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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAA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,CAAC;QAC7B,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;QACzB,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QAClC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC3B,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC;QACxC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC3B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QACnC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;QAC3B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;QACnC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC;KACzC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"move-to-module.d.ts","sourceRoot":"","sources":["../../src/commands/move-to-module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"move-to-module.d.ts","sourceRoot":"","sources":["../../src/commands/move-to-module.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,sHAAsH;AACtH,eAAO,MAAM,mBAAmB,EAAE,OAyCjC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CliError } from '../cli-error.js';
|
|
2
2
|
import { readConfig } from '../config/index.js';
|
|
3
|
+
import { refuseEarlierLayout } from '../generate/refuse-earlier-layout.js';
|
|
3
4
|
import { refreshDocs } from '../generate/refresh-docs.js';
|
|
4
5
|
import { declaredModule } from '../model-modules/index.js';
|
|
5
6
|
import { moveToModule } from '../move-to-module/index.js';
|
|
@@ -15,6 +16,7 @@ export const moveToModuleCommand = (argv, io) => {
|
|
|
15
16
|
const context = toName(contextName).kebab;
|
|
16
17
|
const module = toName(moduleName).kebab;
|
|
17
18
|
assertDeclared(config, context, module);
|
|
19
|
+
refuseEarlierLayout(ws, config, context);
|
|
18
20
|
if (paths.length === 0) {
|
|
19
21
|
throw new CliError('move-to-module needs the paths to move.', `Usage: ddd-ts-kit move-to-module ${context} ${module} <path>..., each relative to the context: domain/aggregates/<name>.aggregate.ts, application/commands/<use-case>.`);
|
|
20
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"move-to-module.js","sourceRoot":"","sources":["../../src/commands/move-to-module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAe,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAoB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,sHAAsH;AACtH,MAAM,CAAC,MAAM,mBAAmB,GAAY,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE;IACvD,MAAM,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACvF,MAAM,CAAC,WAAW,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC;IACvE,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAClD,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;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,EAAE,CAAC,CAAC;IAE5F,MAAM,KAAK,GAAG;QACZ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,OAAO,EAAE,EAAE,CAAC;QACzE,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC;QAC/D,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,EAAE,CAAC;QAC3D,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,EAAE,CAAC;QAC5D,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAChG,CAAC;IAEF,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,uDAAuD,CAAC,CAAC;AACxG,CAAC"}
|
package/dist/config/stack.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export interface Stack {
|
|
|
90
90
|
/**
|
|
91
91
|
* How a domain error is written: `named`, one class per refusal, named after it and extending
|
|
92
92
|
* `DomainRefusal`, built by static factories named after what it is about
|
|
93
|
-
* (`SlotTaken.forCalendar(..)`), its code read from the closed list
|
|
93
|
+
* (`SlotTaken.forCalendar(..)`), its code read from the closed list `<context>.codes.ts` of
|
|
94
94
|
* its context; `factories`, one error class per concept of the model, each refusal built by a
|
|
95
95
|
* static factory named in the words of the business (`AppointmentError.slotTaken(..)`); both
|
|
96
96
|
* are held by the `errors/*` rules. `classes`, one class per error, built with `new`. A config
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ContextFile } from './context-file.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where a file of a context is, relative to it: at the root, unless only the place an earlier
|
|
4
|
+
* version wrote it holds it. `exists` is given a path relative to the context.
|
|
5
|
+
*/
|
|
6
|
+
export declare function contextFileAt(file: ContextFile, context: string, exists: (relative: string) => boolean): string;
|
|
7
|
+
//# sourceMappingURL=context-file-at.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-file-at.d.ts","sourceRoot":"","sources":["../../src/context-files/context-file-at.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,CAI/G"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a file of a context is, relative to it: at the root, unless only the place an earlier
|
|
3
|
+
* version wrote it holds it. `exists` is given a path relative to the context.
|
|
4
|
+
*/
|
|
5
|
+
export function contextFileAt(file, context, exists) {
|
|
6
|
+
const root = file.root(context);
|
|
7
|
+
return !exists(root) && exists(file.earlier(context)) ? file.earlier(context) : root;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=context-file-at.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-file-at.js","sourceRoot":"","sources":["../../src/context-files/context-file-at.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,IAAiB,EAAE,OAAe,EAAE,MAAqC;IACrG,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEhC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACvF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the workspace reads and writes a file of a context named at its root or where 0.86 and 0.87 wrote
|
|
3
|
+
* it, both from the project root: at the root, unless only the earlier place holds it, so that a
|
|
4
|
+
* project that has not moved yet goes on being written where it is. Any other file is as given.
|
|
5
|
+
* `existsAsIs` says whether a file is at this very path, on disk or planned.
|
|
6
|
+
*/
|
|
7
|
+
export declare function contextFilePlacement(contextsDir: string, existsAsIs: (file: string) => boolean): (file: string) => string;
|
|
8
|
+
//# sourceMappingURL=context-file-placement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-file-placement.d.ts","sourceRoot":"","sources":["../../src/context-files/context-file-placement.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GACpC,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAqB1B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CONTEXT_FILES } from './context-file.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where the workspace reads and writes a file of a context named at its root or where 0.86 and 0.87 wrote
|
|
4
|
+
* it, both from the project root: at the root, unless only the earlier place holds it, so that a
|
|
5
|
+
* project that has not moved yet goes on being written where it is. Any other file is as given.
|
|
6
|
+
* `existsAsIs` says whether a file is at this very path, on disk or planned.
|
|
7
|
+
*/
|
|
8
|
+
export function contextFilePlacement(contextsDir, existsAsIs) {
|
|
9
|
+
return (file) => {
|
|
10
|
+
const [context = '', ...rest] = file.startsWith(`${contextsDir}/`)
|
|
11
|
+
? file.slice(contextsDir.length + 1).split('/')
|
|
12
|
+
: [];
|
|
13
|
+
const relative = rest.join('/');
|
|
14
|
+
const named = CONTEXT_FILES.find((candidate) => [candidate.root(context), candidate.earlier(context)].includes(relative));
|
|
15
|
+
if (named === undefined) {
|
|
16
|
+
return file;
|
|
17
|
+
}
|
|
18
|
+
const root = `${contextsDir}/${context}/${named.root(context)}`;
|
|
19
|
+
const earlier = `${contextsDir}/${context}/${named.earlier(context)}`;
|
|
20
|
+
return !existsAsIs(root) && existsAsIs(earlier) ? earlier : root;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=context-file-placement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-file-placement.js","sourceRoot":"","sources":["../../src/context-files/context-file-placement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAAmB,EACnB,UAAqC;IAErC,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,MAAM,CAAC,OAAO,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,WAAW,GAAG,CAAC;YAChE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;YAC/C,CAAC,CAAC,EAAE,CAAC;QAEP,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEhC,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAC7C,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACzE,CAAC;QAEF,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,IAAI,GAAG,GAAG,WAAW,IAAI,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAChE,MAAM,OAAO,GAAG,GAAG,WAAW,IAAI,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAEtE,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A file a context holds once, whatever its modules: at the root of the context, named after it,
|
|
3
|
+
* and, until a later minor version, still read where 0.86 and 0.87 wrote it, in a role folder.
|
|
4
|
+
*/
|
|
5
|
+
export interface ContextFile {
|
|
6
|
+
/** The file at the root of the context, relative to it: `billing.codes.ts`. */
|
|
7
|
+
readonly root: (context: string) => string;
|
|
8
|
+
/** Where 0.86 and 0.87 wrote it, relative to the context: `domain/errors/codes.ts`. */
|
|
9
|
+
readonly earlier: (context: string) => string;
|
|
10
|
+
}
|
|
11
|
+
/** The closed list of the codes of the refusals of a context. */
|
|
12
|
+
export declare const CODES_FILE: ContextFile;
|
|
13
|
+
/** The permission set of a context. */
|
|
14
|
+
export declare const PERMISSIONS_FILE: ContextFile;
|
|
15
|
+
export declare const CONTEXT_FILES: readonly ContextFile[];
|
|
16
|
+
//# sourceMappingURL=context-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-file.d.ts","sourceRoot":"","sources":["../../src/context-files/context-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,+EAA+E;IAC/E,QAAQ,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,uFAAuF;IACvF,QAAQ,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED,iEAAiE;AACjE,eAAO,MAAM,UAAU,EAAE,WAGxB,CAAC;AAEF,uCAAuC;AACvC,eAAO,MAAM,gBAAgB,EAAE,WAG9B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAAmC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The closed list of the codes of the refusals of a context. */
|
|
2
|
+
export const CODES_FILE = {
|
|
3
|
+
root: (context) => `${context}.codes.ts`,
|
|
4
|
+
earlier: () => 'domain/errors/codes.ts',
|
|
5
|
+
};
|
|
6
|
+
/** The permission set of a context. */
|
|
7
|
+
export const PERMISSIONS_FILE = {
|
|
8
|
+
root: (context) => `${context}.permissions.ts`,
|
|
9
|
+
earlier: (context) => `application/authorization/${context}.permissions.ts`,
|
|
10
|
+
};
|
|
11
|
+
export const CONTEXT_FILES = [CODES_FILE, PERMISSIONS_FILE];
|
|
12
|
+
//# sourceMappingURL=context-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-file.js","sourceRoot":"","sources":["../../src/context-files/context-file.ts"],"names":[],"mappings":"AAWA,iEAAiE;AACjE,MAAM,CAAC,MAAM,UAAU,GAAgB;IACrC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,WAAW;IACxC,OAAO,EAAE,GAAG,EAAE,CAAC,wBAAwB;CACxC,CAAC;AAEF,uCAAuC;AACvC,MAAM,CAAC,MAAM,gBAAgB,GAAgB;IAC3C,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,OAAO,iBAAiB;IAC9C,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,6BAA6B,OAAO,iBAAiB;CAC5E,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAA2B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The path a file of a context at its root is read as, relative to the context, so that every rule
|
|
3
|
+
* keeps the meaning it had in the role folder: `billing.codes.ts` is `domain/errors/codes.ts`.
|
|
4
|
+
* Undefined for any other file.
|
|
5
|
+
*/
|
|
6
|
+
export declare function earlierPlaceOf(context: string, relative: string): string | undefined;
|
|
7
|
+
//# sourceMappingURL=earlier-place-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"earlier-place-of.d.ts","sourceRoot":"","sources":["../../src/context-files/earlier-place-of.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CONTEXT_FILES } from './context-file.js';
|
|
2
|
+
/**
|
|
3
|
+
* The path a file of a context at its root is read as, relative to the context, so that every rule
|
|
4
|
+
* keeps the meaning it had in the role folder: `billing.codes.ts` is `domain/errors/codes.ts`.
|
|
5
|
+
* Undefined for any other file.
|
|
6
|
+
*/
|
|
7
|
+
export function earlierPlaceOf(context, relative) {
|
|
8
|
+
return CONTEXT_FILES.find((file) => file.root(context) === relative)?.earlier(context);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=earlier-place-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"earlier-place-of.js","sourceRoot":"","sources":["../../src/context-files/earlier-place-of.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,OAAe,EAAE,QAAgB;IAC9D,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACzF,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CODES_FILE, CONTEXT_FILES, PERMISSIONS_FILE } from './context-file.js';
|
|
2
|
+
export { contextFileAt } from './context-file-at.js';
|
|
3
|
+
export { contextFilePlacement } from './context-file-placement.js';
|
|
4
|
+
export { earlierPlaceOf } from './earlier-place-of.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context-files/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CODES_FILE, CONTEXT_FILES, PERMISSIONS_FILE } from './context-file.js';
|
|
2
|
+
export { contextFileAt } from './context-file-at.js';
|
|
3
|
+
export { contextFilePlacement } from './context-file-placement.js';
|
|
4
|
+
export { earlierPlaceOf } from './earlier-place-of.js';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context-files/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import { type FileMove } from '../file-moves/index.js';
|
|
3
|
+
import type { Workspace } from '../workspace/index.js';
|
|
4
|
+
/** What bringing the contexts to the layout of this version changed, and what is left to a person. */
|
|
5
|
+
export interface ContextLayout {
|
|
6
|
+
readonly moved: readonly FileMove[];
|
|
7
|
+
readonly rewritten: readonly string[];
|
|
8
|
+
readonly manual: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Brings the contexts named, or every context of the config, to the layout of this version: the
|
|
12
|
+
* code list and the permission set that 0.86 and 0.87 wrote in a role folder move to the root of their
|
|
13
|
+
* context, each module of the model moves to its folder with its adapters, routes and specs
|
|
14
|
+
* (`moduleMoves`), every import of them follows, and what derives from the tree is written again: the
|
|
15
|
+
* import graph rules, the generated declarations, and the code types knip is told of, named where
|
|
16
|
+
* they are. A context that holds both places is left to a person, who keeps the one at the root.
|
|
17
|
+
*/
|
|
18
|
+
export declare function contextLayout(ws: Workspace, config: Config, asked: readonly string[]): ContextLayout;
|
|
19
|
+
//# sourceMappingURL=context-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-layout.d.ts","sourceRoot":"","sources":["../../src/context-layout/context-layout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,QAAQ,EAAa,MAAM,eAAe,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQ9C,sGAAsG;AACtG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,aAAa,CAyBpG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { CONTEXT_FILES } from '../context-files/index.js';
|
|
2
|
+
import { moveFiles } from '../file-moves/index.js';
|
|
3
|
+
import { refreshDocs } from '../generate/refresh-docs.js';
|
|
4
|
+
import { ignoreCodeTypesWhereTheyAre } from '../knip/index.js';
|
|
5
|
+
import { moduleMoves } from './module-moves.js';
|
|
6
|
+
const KNIP_BY_HAND = 'knip.json is not plain JSON: tell knip that the code types are a contract where they are now, under "ignoreIssues": `"src/contexts/*/*.codes.ts": ["types"]`.';
|
|
7
|
+
/**
|
|
8
|
+
* Brings the contexts named, or every context of the config, to the layout of this version: the
|
|
9
|
+
* code list and the permission set that 0.86 and 0.87 wrote in a role folder move to the root of their
|
|
10
|
+
* context, each module of the model moves to its folder with its adapters, routes and specs
|
|
11
|
+
* (`moduleMoves`), every import of them follows, and what derives from the tree is written again: the
|
|
12
|
+
* import graph rules, the generated declarations, and the code types knip is told of, named where
|
|
13
|
+
* they are. A context that holds both places is left to a person, who keeps the one at the root.
|
|
14
|
+
*/
|
|
15
|
+
export function contextLayout(ws, config, asked) {
|
|
16
|
+
const contexts = (asked.length > 0 ? asked : Object.keys(config.contexts)).filter((context) => ws.exists(`${config.contextsDir}/${context}`));
|
|
17
|
+
const toTheRoot = contextFileMoves(ws, config, contexts);
|
|
18
|
+
const inModules = contexts.map((context) => moduleMoves(ws, config, context));
|
|
19
|
+
const moved = [...toTheRoot.moves, ...inModules.flatMap((placed) => placed.moves)];
|
|
20
|
+
const { rewritten } = moveFiles(ws, config, moved);
|
|
21
|
+
// What derives from the tree follows the moved files: the import graph rules and the declarations.
|
|
22
|
+
if (moved.length > 0) {
|
|
23
|
+
refreshDocs(ws, 'move');
|
|
24
|
+
}
|
|
25
|
+
// knip is told of the code lists where they are, also when a person moved them.
|
|
26
|
+
const knip = ignoreCodeTypesWhereTheyAre(ws, config);
|
|
27
|
+
const unplaced = inModules.flatMap((placed) => placed.unplaced).map(unplacedLine);
|
|
28
|
+
const taken = inModules.flatMap((placed) => placed.taken).map(takenLine);
|
|
29
|
+
return {
|
|
30
|
+
moved,
|
|
31
|
+
rewritten,
|
|
32
|
+
manual: [...toTheRoot.manual, ...taken, ...unplaced, ...(knip === 'unreadable' ? [KNIP_BY_HAND] : [])],
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** The code lists and permission sets of the contexts that move to their root, and the contexts that hold both places. */
|
|
36
|
+
function contextFileMoves(ws, config, contexts) {
|
|
37
|
+
const found = contexts
|
|
38
|
+
.flatMap((context) => CONTEXT_FILES.map((file) => {
|
|
39
|
+
const directory = `${config.contextsDir}/${context}`;
|
|
40
|
+
return { from: `${directory}/${file.earlier(context)}`, to: `${directory}/${file.root(context)}` };
|
|
41
|
+
}))
|
|
42
|
+
.filter((move) => ws.exists(move.from));
|
|
43
|
+
const moves = found.filter((move) => !ws.exists(move.to));
|
|
44
|
+
const manual = found
|
|
45
|
+
.filter((move) => !moves.includes(move))
|
|
46
|
+
.map((move) => `${move.from} and ${move.to} both exist: keep ${move.to}, move into it what the other holds that it lacks, then delete ${move.from}.`);
|
|
47
|
+
return { moves, manual };
|
|
48
|
+
}
|
|
49
|
+
function takenLine({ from, to }) {
|
|
50
|
+
return `${from} and ${to} both exist: nothing was overwritten. Keep the file of the module, move into it what the other holds that it lacks, delete the other, and run the command again.`;
|
|
51
|
+
}
|
|
52
|
+
function unplacedLine(file) {
|
|
53
|
+
return `${file} names no module, or two, by what it imports: move it with \`ddd-ts-kit move-to-module <context> <module> <path>\`, or leave it at the level of the context if every module uses it.`;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=context-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-layout.js","sourceRoot":"","sources":["../../src/context-layout/context-layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAiB,SAAS,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,YAAY,GAChB,+JAA+J,CAAC;AASlK;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,EAAa,EAAE,MAAc,EAAE,KAAwB;IACnF,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAC5F,EAAE,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,EAAE,CAAC,CAC9C,CAAC;IAEF,MAAM,SAAS,GAAG,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IACzD,MAAM,SAAS,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAC9E,MAAM,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CA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E,EAAE,GAAG,SAAS,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;IACrG,CAAC,CAAC,CACH;SACA,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1C,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1D,MAAM,MAAM,GAAG,KAAK;SACjB,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACvC,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,GAAG,IAAI,CAAC,IAAI,QAAQ,IAAI,CAAC,EAAE,qBAAqB,IAAI,CAAC,EAAE,kEAAkE,IAAI,CAAC,IAAI,GAAG,CACxI,CAAC;IAEJ,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,EAAY;IACvC,OAAO,GAAG,IAAI,QAAQ,EAAE,kKAAkK,CAAC;AAC7L,CAAC;AAED,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,GAAG,IAAI,sLAAsL,CAAC;AACvM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/context-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/context-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Config } from '../config/index.js';
|
|
2
|
+
import type { FileMove } from '../file-moves/index.js';
|
|
3
|
+
import type { Workspace } from '../workspace/index.js';
|
|
4
|
+
/** Where the files of the modules of a context go, and the ones no module could be told for. */
|
|
5
|
+
export interface ModuleMoves {
|
|
6
|
+
readonly moves: readonly FileMove[];
|
|
7
|
+
/** Files of a layer or specs left at the level of the context: no module, or more than one, is theirs. */
|
|
8
|
+
readonly unplaced: readonly string[];
|
|
9
|
+
/** Moves not made because a file is at their target already: nothing is overwritten. */
|
|
10
|
+
readonly taken: readonly FileMove[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The moves that give each module of a context its folder: what 0.86 and 0.87 put under `domain/<module>/`
|
|
14
|
+
* and `application/<module>/` goes to `<module>/domain/` and `<module>/application/`; an adapter,
|
|
15
|
+
* a route or a spec left at the level of the context goes to the module of what it imports (or,
|
|
16
|
+
* for a spec, of the file it is named after), or of what imports it when it imports nothing of a
|
|
17
|
+
* module. The files the context keeps at its own level stay, and so does a file whose imports
|
|
18
|
+
* name two modules, or none: it is listed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function moduleMoves(ws: Workspace, config: Config, context: string): ModuleMoves;
|
|
21
|
+
//# sourceMappingURL=module-moves.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-moves.d.ts","sourceRoot":"","sources":["../../src/context-layout/module-moves.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAU9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAK9C,gGAAgG;AAChG,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,0GAA0G;IAC1G,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,wFAAwF;IACxF,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CACrC;AAQD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,CAmCvF"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { posix } from 'node:path';
|
|
2
|
+
import { aliasRoots } from '../alias/index.js';
|
|
3
|
+
import { isDeclarationsFile } from '../declared/index.js';
|
|
4
|
+
import { filesUnder } from '../generate/files-under.js';
|
|
5
|
+
import { declaredModules, intoModule, isContextLevel, MODULE_LAYERS, MODULE_TEST_FOLDERS, moduleSplit, } from '../model-modules/index.js';
|
|
6
|
+
const SPECIFIER = /(?:\bfrom\s*|\bimport\s*\(\s*|\bimport\s+)(['"])([^'"\n]+)\1/g;
|
|
7
|
+
const EXTENSION = /\.(?:ts|js)$/;
|
|
8
|
+
/**
|
|
9
|
+
* The moves that give each module of a context its folder: what 0.86 and 0.87 put under `domain/<module>/`
|
|
10
|
+
* and `application/<module>/` goes to `<module>/domain/` and `<module>/application/`; an adapter,
|
|
11
|
+
* a route or a spec left at the level of the context goes to the module of what it imports (or,
|
|
12
|
+
* for a spec, of the file it is named after), or of what imports it when it imports nothing of a
|
|
13
|
+
* module. The files the context keeps at its own level stay, and so does a file whose imports
|
|
14
|
+
* name two modules, or none: it is listed.
|
|
15
|
+
*/
|
|
16
|
+
export function moduleMoves(ws, config, context) {
|
|
17
|
+
const directory = `${config.contextsDir}/${context}`;
|
|
18
|
+
const modules = declaredModules(config, context);
|
|
19
|
+
if (modules.length === 0) {
|
|
20
|
+
return { moves: [], unplaced: [], taken: [] };
|
|
21
|
+
}
|
|
22
|
+
const files = filesUnder(ws, directory);
|
|
23
|
+
const earlier = files.flatMap((file) => earlierMove(file, modules));
|
|
24
|
+
const known = new Map(files.map((file) => [file, moduleSplit(file, modules).module]));
|
|
25
|
+
const open = files
|
|
26
|
+
.filter((file) => isOpen(context, file, modules))
|
|
27
|
+
.map((file) => ({ file, module: undefined }));
|
|
28
|
+
const imports = new Map(open.map(({ file }) => [file, importsOf(ws, { directory, file, roots: aliasRoots(config) })]));
|
|
29
|
+
settle(open, { known, imports, modules });
|
|
30
|
+
const placed = open.flatMap(({ file, module }) => module === undefined ? [] : [{ from: file, to: intoModule(module, file) }]);
|
|
31
|
+
const at = (file) => `${directory}/${file}`;
|
|
32
|
+
const all = [...earlier, ...placed].map(({ from, to }) => ({ from: at(from), to: at(to) }));
|
|
33
|
+
return {
|
|
34
|
+
moves: all.filter((move) => !ws.exists(move.to)),
|
|
35
|
+
unplaced: open.filter(({ module }) => module === undefined).map(({ file }) => at(file)),
|
|
36
|
+
taken: all.filter((move) => ws.exists(move.to)),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/** A file of a module where 0.86 and 0.87 put it, with its place of today. */
|
|
40
|
+
function earlierMove(file, modules) {
|
|
41
|
+
const { module, path, earlier } = moduleSplit(file, modules);
|
|
42
|
+
return earlier === true ? [{ from: file, to: intoModule(module, path) }] : [];
|
|
43
|
+
}
|
|
44
|
+
/** A file of a layer, or a spec directly in a test folder, left at the level of the context, that a module may own. */
|
|
45
|
+
function isOpen(context, file, modules) {
|
|
46
|
+
return ((isLayerFile(file, modules) || isSpecInPlace(file, modules)) &&
|
|
47
|
+
!isContextLevel(context, file) &&
|
|
48
|
+
!isDeclarationsFile(context, file, modules));
|
|
49
|
+
}
|
|
50
|
+
function isLayerFile(file, modules) {
|
|
51
|
+
const [layer = '', , ...rest] = file.split('/');
|
|
52
|
+
return MODULE_LAYERS.includes(layer) && rest.length > 0 && moduleSplit(file, modules).module === undefined;
|
|
53
|
+
}
|
|
54
|
+
/** A spec of `test/unit/` or `test/integration/`, at any depth, in no module yet. */
|
|
55
|
+
function isSpecInPlace(file, modules) {
|
|
56
|
+
const [top, folder = '', ...rest] = file.split('/');
|
|
57
|
+
return (top === 'test' &&
|
|
58
|
+
MODULE_TEST_FOLDERS.includes(folder) &&
|
|
59
|
+
rest.length > 0 &&
|
|
60
|
+
file.endsWith('.spec.ts') &&
|
|
61
|
+
moduleSplit(file, modules).module === undefined);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Tells the module of each open file, until nothing changes: a spec named after a file of one
|
|
65
|
+
* module is of it; a file that imports files of exactly one module is of it; a file that imports
|
|
66
|
+
* none is of the one module of the open files that import it. A file whose imports name two
|
|
67
|
+
* modules, once every file is told, is of none: it is listed, whatever order the files came in.
|
|
68
|
+
*/
|
|
69
|
+
function settle(open, reading) {
|
|
70
|
+
const { known, modules } = reading;
|
|
71
|
+
const named = new Set();
|
|
72
|
+
for (const spec of open.filter(({ file }) => file.startsWith('test/'))) {
|
|
73
|
+
spec.module = namedAfter(spec.file, known, modules);
|
|
74
|
+
if (spec.module !== undefined) {
|
|
75
|
+
named.add(spec);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const conflicting = new Set();
|
|
79
|
+
do {
|
|
80
|
+
tellByImports(open, reading, conflicting);
|
|
81
|
+
} while (withdrawTwoModules(open, reading, { named, conflicting }));
|
|
82
|
+
}
|
|
83
|
+
/** Gives each open file the module its imports, or else its importers, name, until nothing changes. */
|
|
84
|
+
function tellByImports(open, reading, conflicting) {
|
|
85
|
+
let changed = true;
|
|
86
|
+
while (changed) {
|
|
87
|
+
changed = false;
|
|
88
|
+
for (const placed of open.filter((candidate) => candidate.module === undefined && !conflicting.has(candidate))) {
|
|
89
|
+
const reached = modulesReached(placed, open, reading);
|
|
90
|
+
const importers = open.filter(({ file }) => (reading.imports.get(file) ?? []).includes(placed.file));
|
|
91
|
+
const told = reached.length > 0 ? only(reached) : only(importers.map(({ module }) => module));
|
|
92
|
+
if (told !== undefined) {
|
|
93
|
+
placed.module = told;
|
|
94
|
+
changed = true;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/** Takes its module back from every file whose imports name two modules; answers whether one was. */
|
|
100
|
+
function withdrawTwoModules(open, reading, { named, conflicting }) {
|
|
101
|
+
const twice = open.filter((placed) => placed.module !== undefined && !named.has(placed) && new Set(modulesReached(placed, open, reading)).size > 1);
|
|
102
|
+
for (const placed of twice) {
|
|
103
|
+
placed.module = undefined;
|
|
104
|
+
conflicting.add(placed);
|
|
105
|
+
}
|
|
106
|
+
return twice.length > 0;
|
|
107
|
+
}
|
|
108
|
+
/** The modules of the files a file imports, those of the open files told so far included. */
|
|
109
|
+
function modulesReached(placed, open, { known, imports }) {
|
|
110
|
+
return (imports.get(placed.file) ?? []).flatMap((file) => {
|
|
111
|
+
const module = known.get(file) ?? open.find((candidate) => candidate.file === file)?.module;
|
|
112
|
+
return module === undefined ? [] : [module];
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/** The one module of a list, undefined when it names none or two. */
|
|
116
|
+
function only(modules) {
|
|
117
|
+
const named = [...new Set(modules.filter((module) => module !== undefined))];
|
|
118
|
+
return named.length === 1 ? named[0] : undefined;
|
|
119
|
+
}
|
|
120
|
+
/** The module of the production file a spec is named after, the longest name winning. */
|
|
121
|
+
function namedAfter(spec, known, modules) {
|
|
122
|
+
const stem = posix.basename(spec).replace(/\.spec\.ts$/, '');
|
|
123
|
+
const matches = [...known].flatMap(([file, module]) => {
|
|
124
|
+
const name = posix.basename(file).replace(EXTENSION, '');
|
|
125
|
+
const own = module !== undefined && modules.includes(module) && !file.startsWith('test/');
|
|
126
|
+
return own && (stem === name || stem.startsWith(`${name}.`)) ? [{ module, length: name.length }] : [];
|
|
127
|
+
});
|
|
128
|
+
return matches.sort((left, right) => right.length - left.length)[0]?.module;
|
|
129
|
+
}
|
|
130
|
+
/** The files of the context a file imports, relative to the context and with their extension, by alias or relative path. */
|
|
131
|
+
function importsOf(ws, { directory, file, roots }) {
|
|
132
|
+
const text = ws.read(`${directory}/${file}`) ?? '';
|
|
133
|
+
return [...text.matchAll(SPECIFIER)].flatMap(([, , specifier = '']) => {
|
|
134
|
+
const bare = specifier.replace(EXTENSION, '');
|
|
135
|
+
const root = roots.find(({ prefix }) => bare.startsWith(prefix));
|
|
136
|
+
const target = bare.startsWith('.')
|
|
137
|
+
? posix.join(posix.dirname(`${directory}/${file}`), bare)
|
|
138
|
+
: root === undefined
|
|
139
|
+
? undefined
|
|
140
|
+
: `${root.directory}/${bare.slice(root.prefix.length)}`;
|
|
141
|
+
return target !== undefined && target.startsWith(`${directory}/`)
|
|
142
|
+
? [`${target.slice(directory.length + 1)}.ts`]
|
|
143
|
+
: [];
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=module-moves.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-moves.js","sourceRoot":"","sources":["../../src/context-layout/module-moves.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAkB,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EACL,eAAe,EACf,UAAU,EACV,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAG1B,MAAM,SAAS,GAAG,+DAA+D,CAAC;AAClF,MAAM,SAAS,GAAG,cAAc,CAAC;AAiBjC;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CAAC,EAAa,EAAE,MAAc,EAAE,OAAe;IACxE,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,EAAE,CAAC;IACrD,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAA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AC,SAAS;gBACX,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAE5D,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC;YAC/D,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC;YAC9C,CAAC,CAAC,EAAE,CAAC;IACT,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -13,7 +13,7 @@ export function migrateContext(migration, context) {
|
|
|
13
13
|
writeGroups(migration, plan);
|
|
14
14
|
for (const controller of plan.controllers) {
|
|
15
15
|
writeController(migration, plan, controller);
|
|
16
|
-
moveSpec(migration,
|
|
16
|
+
moveSpec(migration, controller);
|
|
17
17
|
}
|
|
18
18
|
moveSchemas(migration, plan);
|
|
19
19
|
return true;
|
|
@@ -31,9 +31,9 @@ function writeGroups({ draft }, { http, groups }) {
|
|
|
31
31
|
}
|
|
32
32
|
function writeController(migration, plan, controller) {
|
|
33
33
|
const { draft, config, renamed, moved } = migration;
|
|
34
|
-
const { route, types, body, resource, isPublic } = controller;
|
|
34
|
+
const { route, types, body, resource, isPublic, http } = controller;
|
|
35
35
|
const group = isPublic ? undefined : plan.groups.get(resource);
|
|
36
|
-
const target = `${
|
|
36
|
+
const target = `${http}/${resource}/${route.kebab}/${route.kebab}.controller.ts`;
|
|
37
37
|
const groupImport = group === undefined
|
|
38
38
|
? ''
|
|
39
39
|
: `import { ${group.className} } from '${specifierOf(config, `${plan.http}/${group.kebab}.routes.ts`)}';`;
|
|
@@ -42,23 +42,28 @@ function writeController(migration, plan, controller) {
|
|
|
42
42
|
renamed.set(route.file, target);
|
|
43
43
|
moved.push(`${route.kebab}.route.ts -> ${resource}/${route.kebab}/${route.kebab}.controller.ts`);
|
|
44
44
|
}
|
|
45
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* A schema file named after a route of its folder follows it, under the role its name ends with;
|
|
47
|
+
* any other is shared, under the name it had, in the shared folder of the context.
|
|
48
|
+
*/
|
|
46
49
|
function moveSchemas({ ws, draft, renamed }, plan) {
|
|
47
50
|
const byLength = [...plan.controllers].sort((left, right) => right.route.kebab.length - left.route.kebab.length);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
const folders = [...new Set([plan.http, ...plan.controllers.map(({ http }) => http)])];
|
|
52
|
+
for (const http of folders) {
|
|
53
|
+
for (const name of ws.list(http).filter((file) => file.endsWith('.dto.ts'))) {
|
|
54
|
+
const stem = name.replace(/\.dto\.ts$/, '');
|
|
55
|
+
const owner = byLength.find(({ route, http: own }) => own === http && ROLES.includes(stem.slice(route.kebab.length + 1)) && stem.startsWith(`${route.kebab}-`));
|
|
56
|
+
const target = owner === undefined
|
|
57
|
+
? `${plan.http}/shared/${name}`
|
|
58
|
+
: `${http}/${owner.resource}/${owner.route.kebab}/${owner.route.kebab}.${stem.slice(owner.route.kebab.length + 1)}.ts`;
|
|
59
|
+
draft.write(target, ws.read(`${http}/${name}`) ?? '');
|
|
60
|
+
draft.remove(`${http}/${name}`);
|
|
61
|
+
renamed.set(`${http}/${name}`, target);
|
|
62
|
+
}
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
/** The spec of the route becomes the spec of the controller alone: its guards have their own. */
|
|
60
|
-
function moveSpec({ ws, draft
|
|
61
|
-
const unit = `${config.contextsDir}/${plan.context}/test/unit`;
|
|
66
|
+
function moveSpec({ ws, draft }, { route, unit }) {
|
|
62
67
|
const source = ws.read(`${unit}/${route.kebab}.route.spec.ts`);
|
|
63
68
|
const factory = `${toName(route.kebab).camel}Route`;
|
|
64
69
|
if (source === undefined) {
|