@domain-first/project-structure 2.14.0 → 2.14.2

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/README.md CHANGED
@@ -201,7 +201,7 @@ Enable `useReact` and choose **Scaffold React module** from the main menu. Modul
201
201
  | New UI-kit component | `ui-kit/<name>/<name>.tsx` with a typed props object and a component, re-exported from `index.ts`; with `storybookFramework`, also `<name>.stories.tsx`. |
202
202
  | New shared hook | `hooks/use-<name>.ts` with an app-wide hook, such as `use-debounce`; a leading `use-` in the name is not repeated. |
203
203
 
204
- Page and widget names can include folders split by `/`. For example, a page named `admin/panel/users` is created at `pages/admin/panel/users-page.tsx` as `AdminPanelUsersPage`, and a widget with the same name at `widgets/admin/panel/users/` as `AdminPanelUsersWidget` with the story title `Widgets/Admin/Panel/Users`. File names use only the last segment; code names use the whole path.
204
+ Page and widget names can include folders split by `/`. For example, a page named `admin/panel/users` is created at `pages/admin/panel/admin-panel-users-page.tsx` as `AdminPanelUsersPage`, and a widget with the same name at `widgets/admin/panel/users/admin-panel-users-widget.tsx` as `AdminPanelUsersWidget` with the story title `Widgets/Admin/Panel/Users`. The widget folder uses only the last segment; file names and code names use the whole path.
205
205
 
206
206
  ### Project integrations
207
207
 
@@ -229,8 +229,8 @@ name. Identical generated configs and scripts are skipped on subsequent runs;
229
229
  changed config files use the usual overwrite confirmation. Cancelling before
230
230
  writing leaves all files unchanged.
231
231
 
232
- After writing, the CLI prints npm commands for missing dependencies and the
233
- selected scripts. It does not install packages or execute scripts. Install commands omit version constraints for Storybook, its React + Vite
232
+ After writing, the CLI prints only npm commands for missing dependencies. It
233
+ does not install packages or execute scripts. Install commands omit version constraints for Storybook, its React + Vite
234
234
  framework, Vite and the React plugin; existing dependency versions are preserved
235
235
  and must be compatible with those packages. Generate a
236
236
  UI-kit component or a widget with separated UI to add your first story. The
@@ -244,7 +244,7 @@ Choose **Add integration → Missing domain-first packages** to compare
244
244
  `domainFirstPackages` in the configuration with `dependencies`, `devDependencies`
245
245
  and `optionalDependencies` in the project's `package.json`. The CLI prints one
246
246
  `npm i` command for missing packages, without version constraints. If none are
247
- missing, it reports that all configured packages are already declared. This
247
+ missing, it prints nothing. This
248
248
  checks declared dependencies, not the contents of `node_modules`, and does not
249
249
  modify files or install packages.
250
250
 
@@ -271,7 +271,9 @@ are staged until overwrite confirmation; no packages are installed and no
271
271
  commands connect to the database during scaffolding.
272
272
 
273
273
  The printed install commands omit version constraints for `prisma`,
274
- `@prisma/cli-engine`, `@prisma/orm-postgres`, `temporal-polyfill`, and `dotenv`. Already declared dependencies are kept. This is a PostgreSQL
274
+ `@prisma/cli-engine`, `@prisma/orm-postgres`, `temporal-polyfill`, and `dotenv`. Already declared dependencies are kept.
275
+ The CLI also reminds you to add `!<rootFolder>/shared/infrastructure/prisma` to
276
+ your linter ignores. This is a PostgreSQL
275
277
  preset for Prisma 8 RC, not a Prisma 7 migration tool.
276
278
 
277
279
  After installing dependencies, configure `DATABASE_URL` (the CLI loads `.env`;
@@ -323,10 +325,9 @@ integration adds a `test:e2e` script (`playwright test`) and ignores
323
325
  `/test-results/`, `/playwright-report/`, `/blob-report/`, `/playwright/.cache/`
324
326
  and `/playwright/.auth/` in `.gitignore`.
325
327
 
326
- After writing, the CLI prints the commands needed to run the specs: installing
327
- `@playwright/test` if it is missing, `npx playwright install --with-deps` for
328
- the browsers and their system dependencies, the `test:e2e` script and
329
- `npx playwright show-report`.
328
+ After writing, the CLI prints `npm install --save-dev @playwright/test` if the
329
+ package is missing and `npx playwright install --with-deps` for the browsers and
330
+ their system dependencies. Then run `npm run test:e2e`.
330
331
 
331
332
  ## Configuration
332
333
 
package/dist/index.cjs CHANGED
@@ -220,11 +220,8 @@ const missingDomainFirstPackages = ()=>{
220
220
  ...new Set(packages)
221
221
  ].filter((name)=>!Object.hasOwn(dependencies, name));
222
222
  return missing.length ? [
223
- 'Install missing domain-first packages (run from the project package directory):',
224
- ` npm i ${missing.join(' ')}`
225
- ] : [
226
- 'All configured domain-first packages are already declared in package.json.'
227
- ];
223
+ `npm i ${missing.join(' ')}`
224
+ ] : [];
228
225
  };
229
226
  const addPackageScripts = async (file, additions)=>{
230
227
  const original = file.data;
@@ -260,6 +257,7 @@ const addPackageScripts = async (file, additions)=>{
260
257
  }
261
258
  return selected;
262
259
  };
260
+ const describeScripts = (selected, descriptions)=>Object.entries(descriptions).filter(([name])=>selected[name]).map(([name, description])=>`npm run ${selected[name]} — ${description}`);
263
261
  const addGitignoreEntry = (root, entry)=>{
264
262
  const gitignore = new File(external_node_path_default().join(root, '.gitignore'));
265
263
  const ignored = gitignore.exists ? gitignore.data : '';
@@ -372,19 +370,13 @@ const addPlaywright = async ()=>{
372
370
  }
373
371
  for (const entry of gitignoreEntries)addGitignoreEntry(root, entry);
374
372
  return [
375
- 'Playwright configuration saved.',
376
- 'Next steps (run from the project package directory):',
377
373
  ...dependencies['@playwright/test'] ? [] : [
378
- ' npm install --save-dev @playwright/test'
379
- ],
380
- ' npx playwright install --with-deps',
381
- ' Existing dependency versions were kept.',
382
- ...manifest.scripts?.dev ? [] : [
383
- ' Add a "dev" script: Playwright starts it as the web server.'
374
+ 'npm install --save-dev @playwright/test'
384
375
  ],
385
- ' Adjust baseURL and webServer.url if the dev server does not listen on http://localhost:3000.',
386
- ` ${selected['test:e2e'] ? `npm run ${selected['test:e2e']}` : 'npx playwright test'}`,
387
- ' Open the HTML report: npx playwright show-report'
376
+ 'npx playwright install --with-deps',
377
+ ...describeScripts(selected, {
378
+ 'test:e2e': 'start the dev server and run end-to-end specs from specs/e2e'
379
+ })
388
380
  ];
389
381
  };
390
382
  const runtimePackages = [
@@ -493,24 +485,19 @@ const addPrisma = async ()=>{
493
485
  const install = (packages, dev)=>{
494
486
  const missing = packages.filter((name)=>!dependencies[name]);
495
487
  return missing.length ? [
496
- ` npm install${dev ? ' --save-dev' : ''} ${missing.join(' ')}`
488
+ `npm install${dev ? ' --save-dev' : ''} ${missing.join(' ')}`
497
489
  ] : [];
498
490
  };
499
- const scriptCommand = (name)=>selected[name] ? `npm run ${selected[name]}` : prismaScripts(config.rootFolder)[name];
500
491
  const relativeFolder = external_node_path_default().relative(root, prismaFolder).split(external_node_path_default().sep).join('/');
501
492
  return [
502
- 'Prisma 8 configuration saved (PostgreSQL, RC preset).',
503
- 'Next steps (run from the project package directory):',
504
493
  ...install(runtimePackages, false),
505
494
  ...install(developmentPackages, true),
506
- ` Add !${relativeFolder} in your linter, to ignore prisma files.`,
507
- ' Existing dependency versions were kept.',
508
- ' Use Node.js 22.18+ and TypeScript 5.9+ with ESM and JSON import support.',
509
- ' Set DATABASE_URL in your project environment (.env for the CLI); load it in the application runtime too.',
510
- ` Add your models to ${relativeFolder}/contract.prisma.`,
511
- ` Emit the contract before compiling or importing the service: ${scriptCommand('prisma:emit')}`,
512
- ` Plan migrations: ${scriptCommand('prisma:migration:plan')}`,
513
- ` Review the generated migrations, then apply: ${scriptCommand('prisma:migration:apply')}`
495
+ `Add !${relativeFolder} in your linter, to ignore prisma files.`,
496
+ ...describeScripts(selected, {
497
+ 'prisma:emit': 'emit contract.json and contract.d.ts from contract.prisma',
498
+ 'prisma:migration:plan': 'emit the contract and plan a migration',
499
+ 'prisma:migration:apply': 'apply planned migrations to the database in DATABASE_URL'
500
+ })
514
501
  ];
515
502
  };
516
503
  const storybookFiles = (relativeProjectRoot)=>({
@@ -611,23 +598,16 @@ const addStorybook = async ()=>{
611
598
  'react-dom'
612
599
  ].filter((name)=>!dependencies[name]);
613
600
  return [
614
- 'Storybook configuration saved (React + Vite).',
615
- 'Next steps (run from the project package directory):',
616
601
  ...missing.length ? [
617
- ` npm install --save-dev ${missing.join(' ')}`
602
+ `npm install --save-dev ${missing.join(' ')}`
618
603
  ] : [],
619
604
  ...missingReact.length ? [
620
- ` npm install ${missingReact.join(' ')}`
605
+ `npm install ${missingReact.join(' ')}`
621
606
  ] : [],
622
- ' Existing dependency versions were kept; ensure Storybook packages are compatible.',
623
- ' Add your CSS imports to .storybook/preview.ts using relative paths or the @/ alias (project root).',
624
- ' Generate a UI-kit component or widget UI to create a story.',
625
- ...selected.storybook ? [
626
- ` npm run ${selected.storybook}`
627
- ] : [],
628
- ...selected['build-storybook'] ? [
629
- ` npm run ${selected['build-storybook']}`
630
- ] : []
607
+ ...describeScripts(selected, {
608
+ storybook: 'start Storybook on http://localhost:6006',
609
+ 'build-storybook': `build static Storybook into ${buildFolder}`
610
+ })
631
611
  ];
632
612
  };
633
613
  const vitestScripts = {
@@ -696,18 +676,13 @@ const addVitest = async ()=>{
696
676
  '@vitest/coverage-v8'
697
677
  ].filter((name)=>!dependencies[name]);
698
678
  return [
699
- 'Vitest configuration saved.',
700
- 'Next steps (run from the project package directory):',
701
679
  ...missing.length ? [
702
- ` npm install --save-dev ${missing.join(' ')}`
703
- ] : [],
704
- ' Existing dependency versions were kept; resolve.tsconfigPaths requires Vite 8+.',
705
- ...selected.test ? [
706
- ` npm run ${selected.test}`
680
+ `npm install --save-dev ${missing.join(' ')}`
707
681
  ] : [],
708
- ...selected['test:coverage'] ? [
709
- ` npm run ${selected['test:coverage']}`
710
- ] : []
682
+ ...describeScripts(selected, {
683
+ test: 'run unit tests',
684
+ 'test:coverage': 'run unit tests with a V8 coverage report in coverage/'
685
+ })
711
686
  ];
712
687
  };
713
688
  const integrations = [
@@ -742,13 +717,25 @@ const addIntegration = async ()=>{
742
717
  });
743
718
  const nextSteps = await integrations[index].run();
744
719
  if (await savePendingChanges()) {
745
- if (nextSteps.length) console.log(nextSteps.map((line)=>/^\s*(?:npm (?:i|install)|npx playwright install)\b/.test(line) ? (0, external_node_util_namespaceObject.styleText)([
746
- 'bold',
747
- 'cyan'
748
- ], line) : line.replace(/^(\s*Add )(!\S+)/, (_, prefix, path)=>prefix + (0, external_node_util_namespaceObject.styleText)([
720
+ const isCommand = (line)=>/^\s*(?:npm (?:i|install)|npx playwright install)\b/.test(line);
721
+ const commands = nextSteps.filter(isCommand);
722
+ const notes = nextSteps.filter((line)=>!isCommand(line));
723
+ const sections = [];
724
+ if (commands.length) sections.push([
725
+ 'Run these commands to install the required dependencies:',
726
+ ...commands.map((line)=>(0, external_node_util_namespaceObject.styleText)([
749
727
  'bold',
750
728
  'cyan'
751
- ], path))).join('\n'));
729
+ ], line))
730
+ ].join('\n'));
731
+ if (notes.length) sections.push([
732
+ 'Additional information:',
733
+ ...notes.map((line)=>line.replace(/^(\s*Add )(!\S+)/, (_, prefix, path)=>prefix + (0, external_node_util_namespaceObject.styleText)([
734
+ 'bold',
735
+ 'cyan'
736
+ ], path)))
737
+ ].join('\n'));
738
+ if (sections.length) console.log(sections.join('\n\n'));
752
739
  }
753
740
  };
754
741
  const initializeUseCase = async ()=>{
@@ -2388,13 +2375,15 @@ export const wire${naming.ClassName}UseCase = wireClass(
2388
2375
  const splitSegments = (rawSource)=>rawSource.split(/[\\/]/).map((segment)=>segment.trim()).filter((segment)=>!!segment);
2389
2376
  class NestedName {
2390
2377
  folders;
2378
+ folderName;
2391
2379
  fileName;
2392
2380
  ClassName;
2393
2381
  classNameSegments;
2394
2382
  constructor(rawSource){
2395
2383
  const segments = splitSegments(rawSource);
2396
2384
  this.folders = segments.slice(0, -1);
2397
- this.fileName = new UnknownFormatNaming(segments.at(-1) ?? '').fileName;
2385
+ this.folderName = new UnknownFormatNaming(segments.at(-1) ?? '').fileName;
2386
+ this.fileName = segments.map((segment)=>new UnknownFormatNaming(segment).fileName).join('-');
2398
2387
  this.classNameSegments = segments.map((segment)=>new UnknownFormatNaming(segment).ClassName);
2399
2388
  this.ClassName = this.classNameSegments.join('');
2400
2389
  }
@@ -2488,11 +2477,11 @@ const scaffoldReactWidget = async (presentationReactFolder)=>{
2488
2477
  ],
2489
2478
  message: 'Type: '
2490
2479
  });
2491
- const { folders, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2480
+ const { folders, folderName, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2492
2481
  const folder = presentationReactFolder.subitem([
2493
2482
  'widgets',
2494
2483
  ...folders,
2495
- fileName
2484
+ folderName
2496
2485
  ]);
2497
2486
  const storyTitle = [
2498
2487
  'Widgets',
package/dist/index.js CHANGED
@@ -190,11 +190,8 @@ const missingDomainFirstPackages = ()=>{
190
190
  ...new Set(packages)
191
191
  ].filter((name)=>!Object.hasOwn(dependencies, name));
192
192
  return missing.length ? [
193
- 'Install missing domain-first packages (run from the project package directory):',
194
- ` npm i ${missing.join(' ')}`
195
- ] : [
196
- 'All configured domain-first packages are already declared in package.json.'
197
- ];
193
+ `npm i ${missing.join(' ')}`
194
+ ] : [];
198
195
  };
199
196
  const addPackageScripts = async (file, additions)=>{
200
197
  const original = file.data;
@@ -230,6 +227,7 @@ const addPackageScripts = async (file, additions)=>{
230
227
  }
231
228
  return selected;
232
229
  };
230
+ const describeScripts = (selected, descriptions)=>Object.entries(descriptions).filter(([name])=>selected[name]).map(([name, description])=>`npm run ${selected[name]} — ${description}`);
233
231
  const addGitignoreEntry = (root, entry)=>{
234
232
  const gitignore = new File(node_path.join(root, '.gitignore'));
235
233
  const ignored = gitignore.exists ? gitignore.data : '';
@@ -342,19 +340,13 @@ const addPlaywright = async ()=>{
342
340
  }
343
341
  for (const entry of gitignoreEntries)addGitignoreEntry(root, entry);
344
342
  return [
345
- 'Playwright configuration saved.',
346
- 'Next steps (run from the project package directory):',
347
343
  ...dependencies['@playwright/test'] ? [] : [
348
- ' npm install --save-dev @playwright/test'
349
- ],
350
- ' npx playwright install --with-deps',
351
- ' Existing dependency versions were kept.',
352
- ...manifest.scripts?.dev ? [] : [
353
- ' Add a "dev" script: Playwright starts it as the web server.'
344
+ 'npm install --save-dev @playwright/test'
354
345
  ],
355
- ' Adjust baseURL and webServer.url if the dev server does not listen on http://localhost:3000.',
356
- ` ${selected['test:e2e'] ? `npm run ${selected['test:e2e']}` : 'npx playwright test'}`,
357
- ' Open the HTML report: npx playwright show-report'
346
+ 'npx playwright install --with-deps',
347
+ ...describeScripts(selected, {
348
+ 'test:e2e': 'start the dev server and run end-to-end specs from specs/e2e'
349
+ })
358
350
  ];
359
351
  };
360
352
  const runtimePackages = [
@@ -463,24 +455,19 @@ const addPrisma = async ()=>{
463
455
  const install = (packages, dev)=>{
464
456
  const missing = packages.filter((name)=>!dependencies[name]);
465
457
  return missing.length ? [
466
- ` npm install${dev ? ' --save-dev' : ''} ${missing.join(' ')}`
458
+ `npm install${dev ? ' --save-dev' : ''} ${missing.join(' ')}`
467
459
  ] : [];
468
460
  };
469
- const scriptCommand = (name)=>selected[name] ? `npm run ${selected[name]}` : prismaScripts(config.rootFolder)[name];
470
461
  const relativeFolder = node_path.relative(root, prismaFolder).split(node_path.sep).join('/');
471
462
  return [
472
- 'Prisma 8 configuration saved (PostgreSQL, RC preset).',
473
- 'Next steps (run from the project package directory):',
474
463
  ...install(runtimePackages, false),
475
464
  ...install(developmentPackages, true),
476
- ` Add !${relativeFolder} in your linter, to ignore prisma files.`,
477
- ' Existing dependency versions were kept.',
478
- ' Use Node.js 22.18+ and TypeScript 5.9+ with ESM and JSON import support.',
479
- ' Set DATABASE_URL in your project environment (.env for the CLI); load it in the application runtime too.',
480
- ` Add your models to ${relativeFolder}/contract.prisma.`,
481
- ` Emit the contract before compiling or importing the service: ${scriptCommand('prisma:emit')}`,
482
- ` Plan migrations: ${scriptCommand('prisma:migration:plan')}`,
483
- ` Review the generated migrations, then apply: ${scriptCommand('prisma:migration:apply')}`
465
+ `Add !${relativeFolder} in your linter, to ignore prisma files.`,
466
+ ...describeScripts(selected, {
467
+ 'prisma:emit': 'emit contract.json and contract.d.ts from contract.prisma',
468
+ 'prisma:migration:plan': 'emit the contract and plan a migration',
469
+ 'prisma:migration:apply': 'apply planned migrations to the database in DATABASE_URL'
470
+ })
484
471
  ];
485
472
  };
486
473
  const storybookFiles = (relativeProjectRoot)=>({
@@ -581,23 +568,16 @@ const addStorybook = async ()=>{
581
568
  'react-dom'
582
569
  ].filter((name)=>!dependencies[name]);
583
570
  return [
584
- 'Storybook configuration saved (React + Vite).',
585
- 'Next steps (run from the project package directory):',
586
571
  ...missing.length ? [
587
- ` npm install --save-dev ${missing.join(' ')}`
572
+ `npm install --save-dev ${missing.join(' ')}`
588
573
  ] : [],
589
574
  ...missingReact.length ? [
590
- ` npm install ${missingReact.join(' ')}`
575
+ `npm install ${missingReact.join(' ')}`
591
576
  ] : [],
592
- ' Existing dependency versions were kept; ensure Storybook packages are compatible.',
593
- ' Add your CSS imports to .storybook/preview.ts using relative paths or the @/ alias (project root).',
594
- ' Generate a UI-kit component or widget UI to create a story.',
595
- ...selected.storybook ? [
596
- ` npm run ${selected.storybook}`
597
- ] : [],
598
- ...selected['build-storybook'] ? [
599
- ` npm run ${selected['build-storybook']}`
600
- ] : []
577
+ ...describeScripts(selected, {
578
+ storybook: 'start Storybook on http://localhost:6006',
579
+ 'build-storybook': `build static Storybook into ${buildFolder}`
580
+ })
601
581
  ];
602
582
  };
603
583
  const vitestScripts = {
@@ -666,18 +646,13 @@ const addVitest = async ()=>{
666
646
  '@vitest/coverage-v8'
667
647
  ].filter((name)=>!dependencies[name]);
668
648
  return [
669
- 'Vitest configuration saved.',
670
- 'Next steps (run from the project package directory):',
671
649
  ...missing.length ? [
672
- ` npm install --save-dev ${missing.join(' ')}`
673
- ] : [],
674
- ' Existing dependency versions were kept; resolve.tsconfigPaths requires Vite 8+.',
675
- ...selected.test ? [
676
- ` npm run ${selected.test}`
650
+ `npm install --save-dev ${missing.join(' ')}`
677
651
  ] : [],
678
- ...selected['test:coverage'] ? [
679
- ` npm run ${selected['test:coverage']}`
680
- ] : []
652
+ ...describeScripts(selected, {
653
+ test: 'run unit tests',
654
+ 'test:coverage': 'run unit tests with a V8 coverage report in coverage/'
655
+ })
681
656
  ];
682
657
  };
683
658
  const integrations = [
@@ -712,13 +687,25 @@ const addIntegration = async ()=>{
712
687
  });
713
688
  const nextSteps = await integrations[index].run();
714
689
  if (await savePendingChanges()) {
715
- if (nextSteps.length) console.log(nextSteps.map((line)=>/^\s*(?:npm (?:i|install)|npx playwright install)\b/.test(line) ? styleText([
716
- 'bold',
717
- 'cyan'
718
- ], line) : line.replace(/^(\s*Add )(!\S+)/, (_, prefix, path)=>prefix + styleText([
690
+ const isCommand = (line)=>/^\s*(?:npm (?:i|install)|npx playwright install)\b/.test(line);
691
+ const commands = nextSteps.filter(isCommand);
692
+ const notes = nextSteps.filter((line)=>!isCommand(line));
693
+ const sections = [];
694
+ if (commands.length) sections.push([
695
+ 'Run these commands to install the required dependencies:',
696
+ ...commands.map((line)=>styleText([
719
697
  'bold',
720
698
  'cyan'
721
- ], path))).join('\n'));
699
+ ], line))
700
+ ].join('\n'));
701
+ if (notes.length) sections.push([
702
+ 'Additional information:',
703
+ ...notes.map((line)=>line.replace(/^(\s*Add )(!\S+)/, (_, prefix, path)=>prefix + styleText([
704
+ 'bold',
705
+ 'cyan'
706
+ ], path)))
707
+ ].join('\n'));
708
+ if (sections.length) console.log(sections.join('\n\n'));
722
709
  }
723
710
  };
724
711
  const initializeUseCase = async ()=>{
@@ -2358,13 +2345,15 @@ export const wire${naming.ClassName}UseCase = wireClass(
2358
2345
  const splitSegments = (rawSource)=>rawSource.split(/[\\/]/).map((segment)=>segment.trim()).filter((segment)=>!!segment);
2359
2346
  class NestedName {
2360
2347
  folders;
2348
+ folderName;
2361
2349
  fileName;
2362
2350
  ClassName;
2363
2351
  classNameSegments;
2364
2352
  constructor(rawSource){
2365
2353
  const segments = splitSegments(rawSource);
2366
2354
  this.folders = segments.slice(0, -1);
2367
- this.fileName = new UnknownFormatNaming(segments.at(-1) ?? '').fileName;
2355
+ this.folderName = new UnknownFormatNaming(segments.at(-1) ?? '').fileName;
2356
+ this.fileName = segments.map((segment)=>new UnknownFormatNaming(segment).fileName).join('-');
2368
2357
  this.classNameSegments = segments.map((segment)=>new UnknownFormatNaming(segment).ClassName);
2369
2358
  this.ClassName = this.classNameSegments.join('');
2370
2359
  }
@@ -2458,11 +2447,11 @@ const scaffoldReactWidget = async (presentationReactFolder)=>{
2458
2447
  ],
2459
2448
  message: 'Type: '
2460
2449
  });
2461
- const { folders, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2450
+ const { folders, folderName, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2462
2451
  const folder = presentationReactFolder.subitem([
2463
2452
  'widgets',
2464
2453
  ...folders,
2465
- fileName
2454
+ folderName
2466
2455
  ]);
2467
2456
  const storyTitle = [
2468
2457
  'Widgets',
@@ -1,2 +1,3 @@
1
1
  import type { File } from '../file-system';
2
2
  export declare const addPackageScripts: (file: File, additions: Record<string, string>) => Promise<Record<string, string>>;
3
+ export declare const describeScripts: (selected: Record<string, string>, descriptions: Record<string, string>) => string[];
@@ -1,10 +1,12 @@
1
1
  /**
2
2
  * A name with optional folders before it, e.g. `admin/panel/users`.
3
- * The last segment names the files; the whole path names the code
4
- * (`AdminPanelUsers`), so equal names in different folders don't clash.
3
+ * The last segment names the folder; the whole path names the files
4
+ * (`admin-panel-users`) and the code (`AdminPanelUsers`), so equal names
5
+ * in different folders don't clash.
5
6
  */
6
7
  export declare class NestedName {
7
8
  readonly folders: string[];
9
+ readonly folderName: string;
8
10
  readonly fileName: string;
9
11
  readonly ClassName: string;
10
12
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@domain-first/project-structure",
3
3
  "description": "Build and manage your Domain-First project structure with CLI",
4
- "version": "2.14.0",
4
+ "version": "2.14.2",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",