@domain-first/project-structure 8.3.0 → 8.5.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.
- package/README.md +5 -4
- package/dist/287.js +118 -30
- package/dist/38.js +23 -11
- package/dist/561.js +59 -33
- package/dist/870.js +2 -1
- package/dist/agent-cli.d.ts +24 -2
- package/dist/agent-requests.d.ts +44 -0
- package/dist/config-file.d.ts +4 -1
- package/dist/graph.cjs +2 -1
- package/dist/index.cjs +148 -33
- package/dist/init.cjs +2 -1
- package/dist/integration.cjs +177 -62
- package/dist/lint.cjs +27 -13
- package/dist/lint.js +2 -1
- package/dist/react-module-move.d.ts +26 -3
- package/dist/react.cjs +190 -63
- package/dist/react.js +13 -1
- package/dist/upgrade-steps.d.ts +1 -1
- package/dist/upgrade.cjs +2 -1
- package/package.json +1 -1
- package/skills/df-ps-implement/SKILL.md +2 -1
- package/skills/df-ps-react/SKILL.md +4 -4
- package/skills/df-ps-react/references/generators.md +4 -0
- package/skills/df-ps-scaffold/SKILL.md +1 -1
- package/skills/df-ps-scaffold/references/agent-operations.md +4 -0
- package/skills/df-ps-scaffold/references/choosing-components.md +2 -1
- package/skills/df-ps-scaffold/references/units/port.md +2 -2
|
@@ -121,6 +121,10 @@ The owner configures frontend first. React and Next.js use the same operations.
|
|
|
121
121
|
| `move-widget` | `module`, `name` | Same for widgets. Files, imports, code names and generated story titles follow the move. |
|
|
122
122
|
| `delete-page` | `module` | Deletes the page and its `<name>-page.*` files. With Next.js and the page's own route, `deleteRoute` (default true) deletes that route folder's own files too; `false` keeps the route, which still imports the page, so the delete is refused. Omit `deleteRoute` without such a route. |
|
|
123
123
|
| `delete-widget` | `module` | Deletes the widget folder. Refused with `DELETE_NOT_ALLOWED` and `details.usedBy` while other files import it. |
|
|
124
|
+
| `move-ui-kit-component` | `module`, `name` | Kebab-case names without folders. Folder, files, `<Name>`, `<Name>Props`, the `UI-kit/<Name>` story title and imports follow. |
|
|
125
|
+
| `move-shared-hook` | `module`, `name` | Kebab-case names without folders; a leading `use-` is dropped. `use-<name>.*`, `use<Name>` and imports follow. |
|
|
126
|
+
| `delete-ui-kit-component` | `module` | Deletes the component folder. Refused with `DELETE_NOT_ALLOWED` while other files import it. |
|
|
127
|
+
| `delete-shared-hook` | `module` | Deletes `use-<name>.*`. Refused with `DELETE_NOT_ALLOWED` while other files import it. |
|
|
124
128
|
|
|
125
129
|
All support `dryRun` and `overwrite`. Use CLI moves even for a rename or folder regrouping; an existing target or a move into itself is rejected.
|
|
126
130
|
|
|
@@ -57,11 +57,12 @@ Example: `order-confirmation` prepares a message and calls the injected `mailer`
|
|
|
57
57
|
| Application / infrastructure service | Used by use cases → application. Only by adapters/repositories → infrastructure. |
|
|
58
58
|
| Logic infrastructure needs from an application service | Infrastructure never sees application services. Pure logic without ports → domain service. Logic over ports → infrastructure calls the ports directly. Technical (mapping, retries, external API formats) → infrastructure service. |
|
|
59
59
|
| Clock | Always a port (`clock`, usually in Shared Kernel). A command or query never uses it: the use case reads the time and passes it in the input. |
|
|
60
|
+
| Configuration | Values application logic needs (limits, feature flags) → a port (`config`, usually in Shared Kernel), with methods in the application's terms. Settings only an adapter needs (connection strings, API keys) → that adapter or its infrastructure service reads them; no port. |
|
|
60
61
|
|
|
61
62
|
## Where it goes
|
|
62
63
|
|
|
63
64
|
- Default: the context that owns the data and rules (`df-ps-plan-feature`, step 3).
|
|
64
|
-
- Shared Kernel: technical, ownerless pieces (`clock`, `mailer` ports, shared HTTP client, errors like `unauthorized`) and **universal** entities / value objects: the same meaning and rules in every context, owned by none (`money`, `email`, `address`). A Shared Kernel domain service holds rules at the junction of these universal types only. Anything with one context's meaning or rules (`order-status`, `customer`) stays in that context, even if other contexts need it; they duplicate it in the models of their own ports.
|
|
65
|
+
- Shared Kernel: technical, ownerless pieces (`clock`, `config`, `mailer` ports, shared HTTP client, errors like `unauthorized`) and **universal** entities / value objects: the same meaning and rules in every context, owned by none (`money`, `email`, `address`). A Shared Kernel domain service holds rules at the junction of these universal types only. Anything with one context's meaning or rules (`order-status`, `customer`) stays in that context, even if other contexts need it; they duplicate it in the models of their own ports.
|
|
65
66
|
- Another context's data or behavior → an application port in the consuming context (step 9).
|
|
66
67
|
|
|
67
68
|
## Example
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Port
|
|
2
2
|
|
|
3
|
-
When: a capability across this context's boundary: another bounded context, an external system, or
|
|
3
|
+
When: a capability across this context's boundary: another bounded context, an external system, time or configuration (`../choosing-components.md`, steps 9–10). Own aggregate persistence → repository; atomic operations on this context's own storage → command/query. One method is enough. Wanting to mock a class or imagining multiple implementations does not by itself establish a boundary. The `clock` and `config` ports usually belong in the Shared Kernel.
|
|
4
4
|
|
|
5
5
|
## Generate (context and Shared Kernel)
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ Prompts: name → primary adapter select → `With test implementation` → test
|
|
|
19
19
|
- For another context, define the port in the consuming context with its own models and errors. A `cross-context` adapter can inject queries, commands and use cases from any neighboring context; choices are labelled `(<context>)` and names get context-qualified aliases. Only this adapter imports neighboring handler types, and only its matching wiring imports their factories. Never import foreign models, errors, repositories, ports, services, infrastructure or barrels.
|
|
20
20
|
- Implement the capability's methods by mapping input, invoking injected handlers, and mapping results/errors. The CLI creates the contract, adapters and dependencies; it does not generate methods or delegation. Keep business coordination in the consuming use case.
|
|
21
21
|
- One implementation per adapter: `api` performs the real interaction (an SDK or HTTP client, through an [infrastructure service](services.md) for the client); `mock`/`fake` is deterministic.
|
|
22
|
-
- Use the Shared Kernel `clock` port instead of `new Date()` / `Date.now()` in domain and application code.
|
|
22
|
+
- Use the Shared Kernel `clock` port instead of `new Date()` / `Date.now()` in domain and application code, and a `config` port instead of `process.env` / `import.meta.env`. Its adapter reads the environment; infrastructure and wiring may read it directly.
|
|
23
23
|
|
|
24
24
|
## Test
|
|
25
25
|
|