create-lumen 2.0.0-beta.4 → 2.0.0-beta.5
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 +1 -1
- package/src/cleanup.js +3 -1
- package/src/cli-args.js +10 -0
- package/src/main.js +2 -0
- package/src/prompts.js +4 -0
- package/templates/conditional/state/redux/feature-based/src/app/providers/StoreProvider.jsx +2 -0
- package/templates/conditional/state/redux/feature-based/src/app/providers/StoreProvider.tsx +2 -0
- package/templates/conditional/state/redux/type-based/src/providers/StoreProvider.jsx +2 -0
- package/templates/conditional/state/redux/type-based/src/providers/StoreProvider.tsx +2 -0
- /package/templates/conditional/state/zustand/feature-based/src/{stores → shared/stores}/useCounterStore.jsx +0 -0
- /package/templates/conditional/state/zustand/feature-based/src/{stores → shared/stores}/useCounterStore.ts +0 -0
package/package.json
CHANGED
package/src/cleanup.js
CHANGED
|
@@ -35,7 +35,9 @@ export async function cleanupBoilerplate(projectPath, responses = {}) {
|
|
|
35
35
|
await deleteIfExists(`${projectPath}/src/app/App.jsx`);
|
|
36
36
|
await deleteIfExists(`${projectPath}/src/app/hooks`);
|
|
37
37
|
await deleteIfExists(`${projectPath}/src/app/contexts`);
|
|
38
|
-
|
|
38
|
+
if (responses?.stateManagement !== "redux") {
|
|
39
|
+
await deleteIfExists(`${projectPath}/src/app/providers`);
|
|
40
|
+
}
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
}
|
package/src/cli-args.js
CHANGED
|
@@ -299,6 +299,9 @@ export function parseCliArgs(argv = process.argv.slice(2)) {
|
|
|
299
299
|
styling: { type: "string" },
|
|
300
300
|
"css-framework": { type: "string" },
|
|
301
301
|
cssFramework: { type: "string" },
|
|
302
|
+
state: { type: "string", short: "s" },
|
|
303
|
+
"state-management": { type: "string" },
|
|
304
|
+
stateManagement: { type: "string" },
|
|
302
305
|
ui: { type: "string", short: "u" },
|
|
303
306
|
uiKit: { type: "string" },
|
|
304
307
|
"ui-kit": { type: "string" },
|
|
@@ -348,6 +351,11 @@ export function parseCliArgs(argv = process.argv.slice(2)) {
|
|
|
348
351
|
values.cssFramework ||
|
|
349
352
|
null;
|
|
350
353
|
const uiKit = values.ui || values.uiKit || values["ui-kit"] || null;
|
|
354
|
+
let stateManagement = values.state || values["state-management"] || values.stateManagement || null;
|
|
355
|
+
if (stateManagement) {
|
|
356
|
+
stateManagement = stateManagement.trim().toLowerCase();
|
|
357
|
+
if (stateManagement === "rtk" || stateManagement === "reduxtoolkit") stateManagement = "redux";
|
|
358
|
+
}
|
|
351
359
|
const testing = values.testing ? values.testing.trim().toLowerCase() : null;
|
|
352
360
|
const linter = values.linter ? values.linter.trim().toLowerCase() : null;
|
|
353
361
|
const formatter = values.formatter ? values.formatter.trim().toLowerCase() : null;
|
|
@@ -361,6 +369,7 @@ export function parseCliArgs(argv = process.argv.slice(2)) {
|
|
|
361
369
|
arch,
|
|
362
370
|
language,
|
|
363
371
|
cssFramework,
|
|
372
|
+
stateManagement,
|
|
364
373
|
uiKit,
|
|
365
374
|
bundler,
|
|
366
375
|
adapter,
|
|
@@ -487,6 +496,7 @@ ${chalk.bold("OPTIONS")}
|
|
|
487
496
|
${chalk.yellow("-a, --arch")} <name> Architecture preset (feature-based, type-based, none)
|
|
488
497
|
${chalk.yellow("-l, --language")} <lang> Language (ts, js)
|
|
489
498
|
${chalk.yellow("-c, --css")} <framework> Styling engine (tailwind, none)
|
|
499
|
+
${chalk.yellow("-s, --state")} <lib> State management (zustand, redux, none)
|
|
490
500
|
${chalk.yellow("-m, --manifest")} <path> Drive scaffolding from a lumen.config.json or inline JSON
|
|
491
501
|
${chalk.yellow("-t, --template")} <name> Scaffold using a preset (${Object.keys(PRESETS).join(", ")})
|
|
492
502
|
${chalk.yellow("-f, --framework")} <name> Target framework (react, next, react:vite, next:app-router, etc.)
|
package/src/main.js
CHANGED
|
@@ -54,6 +54,7 @@ export async function main(options = {}) {
|
|
|
54
54
|
arch: archArg,
|
|
55
55
|
language: languageArg,
|
|
56
56
|
cssFramework: cssArg,
|
|
57
|
+
stateManagement: stateArg,
|
|
57
58
|
uiKit: uiKitArg,
|
|
58
59
|
database: databaseArg,
|
|
59
60
|
databaseProvider: dbProviderArg,
|
|
@@ -118,6 +119,7 @@ export async function main(options = {}) {
|
|
|
118
119
|
// Overlay explicit CLI flags if provided
|
|
119
120
|
if (languageArg) responses.language = languageArg;
|
|
120
121
|
if (cssArg) responses.cssFramework = cssArg;
|
|
122
|
+
if (stateArg) responses.stateManagement = stateArg;
|
|
121
123
|
if (uiKitArg) responses.uiKit = uiKitArg;
|
|
122
124
|
if (linterArg) responses.linter = linterArg;
|
|
123
125
|
if (formatterArg) responses.formatter = formatterArg;
|
package/src/prompts.js
CHANGED
|
@@ -548,6 +548,10 @@ export async function getUserInputs(
|
|
|
548
548
|
{
|
|
549
549
|
id: "stateManagement",
|
|
550
550
|
message: "Which state management library do you want to use?",
|
|
551
|
+
skip: (ans) => ans.architecture === "none",
|
|
552
|
+
onSkip: (ans) => {
|
|
553
|
+
ans.stateManagement = "none";
|
|
554
|
+
},
|
|
551
555
|
getOptions: () => [
|
|
552
556
|
{ label: "None", value: "none" },
|
|
553
557
|
{ label: "Redux Toolkit", value: "redux" },
|
|
File without changes
|
|
File without changes
|