@domain-first/project-structure 8.5.1 → 8.6.1
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 +1 -1
- package/dist/287.js +40 -330
- package/dist/38.js +2 -2
- package/dist/526.js +376 -0
- package/dist/561.js +7 -9
- package/dist/{870.js → 780.js} +37 -2
- package/dist/{201.js → 947.js} +2 -36
- package/dist/file-system.d.ts +2 -1
- package/dist/graph.cjs +2 -1
- package/dist/graph.js +2 -2
- package/dist/index.cjs +96 -54
- package/dist/index.js +1 -1
- package/dist/init.cjs +9 -1
- package/dist/init.js +1 -1
- package/dist/integration.cjs +96 -54
- package/dist/integration.js +1 -1
- package/dist/integrations/openapi-extractor.d.ts +12 -0
- package/dist/lint.cjs +2 -1
- package/dist/lint.js +1 -1
- package/dist/react.cjs +96 -54
- package/dist/react.js +1 -1
- package/dist/rest-layout.d.ts +34 -0
- package/dist/upgrade-rest-root.d.ts +8 -0
- package/dist/upgrade-steps.d.ts +1 -0
- package/dist/upgrade.cjs +384 -8
- package/dist/upgrade.js +173 -9
- package/dist/use-cases/scaffold-new-handlers-rest-endpoint.d.ts +6 -0
- package/package.json +1 -1
- package/skills/df-ps-scaffold/references/agent-mode.md +1 -1
- package/skills/df-ps-scaffold/references/agent-operations.md +1 -1
- package/skills/df-ps-scaffold/references/units/endpoint.md +2 -2
- package/dist/711.js +0 -22
package/package.json
CHANGED
|
@@ -40,7 +40,7 @@ npx df-integration --request '{"operation":"add","integrations":["storybook"]}'
|
|
|
40
40
|
- `dependencies`: implementation/class name → array of qualified module IDs. Omitted entries keep the generator's checked suggestions; `[]` explicitly selects none when that selection applies. When wiring is off or no candidates exist, omit the group; see the [dependency conditions](agent-operations.md#dependency-keys-and-system-implementations). Every supplied dependency group must apply to the operation. Different primary/test implementations have independent lists.
|
|
41
41
|
- Aggregate repositories require `withRepository: true` and an `implementation`. Without it, aggregate creation makes no repository.
|
|
42
42
|
- New implementations use a `contract` ID and, with a branched wire, an explicit `environments` array. Moves use a `module` unit ID and optional `targetContext`, `aggregate` and `name`. `wire-dependency` uses a wiring target ID in `module` plus its `dependencies` entry.
|
|
43
|
-
- Endpoints use `controller`, lowercase `method`, relative `path` and a qualified `handler` ID when a wired handler is available. A new controller is created when its name does not exist; omit `controller` for
|
|
43
|
+
- Endpoints use `controller`, lowercase `method`, relative `path` and a qualified `handler` ID when a wired handler is available. A new controller is created when its name does not exist; omit `controller` for the context-root controller `(root)` (`/<context>`, `/<context>/:id`, `/<context>/from-scratch`).
|
|
44
44
|
- Integration-specific fields and script conflict decisions are in the integration request schema. Conflicts require explicit decisions, e.g. `"scriptConflicts": { "storybook": "keep" }`. Configuration changes that require confirmation interactively also require their explicit request field.
|
|
45
45
|
|
|
46
46
|
## Check the result
|
|
@@ -25,7 +25,7 @@ All operations support `dryRun` and `overwrite`. Except `bounded-context`, they
|
|
|
25
25
|
| `query` | `name`, `implementation` | `testImplementation`, `dependencies`. Bounded contexts only. |
|
|
26
26
|
| `port` | `name`, `implementation` | `testImplementation`, `dependencies`. `cross-context` is available only with a neighboring context, never in Shared Kernel. |
|
|
27
27
|
| `implementation` | `contract`, `implementation` | For a usable branched wire, `environments` is required and nonempty; otherwise omit it. `dependencies` is available for the newly added implementation when wiring applies. |
|
|
28
|
-
| `endpoint` | `method`, `path`, optional `controller` (omit for the context
|
|
28
|
+
| `endpoint` | `method`, `path`, optional `controller` (omit for the context-root controller `(root)`) | REST package and generator must exist. With wiring and selectable handlers, provide `handler`. Without selectable handlers, omit it; the generated handler remains `never` and needs a later approved generator rerun. `UPGRADE_REQUIRED`: the context has context-root endpoints of 8.5; ask the project owner to run df-upgrade. |
|
|
29
29
|
| `wire-dependency` | `module`, `dependencies` | `module` is a wiring target ID, not a contract/unit ID. Adds only eligible dependencies not already wired to that implementation. |
|
|
30
30
|
| `move` | `module` | `module` is a unit ID. Optional `name`, `targetContext`, `aggregate`; omitted name/context keep the existing ones. A same-owner entity/value-object keeps its aggregate by default. The target aggregate must exist; the target context must be a discovered, allowed destination for that unit kind. Illegal cross-context imports reject the move. |
|
|
31
31
|
| `delete` | `module` | `module` is a unit ID. Deletes every file of the unit and its generated references (aggregate barrel re-export, in-memory DB section). Refused with `DELETE_NOT_ALLOWED` and `details.usedBy` while other files import it; nothing changes. |
|
|
@@ -4,7 +4,7 @@ When: an HTTP entry point (`../choosing-components.md`, step 2). It exposes a qu
|
|
|
4
4
|
|
|
5
5
|
## Generate (context only)
|
|
6
6
|
|
|
7
|
-
Prompts: controller (select: existing | `New controller` → name
|
|
7
|
+
Prompts: controller (select: `(root) — /<C>` | existing | `New controller` → name) → method (`get` `post` `patch` `delete` `put`) → relative path (may be empty: `default`) → {wire} `Handler:` (select: queries, commands, and use cases of `<C>`, grouped; skipped if there are none).
|
|
8
8
|
|
|
9
9
|
`… pick:Presentation "pick:New Handlers" "pick:New controller" text:orders pick:get text:recent pick:RecentOrdersQuery`
|
|
10
10
|
`… pick:Presentation "pick:New Handlers" pick:orders pick:post default pick:PlaceOrder`
|
|
@@ -15,7 +15,7 @@ For `sales`, `orders`, `get`, `recent`:
|
|
|
15
15
|
- {wire} `<C>/wiring/presentation/rest/orders/wire-orders-recent-get-endpoint.ts` (`[wireRestEndpointGeneratorPresentationService, wireRecentOrdersQuery]`; `[]` without the generator file) + a line in that folder's `index.ts`
|
|
16
16
|
- {wire}, new controller only: `<C>/wiring/presentation/rest/index.ts`, `<rootFolder>/presentation/rest/wires.ts` (lines appended), `<rootFolder>/presentation/rest/index.ts` (`restHandlers`, created once)
|
|
17
17
|
|
|
18
|
-
-
|
|
18
|
+
- `(root)`, context `social-networks`, `get`, empty path: `<C>/presentation/rest/(root)/GET.ts`, `class SocialNetworksGetEndpoint`, route `['social-networks']`, tag `'social-networks'`; {wire} `<C>/wiring/presentation/rest/(root)/wire-social-networks-get-endpoint.ts`, with `(root)` re-exported once like a controller. `(root)` is not a route segment. Use it for the context's own resource (`GET /social-networks`, `GET /social-networks/:id`, `POST /social-networks/from-scratch`) instead of a `list` controller or `/social-networks/social-networks`. A route belongs to one controller: `(root)/from-scratch` and controller `from-scratch` exclude each other, and no controller is named like the context.
|
|
19
19
|
|
|
20
20
|
The same controller, path, and method replace the existing endpoint (after `Overwrite them?`). Generate the exposed handler first, so `Handler:` lists it. If `handler: never` is left, re-run the endpoint generator once the handler exists, as an approved overwrite; don't replace it by hand.
|
|
21
21
|
|
package/dist/711.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import node_path from "node:path";
|
|
2
|
-
import { ProjectRoot, ConfigFile, File } from "./870.js";
|
|
3
|
-
const hasDependency = (name)=>{
|
|
4
|
-
const manifestFile = new File(node_path.join(new ProjectRoot().path, 'package.json'));
|
|
5
|
-
if (!manifestFile.exists) return false;
|
|
6
|
-
const manifest = JSON.parse(manifestFile.data);
|
|
7
|
-
return [
|
|
8
|
-
manifest.dependencies,
|
|
9
|
-
manifest.devDependencies,
|
|
10
|
-
manifest.optionalDependencies
|
|
11
|
-
].some((dependencies)=>dependencies && Object.hasOwn(dependencies, name));
|
|
12
|
-
};
|
|
13
|
-
const missingPackages = (packages)=>{
|
|
14
|
-
const missing = [
|
|
15
|
-
...new Set(packages)
|
|
16
|
-
].filter((name)=>!hasDependency(name));
|
|
17
|
-
return missing.length ? [
|
|
18
|
-
`npm i ${missing.join(' ')}`
|
|
19
|
-
] : [];
|
|
20
|
-
};
|
|
21
|
-
const missingDomainFirstPackages = ()=>missingPackages(ConfigFile.backend.domainFirstPackages);
|
|
22
|
-
export { hasDependency, missingDomainFirstPackages, missingPackages };
|