@highbeek/create-rnstarterkit 1.0.2-beta.11 → 1.0.2-beta.12
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.
|
@@ -21,7 +21,7 @@ async function generateApp(options) {
|
|
|
21
21
|
if (platform === "React Native CLI") {
|
|
22
22
|
await configureCliNativeProjectNames(targetPath, projectName);
|
|
23
23
|
}
|
|
24
|
-
await createStandardStructure(targetPath, platform);
|
|
24
|
+
await createStandardStructure(targetPath, platform, state);
|
|
25
25
|
if (auth) {
|
|
26
26
|
const authFolder = state === "Redux Toolkit"
|
|
27
27
|
? "auth-redux"
|
|
@@ -79,12 +79,10 @@ async function generateApp(options) {
|
|
|
79
79
|
if (husky)
|
|
80
80
|
await configureHusky(targetPath);
|
|
81
81
|
if (typescript) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
});
|
|
87
|
-
}
|
|
82
|
+
// Rename App.js -> App.tsx for projects generated without a .tsx entry point.
|
|
83
|
+
// Both cli-base and expo-base templates already ship App.tsx and correct
|
|
84
|
+
// tsconfigs (extending @react-native/typescript-config / expo/tsconfig.base),
|
|
85
|
+
// so we must NOT overwrite those configs here.
|
|
88
86
|
const appJs = path_1.default.join(targetPath, "App.js");
|
|
89
87
|
const appTsx = path_1.default.join(targetPath, "App.tsx");
|
|
90
88
|
if (await fs_extra_1.default.pathExists(appJs)) {
|
|
@@ -231,7 +229,7 @@ async function ensureCliApiEnvSupport(targetPath) {
|
|
|
231
229
|
},
|
|
232
230
|
});
|
|
233
231
|
}
|
|
234
|
-
async function createStandardStructure(targetPath, platform) {
|
|
232
|
+
async function createStandardStructure(targetPath, platform, state) {
|
|
235
233
|
const commonDirectories = [
|
|
236
234
|
"assets",
|
|
237
235
|
"assets/icons",
|
|
@@ -243,11 +241,14 @@ async function createStandardStructure(targetPath, platform) {
|
|
|
243
241
|
"services",
|
|
244
242
|
"api",
|
|
245
243
|
"config",
|
|
246
|
-
"context",
|
|
247
244
|
"theme",
|
|
248
245
|
"providers",
|
|
249
246
|
"types",
|
|
250
247
|
];
|
|
248
|
+
// Only scaffold a context/ dir when Context API is the chosen state solution
|
|
249
|
+
if (state === "Context API" || state === "None") {
|
|
250
|
+
commonDirectories.push("context");
|
|
251
|
+
}
|
|
251
252
|
const cliOnlyDirectories = ["navigation", "screens"];
|
|
252
253
|
const directories = platform === "Expo"
|
|
253
254
|
? commonDirectories
|
package/package.json
CHANGED