@domain-first/project-structure 5.1.2 → 6.0.0

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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from "node:util";
3
+ import { ConfigFile } from "./201.js";
4
+ import { addIntegration } from "./287.js";
5
+ const help = `Usage: df-integration
6
+
7
+ Adds integrations to a Domain-First project: Storybook, Prisma, Vitest,
8
+ Playwright, integration tests, OpenAPI, Orval and missing domain-first
9
+ packages. Several can be selected at once. Changes project files and prints
10
+ the install commands; nothing is installed or run.
11
+
12
+ Options:
13
+ -h, --help show this help`;
14
+ const { values: values } = parseArgs({
15
+ options: {
16
+ help: {
17
+ type: 'boolean',
18
+ short: 'h',
19
+ default: false
20
+ }
21
+ }
22
+ });
23
+ if (values.help) {
24
+ console.log(help);
25
+ process.exit(0);
26
+ }
27
+ if (!ConfigFile.exists) {
28
+ console.log('No domain-first.project-structure.config.json found: run df-scaffold first to initialize the project.');
29
+ process.exit(1);
30
+ }
31
+ addIntegration();
@@ -1,11 +1,14 @@
1
- export declare const orvalScripts: (rootFolder: string) => {
1
+ export type OrvalTarget = 'hooks' | 'client';
2
+ /** React Query hooks go to the React data layer, the typed client to the shared one. */
3
+ export declare const dataLayerFolder: (rootFolder: string, target: OrvalTarget) => string;
4
+ export declare const orvalScripts: (rootFolder: string, targets: OrvalTarget[]) => {
2
5
  'client:orval': string;
3
6
  };
4
7
  /**
5
8
  * Orval resolves paths relative to the config, which lives in the data layer
6
- * folder next to the generated client.
9
+ * folder next to the generated code. `mutatorPath` is relative to the config.
7
10
  */
8
- export declare const orvalConfig: (rootFolder: string, openapiPath: string, withNext: boolean) => string;
9
- export declare const orvalMutator = "/** Error of the generated hooks, with the parsed response body. */\nexport class ApiError<Body = unknown> extends Error {\n constructor(\n public readonly status: number,\n public readonly body: Body\n ) {\n super(`API error ${status}`);\n this.name = 'ApiError';\n }\n}\n\n/** Error type of the generated hooks, typed per endpoint by Orval. */\nexport type ErrorType<Body> = ApiError<Body>;\n\n/** Every generated request goes through here: add auth headers, token refresh, logging. */\nexport const customInstance = async <T>(\n url: string,\n init?: RequestInit\n): Promise<T> => {\n const response = await fetch(url, init);\n const text = await response.text();\n const body = text ? JSON.parse(text) : undefined;\n\n if (!response.ok) {\n throw new ApiError(response.status, body);\n }\n\n return body as T;\n};\n";
11
+ export declare const orvalConfig: (rootFolder: string, openapiPath: string, withNext: boolean, target?: OrvalTarget, mutatorPath?: string) => string;
12
+ export declare const orvalMutator = "/** Error of the generated requests, with the parsed response body. */\nexport class ApiError<Body = unknown> extends Error {\n constructor(\n public readonly status: number,\n public readonly body: Body\n ) {\n super(`API error ${status}`);\n this.name = 'ApiError';\n }\n}\n\n/** Error type of the generated requests, typed per endpoint by Orval. */\nexport type ErrorType<Body> = ApiError<Body>;\n\n/** Every generated request goes through here: add auth headers, token refresh, logging. */\nexport const customInstance = async <T>(\n url: string,\n init?: RequestInit\n): Promise<T> => {\n const response = await fetch(url, init);\n const text = await response.text();\n const body = text ? JSON.parse(text) : undefined;\n\n if (!response.ok) {\n throw new ApiError(response.status, body);\n }\n\n return body as T;\n};\n";
10
13
  export declare const queryProvider = "'use client';\n\nimport { QueryClient, QueryClientProvider } from '@tanstack/react-query';\nimport { type FC, type ReactNode, useState } from 'react';\n\nexport const QueryProvider: FC<{ children: ReactNode }> = ({ children }) => {\n // One client per browser session; a module-level client would be shared between requests on the server\n const [queryClient] = useState(() => new QueryClient());\n\n return (\n <QueryClientProvider client={queryClient}>\n {children}\n </QueryClientProvider>\n );\n};\n";
11
14
  export declare const addOrval: () => Promise<string[]>;
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Collects the packages of all install commands into one command for
3
+ * dependencies and one for dev dependencies. A package wanted both ways
4
+ * is installed as a dependency. Other commands follow, since they may
5
+ * need the installed packages.
6
+ */
7
+ export declare const mergeInstallCommands: (commands: string[]) => string[];
1
8
  /**
2
9
  * Prints the steps left after a use case: installation commands first,
3
10
  * then additional information.
@@ -0,0 +1 @@
1
+ export {};
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": "5.1.2",
4
+ "version": "6.0.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -16,7 +16,8 @@
16
16
  }
17
17
  },
18
18
  "bin": {
19
- "df-ps": "./dist/index.js",
19
+ "df-scaffold": "./dist/index.js",
20
+ "df-integration": "./dist/integration.js",
20
21
  "df-skills": "./bin/df-skills.mjs",
21
22
  "df-lint": "./dist/lint.js"
22
23
  },
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: df-ps-implement
3
- description: Fill in code generated by the `df-ps` CLI (@domain-first/project-structure) — aggregates, entities and value objects (@domain-first/types), repositories, handler schemas (@domain-first/handlers), errors (@domain-first/errors), wiring (@domain-first/wire), handlers-rest endpoints, React modules, tests — while keeping bounded contexts isolated. Use after scaffolding, or when the user asks to implement, connect, or wire Domain-First components in a project with domain-first.project-structure.config.json.
3
+ description: Fill in code generated by the `df-scaffold` CLI (@domain-first/project-structure) — aggregates, entities and value objects (@domain-first/types), repositories, handler schemas (@domain-first/handlers), errors (@domain-first/errors), wiring (@domain-first/wire), handlers-rest endpoints, React modules, tests — while keeping bounded contexts isolated. Use after scaffolding, or when the user asks to implement, connect, or wire Domain-First components in a project with domain-first.project-structure.config.json.
4
4
  ---
5
5
 
6
6
  # Implement Domain-First scaffolds
@@ -9,7 +9,7 @@ Generated files contain placeholders: empty classes, `{}` schemas, `[]` dependen
9
9
 
10
10
  ## Ground rules
11
11
 
12
- - New files need an approved work plan (`df-ps-scaffold`, rule 1) and come only via df-ps or its listed exceptions (rule 2). Edits to existing files don't need approval; report them.
12
+ - New files need an approved work plan (`df-ps-scaffold`, rule 1) and come only via df-scaffold or its listed exceptions (rule 2). Edits to existing files don't need approval; report them.
13
13
  - Keep generated names and paths: barrels, wiring, specs, and `presentation/rest/wires.ts` import them.
14
14
  - Layers: domain imports nothing from other layers. Application uses domain and its own abstractions. Infrastructure implements repositories, contracts, and ports, and may use application ports (of its context and the Shared Layer), never other application modules. Infrastructure needing logic from an application service means the logic is misplaced: pure logic without ports → a domain service; logic over ports → call those ports directly; technical logic (mapping, retries, formatting for an external API) → an infrastructure service. Presentation calls application handlers. Only `wiring/` knows concrete classes.
15
15
  - Constructors take abstractions (`OrderRepository`, abstract `PlaceOrderCommand`, port `PaymentGateway`), never `PrismaOrderRepository`.
@@ -81,7 +81,7 @@ export class Order extends domainType(
81
81
 
82
82
  ## Wiring ({wire})
83
83
 
84
- Dependencies (constructor parameters and their wires) are added only by `df-ps` (`df-ps-scaffold`, rule 3): the generator's `Dependencies:` step or `Wire dependency`. It keeps each `wireClass(X, [...])` in the order of the constructor, which TypeScript checks:
84
+ Dependencies (constructor parameters and their wires) are added only by `df-scaffold` (`df-ps-scaffold`, rule 3): the generator's `Dependencies:` step or `Wire dependency`. It keeps each `wireClass(X, [...])` in the order of the constructor, which TypeScript checks:
85
85
 
86
86
  ```ts
87
87
  export const wirePlaceOrderUseCase = wireClass(PlaceOrderUseCase, [
@@ -110,7 +110,7 @@ export const wirePlaceOrderUseCase = wireClass(PlaceOrderUseCase, [
110
110
  - Shared hooks (`…/presentation/react/hooks/use-<name>.ts`): generic app-wide logic, driven only by arguments; no business terms, no API client, no imports from UI-kit, widgets, pages, or contexts.
111
111
  - Stories (`storybookFramework`): fill `args` of `Default` with valid props and add one story per meaningful state (`Disabled`, `Loading`, `WithError`). Keep `meta`, the file name, and the title (`UI-kit/N` or `Widgets/N`). For widget UI, the stories cover the UI states that its UI model produces.
112
112
  - Extra hooks, UI parts, styles, and stories: rule 2, exceptions 3–4.
113
- - Moving or renaming a page or widget (files, code names, imports): only with df-ps, `Move or rename page` / `Move or rename widget` (`df-ps-scaffold`, rule 2).
113
+ - Moving or renaming a page or widget (files, code names, imports): only with df-scaffold, `Move or rename page` / `Move or rename widget` (`df-ps-scaffold`, rule 2).
114
114
  - Talk to the backend over HTTP. First look for a generated API client (orval config, `openapi-typescript` output, generated `*.gen.ts` / `api/` folders) and use it, importing nothing from contexts. Only without one, take types from endpoint contracts (`import type`, see "Bounded context isolation"). Regenerating the client is tool output (rule 2, exception 2).
115
115
 
116
116
  ## Tests
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: df-ps-plan-feature
3
- description: Turn an abstract feature request into a Domain-First plan for a project using `df-ps` (@domain-first/project-structure) — decide which bounded contexts own what and which components are needed, then get the user's approval before generating anything. Use when the project has domain-first.project-structure.config.json and the user describes a feature ("add product reviews", "let users cancel orders") without naming bounded contexts or exact components.
3
+ description: Turn an abstract feature request into a Domain-First plan for a project using `df-scaffold` (@domain-first/project-structure) — decide which bounded contexts own what and which components are needed, then get the user's approval before generating anything. Use when the project has domain-first.project-structure.config.json and the user describes a feature ("add product reviews", "let users cancel orders") without naming bounded contexts or exact components.
4
4
  ---
5
5
 
6
6
  # Plan a feature
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  name: df-ps-scaffold
3
- description: Generate Domain-First components with the `df-ps` CLI (@domain-first/project-structure) — bounded contexts, aggregates, repositories, errors, services, use cases, commands, queries, ports, handlers-rest endpoints, React pages, widgets, UI-kit components (with Storybook stories) and shared hooks, and moving or renaming pages and widgets. Use when the project has domain-first.project-structure.config.json and the user asks to add or create any of these, or to move, rename or regroup a page or widget. Holds the mandatory rules (work plan approval, new files and new dependencies only via df-ps) that the other df-ps skills rely on.
3
+ description: Generate Domain-First components with the `df-scaffold` CLI (@domain-first/project-structure) — bounded contexts, aggregates, repositories, errors, services, use cases, commands, queries, ports, handlers-rest endpoints, React pages, widgets, UI-kit components (with Storybook stories) and shared hooks, and moving or renaming pages and widgets. Use when the project has domain-first.project-structure.config.json and the user asks to add or create any of these, or to move, rename or regroup a page or widget. Holds the mandatory rules (work plan approval, new files and new dependencies only via df-scaffold) that the other df-scaffold skills rely on.
4
4
  ---
5
5
 
6
- # Scaffold components with df-ps
6
+ # Scaffold components with df-scaffold
7
7
 
8
8
  ## Workflow
9
9
 
10
10
  Follow this order for every request:
11
11
 
12
- 1. Read `domain-first.project-structure.config.json` (beside the nearest `package.json`). If missing, stop and tell the user to initialize the project with `npx df-ps` first. Its optional `rules.dependencies` changes what each kind of module may depend on; where it differs from the defaults in these skills, the config wins.
12
+ 1. Read `domain-first.project-structure.config.json` (beside the nearest `package.json`). If missing, stop and tell the user to initialize the project with `npx df-scaffold` first. Its optional `rules.dependencies` changes what each kind of module may depend on; where it differs from the defaults in these skills, the config wins.
13
13
  2. Feature request without named contexts/components → `df-ps-plan-feature` (it covers steps 3–5).
14
14
  3. Choose a component for each piece of logic with `references/choosing-components.md`.
15
15
  4. Prepare the run details ("Preparing runs" below).
@@ -23,7 +23,7 @@ Follow this order for every request:
23
23
 
24
24
  ### 1. Work plan approval
25
25
 
26
- **A task that creates any new file** (a df-ps run, or a hand-created file under rule 2) needs an approved work plan first, even for one component, unless the user explicitly says to skip approval for this task. Until approval, only read. Files written by the project's own scripts (rule 2, exception 2) don't count: run those scripts when the work needs them.
26
+ **A task that creates any new file** (a df-scaffold run, or a hand-created file under rule 2) needs an approved work plan first, even for one component, unless the user explicitly says to skip approval for this task. Until approval, only read. Files written by the project's own scripts (rule 2, exception 2) don't count: run those scripts when the work needs them.
27
27
 
28
28
  Tasks that only edit existing files (a bug fix, a new field, a changed rule) don't need a plan: do them directly and say what you changed.
29
29
 
@@ -49,7 +49,7 @@ Hand-created files (exception #): none; list each as `<path>` (#n)
49
49
  Tool runs:
50
50
 
51
51
  - after application, before infrastructure: `npm run prisma:migration:plan -- --name add-order`: migration for the `order` table (applied by the user)
52
- - `npm run openapi && npx orval`: OpenAPI document and API client with the new endpoints
52
+ - `npm run openapi && npm run client:orval`: OpenAPI document and API client with the new endpoints
53
53
  ```
54
54
 
55
55
  - Every run lists the CLI path, target, name, every answer you'll give, and the files from `references/generators.md`. Flag overwrites of existing files.
@@ -59,31 +59,31 @@ Tool runs:
59
59
  - Approval must be explicit ("ok", "да", "делай"…). A question or silence isn't approval. Changes to the plan → show the updated plan and ask again.
60
60
  - After approval, do exactly the plan. An extra **new file**, component, or a different name/option → stop and get the delta approved. Edits to existing files needed along the way don't need approval; list them in the final report.
61
61
 
62
- ### 2. New files only through df-ps
62
+ ### 2. New files only through df-scaffold
63
63
 
64
- Every new file is created by `df-ps`. Don't create files with the Write tool, `touch`, redirects, or by copying templates. The only exceptions (`<C>` = `<rootFolder>/bounded-contexts/<context>`):
64
+ Every new file is created by `df-scaffold`. Don't create files with the Write tool, `touch`, redirects, or by copying templates. The only exceptions (`<C>` = `<rootFolder>/bounded-contexts/<context>`):
65
65
 
66
66
  | # | Files | Location | Condition |
67
67
  | --- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
68
  | 1 | Missing spec | `<component>.spec.ts` next to the component | Exactly from "Spec templates" in `references/generators.md`. |
69
69
  | 2 | Output of project tools | where the tool puts it | Migrations, codegen: run the project's script, use its output as-is; never hand-write or edit it. No approval needed for these files. |
70
- | 3 | Widget hooks / UI | `…/presentation/react/widgets/<name>/hooks/**`, `ui/**` | Widget generated by df-ps. |
71
- | 4 | Widget/page/UI-kit support files | inside the widget folder or `ui-kit/<name>/`: styles, assets, `*.test.tsx`, `*.stories.tsx`; next to a page: `pages/<name>-page.module.css`, for a nested page in its folder (`pages/admin/admin-users-page.module.css`) (layout of its widgets only) | Widget/page/UI-kit component generated by df-ps. A page stays one file that composes widgets, plus an optional CSS module for their layout (grid, spacing, areas); no page tests. Its own hooks, UI parts, types, or styles for how a block looks mean a widget is missing, so generate it. A missing UI-kit or widget UI story: exactly from "Story templates" in `references/generators.md`. |
70
+ | 3 | Widget hooks / UI | `…/presentation/react/widgets/<name>/hooks/**`, `ui/**` | Widget generated by df-scaffold. |
71
+ | 4 | Widget/page/UI-kit support files | inside the widget folder or `ui-kit/<name>/`: styles, assets, `*.test.tsx`, `*.stories.tsx`; next to a page: `pages/<name>-page.module.css`, for a nested page in its folder (`pages/admin/admin-users-page.module.css`) (layout of its widgets only) | Widget/page/UI-kit component generated by df-scaffold. A page stays one file that composes widgets, plus an optional CSS module for their layout (grid, spacing, areas); no page tests. Its own hooks, UI parts, types, or styles for how a block looks mean a widget is missing, so generate it. A missing UI-kit or widget UI story: exactly from "Story templates" in `references/generators.md`. |
72
72
  | 5 | App bootstrap and config | outside `<rootFolder>/{bounded-contexts,shared,presentation}/`: entry point, HTTP server setup registering `restHandlers`, tool configs | Bootstrapping only. Domain/application/infrastructure logic never goes there. |
73
73
 
74
74
  Anything else (helpers, types, constants, mappers, wiring, barrels): put it in an existing generated file, or generate a component that can host it. Editing existing files is fine. If neither works, request an exception for that exact file.
75
75
 
76
- If the CLI can't run, give the user the menu path and answers to run `npx df-ps` themselves (`! npx df-ps`). Never hand-write its output. Missing generated files are only recreated by re-running the generator, as an approved overwrite.
76
+ If the CLI can't run, give the user the menu path and answers to run `npx df-scaffold` themselves (`! npx df-scaffold`). Never hand-write its output. Missing generated files are only recreated by re-running the generator, as an approved overwrite.
77
77
 
78
- Moving or renaming a page or widget is a df-ps run too (`Move or rename page` / `Move or rename widget`, see `references/generators.md`): it creates the files at the new paths, so it needs an approved plan (rule 1). Don't move, rename, or copy their files by hand, and don't rename their `<Name>Page…`, `<Name>Widget…`, or `use<Name>UIModel` by hand: df-ps keeps file names, code names, story titles, and imports in sync. List each move as a run: old → new name, the files to move (`→`), and the files whose imports change (`~`).
78
+ Moving or renaming a page or widget is a df-scaffold run too (`Move or rename page` / `Move or rename widget`, see `references/generators.md`): it creates the files at the new paths, so it needs an approved plan (rule 1). Don't move, rename, or copy their files by hand, and don't rename their `<Name>Page…`, `<Name>Widget…`, or `use<Name>UIModel` by hand: df-scaffold keeps file names, code names, story titles, and imports in sync. List each move as a run: old → new name, the files to move (`→`), and the files whose imports change (`~`).
79
79
 
80
- ### 3. New dependencies only through df-ps
80
+ ### 3. New dependencies only through df-scaffold
81
81
 
82
- With `@domain-first/wire`, every new dependency of a wired class (a constructor parameter plus its wire) is added by `df-ps`: the generator's `Dependencies:` step for a new module, `Wire dependency` for an existing one, and the `Handler:` pick for an endpoint (its generator is added automatically). Don't add constructor parameters or wire entries by hand, and don't reorder or remove the ones `df-ps` added.
82
+ With `@domain-first/wire`, every new dependency of a wired class (a constructor parameter plus its wire) is added by `df-scaffold`: the generator's `Dependencies:` step for a new module, `Wire dependency` for an existing one, and the `Handler:` pick for an endpoint (its generator is added automatically). Don't add constructor parameters or wire entries by hand, and don't reorder or remove the ones `df-scaffold` added.
83
83
 
84
84
  - List each module's dependencies in the plan as run options (`deps: OrderRepository`), with a `Wire dependency` run for existing modules.
85
85
  - A dependency the CLI doesn't offer is forbidden by the project's dependency rules (the defaults, changed by `rules.dependencies` in the config) or by context isolation: change the design (a port, a query or command, an infrastructure service) instead of adding it by hand.
86
- - A value that isn't a wired module (a database or SDK client, a config value) lives in an infrastructure service named after the implementation label (`prisma`, `in-memory-db`, `stripe`): the service creates or reads it itself (`readonly client = new PrismaClient()`), with no constructor parameter for it. Implementations get the service through `df-ps`, where it shows up under `Suggested`. Wrap the service's wire in `memoWire(...)` when one instance must be shared (a connection pool, an in-memory store). No `wireValue(...)`. A domain or application module never gets such a value directly: it depends on a port whose adapter uses the service.
86
+ - A value that isn't a wired module (a database or SDK client, a config value) lives in an infrastructure service named after the implementation label (`prisma`, `in-memory-db`, `stripe`): the service creates or reads it itself (`readonly client = new PrismaClient()`), with no constructor parameter for it. Implementations get the service through `df-scaffold`, where it shows up under `Suggested`. Wrap the service's wire in `memoWire(...)` when one instance must be shared (a connection pool, an in-memory store). No `wireValue(...)`. A domain or application module never gets such a value directly: it depends on a port whose adapter uses the service.
87
87
  - An endpoint generated with `handler: never` gets its handler by re-running the endpoint generator once the handler exists, as an approved overwrite.
88
88
 
89
89
  ### 4. Bounded contexts never import each other
@@ -95,12 +95,12 @@ Details and the check script: `df-ps-implement`, "Bounded context isolation".
95
95
  - **Contexts**: subfolders of `<rootFolder>/bounded-contexts/` (menu: `Bounded Context: <name>`).
96
96
  - **Names**: lowercase kebab-case, no generator suffix (`place-order`, not `place-order-use-case`). No empty segments (`a--b`). Pages and widgets only: folders before the name, each segment kebab-case (`admin/users`); when to nest: `references/choosing-components.md`.
97
97
  - **Collisions**: before writing, the CLI asks `Overwrite them?` if the run would replace existing files. Check the target paths; rename, or flag the overwrite in the plan and end that run's steps with `yes`.
98
- - **Tests**: with `testingLibrary` set, df-ps always generates specs; add a test implementation (`in-memory`/`mock`) to repositories, commands/queries, and ports. Otherwise the spec wires the real one. Without `testingLibrary`, tell the user once and suggest adding it; don't edit the config yourself.
98
+ - **Tests**: with `testingLibrary` set, df-scaffold always generates specs; add a test implementation (`in-memory`/`mock`) to repositories, commands/queries, and ports. Otherwise the spec wires the real one. Without `testingLibrary`, tell the user once and suggest adding it with `! npx df-integration` (Vitest); don't edit the config yourself.
99
99
  - **Prompts**: take the exact sequence for the generator and config from `references/generators.md`.
100
100
 
101
101
  ## Running the driver
102
102
 
103
- `df-ps` is interactive. `scripts/drive.mjs` answers its prompts, then lists created (`+`) and changed (`~`) files.
103
+ `df-scaffold` is interactive. `scripts/drive.mjs` answers its prompts, then lists created (`+`) and changed (`~`) files.
104
104
 
105
105
  ```bash
106
106
  node <this-skill-dir>/scripts/drive.mjs [--cwd <dir>] [--delay <ms>] <step>...
@@ -1,4 +1,4 @@
1
- # df-ps generators: prompts and output
1
+ # df-scaffold generators: prompts and output
2
2
 
3
3
  Notation: `<C>` = `<rootFolder>/bounded-contexts/<context>` or `<rootFolder>/shared`. `n` = the entered kebab-case name, `N` = PascalCase, `v` = camelCase. `I` = implementation label (`prisma` → `Prisma`). Specs are generated without a prompt **only if `testingLibrary` is set**. `{pkg}` = output depends on that `@domain-first/*` package.
4
4
 
@@ -127,7 +127,7 @@ The same controller, path, and method replace the existing endpoint (after `Over
127
127
 
128
128
  Page and widget names may have folders before them: `text:admin/panel/users` → `…/pages/admin/panel/admin-panel-users-page.tsx` and `…/widgets/admin/panel/users/`. The widget folder uses only the last segment; file names use the whole path (`admin-panel-users-page.tsx`, `admin-panel-users-widget.tsx`, `ui/admin-panel-users-widget-ui.tsx`, `hooks/use-admin-panel-users-ui-model.ts`), and so do code names (`AdminPanelUsersPage`, `AdminPanelUsersWidget`, `useAdminPanelUsersUIModel`); the story title follows the folders (`Widgets/Admin/Panel/Users`). `.` and `..` are rejected.
129
129
 
130
- Move or rename a page or a widget only with df-ps, never by hand: `"pick:Scaffold React module" "pick:Move or rename widget" "pick:admin/users" text:team/users "yes"` (`Move or rename page` for pages; the list shows nested names, the default new name is the current one). It moves the widget folder (or the page with its `<name>-page.*` files), renames files and `<Name>Widget…` / `use<Name>UIModel` / `<Name>Page…` to the new name, updates a generated story title and every import of the module (relative and `tsconfig` aliases; importers of barrels re-exporting it get the renamed classes), and fixes relative imports inside it. Before `Apply?` it prints the files to move and to update; check them. An existing target or a move into itself is rejected.
130
+ Move or rename a page or a widget only with df-scaffold, never by hand: `"pick:Scaffold React module" "pick:Move or rename widget" "pick:admin/users" text:team/users "yes"` (`Move or rename page` for pages; the list shows nested names, the default new name is the current one). It moves the widget folder (or the page with its `<name>-page.*` files), renames files and `<Name>Widget…` / `use<Name>UIModel` / `<Name>Page…` to the new name, updates a generated story title and every import of the module (relative and `tsconfig` aliases; importers of barrels re-exporting it get the renamed classes), and fixes relative imports inside it. Before `Apply?` it prints the files to move and to update; check them. An existing target or a move into itself is rejected.
131
131
 
132
132
  `"pick:Scaffold React module" "pick:New UI-kit" text:date-picker` → `…/ui-kit/n/`:
133
133
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Drives the interactive `df-ps` CLI with a scripted list of answers and
3
+ * Drives the interactive `df-scaffold` CLI with a scripted list of answers and
4
4
  * prints the files it created or changed.
5
5
  *
6
6
  * Usage:
@@ -87,12 +87,12 @@ const snapshot = () => {
87
87
  return result;
88
88
  };
89
89
 
90
- const localBin = path.join(projectRoot, 'node_modules', '.bin', 'df-ps');
90
+ const localBin = path.join(projectRoot, 'node_modules', '.bin', 'df-scaffold');
91
91
  const [command, commandArgs] = fs.existsSync(localBin)
92
92
  ? [localBin, []]
93
93
  : [
94
94
  'npm',
95
- ['exec', '--yes', '--package=@domain-first/project-structure', '--', 'df-ps']
95
+ ['exec', '--yes', '--package=@domain-first/project-structure', '--', 'df-scaffold']
96
96
  ];
97
97
 
98
98
  const before = snapshot();