Skip to content

Commit 37604cb

Browse files
Merge pull request #1884 from friederbluemle/update-create-miniapp
2 parents 263a29c + 00163c4 commit 37604cb

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

ern-core/src/MiniApp.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,23 @@ import { BaseMiniApp } from './BaseMiniApp';
2323
import _ from 'lodash';
2424
import { getMetroBlacklistPath } from './getMetroBlacklistPath';
2525

26-
const npmIgnoreContent = `ios/
27-
android/
28-
yarn.lock
29-
.flowconfig
30-
.buckconfig
31-
.gitattributes
26+
const npmIgnoreContent = `android/
27+
ios/
3228
.watchmanconfig
3329
`;
3430

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+
3543
export class MiniApp extends BaseMiniApp {
3644
// Session cache
3745
public static miniAppFsPathByPackagePath = new Map<string, string>();
@@ -205,7 +213,7 @@ You can find instructions to install CocoaPods @ https://cocoapods.org`);
205213

206214
// Create .npmignore if it does not exist
207215
const npmIgnorePath = path.join(process.cwd(), miniAppName, '.npmignore');
208-
if (!npmIgnorePath) {
216+
if (!fs.existsSync(npmIgnorePath)) {
209217
await fs.writeFile(npmIgnorePath, npmIgnoreContent);
210218
}
211219

@@ -281,8 +289,12 @@ module.exports = {
281289
// Also add ern-navigation dependency to the MiniApp.
282290
shell.pushd(miniAppPath);
283291
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+
);
286298
const ernNavigationDependency =
287299
(await kax
288300
.task('Querying Manifest for ern-navigation version to use')

0 commit comments

Comments
 (0)