@domain-first/project-structure 8.5.0 → 8.6.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 +2 -0
- package/dist/287.js +79 -345
- package/dist/38.js +2 -2
- package/dist/526.js +376 -0
- package/dist/561.js +11 -10
- package/dist/{870.js → 780.js} +35 -1
- package/dist/{201.js → 947.js} +2 -36
- package/dist/agent-cli.d.ts +1 -1
- package/dist/agent-requests.d.ts +2 -2
- package/dist/graph.js +2 -2
- package/dist/index.cjs +137 -69
- package/dist/index.js +1 -1
- package/dist/init.cjs +7 -0
- package/dist/init.js +1 -1
- package/dist/integration.cjs +137 -69
- package/dist/integration.js +1 -1
- package/dist/integrations/openapi-extractor.d.ts +12 -0
- package/dist/lint.js +1 -1
- package/dist/react.cjs +137 -69
- 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 +375 -7
- package/dist/upgrade.js +166 -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 +3 -1
- package/dist/711.js +0 -22
|
@@ -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` | `
|
|
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) → 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).
|
|
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,6 +15,8 @@ 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
|
+
- `(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
|
+
|
|
18
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.
|
|
19
21
|
|
|
20
22
|
## Implement
|
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 };
|