Skip to content

Commit ecf6800

Browse files
committed
fix(app): update app and fix installation
1 parent 1a8e8ee commit ecf6800

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ if (existsSync(name.regular)) {
3232

3333
mkdirSync(name.regular)
3434

35-
const npmPackagePath = dirname(import.meta.url)
35+
const npmPackagePath = dirname(new URL(import.meta.url).pathname)
3636

3737
const templateDirectory = join(npmPackagePath, 'template')
3838
const destinationDirectory = join(process.cwd(), name.regular)
@@ -43,7 +43,10 @@ customize(name, destinationDirectory)
4343

4444
console.log('Installing dependencies...')
4545

46-
execSync('npm i', { cwd: destinationDirectory, stdio: 'pipe' })
46+
execSync('npm install --legacy-peer-deps', {
47+
cwd: destinationDirectory,
48+
stdio: 'pipe',
49+
})
4750

4851
console.log('')
4952
console.log(

template/create-app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ console.log('')
3434
console.log('🍞 React Native App created inside /app.')
3535
console.log('🛠️ To run the example with the plugin included:')
3636
console.log('🐚 cd app')
37-
console.log('🐚 react-native run-ios / react-native run-android')
37+
console.log('🐚 npm run ios / npm run android')
3838
console.log('🌪️ To copy over the changes from the plugin source run:')
3939
console.log('🐚 npm run watch')
4040
console.log('🛠️ This will copy changes over to the app.')

template/package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,31 @@
33
"version": "1.0.0",
44
"license": "MIT",
55
"main": "src/index.js",
6+
"type": "module",
67
"scripts": {
78
"app": "node create-app.js",
89
"watch": "cpx 'src/**/*' app/node_modules/<%= name %>/src --watch",
910
"test": "jest --watchAll",
1011
"lint": "eslint ./src --fix",
1112
"format": "prettier \"src/**/*\" --write"
1213
},
14+
"dependencies": {
15+
"@babel/core": "^7.13.14",
16+
"@babel/node": "^7.13.13",
17+
"@babel/preset-env": "^7.13.12",
18+
"@react-native-community/eslint-config": "2.0.0",
19+
"babel-jest": "^26.6.3",
20+
"cpx": "^1.5.0",
21+
"eslint": "^7.23.0",
22+
"jest": "^26.6.3",
23+
"metro-react-native-babel-preset": "^0.65.2",
24+
"prettier": "^2.2.1",
25+
"react": "^17.0.2",
26+
"react-native": "^0.64.0",
27+
"react-test-renderer": "^17.0.2",
28+
"recursive-copy": "^2.0.11",
29+
"rimraf": "^3.0.2"
30+
},
1331
"prettier": {
1432
"singleQuote": true,
1533
"semi": false
@@ -29,23 +47,6 @@
2947
"files": [
3048
"src"
3149
],
32-
"devDependencies": {
33-
"@babel/core": "^7.7.5",
34-
"@babel/node": "^7.7.4",
35-
"@babel/preset-env": "^7.7.6",
36-
"@react-native-community/eslint-config": "0.0.5",
37-
"babel-jest": "^24.9.0",
38-
"cpx": "^1.5.0",
39-
"eslint": "^6.7.2",
40-
"jest": "^24.9.0",
41-
"metro-react-native-babel-preset": "^0.57.0",
42-
"prettier": "^1.19.1",
43-
"react": "^16.12.0",
44-
"react-native": "^0.61.5",
45-
"react-test-renderer": "^16.12.0",
46-
"recursive-copy": "^2.0.10",
47-
"rimraf": "^3.0.0"
48-
},
4950
"engines": {
5051
"node": ">= 14"
5152
}

0 commit comments

Comments
 (0)