ddd-ts-kit 0.87.0 → 0.88.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 +23 -0
- package/README.fr.md +13 -13
- package/README.md +12 -12
- package/dist/check/canonical/earlier-context-file.d.ts +15 -0
- package/dist/check/canonical/earlier-context-file.d.ts.map +1 -0
- package/dist/check/canonical/earlier-context-file.js +33 -0
- package/dist/check/canonical/earlier-context-file.js.map +1 -0
- package/dist/check/canonical/stray-entry.d.ts.map +1 -1
- package/dist/check/canonical/stray-entry.js +11 -9
- package/dist/check/canonical/stray-entry.js.map +1 -1
- package/dist/check/configuration/module-problems.js +2 -2
- package/dist/check/configuration/module-problems.js.map +1 -1
- package/dist/check/errors/code-list.d.ts +1 -1
- package/dist/check/errors/code-list.d.ts.map +1 -1
- package/dist/check/errors/is-codes-file.d.ts +1 -1
- package/dist/check/errors/is-codes-file.d.ts.map +1 -1
- package/dist/check/errors/is-codes-file.js +1 -1
- package/dist/check/errors/is-codes-file.js.map +1 -1
- package/dist/check/explain/errors-docs.js +5 -5
- package/dist/check/explain/errors-docs.js.map +1 -1
- package/dist/check/explain/language-docs.js +1 -1
- package/dist/check/explain/language-docs.js.map +1 -1
- package/dist/check/explain/module-docs.d.ts.map +1 -1
- package/dist/check/explain/module-docs.js +16 -12
- package/dist/check/explain/module-docs.js.map +1 -1
- package/dist/check/fixtures/authz-granted-fixtures.js +2 -2
- package/dist/check/fixtures/authz-granted-fixtures.js.map +1 -1
- package/dist/check/fixtures/authz-scope-narrows-fixtures.js +4 -4
- package/dist/check/fixtures/authz-scope-narrows-fixtures.js.map +1 -1
- package/dist/check/fixtures/context-file-fixtures.d.ts +4 -0
- package/dist/check/fixtures/context-file-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/context-file-fixtures.js +36 -0
- package/dist/check/fixtures/context-file-fixtures.js.map +1 -0
- 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 +50 -17
- package/dist/check/fixtures/module-fixtures.js.map +1 -1
- package/dist/check/fixtures/named-refusal-fixtures.js +5 -5
- package/dist/check/fixtures/named-refusal-fixtures.js.map +1 -1
- package/dist/check/fixtures/vocabulary-fixtures.js +2 -2
- package/dist/check/fixtures/vocabulary-fixtures.js.map +1 -1
- package/dist/check/project/locate.d.ts.map +1 -1
- package/dist/check/project/locate.js +18 -9
- package/dist/check/project/locate.js.map +1 -1
- package/dist/check/rules/errors-code-listed.js +6 -8
- package/dist/check/rules/errors-code-listed.js.map +1 -1
- package/dist/check/rules/errors-code-unique.js +2 -2
- package/dist/check/rules/errors-code-unique.js.map +1 -1
- package/dist/check/rules/errors-known-code.js +2 -2
- package/dist/check/rules/errors-known-code.js.map +1 -1
- package/dist/check/rules/language-glossary-term.js +1 -1
- package/dist/check/rules/language-glossary-term.js.map +1 -1
- package/dist/check/rules/module-complete.d.ts.map +1 -1
- package/dist/check/rules/module-complete.js +67 -13
- package/dist/check/rules/module-complete.js.map +1 -1
- package/dist/check/rules/naming-suffix.d.ts.map +1 -1
- package/dist/check/rules/naming-suffix.js +12 -9
- package/dist/check/rules/naming-suffix.js.map +1 -1
- package/dist/check/rules/tree-closed.d.ts.map +1 -1
- package/dist/check/rules/tree-closed.js +8 -1
- package/dist/check/rules/tree-closed.js.map +1 -1
- package/dist/check/support/path-in-context.d.ts +5 -1
- package/dist/check/support/path-in-context.d.ts.map +1 -1
- package/dist/check/support/path-in-context.js +12 -3
- package/dist/check/support/path-in-context.js.map +1 -1
- package/dist/commands/context-layout.d.ts +4 -0
- package/dist/commands/context-layout.d.ts.map +1 -0
- package/dist/commands/context-layout.js +48 -0
- package/dist/commands/context-layout.js.map +1 -0
- package/dist/commands/generate.js +2 -2
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/move-to-module.d.ts.map +1 -1
- package/dist/commands/move-to-module.js +2 -0
- package/dist/commands/move-to-module.js.map +1 -1
- package/dist/config/stack.d.ts +1 -1
- package/dist/context-files/context-file-at.d.ts +7 -0
- package/dist/context-files/context-file-at.d.ts.map +1 -0
- package/dist/context-files/context-file-at.js +9 -0
- package/dist/context-files/context-file-at.js.map +1 -0
- package/dist/context-files/context-file-placement.d.ts +8 -0
- package/dist/context-files/context-file-placement.d.ts.map +1 -0
- package/dist/context-files/context-file-placement.js +23 -0
- package/dist/context-files/context-file-placement.js.map +1 -0
- package/dist/context-files/context-file.d.ts +16 -0
- package/dist/context-files/context-file.d.ts.map +1 -0
- package/dist/context-files/context-file.js +12 -0
- package/dist/context-files/context-file.js.map +1 -0
- package/dist/context-files/earlier-place-of.d.ts +7 -0
- package/dist/context-files/earlier-place-of.d.ts.map +1 -0
- package/dist/context-files/earlier-place-of.js +10 -0
- package/dist/context-files/earlier-place-of.js.map +1 -0
- package/dist/context-files/index.d.ts +5 -0
- package/dist/context-files/index.d.ts.map +1 -0
- package/dist/context-files/index.js +5 -0
- package/dist/context-files/index.js.map +1 -0
- package/dist/context-layout/context-layout.d.ts +19 -0
- package/dist/context-layout/context-layout.d.ts.map +1 -0
- package/dist/context-layout/context-layout.js +55 -0
- package/dist/context-layout/context-layout.js.map +1 -0
- package/dist/context-layout/index.d.ts +2 -0
- package/dist/context-layout/index.d.ts.map +1 -0
- package/dist/context-layout/index.js +2 -0
- package/dist/context-layout/index.js.map +1 -0
- package/dist/context-layout/module-moves.d.ts +21 -0
- package/dist/context-layout/module-moves.d.ts.map +1 -0
- package/dist/context-layout/module-moves.js +146 -0
- package/dist/context-layout/module-moves.js.map +1 -0
- package/dist/controllers/migrate-context.js +20 -15
- package/dist/controllers/migrate-context.js.map +1 -1
- package/dist/controllers/plan-context.d.ts +5 -1
- package/dist/controllers/plan-context.d.ts.map +1 -1
- package/dist/controllers/plan-context.js +19 -5
- package/dist/controllers/plan-context.js.map +1 -1
- package/dist/depcruise/layer-rules.js +21 -7
- package/dist/depcruise/layer-rules.js.map +1 -1
- package/dist/describe/read-adapters.d.ts.map +1 -1
- package/dist/describe/read-adapters.js +6 -4
- package/dist/describe/read-adapters.js.map +1 -1
- package/dist/describe/read-controllers.d.ts.map +1 -1
- package/dist/describe/read-controllers.js +5 -3
- package/dist/describe/read-controllers.js.map +1 -1
- package/dist/describe/read-errors.d.ts +1 -1
- package/dist/describe/read-errors.d.ts.map +1 -1
- package/dist/describe/read-errors.js +5 -3
- package/dist/describe/read-errors.js.map +1 -1
- package/dist/describe/read-routes.d.ts.map +1 -1
- package/dist/describe/read-routes.js +5 -5
- package/dist/describe/read-routes.js.map +1 -1
- package/dist/docs/context-facts.d.ts +1 -1
- package/dist/docs/context-facts.d.ts.map +1 -1
- package/dist/docs/read-context.d.ts.map +1 -1
- package/dist/docs/read-context.js +2 -1
- package/dist/docs/read-context.js.map +1 -1
- package/dist/docs/refresh-context-doc.js +1 -1
- package/dist/docs/refresh-context-doc.js.map +1 -1
- package/dist/docs/state-machine-lines.d.ts +1 -1
- package/dist/docs/state-machine-lines.d.ts.map +1 -1
- package/dist/docs/state-machine-lines.js +6 -2
- package/dist/docs/state-machine-lines.js.map +1 -1
- package/dist/file-moves/file-move.d.ts +6 -0
- package/dist/file-moves/file-move.d.ts.map +1 -0
- package/dist/file-moves/file-move.js +2 -0
- package/dist/file-moves/file-move.js.map +1 -0
- package/dist/file-moves/index.d.ts +3 -0
- package/dist/file-moves/index.d.ts.map +1 -0
- package/dist/file-moves/index.js +2 -0
- package/dist/file-moves/index.js.map +1 -0
- package/dist/file-moves/move-files.d.ts +15 -0
- package/dist/file-moves/move-files.d.ts.map +1 -0
- package/dist/file-moves/move-files.js +37 -0
- package/dist/file-moves/move-files.js.map +1 -0
- package/dist/generate/errors/codes-list.d.ts +1 -1
- package/dist/generate/errors/codes-list.d.ts.map +1 -1
- package/dist/generate/errors/write-named-refusal.d.ts +1 -1
- package/dist/generate/errors/write-named-refusal.d.ts.map +1 -1
- package/dist/generate/errors/write-named-refusal.js +3 -2
- package/dist/generate/errors/write-named-refusal.js.map +1 -1
- package/dist/generate/kind.d.ts +1 -1
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.d.ts.map +1 -1
- package/dist/generate/kinds/adapter-kind.js +22 -2
- package/dist/generate/kinds/adapter-kind.js.map +1 -1
- package/dist/generate/kinds/error-kind.js +1 -1
- package/dist/generate/kinds/error-kind.js.map +1 -1
- package/dist/generate/kinds/module-kind.js +1 -1
- package/dist/generate/kinds/module-kind.js.map +1 -1
- package/dist/generate/kinds/port-kind.d.ts.map +1 -1
- package/dist/generate/kinds/port-kind.js +3 -1
- package/dist/generate/kinds/port-kind.js.map +1 -1
- package/dist/generate/kinds/presentation/controller-of.d.ts +1 -1
- package/dist/generate/kinds/presentation/controller-of.d.ts.map +1 -1
- package/dist/generate/kinds/presentation/controller-of.js +7 -5
- package/dist/generate/kinds/presentation/controller-of.js.map +1 -1
- package/dist/generate/permissions-file.d.ts +4 -1
- package/dist/generate/permissions-file.d.ts.map +1 -1
- package/dist/generate/permissions-file.js +6 -2
- package/dist/generate/permissions-file.js.map +1 -1
- package/dist/generate/place-context-files.d.ts +9 -0
- package/dist/generate/place-context-files.d.ts.map +1 -0
- package/dist/generate/place-context-files.js +14 -0
- package/dist/generate/place-context-files.js.map +1 -0
- package/dist/generate/place-generated-files.d.ts +18 -0
- package/dist/generate/place-generated-files.d.ts.map +1 -0
- package/dist/generate/{place-in-modules.js → place-generated-files.js} +42 -17
- package/dist/generate/place-generated-files.js.map +1 -0
- package/dist/generate/refresh-docs.d.ts.map +1 -1
- package/dist/generate/refresh-docs.js +3 -0
- package/dist/generate/refresh-docs.js.map +1 -1
- package/dist/generate/refuse-earlier-layout.d.ts +9 -0
- package/dist/generate/refuse-earlier-layout.d.ts.map +1 -0
- package/dist/generate/refuse-earlier-layout.js +15 -0
- package/dist/generate/refuse-earlier-layout.js.map +1 -0
- package/dist/help/notes.d.ts +1 -1
- package/dist/help/notes.d.ts.map +1 -1
- package/dist/help/notes.js +24 -9
- package/dist/help/notes.js.map +1 -1
- package/dist/help/usage.d.ts +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +1 -0
- package/dist/help/usage.js.map +1 -1
- package/dist/init/manifest/versions.js +24 -24
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +6 -0
- package/dist/init/run-init.js.map +1 -1
- package/dist/knip/ignore-code-types-where-they-are.d.ts +11 -0
- package/dist/knip/ignore-code-types-where-they-are.d.ts.map +1 -0
- package/dist/knip/ignore-code-types-where-they-are.js +56 -0
- package/dist/knip/ignore-code-types-where-they-are.js.map +1 -0
- package/dist/knip/index.d.ts +2 -0
- package/dist/knip/index.d.ts.map +1 -0
- package/dist/knip/index.js +2 -0
- package/dist/knip/index.js.map +1 -0
- package/dist/model-modules/index.d.ts +1 -1
- package/dist/model-modules/index.d.ts.map +1 -1
- package/dist/model-modules/index.js +1 -1
- package/dist/model-modules/index.js.map +1 -1
- package/dist/model-modules/into-module.d.ts +5 -1
- package/dist/model-modules/into-module.d.ts.map +1 -1
- package/dist/model-modules/into-module.js +12 -5
- package/dist/model-modules/into-module.js.map +1 -1
- package/dist/model-modules/is-context-level.d.ts +5 -3
- package/dist/model-modules/is-context-level.d.ts.map +1 -1
- package/dist/model-modules/is-context-level.js +17 -4
- package/dist/model-modules/is-context-level.js.map +1 -1
- package/dist/model-modules/module-layers.d.ts +7 -1
- package/dist/model-modules/module-layers.d.ts.map +1 -1
- package/dist/model-modules/module-layers.js +8 -2
- package/dist/model-modules/module-layers.js.map +1 -1
- package/dist/model-modules/module-name-flaw.d.ts +2 -2
- package/dist/model-modules/module-name-flaw.js +4 -4
- package/dist/model-modules/module-name-flaw.js.map +1 -1
- package/dist/model-modules/module-placement.d.ts +5 -1
- package/dist/model-modules/module-placement.d.ts.map +1 -1
- package/dist/model-modules/module-placement.js +47 -18
- package/dist/model-modules/module-placement.js.map +1 -1
- package/dist/model-modules/module-split.d.ts +9 -5
- package/dist/model-modules/module-split.d.ts.map +1 -1
- package/dist/model-modules/module-split.js +30 -13
- package/dist/model-modules/module-split.js.map +1 -1
- package/dist/model-modules/role-directories-of.d.ts.map +1 -1
- package/dist/model-modules/role-directories-of.js +6 -1
- package/dist/model-modules/role-directories-of.js.map +1 -1
- package/dist/model-modules/role-folders-of.d.ts +1 -1
- package/dist/model-modules/role-folders-of.d.ts.map +1 -1
- package/dist/model-modules/role-folders-of.js +15 -5
- package/dist/model-modules/role-folders-of.js.map +1 -1
- package/dist/model-modules/role-folders.d.ts +2 -2
- package/dist/model-modules/role-folders.js +2 -2
- package/dist/move-to-module/module-move.d.ts +2 -4
- package/dist/move-to-module/module-move.d.ts.map +1 -1
- package/dist/move-to-module/move-to-module.d.ts +2 -6
- package/dist/move-to-module/move-to-module.d.ts.map +1 -1
- package/dist/move-to-module/move-to-module.js +2 -31
- package/dist/move-to-module/move-to-module.js.map +1 -1
- package/dist/move-to-module/moves-into-module.d.ts +1 -1
- package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
- package/dist/move-to-module/moves-into-module.js +25 -6
- package/dist/move-to-module/moves-into-module.js.map +1 -1
- package/dist/refusals/code-types-pattern.d.ts +4 -0
- package/dist/refusals/code-types-pattern.d.ts.map +1 -0
- package/dist/refusals/code-types-pattern.js +6 -0
- package/dist/refusals/code-types-pattern.js.map +1 -0
- package/dist/refusals/ignore-code-types.d.ts +1 -1
- package/dist/refusals/ignore-code-types.d.ts.map +1 -1
- package/dist/refusals/ignore-code-types.js +3 -2
- package/dist/refusals/ignore-code-types.js.map +1 -1
- package/dist/refusals/path-from-contexts.d.ts +1 -1
- package/dist/refusals/path-from-contexts.js +2 -2
- package/dist/refusals/path-from-contexts.js.map +1 -1
- package/dist/refusals/with-codes.d.ts +1 -1
- package/dist/refusals/with-codes.d.ts.map +1 -1
- package/dist/refusals/with-codes.js +1 -1
- package/dist/refusals/with-codes.js.map +1 -1
- package/dist/refusals/write-refusal-classes.d.ts.map +1 -1
- package/dist/refusals/write-refusal-classes.js +4 -2
- package/dist/refusals/write-refusal-classes.js.map +1 -1
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
- package/templates/command/handler.spec.buses.ts.tpl +1 -1
- package/templates/command/handler.spec.tsyringe.ts.tpl +1 -1
- package/templates/context/permission-set.tpl +1 -1
- package/templates/context/permissions.spec.ts.tpl +1 -1
- package/templates/error/refusal.ts.tpl +1 -1
- package/templates/file-upload/handler.spec.ts.tpl +1 -1
- package/templates/init/rules/application.md.tpl +3 -2
- package/templates/init/rules/domain.md.tpl +3 -2
- package/templates/init/rules/infrastructure.md.tpl +1 -0
- package/templates/init/rules/presentation.md.tpl +2 -1
- package/templates/pipeline/knip.json.tpl +1 -1
- package/templates/pipeline/package-scripts.json +1 -1
- package/templates/policy/policy.declared.ts.tpl +1 -1
- package/templates/policy/policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/authorization/change-member-roles.policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/authorization/grant-delegations.policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/authorization/invite-members.policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/authorization/read-members.policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/authorization/remove-members.policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/authorization/revoke-delegations.policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/authorization/revoke-invitations.policy.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/accept-invitation/accept-invitation.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/change-member-role/change-member-role.handler.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/deactivate-account/deactivate-account.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/decline-invitation/decline-invitation.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/grant-delegation/grant-delegation.handler.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/invite-member/invite-member.handler.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/open-organisation/open-organisation.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/provision-account/provision-account.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/remove-member/remove-member.handler.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/revoke-delegation/revoke-delegation.handler.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.command.ts.tpl +1 -1
- package/templates/presets/identity/context/application/commands/revoke-invitation/revoke-invitation.handler.ts.tpl +1 -1
- package/templates/presets/identity/context/application/queries/search-members/search-members.handler.ts.tpl +1 -1
- package/templates/presets/identity/context/application/queries/search-members/search-members.query.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/above-own-role.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/account-already-deactivated.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/already-member.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/deactivated-account.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/delegation-not-active.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/delegation-period-inverted.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/delegation-to-oneself.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/delegation-too-long.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/delegation-with-no-right.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/email-not-verified.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/invalid-display-name.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/invalid-email-address.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/invalid-organisation-name.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/invalid-organisation-slug.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/invitation-expired.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/invitation-not-addressed-to-account.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/invitation-not-pending.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/last-owner.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/not-an-owner.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/organisation-slug-taken.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/own-role.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/right-not-in-role.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/unknown-account.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/unknown-delegation.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/unknown-invitation.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/unknown-member.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/domain/errors/unknown-organisation.error.named.ts.tpl +1 -1
- package/templates/presets/identity/context/test/worlds/__context__.world.ts.tpl +1 -1
- package/templates/query/handler.spec.buses.ts.tpl +1 -1
- package/templates/query/handler.spec.tsyringe.ts.tpl +1 -1
- package/templates/query/search.handler.declared.ts.tpl +1 -1
- package/templates/query/search.handler.spec.buses.ts.tpl +1 -1
- package/templates/query/search.handler.spec.tsyringe.ts.tpl +1 -1
- package/templates/query/search.handler.ts.tpl +1 -1
- package/dist/generate/place-in-modules.d.ts +0 -16
- package/dist/generate/place-in-modules.d.ts.map +0 -1
- package/dist/generate/place-in-modules.js.map +0 -1
- /package/templates/presets/identity/context/{domain/errors/codes.named.ts.tpl → __context__.codes.named.ts.tpl} +0 -0
- /package/templates/presets/identity/context/{application/authorization/__context__.permissions.ts.tpl → __context__.permissions.ts.tpl} +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { isRecord } from '../config/values/is-record.js';
|
|
2
|
+
import { CODES_FILE } from '../context-files/index.js';
|
|
3
|
+
import { formatJson } from '../json/format-json.js';
|
|
4
|
+
import { codeTypesPattern } from '../refusals/code-types-pattern.js';
|
|
5
|
+
const KNIP_FILE = 'knip.json';
|
|
6
|
+
const ISSUES = 'ignoreIssues';
|
|
7
|
+
/**
|
|
8
|
+
* The code types knip is told to leave alone, named where the code lists are: at the root of each
|
|
9
|
+
* context, and where 0.86 and 0.87 kept them as long as one context still holds a list there. Only a config
|
|
10
|
+
* that already ignores the code types is touched, the patterns kept where they were among the others.
|
|
11
|
+
*/
|
|
12
|
+
export function ignoreCodeTypesWhereTheyAre(ws, config) {
|
|
13
|
+
const text = ws.read(KNIP_FILE);
|
|
14
|
+
const knip = text === undefined ? undefined : parsed(text);
|
|
15
|
+
if (text === undefined || knip === undefined) {
|
|
16
|
+
return text === undefined ? 'absent' : 'unreadable';
|
|
17
|
+
}
|
|
18
|
+
const issues = knip[ISSUES];
|
|
19
|
+
const known = [codeTypesPattern(config), earlierPattern(config)];
|
|
20
|
+
if (!isRecord(issues) || !Object.keys(issues).some((pattern) => known.includes(pattern))) {
|
|
21
|
+
return 'unchanged';
|
|
22
|
+
}
|
|
23
|
+
const wanted = keepsEarlierLists(ws, config) ? known : [codeTypesPattern(config)];
|
|
24
|
+
const next = { ...knip, [ISSUES]: withPatterns(issues, known, wanted) };
|
|
25
|
+
if (JSON.stringify(next) === JSON.stringify(knip)) {
|
|
26
|
+
return 'unchanged';
|
|
27
|
+
}
|
|
28
|
+
ws.update(KNIP_FILE, formatJson(next));
|
|
29
|
+
return 'rewritten';
|
|
30
|
+
}
|
|
31
|
+
function earlierPattern(config) {
|
|
32
|
+
return `${config.contextsDir}/*/${CODES_FILE.earlier('*')}`;
|
|
33
|
+
}
|
|
34
|
+
function keepsEarlierLists(ws, config) {
|
|
35
|
+
return ws
|
|
36
|
+
.directories(config.contextsDir)
|
|
37
|
+
.some((context) => ws.exists(`${config.contextsDir}/${context}/${CODES_FILE.earlier(context)}`));
|
|
38
|
+
}
|
|
39
|
+
/** The issues with the `wanted` patterns in place of the `known` ones, where the first of them was. */
|
|
40
|
+
function withPatterns(issues, known, wanted) {
|
|
41
|
+
const entries = Object.entries(issues);
|
|
42
|
+
const at = entries.findIndex(([pattern]) => known.includes(pattern));
|
|
43
|
+
const others = entries.filter(([pattern]) => !known.includes(pattern));
|
|
44
|
+
const placed = wanted.map((pattern) => [pattern, issues[pattern] ?? ['types']]);
|
|
45
|
+
return Object.fromEntries([...others.slice(0, at), ...placed, ...others.slice(at)]);
|
|
46
|
+
}
|
|
47
|
+
function parsed(text) {
|
|
48
|
+
try {
|
|
49
|
+
const knip = JSON.parse(text);
|
|
50
|
+
return isRecord(knip) ? knip : undefined;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=ignore-code-types-where-they-are.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignore-code-types-where-they-are.js","sourceRoot":"","sources":["../../src/knip/ignore-code-types-where-they-are.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE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,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,MAAM,CAAC,IAAY;IAC1B,IAAI,CAAC;QACH,MAAM,IAAI,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAEvC,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/knip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/knip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -2,7 +2,7 @@ export { declaredModules } from './declared-modules.js';
|
|
|
2
2
|
export { intoModule } from './into-module.js';
|
|
3
3
|
export { isContextLevel } from './is-context-level.js';
|
|
4
4
|
export { isRoleFolder } from './is-role-folder.js';
|
|
5
|
-
export { MODULE_LAYERS } from './module-layers.js';
|
|
5
|
+
export { EARLIER_MODULE_LAYERS, MODULE_LAYERS, MODULE_TEST_FOLDERS } from './module-layers.js';
|
|
6
6
|
export { modulePlacement } from './module-placement.js';
|
|
7
7
|
export { moduleSplit } from './module-split.js';
|
|
8
8
|
export { placedImports } from './placed-imports.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model-modules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AAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -2,7 +2,7 @@ export { declaredModules } from './declared-modules.js';
|
|
|
2
2
|
export { intoModule } from './into-module.js';
|
|
3
3
|
export { isContextLevel } from './is-context-level.js';
|
|
4
4
|
export { isRoleFolder } from './is-role-folder.js';
|
|
5
|
-
export { MODULE_LAYERS } from './module-layers.js';
|
|
5
|
+
export { EARLIER_MODULE_LAYERS, MODULE_LAYERS, MODULE_TEST_FOLDERS } from './module-layers.js';
|
|
6
6
|
export { modulePlacement } from './module-placement.js';
|
|
7
7
|
export { moduleSplit } from './module-split.js';
|
|
8
8
|
export { placedImports } from './placed-imports.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model-modules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAyB,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAoB,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Puts a path relative to its context, written without modules, back in its module: a file of a
|
|
3
|
+
* layer under the folder of the module (`<module>/domain/...`), a spec under the module folder of
|
|
4
|
+
* its test folder (`test/unit/<module>/...`). Any other path stays at the level of the context.
|
|
5
|
+
*/
|
|
2
6
|
export declare function intoModule(module: string | undefined, file: string): string;
|
|
3
7
|
//# sourceMappingURL=into-module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"into-module.d.ts","sourceRoot":"","sources":["../../src/model-modules/into-module.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"into-module.d.ts","sourceRoot":"","sources":["../../src/model-modules/into-module.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAY3E"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import { MODULE_LAYERS } from './module-layers.js';
|
|
2
|
-
/**
|
|
1
|
+
import { MODULE_LAYERS, MODULE_TEST_FOLDERS } from './module-layers.js';
|
|
2
|
+
/**
|
|
3
|
+
* Puts a path relative to its context, written without modules, back in its module: a file of a
|
|
4
|
+
* layer under the folder of the module (`<module>/domain/...`), a spec under the module folder of
|
|
5
|
+
* its test folder (`test/unit/<module>/...`). Any other path stays at the level of the context.
|
|
6
|
+
*/
|
|
3
7
|
export function intoModule(module, file) {
|
|
4
|
-
const [
|
|
5
|
-
if (module === undefined
|
|
8
|
+
const [first = '', second = '', ...rest] = file.split('/');
|
|
9
|
+
if (module === undefined) {
|
|
6
10
|
return file;
|
|
7
11
|
}
|
|
8
|
-
|
|
12
|
+
if (MODULE_LAYERS.includes(first)) {
|
|
13
|
+
return `${module}/${file}`;
|
|
14
|
+
}
|
|
15
|
+
return first === 'test' && MODULE_TEST_FOLDERS.includes(second) ? ['test', second, module, ...rest].join('/') : file;
|
|
9
16
|
}
|
|
10
17
|
//# sourceMappingURL=into-module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"into-module.js","sourceRoot":"","sources":["../../src/model-modules/into-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"into-module.js","sourceRoot":"","sources":["../../src/model-modules/into-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAErE;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,MAA0B,EAAE,IAAY;IACjE,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE3D,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAClC,OAAO,GAAG,MAAM,IAAI,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED,OAAO,KAAK,KAAK,MAAM,IAAI,mBAAmB,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACvH,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The files
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* The files a context keeps at its own level once it is divided into modules, by their path
|
|
3
|
+
* relative to the context written without modules: the closed list of its error codes and its
|
|
4
|
+
* permission set (`perContext` of the canonical tree, at the root of the context), the schema,
|
|
5
|
+
* tables and migrations of its database, its route groups with their guards and shared shapes,
|
|
6
|
+
* and the fakes, builders and worlds of its specs. Every other file of a layer belongs to a module.
|
|
5
7
|
*/
|
|
6
8
|
export declare function isContextLevel(context: string, file: string): boolean;
|
|
7
9
|
//# sourceMappingURL=is-context-level.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-context-level.d.ts","sourceRoot":"","sources":["../../src/model-modules/is-context-level.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"is-context-level.d.ts","sourceRoot":"","sources":["../../src/model-modules/is-context-level.ts"],"names":[],"mappings":"AAaA;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAOrE"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { ROLES } from '../check/canonical/roles.js';
|
|
2
|
+
/** What a context divided into modules keeps at its own level, read without modules, besides the files of `perContext`. */
|
|
3
|
+
const SHARED_BY_THE_MODULES = [
|
|
4
|
+
// The database of the context: its schema, its tables and its migrations; a row schema is of a module.
|
|
5
|
+
/^infrastructure\/persistence\/(?![^/]*-row\.schema\.ts$)[^/]+\.schema\.ts$/,
|
|
6
|
+
// The route groups, their guards and the shapes several routes answer with.
|
|
7
|
+
/^presentation\/http\/[^/]+\.routes\.ts$/,
|
|
8
|
+
/^presentation\/http\/(?:shared|guards)\//,
|
|
9
|
+
// What the specs of several modules share.
|
|
10
|
+
/^test\/(?:fakes|builders|worlds)\//,
|
|
11
|
+
];
|
|
2
12
|
/**
|
|
3
|
-
* The files
|
|
4
|
-
*
|
|
5
|
-
*
|
|
13
|
+
* The files a context keeps at its own level once it is divided into modules, by their path
|
|
14
|
+
* relative to the context written without modules: the closed list of its error codes and its
|
|
15
|
+
* permission set (`perContext` of the canonical tree, at the root of the context), the schema,
|
|
16
|
+
* tables and migrations of its database, its route groups with their guards and shared shapes,
|
|
17
|
+
* and the fakes, builders and worlds of its specs. Every other file of a layer belongs to a module.
|
|
6
18
|
*/
|
|
7
19
|
export function isContextLevel(context, file) {
|
|
8
|
-
return
|
|
20
|
+
return (SHARED_BY_THE_MODULES.some((pattern) => pattern.test(file)) ||
|
|
21
|
+
ROLES.some((role) => (role.perContext ?? []).some((name) => file === `${role.directory}/${name.replace('<context>', context)}`)));
|
|
9
22
|
}
|
|
10
23
|
//# sourceMappingURL=is-context-level.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-context-level.js","sourceRoot":"","sources":["../../src/model-modules/is-context-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD
|
|
1
|
+
{"version":3,"file":"is-context-level.js","sourceRoot":"","sources":["../../src/model-modules/is-context-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAEjD,2HAA2H;AAC3H,MAAM,qBAAqB,GAAsB;IAC/C,uGAAuG;IACvG,4EAA4E;IAC5E,4EAA4E;IAC5E,yCAAyC;IACzC,0CAA0C;IAC1C,2CAA2C;IAC3C,oCAAoC;CACrC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,IAAY;IAC1D,OAAO,CACL,qBAAqB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAClB,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC,CAC3G,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
/** The
|
|
1
|
+
/** The four layers a module of the model holds, each with its role folders unchanged below it. */
|
|
2
2
|
export declare const MODULE_LAYERS: readonly string[];
|
|
3
|
+
/** The layers 0.86 and 0.87 put a module under (`domain/<module>/`), still read for one minor version. */
|
|
4
|
+
export declare const EARLIER_MODULE_LAYERS: readonly string[];
|
|
5
|
+
/** The folders of `test/` whose specs follow the module of their subject: `test/unit/<module>/`. */
|
|
6
|
+
export declare const MODULE_TEST_FOLDERS: readonly string[];
|
|
7
|
+
/** What a module can never be named: a layer, a folder of the root of a context. */
|
|
8
|
+
export declare const CONTEXT_FOLDERS: readonly string[];
|
|
3
9
|
//# sourceMappingURL=module-layers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-layers.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-layers.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"module-layers.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-layers.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAAgE,CAAC;AAE5G,0GAA0G;AAC1G,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAA8B,CAAC;AAElF,oGAAoG;AACpG,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAA4B,CAAC;AAE9E,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAqD,CAAC"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
/** The
|
|
2
|
-
export const MODULE_LAYERS = ['domain', 'application'];
|
|
1
|
+
/** The four layers a module of the model holds, each with its role folders unchanged below it. */
|
|
2
|
+
export const MODULE_LAYERS = ['domain', 'application', 'infrastructure', 'presentation'];
|
|
3
|
+
/** The layers 0.86 and 0.87 put a module under (`domain/<module>/`), still read for one minor version. */
|
|
4
|
+
export const EARLIER_MODULE_LAYERS = ['domain', 'application'];
|
|
5
|
+
/** The folders of `test/` whose specs follow the module of their subject: `test/unit/<module>/`. */
|
|
6
|
+
export const MODULE_TEST_FOLDERS = ['unit', 'integration'];
|
|
7
|
+
/** What a module can never be named: a layer, a folder of the root of a context. */
|
|
8
|
+
export const CONTEXT_FOLDERS = [...MODULE_LAYERS, 'published-language', 'test'];
|
|
3
9
|
//# sourceMappingURL=module-layers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-layers.js","sourceRoot":"","sources":["../../src/model-modules/module-layers.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"module-layers.js","sourceRoot":"","sources":["../../src/model-modules/module-layers.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,MAAM,CAAC,MAAM,aAAa,GAAsB,CAAC,QAAQ,EAAE,aAAa,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC;AAE5G,0GAA0G;AAC1G,MAAM,CAAC,MAAM,qBAAqB,GAAsB,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;AAElF,oGAAoG;AACpG,MAAM,CAAC,MAAM,mBAAmB,GAAsB,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE9E,oFAAoF;AACpF,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,GAAG,aAAa,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -9,8 +9,8 @@ export type ModuleNameFlaw = {
|
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* The one judgement of a module name that the config check, the rule module/declared and
|
|
12
|
-
* `generate module` share: a folder name in kebab-case, never the name of a
|
|
13
|
-
* technical grouping. Whether its words are terms of the glossary depends on the context.
|
|
12
|
+
* `generate module` share: a folder name in kebab-case, never the name of a layer, of a folder of the
|
|
13
|
+
* root of a context or of a role folder, never a technical grouping. Whether its words are terms of the glossary depends on the context.
|
|
14
14
|
*/
|
|
15
15
|
export declare function moduleNameFlaw(name: string): ModuleNameFlaw | undefined;
|
|
16
16
|
//# sourceMappingURL=module-name-flaw.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TECHNICAL_WORDS } from '../check/language/technical-words.js';
|
|
2
2
|
import { splitWords } from '../naming/index.js';
|
|
3
3
|
import { isRoleFolder } from './is-role-folder.js';
|
|
4
|
-
import { MODULE_LAYERS } from './module-layers.js';
|
|
4
|
+
import { CONTEXT_FOLDERS, MODULE_LAYERS } from './module-layers.js';
|
|
5
5
|
/**
|
|
6
6
|
* Words that name a bag, not a part of the model: a module called `shared`, `common` or `core`
|
|
7
7
|
* becomes the place where everything else goes, which is what modules are there to avoid.
|
|
@@ -22,14 +22,14 @@ const MODULE_TECHNICAL_WORDS = [
|
|
|
22
22
|
const KEBAB = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
|
|
23
23
|
/**
|
|
24
24
|
* The one judgement of a module name that the config check, the rule module/declared and
|
|
25
|
-
* `generate module` share: a folder name in kebab-case, never the name of a
|
|
26
|
-
* technical grouping. Whether its words are terms of the glossary depends on the context.
|
|
25
|
+
* `generate module` share: a folder name in kebab-case, never the name of a layer, of a folder of the
|
|
26
|
+
* root of a context or of a role folder, never a technical grouping. Whether its words are terms of the glossary depends on the context.
|
|
27
27
|
*/
|
|
28
28
|
export function moduleNameFlaw(name) {
|
|
29
29
|
if (!KEBAB.test(name)) {
|
|
30
30
|
return { reason: 'format' };
|
|
31
31
|
}
|
|
32
|
-
if (MODULE_LAYERS.some((layer) => isRoleFolder(layer, name))) {
|
|
32
|
+
if (CONTEXT_FOLDERS.includes(name) || MODULE_LAYERS.some((layer) => isRoleFolder(layer, name))) {
|
|
33
33
|
return { reason: 'role-folder' };
|
|
34
34
|
}
|
|
35
35
|
const word = splitWords(name).find((candidate) => MODULE_TECHNICAL_WORDS.includes(candidate));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-name-flaw.js","sourceRoot":"","sources":["../../src/model-modules/module-name-flaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"module-name-flaw.js","sourceRoot":"","sources":["../../src/model-modules/module-name-flaw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEjE;;;GAGG;AACH,MAAM,sBAAsB,GAAsB;IAChD,GAAG,eAAe;IAClB,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,MAAM;IACN,SAAS;IACT,KAAK;IACL,OAAO;CACR,CAAC;AAEF,MAAM,KAAK,GAAG,iCAAiC,CAAC;AAQhD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACtB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC;QAC/F,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IACnC,CAAC;IAED,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,sBAAsB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAE9F,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -15,11 +15,15 @@ export interface PlacementSources {
|
|
|
15
15
|
readonly unplaced: (context: string, relative: string) => never;
|
|
16
16
|
/** Called when `--module` names another module than the one that holds the use case of the file: it throws. */
|
|
17
17
|
readonly split: (context: string, relative: string, holder: string) => never;
|
|
18
|
+
/** The module whose production file a spec of a context is named after (`<subject>.spec.ts`), if one is. */
|
|
19
|
+
readonly subjectModule: (context: string, spec: string) => string | undefined;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Where a path of a context, written as it would be without modules of its model, is: as written
|
|
21
23
|
* when the file is there or stays one per context; else in the module that holds it, the asked
|
|
22
|
-
* one first; else, for a file being written, in the asked module.
|
|
24
|
+
* one first; else, for a file being written, in the asked module. A spec goes with its subject,
|
|
25
|
+
* in the module that holds the file it is named after, and stays at the level of the context
|
|
26
|
+
* when no module does.
|
|
23
27
|
*/
|
|
24
28
|
export declare function modulePlacement(sources: PlacementSources): (file: string, writing: boolean) => string;
|
|
25
29
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-placement.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-placement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAMxC,qGAAqG;AACrG,UAAU,WAAW;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,CAAC;IAC3D,8GAA8G;IAC9G,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,KAAK,CAAC;IAChE,+GAA+G;IAC/G,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"module-placement.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-placement.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAMxC,qGAAqG;AACrG,UAAU,WAAW;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,CAAC;IACxC,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,8DAA8D;IAC9D,QAAQ,CAAC,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,SAAS,MAAM,EAAE,CAAC;IAC3D,8GAA8G;IAC9G,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,KAAK,CAAC;IAChE,+GAA+G;IAC/G,QAAQ,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC;IAC7E,4GAA4G;IAC5G,QAAQ,CAAC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;CAC/E;AAQD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,MAAM,CAcrG"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import { declaredModules } from './declared-modules.js';
|
|
2
3
|
import { intoModule } from './into-module.js';
|
|
3
4
|
import { isContextLevel } from './is-context-level.js';
|
|
4
|
-
import {
|
|
5
|
-
import { MODULE_LAYERS } from './module-layers.js';
|
|
5
|
+
import { MODULE_LAYERS, MODULE_TEST_FOLDERS } from './module-layers.js';
|
|
6
6
|
/**
|
|
7
7
|
* Where a path of a context, written as it would be without modules of its model, is: as written
|
|
8
8
|
* when the file is there or stays one per context; else in the module that holds it, the asked
|
|
9
|
-
* one first; else, for a file being written, in the asked module.
|
|
9
|
+
* one first; else, for a file being written, in the asked module. A spec goes with its subject,
|
|
10
|
+
* in the module that holds the file it is named after, and stays at the level of the context
|
|
11
|
+
* when no module does.
|
|
10
12
|
*/
|
|
11
13
|
export function modulePlacement(sources) {
|
|
12
14
|
return (file, writing) => {
|
|
@@ -14,19 +16,33 @@ export function modulePlacement(sources) {
|
|
|
14
16
|
if (role === undefined || isContextLevel(role.context, role.relative) || sources.existsAsIs(file)) {
|
|
15
17
|
return file;
|
|
16
18
|
}
|
|
19
|
+
if (role.relative.startsWith('test/')) {
|
|
20
|
+
return specInItsModule(sources, role) ?? file;
|
|
21
|
+
}
|
|
17
22
|
return inItsModule(sources, role, writing) ?? (writing ? unplaced(sources, role, file) : file);
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
|
-
/** The path a
|
|
25
|
+
/** The path a file has in a context, when it is written in a layer or in a test folder a module divides. */
|
|
21
26
|
function rolePathOf(config, file) {
|
|
22
27
|
const prefix = `${config.contextsDir}/`;
|
|
23
|
-
const [context = '',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
const [context = '', ...parts] = file.startsWith(prefix) ? file.slice(prefix.length).split('/') : [];
|
|
29
|
+
const inLayer = MODULE_LAYERS.includes(parts[0] ?? '') && parts.length > 1;
|
|
30
|
+
return inLayer || isSpecOutsideModules(parts, declaredModules(config, context))
|
|
31
|
+
? { context, relative: parts.join('/') }
|
|
32
|
+
: undefined;
|
|
33
|
+
}
|
|
34
|
+
/** A spec of `test/unit/` or `test/integration/`, at any depth, not already in the folder of a module. */
|
|
35
|
+
function isSpecOutsideModules([layer, folder = '', first = ''], modules) {
|
|
36
|
+
return layer === 'test' && MODULE_TEST_FOLDERS.includes(folder) && first !== '' && !modules.includes(first);
|
|
37
|
+
}
|
|
38
|
+
/** The module of a spec: the one that holds it, the asked one, or the one that holds its subject. */
|
|
39
|
+
function specInItsModule(sources, role) {
|
|
40
|
+
const { context, relative } = role;
|
|
41
|
+
const asked = sources.asked?.context === context ? sources.asked.module : undefined;
|
|
42
|
+
const candidates = candidatesOf(sources, role, asked);
|
|
43
|
+
const holding = candidates.ordered.find((module) => sources.existsAsIs(candidates.inModule(module)));
|
|
44
|
+
const chosen = holding ?? asked ?? sources.subjectModule(context, path.posix.basename(relative));
|
|
45
|
+
return chosen === undefined ? undefined : candidates.inModule(chosen);
|
|
30
46
|
}
|
|
31
47
|
/**
|
|
32
48
|
* The file in the module that holds it, the asked module first; else in the module that holds
|
|
@@ -47,21 +63,34 @@ function inItsModule(sources, role, writing) {
|
|
|
47
63
|
}
|
|
48
64
|
function candidatesOf(sources, { context, relative }, asked) {
|
|
49
65
|
const others = sources.modulesOf(context).filter((module) => module !== asked);
|
|
66
|
+
const placedIn = (module, file) => `${sources.config.contextsDir}/${context}/${intoModule(module, file)}`;
|
|
50
67
|
return {
|
|
51
68
|
ordered: [...(asked === undefined ? [] : [asked]), ...others],
|
|
52
|
-
inModule: (module) =>
|
|
69
|
+
inModule: (module) => placedIn(module, relative),
|
|
70
|
+
placedIn,
|
|
53
71
|
};
|
|
54
72
|
}
|
|
55
73
|
/**
|
|
56
|
-
* The module that holds the file, or, for a file of a use case
|
|
57
|
-
*
|
|
74
|
+
* The module that holds the file, or, for a file of a use case, the one that holds a folder of
|
|
75
|
+
* that use case: its folder of `application/commands/` or `application/queries/`, or, for a file
|
|
76
|
+
* of its route, the folder of the route and the folder of the use case it sends.
|
|
58
77
|
*/
|
|
59
|
-
function holderOf(sources, { ordered, inModule }, relative) {
|
|
78
|
+
function holderOf(sources, { ordered, inModule, placedIn }, relative) {
|
|
60
79
|
const holding = ordered.find((module) => sources.existsAsIs(inModule(module)));
|
|
61
|
-
|
|
62
|
-
|
|
80
|
+
const folders = useCaseFoldersOf(relative);
|
|
81
|
+
return holding ?? ordered.find((module) => folders.some((folder) => sources.existsAsIs(placedIn(module, folder))));
|
|
82
|
+
}
|
|
83
|
+
/** The folders, written without modules, that name the use case a file belongs to; none for a file of no use case. */
|
|
84
|
+
function useCaseFoldersOf(relative) {
|
|
85
|
+
const parts = relative.split('/');
|
|
86
|
+
const [layer, role = '', first = '', second = ''] = parts;
|
|
87
|
+
const inUseCase = parts.length > 4;
|
|
88
|
+
if (layer === 'application' && ['commands', 'queries'].includes(role) && parts.length > 3) {
|
|
89
|
+
return [`application/${role}/${first}`];
|
|
63
90
|
}
|
|
64
|
-
return
|
|
91
|
+
return layer === 'presentation' && role === 'http' && inUseCase
|
|
92
|
+
? [`presentation/http/${first}/${second}`, `application/commands/${second}`, `application/queries/${second}`]
|
|
93
|
+
: [];
|
|
65
94
|
}
|
|
66
95
|
/** A file written in a context that declares modules, without saying which one: refused, with the way out. */
|
|
67
96
|
function unplaced(sources, { context, relative }, file) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-placement.js","sourceRoot":"","sources":["../../src/model-modules/module-placement.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"module-placement.js","sourceRoot":"","sources":["../../src/model-modules/module-placement.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AA6BrE;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,OAAyB;IACvD,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAE9C,I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AAI,SAAS;QAC7D,CAAC,CAAC,CAAC,qBAAqB,KAAK,IAAI,MAAM,EAAE,EAAE,wBAAwB,MAAM,EAAE,EAAE,uBAAuB,MAAM,EAAE,CAAC;QAC7G,CAAC,CAAC,EAAE,CAAC;AACT,CAAC;AAED,8GAA8G;AAC9G,SAAS,QAAQ,CAAC,OAAyB,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAY,EAAE,IAAY;IACxF,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;IAE9E,OAAO,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC"}
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
export interface ModuleSplit {
|
|
3
3
|
readonly module: string | undefined;
|
|
4
4
|
readonly path: string;
|
|
5
|
+
/** True when the module sits where 0.86 and 0.87 put it, under `domain/` or `application/`. */
|
|
6
|
+
readonly earlier?: boolean;
|
|
5
7
|
}
|
|
6
8
|
/**
|
|
7
9
|
* Reads the module of a path relative to its context, among the modules of the model the config
|
|
8
|
-
* declares (`declaredModules`): `domain/
|
|
9
|
-
* `domain/aggregates/calendar.aggregate.ts` of the module `calendars
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* declares (`declaredModules`): `calendars/domain/aggregates/calendar.aggregate.ts` is
|
|
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
|
+
* The layout of 0.86 and 0.87, `domain/calendars/aggregates/...`, is read too, and said so (`earlier`). A
|
|
14
|
+
* folder the config does not declare is no module: `tree/closed` reports it, and no tool reads it
|
|
15
|
+
* as one. The folder of the module itself (`calendars`) is the module with an empty path. A path
|
|
16
|
+
* already read without its module (`pathInContext`) is given no module.
|
|
13
17
|
*/
|
|
14
18
|
export declare function moduleSplit(file: string, modules: readonly string[]): ModuleSplit;
|
|
15
19
|
//# sourceMappingURL=module-split.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-split.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-split.ts"],"names":[],"mappings":"AAGA,mHAAmH;AACnH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"module-split.d.ts","sourceRoot":"","sources":["../../src/model-modules/module-split.ts"],"names":[],"mappings":"AAGA,mHAAmH;AACnH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAQjF"}
|
|
@@ -1,21 +1,38 @@
|
|
|
1
1
|
import { isRoleFolder } from './is-role-folder.js';
|
|
2
|
-
import { MODULE_LAYERS } from './module-layers.js';
|
|
2
|
+
import { EARLIER_MODULE_LAYERS, MODULE_LAYERS, MODULE_TEST_FOLDERS } from './module-layers.js';
|
|
3
3
|
/**
|
|
4
4
|
* Reads the module of a path relative to its context, among the modules of the model the config
|
|
5
|
-
* declares (`declaredModules`): `domain/
|
|
6
|
-
* `domain/aggregates/calendar.aggregate.ts` of the module `calendars
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* declares (`declaredModules`): `calendars/domain/aggregates/calendar.aggregate.ts` is
|
|
6
|
+
* `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
|
+
* The layout of 0.86 and 0.87, `domain/calendars/aggregates/...`, is read too, and said so (`earlier`). A
|
|
9
|
+
* folder the config does not declare is no module: `tree/closed` reports it, and no tool reads it
|
|
10
|
+
* as one. The folder of the module itself (`calendars`) is the module with an empty path. A path
|
|
11
|
+
* already read without its module (`pathInContext`) is given no module.
|
|
10
12
|
*/
|
|
11
13
|
export function moduleSplit(file, modules) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const parts = file.split('/');
|
|
15
|
+
return (inFolderOfModule(parts, modules) ??
|
|
16
|
+
inTestFolder(parts, modules) ??
|
|
17
|
+
inEarlierPlace(parts, modules) ?? { module: undefined, path: file });
|
|
18
|
+
}
|
|
19
|
+
/** `<module>/<layer>/...`, or the folder of the module itself. */
|
|
20
|
+
function inFolderOfModule([first = '', second, ...rest], modules) {
|
|
21
|
+
if (!modules.includes(first) || (second !== undefined && !MODULE_LAYERS.includes(second))) {
|
|
22
|
+
return undefined;
|
|
18
23
|
}
|
|
19
|
-
return { module, path: [
|
|
24
|
+
return { module: first, path: second === undefined ? '' : [second, ...rest].join('/') };
|
|
25
|
+
}
|
|
26
|
+
/** `test/<unit|integration>/<module>/...`. */
|
|
27
|
+
function inTestFolder([first, second = '', module = '', ...below], modules) {
|
|
28
|
+
return first === 'test' && MODULE_TEST_FOLDERS.includes(second) && modules.includes(module)
|
|
29
|
+
? { module, path: ['test', second, ...below].join('/') }
|
|
30
|
+
: undefined;
|
|
31
|
+
}
|
|
32
|
+
/** `<domain|application>/<module>/...`, as 0.86 and 0.87 laid modules out. */
|
|
33
|
+
function inEarlierPlace([first = '', second = '', ...rest], modules) {
|
|
34
|
+
return EARLIER_MODULE_LAYERS.includes(first) && !isRoleFolder(first, second) && modules.includes(second)
|
|
35
|
+
? { module: second, path: [first, ...rest].join('/'), earlier: true }
|
|
36
|
+
: undefined;
|
|
20
37
|
}
|
|
21
38
|
//# 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,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"module-split.js","sourceRoot":"","sources":["../../src/model-modules/module-split.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAU5F;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,OAA0B;IAClE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9B,OAAO,CACL,gBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC;QAChC,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC;QAC5B,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CACpE,CAAC;AACJ,CAAC;AAED,kEAAkE;AAClE,SAAS,gBAAgB,CACvB,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAoB,EAChD,OAA0B;IAE1B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,CAA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ules/role-directories-of.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"role-directories-of.d.ts","sourceRoot":"","sources":["../../src/model-modules/role-directories-of.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C,0HAA0H;AAC1H,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAQ9F"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { filesUnder } from '../generate/files-under.js';
|
|
1
2
|
import { roleFoldersOf } from './role-folders-of.js';
|
|
2
3
|
/** The folders directly inside the folder of a role, such as the use cases of `application/commands`, in every module. */
|
|
3
4
|
export function roleDirectoriesOf(ws, tree, folder) {
|
|
4
|
-
return roleFoldersOf(ws, tree, folder).flatMap((placed) => ws
|
|
5
|
+
return roleFoldersOf(ws, tree, folder).flatMap((placed) => ws
|
|
6
|
+
.directories(placed)
|
|
7
|
+
.map((name) => ({ name, path: `${placed}/${name}` }))
|
|
8
|
+
// A folder whose files a move takes away this very run is gone, though still on disk.
|
|
9
|
+
.filter(({ path }) => filesUnder(ws, path).length > 0));
|
|
5
10
|
}
|
|
6
11
|
//# sourceMappingURL=role-directories-of.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"role-directories-of.js","sourceRoot":"","sources":["../../src/model-modules/role-directories-of.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"role-directories-of.js","sourceRoot":"","sources":["../../src/model-modules/role-directories-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAIrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,0HAA0H;AAC1H,MAAM,UAAU,iBAAiB,CAAC,EAAa,EAAE,IAAiB,EAAE,MAAc;IAChF,OAAO,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CACxD,EAAE;SACC,WAAW,CAAC,MAAM,CAAC;SACnB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,IAAI,EAAE,EAAE,CAAC,CAAC;QACrD,sFAAsF;SACrF,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CACzD,CAAC;AACJ,CAAC"}
|