create-velox-app 0.6.70 → 0.6.71
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/CHANGELOG.md +6 -0
- package/dist/cli.js +35 -13
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cli.js
CHANGED
|
@@ -42,28 +42,36 @@ Options:
|
|
|
42
42
|
-h, --help Show this help message
|
|
43
43
|
-v, --version Show version number
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
spa ${TEMPLATE_METADATA.spa.description}
|
|
47
|
-
auth ${TEMPLATE_METADATA.auth.description}
|
|
48
|
-
trpc ${TEMPLATE_METADATA.trpc.description}
|
|
49
|
-
rsc ${TEMPLATE_METADATA.rsc.description}
|
|
50
|
-
rsc-auth ${TEMPLATE_METADATA['rsc-auth'].description}
|
|
45
|
+
Template Shortcuts:
|
|
46
|
+
--spa ${TEMPLATE_METADATA.spa.description}
|
|
47
|
+
--auth ${TEMPLATE_METADATA.auth.description}
|
|
48
|
+
--trpc ${TEMPLATE_METADATA.trpc.description}
|
|
49
|
+
--rsc ${TEMPLATE_METADATA.rsc.description}
|
|
50
|
+
--rsc-auth ${TEMPLATE_METADATA['rsc-auth'].description}
|
|
51
|
+
--default Alias for --spa
|
|
52
|
+
--fullstack Alias for --rsc
|
|
51
53
|
|
|
52
54
|
Databases:
|
|
53
55
|
sqlite ${DATABASE_METADATA.sqlite.hint}
|
|
54
56
|
postgresql ${DATABASE_METADATA.postgresql.hint}
|
|
55
57
|
|
|
56
|
-
Aliases:
|
|
57
|
-
default → spa (backward compatible)
|
|
58
|
-
fullstack → rsc (backward compatible)
|
|
59
|
-
|
|
60
58
|
Examples:
|
|
61
59
|
npx create-velox-app my-app # Interactive mode
|
|
60
|
+
npx create-velox-app my-app --auth # Auth template (shortcut)
|
|
61
|
+
npx create-velox-app my-app --rsc -d postgresql # RSC with PostgreSQL
|
|
62
62
|
npx create-velox-app my-app --template=spa # SPA + API template
|
|
63
|
-
npx create-velox-app
|
|
64
|
-
npx create-velox-app my-app -t rsc -d postgresql # RSC with PostgreSQL
|
|
65
|
-
npx create-velox-app # Prompt for name
|
|
63
|
+
npx create-velox-app # Prompt for all options
|
|
66
64
|
`;
|
|
65
|
+
/** Template shorthand flags (--auth, --spa, etc.) */
|
|
66
|
+
const TEMPLATE_FLAGS = new Set([
|
|
67
|
+
'--spa',
|
|
68
|
+
'--auth',
|
|
69
|
+
'--trpc',
|
|
70
|
+
'--rsc',
|
|
71
|
+
'--rsc-auth',
|
|
72
|
+
'--default', // alias for spa
|
|
73
|
+
'--fullstack', // alias for rsc
|
|
74
|
+
]);
|
|
67
75
|
/** @internal Exported for testing */
|
|
68
76
|
export function parseArgs(args) {
|
|
69
77
|
const result = {
|
|
@@ -80,6 +88,20 @@ export function parseArgs(args) {
|
|
|
80
88
|
result.help = true;
|
|
81
89
|
continue;
|
|
82
90
|
}
|
|
91
|
+
// Handle template shorthand flags (--auth, --spa, --rsc, etc.)
|
|
92
|
+
if (TEMPLATE_FLAGS.has(arg)) {
|
|
93
|
+
if (templateFlagSeen) {
|
|
94
|
+
console.error('Error: Template specified multiple times');
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
97
|
+
templateFlagSeen = true;
|
|
98
|
+
const templateName = arg.slice(2); // Remove '--' prefix
|
|
99
|
+
const resolved = resolveTemplateAlias(templateName);
|
|
100
|
+
if (resolved) {
|
|
101
|
+
result.template = resolved;
|
|
102
|
+
}
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
83
105
|
// Handle --version / -v
|
|
84
106
|
if (arg === '-v' || arg === '--version') {
|
|
85
107
|
result.version = true;
|