Skip to content

Commit 6c8c4bd

Browse files
committed
fix(template): just move instead of copy template
Plus remove already obsolete concurrently dependency. release-npm
1 parent 229c706 commit 6c8c4bd

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

template/create-app.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
#!/usr/bin/env node
2+
import { copyFileSync, renameSync, rmSync } from 'fs'
23
import { join } from 'path'
34
import { execSync } from 'child_process'
4-
import copy from 'recursive-copy'
5-
import rimraf from 'rimraf'
65

7-
// Enhances source files inside /app with a fresh RN project template.
6+
// This script enhances source files inside /app with a fresh React Native template.
87
const appName = '<%= pascal %>App'
98

109
console.log('⌛ Initializing a fresh RN project...')
@@ -14,15 +13,11 @@ execSync(`npx react-native init ${appName}`, {
1413
stdio: 'inherit',
1514
})
1615

17-
// Copy to destination directory, leaving source files untouched.
18-
await copy(appName, 'app', {
19-
dot: true,
20-
overwrite: false,
21-
filter: ['**/*', '!App.js'],
22-
})
16+
copyFileSync('app/App.js', `${appName}/App.js`)
17+
18+
rmSync('app', { recursive: true })
2319

24-
// Remove temporary project directory.
25-
rimraf.sync(appName)
20+
renameSync(appName, 'app')
2621

2722
// Install this package locally, avoiding symlinks.
2823
execSync('npm install $(npm pack .. | tail -1) --legacy-peer-deps', {

template/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"@typescript-eslint/eslint-plugin": "^5.30.5",
3737
"@typescript-eslint/parser": "^5.30.5",
3838
"babel-jest": "^28.1.2",
39-
"concurrently": "^7.2.2",
4039
"cpx": "^1.5.0",
4140
"esbuild": "^0.14.48",
4241
"eslint": "^8.19.0",
@@ -48,8 +47,6 @@
4847
"react": "^18.2.0",
4948
"react-native": "^0.69.1",
5049
"react-test-renderer": "^18.2.0",
51-
"recursive-copy": "^2.0.14",
52-
"rimraf": "^3.0.2",
5350
"typescript": "^4.7.4"
5451
},
5552
"files": [

0 commit comments

Comments
 (0)