create-cwa 0.1.0 → 0.1.1

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/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ dist/
2
+ node_modules/
package/dist/index.js CHANGED
@@ -151,7 +151,7 @@ async function generateReadme(tempDir, answers) {
151
151
  Sample content is bundled. Load it after the API container is healthy:
152
152
 
153
153
  \`\`\`bash
154
- docker compose exec php bin/console doctrine:fixtures:load
154
+ docker compose exec php bin/console doctrine:fixtures:load --append
155
155
  \`\`\`
156
156
  `
157
157
  : '';
@@ -166,25 +166,27 @@ ${featureList}
166
166
  ## Getting started
167
167
 
168
168
  \`\`\`bash
169
- # 1. Start the stack
170
- # composer install, database wait, and migrations all run automatically
169
+ # Start the stack. The php container runs composer install, waits for the
170
+ # database and migrates; the app container installs the Nuxt dependencies and
171
+ # runs the dev server. There is nothing to start by hand.
171
172
  docker compose up -d
172
173
 
173
- # 2. Install Nuxt app dependencies (run locally, not inside Docker)
174
- cd app
175
- pnpm install
176
-
177
- # 3. Start the dev server
178
- pnpm dev
174
+ # Follow the Nuxt dev server
175
+ docker compose logs -f app
179
176
  \`\`\`
180
177
 
178
+ \`app/\` is mounted into the app container, so its \`node_modules\` is shared. Run
179
+ \`pnpm install\` in \`app/\` yourself only if your editor needs the types locally.
180
+
181
181
  | URL | Description |
182
182
  |---|---|
183
183
  | https://localhost | Nuxt app |
184
184
  | https://localhost/_api | API (JSON-LD / HAL) |
185
- | https://localhost/admin | CWA admin panel |
185
+ | https://localhost/login | Sign in to the CWA admin |
186
186
 
187
- > **SSL:** The dev stack uses self-signed certs. Accept the browser warning or trust the CA at \`api/frankenphp/caddy/certs/\`.
187
+ > **SSL:** Caddy issues local certificates from its own CA. Accept the browser warning, or trust the CA once:
188
+ > \`docker compose cp php:/data/caddy/pki/authorities/local/root.crt caddy-local-root.crt\`,
189
+ > then add \`caddy-local-root.crt\` to your system or browser trust store.
188
190
 
189
191
  ${fixturesSection}
190
192
  ${ciSection}## Learn more
@@ -252,7 +254,8 @@ async function main() {
252
254
  ' • waits for PostgreSQL to be ready',
253
255
  ' • runs database migrations',
254
256
  '',
255
- 'You only need to run pnpm install and pnpm dev locally.',
257
+ 'The app container installs the Nuxt dependencies and runs the dev server,',
258
+ 'so there is nothing to start by hand.',
256
259
  answers.fixtures
257
260
  ? '\nFixtures are NOT loaded automatically — you will be reminded below.'
258
261
  : '',
@@ -267,7 +270,7 @@ async function main() {
267
270
  log.step('Running: docker compose up -d');
268
271
  const ok = run('docker', ['compose', 'up', '-d'], targetDir);
269
272
  if (!ok) {
270
- log.warn('docker compose up -d failed. Start it manually before running pnpm dev.');
273
+ log.warn('docker compose up -d failed. Run it manually from the project directory.');
271
274
  }
272
275
  }
273
276
  }
@@ -278,8 +281,8 @@ async function main() {
278
281
  const hasPnpm = commandExists('pnpm');
279
282
  if (hasPnpm) {
280
283
  const installDeps = checkCancel(await confirm({
281
- message: 'Install Nuxt app dependencies now? (pnpm install in app/)',
282
- initialValue: true,
284
+ message: 'Also install app/ dependencies on this machine, for editor type support? (the app container installs them either way)',
285
+ initialValue: false,
283
286
  }));
284
287
  if (installDeps) {
285
288
  log.step('Running: pnpm install');
@@ -293,18 +296,18 @@ async function main() {
293
296
  log.warn('pnpm not found — run: npm i -g pnpm, then pnpm install inside app/');
294
297
  }
295
298
  const outroLines = [
296
- `Start the dev server:`,
297
- ` cd ${answers.projectName}/app && pnpm dev`,
299
+ `The dev server runs in the app container. Follow it with:`,
300
+ ` cd ${answers.projectName} && docker compose logs -f app`,
298
301
  '',
299
302
  'Then visit:',
300
303
  ' https://localhost — app',
301
304
  ' https://localhost/_api — API',
302
- ' https://localhost/admin — admin panel',
305
+ ' https://localhost/login — sign in to the admin',
303
306
  ];
304
307
  if (answers.fixtures) {
305
308
  outroLines.push('');
306
309
  outroLines.push('Load sample content (once the API container is healthy):');
307
- outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load');
310
+ outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load --append');
308
311
  }
309
312
  outro(outroLines.join('\n'));
310
313
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cwa",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Create a new CWA (Components Web App) project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  "directory": "packages/create-cwa"
22
22
  },
23
23
  "engines": {
24
- "node": ">=18.0.0"
24
+ "node": ">=22.13.0"
25
25
  },
26
26
  "dependencies": {
27
27
  "@clack/prompts": "^0.9.0",
package/src/index.ts CHANGED
@@ -206,7 +206,7 @@ async function generateReadme(tempDir: string, answers: Answers): Promise<void>
206
206
  Sample content is bundled. Load it after the API container is healthy:
207
207
 
208
208
  \`\`\`bash
209
- docker compose exec php bin/console doctrine:fixtures:load
209
+ docker compose exec php bin/console doctrine:fixtures:load --append
210
210
  \`\`\`
211
211
  `
212
212
  : ''
@@ -222,25 +222,27 @@ ${featureList}
222
222
  ## Getting started
223
223
 
224
224
  \`\`\`bash
225
- # 1. Start the stack
226
- # composer install, database wait, and migrations all run automatically
225
+ # Start the stack. The php container runs composer install, waits for the
226
+ # database and migrates; the app container installs the Nuxt dependencies and
227
+ # runs the dev server. There is nothing to start by hand.
227
228
  docker compose up -d
228
229
 
229
- # 2. Install Nuxt app dependencies (run locally, not inside Docker)
230
- cd app
231
- pnpm install
232
-
233
- # 3. Start the dev server
234
- pnpm dev
230
+ # Follow the Nuxt dev server
231
+ docker compose logs -f app
235
232
  \`\`\`
236
233
 
234
+ \`app/\` is mounted into the app container, so its \`node_modules\` is shared. Run
235
+ \`pnpm install\` in \`app/\` yourself only if your editor needs the types locally.
236
+
237
237
  | URL | Description |
238
238
  |---|---|
239
239
  | https://localhost | Nuxt app |
240
240
  | https://localhost/_api | API (JSON-LD / HAL) |
241
- | https://localhost/admin | CWA admin panel |
241
+ | https://localhost/login | Sign in to the CWA admin |
242
242
 
243
- > **SSL:** The dev stack uses self-signed certs. Accept the browser warning or trust the CA at \`api/frankenphp/caddy/certs/\`.
243
+ > **SSL:** Caddy issues local certificates from its own CA. Accept the browser warning, or trust the CA once:
244
+ > \`docker compose cp php:/data/caddy/pki/authorities/local/root.crt caddy-local-root.crt\`,
245
+ > then add \`caddy-local-root.crt\` to your system or browser trust store.
244
246
 
245
247
  ${fixturesSection}
246
248
  ${ciSection}## Learn more
@@ -321,7 +323,8 @@ async function main(): Promise<void> {
321
323
  ' • waits for PostgreSQL to be ready',
322
324
  ' • runs database migrations',
323
325
  '',
324
- 'You only need to run pnpm install and pnpm dev locally.',
326
+ 'The app container installs the Nuxt dependencies and runs the dev server,',
327
+ 'so there is nothing to start by hand.',
325
328
  answers.fixtures
326
329
  ? '\nFixtures are NOT loaded automatically — you will be reminded below.'
327
330
  : '',
@@ -342,7 +345,7 @@ async function main(): Promise<void> {
342
345
  log.step('Running: docker compose up -d')
343
346
  const ok = run('docker', ['compose', 'up', '-d'], targetDir)
344
347
  if (!ok) {
345
- log.warn('docker compose up -d failed. Start it manually before running pnpm dev.')
348
+ log.warn('docker compose up -d failed. Run it manually from the project directory.')
346
349
  }
347
350
  }
348
351
  } else {
@@ -354,8 +357,8 @@ async function main(): Promise<void> {
354
357
  if (hasPnpm) {
355
358
  const installDeps = checkCancel(
356
359
  await confirm({
357
- message: 'Install Nuxt app dependencies now? (pnpm install in app/)',
358
- initialValue: true,
360
+ message: 'Also install app/ dependencies on this machine, for editor type support? (the app container installs them either way)',
361
+ initialValue: false,
359
362
  })
360
363
  ) as boolean
361
364
 
@@ -371,19 +374,19 @@ async function main(): Promise<void> {
371
374
  }
372
375
 
373
376
  const outroLines = [
374
- `Start the dev server:`,
375
- ` cd ${answers.projectName}/app && pnpm dev`,
377
+ `The dev server runs in the app container. Follow it with:`,
378
+ ` cd ${answers.projectName} && docker compose logs -f app`,
376
379
  '',
377
380
  'Then visit:',
378
381
  ' https://localhost — app',
379
382
  ' https://localhost/_api — API',
380
- ' https://localhost/admin — admin panel',
383
+ ' https://localhost/login — sign in to the admin',
381
384
  ]
382
385
 
383
386
  if (answers.fixtures) {
384
387
  outroLines.push('')
385
388
  outroLines.push('Load sample content (once the API container is healthy):')
386
- outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load')
389
+ outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load --append')
387
390
  }
388
391
 
389
392
  outro(outroLines.join('\n'))
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/types.d.ts DELETED
@@ -1,36 +0,0 @@
1
- export interface ManifestChoice {
2
- value: string;
3
- label: string;
4
- requires?: string[];
5
- }
6
- export interface ManifestQuestion {
7
- id: string;
8
- type: 'text' | 'select' | 'multiselect' | 'confirm';
9
- message: string;
10
- placeholder?: string;
11
- hint?: string;
12
- default?: boolean;
13
- choices?: ManifestChoice[];
14
- }
15
- export interface ManifestFeature {
16
- requires?: string[];
17
- exclude: string[];
18
- }
19
- export interface ManifestCi {
20
- exclude: string[];
21
- }
22
- export interface Manifest {
23
- version: string;
24
- repo: string;
25
- branch: string;
26
- alwaysExclude: string[];
27
- questions: ManifestQuestion[];
28
- features: Record<string, ManifestFeature>;
29
- ci: Record<string, ManifestCi>;
30
- }
31
- export interface Answers {
32
- projectName: string;
33
- ci: string;
34
- features: string[];
35
- fixtures: boolean;
36
- }
package/dist/types.js DELETED
@@ -1 +0,0 @@
1
- export {};