@@ -23,15 +23,23 @@ import { BaseMiniApp } from './BaseMiniApp';
23
23
import _ from 'lodash' ;
24
24
import { getMetroBlacklistPath } from './getMetroBlacklistPath' ;
25
25
26
- const npmIgnoreContent = `ios/
27
- android/
28
- yarn.lock
29
- .flowconfig
30
- .buckconfig
31
- .gitattributes
26
+ const npmIgnoreContent = `android/
27
+ ios/
32
28
.watchmanconfig
33
29
` ;
34
30
31
+ const filesToRemove = [
32
+ '.bundle/' ,
33
+ 'android/' ,
34
+ 'ios/' ,
35
+ '.buckconfig' ,
36
+ '.flowconfig' ,
37
+ '.node-version' ,
38
+ '.ruby-version' ,
39
+ 'Gemfile' ,
40
+ 'Gemfile.lock' ,
41
+ ] ;
42
+
35
43
export class MiniApp extends BaseMiniApp {
36
44
// Session cache
37
45
public static miniAppFsPathByPackagePath = new Map < string , string > ( ) ;
@@ -205,7 +213,7 @@ You can find instructions to install CocoaPods @ https://cocoapods.org`);
205
213
206
214
// Create .npmignore if it does not exist
207
215
const npmIgnorePath = path . join ( process . cwd ( ) , miniAppName , '.npmignore' ) ;
208
- if ( ! npmIgnorePath ) {
216
+ if ( ! fs . existsSync ( npmIgnorePath ) ) {
209
217
await fs . writeFile ( npmIgnorePath , npmIgnoreContent ) ;
210
218
}
211
219
@@ -281,8 +289,12 @@ module.exports = {
281
289
// Also add ern-navigation dependency to the MiniApp.
282
290
shell . pushd ( miniAppPath ) ;
283
291
try {
284
- shell . rm ( '-rf' , 'android' ) ;
285
- shell . rm ( '-rf' , 'ios' ) ;
292
+ await kax . task ( 'Removing unnecessary files from generated project' ) . run (
293
+ new Promise < void > ( ( resolve ) => {
294
+ filesToRemove . forEach ( ( file ) => shell . rm ( '-rf' , file ) ) ;
295
+ resolve ( ) ;
296
+ } ) ,
297
+ ) ;
286
298
const ernNavigationDependency =
287
299
( await kax
288
300
. task ( 'Querying Manifest for ern-navigation version to use' )
0 commit comments