expo-template-default 51.0.1 → 51.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/scripts/reset-project.js +12 -11
package/package.json
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-template-default",
|
|
3
3
|
"main": "expo-router/entry",
|
|
4
|
-
"version": "51.0.
|
|
4
|
+
"version": "51.0.3",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "expo start",
|
|
7
7
|
"reset-project": "./scripts/reset-project.js",
|
|
8
8
|
"android": "expo start --android",
|
|
9
9
|
"ios": "expo start --ios",
|
|
10
10
|
"web": "expo start --web",
|
|
11
|
-
"test": "jest --watchAll"
|
|
11
|
+
"test": "jest --watchAll",
|
|
12
|
+
"lint": "expo lint"
|
|
12
13
|
},
|
|
13
14
|
"jest": {
|
|
14
15
|
"preset": "jest-expo"
|
|
15
16
|
},
|
|
16
17
|
"dependencies": {
|
|
17
18
|
"@expo/vector-icons": "^14.0.0",
|
|
18
|
-
"@react-navigation/drawer": "^6.6.6",
|
|
19
19
|
"@react-navigation/native": "^6.0.2",
|
|
20
|
-
"expo": "~51.0.0-
|
|
20
|
+
"expo": "~51.0.0-preview.0",
|
|
21
21
|
"expo-font": "~12.0.0",
|
|
22
22
|
"expo-linking": "~6.3.0",
|
|
23
23
|
"expo-router": "~3.5.0",
|
package/scripts/reset-project.js
CHANGED
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
* You can remove the `reset-project` script from package.json and safely delete this file after running it.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
const fs = require(
|
|
10
|
-
const path = require(
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const path = require('path');
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
12
|
+
const root = process.cwd();
|
|
13
|
+
const oldDirPath = path.join(root, 'app');
|
|
14
|
+
const newDirPath = path.join(root, 'app-example');
|
|
15
|
+
const newAppDirPath = path.join(root, 'app');
|
|
15
16
|
|
|
16
17
|
const indexContent = `import { Text, View } from "react-native";
|
|
17
18
|
|
|
@@ -45,27 +46,27 @@ fs.rename(oldDirPath, newDirPath, (error) => {
|
|
|
45
46
|
if (error) {
|
|
46
47
|
return console.error(`Error renaming directory: ${error}`);
|
|
47
48
|
}
|
|
48
|
-
console.log(
|
|
49
|
+
console.log('/app moved to /app-example.');
|
|
49
50
|
|
|
50
51
|
fs.mkdir(newAppDirPath, { recursive: true }, (error) => {
|
|
51
52
|
if (error) {
|
|
52
53
|
return console.error(`Error creating new app directory: ${error}`);
|
|
53
54
|
}
|
|
54
|
-
console.log(
|
|
55
|
+
console.log('New /app directory created.');
|
|
55
56
|
|
|
56
|
-
const indexPath = path.join(newAppDirPath,
|
|
57
|
+
const indexPath = path.join(newAppDirPath, 'index.tsx');
|
|
57
58
|
fs.writeFile(indexPath, indexContent, (error) => {
|
|
58
59
|
if (error) {
|
|
59
60
|
return console.error(`Error creating index.tsx: ${error}`);
|
|
60
61
|
}
|
|
61
|
-
console.log(
|
|
62
|
+
console.log('app/index.tsx created.');
|
|
62
63
|
|
|
63
|
-
const layoutPath = path.join(newAppDirPath,
|
|
64
|
+
const layoutPath = path.join(newAppDirPath, '_layout.tsx');
|
|
64
65
|
fs.writeFile(layoutPath, layoutContent, (error) => {
|
|
65
66
|
if (error) {
|
|
66
67
|
return console.error(`Error creating _layout.tsx: ${error}`);
|
|
67
68
|
}
|
|
68
|
-
console.log(
|
|
69
|
+
console.log('app/_layout.tsx created.');
|
|
69
70
|
});
|
|
70
71
|
});
|
|
71
72
|
});
|