@domain-first/project-structure 2.14.1 → 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
 
package/dist/index.cjs CHANGED
@@ -2375,13 +2375,15 @@ export const wire${naming.ClassName}UseCase = wireClass(
2375
2375
  const splitSegments = (rawSource)=>rawSource.split(/[\\/]/).map((segment)=>segment.trim()).filter((segment)=>!!segment);
2376
2376
  class NestedName {
2377
2377
  folders;
2378
+ folderName;
2378
2379
  fileName;
2379
2380
  ClassName;
2380
2381
  classNameSegments;
2381
2382
  constructor(rawSource){
2382
2383
  const segments = splitSegments(rawSource);
2383
2384
  this.folders = segments.slice(0, -1);
2384
- 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('-');
2385
2387
  this.classNameSegments = segments.map((segment)=>new UnknownFormatNaming(segment).ClassName);
2386
2388
  this.ClassName = this.classNameSegments.join('');
2387
2389
  }
@@ -2475,11 +2477,11 @@ const scaffoldReactWidget = async (presentationReactFolder)=>{
2475
2477
  ],
2476
2478
  message: 'Type: '
2477
2479
  });
2478
- const { folders, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2480
+ const { folders, folderName, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2479
2481
  const folder = presentationReactFolder.subitem([
2480
2482
  'widgets',
2481
2483
  ...folders,
2482
- fileName
2484
+ folderName
2483
2485
  ]);
2484
2486
  const storyTitle = [
2485
2487
  'Widgets',
package/dist/index.js CHANGED
@@ -2345,13 +2345,15 @@ export const wire${naming.ClassName}UseCase = wireClass(
2345
2345
  const splitSegments = (rawSource)=>rawSource.split(/[\\/]/).map((segment)=>segment.trim()).filter((segment)=>!!segment);
2346
2346
  class NestedName {
2347
2347
  folders;
2348
+ folderName;
2348
2349
  fileName;
2349
2350
  ClassName;
2350
2351
  classNameSegments;
2351
2352
  constructor(rawSource){
2352
2353
  const segments = splitSegments(rawSource);
2353
2354
  this.folders = segments.slice(0, -1);
2354
- 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('-');
2355
2357
  this.classNameSegments = segments.map((segment)=>new UnknownFormatNaming(segment).ClassName);
2356
2358
  this.ClassName = this.classNameSegments.join('');
2357
2359
  }
@@ -2445,11 +2447,11 @@ const scaffoldReactWidget = async (presentationReactFolder)=>{
2445
2447
  ],
2446
2448
  message: 'Type: '
2447
2449
  });
2448
- const { folders, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2450
+ const { folders, folderName, ClassName, fileName, classNameSegments } = new NestedName(widgetName);
2449
2451
  const folder = presentationReactFolder.subitem([
2450
2452
  'widgets',
2451
2453
  ...folders,
2452
- fileName
2454
+ folderName
2453
2455
  ]);
2454
2456
  const storyTitle = [
2455
2457
  'Widgets',
@@ -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.1",
4
+ "version": "2.14.2",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",