ddd-ts-kit 0.84.0 → 0.85.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/CHANGELOG.md +50 -0
- package/README.fr.md +60 -27
- package/README.md +57 -28
- package/dist/check/canonical/stray-entry.js +3 -2
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/explain/layout-docs.js +1 -1
- package/dist/check/explain/layout-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +3 -2
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/explain/wiring-docs.d.ts.map +1 -1
- package/dist/check/explain/wiring-docs.js +17 -6
- package/dist/check/explain/wiring-docs.js.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/authz-policy-fixtures.js +4 -4
- package/dist/check/fixtures/authz-policy-fixtures.js.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/constructor-injection-fixtures.js +10 -8
- package/dist/check/fixtures/constructor-injection-fixtures.js.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/declarations-fixtures.js +54 -9
- package/dist/check/fixtures/declarations-fixtures.js.map +1 -1
- package/dist/check/fixtures/declared-declarations.d.ts +7 -0
- package/dist/check/fixtures/declared-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/declared-declarations.js +21 -0
- package/dist/check/fixtures/declared-declarations.js.map +1 -0
- package/dist/check/fixtures/declared-project.d.ts +4 -1
- package/dist/check/fixtures/declared-project.d.ts.map +1 -1
- package/dist/check/fixtures/declared-project.js +17 -9
- package/dist/check/fixtures/declared-project.js.map +1 -1
- package/dist/check/fixtures/paths.d.ts +1 -0
- package/dist/check/fixtures/paths.d.ts.map +1 -1
- package/dist/check/fixtures/paths.js +1 -0
- package/dist/check/fixtures/paths.js.map +1 -1
- package/dist/check/fixtures/signature-project.d.ts +3 -3
- package/dist/check/fixtures/signature-project.js +3 -3
- package/dist/check/fixtures/signature.d.ts +2 -1
- package/dist/check/fixtures/signature.d.ts.map +1 -1
- package/dist/check/fixtures/signature.js +2 -1
- package/dist/check/fixtures/signature.js.map +1 -1
- package/dist/check/fixtures/single-file-declarations.d.ts +7 -0
- package/dist/check/fixtures/single-file-declarations.d.ts.map +1 -0
- package/dist/check/fixtures/single-file-declarations.js +21 -0
- package/dist/check/fixtures/single-file-declarations.js.map +1 -0
- package/dist/check/rules/clean-file-size.d.ts.map +1 -1
- package/dist/check/rules/clean-file-size.js +9 -1
- package/dist/check/rules/clean-file-size.js.map +1 -1
- package/dist/check/rules/declarations-barrel-current.d.ts.map +1 -1
- package/dist/check/rules/declarations-barrel-current.js +56 -23
- package/dist/check/rules/declarations-barrel-current.js.map +1 -1
- package/dist/check/rules/naming-suffix.d.ts.map +1 -1
- package/dist/check/rules/naming-suffix.js +7 -3
- package/dist/check/rules/naming-suffix.js.map +1 -1
- package/dist/check/support/is-generated-context-file.d.ts +5 -1
- package/dist/check/support/is-generated-context-file.d.ts.map +1 -1
- package/dist/check/support/is-generated-context-file.js +11 -5
- package/dist/check/support/is-generated-context-file.js.map +1 -1
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +23 -11
- package/dist/commands/docs.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +7 -4
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/print-report.js +1 -0
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commit/is-derived.js +4 -4
- package/dist/commit/is-derived.js.map +1 -1
- package/dist/declared/barrel-file.d.ts +4 -1
- package/dist/declared/barrel-file.d.ts.map +1 -1
- package/dist/declared/barrel-file.js +4 -1
- package/dist/declared/barrel-file.js.map +1 -1
- package/dist/declared/context-declarations.d.ts +24 -0
- package/dist/declared/context-declarations.d.ts.map +1 -0
- package/dist/declared/context-declarations.js +22 -0
- package/dist/declared/context-declarations.js.map +1 -0
- package/dist/declared/declarations-folder-of.d.ts +10 -0
- package/dist/declared/declarations-folder-of.d.ts.map +1 -0
- package/dist/declared/declarations-folder-of.js +13 -0
- package/dist/declared/declarations-folder-of.js.map +1 -0
- package/dist/declared/folder-declarations-file.d.ts +7 -0
- package/dist/declared/folder-declarations-file.d.ts.map +1 -0
- package/dist/declared/folder-declarations-file.js +10 -0
- package/dist/declared/folder-declarations-file.js.map +1 -0
- package/dist/declared/index.d.ts +8 -1
- package/dist/declared/index.d.ts.map +1 -1
- package/dist/declared/index.js +8 -1
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/is-declarations-file.d.ts +7 -0
- package/dist/declared/is-declarations-file.d.ts.map +1 -0
- package/dist/declared/is-declarations-file.js +20 -0
- package/dist/declared/is-declarations-file.js.map +1 -0
- package/dist/declared/keeps-single-file.d.ts +11 -0
- package/dist/declared/keeps-single-file.d.ts.map +1 -0
- package/dist/declared/keeps-single-file.js +23 -0
- package/dist/declared/keeps-single-file.js.map +1 -0
- package/dist/declared/render-declarations.d.ts +18 -0
- package/dist/declared/render-declarations.d.ts.map +1 -0
- package/dist/declared/render-declarations.js +37 -0
- package/dist/declared/render-declarations.js.map +1 -0
- package/dist/declared/render-folder-declarations.d.ts +11 -0
- package/dist/declared/render-folder-declarations.d.ts.map +1 -0
- package/dist/declared/render-folder-declarations.js +23 -0
- package/dist/declared/render-folder-declarations.js.map +1 -0
- package/dist/declared/single-file-declarations.d.ts +9 -0
- package/dist/declared/single-file-declarations.d.ts.map +1 -0
- package/dist/declared/single-file-declarations.js +14 -0
- package/dist/declared/single-file-declarations.js.map +1 -0
- package/dist/declared/single-file-notice.d.ts +8 -0
- package/dist/declared/single-file-notice.d.ts.map +1 -0
- package/dist/declared/single-file-notice.js +9 -0
- package/dist/declared/single-file-notice.js.map +1 -0
- package/dist/derived/is-derived.d.ts +4 -3
- package/dist/derived/is-derived.d.ts.map +1 -1
- package/dist/derived/is-derived.js +8 -8
- package/dist/derived/is-derived.js.map +1 -1
- package/dist/describe/read-consumed-events.js +7 -2
- package/dist/describe/read-consumed-events.js.map +1 -1
- package/dist/dev/refresh-declarations.d.ts.map +1 -1
- package/dist/dev/refresh-declarations.js +3 -2
- package/dist/dev/refresh-declarations.js.map +1 -1
- package/dist/docs/write-docs.d.ts +3 -1
- package/dist/docs/write-docs.d.ts.map +1 -1
- package/dist/docs/write-docs.js +4 -2
- package/dist/docs/write-docs.js.map +1 -1
- package/dist/generate/context-imports.d.ts.map +1 -1
- package/dist/generate/context-imports.js +2 -1
- package/dist/generate/context-imports.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e/reaction-of.d.ts +14 -0
- package/dist/generate/kinds/e2e/reaction-of.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/reaction-of.js +93 -0
- package/dist/generate/kinds/e2e/reaction-of.js.map +1 -0
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +30 -18
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/refresh-barrels.d.ts +11 -4
- package/dist/generate/refresh-barrels.d.ts.map +1 -1
- package/dist/generate/refresh-barrels.js +41 -15
- package/dist/generate/refresh-barrels.js.map +1 -1
- package/dist/generate/refuse-shared-writes.js +1 -1
- package/dist/generate/refuse-shared-writes.js.map +1 -1
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +19 -16
- package/dist/help/notes.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/merge/classify-conflict.d.ts +2 -1
- package/dist/merge/classify-conflict.d.ts.map +1 -1
- package/dist/merge/classify-conflict.js +9 -0
- package/dist/merge/classify-conflict.js.map +1 -1
- package/dist/merge/higher-version.d.ts +7 -0
- package/dist/merge/higher-version.d.ts.map +1 -0
- package/dist/merge/higher-version.js +59 -0
- package/dist/merge/higher-version.js.map +1 -0
- package/dist/merge/merge-client-manifest.d.ts +16 -0
- package/dist/merge/merge-client-manifest.d.ts.map +1 -0
- package/dist/merge/merge-client-manifest.js +39 -0
- package/dist/merge/merge-client-manifest.js.map +1 -0
- package/dist/merge/merge-exclusions.d.ts +4 -3
- package/dist/merge/merge-exclusions.d.ts.map +1 -1
- package/dist/merge/merge-exclusions.js +6 -3
- package/dist/merge/merge-exclusions.js.map +1 -1
- package/dist/merge/resolve-conflict.d.ts +3 -2
- package/dist/merge/resolve-conflict.d.ts.map +1 -1
- package/dist/merge/resolve-conflict.js +29 -7
- package/dist/merge/resolve-conflict.js.map +1 -1
- package/dist/plan/batched-waves.d.ts +2 -0
- package/dist/plan/batched-waves.d.ts.map +1 -1
- package/dist/plan/batched-waves.js +20 -7
- package/dist/plan/batched-waves.js.map +1 -1
- package/dist/plan/format-plan.d.ts +1 -1
- package/dist/plan/format-plan.d.ts.map +1 -1
- package/dist/plan/format-plan.js +33 -8
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/plan/other-stories.d.ts +9 -0
- package/dist/plan/other-stories.d.ts.map +1 -0
- package/dist/plan/other-stories.js +31 -0
- package/dist/plan/other-stories.js.map +1 -0
- package/dist/plan/plan-waves.d.ts +2 -1
- package/dist/plan/plan-waves.d.ts.map +1 -1
- package/dist/plan/plan-waves.js +13 -4
- package/dist/plan/plan-waves.js.map +1 -1
- package/dist/plan/wave-plan.d.ts +28 -0
- package/dist/plan/wave-plan.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/briefing-of.js +4 -2
- package/dist/worker/briefing-of.js.map +1 -1
- package/dist/workspace/workspace-report.d.ts +2 -0
- package/dist/workspace/workspace-report.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +8 -0
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +24 -3
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +2 -2
- package/templates/e2e/e2e-reaction.spec.ts.tpl +68 -0
- package/templates/init/AGENTS.md.tpl +1 -1
- package/templates/init/README.md.tpl +2 -1
- package/templates/init/e2e/start-application.database.ts.tpl +22 -2
- package/templates/init/e2e/start-application.memory.ts.tpl +22 -2
- package/templates/init/platform/events/custom-event-bus.ts.tpl +1 -1
- package/templates/init/platform/events/in-process-events.ts.tpl +1 -1
- package/templates/init/rules/tests.md.tpl +1 -1
- package/templates/pipeline/biome.json.tpl +1 -0
- package/templates/pipeline/github/actions/setup/action.yml.tpl +3 -0
- package/templates/pipeline/github/workflows/ci.yml.tpl +12 -12
- package/templates/pipeline/github/workflows/codeql.yml +1 -1
- package/templates/pipeline/github/workflows/copilot-setup-steps.yml +1 -1
- package/templates/pipeline/github/workflows/pr-title.yml +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -0
- package/templates/test-world/world.buses.ts.tpl +1 -1
- package/templates/test-world/world.tsyringe.ts.tpl +1 -0
- package/dist/check/fixtures/declared-barrel.d.ts +0 -3
- package/dist/check/fixtures/declared-barrel.d.ts.map +0 -1
- package/dist/check/fixtures/declared-barrel.js +0 -4
- package/dist/check/fixtures/declared-barrel.js.map +0 -1
- package/dist/declared/render-barrel.d.ts +0 -11
- package/dist/declared/render-barrel.d.ts.map +0 -1
- package/dist/declared/render-barrel.js +0 -29
- package/dist/declared/render-barrel.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-declarations.d.ts","sourceRoot":"","sources":["../../src/declared/context-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAGtD,oDAAoD;AACpD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2DAA2D;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,uEAAuE;IACvE,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAChD;AAED,uHAAuH;AACvH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;CAChD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,GACZ,EAAE,eAAe,GAAG,mBAAmB,CAiBvC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { contextInjections } from './injection/context-injections.js';
|
|
2
|
+
import { renderInjections } from './injection/render-injections.js';
|
|
3
|
+
import { renderDeclarations } from './render-declarations.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the generator writes for a context assembled by barrel, and what `declarations/barrel-current`
|
|
6
|
+
* compares the tree with: one declarations file per role folder and the summary at the root.
|
|
7
|
+
*/
|
|
8
|
+
export function contextDeclarations({ context, directory, entries, sources, specifierOf, }) {
|
|
9
|
+
const injections = [];
|
|
10
|
+
const files = renderDeclarations({
|
|
11
|
+
context,
|
|
12
|
+
files: entries,
|
|
13
|
+
specifierOf: (entry) => specifierOf(`${directory}/${entry}`),
|
|
14
|
+
injectedIn: (roleFiles) => {
|
|
15
|
+
const read = contextInjections(sources, directory, roleFiles);
|
|
16
|
+
injections.push(...read);
|
|
17
|
+
return renderInjections(read, specifierOf);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
return { files, injections };
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=context-declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-declarations.js","sourceRoot":"","sources":["../../src/declared/context-declarations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAoB9D;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAClC,OAAO,EACP,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,GACK;IAChB,MAAM,UAAU,GAAqB,EAAE,CAAC;IAExC,MAAM,KAAK,GAAG,kBAAkB,CAAC;QAC/B,OAAO;QACP,KAAK,EAAE,OAAO;QACd,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC;QAC5D,UAAU,EAAE,CAAC,SAAS,EAAE,EAAE;YACxB,MAAM,IAAI,GAAG,iBAAiB,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;YAE9D,UAAU,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YAEzB,OAAO,gBAAgB,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The role folder a role file of a context belongs to, both relative to the context: the folder
|
|
3
|
+
* at `<layer>/<folder>/`, so that a file of a use case
|
|
4
|
+
* (`application/commands/issue-invoice/issue-invoice.handler.ts`) or of a route
|
|
5
|
+
* (`presentation/http/invoices/issue-invoice/issue-invoice.controller.ts`) rolls up to
|
|
6
|
+
* `application/commands` or `presentation/http`; a file sitting directly in its layer
|
|
7
|
+
* (`infrastructure/tax-rates.gateway.ts`) belongs to the layer itself.
|
|
8
|
+
*/
|
|
9
|
+
export declare function declarationsFolderOf(file: string): string;
|
|
10
|
+
//# sourceMappingURL=declarations-folder-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations-folder-of.d.ts","sourceRoot":"","sources":["../../src/declared/declarations-folder-of.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIzD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The role folder a role file of a context belongs to, both relative to the context: the folder
|
|
3
|
+
* at `<layer>/<folder>/`, so that a file of a use case
|
|
4
|
+
* (`application/commands/issue-invoice/issue-invoice.handler.ts`) or of a route
|
|
5
|
+
* (`presentation/http/invoices/issue-invoice/issue-invoice.controller.ts`) rolls up to
|
|
6
|
+
* `application/commands` or `presentation/http`; a file sitting directly in its layer
|
|
7
|
+
* (`infrastructure/tax-rates.gateway.ts`) belongs to the layer itself.
|
|
8
|
+
*/
|
|
9
|
+
export function declarationsFolderOf(file) {
|
|
10
|
+
const [layer = '', folder, ...rest] = file.split('/');
|
|
11
|
+
return folder === undefined || rest.length === 0 ? layer : `${layer}/${folder}`;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=declarations-folder-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declarations-folder-of.js","sourceRoot":"","sources":["../../src/declared/declarations-folder-of.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEtD,OAAO,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC;AAClF,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The generated declarations of a role folder (`declarationsFolderOf`), relative to the context:
|
|
3
|
+
* the file named after the folder, inside it, `application/commands/commands.declarations.ts`. It
|
|
4
|
+
* exports the role files of the folder and registers what their constructors are injected.
|
|
5
|
+
*/
|
|
6
|
+
export declare function folderDeclarationsFile(folder: string): string;
|
|
7
|
+
//# sourceMappingURL=folder-declarations-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder-declarations-file.d.ts","sourceRoot":"","sources":["../../src/declared/folder-declarations-file.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE7D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
/**
|
|
3
|
+
* The generated declarations of a role folder (`declarationsFolderOf`), relative to the context:
|
|
4
|
+
* the file named after the folder, inside it, `application/commands/commands.declarations.ts`. It
|
|
5
|
+
* exports the role files of the folder and registers what their constructors are injected.
|
|
6
|
+
*/
|
|
7
|
+
export function folderDeclarationsFile(folder) {
|
|
8
|
+
return `${folder}/${path.posix.basename(folder)}.declarations.ts`;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=folder-declarations-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder-declarations-file.js","sourceRoot":"","sources":["../../src/declared/folder-declarations-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc;IACnD,OAAO,GAAG,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC;AACpE,CAAC"}
|
package/dist/declared/index.d.ts
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
export { barrelFile } from './barrel-file.js';
|
|
2
|
+
export { contextDeclarations, type DeclaredContext } from './context-declarations.js';
|
|
2
3
|
export { DECLARED_ROLES, DISCOVERED_SUFFIXES, EDGE_SUFFIXES, type DeclaredRole } from './declared-role.js';
|
|
3
4
|
export { declaredRoleOf } from './declared-role-of.js';
|
|
5
|
+
export { declarationsFolderOf } from './declarations-folder-of.js';
|
|
4
6
|
export { dependenciesFile } from './dependencies-file.js';
|
|
7
|
+
export { folderDeclarationsFile } from './folder-declarations-file.js';
|
|
5
8
|
export { generatedDrift } from './generated-drift.js';
|
|
6
9
|
export type { ClassInjection } from './injection/class-injection.js';
|
|
7
10
|
export { contextInjections } from './injection/context-injections.js';
|
|
8
11
|
export { renderInjections } from './injection/render-injections.js';
|
|
9
12
|
export type { Sources } from './injection/sources.js';
|
|
10
|
-
export {
|
|
13
|
+
export { isDeclarationsFile } from './is-declarations-file.js';
|
|
14
|
+
export { renderDeclarations } from './render-declarations.js';
|
|
11
15
|
export { renderDependenciesFile } from './render-dependencies-file.js';
|
|
16
|
+
export { keepsSingleFile } from './keeps-single-file.js';
|
|
17
|
+
export { singleFileDeclarations } from './single-file-declarations.js';
|
|
18
|
+
export { singleFileNotice } from './single-file-notice.js';
|
|
12
19
|
export { routesFile } from './routes-file.js';
|
|
13
20
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/declared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC3G,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM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AAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/declared/index.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
export { barrelFile } from './barrel-file.js';
|
|
2
|
+
export { contextDeclarations } from './context-declarations.js';
|
|
2
3
|
export { DECLARED_ROLES, DISCOVERED_SUFFIXES, EDGE_SUFFIXES } from './declared-role.js';
|
|
3
4
|
export { declaredRoleOf } from './declared-role-of.js';
|
|
5
|
+
export { declarationsFolderOf } from './declarations-folder-of.js';
|
|
4
6
|
export { dependenciesFile } from './dependencies-file.js';
|
|
7
|
+
export { folderDeclarationsFile } from './folder-declarations-file.js';
|
|
5
8
|
export { generatedDrift } from './generated-drift.js';
|
|
6
9
|
export { contextInjections } from './injection/context-injections.js';
|
|
7
10
|
export { renderInjections } from './injection/render-injections.js';
|
|
8
|
-
export {
|
|
11
|
+
export { isDeclarationsFile } from './is-declarations-file.js';
|
|
12
|
+
export { renderDeclarations } from './render-declarations.js';
|
|
9
13
|
export { renderDependenciesFile } from './render-dependencies-file.js';
|
|
14
|
+
export { keepsSingleFile } from './keeps-single-file.js';
|
|
15
|
+
export { singleFileDeclarations } from './single-file-declarations.js';
|
|
16
|
+
export { singleFileNotice } from './single-file-notice.js';
|
|
10
17
|
export { routesFile } from './routes-file.js';
|
|
11
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/declared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AAC3G,OAAO,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AE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* True for a file the generator writes for a declared context assembled by barrel, given relative
|
|
3
|
+
* to the context: the summary at its root, `<context>.declarations.ts`, or the declarations of a
|
|
4
|
+
* role folder, `<layer>/<folder>/<folder>.declarations.ts` or `<layer>/<layer>.declarations.ts`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isDeclarationsFile(context: string, file: string): boolean;
|
|
7
|
+
//# sourceMappingURL=is-declarations-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-declarations-file.d.ts","sourceRoot":"","sources":["../../src/declared/is-declarations-file.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CASzE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { barrelFile } from './barrel-file.js';
|
|
3
|
+
import { DECLARED_ROLES } from './declared-role.js';
|
|
4
|
+
import { folderDeclarationsFile } from './folder-declarations-file.js';
|
|
5
|
+
/** The layers role files live in: `application`, `infrastructure`, `presentation`. */
|
|
6
|
+
const ROLE_LAYERS = new Set(DECLARED_ROLES.flatMap((role) => role.folders.map((folder) => folder.split('/')[0])));
|
|
7
|
+
/**
|
|
8
|
+
* True for a file the generator writes for a declared context assembled by barrel, given relative
|
|
9
|
+
* to the context: the summary at its root, `<context>.declarations.ts`, or the declarations of a
|
|
10
|
+
* role folder, `<layer>/<folder>/<folder>.declarations.ts` or `<layer>/<layer>.declarations.ts`.
|
|
11
|
+
*/
|
|
12
|
+
export function isDeclarationsFile(context, file) {
|
|
13
|
+
if (file === barrelFile(context)) {
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
const folder = path.posix.dirname(file);
|
|
17
|
+
const [layer = '', ...deeper] = folder.split('/');
|
|
18
|
+
return ROLE_LAYERS.has(layer) && deeper.length <= 1 && file === folderDeclarationsFile(folder);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=is-declarations-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-declarations-file.js","sourceRoot":"","sources":["../../src/declared/is-declarations-file.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,sFAAsF;AACtF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAElH;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,IAAY;IAC9D,IAAI,IAAI,KAAK,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElD,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,KAAK,sBAAsB,CAAC,MAAM,CAAC,CAAC;AACjG,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DeclaredContext } from './context-declarations.js';
|
|
2
|
+
/**
|
|
3
|
+
* True while a context keeps its declarations in the single file the generator wrote up to 0.84:
|
|
4
|
+
* no role folder holds a declarations file yet, and `<context>.declarations.ts` (`written`) is
|
|
5
|
+
* exactly what that generator would write for the role files and constructors of today. This
|
|
6
|
+
* version accepts it with a warning (`singleFileNotice`), so that upgrading the kit fails no gate;
|
|
7
|
+
* a later minor version refuses it. A single file that is itself stale, or a context half moved,
|
|
8
|
+
* is not this case.
|
|
9
|
+
*/
|
|
10
|
+
export declare function keepsSingleFile(declared: DeclaredContext, written: string | undefined): boolean;
|
|
11
|
+
//# sourceMappingURL=keeps-single-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keeps-single-file.d.ts","sourceRoot":"","sources":["../../src/declared/keeps-single-file.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAOjE;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAW/F"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { barrelFile } from './barrel-file.js';
|
|
2
|
+
import { isDeclarationsFile } from './is-declarations-file.js';
|
|
3
|
+
import { singleFileDeclarations } from './single-file-declarations.js';
|
|
4
|
+
/** What both layouts write for a context that declares no role file: such a context is current either way. */
|
|
5
|
+
const NOTHING_DECLARED = 'export {};\n';
|
|
6
|
+
/**
|
|
7
|
+
* True while a context keeps its declarations in the single file the generator wrote up to 0.84:
|
|
8
|
+
* no role folder holds a declarations file yet, and `<context>.declarations.ts` (`written`) is
|
|
9
|
+
* exactly what that generator would write for the role files and constructors of today. This
|
|
10
|
+
* version accepts it with a warning (`singleFileNotice`), so that upgrading the kit fails no gate;
|
|
11
|
+
* a later minor version refuses it. A single file that is itself stale, or a context half moved,
|
|
12
|
+
* is not this case.
|
|
13
|
+
*/
|
|
14
|
+
export function keepsSingleFile(declared, written) {
|
|
15
|
+
const { context, entries } = declared;
|
|
16
|
+
const moving = entries.some((entry) => entry !== barrelFile(context) && isDeclarationsFile(context, entry));
|
|
17
|
+
if (written === undefined || moving) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const single = singleFileDeclarations(declared);
|
|
21
|
+
return single !== NOTHING_DECLARED && written.replaceAll('\r\n', '\n') === single;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=keeps-single-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keeps-single-file.js","sourceRoot":"","sources":["../../src/declared/keeps-single-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,8GAA8G;AAC9G,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC;;;;;;;GAOG;AACH,MAAM,UAAU,eAAe,CAAC,QAAyB,EAAE,OAA2B;IACpF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;IACtC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,UAAU,CAAC,OAAO,CAAC,IAAI,kBAAkB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;IAE5G,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,EAAE,CAAC;QACpC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,MAAM,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAEhD,OAAO,MAAM,KAAK,gBAAgB,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,MAAM,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RenderedInjections } from './injection/rendered-injections.js';
|
|
2
|
+
/** What the declarations of a context are rendered from; every file is relative to the context. */
|
|
3
|
+
export interface DeclarationsSource {
|
|
4
|
+
readonly context: string;
|
|
5
|
+
readonly files: readonly string[];
|
|
6
|
+
/** How a generated import names a file of the context: its alias, ending as the project writes its imports. */
|
|
7
|
+
readonly specifierOf: (file: string) => string;
|
|
8
|
+
/** The registrations of what the classes of these role files are given, all of one folder. */
|
|
9
|
+
readonly injectedIn: (roleFiles: readonly string[]) => RenderedInjections;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Every generated declarations file of a context assembled by barrel, by path relative to the
|
|
13
|
+
* context: one per role folder that holds a role file (`folderDeclarationsFile`), then the summary
|
|
14
|
+
* at the root, `<context>.declarations.ts`, which only re-exports them, sorted by path. Nested
|
|
15
|
+
* `export *` flatten: the namespace the composition root imports holds every declared class.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderDeclarations({ context, files, specifierOf, injectedIn, }: DeclarationsSource): Map<string, string>;
|
|
18
|
+
//# sourceMappingURL=render-declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-declarations.d.ts","sourceRoot":"","sources":["../../src/declared/render-declarations.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAG7E,mGAAmG;AACnG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,+GAA+G;IAC/G,QAAQ,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC/C,8FAA8F;IAC9F,QAAQ,CAAC,UAAU,EAAE,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,KAAK,kBAAkB,CAAC;CAC3E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,KAAK,EACL,WAAW,EACX,UAAU,GACX,EAAE,kBAAkB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB1C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { barrelFile } from './barrel-file.js';
|
|
2
|
+
import { declaredRoleOf } from './declared-role-of.js';
|
|
3
|
+
import { declarationsFolderOf } from './declarations-folder-of.js';
|
|
4
|
+
import { folderDeclarationsFile } from './folder-declarations-file.js';
|
|
5
|
+
import { renderFolderDeclarations } from './render-folder-declarations.js';
|
|
6
|
+
/**
|
|
7
|
+
* Every generated declarations file of a context assembled by barrel, by path relative to the
|
|
8
|
+
* context: one per role folder that holds a role file (`folderDeclarationsFile`), then the summary
|
|
9
|
+
* at the root, `<context>.declarations.ts`, which only re-exports them, sorted by path. Nested
|
|
10
|
+
* `export *` flatten: the namespace the composition root imports holds every declared class.
|
|
11
|
+
*/
|
|
12
|
+
export function renderDeclarations({ context, files, specifierOf, injectedIn, }) {
|
|
13
|
+
const byFolder = new Map();
|
|
14
|
+
for (const file of [...new Set(files)].filter((candidate) => declaredRoleOf(candidate) !== undefined).sort()) {
|
|
15
|
+
const folder = folderDeclarationsFile(declarationsFolderOf(file));
|
|
16
|
+
byFolder.set(folder, [...(byFolder.get(folder) ?? []), file]);
|
|
17
|
+
}
|
|
18
|
+
const rendered = new Map();
|
|
19
|
+
for (const [folderFile, roleFiles] of [...byFolder].sort(([left], [right]) => byPath(left, right))) {
|
|
20
|
+
rendered.set(folderFile, renderFolderDeclarations(roleFiles, specifierOf, injectedIn(roleFiles)));
|
|
21
|
+
}
|
|
22
|
+
rendered.set(barrelFile(context), summaryOf([...rendered.keys()], specifierOf));
|
|
23
|
+
return rendered;
|
|
24
|
+
}
|
|
25
|
+
function summaryOf(folderFiles, specifierOf) {
|
|
26
|
+
if (folderFiles.length === 0) {
|
|
27
|
+
return 'export {};\n';
|
|
28
|
+
}
|
|
29
|
+
return `${folderFiles.map((file) => `export * from '${specifierOf(file)}';`).join('\n')}\n`;
|
|
30
|
+
}
|
|
31
|
+
function byPath(left, right) {
|
|
32
|
+
if (left === right) {
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
return left < right ? -1 : 1;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=render-declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-declarations.js","sourceRoot":"","sources":["../../src/declared/render-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAY3E;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,EACjC,OAAO,EACP,KAAK,EACL,WAAW,EACX,UAAU,GACS;IACnB,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAC;IAE7C,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;QAC7G,MAAM,MAAM,GAAG,sBAAsB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC;QAElE,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE3C,KAAK,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;QACnG,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,wBAAwB,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;IACpG,CAAC;IAED,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;IAEhF,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,SAAS,CAAC,WAA8B,EAAE,WAAqC;IACtF,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9F,CAAC;AAED,SAAS,MAAM,CAAC,IAAY,EAAE,KAAa;IACzC,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RenderedInjections } from './injection/rendered-injections.js';
|
|
2
|
+
/**
|
|
3
|
+
* The declarations of one role folder: the imports the registrations need, one `export *` per
|
|
4
|
+
* role file of the folder, named by the specifier `specifierOf` gives it and sorted by path, then
|
|
5
|
+
* one `injected(Class, [Tokens])` per class of the folder whose constructor takes something its
|
|
6
|
+
* decorator does not list, read from the constructor signatures. `files` are relative to the
|
|
7
|
+
* context. It is derived from the tree, never edited by hand: `ddd-ts-kit check` reports a file
|
|
8
|
+
* that differs (`declarations/barrel-current`).
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderFolderDeclarations(files: readonly string[], specifierOf: (file: string) => string, injected?: RenderedInjections): string;
|
|
11
|
+
//# sourceMappingURL=render-folder-declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-folder-declarations.d.ts","sourceRoot":"","sources":["../../src/declared/render-folder-declarations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAI7E;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EACrC,QAAQ,GAAE,kBAA4B,GACrC,MAAM,CAcR"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { declaredRoleOf } from './declared-role-of.js';
|
|
2
|
+
import { laidOutCalls } from './injection/laid-out-calls.js';
|
|
3
|
+
const NOTHING = { imports: [], calls: [] };
|
|
4
|
+
/**
|
|
5
|
+
* The declarations of one role folder: the imports the registrations need, one `export *` per
|
|
6
|
+
* role file of the folder, named by the specifier `specifierOf` gives it and sorted by path, then
|
|
7
|
+
* one `injected(Class, [Tokens])` per class of the folder whose constructor takes something its
|
|
8
|
+
* decorator does not list, read from the constructor signatures. `files` are relative to the
|
|
9
|
+
* context. It is derived from the tree, never edited by hand: `ddd-ts-kit check` reports a file
|
|
10
|
+
* that differs (`declarations/barrel-current`).
|
|
11
|
+
*/
|
|
12
|
+
export function renderFolderDeclarations(files, specifierOf, injected = NOTHING) {
|
|
13
|
+
const roleFiles = [...new Set(files.filter((file) => declaredRoleOf(file) !== undefined))].sort();
|
|
14
|
+
if (roleFiles.length === 0) {
|
|
15
|
+
return 'export {};\n';
|
|
16
|
+
}
|
|
17
|
+
const exported = roleFiles.map((file) => `export * from '${specifierOf(file)}';`).join('\n');
|
|
18
|
+
if (injected.calls.length === 0) {
|
|
19
|
+
return `${exported}\n`;
|
|
20
|
+
}
|
|
21
|
+
return `${injected.imports.join('\n')}\n\n${exported}\n\n${laidOutCalls(injected.calls)}\n`;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=render-folder-declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-folder-declarations.js","sourceRoot":"","sources":["../../src/declared/render-folder-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D,MAAM,OAAO,GAAuB,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAE/D;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CACtC,KAAwB,EACxB,WAAqC,EACrC,QAAQ,GAAuB,OAAO;IAEtC,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAElG,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,MAAM,QAAQ,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE7F,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,GAAG,QAAQ,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,QAAQ,OAAO,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeclaredContext } from './context-declarations.js';
|
|
2
|
+
/**
|
|
3
|
+
* The declarations of a context as the generator wrote them up to 0.84, all in
|
|
4
|
+
* `<context>.declarations.ts`: one `export *` per role file of the context, sorted by path, then
|
|
5
|
+
* the imports and the `injected(Class, [Tokens])` of every class of the context that takes
|
|
6
|
+
* something. Only `keepsSingleFile` reads it, to recognise a project that has not moved yet.
|
|
7
|
+
*/
|
|
8
|
+
export declare function singleFileDeclarations({ directory, entries, sources, specifierOf }: DeclaredContext): string;
|
|
9
|
+
//# sourceMappingURL=single-file-declarations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-file-declarations.d.ts","sourceRoot":"","sources":["../../src/declared/single-file-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAKjE;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,eAAe,GAAG,MAAM,CAI5G"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { contextInjections } from './injection/context-injections.js';
|
|
2
|
+
import { renderInjections } from './injection/render-injections.js';
|
|
3
|
+
import { renderFolderDeclarations } from './render-folder-declarations.js';
|
|
4
|
+
/**
|
|
5
|
+
* The declarations of a context as the generator wrote them up to 0.84, all in
|
|
6
|
+
* `<context>.declarations.ts`: one `export *` per role file of the context, sorted by path, then
|
|
7
|
+
* the imports and the `injected(Class, [Tokens])` of every class of the context that takes
|
|
8
|
+
* something. Only `keepsSingleFile` reads it, to recognise a project that has not moved yet.
|
|
9
|
+
*/
|
|
10
|
+
export function singleFileDeclarations({ directory, entries, sources, specifierOf }) {
|
|
11
|
+
const injected = renderInjections(contextInjections(sources, directory, entries), specifierOf);
|
|
12
|
+
return renderFolderDeclarations(entries, (entry) => specifierOf(`${directory}/${entry}`), injected);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=single-file-declarations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-file-declarations.js","sourceRoot":"","sources":["../../src/declared/single-file-declarations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAmB;IAClG,MAAM,QAAQ,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,CAAC;IAE/F,OAAO,wBAAwB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AACtG,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** What a finding, a note or a warning says of a context that `keepsSingleFile`. */
|
|
2
|
+
export interface SingleFileNotice {
|
|
3
|
+
readonly message: string;
|
|
4
|
+
readonly fix: string;
|
|
5
|
+
}
|
|
6
|
+
/** What `check`, `docs --check` and `generate --local-only` say of a context that `keepsSingleFile`. */
|
|
7
|
+
export declare function singleFileNotice(context: string): SingleFileNotice;
|
|
8
|
+
//# sourceMappingURL=single-file-notice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-file-notice.d.ts","sourceRoot":"","sources":["../../src/declared/single-file-notice.ts"],"names":[],"mappings":"AAEA,oFAAoF;AACpF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,wGAAwG;AACxG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAKlE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { barrelFile } from './barrel-file.js';
|
|
2
|
+
/** What `check`, `docs --check` and `generate --local-only` say of a context that `keepsSingleFile`. */
|
|
3
|
+
export function singleFileNotice(context) {
|
|
4
|
+
return {
|
|
5
|
+
message: `"${context}" still keeps all its declarations in ${barrelFile(context)}, the single file the generator wrote up to 0.84: it is current, so this version accepts it, and a later minor version reports it as an error.`,
|
|
6
|
+
fix: `Run \`npx ddd-ts-kit docs\` (or any \`generate\`, or \`npm run dev\`), which writes the <folder>.declarations.ts of each role folder and rewrites ${barrelFile(context)} as their summary, and commit the result.`,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=single-file-notice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"single-file-notice.js","sourceRoot":"","sources":["../../src/declared/single-file-notice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ9C,wGAAwG;AACxG,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,OAAO;QACL,OAAO,EAAE,IAAI,OAAO,yCAAyC,UAAU,CAAC,OAAO,CAAC,gJAAgJ;QAChO,GAAG,EAAE,qJAAqJ,UAAU,CAAC,OAAO,CAAC,2CAA2C;KACzN,CAAC;AACJ,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Config } from '../config/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* What `npm run regenerate` rewrites: the dependency rules, the context map, the
|
|
4
|
-
* of each context
|
|
5
|
-
* written again from the sources. `path` is relative
|
|
3
|
+
* What `npm run regenerate` rewrites: the dependency rules, the context map, the declarations and
|
|
4
|
+
* lists of each context (at its root and in its role folders), the contracts and their clients.
|
|
5
|
+
* Such a file is never merged by hand: it is written again from the sources. `path` is relative
|
|
6
|
+
* to the project root, with POSIX separators.
|
|
6
7
|
*/
|
|
7
8
|
export declare function isDerived(path: string, { contextsDir }: Pick<Config, 'contextsDir'>): boolean;
|
|
8
9
|
//# sourceMappingURL=is-derived.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-derived.d.ts","sourceRoot":"","sources":["../../src/derived/is-derived.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-derived.d.ts","sourceRoot":"","sources":["../../src/derived/is-derived.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,OAAO,CAc7F"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { isDeclarationsFile } from '../declared/index.js';
|
|
1
2
|
/**
|
|
2
|
-
* What `npm run regenerate` rewrites: the dependency rules, the context map, the
|
|
3
|
-
* of each context
|
|
4
|
-
* written again from the sources. `path` is relative
|
|
3
|
+
* What `npm run regenerate` rewrites: the dependency rules, the context map, the declarations and
|
|
4
|
+
* lists of each context (at its root and in its role folders), the contracts and their clients.
|
|
5
|
+
* Such a file is never merged by hand: it is written again from the sources. `path` is relative
|
|
6
|
+
* to the project root, with POSIX separators.
|
|
5
7
|
*/
|
|
6
8
|
export function isDerived(path, { contextsDir }) {
|
|
7
|
-
const [context,
|
|
8
|
-
|
|
9
|
-
: [];
|
|
9
|
+
const [context, ...inside] = path.startsWith(`${contextsDir}/`) ? path.slice(contextsDir.length + 1).split('/') : [];
|
|
10
|
+
const file = inside.join('/');
|
|
10
11
|
const ofAContext = context !== undefined &&
|
|
11
|
-
|
|
12
|
-
(file === 'CONTEXT.md' || file === `${context}.declarations.ts` || file === `${context}.dependencies.ts`);
|
|
12
|
+
(file === 'CONTEXT.md' || file === `${context}.dependencies.ts` || isDeclarationsFile(context, file));
|
|
13
13
|
return (ofAContext ||
|
|
14
14
|
path === '.dependency-cruiser.cjs' ||
|
|
15
15
|
path === 'docs/context-map.md' ||
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-derived.js","sourceRoot":"","sources":["../../src/derived/is-derived.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-derived.js","sourceRoot":"","sources":["../../src/derived/is-derived.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,EAAE,WAAW,EAA+B;IAClF,MAAM,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACrH,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAE9B,MAAM,UAAU,GACd,OAAO,KAAK,SAAS;QACrB,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,KAAK,GAAG,OAAO,kBAAkB,IAAI,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAExG,OAAO,CACL,UAAU;QACV,IAAI,KAAK,yBAAyB;QAClC,IAAI,KAAK,qBAAqB;QAC9B,0CAA0C,CAAC,IAAI,CAAC,IAAI,CAAC,CACtD,CAAC;AACJ,CAAC"}
|
|
@@ -41,9 +41,14 @@ function wiringOf(module, handler) {
|
|
|
41
41
|
.filter((statement) => named.test(statement))
|
|
42
42
|
.join('\n');
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
44
|
+
/**
|
|
45
|
+
* The declaration a handler is given (`@IntegrationEventHandler(definition`, `on(definition`,
|
|
46
|
+
* `consume(definition` behind a broker) or reads its type from (`eventType = definition.type`),
|
|
47
|
+
* found in the published language it is imported from.
|
|
48
|
+
*/
|
|
45
49
|
function givenDefinition({ ws, config }, text) {
|
|
46
|
-
const local = /(?:@IntegrationEventHandler|\bon)\(\s*(\w+)\s*,/.exec(text)?.[1]
|
|
50
|
+
const local = /(?:@IntegrationEventHandler|\bon|\bconsume)\(\s*(\w+)\s*,/.exec(text)?.[1] ??
|
|
51
|
+
/\bstatic readonly eventType = (\w+)\.type\b/.exec(text)?.[1];
|
|
47
52
|
for (const [, names = '', from = ''] of text.matchAll(/\bimport \{([^}]*)\} from '([^']*\/published-language\/[^']*)'/g)) {
|
|
48
53
|
const context = /([a-z0-9-]+)\/published-language\//.exec(from)?.[1] ?? '';
|
|
49
54
|
const original = originalName(names, local);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read-consumed-events.js","sourceRoot":"","sources":["../../src/describe/read-consumed-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,oBAAoB,EAAwB,MAAM,6BAA6B,CAAC;AAEzF,MAAM,MAAM,GAAG,kCAAkC,CAAC;AAClD,MAAM,MAAM,GAAG,yBAAyB,CAAC;AAEzC,4HAA4H;AAC5H,MAAM,UAAU,kBAAkB,CAAC,OAA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AI,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;SAC5C,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-declarations.d.ts","sourceRoot":"","sources":["../../src/dev/refresh-declarations.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"refresh-declarations.d.ts","sourceRoot":"","sources":["../../src/dev/refresh-declarations.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,SAAS,MAAM,EAAE,CAsBlG"}
|
|
@@ -14,11 +14,12 @@ export function refreshDeclarations(start, tell) {
|
|
|
14
14
|
const root = findRoot(start);
|
|
15
15
|
const ws = new Workspace(root, false);
|
|
16
16
|
refreshBarrels(ws, readConfig(root).config);
|
|
17
|
-
const { created, updated, notes } = ws.commit(false);
|
|
17
|
+
const { created, updated, deleted, notes } = ws.commit(false);
|
|
18
18
|
const rewritten = [...created, ...updated];
|
|
19
19
|
rewritten.forEach((file) => tell(`ddd-ts-kit: rewrote ${file} from the role files and their constructors`));
|
|
20
|
+
deleted.forEach((file) => tell(`ddd-ts-kit: deleted ${file}: its folder holds no declared class any more`));
|
|
20
21
|
notes.forEach((note) => tell(`ddd-ts-kit: ${note}`));
|
|
21
|
-
return rewritten;
|
|
22
|
+
return [...rewritten, ...deleted];
|
|
22
23
|
}
|
|
23
24
|
catch (error) {
|
|
24
25
|
tell(`ddd-ts-kit: the generated declarations were not refreshed: ${error instanceof Error ? error.message : String(error)}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-declarations.js","sourceRoot":"","sources":["../../src/dev/refresh-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa,EAAE,IAA4B;IAC7E,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEtC,cAAc,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;QAE5C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"refresh-declarations.js","sourceRoot":"","sources":["../../src/dev/refresh-declarations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa,EAAE,IAA4B;IAC7E,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC7B,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QAEtC,cAAc,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;QAE5C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC;QAE3C,SAAS,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,uBAAuB,IAAI,6CAA6C,CAAC,CAAC,CAAC;QAC5G,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,uBAAuB,IAAI,+CAA+C,CAAC,CAAC,CAAC;QAC5G,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,CAAC;QAErD,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC,CAAC;IACpC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CACF,8DAA8D,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACvH,CAAC;QAEF,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { Config } from '../config/index.js';
|
|
2
|
+
import { type SingleFile } from '../generate/refresh-barrels.js';
|
|
2
3
|
import type { Workspace } from '../workspace/index.js';
|
|
3
4
|
/**
|
|
4
5
|
* Plans every generated part of the documentation: the lists of each CONTEXT.md, the block
|
|
5
6
|
* of the context map, the barrel of each declared context, and, once, the skeleton of what only people can write. The caller commits the workspace, or reads what it would change to detect drift.
|
|
7
|
+
* Answers the contexts left in the single declarations file of 0.84, which `singleFile` keeps.
|
|
6
8
|
*/
|
|
7
|
-
export declare function writeDocs(ws: Workspace, config: Config):
|
|
9
|
+
export declare function writeDocs(ws: Workspace, config: Config, singleFile?: SingleFile): string[];
|
|
8
10
|
//# sourceMappingURL=write-docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-docs.d.ts","sourceRoot":"","sources":["../../src/docs/write-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"write-docs.d.ts","sourceRoot":"","sources":["../../src/docs/write-docs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAGjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAUvD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,UAAmB,GAAG,MAAM,EAAE,CAwBlG"}
|
package/dist/docs/write-docs.js
CHANGED
|
@@ -12,8 +12,9 @@ const INTEGRATION_README = 'docs/integration/README.md';
|
|
|
12
12
|
/**
|
|
13
13
|
* Plans every generated part of the documentation: the lists of each CONTEXT.md, the block
|
|
14
14
|
* of the context map, the barrel of each declared context, and, once, the skeleton of what only people can write. The caller commits the workspace, or reads what it would change to detect drift.
|
|
15
|
+
* Answers the contexts left in the single declarations file of 0.84, which `singleFile` keeps.
|
|
15
16
|
*/
|
|
16
|
-
export function writeDocs(ws, config) {
|
|
17
|
+
export function writeDocs(ws, config, singleFile = 'move') {
|
|
17
18
|
const contexts = readContexts(ws, config);
|
|
18
19
|
for (const context of contexts) {
|
|
19
20
|
if (context.declared && context.onDisk) {
|
|
@@ -21,12 +22,13 @@ export function writeDocs(ws, config) {
|
|
|
21
22
|
}
|
|
22
23
|
}
|
|
23
24
|
writeContextMap(ws, contextMapLines(contexts));
|
|
24
|
-
refreshBarrels(ws, config);
|
|
25
|
+
const kept = refreshBarrels(ws, config, singleFile);
|
|
25
26
|
writeOpenApiDocuments(ws, config);
|
|
26
27
|
// Written by people from here on: never replaced, not even with --force.
|
|
27
28
|
if (!ws.exists(INTEGRATION_README)) {
|
|
28
29
|
ws.create(INTEGRATION_README, renderTemplate('docs/integration-readme.md.tpl', { integration: { strategy: brokerStrategy(config) } }));
|
|
29
30
|
}
|
|
31
|
+
return kept;
|
|
30
32
|
}
|
|
31
33
|
function writeContextMap(ws, lines) {
|
|
32
34
|
const existing = ws.read(CONTEXT_MAP);
|