create-velox-app 0.6.70 → 0.6.72

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # create-velox-app
2
2
 
3
+ ## 0.6.72
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(create): prompt for database and package manager when template is passed
8
+
9
+ ## 0.6.71
10
+
11
+ ### Patch Changes
12
+
13
+ - feat(create): add template shorthand flags (--auth, --rsc, etc.) (#20)
14
+
3
15
  ## 0.6.70
4
16
 
5
17
  ### Patch Changes
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
- Templates:
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 my-app --database=postgresql # Use PostgreSQL
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;
package/dist/index.js CHANGED
@@ -175,10 +175,11 @@ async function promptProjectConfig(initialName, initialTemplate, initialDatabase
175
175
  }
176
176
  template = selectedTemplate;
177
177
  }
178
- // Database selection
178
+ // Database selection (prompt unless provided via CLI or running in CI/non-interactive mode)
179
179
  let database = initialDatabase ?? 'sqlite';
180
- // Only show database prompt in interactive mode (when not provided via CLI)
181
- if (!initialDatabase && !initialTemplate) {
180
+ // Only show database prompt if not provided via CLI
181
+ // SKIP_INSTALL is set in smoke tests to skip interactive prompts
182
+ if (!initialDatabase && process.env.SKIP_INSTALL !== 'true') {
182
183
  const databases = getAvailableDatabases();
183
184
  const selectedDatabase = await p.select({
184
185
  message: 'Choose a database',
@@ -198,9 +199,10 @@ async function promptProjectConfig(initialName, initialTemplate, initialDatabase
198
199
  throw new Error(`Database "${database}" is not yet available. Please choose SQLite for now.`);
199
200
  }
200
201
  }
201
- // Package manager selection (only in interactive mode)
202
+ // Package manager selection (prompt unless running in CI/non-interactive mode)
202
203
  let packageManager = detectPackageManager();
203
- if (!initialTemplate) {
204
+ // SKIP_INSTALL is set in smoke tests to skip interactive prompts
205
+ if (process.env.SKIP_INSTALL !== 'true') {
204
206
  const selectedPackageManager = await p.select({
205
207
  message: 'Choose a package manager',
206
208
  initialValue: packageManager,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-velox-app",
3
- "version": "0.6.70",
3
+ "version": "0.6.72",
4
4
  "description": "Project scaffolder for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",