ddd-ts-kit 0.109.0 → 0.110.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/CHANGELOG.md +142 -0
- package/README.fr.md +31 -13
- package/README.md +26 -13
- package/dist/affected/reach-of.d.ts.map +1 -1
- package/dist/affected/reach-of.js +4 -1
- package/dist/affected/reach-of.js.map +1 -1
- package/dist/check/canonical/holds-shared-files.d.ts +3 -0
- package/dist/check/canonical/holds-shared-files.d.ts.map +1 -0
- package/dist/check/canonical/holds-shared-files.js +7 -0
- package/dist/check/canonical/holds-shared-files.js.map +1 -0
- package/dist/check/canonical/is-shared-directory.d.ts +7 -0
- package/dist/check/canonical/is-shared-directory.d.ts.map +1 -0
- package/dist/check/canonical/is-shared-directory.js +13 -0
- package/dist/check/canonical/is-shared-directory.js.map +1 -0
- package/dist/check/canonical/role.d.ts +2 -0
- package/dist/check/canonical/role.d.ts.map +1 -1
- package/dist/check/canonical/roles.d.ts.map +1 -1
- package/dist/check/canonical/roles.js +10 -5
- package/dist/check/canonical/roles.js.map +1 -1
- package/dist/check/canonical/shared-directories.d.ts +3 -0
- package/dist/check/canonical/shared-directories.d.ts.map +1 -0
- package/dist/check/canonical/shared-directories.js +8 -0
- package/dist/check/canonical/shared-directories.js.map +1 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +43 -4
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/configuration/module-problems.js +20 -16
- package/dist/check/configuration/module-problems.js.map +1 -1
- package/dist/check/errors/code-reference.d.ts +7 -0
- package/dist/check/errors/code-reference.d.ts.map +1 -0
- package/dist/check/errors/code-reference.js +2 -0
- package/dist/check/errors/code-reference.js.map +1 -0
- package/dist/check/errors/code-references.d.ts +7 -0
- package/dist/check/errors/code-references.d.ts.map +1 -0
- package/dist/check/errors/code-references.js +13 -0
- package/dist/check/errors/code-references.js.map +1 -0
- package/dist/check/errors/kit-code-keys.d.ts +3 -0
- package/dist/check/errors/kit-code-keys.d.ts.map +1 -0
- package/dist/check/errors/kit-code-keys.js +5 -0
- package/dist/check/errors/kit-code-keys.js.map +1 -0
- package/dist/check/errors/kit-codes-list.d.ts +3 -0
- package/dist/check/errors/kit-codes-list.d.ts.map +1 -0
- package/dist/check/errors/kit-codes-list.js +3 -0
- package/dist/check/errors/kit-codes-list.js.map +1 -0
- package/dist/check/explain/errors-docs.d.ts.map +1 -1
- package/dist/check/explain/errors-docs.js +5 -2
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/module-docs.d.ts.map +1 -1
- package/dist/check/explain/module-docs.js +9 -6
- package/dist/check/explain/module-docs.js.map +1 -1
- package/dist/check/explain/tree-docs.d.ts.map +1 -1
- package/dist/check/explain/tree-docs.js +3 -1
- package/dist/check/explain/tree-docs.js.map +1 -1
- package/dist/check/fixtures/errors-route.d.ts +1 -1
- package/dist/check/fixtures/errors-route.d.ts.map +1 -1
- package/dist/check/fixtures/errors-route.js +2 -2
- package/dist/check/fixtures/errors-route.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/module-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/module-fixtures.js +27 -31
- package/dist/check/fixtures/module-fixtures.js.map +1 -1
- package/dist/check/fixtures/named-refusal-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/named-refusal-fixtures.js +40 -0
- package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -1
- package/dist/check/fixtures/shared-folder-fixtures.d.ts +7 -0
- package/dist/check/fixtures/shared-folder-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/shared-folder-fixtures.js +176 -0
- package/dist/check/fixtures/shared-folder-fixtures.js.map +1 -0
- package/dist/check/fixtures/shared-kernel-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/shared-kernel-fixtures.js +11 -0
- package/dist/check/fixtures/shared-kernel-fixtures.js.map +1 -1
- package/dist/check/fixtures/with-modules.d.ts +4 -0
- package/dist/check/fixtures/with-modules.d.ts.map +1 -0
- package/dist/check/fixtures/with-modules.js +22 -0
- package/dist/check/fixtures/with-modules.js.map +1 -0
- package/dist/check/model/context-location.d.ts +5 -0
- package/dist/check/model/context-location.d.ts.map +1 -1
- package/dist/check/project/locate.js +12 -5
- package/dist/check/project/locate.js.map +1 -1
- package/dist/check/rules/errors-known-code.d.ts.map +1 -1
- package/dist/check/rules/errors-known-code.js +60 -9
- package/dist/check/rules/errors-known-code.js.map +1 -1
- package/dist/check/rules/module-complete.d.ts.map +1 -1
- package/dist/check/rules/module-complete.js +19 -20
- package/dist/check/rules/module-complete.js.map +1 -1
- package/dist/check/rules/module-declared.js +5 -1
- package/dist/check/rules/module-declared.js.map +1 -1
- package/dist/check/rules/test-acceptance-black-box.d.ts.map +1 -1
- package/dist/check/rules/test-acceptance-black-box.js +6 -7
- package/dist/check/rules/test-acceptance-black-box.js.map +1 -1
- package/dist/check/rules/test-builder-required.d.ts.map +1 -1
- package/dist/check/rules/test-builder-required.js +15 -12
- package/dist/check/rules/test-builder-required.js.map +1 -1
- package/dist/check/rules/test-spec-required.d.ts.map +1 -1
- package/dist/check/rules/test-spec-required.js +12 -11
- package/dist/check/rules/test-spec-required.js.map +1 -1
- package/dist/check/rules/tree-closed.js +1 -1
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/check/support/path-in-context.d.ts +1 -1
- package/dist/check/support/path-in-context.d.ts.map +1 -1
- package/dist/check/support/path-in-context.js +6 -3
- package/dist/check/support/path-in-context.js.map +1 -1
- package/dist/check/support/test-folder-of.d.ts +11 -0
- package/dist/check/support/test-folder-of.d.ts.map +1 -0
- package/dist/check/support/test-folder-of.js +12 -0
- package/dist/check/support/test-folder-of.js.map +1 -0
- package/dist/commands/drizzle-generate.d.ts.map +1 -1
- package/dist/commands/drizzle-generate.js +9 -0
- package/dist/commands/drizzle-generate.js.map +1 -1
- package/dist/commands/generate.js +9 -1
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/lint.d.ts +2 -1
- package/dist/commands/lint.d.ts.map +1 -1
- package/dist/commands/lint.js +4 -1
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/move-to-module.d.ts.map +1 -1
- package/dist/commands/move-to-module.js +0 -2
- package/dist/commands/move-to-module.js.map +1 -1
- package/dist/context-layout/context-layout.d.ts +3 -2
- package/dist/context-layout/context-layout.d.ts.map +1 -1
- package/dist/context-layout/context-layout.js +18 -8
- package/dist/context-layout/context-layout.js.map +1 -1
- package/dist/context-layout/imports-of.d.ts +11 -0
- package/dist/context-layout/imports-of.d.ts.map +1 -0
- package/dist/context-layout/imports-of.js +20 -0
- package/dist/context-layout/imports-of.js.map +1 -0
- package/dist/context-layout/module-moves.d.ts +10 -7
- package/dist/context-layout/module-moves.d.ts.map +1 -1
- package/dist/context-layout/module-moves.js +65 -122
- package/dist/context-layout/module-moves.js.map +1 -1
- package/dist/context-layout/runner-configs-by-hand.d.ts +11 -0
- package/dist/context-layout/runner-configs-by-hand.d.ts.map +1 -0
- package/dist/context-layout/runner-configs-by-hand.js +23 -0
- package/dist/context-layout/runner-configs-by-hand.js.map +1 -0
- package/dist/context-layout/settle.d.ts +20 -0
- package/dist/context-layout/settle.d.ts.map +1 -0
- package/dist/context-layout/settle.js +58 -0
- package/dist/context-layout/settle.js.map +1 -0
- package/dist/controllers/declared-code.d.ts +3 -0
- package/dist/controllers/declared-code.d.ts.map +1 -0
- package/dist/controllers/declared-code.js +8 -0
- package/dist/controllers/declared-code.js.map +1 -0
- package/dist/controllers/finish-migration.d.ts.map +1 -1
- package/dist/controllers/finish-migration.js +5 -3
- package/dist/controllers/finish-migration.js.map +1 -1
- package/dist/controllers/migrate-context.js +3 -2
- package/dist/controllers/migrate-context.js.map +1 -1
- package/dist/controllers/plan-context.d.ts +1 -1
- package/dist/controllers/plan-context.d.ts.map +1 -1
- package/dist/controllers/plan-context.js +11 -6
- package/dist/controllers/plan-context.js.map +1 -1
- package/dist/controllers/render-controller.d.ts.map +1 -1
- package/dist/controllers/render-controller.js +20 -4
- package/dist/controllers/render-controller.js.map +1 -1
- package/dist/depcruise/hygiene-rules.js +2 -2
- package/dist/depcruise/hygiene-rules.js.map +1 -1
- package/dist/depcruise/test-files.d.ts +4 -1
- package/dist/depcruise/test-files.d.ts.map +1 -1
- package/dist/depcruise/test-files.js +5 -2
- package/dist/depcruise/test-files.js.map +1 -1
- package/dist/describe/codes-named-in.d.ts +8 -0
- package/dist/describe/codes-named-in.d.ts.map +1 -0
- package/dist/describe/codes-named-in.js +33 -0
- package/dist/describe/codes-named-in.js.map +1 -0
- package/dist/describe/read-controllers.js +2 -2
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-route-groups.d.ts +6 -2
- package/dist/describe/read-route-groups.d.ts.map +1 -1
- package/dist/describe/read-route-groups.js +8 -4
- package/dist/describe/read-route-groups.js.map +1 -1
- package/dist/describe/read-routes.d.ts.map +1 -1
- package/dist/describe/read-routes.js +7 -2
- package/dist/describe/read-routes.js.map +1 -1
- package/dist/docs/spec-heading.d.ts +5 -4
- package/dist/docs/spec-heading.d.ts.map +1 -1
- package/dist/docs/spec-heading.js +4 -6
- package/dist/docs/spec-heading.js.map +1 -1
- package/dist/docs/spec-of-page.d.ts +7 -2
- package/dist/docs/spec-of-page.d.ts.map +1 -1
- package/dist/docs/spec-of-page.js +8 -3
- package/dist/docs/spec-of-page.js.map +1 -1
- package/dist/docs/specs-by-directory.d.ts +2 -2
- package/dist/docs/specs-by-directory.d.ts.map +1 -1
- package/dist/docs/specs-by-directory.js +4 -5
- package/dist/docs/specs-by-directory.js.map +1 -1
- package/dist/docs/write-behaviour.d.ts +1 -1
- package/dist/docs/write-behaviour.d.ts.map +1 -1
- package/dist/docs/write-behaviour.js +17 -2
- package/dist/docs/write-behaviour.js.map +1 -1
- package/dist/file-moves/follow-in-migrations.d.ts +10 -0
- package/dist/file-moves/follow-in-migrations.d.ts.map +1 -0
- package/dist/file-moves/follow-in-migrations.js +30 -0
- package/dist/file-moves/follow-in-migrations.js.map +1 -0
- package/dist/file-moves/move-files.d.ts +2 -1
- package/dist/file-moves/move-files.d.ts.map +1 -1
- package/dist/file-moves/move-files.js +4 -2
- package/dist/file-moves/move-files.js.map +1 -1
- package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
- package/dist/generate/errors/write-named-refusal.js +6 -2
- package/dist/generate/errors/write-named-refusal.js.map +1 -1
- package/dist/generate/kinds/builder-kind.js +1 -1
- package/dist/generate/kinds/builder-kind.js.map +1 -1
- package/dist/generate/kinds/declarations-of.js +1 -1
- package/dist/generate/kinds/declarations-of.js.map +1 -1
- package/dist/generate/kinds/declare-storage.d.ts +2 -1
- package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.js +19 -5
- package/dist/generate/kinds/declare-storage.js.map +1 -1
- package/dist/generate/kinds/e2e/acting-role.d.ts +15 -0
- package/dist/generate/kinds/e2e/acting-role.d.ts.map +1 -0
- package/dist/generate/kinds/e2e/acting-role.js +19 -0
- package/dist/generate/kinds/e2e/acting-role.js.map +1 -0
- package/dist/generate/kinds/e2e-kind.d.ts.map +1 -1
- package/dist/generate/kinds/e2e-kind.js +5 -1
- package/dist/generate/kinds/e2e-kind.js.map +1 -1
- package/dist/generate/kinds/gateway-kind.d.ts.map +1 -1
- package/dist/generate/kinds/gateway-kind.js +14 -2
- package/dist/generate/kinds/gateway-kind.js.map +1 -1
- package/dist/generate/kinds/generate-repository.js +1 -1
- package/dist/generate/kinds/generate-repository.js.map +1 -1
- package/dist/generate/kinds/module-kind.d.ts.map +1 -1
- package/dist/generate/kinds/module-kind.js +9 -1
- package/dist/generate/kinds/module-kind.js.map +1 -1
- package/dist/generate/kinds/route/group-vars.d.ts.map +1 -1
- package/dist/generate/kinds/route/group-vars.js +5 -3
- package/dist/generate/kinds/route/group-vars.js.map +1 -1
- package/dist/generate/kinds/route/route-vars.js +1 -1
- package/dist/generate/kinds/route/route-vars.js.map +1 -1
- package/dist/generate/kinds/world/context-fakes.d.ts +1 -1
- package/dist/generate/kinds/world/context-fakes.d.ts.map +1 -1
- package/dist/generate/kinds/world/context-fakes.js +8 -7
- package/dist/generate/kinds/world/context-fakes.js.map +1 -1
- package/dist/generate/kinds/world/context-world.d.ts +1 -1
- package/dist/generate/kinds/world/context-world.d.ts.map +1 -1
- package/dist/generate/kinds/world/context-world.js +3 -1
- package/dist/generate/kinds/world/context-world.js.map +1 -1
- package/dist/generate/place-generated-files.d.ts +2 -0
- package/dist/generate/place-generated-files.d.ts.map +1 -1
- package/dist/generate/place-generated-files.js +13 -13
- package/dist/generate/place-generated-files.js.map +1 -1
- package/dist/generate/refresh-docs.d.ts +1 -1
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +3 -1
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/generate/refuse-earlier-layout.d.ts +4 -3
- package/dist/generate/refuse-earlier-layout.d.ts.map +1 -1
- package/dist/generate/refuse-earlier-layout.js +9 -6
- package/dist/generate/refuse-earlier-layout.js.map +1 -1
- package/dist/help/flag-notes.d.ts.map +1 -1
- package/dist/help/flag-notes.js +8 -7
- package/dist/help/flag-notes.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +23 -17
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.js +1 -1
- package/dist/help/work-notes.d.ts.map +1 -1
- package/dist/help/work-notes.js +4 -3
- package/dist/help/work-notes.js.map +1 -1
- package/dist/init/manifest/versions.js +25 -25
- package/dist/init/rewire-personal-data.d.ts.map +1 -1
- package/dist/init/rewire-personal-data.js +4 -2
- package/dist/init/rewire-personal-data.js.map +1 -1
- package/dist/init/rewire-tables.d.ts.map +1 -1
- package/dist/init/rewire-tables.js +4 -2
- package/dist/init/rewire-tables.js.map +1 -1
- package/dist/init/with-held-imports.d.ts +9 -0
- package/dist/init/with-held-imports.d.ts.map +1 -0
- package/dist/init/with-held-imports.js +15 -0
- package/dist/init/with-held-imports.js.map +1 -0
- package/dist/knip/enter-module-test-folders.d.ts +10 -0
- package/dist/knip/enter-module-test-folders.d.ts.map +1 -0
- package/dist/knip/enter-module-test-folders.js +42 -0
- package/dist/knip/enter-module-test-folders.js.map +1 -0
- package/dist/knip/index.d.ts +1 -0
- package/dist/knip/index.d.ts.map +1 -1
- package/dist/knip/index.js +1 -0
- package/dist/knip/index.js.map +1 -1
- package/dist/lint/eslint-in-project.d.ts +1 -1
- package/dist/lint/eslint-in-project.d.ts.map +1 -1
- package/dist/lint/eslint-in-project.js +3 -2
- package/dist/lint/eslint-in-project.js.map +1 -1
- package/dist/lint/lint-run.d.ts +2 -0
- package/dist/lint/lint-run.d.ts.map +1 -1
- package/dist/merge/landed-commit.js +14 -2
- package/dist/merge/landed-commit.js.map +1 -1
- package/dist/merge/landed-point.js +3 -0
- package/dist/merge/landed-point.js.map +1 -1
- package/dist/merge/lost/dropped-additions.d.ts +20 -0
- package/dist/merge/lost/dropped-additions.d.ts.map +1 -0
- package/dist/merge/lost/dropped-additions.js +42 -0
- package/dist/merge/lost/dropped-additions.js.map +1 -0
- package/dist/merge/lost/expected-over.d.ts +13 -0
- package/dist/merge/lost/expected-over.d.ts.map +1 -0
- package/dist/merge/lost/expected-over.js +16 -0
- package/dist/merge/lost/expected-over.js.map +1 -0
- package/dist/merge/lost/kept-rows.d.ts +4 -2
- package/dist/merge/lost/kept-rows.d.ts.map +1 -1
- package/dist/merge/lost/kept-rows.js +10 -7
- package/dist/merge/lost/kept-rows.js.map +1 -1
- package/dist/merge/lost/lost-lines.d.ts +2 -2
- package/dist/merge/lost/lost-lines.d.ts.map +1 -1
- package/dist/merge/lost/lost-lines.js +5 -3
- package/dist/merge/lost/lost-lines.js.map +1 -1
- package/dist/merge/lost/lost-tests.d.ts +2 -2
- package/dist/merge/lost/lost-tests.d.ts.map +1 -1
- package/dist/merge/lost/lost-tests.js +5 -3
- package/dist/merge/lost/lost-tests.js.map +1 -1
- package/dist/merge/lost/verify-merge.d.ts.map +1 -1
- package/dist/merge/lost/verify-merge.js +12 -5
- package/dist/merge/lost/verify-merge.js.map +1 -1
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +35 -7
- package/dist/merge/merge-trunk.js.map +1 -1
- package/dist/merge/slices-from-fork.d.ts +20 -0
- package/dist/merge/slices-from-fork.d.ts.map +1 -0
- package/dist/merge/slices-from-fork.js +27 -0
- package/dist/merge/slices-from-fork.js.map +1 -0
- package/dist/merge/trunk-of.d.ts +4 -2
- package/dist/merge/trunk-of.d.ts.map +1 -1
- package/dist/merge/trunk-of.js +4 -2
- package/dist/merge/trunk-of.js.map +1 -1
- package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -1
- package/dist/migration/warn-dropped-context-tables.js +6 -4
- package/dist/migration/warn-dropped-context-tables.js.map +1 -1
- package/dist/model-modules/context-level-folder-of.d.ts +9 -0
- package/dist/model-modules/context-level-folder-of.d.ts.map +1 -0
- package/dist/model-modules/context-level-folder-of.js +11 -0
- package/dist/model-modules/context-level-folder-of.js.map +1 -0
- package/dist/model-modules/earlier-folders.d.ts +10 -0
- package/dist/model-modules/earlier-folders.d.ts.map +1 -0
- package/dist/model-modules/earlier-folders.js +20 -0
- package/dist/model-modules/earlier-folders.js.map +1 -0
- package/dist/model-modules/folders-of-context.d.ts +8 -0
- package/dist/model-modules/folders-of-context.d.ts.map +1 -0
- package/dist/model-modules/folders-of-context.js +11 -0
- package/dist/model-modules/folders-of-context.js.map +1 -0
- package/dist/model-modules/held-file-of.d.ts +10 -0
- package/dist/model-modules/held-file-of.d.ts.map +1 -0
- package/dist/model-modules/held-file-of.js +18 -0
- package/dist/model-modules/held-file-of.js.map +1 -0
- package/dist/model-modules/index.d.ts +8 -1
- package/dist/model-modules/index.d.ts.map +1 -1
- package/dist/model-modules/index.js +8 -1
- package/dist/model-modules/index.js.map +1 -1
- package/dist/model-modules/into-module.d.ts +3 -3
- package/dist/model-modules/into-module.d.ts.map +1 -1
- package/dist/model-modules/into-module.js +9 -12
- package/dist/model-modules/into-module.js.map +1 -1
- package/dist/model-modules/is-context-level.d.ts +4 -5
- package/dist/model-modules/is-context-level.d.ts.map +1 -1
- package/dist/model-modules/is-context-level.js +6 -16
- package/dist/model-modules/is-context-level.js.map +1 -1
- package/dist/model-modules/is-held-by-shared.d.ts +8 -0
- package/dist/model-modules/is-held-by-shared.d.ts.map +1 -0
- package/dist/model-modules/is-held-by-shared.js +20 -0
- package/dist/model-modules/is-held-by-shared.js.map +1 -0
- package/dist/model-modules/module-layers.d.ts +9 -2
- package/dist/model-modules/module-layers.d.ts.map +1 -1
- package/dist/model-modules/module-layers.js +10 -3
- package/dist/model-modules/module-layers.js.map +1 -1
- package/dist/model-modules/module-name-flaw.d.ts +4 -1
- package/dist/model-modules/module-name-flaw.d.ts.map +1 -1
- package/dist/model-modules/module-name-flaw.js +6 -2
- package/dist/model-modules/module-name-flaw.js.map +1 -1
- package/dist/model-modules/module-placement.d.ts +8 -6
- package/dist/model-modules/module-placement.d.ts.map +1 -1
- package/dist/model-modules/module-placement.js +32 -30
- package/dist/model-modules/module-placement.js.map +1 -1
- package/dist/model-modules/module-split.d.ts +7 -5
- package/dist/model-modules/module-split.d.ts.map +1 -1
- package/dist/model-modules/module-split.js +18 -17
- package/dist/model-modules/module-split.js.map +1 -1
- package/dist/model-modules/module-test-folder-of.d.ts +8 -0
- package/dist/model-modules/module-test-folder-of.d.ts.map +1 -0
- package/dist/model-modules/module-test-folder-of.js +11 -0
- package/dist/model-modules/module-test-folder-of.js.map +1 -0
- package/dist/model-modules/role-folders-of.d.ts +5 -3
- package/dist/model-modules/role-folders-of.d.ts.map +1 -1
- package/dist/model-modules/role-folders-of.js +19 -11
- package/dist/model-modules/role-folders-of.js.map +1 -1
- package/dist/model-modules/role-folders.d.ts +1 -1
- package/dist/model-modules/role-folders.js +1 -1
- package/dist/model-modules/subject-module.d.ts +13 -0
- package/dist/model-modules/subject-module.d.ts.map +1 -0
- package/dist/model-modules/subject-module.js +34 -0
- package/dist/model-modules/subject-module.js.map +1 -0
- package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
- package/dist/move-to-module/moves-into-module.js +29 -16
- package/dist/move-to-module/moves-into-module.js.map +1 -1
- package/dist/naming/plural.d.ts.map +1 -1
- package/dist/naming/plural.js +5 -0
- package/dist/naming/plural.js.map +1 -1
- package/dist/plan/format-plan.js +1 -1
- package/dist/plan/format-plan.js.map +1 -1
- package/dist/progress/build-next-of.d.ts.map +1 -1
- package/dist/progress/build-next-of.js +8 -3
- package/dist/progress/build-next-of.js.map +1 -1
- package/dist/refusals/apply-plan.d.ts.map +1 -1
- package/dist/refusals/apply-plan.js +8 -4
- package/dist/refusals/apply-plan.js.map +1 -1
- package/dist/refusals/move-named-specs.d.ts.map +1 -1
- package/dist/refusals/move-named-specs.js +7 -4
- package/dist/refusals/move-named-specs.js.map +1 -1
- package/dist/refusals/unit-folder-of.d.ts +9 -0
- package/dist/refusals/unit-folder-of.d.ts.map +1 -0
- package/dist/refusals/unit-folder-of.js +15 -0
- package/dist/refusals/unit-folder-of.js.map +1 -0
- package/dist/slice/plan-staging.d.ts +2 -1
- package/dist/slice/plan-staging.d.ts.map +1 -1
- package/dist/slice/plan-staging.js +3 -1
- package/dist/slice/plan-staging.js.map +1 -1
- package/dist/stack/declares-roles.d.ts +8 -0
- package/dist/stack/declares-roles.d.ts.map +1 -0
- package/dist/stack/declares-roles.js +11 -0
- package/dist/stack/declares-roles.js.map +1 -0
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +2 -1
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/worker/progress-of.js +12 -1
- package/dist/worker/progress-of.js.map +1 -1
- package/dist/worker/row-commits.js +7 -1
- package/dist/worker/row-commits.js.map +1 -1
- package/package.json +6 -6
- package/templates/command/handler.spec.buses.ts.tpl +4 -1
- package/templates/command/handler.spec.container.ts.tpl +6 -1
- package/templates/controller/controller.spec.ts.tpl +4 -1
- package/templates/controller/guard.spec.ts.tpl +2 -2
- package/templates/controller/guard.ts.tpl +2 -1
- package/templates/e2e/e2e.spec.ts.tpl +5 -2
- package/templates/error/codes-import.ts.tpl +1 -0
- package/templates/error/refusal-case.spec.ts.tpl +1 -1
- package/templates/error/refusal.spec.ts.tpl +1 -0
- package/templates/file-upload/handler.spec.ts.tpl +4 -1
- package/templates/init/e2e/create-credentials.jwt.ts.tpl +13 -0
- package/templates/init/e2e/create-credentials.keycloak.ts.tpl +13 -0
- package/templates/init/e2e/create-credentials.none.ts.tpl +13 -0
- package/templates/init/e2e/create-credentials.passport.ts.tpl +13 -0
- package/templates/init/platform/audit/search-audit-entries/search-audit-entries.controller.ts.tpl +2 -2
- package/templates/init/platform/audit/search-audit-entries/search-audit-entries.route.ts.tpl +2 -2
- package/templates/init/platform/composition/create-platform.manual.ts.tpl +14 -4
- package/templates/init/platform/http/start-http-server.fastify.ts.tpl +8 -2
- package/templates/init/rules/presentation.md.tpl +2 -2
- package/templates/init/rules/tests.md.tpl +1 -0
- package/templates/nest-controller/controller.spec.ts.tpl +4 -1
- package/templates/pipeline/biome.json.tpl +1 -1
- package/templates/pipeline/jest.mutation.config.js.tpl +1 -1
- package/templates/pipeline/knip.json.tpl +2 -0
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/pipeline/vitest.config.ts.tpl +11 -6
- package/templates/pipeline/vitest.mutation.config.ts.tpl +1 -1
- package/templates/presets/identity/context/presentation/http/accounts.routes.ts.tpl +2 -1
- package/templates/presets/identity/context/presentation/http/invitations.routes.ts.tpl +2 -1
- package/templates/presets/identity/context/presentation/http/organisations.routes.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/change-member-role.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/deactivate-account.handler.spec.ts.tpl +4 -4
- package/templates/presets/identity/context/test/unit/grant-delegation.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/invite-member.handler.spec.ts.tpl +3 -3
- package/templates/presets/identity/context/test/unit/provision-account.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/remove-member.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/revoke-delegation.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/revoke-invitation.handler.spec.ts.tpl +2 -1
- package/templates/presets/identity/context/test/unit/search-members.handler.spec.ts.tpl +2 -2
- package/templates/query/handler.spec.buses.ts.tpl +4 -1
- package/templates/query/handler.spec.container.ts.tpl +6 -1
- package/templates/query/search.handler.spec.buses.ts.tpl +2 -2
- package/templates/query/search.handler.spec.container.ts.tpl +2 -2
- package/templates/query/search.reader.spec.ts.tpl +2 -2
- package/templates/route/route.class-validator.ts.tpl +5 -0
- package/templates/route/route.none.ts.tpl +6 -1
- package/templates/route/route.search.ts.tpl +3 -3
- package/templates/route/route.spec.ts.tpl +4 -1
- package/templates/route/route.standard-schema.ts.tpl +5 -0
- package/templates/route/route.typebox.ts.tpl +5 -0
- package/templates/route/route.zod.ts.tpl +5 -0
- package/templates/value-object/value-object.spec.ts.tpl +6 -3
|
@@ -1,43 +1,50 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { declaredModules } from './declared-modules.js';
|
|
3
2
|
import { intoModule } from './into-module.js';
|
|
4
3
|
import { isContextLevel } from './is-context-level.js';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { isHeldByShared } from './is-held-by-shared.js';
|
|
5
|
+
import { MODULE_LAYERS, SHARED_FOLDER, TEST_FOLDER } from './module-layers.js';
|
|
7
6
|
/**
|
|
8
|
-
* Where a path of a context, written as it would be without
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* Where a path of a context divided into modules, written as it would be without them, is. What
|
|
8
|
+
* belongs to no module is in `shared/` (`isHeldByShared`); the code list and the permission set
|
|
9
|
+
* stay as written, at the root. A file of a layer is in the module that holds it, the asked one
|
|
10
|
+
* first, or, for a file being written, in the asked module; one still at the level of the
|
|
11
|
+
* context, which `move-to-module` has not moved yet, is read there. A spec, a fake or a builder
|
|
12
|
+
* goes with its subject, in the test folder of the module that holds the file it is named after,
|
|
13
|
+
* and in `shared/test/` when no module does. A path of a context without modules is as written.
|
|
13
14
|
*/
|
|
14
15
|
export function modulePlacement(sources) {
|
|
15
16
|
return (file, writing) => {
|
|
16
|
-
const role = rolePathOf(sources
|
|
17
|
-
if (role === undefined
|
|
17
|
+
const role = rolePathOf(sources, file);
|
|
18
|
+
if (role === undefined) {
|
|
18
19
|
return file;
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const inShared = `${sources.config.contextsDir}/${role.context}/${SHARED_FOLDER}/${role.relative}`;
|
|
22
|
+
if (isHeldByShared(role.relative)) {
|
|
23
|
+
return readWhereItIs(sources, file, inShared);
|
|
22
24
|
}
|
|
23
|
-
|
|
25
|
+
if (role.relative.startsWith(`${TEST_FOLDER}/`)) {
|
|
26
|
+
return testInItsModule(sources, role) ?? inShared;
|
|
27
|
+
}
|
|
28
|
+
if (isContextLevel(role.context, role.relative) || sources.existsAsIs(file)) {
|
|
29
|
+
return file;
|
|
30
|
+
}
|
|
31
|
+
return inItsModule(sources, role, writing) ?? (writing ? sources.unplaced(role.context, role.relative) : file);
|
|
24
32
|
};
|
|
25
33
|
}
|
|
26
|
-
/**
|
|
27
|
-
function
|
|
34
|
+
/** What belongs to no module is in `shared/`; what a context in the middle of its move still holds at its own level is read there. */
|
|
35
|
+
function readWhereItIs({ existsAsIs }, file, inShared) {
|
|
36
|
+
return !existsAsIs(inShared) && existsAsIs(file) ? file : inShared;
|
|
37
|
+
}
|
|
38
|
+
/** The path a file has in a context divided into modules, when it is written in a layer or in the test folder. */
|
|
39
|
+
function rolePathOf({ config, modulesOf }, file) {
|
|
28
40
|
const prefix = `${config.contextsDir}/`;
|
|
29
41
|
const [context = '', ...parts] = file.startsWith(prefix) ? file.slice(prefix.length).split('/') : [];
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
: undefined;
|
|
34
|
-
}
|
|
35
|
-
/** A spec of `test/unit/` or `test/integration/`, at any depth, not already in the folder of a module. */
|
|
36
|
-
function isSpecOutsideModules([layer, folder = '', first = ''], modules) {
|
|
37
|
-
return layer === 'test' && MODULE_TEST_FOLDERS.includes(folder) && first !== '' && !modules.includes(first);
|
|
42
|
+
const [top = ''] = parts;
|
|
43
|
+
const held = parts.length > 1 && (MODULE_LAYERS.includes(top) || top === TEST_FOLDER);
|
|
44
|
+
return held && modulesOf(context).length > 0 ? { context, relative: parts.join('/') } : undefined;
|
|
38
45
|
}
|
|
39
|
-
/**
|
|
40
|
-
function
|
|
46
|
+
/** A spec, a fake or a builder in its module: the one that holds it, the asked one, or the one that holds its subject. */
|
|
47
|
+
function testInItsModule(sources, role) {
|
|
41
48
|
const { context, relative } = role;
|
|
42
49
|
const asked = sources.asked?.context === context ? sources.asked.module : undefined;
|
|
43
50
|
const candidates = candidatesOf(sources, role, asked);
|
|
@@ -93,9 +100,4 @@ function useCaseFoldersOf(relative) {
|
|
|
93
100
|
? [`presentation/http/${first}/${second}`, `application/commands/${second}`, `application/queries/${second}`]
|
|
94
101
|
: [];
|
|
95
102
|
}
|
|
96
|
-
/** A file written in a context that declares modules, without saying which one: refused, with the way out. */
|
|
97
|
-
function unplaced(sources, { context, relative }, file) {
|
|
98
|
-
const declared = (ownEntry(sources.config.contexts, context)?.modules ?? []).length > 0;
|
|
99
|
-
return declared ? sources.unplaced(context, relative) : file;
|
|
100
|
-
}
|
|
101
103
|
//# sourceMappingURL=module-placement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-placement.js","sourceRoot":"","sources":["../../src/model-modules/module-placement.ts"],"names":[],"mappings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|
-
/** True when the
|
|
6
|
-
readonly
|
|
5
|
+
/** True when the file sits under `shared/`, the folder of what belongs to no module: it then has no module. */
|
|
6
|
+
readonly shared?: boolean;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Reads the module of a path relative to its context, among the modules of the model the config
|
|
10
10
|
* declares (`declaredModules`): `calendars/domain/aggregates/calendar.aggregate.ts` is
|
|
11
11
|
* `domain/aggregates/calendar.aggregate.ts` of the module `calendars`, and
|
|
12
|
-
* `test/unit/calendars/calendar.aggregate.spec.ts` is `test/unit/calendar.aggregate.spec.ts` of it
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* `test/unit/calendars/calendar.aggregate.spec.ts` is `test/unit/calendar.aggregate.spec.ts` of it,
|
|
13
|
+
* as is `calendars/test/unit/calendar.aggregate.spec.ts`, in the test folder of the module.
|
|
14
|
+
* In a context that declares modules, `shared/infrastructure/persistence/scheduling.schema.ts` is
|
|
15
|
+
* `infrastructure/persistence/scheduling.schema.ts` of no module, and said so (`shared`).
|
|
16
|
+
* A folder the config does not declare is no module: `tree/closed` reports it, and no tool reads it
|
|
15
17
|
* as one. The folder of the module itself (`calendars`) is the module with an empty path. A path
|
|
16
18
|
* already read without its module (`pathInContext`) is given no module.
|
|
17
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-split.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-split.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module-split.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-split.ts"],"names":[],"mappings":"AAEA,mHAAmH;AACnH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+GAA+G;IAC/G,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAQjF"}
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EARLIER_MODULE_LAYERS, MODULE_LAYERS, MODULE_TEST_FOLDERS } from './module-layers.js';
|
|
1
|
+
import { MODULE_LAYERS, MODULE_TEST_FOLDERS, SHARED_FOLDER, SHARED_FOLDERS, TEST_FOLDER } from './module-layers.js';
|
|
3
2
|
/**
|
|
4
3
|
* Reads the module of a path relative to its context, among the modules of the model the config
|
|
5
4
|
* declares (`declaredModules`): `calendars/domain/aggregates/calendar.aggregate.ts` is
|
|
6
5
|
* `domain/aggregates/calendar.aggregate.ts` of the module `calendars`, and
|
|
7
|
-
* `test/unit/calendars/calendar.aggregate.spec.ts` is `test/unit/calendar.aggregate.spec.ts` of it
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* `test/unit/calendars/calendar.aggregate.spec.ts` is `test/unit/calendar.aggregate.spec.ts` of it,
|
|
7
|
+
* as is `calendars/test/unit/calendar.aggregate.spec.ts`, in the test folder of the module.
|
|
8
|
+
* In a context that declares modules, `shared/infrastructure/persistence/scheduling.schema.ts` is
|
|
9
|
+
* `infrastructure/persistence/scheduling.schema.ts` of no module, and said so (`shared`).
|
|
10
|
+
* A folder the config does not declare is no module: `tree/closed` reports it, and no tool reads it
|
|
10
11
|
* as one. The folder of the module itself (`calendars`) is the module with an empty path. A path
|
|
11
12
|
* already read without its module (`pathInContext`) is given no module.
|
|
12
13
|
*/
|
|
13
14
|
export function moduleSplit(file, modules) {
|
|
14
15
|
const parts = file.split('/');
|
|
15
16
|
return (inFolderOfModule(parts, modules) ??
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
inSharedFolder(parts, modules) ??
|
|
18
|
+
inTestFolder(parts, modules) ?? { module: undefined, path: file });
|
|
18
19
|
}
|
|
19
|
-
/** `<module>/<layer
|
|
20
|
+
/** `<module>/<layer>/...` and `<module>/test/...`, or the folder of the module itself. */
|
|
20
21
|
function inFolderOfModule([first = '', second, ...rest], modules) {
|
|
21
|
-
if (!modules.includes(first) || (second !== undefined && !MODULE_LAYERS.includes(second))) {
|
|
22
|
+
if (!modules.includes(first) || (second !== undefined && !MODULE_LAYERS.includes(second) && second !== TEST_FOLDER)) {
|
|
22
23
|
return undefined;
|
|
23
24
|
}
|
|
24
25
|
return { module: first, path: second === undefined ? '' : [second, ...rest].join('/') };
|
|
25
26
|
}
|
|
26
|
-
/** `
|
|
27
|
-
function
|
|
28
|
-
return first ===
|
|
29
|
-
? { module, path: [
|
|
27
|
+
/** `shared/<infrastructure|presentation|test>/...`, in a context divided into modules. */
|
|
28
|
+
function inSharedFolder([first, second = '', ...rest], modules) {
|
|
29
|
+
return modules.length > 0 && first === SHARED_FOLDER && SHARED_FOLDERS.includes(second)
|
|
30
|
+
? { module: undefined, path: [second, ...rest].join('/'), shared: true }
|
|
30
31
|
: undefined;
|
|
31
32
|
}
|
|
32
|
-
/**
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
? { module
|
|
33
|
+
/** `test/<unit|integration>/<module>/...`. */
|
|
34
|
+
function inTestFolder([first, second = '', module = '', ...below], modules) {
|
|
35
|
+
return first === TEST_FOLDER && MODULE_TEST_FOLDERS.includes(second) && modules.includes(module)
|
|
36
|
+
? { module, path: [TEST_FOLDER, second, ...below].join('/') }
|
|
36
37
|
: undefined;
|
|
37
38
|
}
|
|
38
39
|
//# sourceMappingURL=module-split.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-split.js","sourceRoot":"","sources":["../../src/model-modules/module-split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"module-split.js","sourceRoot":"","sources":["../../src/model-modules/module-split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAA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AAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE;QACxE,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,8CAA8C;AAC9C,SAAS,YAAY,CACnB,CAAC,KAAK,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,KAAK,CAAoB,EAC9D,OAA0B;IAE1B,OAAO,KAAK,KAAK,WAAW,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC9F,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC7D,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ContextTree } from './context-tree.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where the tests of a module of the model go, from the project root, for a folder of the tests
|
|
4
|
+
* (`unit`, `integration`): the test folder of the module (`<module>/test/unit`). Without a
|
|
5
|
+
* module, the folder of the context.
|
|
6
|
+
*/
|
|
7
|
+
export declare function moduleTestFolderOf({ directory }: ContextTree, module: string | undefined, folder: string): string;
|
|
8
|
+
//# sourceMappingURL=module-test-folder-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-test-folder-of.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-test-folder-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEjH"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { intoModule } from './into-module.js';
|
|
2
|
+
import { TEST_FOLDER } from './module-layers.js';
|
|
3
|
+
/**
|
|
4
|
+
* Where the tests of a module of the model go, from the project root, for a folder of the tests
|
|
5
|
+
* (`unit`, `integration`): the test folder of the module (`<module>/test/unit`). Without a
|
|
6
|
+
* module, the folder of the context.
|
|
7
|
+
*/
|
|
8
|
+
export function moduleTestFolderOf({ directory }, module, folder) {
|
|
9
|
+
return `${directory}/${intoModule(module, `${TEST_FOLDER}/${folder}`)}`;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=module-test-folder-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-test-folder-of.js","sourceRoot":"","sources":["../../src/model-modules/module-test-folder-of.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAE,SAAS,EAAe,EAAE,MAA0B,EAAE,MAAc;IACvG,OAAO,GAAG,SAAS,IAAI,UAAU,CAAC,MAAM,EAAE,GAAG,WAAW,IAAI,MAAM,EAAE,CAAC,EAAE,CAAC;AAC1E,CAAC"}
|
|
@@ -2,9 +2,11 @@ import type { Workspace } from '../workspace/index.js';
|
|
|
2
2
|
import type { ContextTree } from './context-tree.js';
|
|
3
3
|
/**
|
|
4
4
|
* Every folder of a context that plays one role, by its path from the project root: the folder
|
|
5
|
-
* of the context itself (`domain/aggregates`)
|
|
6
|
-
* (`calendars/domain/aggregates`,
|
|
7
|
-
*
|
|
5
|
+
* of the context itself (`domain/aggregates`), the same folder in each module of its model
|
|
6
|
+
* (`calendars/domain/aggregates`, `calendars/test/unit` for a folder of the tests), and in `shared/` when
|
|
7
|
+
* the context is divided into modules (`shared/infrastructure/persistence`). A reader that lists a
|
|
8
|
+
* role goes through here, so a file moved into a module is never lost from what the kit writes
|
|
9
|
+
* about its context.
|
|
8
10
|
*/
|
|
9
11
|
export declare function roleFoldersOf(ws: Workspace, { directory, modules }: ContextTree, folder: string): string[];
|
|
10
12
|
//# sourceMappingURL=role-folders-of.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role-folders-of.d.ts","sourceRoot":"","sources":["../../src/model-modules/role-folders-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"role-folders-of.d.ts","sourceRoot":"","sources":["../../src/model-modules/role-folders-of.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAW1G"}
|
|
@@ -1,24 +1,32 @@
|
|
|
1
|
+
import { foldersOfContext } from './folders-of-context.js';
|
|
1
2
|
import { intoModule } from './into-module.js';
|
|
2
|
-
import {
|
|
3
|
+
import { SHARED_FOLDER, SHARED_FOLDERS } from './module-layers.js';
|
|
3
4
|
/**
|
|
4
5
|
* Every folder of a context that plays one role, by its path from the project root: the folder
|
|
5
|
-
* of the context itself (`domain/aggregates`)
|
|
6
|
-
* (`calendars/domain/aggregates`,
|
|
7
|
-
*
|
|
6
|
+
* of the context itself (`domain/aggregates`), the same folder in each module of its model
|
|
7
|
+
* (`calendars/domain/aggregates`, `calendars/test/unit` for a folder of the tests), and in `shared/` when
|
|
8
|
+
* the context is divided into modules (`shared/infrastructure/persistence`). A reader that lists a
|
|
9
|
+
* role goes through here, so a file moved into a module is never lost from what the kit writes
|
|
10
|
+
* about its context.
|
|
8
11
|
*/
|
|
9
12
|
export function roleFoldersOf(ws, { directory, modules }, folder) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
.flatMap((module) => [intoModule(module, folder), earlierPlace(module, folder)])
|
|
13
|
+
const placed = foldersOfContext(modules)
|
|
14
|
+
.flatMap((holder) => (holder === SHARED_FOLDER ? inShared(folder) : inModule(holder, folder)))
|
|
13
15
|
.filter((candidate) => candidate !== folder);
|
|
14
16
|
return ([folder, ...placed]
|
|
15
17
|
// A folder a move is filling is planned before it is on disk.
|
|
16
18
|
.filter((candidate) => ws.existsAsIs(`${directory}/${candidate}`) || candidate === folder)
|
|
17
19
|
.map((candidate) => `${directory}/${candidate}`));
|
|
18
20
|
}
|
|
19
|
-
/**
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/** Where a module holds the folder. */
|
|
22
|
+
function inModule(module, folder) {
|
|
23
|
+
return [intoModule(module, folder)];
|
|
24
|
+
}
|
|
25
|
+
/** The folder in `shared/`, which holds no folder of `domain/` nor of `application/`. */
|
|
26
|
+
function inShared(folder) {
|
|
27
|
+
return SHARED_FOLDERS.includes(topOf(folder)) ? [`${SHARED_FOLDER}/${folder}`] : [];
|
|
28
|
+
}
|
|
29
|
+
function topOf(folder) {
|
|
30
|
+
return folder.split('/')[0] ?? '';
|
|
23
31
|
}
|
|
24
32
|
//# sourceMappingURL=role-folders-of.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role-folders-of.js","sourceRoot":"","sources":["../../src/model-modules/role-folders-of.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"role-folders-of.js","sourceRoot":"","sources":["../../src/model-modules/role-folders-of.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,C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AC3B,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The folders a role owns directly under each layer a module holds, read from the canonical tree:
|
|
3
|
-
* a folder
|
|
3
|
+
* a folder directly under a layer that none owns is no role folder.
|
|
4
4
|
*/
|
|
5
5
|
export declare const ROLE_FOLDERS: Readonly<Record<string, readonly string[]>>;
|
|
6
6
|
//# sourceMappingURL=role-folders.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { ROLES } from '../check/canonical/roles.js';
|
|
|
2
2
|
import { MODULE_LAYERS } from './module-layers.js';
|
|
3
3
|
/**
|
|
4
4
|
* The folders a role owns directly under each layer a module holds, read from the canonical tree:
|
|
5
|
-
* a folder
|
|
5
|
+
* a folder directly under a layer that none owns is no role folder.
|
|
6
6
|
*/
|
|
7
7
|
export const ROLE_FOLDERS = Object.fromEntries(MODULE_LAYERS.map((layer) => [
|
|
8
8
|
layer,
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** A production file of a module of the model: its path relative to the context, its module left out, and that module. */
|
|
2
|
+
export interface ModuleFile {
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly module: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The module of the production file a file of the tests is named after, the longest name winning:
|
|
8
|
+
* a spec after any file (`appointment.repository.contract.spec.ts` is of `appointment.repository.ts`),
|
|
9
|
+
* a builder after an aggregate (`invoice.builder.ts` is of `invoice.aggregate.ts`), a fake after a
|
|
10
|
+
* repository or a port (`payment-gateway.fake.ts` is of `payment-gateway.port.ts`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function subjectModule(file: string, production: readonly ModuleFile[]): string | undefined;
|
|
13
|
+
//# sourceMappingURL=subject-module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subject-module.d.ts","sourceRoot":"","sources":["../../src/model-modules/subject-module.ts"],"names":[],"mappings":"AAEA,0HAA0H;AAC1H,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AASD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,GAAG,SAAS,CAyBjG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { posix } from 'node:path';
|
|
2
|
+
/** What a file of the tests is named after, by its suffix, and the role folders its subject sits in; every folder for a spec. */
|
|
3
|
+
const SUBJECTS = [
|
|
4
|
+
{ suffix: '.builder.ts', folders: ['domain/aggregates/'] },
|
|
5
|
+
{ suffix: '.fake.ts', folders: ['domain/repositories/', 'application/ports/'] },
|
|
6
|
+
{ suffix: '.spec.ts', folders: [''] },
|
|
7
|
+
];
|
|
8
|
+
/**
|
|
9
|
+
* The module of the production file a file of the tests is named after, the longest name winning:
|
|
10
|
+
* a spec after any file (`appointment.repository.contract.spec.ts` is of `appointment.repository.ts`),
|
|
11
|
+
* a builder after an aggregate (`invoice.builder.ts` is of `invoice.aggregate.ts`), a fake after a
|
|
12
|
+
* repository or a port (`payment-gateway.fake.ts` is of `payment-gateway.port.ts`).
|
|
13
|
+
*/
|
|
14
|
+
export function subjectModule(file, production) {
|
|
15
|
+
const name = posix.basename(file);
|
|
16
|
+
const subject = SUBJECTS.find(({ suffix }) => name.endsWith(suffix));
|
|
17
|
+
if (subject === undefined) {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
const stem = name.slice(0, -subject.suffix.length);
|
|
21
|
+
// A spec carries the whole name of its subject; a builder or a fake names it without its role.
|
|
22
|
+
const whole = subject.suffix === '.spec.ts';
|
|
23
|
+
const matches = production
|
|
24
|
+
.filter(({ path }) => subject.folders.some((folder) => path.startsWith(folder)))
|
|
25
|
+
.flatMap(({ path, module }) => {
|
|
26
|
+
const named = posix.basename(path).replace(/\.ts$/, '');
|
|
27
|
+
const fits = whole
|
|
28
|
+
? stem === named || stem.startsWith(`${named}.`)
|
|
29
|
+
: named === stem || named.startsWith(`${stem}.`);
|
|
30
|
+
return fits ? [{ module, length: named.length }] : [];
|
|
31
|
+
});
|
|
32
|
+
return matches.sort((left, right) => right.length - left.length)[0]?.module;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=subject-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subject-module.js","sourceRoot":"","sources":["../../src/model-modules/subject-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAQlC,iIAAiI;AACjI,MAAM,QAAQ,GAAgF;IAC5F,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,oBAAoB,CAAC,EAAE;IAC1D,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,EAAE;IAC/E,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE;CACtC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,UAAiC;IAC3E,MAAM,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAErE,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACnD,+FAA+F;IAC/F,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,KAAK,UAAU,CAAC;IAE5C,MAAM,OAAO,GAAG,UAAU;SACvB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;SAC/E,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5B,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAExD,MAAM,IAAI,GAAG,KAAK;YAChB,CAAC,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC;YAChD,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;QAEnD,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC;AAC9E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moves-into-module.d.ts","sourceRoot":"","sources":["../../src/move-to-module/moves-into-module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"moves-into-module.d.ts","sourceRoot":"","sources":["../../src/move-to-module/moves-into-module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAaxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAKhD,2FAA2F;AAC3F,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,UAAU,EAAE,CA8BjG"}
|
|
@@ -2,7 +2,9 @@ import { posix } from 'node:path';
|
|
|
2
2
|
import { CliError } from '../cli-error.js';
|
|
3
3
|
import { isDeclarationsFile } from '../declared/index.js';
|
|
4
4
|
import { filesUnder } from '../generate/files-under.js';
|
|
5
|
-
import { declaredModules, intoModule, isContextLevel, isRoleFolder, MODULE_LAYERS, MODULE_TEST_FOLDERS, moduleSplit, } from '../model-modules/index.js';
|
|
5
|
+
import { declaredModules, intoModule, isContextLevel, isRoleFolder, MODULE_LAYERS, MODULE_TEST_FOLDERS, moduleSplit, TEST_FOLDER, } from '../model-modules/index.js';
|
|
6
|
+
/** The folders of the tests whose files follow their subject into a module, beside its specs. */
|
|
7
|
+
const SUPPORT_FOLDERS = ['fakes', 'builders'];
|
|
6
8
|
/**
|
|
7
9
|
* The files the paths name, a file or a folder of a role of a layer or a spec, each with
|
|
8
10
|
* where it goes in the module: the files that stay one per context and the generated
|
|
@@ -10,7 +12,8 @@ import { declaredModules, intoModule, isContextLevel, isRoleFolder, MODULE_LAYER
|
|
|
10
12
|
*/
|
|
11
13
|
export function movesIntoModule(ws, config, request) {
|
|
12
14
|
const directory = `${config.contextsDir}/${request.context}`;
|
|
13
|
-
const
|
|
15
|
+
const modules = declaredModules(config, request.context);
|
|
16
|
+
const placement = { ...request, directory, modules };
|
|
14
17
|
const moves = request.paths.flatMap((asked) => {
|
|
15
18
|
const relative = asked.replace(/^\.\//, '').replace(/\/+$/, '');
|
|
16
19
|
const files = ws.exists(`${directory}/${relative}`) && ws.read(`${directory}/${relative}`) !== undefined
|
|
@@ -21,7 +24,7 @@ export function movesIntoModule(ws, config, request) {
|
|
|
21
24
|
}
|
|
22
25
|
return files.flatMap((file) => moveOf(file, placement));
|
|
23
26
|
});
|
|
24
|
-
// The specs of a moved file go with it, into the module folder of
|
|
27
|
+
// The specs of a moved file go with it, into the test folder of the module, or the module folder of the test folder of the context.
|
|
25
28
|
const specs = specsOf(ws, moves, placement).flatMap((file) => moveOf(file, placement));
|
|
26
29
|
const unique = [...new Map([...moves, ...specs].map((move) => [move.from, move])).values()];
|
|
27
30
|
refuseLosses(ws, unique, placement);
|
|
@@ -51,18 +54,23 @@ function refuseLosses(ws, moves, placement) {
|
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
/**
|
|
54
|
-
* The specs
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
+
* The specs named after a moved production file (`appointment.repository.contract.spec.ts` is of
|
|
58
|
+
* `appointment.repository.ts`), wherever they sit in a `unit/` or an `integration/` folder of the
|
|
59
|
+
* tests of where the file came from: the context, `shared/` or another module. Relative to the context.
|
|
57
60
|
*/
|
|
58
61
|
function specsOf(ws, moves, { directory, modules }) {
|
|
59
|
-
const
|
|
60
|
-
.
|
|
61
|
-
.
|
|
62
|
-
|
|
62
|
+
const moved = moves
|
|
63
|
+
.map((move) => ({ ...moduleSplit(move.from.slice(directory.length + 1), modules), from: move.from }))
|
|
64
|
+
.filter(({ path }) => !path.startsWith(`${TEST_FOLDER}/`))
|
|
65
|
+
.map(({ module, from }) => ({ module, name: posix.basename(from).replace(/\.ts$/, '') }));
|
|
66
|
+
return filesUnder(ws, directory).filter((file) => {
|
|
67
|
+
const { module, path } = moduleSplit(file, modules);
|
|
68
|
+
const [top, folder = ''] = path.split('/');
|
|
63
69
|
const stem = posix.basename(file).replace(/\.spec\.ts$/, '');
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
return (top === TEST_FOLDER &&
|
|
71
|
+
MODULE_TEST_FOLDERS.includes(folder) &&
|
|
72
|
+
file.endsWith('.spec.ts') &&
|
|
73
|
+
moved.some((from) => from.module === module && (stem === from.name || stem.startsWith(`${from.name}.`))));
|
|
66
74
|
});
|
|
67
75
|
}
|
|
68
76
|
/** The same file of the role in another module, or at the level of the context, a move would make a twin of. */
|
|
@@ -76,10 +84,8 @@ function twinsOf(ws, move, { directory, modules, module }) {
|
|
|
76
84
|
}
|
|
77
85
|
function moveOf(file, { context, directory, modules, module }) {
|
|
78
86
|
const { path } = moduleSplit(file, modules);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
if (!inLayer && !(layer === 'test' && MODULE_TEST_FOLDERS.includes(folder))) {
|
|
82
|
-
throw new CliError(`${file} is in no role folder of a layer of "${context}", and in no test/unit/ nor test/integration/.`, 'A module holds the files of the layers of its concepts and their specs: published-language/, the fakes, the builders and the worlds stay at the level of the context.');
|
|
87
|
+
if (!hasPlaceInModule(path)) {
|
|
88
|
+
throw new CliError(`${file} is in no role folder of a layer of "${context}", and in no test/unit/ nor test/integration/.`, 'A module holds the files of the layers of its concepts, their specs, their fakes and their builders: published-language/ and the worlds stay outside every module.');
|
|
83
89
|
}
|
|
84
90
|
if (isContextLevel(context, path) || isDeclarationsFile(context, file, modules)) {
|
|
85
91
|
return [];
|
|
@@ -87,4 +93,11 @@ function moveOf(file, { context, directory, modules, module }) {
|
|
|
87
93
|
const to = intoModule(module, path);
|
|
88
94
|
return to === file ? [] : [{ from: `${directory}/${file}`, to: `${directory}/${to}` }];
|
|
89
95
|
}
|
|
96
|
+
/** True for a path, read without its module, that a module holds: a file of a role folder of a layer, a spec, a fake or a builder. */
|
|
97
|
+
function hasPlaceInModule(path) {
|
|
98
|
+
const [layer = '', folder = ''] = path.split('/');
|
|
99
|
+
return layer === TEST_FOLDER
|
|
100
|
+
? MODULE_TEST_FOLDERS.includes(folder) || SUPPORT_FOLDERS.includes(folder)
|
|
101
|
+
: MODULE_LAYERS.includes(layer) && isRoleFolder(layer, folder);
|
|
102
|
+
}
|
|
90
103
|
//# sourceMappingURL=moves-into-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"moves-into-module.js","sourceRoot":"","sources":["../../src/move-to-module/moves-into-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,WAAW,GACZ,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"moves-into-module.js","sourceRoot":"","sources":["../../src/move-to-module/moves-into-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,eAAe,EACf,UAAU,EACV,cAAc,EACd,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAI1B,iGAAiG;AACjG,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAS9C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,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O,CAAC,EAAE,CAAC;QAChF,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAEpC,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,SAAS,IAAI,IAAI,EAAE,EAAE,EAAE,EAAE,GAAG,SAAS,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,sIAAsI;AACtI,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAElD,OAAO,KAAK,KAAK,WAAW;QAC1B,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC1E,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plural.d.ts","sourceRoot":"","sources":["../../src/naming/plural.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plural.d.ts","sourceRoot":"","sources":["../../src/naming/plural.ts"],"names":[],"mappings":"AAIA,2GAA2G;AAC3G,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU3C"}
|
package/dist/naming/plural.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/** The last words that name several things already, or a mass: the table is named as they are (`reader_settings`). */
|
|
2
|
+
const ALREADY_PLURAL = /^(?:settings|preferences|news|series|species|data|metadata|analytics|statistics|logistics|economics)$/;
|
|
1
3
|
/** The plural of an English word, as the generator writes table names: `purchase_orders`, `deliveries`. */
|
|
2
4
|
export function plural(word) {
|
|
5
|
+
if (ALREADY_PLURAL.test(word)) {
|
|
6
|
+
return word;
|
|
7
|
+
}
|
|
3
8
|
if (/[^aeiou]y$/.test(word)) {
|
|
4
9
|
return `${word.slice(0, -1)}ies`;
|
|
5
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plural.js","sourceRoot":"","sources":["../../src/naming/plural.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;AAClE,CAAC"}
|
|
1
|
+
{"version":3,"file":"plural.js","sourceRoot":"","sources":["../../src/naming/plural.ts"],"names":[],"mappings":"AAAA,sHAAsH;AACtH,MAAM,cAAc,GAClB,uGAAuG,CAAC;AAE1G,2GAA2G;AAC3G,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;AAClE,CAAC"}
|
package/dist/plan/format-plan.js
CHANGED
|
@@ -137,7 +137,7 @@ function howLine(batch) {
|
|
|
137
137
|
return batch.brief;
|
|
138
138
|
}
|
|
139
139
|
return batch.owner === 'conductor'
|
|
140
|
-
? 'on the trunk, by the conductor'
|
|
140
|
+
? 'on the trunk, by the conductor, in the worktree of the plan (`npx ddd-ts-kit worktree <plan>`)'
|
|
141
141
|
: `brief ${batch.owner} by hand: worker-scope briefs the worker of a context`;
|
|
142
142
|
}
|
|
143
143
|
//# sourceMappingURL=format-plan.js.map
|