Skip to content

Commit 2b54a81

Browse files
authored
fix(init): remove useless await and add @types/react-native (#376)
* fix(init): remove useless await and add @types/react-native to be able to tsc again * fix(init): re-gen lock --------- Co-authored-by: jeremydolle <[email protected]>
1 parent e5d6d89 commit 2b54a81

File tree

4 files changed

+14
-7217
lines changed

4 files changed

+14
-7217
lines changed

template/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,12 @@
3939
"@react-navigation/devtools": "^6.0.19",
4040
"@testing-library/jest-native": "^5.4.2",
4141
"@testing-library/react-native": "^12.1.2",
42+
"@tsconfig/react-native": "^3.0.0",
4243
"@types/jest": "^29.4.0",
4344
"@types/metro-config": "^0.76.3",
4445
"@types/node": "^18.14.1",
45-
"@tsconfig/react-native": "^3.0.0",
4646
"@types/react": "^18.0.24",
47+
"@types/react-native": "^0.72.2",
4748
"@types/react-test-renderer": "^18.0.0",
4849
"babel-jest": "^29.2.1",
4950
"babel-plugin-inline-dotenv": "^1.7.0",
@@ -54,10 +55,10 @@
5455
"jest": "^29.2.1",
5556
"metro-react-native-babel-preset": "0.76.5",
5657
"prettier": "^2.4.1",
57-
"react-test-renderer": "18.2.0",
5858
"react-native-flipper": "^0.202.0",
59+
"react-test-renderer": "18.2.0",
5960
"redux-flipper": "^2.0.2",
60-
"typescript": "4.8.4"
61+
"typescript": "5.2.2"
6162
},
6263
"engines": {
6364
"node": ">=16"

template/plugins/compile-js/plugin.js

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,23 @@ module.exports = {
77
console.log('\n');
88

99
console.log('📦 Loading the build tool...');
10-
await execSync('yarn add -D typescript', { stdio: 'pipe' });
10+
execSync('yarn add -D typescript');
1111

1212
console.log('🧱 Building the javascript source...');
13-
await execSync(
13+
execSync(
1414
'npx tsc --jsx react-native --module ESNext -t esnext --outDir js --noEmit false',
15-
{ stdio: 'pipe' },
1615
);
1716

1817
console.log('🖼️ Copying assets...');
19-
await execSync('cp -R src/theme/assets js/src/theme/assets', {
20-
stdio: 'pipe',
21-
});
18+
execSync('cp -R src/theme/assets js/src/theme/assets');
2219

2320
console.log('♻️ Replacing source...');
24-
await execSync('rm -rf src', { stdio: 'pipe' });
25-
await execSync('cp -R js/src ./src', { stdio: 'pipe' });
26-
await execSync('rm -rf js', { stdio: 'pipe' });
21+
execSync('rm -rf src', { stdio: 'pipe' });
22+
execSync('cp -R js/src ./src', { stdio: 'pipe' });
23+
execSync('rm -rf js', { stdio: 'pipe' });
2724

2825
console.log('💣 Removing typescript dependencies source...');
29-
await execSync(
26+
execSync(
3027
'yarn remove ' +
3128
'@tsconfig/react-native ' +
3229
'@types/jest ' +
@@ -38,8 +35,8 @@ module.exports = {
3835
);
3936

4037
console.log('🌀 Removing types ...');
41-
await execSync('rm -rf @types', { stdio: 'pipe' });
42-
await execSync('rm tsconfig.json', { stdio: 'pipe' });
38+
execSync('rm -rf @types', { stdio: 'pipe' });
39+
execSync('rm tsconfig.json', { stdio: 'pipe' });
4340
}
4441
resolve();
4542
});

template/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@types",
77
"./node_modules/@types"
88
],
9-
"baseUrl": "..",
9+
"baseUrl": "./",
1010
"paths": {
1111
"@/*": ["./src/*"],
1212
"types/*": ["./@types/*"]

0 commit comments

Comments
 (0)