expo-template-default 58.0.9 → 58.0.11
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 +12 -12
- package/scripts/reset-project.js +31 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-template-default",
|
|
3
|
-
"version": "58.0.
|
|
3
|
+
"version": "58.0.11",
|
|
4
4
|
"license": "0BSD",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,20 +9,20 @@
|
|
|
9
9
|
},
|
|
10
10
|
"main": "expo-router/entry",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@expo/ui": "~58.0.
|
|
13
|
-
"expo": "~58.0.
|
|
12
|
+
"@expo/ui": "~58.0.11",
|
|
13
|
+
"expo": "~58.0.2",
|
|
14
14
|
"expo-constants": "~58.0.9",
|
|
15
|
-
"expo-device": "~58.0.
|
|
16
|
-
"expo-font": "~58.0.
|
|
15
|
+
"expo-device": "~58.0.5",
|
|
16
|
+
"expo-font": "~58.0.5",
|
|
17
17
|
"expo-glass-effect": "~58.0.3",
|
|
18
|
-
"expo-image": "~58.0.
|
|
19
|
-
"expo-linking": "~58.0.
|
|
20
|
-
"expo-router": "~58.0.
|
|
21
|
-
"expo-splash-screen": "~58.0.
|
|
22
|
-
"expo-status-bar": "~58.0.
|
|
18
|
+
"expo-image": "~58.0.10",
|
|
19
|
+
"expo-linking": "~58.0.10",
|
|
20
|
+
"expo-router": "~58.0.12",
|
|
21
|
+
"expo-splash-screen": "~58.0.4",
|
|
22
|
+
"expo-status-bar": "~58.0.3",
|
|
23
23
|
"expo-symbols": "~58.0.3",
|
|
24
|
-
"expo-system-ui": "~58.0.
|
|
25
|
-
"expo-web-browser": "~58.0.
|
|
24
|
+
"expo-system-ui": "~58.0.5",
|
|
25
|
+
"expo-web-browser": "~58.0.4",
|
|
26
26
|
"react": "19.3.0",
|
|
27
27
|
"react-dom": "19.3.0",
|
|
28
28
|
"react-native": "0.88.0-rc.3",
|
package/scripts/reset-project.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* This script is used to reset the project to a blank state.
|
|
5
5
|
* It deletes or moves the /src and /scripts directories to /example based on user input and creates a new /src/app directory with an index.tsx and _layout.tsx file.
|
|
6
|
+
* Demo images in /assets/images are deleted or moved along with them.
|
|
6
7
|
* You can remove the `reset-project` script from package.json and safely delete this file after running it.
|
|
7
8
|
*/
|
|
8
9
|
|
|
@@ -15,6 +16,18 @@ const oldDirs = ["src", "scripts"];
|
|
|
15
16
|
const exampleDir = "example";
|
|
16
17
|
const newAppDir = "src/app";
|
|
17
18
|
const exampleDirPath = path.join(root, exampleDir);
|
|
19
|
+
// Demo images and folders used only by the files in /src
|
|
20
|
+
const exampleAssets = [
|
|
21
|
+
"expo-badge.png",
|
|
22
|
+
"expo-badge-white.png",
|
|
23
|
+
"expo-logo.png",
|
|
24
|
+
"logo-glow.png",
|
|
25
|
+
"react-logo.png",
|
|
26
|
+
"react-logo@2x.png",
|
|
27
|
+
"react-logo@3x.png",
|
|
28
|
+
"tutorial-web.png",
|
|
29
|
+
"tabIcons",
|
|
30
|
+
];
|
|
18
31
|
|
|
19
32
|
const indexContent = `import { Text, View, StyleSheet } from "react-native";
|
|
20
33
|
|
|
@@ -52,6 +65,7 @@ const moveDirectories = async (userInput) => {
|
|
|
52
65
|
if (userInput === "y") {
|
|
53
66
|
// Create the app-example directory
|
|
54
67
|
await fs.promises.mkdir(exampleDirPath, { recursive: true });
|
|
68
|
+
await fs.promises.mkdir(path.join(exampleDirPath, "assets/images"), { recursive: true });
|
|
55
69
|
console.log(`📁 /${exampleDir} directory created.`);
|
|
56
70
|
}
|
|
57
71
|
|
|
@@ -72,6 +86,23 @@ const moveDirectories = async (userInput) => {
|
|
|
72
86
|
}
|
|
73
87
|
}
|
|
74
88
|
|
|
89
|
+
// Move demo assets to /example or delete them
|
|
90
|
+
for (const asset of exampleAssets) {
|
|
91
|
+
const assetPath = path.join(root, "assets/images", asset);
|
|
92
|
+
if (fs.existsSync(assetPath)) {
|
|
93
|
+
if (userInput === "y") {
|
|
94
|
+
const newAssetPath = path.join(exampleDirPath, "assets/images", asset);
|
|
95
|
+
await fs.promises.rename(assetPath, newAssetPath);
|
|
96
|
+
console.log(
|
|
97
|
+
`➡️ /assets/images/${asset} moved to /${exampleDir}/assets/images/${asset}.`
|
|
98
|
+
);
|
|
99
|
+
} else {
|
|
100
|
+
await fs.promises.rm(assetPath, { recursive: true, force: true });
|
|
101
|
+
console.log(`❌ /assets/images/${asset} deleted.`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
75
106
|
// Create new /src/app directory
|
|
76
107
|
const newAppDirPath = path.join(root, newAppDir);
|
|
77
108
|
await fs.promises.mkdir(newAppDirPath, { recursive: true });
|