create-cwa 2.0.0-alpha.2 → 2.0.0-alpha.21

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/dist/index.js CHANGED
@@ -182,7 +182,16 @@ Sample content is bundled. Load it after the API container is healthy:
182
182
  docker compose exec php bin/console doctrine:fixtures:load --append
183
183
  \`\`\`
184
184
  `
185
- : '';
185
+ : `## Admin account
186
+
187
+ No sample content is bundled. Create the admin (\`ADMIN_USERNAME\` / \`ADMIN_PASSWORD\` / \`ADMIN_EMAIL\`, default \`admin\` / \`admin\`) once the API container is healthy:
188
+
189
+ \`\`\`bash
190
+ docker compose exec php bin/console doctrine:fixtures:load --append
191
+ \`\`\`
192
+
193
+ Or create one by hand: \`docker compose exec php bin/console silverback:api-components:user:create --admin\`.
194
+ `;
186
195
  const readme = `# ${answers.projectName}
187
196
 
188
197
  A [CWA](https://github.com/components-web-app/components-web-app) project.
@@ -264,7 +273,8 @@ async function main() {
264
273
  }
265
274
  }
266
275
  if (!answers.fixtures) {
267
- await removeExcluded(tempDir, ['api/src/DataFixtures/Parts/']);
276
+ // Sample content only: UsersFixture stays, so the admin is still created from ADMIN_* (#142).
277
+ await removeExcluded(tempDir, ['api/src/DataFixtures/AppScaffold.php', 'api/src/DataFixtures/Parts/']);
268
278
  }
269
279
  await processNuxtConfig(tempDir, answers.features);
270
280
  await replaceProjectName(tempDir, answers.projectName);
@@ -338,6 +348,11 @@ async function main() {
338
348
  outroLines.push('Load sample content (once the API container is healthy):');
339
349
  outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load --append');
340
350
  }
351
+ else {
352
+ outroLines.push('');
353
+ outroLines.push('Create the admin from ADMIN_* (once the API container is healthy):');
354
+ outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load --append');
355
+ }
341
356
  outro(outroLines.join('\n'));
342
357
  }
343
358
  main().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cwa",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.21",
4
4
  "description": "Create a new CWA (Components Web App) project",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -236,7 +236,16 @@ Sample content is bundled. Load it after the API container is healthy:
236
236
  docker compose exec php bin/console doctrine:fixtures:load --append
237
237
  \`\`\`
238
238
  `
239
- : ''
239
+ : `## Admin account
240
+
241
+ No sample content is bundled. Create the admin (\`ADMIN_USERNAME\` / \`ADMIN_PASSWORD\` / \`ADMIN_EMAIL\`, default \`admin\` / \`admin\`) once the API container is healthy:
242
+
243
+ \`\`\`bash
244
+ docker compose exec php bin/console doctrine:fixtures:load --append
245
+ \`\`\`
246
+
247
+ Or create one by hand: \`docker compose exec php bin/console silverback:api-components:user:create --admin\`.
248
+ `
240
249
 
241
250
  const readme = `# ${answers.projectName}
242
251
 
@@ -329,7 +338,8 @@ async function main(): Promise<void> {
329
338
  }
330
339
 
331
340
  if (!answers.fixtures) {
332
- await removeExcluded(tempDir, ['api/src/DataFixtures/Parts/'])
341
+ // Sample content only: UsersFixture stays, so the admin is still created from ADMIN_* (#142).
342
+ await removeExcluded(tempDir, ['api/src/DataFixtures/AppScaffold.php', 'api/src/DataFixtures/Parts/'])
333
343
  }
334
344
 
335
345
  await processNuxtConfig(tempDir, answers.features)
@@ -415,6 +425,10 @@ async function main(): Promise<void> {
415
425
  outroLines.push('')
416
426
  outroLines.push('Load sample content (once the API container is healthy):')
417
427
  outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load --append')
428
+ } else {
429
+ outroLines.push('')
430
+ outroLines.push('Create the admin from ADMIN_* (once the API container is healthy):')
431
+ outroLines.push(' docker compose exec php bin/console doctrine:fixtures:load --append')
418
432
  }
419
433
 
420
434
  outro(outroLines.join('\n'))
package/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- dist/
2
- node_modules/