ddd-ts-kit 0.112.0 → 0.113.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 +42 -0
- package/README.fr.md +18 -1
- package/README.md +16 -0
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +2 -0
- package/dist/check/catalogue/architecture-rules.js.map +1 -1
- package/dist/check/commands/check-command.js +4 -3
- package/dist/check/commands/check-command.js.map +1 -1
- package/dist/check/explain/persistence-docs.d.ts.map +1 -1
- package/dist/check/explain/persistence-docs.js +17 -0
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +2 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/read-model-list-files.d.ts +7 -0
- package/dist/check/fixtures/read-model-list-files.d.ts.map +1 -0
- package/dist/check/fixtures/read-model-list-files.js +18 -0
- package/dist/check/fixtures/read-model-list-files.js.map +1 -0
- package/dist/check/fixtures/read-model-listed-fixtures.d.ts +3 -0
- package/dist/check/fixtures/read-model-listed-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/read-model-listed-fixtures.js +292 -0
- package/dist/check/fixtures/read-model-listed-fixtures.js.map +1 -0
- package/dist/check/fixtures/tenancy-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-fixtures.js +2 -1
- package/dist/check/fixtures/tenancy-fixtures.js.map +1 -1
- package/dist/check/fixtures/tenancy-prisma-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-prisma-fixtures.js +2 -0
- package/dist/check/fixtures/tenancy-prisma-fixtures.js.map +1 -1
- package/dist/check/fixtures/tenancy-typeorm-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/tenancy-typeorm-fixtures.js +2 -0
- package/dist/check/fixtures/tenancy-typeorm-fixtures.js.map +1 -1
- package/dist/check/model/finding.d.ts +2 -1
- package/dist/check/model/finding.d.ts.map +1 -1
- package/dist/check/model/violation.d.ts +4 -1
- package/dist/check/model/violation.d.ts.map +1 -1
- package/dist/check/read-models/list-findings.d.ts +22 -0
- package/dist/check/read-models/list-findings.d.ts.map +1 -0
- package/dist/check/read-models/list-findings.js +84 -0
- package/dist/check/read-models/list-findings.js.map +1 -0
- package/dist/check/rules/declarations-port-adapter-wired.js +9 -2
- package/dist/check/rules/declarations-port-adapter-wired.js.map +1 -1
- package/dist/check/rules/persistence-read-model-listed.d.ts +3 -0
- package/dist/check/rules/persistence-read-model-listed.d.ts.map +1 -0
- package/dist/check/rules/persistence-read-model-listed.js +93 -0
- package/dist/check/rules/persistence-read-model-listed.js.map +1 -0
- package/dist/check/scan/lexer.d.ts +4 -0
- package/dist/check/scan/lexer.d.ts.map +1 -1
- package/dist/check/scan/lexer.js +11 -0
- package/dist/check/scan/lexer.js.map +1 -1
- package/dist/check/scan/scan.d.ts +6 -0
- package/dist/check/scan/scan.d.ts.map +1 -1
- package/dist/check/scan/scan.js +1 -0
- package/dist/check/scan/scan.js.map +1 -1
- package/dist/check/structure/read-structure.js +35 -13
- package/dist/check/structure/read-structure.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +3 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/json-report.js +4 -4
- package/dist/commands/json-report.js.map +1 -1
- package/dist/commands/print-report.js +3 -0
- package/dist/commands/print-report.js.map +1 -1
- package/dist/commands/prisma-client.d.ts +8 -0
- package/dist/commands/prisma-client.d.ts.map +1 -0
- package/dist/commands/prisma-client.js +23 -0
- package/dist/commands/prisma-client.js.map +1 -0
- package/dist/generate/kinds/declare-storage.d.ts.map +1 -1
- package/dist/generate/kinds/declare-storage.js +6 -1
- package/dist/generate/kinds/declare-storage.js.map +1 -1
- package/dist/generate/kinds/declare-table.d.ts +2 -0
- package/dist/generate/kinds/declare-table.d.ts.map +1 -1
- package/dist/generate/kinds/declare-table.js +65 -1
- package/dist/generate/kinds/declare-table.js.map +1 -1
- package/dist/generate/kinds/read-model/list-read-model.d.ts +4 -9
- package/dist/generate/kinds/read-model/list-read-model.d.ts.map +1 -1
- package/dist/generate/kinds/read-model/list-read-model.js +11 -9
- package/dist/generate/kinds/read-model/list-read-model.js.map +1 -1
- package/dist/generate/kinds/read-model-kind.d.ts.map +1 -1
- package/dist/generate/kinds/read-model-kind.js +7 -2
- package/dist/generate/kinds/read-model-kind.js.map +1 -1
- package/dist/generate/kinds/same-name/code-from.d.ts +8 -0
- package/dist/generate/kinds/same-name/code-from.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/code-from.js +34 -0
- package/dist/generate/kinds/same-name/code-from.js.map +1 -0
- package/dist/generate/kinds/same-name/context-of-source.d.ts +5 -0
- package/dist/generate/kinds/same-name/context-of-source.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/context-of-source.js +10 -0
- package/dist/generate/kinds/same-name/context-of-source.js.map +1 -0
- package/dist/generate/kinds/same-name/entities-list.d.ts +6 -0
- package/dist/generate/kinds/same-name/entities-list.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/entities-list.js +25 -0
- package/dist/generate/kinds/same-name/entities-list.js.map +1 -0
- package/dist/generate/kinds/same-name/exports-an-alias.d.ts +12 -0
- package/dist/generate/kinds/same-name/exports-an-alias.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/exports-an-alias.js +150 -0
- package/dist/generate/kinds/same-name/exports-an-alias.js.map +1 -0
- package/dist/generate/kinds/same-name/free-name.d.ts +10 -0
- package/dist/generate/kinds/same-name/free-name.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/free-name.js +20 -0
- package/dist/generate/kinds/same-name/free-name.js.map +1 -0
- package/dist/generate/kinds/same-name/hidden-symbols.d.ts +8 -0
- package/dist/generate/kinds/same-name/hidden-symbols.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/hidden-symbols.js +18 -0
- package/dist/generate/kinds/same-name/hidden-symbols.js.map +1 -0
- package/dist/generate/kinds/same-name/imported-twice-notes.d.ts +10 -0
- package/dist/generate/kinds/same-name/imported-twice-notes.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/imported-twice-notes.js +24 -0
- package/dist/generate/kinds/same-name/imported-twice-notes.js.map +1 -0
- package/dist/generate/kinds/same-name/index-exports.d.ts +11 -0
- package/dist/generate/kinds/same-name/index-exports.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/index-exports.js +27 -0
- package/dist/generate/kinds/same-name/index-exports.js.map +1 -0
- package/dist/generate/kinds/same-name/index-picture.d.ts +29 -0
- package/dist/generate/kinds/same-name/index-picture.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/index-picture.js +63 -0
- package/dist/generate/kinds/same-name/index-picture.js.map +1 -0
- package/dist/generate/kinds/same-name/index-reading.d.ts +83 -0
- package/dist/generate/kinds/same-name/index-reading.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/index-reading.js +105 -0
- package/dist/generate/kinds/same-name/index-reading.js.map +1 -0
- package/dist/generate/kinds/same-name/keep-the-picture.d.ts +17 -0
- package/dist/generate/kinds/same-name/keep-the-picture.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/keep-the-picture.js +164 -0
- package/dist/generate/kinds/same-name/keep-the-picture.js.map +1 -0
- package/dist/generate/kinds/same-name/lines-to-settle.d.ts +37 -0
- package/dist/generate/kinds/same-name/lines-to-settle.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/lines-to-settle.js +100 -0
- package/dist/generate/kinds/same-name/lines-to-settle.js.map +1 -0
- package/dist/generate/kinds/same-name/linked.d.ts +14 -0
- package/dist/generate/kinds/same-name/linked.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/linked.js +14 -0
- package/dist/generate/kinds/same-name/linked.js.map +1 -0
- package/dist/generate/kinds/same-name/listed-entity.d.ts +25 -0
- package/dist/generate/kinds/same-name/listed-entity.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/listed-entity.js +25 -0
- package/dist/generate/kinds/same-name/listed-entity.js.map +1 -0
- package/dist/generate/kinds/same-name/may-share.d.ts +22 -0
- package/dist/generate/kinds/same-name/may-share.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/may-share.js +35 -0
- package/dist/generate/kinds/same-name/may-share.js.map +1 -0
- package/dist/generate/kinds/same-name/not-settled.d.ts +16 -0
- package/dist/generate/kinds/same-name/not-settled.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/not-settled.js +12 -0
- package/dist/generate/kinds/same-name/not-settled.js.map +1 -0
- package/dist/generate/kinds/same-name/places-of.d.ts +4 -0
- package/dist/generate/kinds/same-name/places-of.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/places-of.js +13 -0
- package/dist/generate/kinds/same-name/places-of.js.map +1 -0
- package/dist/generate/kinds/same-name/project-reader.d.ts +13 -0
- package/dist/generate/kinds/same-name/project-reader.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/project-reader.js +55 -0
- package/dist/generate/kinds/same-name/project-reader.js.map +1 -0
- package/dist/generate/kinds/same-name/read-module.d.ts +44 -0
- package/dist/generate/kinds/same-name/read-module.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/read-module.js +189 -0
- package/dist/generate/kinds/same-name/read-module.js.map +1 -0
- package/dist/generate/kinds/same-name/read-tables-file.d.ts +34 -0
- package/dist/generate/kinds/same-name/read-tables-file.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/read-tables-file.js +116 -0
- package/dist/generate/kinds/same-name/read-tables-file.js.map +1 -0
- package/dist/generate/kinds/same-name/region-of.d.ts +3 -0
- package/dist/generate/kinds/same-name/region-of.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/region-of.js +5 -0
- package/dist/generate/kinds/same-name/region-of.js.map +1 -0
- package/dist/generate/kinds/same-name/settle-same-names.d.ts +30 -0
- package/dist/generate/kinds/same-name/settle-same-names.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/settle-same-names.js +123 -0
- package/dist/generate/kinds/same-name/settle-same-names.js.map +1 -0
- package/dist/generate/kinds/same-name/signature-of.d.ts +4 -0
- package/dist/generate/kinds/same-name/signature-of.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/signature-of.js +5 -0
- package/dist/generate/kinds/same-name/signature-of.js.map +1 -0
- package/dist/generate/kinds/same-name/sources-of.d.ts +35 -0
- package/dist/generate/kinds/same-name/sources-of.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/sources-of.js +57 -0
- package/dist/generate/kinds/same-name/sources-of.js.map +1 -0
- package/dist/generate/kinds/same-name/symbol-of.d.ts +9 -0
- package/dist/generate/kinds/same-name/symbol-of.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/symbol-of.js +8 -0
- package/dist/generate/kinds/same-name/symbol-of.js.map +1 -0
- package/dist/generate/kinds/same-name/tables-constants.d.ts +5 -0
- package/dist/generate/kinds/same-name/tables-constants.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/tables-constants.js +8 -0
- package/dist/generate/kinds/same-name/tables-constants.js.map +1 -0
- package/dist/generate/kinds/same-name/tables-file-of.d.ts +5 -0
- package/dist/generate/kinds/same-name/tables-file-of.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/tables-file-of.js +6 -0
- package/dist/generate/kinds/same-name/tables-file-of.js.map +1 -0
- package/dist/generate/kinds/same-name/tables-files-held.d.ts +9 -0
- package/dist/generate/kinds/same-name/tables-files-held.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/tables-files-held.js +14 -0
- package/dist/generate/kinds/same-name/tables-files-held.js.map +1 -0
- package/dist/generate/kinds/same-name/unread-note.d.ts +22 -0
- package/dist/generate/kinds/same-name/unread-note.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/unread-note.js +76 -0
- package/dist/generate/kinds/same-name/unread-note.js.map +1 -0
- package/dist/generate/kinds/same-name/unseen-shares.d.ts +14 -0
- package/dist/generate/kinds/same-name/unseen-shares.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/unseen-shares.js +23 -0
- package/dist/generate/kinds/same-name/unseen-shares.js.map +1 -0
- package/dist/generate/kinds/same-name/workspace-index.d.ts +6 -0
- package/dist/generate/kinds/same-name/workspace-index.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/workspace-index.js +13 -0
- package/dist/generate/kinds/same-name/workspace-index.js.map +1 -0
- package/dist/generate/kinds/same-name/workspace-sources.d.ts +9 -0
- package/dist/generate/kinds/same-name/workspace-sources.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/workspace-sources.js +10 -0
- package/dist/generate/kinds/same-name/workspace-sources.js.map +1 -0
- package/dist/generate/kinds/same-name/yield-to-the-trunk.d.ts +14 -0
- package/dist/generate/kinds/same-name/yield-to-the-trunk.d.ts.map +1 -0
- package/dist/generate/kinds/same-name/yield-to-the-trunk.js +59 -0
- package/dist/generate/kinds/same-name/yield-to-the-trunk.js.map +1 -0
- package/dist/generator-lock/held-lock-refusal.d.ts.map +1 -1
- package/dist/generator-lock/held-lock-refusal.js +1 -7
- package/dist/generator-lock/held-lock-refusal.js.map +1 -1
- package/dist/generator-lock/holder-text.d.ts +4 -0
- package/dist/generator-lock/holder-text.d.ts.map +1 -0
- package/dist/generator-lock/holder-text.js +10 -0
- package/dist/generator-lock/holder-text.js.map +1 -0
- package/dist/generator-lock/index.d.ts +4 -0
- package/dist/generator-lock/index.d.ts.map +1 -1
- package/dist/generator-lock/index.js +2 -0
- package/dist/generator-lock/index.js.map +1 -1
- package/dist/generator-lock/with-folder-lock.d.ts +27 -0
- package/dist/generator-lock/with-folder-lock.d.ts.map +1 -0
- package/dist/generator-lock/with-folder-lock.js +65 -0
- package/dist/generator-lock/with-folder-lock.js.map +1 -0
- package/dist/generator-lock/with-generator-lock.d.ts +1 -5
- package/dist/generator-lock/with-generator-lock.d.ts.map +1 -1
- package/dist/generator-lock/with-generator-lock.js +11 -58
- package/dist/generator-lock/with-generator-lock.js.map +1 -1
- package/dist/help/tool-notes.d.ts.map +1 -1
- package/dist/help/tool-notes.js +12 -0
- package/dist/help/tool-notes.js.map +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/help/work-notes.d.ts.map +1 -1
- package/dist/help/work-notes.js +6 -3
- package/dist/help/work-notes.js.map +1 -1
- package/dist/init/end-of-the-index.d.ts +9 -0
- package/dist/init/end-of-the-index.d.ts.map +1 -0
- package/dist/init/end-of-the-index.js +13 -0
- package/dist/init/end-of-the-index.js.map +1 -0
- package/dist/init/laid-out.d.ts +3 -0
- package/dist/init/laid-out.d.ts.map +1 -0
- package/dist/init/laid-out.js +7 -0
- package/dist/init/laid-out.js.map +1 -0
- package/dist/init/list-read-models.d.ts +11 -8
- package/dist/init/list-read-models.d.ts.map +1 -1
- package/dist/init/list-read-models.js +55 -55
- package/dist/init/list-read-models.js.map +1 -1
- package/dist/init/manifest/prisma-client-script.js +1 -1
- package/dist/init/manifest/prisma-client-script.js.map +1 -1
- package/dist/init/manifest/versions.js +33 -33
- package/dist/init/rewire-contexts.d.ts.map +1 -1
- package/dist/init/rewire-contexts.js +2 -0
- package/dist/init/rewire-contexts.js.map +1 -1
- package/dist/init/rewire-tables.d.ts.map +1 -1
- package/dist/init/rewire-tables.js +18 -10
- package/dist/init/rewire-tables.js.map +1 -1
- package/dist/init/run-init.d.ts.map +1 -1
- package/dist/init/run-init.js +3 -7
- package/dist/init/run-init.js.map +1 -1
- package/dist/init/settle-index-names.d.ts +11 -0
- package/dist/init/settle-index-names.d.ts.map +1 -0
- package/dist/init/settle-index-names.js +89 -0
- package/dist/init/settle-index-names.js.map +1 -0
- package/dist/merge/accept-in-merge-message.d.ts.map +1 -1
- package/dist/merge/accept-in-merge-message.js +2 -7
- package/dist/merge/accept-in-merge-message.js.map +1 -1
- package/dist/merge/as-settled.d.ts +7 -0
- package/dist/merge/as-settled.d.ts.map +1 -0
- package/dist/merge/as-settled.js +9 -0
- package/dist/merge/as-settled.js.map +1 -0
- package/dist/merge/config-of-the-merge.d.ts +12 -0
- package/dist/merge/config-of-the-merge.d.ts.map +1 -0
- package/dist/merge/config-of-the-merge.js +35 -0
- package/dist/merge/config-of-the-merge.js.map +1 -0
- package/dist/merge/continue-merge.d.ts.map +1 -1
- package/dist/merge/continue-merge.js +32 -1
- package/dist/merge/continue-merge.js.map +1 -1
- package/dist/merge/lines-at-moved-places.d.ts +10 -0
- package/dist/merge/lines-at-moved-places.d.ts.map +1 -0
- package/dist/merge/lines-at-moved-places.js +38 -0
- package/dist/merge/lines-at-moved-places.js.map +1 -0
- package/dist/merge/lost/in-progress-merge.d.ts.map +1 -1
- package/dist/merge/lost/in-progress-merge.js +6 -2
- package/dist/merge/lost/in-progress-merge.js.map +1 -1
- package/dist/merge/lost/line-findings.d.ts +3 -2
- package/dist/merge/lost/line-findings.d.ts.map +1 -1
- package/dist/merge/lost/line-findings.js +5 -4
- package/dist/merge/lost/line-findings.js.map +1 -1
- package/dist/merge/lost/line-key.d.ts +7 -0
- package/dist/merge/lost/line-key.d.ts.map +1 -0
- package/dist/merge/lost/line-key.js +11 -0
- package/dist/merge/lost/line-key.js.map +1 -0
- package/dist/merge/lost/lost-lines.d.ts +1 -1
- package/dist/merge/lost/lost-lines.d.ts.map +1 -1
- package/dist/merge/lost/lost-lines.js +3 -2
- package/dist/merge/lost/lost-lines.js.map +1 -1
- package/dist/merge/lost/merge-of-record.d.ts.map +1 -1
- package/dist/merge/lost/merge-of-record.js +1 -0
- package/dist/merge/lost/merge-of-record.js.map +1 -1
- package/dist/merge/lost/merge-records.d.ts +2 -0
- package/dist/merge/lost/merge-records.d.ts.map +1 -1
- package/dist/merge/lost/merge-records.js +3 -2
- package/dist/merge/lost/merge-records.js.map +1 -1
- package/dist/merge/lost/merge-to-verify.d.ts +2 -0
- package/dist/merge/lost/merge-to-verify.d.ts.map +1 -1
- package/dist/merge/lost/rewritten-in-place.d.ts +5 -2
- package/dist/merge/lost/rewritten-in-place.d.ts.map +1 -1
- package/dist/merge/lost/rewritten-in-place.js +6 -5
- package/dist/merge/lost/rewritten-in-place.js.map +1 -1
- package/dist/merge/lost/verify-merge.d.ts.map +1 -1
- package/dist/merge/lost/verify-merge.js +10 -3
- package/dist/merge/lost/verify-merge.js.map +1 -1
- package/dist/merge/merge-state.d.ts +2 -0
- package/dist/merge/merge-state.d.ts.map +1 -1
- package/dist/merge/merge-state.js +3 -2
- package/dist/merge/merge-state.js.map +1 -1
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +3 -1
- package/dist/merge/merge-trunk.js.map +1 -1
- package/dist/merge/merged-tree-workspace.d.ts +19 -0
- package/dist/merge/merged-tree-workspace.d.ts.map +1 -0
- package/dist/merge/merged-tree-workspace.js +41 -0
- package/dist/merge/merged-tree-workspace.js.map +1 -0
- package/dist/merge/moved-tables-files.d.ts +9 -0
- package/dist/merge/moved-tables-files.d.ts.map +1 -0
- package/dist/merge/moved-tables-files.js +16 -0
- package/dist/merge/moved-tables-files.js.map +1 -0
- package/dist/merge/preview-table-names.d.ts +21 -0
- package/dist/merge/preview-table-names.d.ts.map +1 -0
- package/dist/merge/preview-table-names.js +85 -0
- package/dist/merge/preview-table-names.js.map +1 -0
- package/dist/merge/settle-table-names.d.ts +21 -0
- package/dist/merge/settle-table-names.d.ts.map +1 -0
- package/dist/merge/settle-table-names.js +60 -0
- package/dist/merge/settle-table-names.js.map +1 -0
- package/dist/merge/side-index.d.ts +13 -0
- package/dist/merge/side-index.d.ts.map +1 -0
- package/dist/merge/side-index.js +43 -0
- package/dist/merge/side-index.js.map +1 -0
- package/dist/merge/side-reader.d.ts +8 -0
- package/dist/merge/side-reader.d.ts.map +1 -0
- package/dist/merge/side-reader.js +13 -0
- package/dist/merge/side-reader.js.map +1 -0
- package/dist/merge/side-tables-file.d.ts +5 -0
- package/dist/merge/side-tables-file.d.ts.map +1 -0
- package/dist/merge/side-tables-file.js +10 -0
- package/dist/merge/side-tables-file.js.map +1 -0
- package/dist/merge/table-names-settled.d.ts +18 -0
- package/dist/merge/table-names-settled.d.ts.map +1 -0
- package/dist/merge/table-names-settled.js +168 -0
- package/dist/merge/table-names-settled.js.map +1 -0
- package/dist/merge/trailer-in-merge-message.d.ts +9 -0
- package/dist/merge/trailer-in-merge-message.d.ts.map +1 -0
- package/dist/merge/trailer-in-merge-message.js +16 -0
- package/dist/merge/trailer-in-merge-message.js.map +1 -0
- package/dist/merge/tree-files.d.ts +21 -0
- package/dist/merge/tree-files.d.ts.map +1 -0
- package/dist/merge/tree-files.js +86 -0
- package/dist/merge/tree-files.js.map +1 -0
- package/dist/merge/trunk-reader.d.ts +5 -0
- package/dist/merge/trunk-reader.d.ts.map +1 -0
- package/dist/merge/trunk-reader.js +9 -0
- package/dist/merge/trunk-reader.js.map +1 -0
- package/dist/merge/two-tables-files.d.ts +19 -0
- package/dist/merge/two-tables-files.d.ts.map +1 -0
- package/dist/merge/two-tables-files.js +67 -0
- package/dist/merge/two-tables-files.js.map +1 -0
- package/dist/migration/file-of-source.d.ts +3 -0
- package/dist/migration/file-of-source.d.ts.map +1 -0
- package/dist/migration/file-of-source.js +5 -0
- package/dist/migration/file-of-source.js.map +1 -0
- package/dist/migration/hidden-in-index.d.ts +15 -0
- package/dist/migration/hidden-in-index.d.ts.map +1 -0
- package/dist/migration/hidden-in-index.js +23 -0
- package/dist/migration/hidden-in-index.js.map +1 -0
- package/dist/migration/index.d.ts +2 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +2 -0
- package/dist/migration/index.js.map +1 -1
- package/dist/migration/is-source-of-context.d.ts +17 -0
- package/dist/migration/is-source-of-context.d.ts.map +1 -0
- package/dist/migration/is-source-of-context.js +13 -0
- package/dist/migration/is-source-of-context.js.map +1 -0
- package/dist/migration/listed-in-index.d.ts +15 -3
- package/dist/migration/listed-in-index.d.ts.map +1 -1
- package/dist/migration/listed-in-index.js +25 -4
- package/dist/migration/listed-in-index.js.map +1 -1
- package/dist/migration/named-bindings-of.d.ts +14 -0
- package/dist/migration/named-bindings-of.d.ts.map +1 -0
- package/dist/migration/named-bindings-of.js +21 -0
- package/dist/migration/named-bindings-of.js.map +1 -0
- package/dist/migration/warn-dropped-context-tables.d.ts.map +1 -1
- package/dist/migration/warn-dropped-context-tables.js +21 -6
- package/dist/migration/warn-dropped-context-tables.js.map +1 -1
- package/dist/prisma-client/client-outputs.d.ts +3 -0
- package/dist/prisma-client/client-outputs.d.ts.map +1 -0
- package/dist/prisma-client/client-outputs.js +9 -0
- package/dist/prisma-client/client-outputs.js.map +1 -0
- package/dist/prisma-client/index.d.ts +4 -0
- package/dist/prisma-client/index.d.ts.map +1 -0
- package/dist/prisma-client/index.js +4 -0
- package/dist/prisma-client/index.js.map +1 -0
- package/dist/prisma-client/prisma-client-fingerprint.d.ts +7 -0
- package/dist/prisma-client/prisma-client-fingerprint.d.ts.map +1 -0
- package/dist/prisma-client/prisma-client-fingerprint.js +32 -0
- package/dist/prisma-client/prisma-client-fingerprint.js.map +1 -0
- package/dist/prisma-client/prisma-client-in-turn.d.ts +14 -0
- package/dist/prisma-client/prisma-client-in-turn.d.ts.map +1 -0
- package/dist/prisma-client/prisma-client-in-turn.js +15 -0
- package/dist/prisma-client/prisma-client-in-turn.js.map +1 -0
- package/dist/prisma-client/prisma-client-lock-refusal.d.ts +5 -0
- package/dist/prisma-client/prisma-client-lock-refusal.d.ts.map +1 -0
- package/dist/prisma-client/prisma-client-lock-refusal.js +11 -0
- package/dist/prisma-client/prisma-client-lock-refusal.js.map +1 -0
- package/dist/prisma-client/prisma-client-paths.d.ts +7 -0
- package/dist/prisma-client/prisma-client-paths.d.ts.map +1 -0
- package/dist/prisma-client/prisma-client-paths.js +8 -0
- package/dist/prisma-client/prisma-client-paths.js.map +1 -0
- package/dist/prisma-client/refresh-prisma-client.d.ts +16 -0
- package/dist/prisma-client/refresh-prisma-client.d.ts.map +1 -0
- package/dist/prisma-client/refresh-prisma-client.js +53 -0
- package/dist/prisma-client/refresh-prisma-client.js.map +1 -0
- package/dist/prisma-client/schema-files.d.ts +3 -0
- package/dist/prisma-client/schema-files.d.ts.map +1 -0
- package/dist/prisma-client/schema-files.js +18 -0
- package/dist/prisma-client/schema-files.js.map +1 -0
- package/dist/prisma-schema/single-prisma-schema-steps.js +1 -1
- package/dist/prisma-schema/single-prisma-schema-steps.js.map +1 -1
- package/dist/read-models/buildable-constructor.d.ts +3 -0
- package/dist/read-models/buildable-constructor.d.ts.map +1 -0
- package/dist/read-models/buildable-constructor.js +3 -0
- package/dist/read-models/buildable-constructor.js.map +1 -0
- package/dist/read-models/declared-class.d.ts +14 -0
- package/dist/read-models/declared-class.d.ts.map +1 -0
- package/dist/read-models/declared-class.js +2 -0
- package/dist/read-models/declared-class.js.map +1 -0
- package/dist/read-models/declared-classes.d.ts +32 -0
- package/dist/read-models/declared-classes.d.ts.map +1 -0
- package/dist/read-models/declared-classes.js +123 -0
- package/dist/read-models/declared-classes.js.map +1 -0
- package/dist/read-models/list-answers.d.ts +35 -0
- package/dist/read-models/list-answers.d.ts.map +1 -0
- package/dist/read-models/list-answers.js +53 -0
- package/dist/read-models/list-answers.js.map +1 -0
- package/dist/read-models/listing-of.d.ts +25 -0
- package/dist/read-models/listing-of.d.ts.map +1 -0
- package/dist/read-models/listing-of.js +22 -0
- package/dist/read-models/listing-of.js.map +1 -0
- package/dist/read-models/read-model-list-of.d.ts +12 -0
- package/dist/read-models/read-model-list-of.d.ts.map +1 -0
- package/dist/read-models/read-model-list-of.js +94 -0
- package/dist/read-models/read-model-list-of.js.map +1 -0
- package/dist/read-models/read-model-list.d.ts +41 -0
- package/dist/read-models/read-model-list.d.ts.map +1 -0
- package/dist/read-models/read-model-list.js +2 -0
- package/dist/read-models/read-model-list.js.map +1 -0
- package/dist/read-models/read-model-store.d.ts +16 -0
- package/dist/read-models/read-model-store.d.ts.map +1 -0
- package/dist/read-models/read-model-store.js +2 -0
- package/dist/read-models/read-model-store.js.map +1 -0
- package/dist/read-models/read-model-stores-of.d.ts +14 -0
- package/dist/read-models/read-model-stores-of.d.ts.map +1 -0
- package/dist/read-models/read-model-stores-of.js +63 -0
- package/dist/read-models/read-model-stores-of.js.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +2 -0
- package/dist/run.js.map +1 -1
- package/dist/slice/storage-of-slice.d.ts +10 -7
- package/dist/slice/storage-of-slice.d.ts.map +1 -1
- package/dist/slice/storage-of-slice.js +145 -22
- package/dist/slice/storage-of-slice.js.map +1 -1
- package/dist/stack/stack-vars.d.ts.map +1 -1
- package/dist/stack/stack-vars.js +10 -1
- package/dist/stack/stack-vars.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspace/exit-code-of.d.ts +2 -2
- package/dist/workspace/exit-code-of.d.ts.map +1 -1
- package/dist/workspace/exit-code-of.js +2 -2
- package/dist/workspace/exit-code-of.js.map +1 -1
- package/dist/workspace/located-step.d.ts +5 -0
- package/dist/workspace/located-step.d.ts.map +1 -0
- package/dist/workspace/located-step.js +7 -0
- package/dist/workspace/located-step.js.map +1 -0
- package/dist/workspace/remove-file.d.ts +3 -0
- package/dist/workspace/remove-file.d.ts.map +1 -0
- package/dist/workspace/remove-file.js +11 -0
- package/dist/workspace/remove-file.js.map +1 -0
- package/dist/workspace/workspace-report.d.ts +2 -0
- package/dist/workspace/workspace-report.d.ts.map +1 -1
- package/dist/workspace/workspace.d.ts +4 -3
- package/dist/workspace/workspace.d.ts.map +1 -1
- package/dist/workspace/workspace.js +16 -16
- package/dist/workspace/workspace.js.map +1 -1
- package/package.json +6 -6
- package/templates/init/docker/dockerignore.tpl +2 -0
- package/templates/init/platform/database/read-model-tables.ts.tpl +7 -4
- package/templates/init/rules/infrastructure.md.tpl +3 -0
- package/templates/pipeline/biome.json.tpl +1 -1
- package/templates/pipeline/github/workflows/codeql.yml +2 -2
- package/templates/pipeline/package-scripts.json +2 -2
- package/templates/repository/typeorm/schema-export.tpl +2 -2
- package/templates/read-model/typeorm/schema-export.tpl +0 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { resolveImport } from '../check/project/resolve-import.js';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a module specifier leads into a context: a file under its directory, its tables file
|
|
4
|
+
* included, or the barrel a team wrote for it (`@/contexts/shipping`). The specifier is resolved as
|
|
5
|
+
* the project resolves it: a package that bears the name of a context (`@ddd-ts-kit/kernel` beside
|
|
6
|
+
* a context `kernel`) is no file of that context.
|
|
7
|
+
*/
|
|
8
|
+
export function isSourceOfContext(config, { from, source, context }) {
|
|
9
|
+
const target = resolveImport(config, from, source);
|
|
10
|
+
const directory = `${config.contextsDir}/${context}`;
|
|
11
|
+
return target.kind === 'file' && (target.path.startsWith(`${directory}/`) || target.path === `${directory}.ts`);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=is-source-of-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-source-of-context.js","sourceRoot":"","sources":["../../src/migration/is-source-of-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAWhE;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAkB;IACzF,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IACnD,MAAM,SAAS,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,OAAO,EAAE,CAAC;IAErD,OAAO,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,SAAS,GAAG,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,GAAG,SAAS,KAAK,CAAC,CAAC;AAClH,CAAC"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/** What a schema index is asked about: the tables file, the constant it exports, the context that holds it. */
|
|
2
|
+
interface Listed {
|
|
3
3
|
readonly file: string;
|
|
4
4
|
readonly constant?: string;
|
|
5
|
-
|
|
5
|
+
/** Whether a module the index imports from is a file of the context that holds the tables file. */
|
|
6
|
+
readonly isOfItsContext?: (source: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Whether a schema index re-exports the file of this name, or names this constant in its code: an
|
|
10
|
+
* import alone does not list a table, nor does a comment. A constant the index imports from the
|
|
11
|
+
* file of this name, from another file of its context or from a barrel a team wrote for it, is
|
|
12
|
+
* read under the name the import gives it, `orders as billingOrders`; one it imports only from the
|
|
13
|
+
* tables file of another context is the table of that context, which bears the same name, and
|
|
14
|
+
* lists nothing of this file.
|
|
15
|
+
*/
|
|
16
|
+
export declare function listedInIndex(index: string, { file, constant, isOfItsContext }: Listed): boolean;
|
|
17
|
+
export {};
|
|
6
18
|
//# sourceMappingURL=listed-in-index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listed-in-index.d.ts","sourceRoot":"","sources":["../../src/migration/listed-in-index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listed-in-index.d.ts","sourceRoot":"","sources":["../../src/migration/listed-in-index.ts"],"names":[],"mappings":"AAKA,+GAA+G;AAC/G,UAAU,MAAM;IACd,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,mGAAmG;IACnG,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CACvD;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,MAAM,GAAG,OAAO,CAyBhG"}
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import { namedOutsideImports } from '../check/scan/named-outside-imports.js';
|
|
2
2
|
import { starExportsOf } from '../check/scan/star-exports-of.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { fileOfSource } from './file-of-source.js';
|
|
4
|
+
import { namedBindingsOf } from './named-bindings-of.js';
|
|
5
|
+
/**
|
|
6
|
+
* Whether a schema index re-exports the file of this name, or names this constant in its code: an
|
|
7
|
+
* import alone does not list a table, nor does a comment. A constant the index imports from the
|
|
8
|
+
* file of this name, from another file of its context or from a barrel a team wrote for it, is
|
|
9
|
+
* read under the name the import gives it, `orders as billingOrders`; one it imports only from the
|
|
10
|
+
* tables file of another context is the table of that context, which bears the same name, and
|
|
11
|
+
* lists nothing of this file.
|
|
12
|
+
*/
|
|
13
|
+
export function listedInIndex(index, { file, constant, isOfItsContext }) {
|
|
14
|
+
if (starExportsOf(index).some((source) => fileOfSource(source) === file)) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if (constant === undefined) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const isOwn = (source) => fileOfSource(source) === file || isOfItsContext?.(source) === true;
|
|
21
|
+
const imported = namedBindingsOf(index, 'import').flatMap(({ source, names }) => names.filter(({ name }) => name === constant).map(({ local }) => ({ source, local })));
|
|
22
|
+
const own = imported.filter(({ source }) => isOwn(source));
|
|
23
|
+
const ofAnotherContext = imported.some(({ source }) => !isOwn(source) && fileOfSource(source).endsWith('.schema'));
|
|
24
|
+
if (own.length === 0 && ofAnotherContext) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return (own.length === 0 ? [constant] : own.map(({ local }) => local)).some((local) => namedOutsideImports(index, local));
|
|
7
28
|
}
|
|
8
29
|
//# sourceMappingURL=listed-in-index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listed-in-index.js","sourceRoot":"","sources":["../../src/migration/listed-in-index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAA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EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3D,MAAM,gBAAgB,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,YAAY,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IAEnH,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,EAAE,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CACpF,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAClC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** One name a statement takes from a module: as the module exports it, and as the statement calls it. */
|
|
2
|
+
interface NamedBinding {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly local: string;
|
|
5
|
+
}
|
|
6
|
+
/** The names one `import { ... } from` or `export { ... } from` takes, and the module it takes them from. */
|
|
7
|
+
export interface NamedBindings {
|
|
8
|
+
readonly source: string;
|
|
9
|
+
readonly names: readonly NamedBinding[];
|
|
10
|
+
}
|
|
11
|
+
/** What a source takes by name from other modules, comments left out: every `import { a, b as c } from` or every `export { a, b as c } from`. */
|
|
12
|
+
export declare function namedBindingsOf(text: string, keyword: 'import' | 'export'): NamedBindings[];
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=named-bindings-of.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"named-bindings-of.d.ts","sourceRoot":"","sources":["../../src/migration/named-bindings-of.ts"],"names":[],"mappings":"AAGA,yGAAyG;AACzG,UAAU,YAAY;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,6GAA6G;AAC7G,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;CACzC;AAED,iJAAiJ;AACjJ,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,aAAa,EAAE,CAQ3F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { scan } from '../check/scan/scan.js';
|
|
2
|
+
import { stringAt } from '../check/scan/string-at.js';
|
|
3
|
+
/** What a source takes by name from other modules, comments left out: every `import { a, b as c } from` or every `export { a, b as c } from`. */
|
|
4
|
+
export function namedBindingsOf(text, keyword) {
|
|
5
|
+
const statement = new RegExp(`\\b${keyword}\\s*(?:type\\s+)?\\{([^}]*)\\}\\s*from\\s*`, 'g');
|
|
6
|
+
return [...scan(text).code.matchAll(statement)].flatMap((found) => {
|
|
7
|
+
const source = stringAt(text, found.index + found[0].length);
|
|
8
|
+
return source === undefined ? [] : [{ source, names: bindingsOf(found[1] ?? '') }];
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function bindingsOf(clause) {
|
|
12
|
+
return clause
|
|
13
|
+
.split(',')
|
|
14
|
+
.map((part) => part.trim().replace(/^type\s+/, ''))
|
|
15
|
+
.filter((part) => part !== '')
|
|
16
|
+
.map((part) => {
|
|
17
|
+
const [name = '', local = name] = part.split(/\s+as\s+/);
|
|
18
|
+
return { name, local };
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=named-bindings-of.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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,CAAC;QAEzD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warn-dropped-context-tables.d.ts","sourceRoot":"","sources":["../../src/migration/warn-dropped-context-tables.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"warn-dropped-context-tables.d.ts","sourceRoot":"","sources":["../../src/migration/warn-dropped-context-tables.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAWzC,6FAA6F;AAC7F,KAAK,aAAa,GAAG,aAAa,GAAG,SAAS,CAAC;AAS/C;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,GAAE,aAA6B,GAAG,IAAI,CAqBxG"}
|
|
@@ -7,6 +7,8 @@ import { roleFoldersOf, treeOf } from '../model-modules/index.js';
|
|
|
7
7
|
import { schemaOfContext } from '../prisma-schema/index.js';
|
|
8
8
|
import { Workspace } from '../workspace/index.js';
|
|
9
9
|
import { declaredTables } from './declared-tables.js';
|
|
10
|
+
import { hiddenInIndex } from './hidden-in-index.js';
|
|
11
|
+
import { isSourceOfContext } from './is-source-of-context.js';
|
|
10
12
|
import { listedInIndex } from './listed-in-index.js';
|
|
11
13
|
import { migrationFiles } from './migration-files.js';
|
|
12
14
|
const CREATE_TABLE = /CREATE TABLE (?:IF NOT EXISTS )?"(\w+)"\."(\w+)"/g;
|
|
@@ -21,12 +23,10 @@ export function warnDroppedContextTables(root, io, tool = 'drizzle-kit') {
|
|
|
21
23
|
const file = `${config.platformDir}/database/schema.ts`;
|
|
22
24
|
const index = readIfPresent(path.join(root, file));
|
|
23
25
|
const recorded = tool === 'typeorm' ? createdTables(root) : lastSnapshotTables(root);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
.filter((table) => !listedInIndex(index ?? '', table))
|
|
29
|
-
.map(({ table }) => `${schema}.${table}`);
|
|
26
|
+
const held = index === undefined ? [] : Object.keys(config.contexts);
|
|
27
|
+
const tables = new Map(held.map((context) => [context, tablesOf(root, config, context)]));
|
|
28
|
+
for (const context of held) {
|
|
29
|
+
const dropped = droppedOf(context, { config, file, index: index ?? '', tables, recorded, tool });
|
|
30
30
|
if (dropped.length > 0) {
|
|
31
31
|
io.err([
|
|
32
32
|
`Warning: the migration about to be written drops the tables of the context ${context} (${dropped.join(', ')}): ${file} no longer names them, so ${tool} reads them as removed and writes DROP TABLE; those rows are gone once it is migrated.`,
|
|
@@ -35,6 +35,21 @@ export function warnDroppedContextTables(root, io, tool = 'drizzle-kit') {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
/** The tables of a context a migration recorded and the index no longer lists, each as `<schema>.<table>`. */
|
|
39
|
+
function droppedOf(context, { config, file, index, tables, recorded, tool }) {
|
|
40
|
+
const schema = schemaOfContext(context);
|
|
41
|
+
const isOfItsContext = (source) => isSourceOfContext(config, { from: file, source, context });
|
|
42
|
+
// On Drizzle a table of the same name in two tables files the index re-exports whole is listed by neither.
|
|
43
|
+
const sharesItsName = ({ constant }) => tool === 'drizzle-kit' &&
|
|
44
|
+
[...tables]
|
|
45
|
+
.filter(([other]) => other !== context)
|
|
46
|
+
.some(([, others]) => others.some((other) => other.constant === constant && listedInIndex(index, { file: other.file })));
|
|
47
|
+
return (tables.get(context) ?? [])
|
|
48
|
+
.filter(({ table }) => recorded.includes(`${schema}.${table}`))
|
|
49
|
+
.filter((table) => !listedInIndex(index, { ...table, isOfItsContext }) ||
|
|
50
|
+
hiddenInIndex(index, { ...table, sharesItsName: sharesItsName(table) }))
|
|
51
|
+
.map(({ table }) => `${schema}.${table}`);
|
|
52
|
+
}
|
|
38
53
|
/** The tables the files of the persistence of a context export: its own, those of `shared/` and of each module of its model. */
|
|
39
54
|
function tablesOf(root, config, context) {
|
|
40
55
|
const folders = roleFoldersOf(new Workspace(root, false), treeOf(config, context), 'infrastructure/persistence');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"warn-dropped-context-tables.js","sourceRoot":"","sources":["../../src/migration/warn-dropped-context-tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAe,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,cAAc,EAAsB,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKnD,MAAM,YAAY,GAAG,mDAAmD,CAAC;AAOzE;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,IAAY,EAAE,EAAM,EAAE,IAAI,GAAkB,aAAa;IAChG,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,IAAI,GAAG,GAAG,MAAM,CAAC,WAAW,qBAAqB,CAAC;IACxD,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,C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AAS,OAAO,CAAC,SAAiB;IAChC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-outputs.d.ts","sourceRoot":"","sources":["../../src/prisma-client/client-outputs.ts"],"names":[],"mappings":"AAMA,4HAA4H;AAC5H,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAMvF"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/** The `output` of a generator block, as Prisma writes it: a path between double quotes. */
|
|
4
|
+
const OUTPUT = /^\s*output\s*=\s*"([^"]+)"/gm;
|
|
5
|
+
/** The folders the generators of the schema write, relative to `root`: each `output`, read from the file that states it. */
|
|
6
|
+
export function clientOutputs(root, files) {
|
|
7
|
+
return files.flatMap((file) => [...fs.readFileSync(path.join(root, file), 'utf8').matchAll(OUTPUT)].map(([, output = '']) => path.posix.normalize(path.posix.join(path.posix.dirname(file), output))));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=client-outputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-outputs.js","sourceRoot":"","sources":["../../src/prisma-client/client-outputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,4FAA4F;AAC5F,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAE9C,4HAA4H;AAC5H,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,KAAwB;IAClE,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAC5B,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,GAAG,EAAE,CAAC,EAAE,EAAE,CAC3F,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CACxE,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prisma-client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prisma-client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the client and the schema of the tests are derived from, as one digest: the path of the
|
|
3
|
+
* schema, then the path and the content of each of its `files` and of the other sources (empty for
|
|
4
|
+
* one that is not there). Two runs that compute the same one would write the same files.
|
|
5
|
+
*/
|
|
6
|
+
export declare function prismaClientFingerprint(root: string, schema: string, files: readonly string[]): string;
|
|
7
|
+
//# sourceMappingURL=prisma-client-fingerprint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-fingerprint.d.ts","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-fingerprint.ts"],"names":[],"mappings":"AAeA;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAWtG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
/**
|
|
5
|
+
* The files besides the schema that change what Prisma writes: the configuration it reads the
|
|
6
|
+
* schema from, and the manifests of the installed `prisma` and `@prisma/client`, which hold their
|
|
7
|
+
* version.
|
|
8
|
+
*/
|
|
9
|
+
const OTHER_SOURCES = [
|
|
10
|
+
'prisma.config.ts',
|
|
11
|
+
'node_modules/prisma/package.json',
|
|
12
|
+
'node_modules/@prisma/client/package.json',
|
|
13
|
+
];
|
|
14
|
+
/**
|
|
15
|
+
* What the client and the schema of the tests are derived from, as one digest: the path of the
|
|
16
|
+
* schema, then the path and the content of each of its `files` and of the other sources (empty for
|
|
17
|
+
* one that is not there). Two runs that compute the same one would write the same files.
|
|
18
|
+
*/
|
|
19
|
+
export function prismaClientFingerprint(root, schema, files) {
|
|
20
|
+
const hash = createHash('sha256').update(`schema ${schema}\n`);
|
|
21
|
+
for (const file of [...files, ...OTHER_SOURCES]) {
|
|
22
|
+
hash
|
|
23
|
+
.update(`file ${file}\n`)
|
|
24
|
+
.update(contentOf(path.join(root, file)))
|
|
25
|
+
.update('\n');
|
|
26
|
+
}
|
|
27
|
+
return hash.digest('hex');
|
|
28
|
+
}
|
|
29
|
+
function contentOf(file) {
|
|
30
|
+
return fs.existsSync(file) ? fs.readFileSync(file, 'utf8') : '';
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=prisma-client-fingerprint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-fingerprint.js","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-fingerprint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B;;;;GAIG;AACH,MAAM,aAAa,GAAG;IACpB,kBAAkB;IAClB,kCAAkC;IAClC,0CAA0C;CAC3C,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAY,EAAE,MAAc,EAAE,KAAwB;IAC5F,MAAM,IAAI,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,UAAU,MAAM,IAAI,CAAC,CAAC;IAE/D,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,KAAK,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC;QAChD,IAAI;aACD,MAAM,CAAC,QAAQ,IAAI,IAAI,CAAC;aACxB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;aACxC,MAAM,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,CAAC;AAED,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type LockTiming } from '../generator-lock/index.js';
|
|
2
|
+
import { type PrismaClientRequest } from './refresh-prisma-client.js';
|
|
3
|
+
/** A refresh of the client, asked by `command` (its line, as the refusal of another run names it). */
|
|
4
|
+
export interface PrismaClientTurn extends PrismaClientRequest {
|
|
5
|
+
readonly command: string;
|
|
6
|
+
readonly timing?: LockTiming;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* `refreshPrismaClient` while this run holds the lock of the client in the project. Two runs in one
|
|
10
|
+
* project (two test runs started together, a type check beside them) take turns: the second finds
|
|
11
|
+
* the client current and writes nothing, so that no run reads a client another one is rewriting.
|
|
12
|
+
*/
|
|
13
|
+
export declare function prismaClientInTurn({ command, timing, ...request }: PrismaClientTurn): number;
|
|
14
|
+
//# sourceMappingURL=prisma-client-in-turn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-in-turn.d.ts","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-in-turn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGpE,OAAO,EAAuB,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAKxF,sGAAsG;AACtG,MAAM,WAAW,gBAAiB,SAAQ,mBAAmB;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,MAA6B,EAAE,GAAG,OAAO,EAAE,EAAE,gBAAgB,GAAG,MAAM,CAKnH"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { withFolderLock } from '../generator-lock/index.js';
|
|
2
|
+
import { prismaClientLockRefusal } from './prisma-client-lock-refusal.js';
|
|
3
|
+
import { PRISMA_CLIENT_LOCK } from './prisma-client-paths.js';
|
|
4
|
+
import { refreshPrismaClient } from './refresh-prisma-client.js';
|
|
5
|
+
/** About ten minutes of waiting for the other run, a look every fifth of a second; a lock of another machine taken over after as long. */
|
|
6
|
+
const PRISMA_CLIENT_TIMING = { waitMs: 600_000, pollMs: 200, staleMs: 600_000 };
|
|
7
|
+
/**
|
|
8
|
+
* `refreshPrismaClient` while this run holds the lock of the client in the project. Two runs in one
|
|
9
|
+
* project (two test runs started together, a type check beside them) take turns: the second finds
|
|
10
|
+
* the client current and writes nothing, so that no run reads a client another one is rewriting.
|
|
11
|
+
*/
|
|
12
|
+
export function prismaClientInTurn({ command, timing = PRISMA_CLIENT_TIMING, ...request }) {
|
|
13
|
+
return withFolderLock({ root: request.root, lock: PRISMA_CLIENT_LOCK, command, timing, refusal: prismaClientLockRefusal }, () => refreshPrismaClient(request));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=prisma-client-in-turn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-in-turn.js","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-in-turn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAmB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAA4B,MAAM,yBAAyB,CAAC;AAExF,0IAA0I;AAC1I,MAAM,oBAAoB,GAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAQ5F;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,oBAAoB,EAAE,GAAG,OAAO,EAAoB;IACzG,OAAO,cAAc,CACnB,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,uBAAuB,EAAE,EACnG,GAAG,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,CACnC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CliError } from '../cli-error.js';
|
|
2
|
+
import { type LockHolder } from '../generator-lock/index.js';
|
|
3
|
+
/** The refusal of a run that waited as long as it waits for another one: the other run named, or the lock that reads as nothing. */
|
|
4
|
+
export declare function prismaClientLockRefusal(holder: LockHolder | undefined, now: number): CliError;
|
|
5
|
+
//# sourceMappingURL=prisma-client-lock-refusal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-lock-refusal.d.ts","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-lock-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAGhE,oIAAoI;AACpI,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,UAAU,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAU7F"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CliError } from '../cli-error.js';
|
|
2
|
+
import { holderText } from '../generator-lock/index.js';
|
|
3
|
+
import { PRISMA_CLIENT_LOCK } from './prisma-client-paths.js';
|
|
4
|
+
/** The refusal of a run that waited as long as it waits for another one: the other run named, or the lock that reads as nothing. */
|
|
5
|
+
export function prismaClientLockRefusal(holder, now) {
|
|
6
|
+
const held = holder === undefined
|
|
7
|
+
? `${PRISMA_CLIENT_LOCK} stands there and cannot be read, a link to nothing for one`
|
|
8
|
+
: `Another run generates the Prisma client of this project: ${holderText(holder, now, PRISMA_CLIENT_LOCK)}`;
|
|
9
|
+
return new CliError(`${held}. This command waited for it and generated nothing.`, `Run it again once that one has ended. A lock taken on this machine is kept while its command runs and taken over once it has ended; one taken on another machine, or whose holder cannot be read, is taken over ten minutes after it was taken. To take it at once, remove ${PRISMA_CLIENT_LOCK}.`);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=prisma-client-lock-refusal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-lock-refusal.js","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-lock-refusal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAmB,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,oIAAoI;AACpI,MAAM,UAAU,uBAAuB,CAAC,MAA8B,EAAE,GAAW;IACjF,MAAM,IAAI,GACR,MAAM,KAAK,SAAS;QAClB,CAAC,CAAC,GAAG,kBAAkB,6DAA6D;QACpF,CAAC,CAAC,4DAA4D,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,kBAAkB,CAAC,EAAE,CAAC;IAEhH,OAAO,IAAI,QAAQ,CACjB,GAAG,IAAI,qDAAqD,EAC5D,8QAA8Q,kBAAkB,GAAG,CACpS,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** The schema of the tests, which `prisma migrate diff` writes from the Prisma schema. */
|
|
2
|
+
export declare const TEST_SCHEMA = "generated/schema.sql";
|
|
3
|
+
/** What the client and the schema of the tests were last generated from, written once both are. */
|
|
4
|
+
export declare const PRISMA_CLIENT_STAMP = "generated/prisma-client.sha256";
|
|
5
|
+
/** The lock two runs of `ddd-ts-kit prisma-client` in one project take turns on. */
|
|
6
|
+
export declare const PRISMA_CLIENT_LOCK = ".ddd-ts-kit/prisma-client";
|
|
7
|
+
//# sourceMappingURL=prisma-client-paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-paths.d.ts","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-paths.ts"],"names":[],"mappings":"AAEA,0FAA0F;AAC1F,eAAO,MAAM,WAAW,yBAAyB,CAAC;AAElD,mGAAmG;AACnG,eAAO,MAAM,mBAAmB,mCAAmC,CAAC;AAEpE,oFAAoF;AACpF,eAAO,MAAM,kBAAkB,8BAAgC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { KIT_FOLDER } from '../workspace/kit-folder.js';
|
|
2
|
+
/** The schema of the tests, which `prisma migrate diff` writes from the Prisma schema. */
|
|
3
|
+
export const TEST_SCHEMA = 'generated/schema.sql';
|
|
4
|
+
/** What the client and the schema of the tests were last generated from, written once both are. */
|
|
5
|
+
export const PRISMA_CLIENT_STAMP = 'generated/prisma-client.sha256';
|
|
6
|
+
/** The lock two runs of `ddd-ts-kit prisma-client` in one project take turns on. */
|
|
7
|
+
export const PRISMA_CLIENT_LOCK = `${KIT_FOLDER}/prisma-client`;
|
|
8
|
+
//# sourceMappingURL=prisma-client-paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prisma-client-paths.js","sourceRoot":"","sources":["../../src/prisma-client/prisma-client-paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAElD,mGAAmG;AACnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,gCAAgC,CAAC;AAEpE,oFAAoF;AACpF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,UAAU,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Io } from '../commands/io.js';
|
|
2
|
+
/** The project, the Prisma schema its client is derived from (a folder or one file), and where the command prints. */
|
|
3
|
+
export interface PrismaClientRequest {
|
|
4
|
+
readonly root: string;
|
|
5
|
+
readonly schema: string;
|
|
6
|
+
readonly io: Io;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The Prisma client (`prisma generate`, from the same `schema`) and the schema of the tests (`prisma migrate diff` into
|
|
10
|
+
* generated/schema.sql), written again unless they are current: generated from the same schema, the
|
|
11
|
+
* same `prisma.config.ts` and the same Prisma, and still there. The stamp of what they were derived
|
|
12
|
+
* from goes before the first tool runs and comes back once both succeeded, so that a run stopped
|
|
13
|
+
* half way is never taken for current. Answers the exit code of the first tool that fails, else 0.
|
|
14
|
+
*/
|
|
15
|
+
export declare function refreshPrismaClient({ root, schema, io }: PrismaClientRequest): number;
|
|
16
|
+
//# sourceMappingURL=refresh-prisma-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-prisma-client.d.ts","sourceRoot":"","sources":["../../src/prisma-client/refresh-prisma-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AASzC,sHAAsH;AACtH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,mBAAmB,GAAG,MAAM,CAwBrF"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { runOrmTool } from '../migration/index.js';
|
|
4
|
+
import { clientOutputs } from './client-outputs.js';
|
|
5
|
+
import { prismaClientFingerprint } from './prisma-client-fingerprint.js';
|
|
6
|
+
import { PRISMA_CLIENT_STAMP, TEST_SCHEMA } from './prisma-client-paths.js';
|
|
7
|
+
import { schemaFiles } from './schema-files.js';
|
|
8
|
+
const PRISMA = 'prisma/build/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* The Prisma client (`prisma generate`, from the same `schema`) and the schema of the tests (`prisma migrate diff` into
|
|
11
|
+
* generated/schema.sql), written again unless they are current: generated from the same schema, the
|
|
12
|
+
* same `prisma.config.ts` and the same Prisma, and still there. The stamp of what they were derived
|
|
13
|
+
* from goes before the first tool runs and comes back once both succeeded, so that a run stopped
|
|
14
|
+
* half way is never taken for current. Answers the exit code of the first tool that fails, else 0.
|
|
15
|
+
*/
|
|
16
|
+
export function refreshPrismaClient({ root, schema, io }) {
|
|
17
|
+
const files = schemaFiles(root, schema);
|
|
18
|
+
const fingerprint = prismaClientFingerprint(root, schema, files);
|
|
19
|
+
const stamp = path.join(root, PRISMA_CLIENT_STAMP);
|
|
20
|
+
if (isCurrent(root, files, fingerprint)) {
|
|
21
|
+
io.out(`The Prisma client and ${TEST_SCHEMA} are current with ${schema}: nothing to generate.\n`);
|
|
22
|
+
return 0;
|
|
23
|
+
}
|
|
24
|
+
fs.rmSync(stamp, { force: true });
|
|
25
|
+
const code = firstFailure(root, [
|
|
26
|
+
['generate', '--schema', schema],
|
|
27
|
+
['migrate', 'diff', '--from-empty', '--to-schema', schema, '--script', '-o', TEST_SCHEMA],
|
|
28
|
+
]);
|
|
29
|
+
if (code === 0) {
|
|
30
|
+
fs.mkdirSync(path.dirname(stamp), { recursive: true });
|
|
31
|
+
fs.writeFileSync(stamp, `${fingerprint}\n`);
|
|
32
|
+
}
|
|
33
|
+
return code;
|
|
34
|
+
}
|
|
35
|
+
/** Whether the stamp names the same sources and every file the tools write is still there. */
|
|
36
|
+
function isCurrent(root, files, fingerprint) {
|
|
37
|
+
const stamp = path.join(root, PRISMA_CLIENT_STAMP);
|
|
38
|
+
const written = [TEST_SCHEMA, ...clientOutputs(root, files)];
|
|
39
|
+
return (fs.existsSync(stamp) &&
|
|
40
|
+
fs.readFileSync(stamp, 'utf8').trim() === fingerprint &&
|
|
41
|
+
written.every((file) => fs.existsSync(path.join(root, file))));
|
|
42
|
+
}
|
|
43
|
+
/** Runs the CLI of Prisma once per list of arguments, in order, stopping at the first that fails: its exit code, else 0. */
|
|
44
|
+
function firstFailure(root, runs) {
|
|
45
|
+
for (const args of runs) {
|
|
46
|
+
const code = runOrmTool(root, PRISMA, args);
|
|
47
|
+
if (code !== 0) {
|
|
48
|
+
return code;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=refresh-prisma-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-prisma-client.js","sourceRoot":"","sources":["../../src/prisma-client/refresh-prisma-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,GAAG,uBAAuB,CAAC;AASvC;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAuB;IAC3E,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxC,MAAM,WAAW,GAAG,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAEnD,IAAI,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,CAAC;QACxC,EAAE,CAAC,GA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;AAED,4HAA4H;AAC5H,SAAS,YAAY,CAAC,IAAY,EAAE,IAAoC;IACtE,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAE5C,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-files.d.ts","sourceRoot":"","sources":["../../src/prisma-client/schema-files.ts"],"names":[],"mappings":"AAGA,kIAAkI;AAClI,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAgB3E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
/** The files of the Prisma schema at `schema` (a folder, or one file), relative to `root` and sorted; none when it is missing. */
|
|
4
|
+
export function schemaFiles(root, schema) {
|
|
5
|
+
const stat = fs.statSync(path.join(root, schema), { throwIfNoEntry: false });
|
|
6
|
+
if (stat === undefined) {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
if (!stat.isDirectory()) {
|
|
10
|
+
return [schema];
|
|
11
|
+
}
|
|
12
|
+
return fs
|
|
13
|
+
.readdirSync(path.join(root, schema), { recursive: true, encoding: 'utf8' })
|
|
14
|
+
.map((entry) => path.posix.join(schema, entry.split(path.sep).join('/')))
|
|
15
|
+
.filter((file) => fs.statSync(path.join(root, file)).isFile())
|
|
16
|
+
.sort();
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=schema-files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-files.js","sourceRoot":"","sources":["../../src/prisma-client/schema-files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,kIAAkI;AAClI,MAAM,UAAU,WAAW,CAAC,IAAY,EAAE,MAAc;IACtD,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;IAE7E,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,EAAE;SACN,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;SAC3E,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SACxE,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SAC7D,IAAI,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -18,7 +18,7 @@ export function singlePrismaSchemaSteps(contexts) {
|
|
|
18
18
|
'in that file write the `output` of the generator one level up (`"../../generated/prisma"`);',
|
|
19
19
|
`move out of its \`// ddd-ts-kit:models\` region ${each}, each file holding them between a \`// ddd-ts-kit:models\` and a \`// /ddd-ts-kit:models\` line of its own, then remove the emptied region;`,
|
|
20
20
|
`in prisma.config.ts set \`schema: './${PRISMA_SCHEMA_FOLDER}'\`;`,
|
|
21
|
-
`
|
|
21
|
+
`set the \`db:client\` script of package.json to \`ddd-ts-kit prisma-client --schema ${PRISMA_SCHEMA_FOLDER}\`;`,
|
|
22
22
|
'then run `npm run db:client`: the tables are the same, so `npm run db:generate` finds no change and no migration is needed.',
|
|
23
23
|
].join(' ');
|
|
24
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-prisma-schema-steps.js","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,MAAM,IAAI,GACR,QAAQ,CAAC,MAAM,KAAK,CAAC;QACnB,CAAC,CAAC,qGAAqG,cAAc,CAAC,WAAW,CAAC,EAAE;QACpI,CAAC,CAAC,QAAQ;aACL,GAAG,CACF,CAAC,OAAO,EAAE,EAAE,CACV,+CAA+C,eAAe,CAAC,OAAO,CAAC,UAAU,cAAc,CAAC,OAAO,CAAC,EAAE,CAC7G;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpB,OAAO;QACL,oBAAoB,oBAAoB,cAAc,oBAAoB,IAAI,kBAAkB,KAAK;QACrG,6FAA6F;QAC7F,mDAAmD,IAAI,8IAA8I;QACrM,wCAAwC,oBAAoB,MAAM;QAClE,
|
|
1
|
+
{"version":3,"file":"single-prisma-schema-steps.js","sourceRoot":"","sources":["../../src/prisma-schema/single-prisma-schema-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA2B;IACjE,MAAM,IAAI,GACR,QAAQ,CAAC,MAAM,KAAK,CAAC;QACnB,CAAC,CAAC,qGAAqG,cAAc,CAAC,WAAW,CAAC,EAAE;QACpI,CAAC,CAAC,QAAQ;aACL,GAAG,CACF,CAAC,OAAO,EAAE,EAAE,CACV,+CAA+C,eAAe,CAAC,OAAO,CAAC,UAAU,cAAc,CAAC,OAAO,CAAC,EAAE,CAC7G;aACA,IAAI,CAAC,IAAI,CAAC,CAAC;IAEpB,OAAO;QACL,oBAAoB,oBAAoB,cAAc,oBAAoB,IAAI,kBAAkB,KAAK;QACrG,6FAA6F;QAC7F,mDAAmD,IAAI,8IAA8I;QACrM,wCAAwC,oBAAoB,MAAM;QAClE,uFAAuF,oBAAoB,KAAK;QAChH,6HAA6H;KAC9H,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** The constructor the list builds a store with, as a sentence names it. */
|
|
2
|
+
export declare const BUILDABLE_CONSTRUCTOR = "`(database: <Type>)` or `(database: <Type>, scope: ExecutionScope)`, `<Type>` a name or a member of one such as `Persistence['database']`, with or without `private readonly`";
|
|
3
|
+
//# sourceMappingURL=buildable-constructor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildable-constructor.d.ts","sourceRoot":"","sources":["../../src/read-models/buildable-constructor.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,kLAC+I,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** The constructor the list builds a store with, as a sentence names it. */
|
|
2
|
+
export const BUILDABLE_CONSTRUCTOR = "`(database: <Type>)` or `(database: <Type>, scope: ExecutionScope)`, `<Type>` a name or a member of one such as `Persistence['database']`, with or without `private readonly`";
|
|
3
|
+
//# sourceMappingURL=buildable-constructor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildable-constructor.js","sourceRoot":"","sources":["../../src/read-models/buildable-constructor.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAChC,+KAA+K,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ClassShape } from '../check/structure/class-shape.js';
|
|
2
|
+
/** A class a source of the project declares at the level of its module, outside its tests. */
|
|
3
|
+
export interface DeclaredClass {
|
|
4
|
+
/** Its file, from the root of the project. */
|
|
5
|
+
readonly file: string;
|
|
6
|
+
/** The bounded context of its file, when it is in one. */
|
|
7
|
+
readonly context: string | undefined;
|
|
8
|
+
readonly shape: ClassShape;
|
|
9
|
+
/** Its own text, from `class` to the brace that closes it, comments and literals blanked. */
|
|
10
|
+
readonly code: string;
|
|
11
|
+
/** True when its file exports it as its default and not by its name. */
|
|
12
|
+
readonly isDefaultOnly: boolean;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=declared-class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declared-class.d.ts","sourceRoot":"","sources":["../../src/read-models/declared-class.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,8FAA8F;AAC9F,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wEAAwE;IACxE,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC"}
|