ddd-ts-kit 0.111.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 +154 -0
- package/README.fr.md +52 -6
- package/README.md +48 -5
- package/dist/alias/index.d.ts +2 -0
- package/dist/alias/index.d.ts.map +1 -1
- package/dist/alias/index.js +2 -0
- package/dist/alias/index.js.map +1 -1
- package/dist/alias/neighbour-sources.d.ts +17 -0
- package/dist/alias/neighbour-sources.d.ts.map +1 -0
- package/dist/alias/neighbour-sources.js +11 -0
- package/dist/alias/neighbour-sources.js.map +1 -0
- package/dist/alias/neighbour-suffix.d.ts +8 -0
- package/dist/alias/neighbour-suffix.d.ts.map +1 -0
- package/dist/alias/neighbour-suffix.js +10 -0
- package/dist/alias/neighbour-suffix.js.map +1 -0
- package/dist/build/rewrite-aliases.d.ts.map +1 -1
- package/dist/build/rewrite-aliases.js +11 -0
- package/dist/build/rewrite-aliases.js.map +1 -1
- package/dist/check/alias/build-scripts.d.ts.map +1 -1
- package/dist/check/alias/build-scripts.js +4 -8
- package/dist/check/alias/build-scripts.js.map +1 -1
- package/dist/check/alias/compiler-options-of.d.ts +3 -3
- package/dist/check/alias/compiler-options-of.js +17 -6
- package/dist/check/alias/compiler-options-of.js.map +1 -1
- package/dist/check/alias/neighbour-sources.d.ts +12 -0
- package/dist/check/alias/neighbour-sources.d.ts.map +1 -0
- package/dist/check/alias/neighbour-sources.js +80 -0
- package/dist/check/alias/neighbour-sources.js.map +1 -0
- package/dist/check/alias/script-steps.d.ts +11 -0
- package/dist/check/alias/script-steps.d.ts.map +1 -0
- package/dist/check/alias/script-steps.js +22 -0
- package/dist/check/alias/script-steps.js.map +1 -0
- package/dist/check/aspects/adapter-policies.d.ts +10 -0
- package/dist/check/aspects/adapter-policies.d.ts.map +1 -0
- package/dist/check/aspects/adapter-policies.js +104 -0
- package/dist/check/aspects/adapter-policies.js.map +1 -0
- package/dist/check/aspects/adapter-policy.d.ts +18 -0
- package/dist/check/aspects/adapter-policy.d.ts.map +1 -0
- package/dist/check/aspects/adapter-policy.js +2 -0
- package/dist/check/aspects/adapter-policy.js.map +1 -0
- package/dist/check/aspects/is-under-condition.d.ts +7 -0
- package/dist/check/aspects/is-under-condition.d.ts.map +1 -0
- package/dist/check/aspects/is-under-condition.js +50 -0
- package/dist/check/aspects/is-under-condition.js.map +1 -0
- package/dist/check/aspects/stated-policy.d.ts +18 -0
- package/dist/check/aspects/stated-policy.d.ts.map +1 -0
- package/dist/check/aspects/stated-policy.js +39 -0
- package/dist/check/aspects/stated-policy.js.map +1 -0
- package/dist/check/catalogue/architecture-rules.d.ts.map +1 -1
- package/dist/check/catalogue/architecture-rules.js +6 -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/imports-docs.d.ts.map +1 -1
- package/dist/check/explain/imports-docs.js +5 -3
- package/dist/check/explain/imports-docs.js.map +1 -1
- package/dist/check/explain/persistence-docs.d.ts.map +1 -1
- package/dist/check/explain/persistence-docs.js +38 -0
- package/dist/check/explain/persistence-docs.js.map +1 -1
- package/dist/check/explain/standard-docs.d.ts.map +1 -1
- package/dist/check/explain/standard-docs.js +16 -0
- package/dist/check/explain/standard-docs.js.map +1 -1
- package/dist/check/files/kit-content-types.d.ts +12 -0
- package/dist/check/files/kit-content-types.d.ts.map +1 -0
- package/dist/check/files/kit-content-types.js +38 -0
- package/dist/check/files/kit-content-types.js.map +1 -0
- package/dist/check/files/upload-content-defect.d.ts +7 -0
- package/dist/check/files/upload-content-defect.d.ts.map +1 -0
- package/dist/check/files/upload-content-defect.js +2 -0
- package/dist/check/files/upload-content-defect.js.map +1 -0
- package/dist/check/files/upload-content-defects.d.ts +9 -0
- package/dist/check/files/upload-content-defects.d.ts.map +1 -0
- package/dist/check/files/upload-content-defects.js +54 -0
- package/dist/check/files/upload-content-defects.js.map +1 -0
- package/dist/check/files/upload-declaration.d.ts +7 -0
- package/dist/check/files/upload-declaration.d.ts.map +1 -0
- package/dist/check/files/upload-declaration.js +2 -0
- package/dist/check/files/upload-declaration.js.map +1 -0
- package/dist/check/files/upload-declarations.d.ts +9 -0
- package/dist/check/files/upload-declarations.d.ts.map +1 -0
- package/dist/check/files/upload-declarations.js +41 -0
- package/dist/check/files/upload-declarations.js.map +1 -0
- package/dist/check/fixtures/alias-declared-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/alias-declared-fixtures.js +95 -1
- package/dist/check/fixtures/alias-declared-fixtures.js.map +1 -1
- package/dist/check/fixtures/fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/fixtures.js +4 -0
- package/dist/check/fixtures/fixtures.js.map +1 -1
- package/dist/check/fixtures/imports-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/imports-fixtures.js +97 -0
- package/dist/check/fixtures/imports-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/standard-fixtures.d.ts.map +1 -1
- package/dist/check/fixtures/standard-fixtures.js +42 -0
- package/dist/check/fixtures/standard-fixtures.js.map +1 -1
- 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/fixtures/upload-fixtures.d.ts +3 -0
- package/dist/check/fixtures/upload-fixtures.d.ts.map +1 -0
- package/dist/check/fixtures/upload-fixtures.js +94 -0
- package/dist/check/fixtures/upload-fixtures.js.map +1 -0
- package/dist/check/migrations/is-working-migration.d.ts +6 -0
- package/dist/check/migrations/is-working-migration.d.ts.map +1 -0
- package/dist/check/migrations/is-working-migration.js +8 -0
- package/dist/check/migrations/is-working-migration.js.map +1 -0
- package/dist/check/migrations/journal-entries.d.ts +4 -0
- package/dist/check/migrations/journal-entries.d.ts.map +1 -0
- package/dist/check/migrations/journal-entries.js +21 -0
- package/dist/check/migrations/journal-entries.js.map +1 -0
- package/dist/check/migrations/read-drizzle-migrations.d.ts.map +1 -1
- package/dist/check/migrations/read-drizzle-migrations.js +4 -9
- package/dist/check/migrations/read-drizzle-migrations.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/modules/imported-modules.d.ts +4 -0
- package/dist/check/modules/imported-modules.d.ts.map +1 -0
- package/dist/check/modules/imported-modules.js +5 -0
- package/dist/check/modules/imported-modules.js.map +1 -0
- package/dist/check/modules/module-imports.d.ts +17 -0
- package/dist/check/modules/module-imports.d.ts.map +1 -0
- package/dist/check/modules/module-imports.js +23 -0
- package/dist/check/modules/module-imports.js.map +1 -0
- package/dist/check/project/assemble-project.d.ts.map +1 -1
- package/dist/check/project/assemble-project.js +1 -8
- package/dist/check/project/assemble-project.js.map +1 -1
- package/dist/check/project/file-severity.d.ts +4 -0
- package/dist/check/project/file-severity.d.ts.map +1 -0
- package/dist/check/project/file-severity.js +11 -0
- package/dist/check/project/file-severity.js.map +1 -0
- package/dist/check/project/load-project.js +1 -10
- package/dist/check/project/load-project.js.map +1 -1
- package/dist/check/project/not-in-the-tree.d.ts +10 -0
- package/dist/check/project/not-in-the-tree.d.ts.map +1 -0
- package/dist/check/project/not-in-the-tree.js +17 -0
- package/dist/check/project/not-in-the-tree.js.map +1 -0
- package/dist/check/project/skipped-directories.d.ts +3 -0
- package/dist/check/project/skipped-directories.d.ts.map +1 -0
- package/dist/check/project/skipped-directories.js +3 -0
- package/dist/check/project/skipped-directories.js.map +1 -0
- package/dist/check/project/walk-directory.d.ts.map +1 -1
- package/dist/check/project/walk-directory.js +1 -1
- package/dist/check/project/walk-directory.js.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/aspects-timeout-covers-delegate.d.ts +3 -0
- package/dist/check/rules/aspects-timeout-covers-delegate.d.ts.map +1 -0
- package/dist/check/rules/aspects-timeout-covers-delegate.js +179 -0
- package/dist/check/rules/aspects-timeout-covers-delegate.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/files-upload-content-rule.d.ts +3 -0
- package/dist/check/rules/files-upload-content-rule.d.ts.map +1 -0
- package/dist/check/rules/files-upload-content-rule.js +25 -0
- package/dist/check/rules/files-upload-content-rule.js.map +1 -0
- package/dist/check/rules/imports-alias-declared.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-declared.js +3 -1
- package/dist/check/rules/imports-alias-declared.js.map +1 -1
- package/dist/check/rules/imports-alias-only.d.ts.map +1 -1
- package/dist/check/rules/imports-alias-only.js +86 -7
- package/dist/check/rules/imports-alias-only.js.map +1 -1
- package/dist/check/rules/module-no-cycle.d.ts.map +1 -1
- package/dist/check/rules/module-no-cycle.js +12 -34
- package/dist/check/rules/module-no-cycle.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/cli-error.d.ts +7 -2
- package/dist/cli-error.d.ts.map +1 -1
- package/dist/cli-error.js +8 -2
- package/dist/cli-error.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +4 -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/knex-generate.d.ts.map +1 -1
- package/dist/commands/knex-generate.js +2 -1
- package/dist/commands/knex-generate.js.map +1 -1
- package/dist/commands/move-to-module.d.ts +6 -1
- package/dist/commands/move-to-module.d.ts.map +1 -1
- package/dist/commands/move-to-module.js +28 -3
- package/dist/commands/move-to-module.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/commands/prisma-generate.d.ts.map +1 -1
- package/dist/commands/prisma-generate.js +2 -1
- package/dist/commands/prisma-generate.js.map +1 -1
- package/dist/commands/typeorm-generate.d.ts.map +1 -1
- package/dist/commands/typeorm-generate.js +2 -1
- package/dist/commands/typeorm-generate.js.map +1 -1
- package/dist/commands/verify-merge.d.ts +4 -2
- package/dist/commands/verify-merge.d.ts.map +1 -1
- package/dist/commands/verify-merge.js +8 -5
- package/dist/commands/verify-merge.js.map +1 -1
- package/dist/generate/generate-options.d.ts +3 -0
- package/dist/generate/generate-options.d.ts.map +1 -1
- package/dist/generate/generate-options.js +1 -0
- package/dist/generate/generate-options.js.map +1 -1
- package/dist/generate/kind.d.ts +2 -0
- package/dist/generate/kind.d.ts.map +1 -1
- package/dist/generate/kinds/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/file-upload/upload-file-vars.d.ts +9 -0
- package/dist/generate/kinds/file-upload/upload-file-vars.d.ts.map +1 -0
- package/dist/generate/kinds/file-upload/upload-file-vars.js +39 -0
- package/dist/generate/kinds/file-upload/upload-file-vars.js.map +1 -0
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js +2 -1
- package/dist/generate/kinds/file-upload/write-nest-upload-controller.js.map +1 -1
- package/dist/generate/kinds/file-upload/write-upload-controller.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload/write-upload-controller.js +2 -1
- package/dist/generate/kinds/file-upload/write-upload-controller.js.map +1 -1
- package/dist/generate/kinds/file-upload-kind.d.ts.map +1 -1
- package/dist/generate/kinds/file-upload-kind.js +5 -3
- package/dist/generate/kinds/file-upload-kind.js.map +1 -1
- package/dist/generate/kinds/read-model/list-read-model.d.ts +12 -0
- package/dist/generate/kinds/read-model/list-read-model.d.ts.map +1 -0
- package/dist/generate/kinds/read-model/list-read-model.js +24 -0
- package/dist/generate/kinds/read-model/list-read-model.js.map +1 -0
- package/dist/generate/kinds/read-model-kind.d.ts.map +1 -1
- package/dist/generate/kinds/read-model-kind.js +25 -1
- 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/generate/kinds/service-kind.d.ts.map +1 -1
- package/dist/generate/kinds/service-kind.js +8 -0
- package/dist/generate/kinds/service-kind.js.map +1 -1
- package/dist/generate/kinds/wire-context.d.ts.map +1 -1
- package/dist/generate/kinds/wire-context.js +4 -0
- package/dist/generate/kinds/wire-context.js.map +1 -1
- package/dist/generate/shared-writes.d.ts.map +1 -1
- package/dist/generate/shared-writes.js +3 -2
- package/dist/generate/shared-writes.js.map +1 -1
- 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 +17 -1
- package/dist/help/tool-notes.js.map +1 -1
- package/dist/help/usage.d.ts.map +1 -1
- package/dist/help/usage.js +2 -1
- package/dist/help/usage.js.map +1 -1
- package/dist/help/work-notes.d.ts.map +1 -1
- package/dist/help/work-notes.js +15 -5
- 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/files/end-to-end-files.d.ts.map +1 -1
- package/dist/init/files/end-to-end-files.js +3 -0
- package/dist/init/files/end-to-end-files.js.map +1 -1
- package/dist/init/files/persistence-files.d.ts.map +1 -1
- package/dist/init/files/persistence-files.js +8 -2
- package/dist/init/files/persistence-files.js.map +1 -1
- package/dist/init/files/script-files.d.ts +2 -1
- package/dist/init/files/script-files.d.ts.map +1 -1
- package/dist/init/files/script-files.js +6 -1
- package/dist/init/files/script-files.js.map +1 -1
- package/dist/init/is-team-file.d.ts +2 -2
- package/dist/init/is-team-file.d.ts.map +1 -1
- package/dist/init/is-team-file.js +5 -4
- package/dist/init/is-team-file.js.map +1 -1
- 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 +20 -0
- package/dist/init/list-read-models.d.ts.map +1 -0
- package/dist/init/list-read-models.js +74 -0
- package/dist/init/list-read-models.js.map +1 -0
- package/dist/init/manifest/database-scripts.d.ts.map +1 -1
- package/dist/init/manifest/database-scripts.js +8 -0
- package/dist/init/manifest/database-scripts.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 +4 -2
- package/dist/init/rewire-contexts.d.ts.map +1 -1
- package/dist/init/rewire-contexts.js +12 -2
- 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 +4 -8
- 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/init/wiring-notes.js +1 -1
- package/dist/init/wiring-notes.js.map +1 -1
- package/dist/init/write-type-script-configs.d.ts +3 -1
- package/dist/init/write-type-script-configs.d.ts.map +1 -1
- package/dist/init/write-type-script-configs.js +14 -2
- package/dist/init/write-type-script-configs.js.map +1 -1
- 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/format-merge-report.js +5 -2
- package/dist/merge/format-merge-report.js.map +1 -1
- package/dist/merge/land-drizzle.d.ts +4 -0
- package/dist/merge/land-drizzle.d.ts.map +1 -1
- package/dist/merge/land-drizzle.js +6 -1
- package/dist/merge/land-drizzle.js.map +1 -1
- package/dist/merge/land-up-to-date.d.ts +15 -0
- package/dist/merge/land-up-to-date.d.ts.map +1 -0
- package/dist/merge/land-up-to-date.js +76 -0
- package/dist/merge/land-up-to-date.js.map +1 -0
- 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/format-merge-verification.d.ts +2 -1
- package/dist/merge/lost/format-merge-verification.d.ts.map +1 -1
- package/dist/merge/lost/format-merge-verification.js +13 -2
- package/dist/merge/lost/format-merge-verification.js.map +1 -1
- 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/merge-verification.d.ts +4 -0
- package/dist/merge/lost/merge-verification.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/lost/verify-merges.d.ts +2 -1
- package/dist/merge/lost/verify-merges.d.ts.map +1 -1
- package/dist/merge/lost/verify-merges.js +10 -4
- package/dist/merge/lost/verify-merges.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 +2 -1
- package/dist/merge/merge-trunk.d.ts.map +1 -1
- package/dist/merge/merge-trunk.js +8 -3
- 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/next-steps.d.ts +3 -0
- package/dist/merge/next-steps.d.ts.map +1 -1
- package/dist/merge/next-steps.js +3 -0
- package/dist/merge/next-steps.js.map +1 -1
- package/dist/merge/order/applied-under-old-name.d.ts +13 -0
- package/dist/merge/order/applied-under-old-name.d.ts.map +1 -0
- package/dist/merge/order/applied-under-old-name.js +14 -0
- package/dist/merge/order/applied-under-old-name.js.map +1 -0
- package/dist/merge/order/comes-after.d.ts +8 -0
- package/dist/merge/order/comes-after.d.ts.map +1 -0
- package/dist/merge/order/comes-after.js +9 -0
- package/dist/merge/order/comes-after.js.map +1 -0
- package/dist/merge/order/drizzle-order.d.ts +11 -0
- package/dist/merge/order/drizzle-order.d.ts.map +1 -0
- package/dist/merge/order/drizzle-order.js +64 -0
- package/dist/merge/order/drizzle-order.js.map +1 -0
- package/dist/merge/order/in-order.d.ts +4 -0
- package/dist/merge/order/in-order.d.ts.map +1 -0
- package/dist/merge/order/in-order.js +6 -0
- package/dist/merge/order/in-order.js.map +1 -0
- package/dist/merge/order/migration-order-finding.d.ts +18 -0
- package/dist/merge/order/migration-order-finding.d.ts.map +1 -0
- package/dist/merge/order/migration-order-finding.js +2 -0
- package/dist/merge/order/migration-order-finding.js.map +1 -0
- package/dist/merge/order/migration-order.d.ts +12 -0
- package/dist/merge/order/migration-order.d.ts.map +1 -0
- package/dist/merge/order/migration-order.js +21 -0
- package/dist/merge/order/migration-order.js.map +1 -0
- package/dist/merge/order/migrations-of-commit.d.ts +7 -0
- package/dist/merge/order/migrations-of-commit.d.ts.map +1 -0
- package/dist/merge/order/migrations-of-commit.js +43 -0
- package/dist/merge/order/migrations-of-commit.js.map +1 -0
- package/dist/merge/order/migrations-of-tree.d.ts +9 -0
- package/dist/merge/order/migrations-of-tree.d.ts.map +1 -0
- package/dist/merge/order/migrations-of-tree.js +25 -0
- package/dist/merge/order/migrations-of-tree.js.map +1 -0
- package/dist/merge/order/named-order.d.ts +11 -0
- package/dist/merge/order/named-order.d.ts.map +1 -0
- package/dist/merge/order/named-order.js +36 -0
- package/dist/merge/order/named-order.js.map +1 -0
- package/dist/merge/order/ordered-migration.d.ts +12 -0
- package/dist/merge/order/ordered-migration.d.ts.map +1 -0
- package/dist/merge/order/ordered-migration.js +2 -0
- package/dist/merge/order/ordered-migration.js.map +1 -0
- package/dist/merge/order/trunk-to-follow.d.ts +9 -0
- package/dist/merge/order/trunk-to-follow.d.ts.map +1 -0
- package/dist/merge/order/trunk-to-follow.js +2 -0
- package/dist/merge/order/trunk-to-follow.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/renumber-migrations.d.ts +14 -5
- package/dist/merge/renumber-migrations.d.ts.map +1 -1
- package/dist/merge/renumber-migrations.js +141 -60
- package/dist/merge/renumber-migrations.js.map +1 -1
- package/dist/merge/restamp-class.d.ts +9 -0
- package/dist/merge/restamp-class.d.ts.map +1 -0
- package/dist/merge/restamp-class.js +30 -0
- package/dist/merge/restamp-class.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 +3 -0
- package/dist/migration/index.d.ts.map +1 -1
- package/dist/migration/index.js +3 -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/plan-replay.d.ts.map +1 -1
- package/dist/migration/plan-replay.js +2 -1
- package/dist/migration/plan-replay.js.map +1 -1
- package/dist/migration/refuse-taken-migration-name.d.ts +8 -0
- package/dist/migration/refuse-taken-migration-name.d.ts.map +1 -0
- package/dist/migration/refuse-taken-migration-name.js +22 -0
- package/dist/migration/refuse-taken-migration-name.js.map +1 -0
- package/dist/migration/replay-drizzle-migrations.d.ts +5 -0
- package/dist/migration/replay-drizzle-migrations.d.ts.map +1 -1
- package/dist/migration/replay-drizzle-migrations.js +10 -2
- package/dist/migration/replay-drizzle-migrations.js.map +1 -1
- package/dist/migration/replay-plan.d.ts +2 -2
- package/dist/migration/replay-plan.d.ts.map +1 -1
- package/dist/migration/restore-migration-folder.d.ts +6 -2
- package/dist/migration/restore-migration-folder.d.ts.map +1 -1
- package/dist/migration/restore-migration-folder.js +14 -7
- package/dist/migration/restore-migration-folder.js.map +1 -1
- package/dist/migration/snapshot-migration-folder.d.ts +7 -0
- package/dist/migration/snapshot-migration-folder.d.ts.map +1 -0
- package/dist/migration/snapshot-migration-folder.js +12 -0
- package/dist/migration/snapshot-migration-folder.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/move-to-module/before-the-move.d.ts +5 -0
- package/dist/move-to-module/before-the-move.d.ts.map +1 -0
- package/dist/move-to-module/before-the-move.js +13 -0
- package/dist/move-to-module/before-the-move.js.map +1 -0
- package/dist/move-to-module/closed-cycles.d.ts +21 -0
- package/dist/move-to-module/closed-cycles.d.ts.map +1 -0
- package/dist/move-to-module/closed-cycles.js +66 -0
- package/dist/move-to-module/closed-cycles.js.map +1 -0
- package/dist/move-to-module/cycle-lines.d.ts +7 -0
- package/dist/move-to-module/cycle-lines.d.ts.map +1 -0
- package/dist/move-to-module/cycle-lines.js +22 -0
- package/dist/move-to-module/cycle-lines.js.map +1 -0
- package/dist/move-to-module/cycle-refusal.d.ts +17 -0
- package/dist/move-to-module/cycle-refusal.d.ts.map +1 -0
- package/dist/move-to-module/cycle-refusal.js +25 -0
- package/dist/move-to-module/cycle-refusal.js.map +1 -0
- package/dist/move-to-module/index.d.ts +5 -0
- package/dist/move-to-module/index.d.ts.map +1 -1
- package/dist/move-to-module/index.js +4 -0
- package/dist/move-to-module/index.js.map +1 -1
- package/dist/move-to-module/module-imports-in.d.ts +11 -0
- package/dist/move-to-module/module-imports-in.d.ts.map +1 -0
- package/dist/move-to-module/module-imports-in.js +32 -0
- package/dist/move-to-module/module-imports-in.js.map +1 -0
- package/dist/move-to-module/moves-into-module.d.ts.map +1 -1
- package/dist/move-to-module/moves-into-module.js +6 -18
- package/dist/move-to-module/moves-into-module.js.map +1 -1
- package/dist/move-to-module/place-in-module.d.ts +13 -0
- package/dist/move-to-module/place-in-module.d.ts.map +1 -0
- package/dist/move-to-module/place-in-module.js +24 -0
- package/dist/move-to-module/place-in-module.js.map +1 -0
- package/dist/move-to-module/watch-cycles.d.ts +19 -0
- package/dist/move-to-module/watch-cycles.d.ts.map +1 -0
- package/dist/move-to-module/watch-cycles.js +51 -0
- package/dist/move-to-module/watch-cycles.js.map +1 -0
- 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 +3 -1
- package/dist/run.js.map +1 -1
- package/dist/slice/format-slice-verification.d.ts.map +1 -1
- package/dist/slice/format-slice-verification.js +11 -5
- package/dist/slice/format-slice-verification.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/alias-vars.d.ts +3 -1
- package/dist/stack/alias-vars.d.ts.map +1 -1
- package/dist/stack/alias-vars.js +5 -2
- package/dist/stack/alias-vars.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/file-upload/controller.spec.ts.tpl +66 -2
- package/templates/file-upload/controller.ts.tpl +12 -0
- package/templates/file-upload/handler.spec.ts.tpl +3 -3
- package/templates/init/README.md.tpl +20 -1
- package/templates/init/docker/dockerignore.tpl +2 -0
- package/templates/init/e2e/jest.e2e.config.js.tpl +5 -0
- package/templates/init/e2e/test-database-setup.ts.tpl +120 -0
- package/templates/init/e2e/vitest.e2e.config.ts.tpl +2 -1
- package/templates/init/platform/composition/compose-application.container.ts.tpl +5 -0
- package/templates/init/platform/composition/compose-application.manual.ts.tpl +20 -3
- package/templates/init/platform/composition/create-platform.manual.ts.tpl +6 -0
- package/templates/init/platform/composition/platform-options.manual.ts.tpl +11 -0
- package/templates/init/platform/composition/platform.manual.ts.tpl +7 -0
- package/templates/init/platform/composition/platform.module.container.ts.tpl +34 -0
- package/templates/init/platform/database/connect-to-database.drizzle.ts.tpl +7 -2
- package/templates/init/platform/database/open-test-database.drizzle.ts.tpl +8 -3
- package/templates/init/platform/database/open-test-database.knex.ts.tpl +8 -3
- package/templates/init/platform/database/open-test-database.prisma.ts.tpl +8 -3
- package/templates/init/platform/database/open-test-database.typeorm.ts.tpl +8 -3
- package/templates/init/platform/database/read-model-tables.ts.tpl +70 -0
- package/templates/init/platform/database/test-database-budget.ts.tpl +108 -0
- package/templates/init/platform/database/test-database-clone.ts.tpl +52 -161
- package/templates/init/platform/database/test-database-copy.ts.tpl +76 -0
- package/templates/init/platform/database/test-database-emptying.ts.tpl +209 -0
- package/templates/init/platform/database/test-database-kept.ts.tpl +32 -0
- package/templates/init/platform/database/test-database-leftovers.ts.tpl +52 -0
- package/templates/init/platform/database/test-database-run.ts.tpl +99 -0
- package/templates/init/platform/database/test-database-server.ts.tpl +140 -0
- package/templates/init/platform/database/test-database-session.ts.tpl +141 -0
- package/templates/init/platform/database/test-database-teardown.ts.tpl +11 -1
- package/templates/init/platform/resilience/default-policy.ts.tpl +8 -1
- package/templates/init/rules/infrastructure.md.tpl +5 -2
- package/templates/init/scripts/read-model-tables.ts.tpl +83 -0
- package/templates/nest-controller/upload.spec.ts.tpl +67 -2
- package/templates/nest-controller/upload.ts.tpl +12 -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/presets/identity/context/infrastructure/persistence/drizzle-account.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-delegation.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-invitation.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-member.repository.drizzle.ts.tpl +5 -9
- package/templates/presets/identity/context/infrastructure/persistence/drizzle-organisation.repository.drizzle.ts.tpl +5 -9
- package/templates/repository/drizzle/repository.ts.tpl +6 -9
- package/templates/repository/typeorm/schema-export.tpl +2 -2
- package/templates/read-model/typeorm/schema-export.tpl +0 -4
|
@@ -30,6 +30,9 @@ export interface TestDatabase {
|
|
|
30
30
|
* no migration run. With a URL, the tests run on that server instead, each call on a copy of the
|
|
31
31
|
* database the URL names, which must already be migrated (`npm run db:migrate`); the migrations
|
|
32
32
|
* remain what production applies.
|
|
33
|
+
* The copy holds the tables and no row, but for the tables test/support/test-database-kept.ts
|
|
34
|
+
* lists: an end-to-end run makes it from the template of its global setup, any other caller
|
|
35
|
+
* copies the migrated database itself.
|
|
33
36
|
*/
|
|
34
37
|
export function openTestDatabase(url?: string): Promise<TestDatabase> {
|
|
35
38
|
return url === undefined ? openInProcess() : openServer(url);
|
|
@@ -64,12 +67,14 @@ async function inProcessPostgres(): Promise<PGlite> {
|
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
/**
|
|
67
|
-
* A database of its own on the server,
|
|
68
|
-
*
|
|
70
|
+
* A database of its own on the server, dropped at close (test/support/test-database-clone.ts): the
|
|
71
|
+
* tables of the migrated one, emptied but for those test/support/test-database-kept.ts lists. No
|
|
72
|
+
* other file, and no other run, reads or empties its rows. Its pool is the share this file has of
|
|
73
|
+
* the connections of the server.
|
|
69
74
|
*/
|
|
70
75
|
async function openServer(url: string): Promise<TestDatabase> {
|
|
71
76
|
const clone = await cloneDatabase(url);
|
|
72
|
-
const connection = connectToDatabase(clone.url);
|
|
77
|
+
const connection = connectToDatabase(clone.url, { poolSize: clone.poolSize });
|
|
73
78
|
const statements = new TableStatements();
|
|
74
79
|
|
|
75
80
|
return {
|
|
@@ -34,6 +34,9 @@ export interface TestDatabase {
|
|
|
34
34
|
* ./schema.ts: adapter and end-to-end specs need no container. With a URL, the tests run on
|
|
35
35
|
* that server instead, each call on a copy of the database the URL names, which must already be
|
|
36
36
|
* migrated (`npm run db:migrate`).
|
|
37
|
+
* The copy holds the tables and no row, but for the tables test/support/test-database-kept.ts
|
|
38
|
+
* lists: an end-to-end run makes it from the template of its global setup, any other caller
|
|
39
|
+
* copies the migrated database itself.
|
|
37
40
|
*/
|
|
38
41
|
export function openTestDatabase(url?: string): Promise<TestDatabase> {
|
|
39
42
|
return url === undefined ? openInProcess() : openServer(url);
|
|
@@ -73,12 +76,14 @@ async function inProcessPostgres(): Promise<PGlite> {
|
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
/**
|
|
76
|
-
* A database of its own on the server,
|
|
77
|
-
*
|
|
79
|
+
* A database of its own on the server, dropped at close (test/support/test-database-clone.ts): the
|
|
80
|
+
* tables of the migrated one, emptied but for those test/support/test-database-kept.ts lists. No
|
|
81
|
+
* other file, and no other run, reads or empties its rows. Its pool is the share this file has of
|
|
82
|
+
* the connections of the server.
|
|
78
83
|
*/
|
|
79
84
|
async function openServer(url: string): Promise<TestDatabase> {
|
|
80
85
|
const clone = await cloneDatabase(url);
|
|
81
|
-
const connection = connectToDatabase(clone.url);
|
|
86
|
+
const connection = connectToDatabase(clone.url, { poolSize: clone.poolSize });
|
|
82
87
|
|
|
83
88
|
return {
|
|
84
89
|
url: clone.url,
|
|
@@ -34,6 +34,9 @@ export interface TestDatabase {
|
|
|
34
34
|
* and end-to-end specs need no container. With a URL, the tests run on that server instead,
|
|
35
35
|
* each call on a copy of the database the URL names, which must already be migrated
|
|
36
36
|
* (`npm run db:migrate`).
|
|
37
|
+
* The copy holds the tables and no row, but for the tables test/support/test-database-kept.ts
|
|
38
|
+
* lists: an end-to-end run makes it from the template of its global setup, any other caller
|
|
39
|
+
* copies the migrated database itself.
|
|
37
40
|
*/
|
|
38
41
|
export function openTestDatabase(url?: string): Promise<TestDatabase> {
|
|
39
42
|
return url === undefined ? openInProcess() : openServer(url);
|
|
@@ -73,12 +76,14 @@ async function inProcessPostgres(): Promise<PGlite> {
|
|
|
73
76
|
}
|
|
74
77
|
|
|
75
78
|
/**
|
|
76
|
-
* A database of its own on the server,
|
|
77
|
-
*
|
|
79
|
+
* A database of its own on the server, dropped at close (test/support/test-database-clone.ts): the
|
|
80
|
+
* tables of the migrated one, emptied but for those test/support/test-database-kept.ts lists. No
|
|
81
|
+
* other file, and no other run, reads or empties its rows. Its pool is the share this file has of
|
|
82
|
+
* the connections of the server.
|
|
78
83
|
*/
|
|
79
84
|
async function openServer(url: string): Promise<TestDatabase> {
|
|
80
85
|
const clone = await cloneDatabase(url);
|
|
81
|
-
const client = createClient(clone.url);
|
|
86
|
+
const client = createClient(clone.url, { poolSize: clone.poolSize });
|
|
82
87
|
|
|
83
88
|
const close = async (): Promise<void> => {
|
|
84
89
|
await client.$disconnect();
|
|
@@ -34,6 +34,9 @@ export interface TestDatabase {
|
|
|
34
34
|
* created from the entity schemas: adapter and end-to-end specs need no container. With a URL,
|
|
35
35
|
* the tests run on that server instead, each call on a copy of the database the URL names, which
|
|
36
36
|
* must already be migrated (`npm run db:migrate`).
|
|
37
|
+
* The copy holds the tables and no row, but for the tables test/support/test-database-kept.ts
|
|
38
|
+
* lists: an end-to-end run makes it from the template of its global setup, any other caller
|
|
39
|
+
* copies the migrated database itself.
|
|
37
40
|
*/
|
|
38
41
|
export function openTestDatabase(url?: string): Promise<TestDatabase> {
|
|
39
42
|
return url === undefined ? openInProcess() : openServer(url);
|
|
@@ -76,12 +79,14 @@ async function inProcessPostgres(): Promise<PGlite> {
|
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
/**
|
|
79
|
-
* A database of its own on the server,
|
|
80
|
-
*
|
|
82
|
+
* A database of its own on the server, dropped at close (test/support/test-database-clone.ts): the
|
|
83
|
+
* tables of the migrated one, emptied but for those test/support/test-database-kept.ts lists. No
|
|
84
|
+
* other file, and no other run, reads or empties its rows. Its pool is the share this file has of
|
|
85
|
+
* the connections of the server.
|
|
81
86
|
*/
|
|
82
87
|
async function openServer(url: string): Promise<TestDatabase> {
|
|
83
88
|
const clone = await cloneDatabase(url);
|
|
84
|
-
const dataSource = createDataSource(clone.url);
|
|
89
|
+
const dataSource = createDataSource(clone.url, { poolSize: clone.poolSize });
|
|
85
90
|
|
|
86
91
|
await dataSource.initialize();
|
|
87
92
|
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AsyncLocalStorageExecutionScope,
|
|
3
|
+
ReadModelTables,
|
|
4
|
+
type ExecutionScope,
|
|
5
|
+
type ReadModelInATable,
|
|
6
|
+
} from '@ddd-ts-kit/kernel';
|
|
7
|
+
import type { Persistence } from '{{alias.platform}}/database/persistence{{alias.ext}}';
|
|
8
|
+
// ddd-ts-kit:imports
|
|
9
|
+
// /ddd-ts-kit:imports
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The class of a read model store, built as the application binds it: on the storage, with the
|
|
13
|
+
* scope of the work when it keeps tenant data.
|
|
14
|
+
*/
|
|
15
|
+
type Store = new (database: Persistence['database'], scope: ExecutionScope) => ReadModelInATable;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The bounded contexts of the project: `generate context` adds each. An entry of the list names
|
|
19
|
+
* one of them, or does not compile.
|
|
20
|
+
*/
|
|
21
|
+
type Contexts = [
|
|
22
|
+
// ddd-ts-kit:contexts
|
|
23
|
+
// /ddd-ts-kit:contexts
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The read models the application keeps in a table: the context each belongs to and the class of
|
|
28
|
+
* its store. `generate read-model` adds its store here, and `init` those it finds in the tree; a
|
|
29
|
+
* store written by hand is added by hand, or `ddd-ts-kit check` reports it
|
|
30
|
+
* (`persistence/read-model-listed`). A table that is not listed is never read. A store left
|
|
31
|
+
* out on purpose is a comment between the two markers below that holds `<context>: <Store>` and
|
|
32
|
+
* the reason: `init` then leaves it out, and the check says nothing of it. `init --force` keeps
|
|
33
|
+
* what the markers of this file hold and nothing else: a comment, or a class, written anywhere
|
|
34
|
+
* else is lost, and such a comment leaves nothing out.
|
|
35
|
+
*/
|
|
36
|
+
const LISTED: readonly (readonly [context: Contexts[number], store: Store])[] = [
|
|
37
|
+
// ddd-ts-kit:read-model-tables
|
|
38
|
+
// /ddd-ts-kit:read-model-tables
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The read model stores of the tree `init` could not list, `<context>: <Store>`, since their
|
|
43
|
+
* constructor takes something else: the check says at each start that nothing checks their
|
|
44
|
+
* tables, until each is listed through a class that builds it, written beside the store.
|
|
45
|
+
*/
|
|
46
|
+
const NOT_LISTED: readonly string[] = [
|
|
47
|
+
// ddd-ts-kit:read-models-not-listed
|
|
48
|
+
// /ddd-ts-kit:read-models-not-listed
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The listed tables of these contexts, every context when none is named, checked in one pass:
|
|
53
|
+
* each is read by its own store, with the code that store runs before its first trace, so the
|
|
54
|
+
* verdict is the store's and the migration of a table that is not ready names the columns the
|
|
55
|
+
* store maps and no other. An application asks it when it starts, of the contexts it hosts: a
|
|
56
|
+
* context run as a service of its own checks its tables, on its database, and no other.
|
|
57
|
+
* `npm run db:read-models` asks it of the database a deployment is about to reach. The scope a
|
|
58
|
+
* store of tenant data is given is never read by the check.
|
|
59
|
+
*/
|
|
60
|
+
export function readModelTables(persistence: Persistence, contexts?: readonly string[]): ReadModelTables {
|
|
61
|
+
const scope = new AsyncLocalStorageExecutionScope();
|
|
62
|
+
|
|
63
|
+
const listed = LISTED.map(([context, Store]) => ({
|
|
64
|
+
context,
|
|
65
|
+
name: Store.name,
|
|
66
|
+
build: () => new Store(persistence.database, scope),
|
|
67
|
+
}));
|
|
68
|
+
|
|
69
|
+
return new ReadModelTables(listed, NOT_LISTED).hosting(contexts);
|
|
70
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type pg from 'pg';
|
|
2
|
+
|
|
3
|
+
/** Stated by whoever starts the run: the connections it may take, when that is less than what the server has left. */
|
|
4
|
+
const STATED = 'TEST_DATABASE_CONNECTIONS';
|
|
5
|
+
/** The pool an application opens when nothing bounds it, and the one under which a request that waits for another never ends. */
|
|
6
|
+
const LARGEST_POOL = 10;
|
|
7
|
+
const SMALLEST_POOL = 2;
|
|
8
|
+
/** Beside its pool a file has one connection to spare: the one that copies and drops its database, a client a spec opens itself. */
|
|
9
|
+
const SPARE = 1;
|
|
10
|
+
|
|
11
|
+
/** One thing that bounds the connections of a run. */
|
|
12
|
+
interface Bound {
|
|
13
|
+
readonly left: number;
|
|
14
|
+
/** How a refusal says it. */
|
|
15
|
+
readonly counted: string;
|
|
16
|
+
/** What raises it. */
|
|
17
|
+
readonly remedy: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type Counts = Record<'max' | 'reserved' | 'open' | 'limit' | 'openOfRole', number> & { readonly role: string };
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The pool of each file of a run in which `atOnce` files run at the same time: what the tightest
|
|
24
|
+
* bound leaves, shared between them, less the connection each has to spare, 10 at most. A run that
|
|
25
|
+
* does not fit is refused here with its numbers and what raises that bound, before any file
|
|
26
|
+
* starts, instead of `too many clients` from the driver in the middle of a spec. The count is
|
|
27
|
+
* taken once, on the session `server` of the run, itself among the connections open: a run that
|
|
28
|
+
* starts later sees what this one has open, not what it will open.
|
|
29
|
+
*/
|
|
30
|
+
export async function poolSizeFor(server: pg.Client, atOnce: number): Promise<number> {
|
|
31
|
+
const { left, counted, remedy } = tightest(await bounds(server));
|
|
32
|
+
const each = SMALLEST_POOL + SPARE;
|
|
33
|
+
const fitting = Math.floor(left / each);
|
|
34
|
+
const fewer = fitting > 0 ? `run at most ${fitting} at once (npm run test:e2e -- --maxWorkers=${fitting}), or ` : '';
|
|
35
|
+
|
|
36
|
+
if (fitting < atOnce) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`${atOnce} spec files at once need ${atOnce * each} connections (${SMALLEST_POOL} for each application at least and ${SPARE} to spare), and ${counted}: ${fewer}${remedy}.`,
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return Math.min(LARGEST_POOL, Math.floor(left / atOnce) - SPARE);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function tightest(all: readonly Bound[]): Bound {
|
|
46
|
+
return all.reduce((least, bound) => (bound.left < least.left ? bound : least));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The server, the role when it has a limit of its own, and what TEST_DATABASE_CONNECTIONS states. */
|
|
50
|
+
async function bounds(server: pg.Client): Promise<Bound[]> {
|
|
51
|
+
const { rows } = await server.query<Counts>(
|
|
52
|
+
`select current_setting('max_connections')::int as max,
|
|
53
|
+
current_setting('superuser_reserved_connections')::int + coalesce(current_setting('reserved_connections', true)::int, 0) as reserved,
|
|
54
|
+
(select count(*)::int from pg_stat_activity where usesysid is not null and coalesce(backend_type, 'client backend') = 'client backend') as "open",
|
|
55
|
+
(select case when rolsuper then -1 else rolconnlimit end from pg_roles where rolname = current_user) as "limit",
|
|
56
|
+
(select count(*)::int from pg_stat_activity where usename = current_user) as "openOfRole",
|
|
57
|
+
current_user::text as "role"`,
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
const [counts = { max: 0, reserved: 0, open: 0, limit: -1, openOfRole: 0, role: '' }] = rows;
|
|
61
|
+
const ofTheServer = [boundOfTheServer(counts), ...(counts.limit < 0 ? [] : [boundOfTheRole(counts)])];
|
|
62
|
+
|
|
63
|
+
return [...ofTheServer, ...stated(tightest(ofTheServer))];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function boundOfTheServer({ max, reserved, open }: Counts): Bound {
|
|
67
|
+
return {
|
|
68
|
+
left: max - reserved - open,
|
|
69
|
+
counted: `the server leaves ${max - reserved - open} (max_connections ${max}, ${reserved} reserved, ${open} open)`,
|
|
70
|
+
remedy: 'raise max_connections',
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function boundOfTheRole({ role, limit, openOfRole }: Counts): Bound {
|
|
75
|
+
return {
|
|
76
|
+
left: limit - openOfRole,
|
|
77
|
+
counted: `the role ${role} has ${limit - openOfRole} left (connection limit ${limit}, ${openOfRole} open)`,
|
|
78
|
+
remedy: `raise the limit of the role (alter role ${role} connection limit <more>)`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** What the variable states, when it is set: a whole number of connections, no more than the server leaves. */
|
|
83
|
+
function stated(ofTheServer: Bound): Bound[] {
|
|
84
|
+
const text = process.env[STATED] ?? '';
|
|
85
|
+
const connections = Number(text);
|
|
86
|
+
|
|
87
|
+
if (text === '') {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (!Number.isInteger(connections) || connections < 1) {
|
|
92
|
+
throw new Error(`${STATED} is "${text}": state a whole number of connections, 1 or more, or leave it unset.`);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (connections > ofTheServer.left) {
|
|
96
|
+
throw new Error(
|
|
97
|
+
`${STATED} states ${connections} connections, and ${ofTheServer.counted}: state ${ofTheServer.left} at most, or leave it unset.`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return [
|
|
102
|
+
{
|
|
103
|
+
left: connections,
|
|
104
|
+
counted: `${STATED} allows ${connections}`,
|
|
105
|
+
remedy: `state more in ${STATED} (${ofTheServer.left} at most)`,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
}
|
|
@@ -1,184 +1,75 @@
|
|
|
1
1
|
import { randomBytes } from 'node:crypto';
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { openRun } from './test-database-run{{alias.sibling}}';
|
|
3
|
+
import {
|
|
4
|
+
codeOf,
|
|
5
|
+
copying,
|
|
6
|
+
dropping,
|
|
7
|
+
lostDatabases,
|
|
8
|
+
nameOf,
|
|
9
|
+
NO_SUCH_DATABASE,
|
|
10
|
+
oneAtATime,
|
|
11
|
+
onServer,
|
|
12
|
+
POOL_SIZE,
|
|
13
|
+
RUN_TEMPLATE,
|
|
14
|
+
runOf,
|
|
15
|
+
urlOf,
|
|
16
|
+
} from './test-database-server{{alias.sibling}}';
|
|
17
|
+
|
|
18
|
+
/** A database of its own for one caller, on the server it was given. */
|
|
5
19
|
export interface DatabaseClone {
|
|
6
20
|
readonly url: string;
|
|
7
21
|
|
|
22
|
+
/** The connections the application of the caller may open: its share of what the server has left, so that every file of a run fits. */
|
|
23
|
+
readonly poolSize: number;
|
|
24
|
+
|
|
8
25
|
/** Drops the database, whoever is still connected to it. */
|
|
9
26
|
drop(): Promise<void>;
|
|
10
27
|
}
|
|
11
28
|
|
|
12
|
-
/**
|
|
13
|
-
const
|
|
14
|
-
/** PostgreSQL keeps 63 bytes of a name: the migrated one is cut so that what follows it always fits. */
|
|
15
|
-
const KEPT_OF_THE_NAME = 38;
|
|
16
|
-
/** No spec file runs for an hour: a copy that old was left by a run that was killed. */
|
|
17
|
-
const LEFTOVER_AFTER_SECONDS = 3600;
|
|
18
|
-
/** The SQLSTATE of a server that refuses to copy a database other sessions are connected to. */
|
|
19
|
-
const OTHER_SESSIONS = '55006';
|
|
20
|
-
|
|
21
|
-
const REFUSALS: Readonly<Record<string, (database: string) => string>> = {
|
|
22
|
-
[OTHER_SESSIONS]: (database) =>
|
|
23
|
-
`The database "${database}" has other sessions (an application that runs, a console, a migration): PostgreSQL copies a database only while nobody else is connected to it. Close them, or give the tests a database of their own.`,
|
|
24
|
-
'42501': (database) =>
|
|
25
|
-
`The role of DATABASE_URL may not copy the database "${database}", and each spec file runs on a copy of it: the role creates databases (alter role <role> createdb) and owns that one (alter database "${database}" owner to <role>).`,
|
|
26
|
-
'3D000': (database) =>
|
|
27
|
-
`The server of DATABASE_URL has no database "${database}": create it, then migrate it (npm run db:migrate).`,
|
|
28
|
-
};
|
|
29
|
+
/** The pool of a file that is a run of its own: nothing shares the connections of the server between such runs, so each takes few. */
|
|
30
|
+
const POOL_OF_ITS_OWN = 4;
|
|
29
31
|
|
|
30
32
|
/**
|
|
31
|
-
* A
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
33
|
+
* A database of its own on the server `url` names: the tables of the migrated database and none
|
|
34
|
+
* of the rows a run empties (test-database-emptying.ts). In an end-to-end run the global setup
|
|
35
|
+
* copied and emptied the migrated database once (test-database-setup.ts), and this copies that
|
|
36
|
+
* template (`create database ... template`), one copy at a time in the run, in a fraction of a
|
|
37
|
+
* second whatever the migrated database holds. Anywhere else (a spec of the unit run, a project
|
|
38
|
+
* with no end-to-end run) nothing started a run: the call is a run of its own, which copies the
|
|
39
|
+
* migrated database itself, in the time that takes. Either way spec files run at the same time on
|
|
40
|
+
* one server and nothing one stores reaches another. The copy is dropped when its caller closes
|
|
41
|
+
* it, at the end of its run, or by a later run when its own was killed.
|
|
35
42
|
*/
|
|
36
43
|
export async function cloneDatabase(url: string): Promise<DatabaseClone> {
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
await onServer(url, async (server) => {
|
|
41
|
-
await dropLeftovers(server, database);
|
|
42
|
-
await copy(server, database, name);
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
const clone = { url: urlOf(url, name), drop: () => onServer(url, (server) => drop(server, name)) };
|
|
46
|
-
|
|
47
|
-
await refuseWithoutTable(clone, database);
|
|
48
|
-
|
|
49
|
-
return clone;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Runs `work` on a connection of its own to the maintenance database of the server, never to the
|
|
54
|
-
* migrated one: PostgreSQL refuses to copy a database another session is connected to, and the
|
|
55
|
-
* files that start together would be those sessions for one another.
|
|
56
|
-
*/
|
|
57
|
-
async function onServer(url: string, work: (server: pg.Client) => Promise<void>): Promise<void> {
|
|
58
|
-
const server = new pg.Client({ connectionString: urlOf(url, maintenanceDatabaseOf(url)) });
|
|
44
|
+
const template = process.env[RUN_TEMPLATE] ?? '';
|
|
45
|
+
const run = runOf(template, url);
|
|
59
46
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
try {
|
|
63
|
-
await work(server);
|
|
64
|
-
} finally {
|
|
65
|
-
await server.end();
|
|
47
|
+
if (run === undefined) {
|
|
48
|
+
return runOfItsOwn(url);
|
|
66
49
|
}
|
|
67
|
-
}
|
|
68
50
|
|
|
69
|
-
|
|
70
|
-
async function dropLeftovers(server: pg.Client, database: string): Promise<void> {
|
|
71
|
-
const { rows } = await server.query<{ datname: string }>('select datname from pg_database');
|
|
72
|
-
const oldest = secondsNow() - LEFTOVER_AFTER_SECONDS;
|
|
51
|
+
const name = nameOf(url, run, randomBytes(4).toString('hex'));
|
|
73
52
|
|
|
74
|
-
|
|
75
|
-
|
|
53
|
+
await onServer(url, (server) => oneAtATime(server, run, () => server.query(copying(template, name)))).catch(
|
|
54
|
+
(error: unknown) => {
|
|
55
|
+
throw codeOf(error) === NO_SUCH_DATABASE ? new Error(lostDatabases(template), { cause: error }) : error;
|
|
56
|
+
},
|
|
57
|
+
);
|
|
76
58
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
59
|
+
return {
|
|
60
|
+
url: urlOf(url, name),
|
|
61
|
+
poolSize: Number(process.env[POOL_SIZE]),
|
|
62
|
+
drop: () => onServer(url, (server) => server.query(dropping(name))),
|
|
63
|
+
};
|
|
82
64
|
}
|
|
83
65
|
|
|
84
66
|
/**
|
|
85
|
-
*
|
|
86
|
-
*
|
|
67
|
+
* The template of a run of one file is the database of that file. Nothing counts the files that
|
|
68
|
+
* do this at the same time, each one a run that sees the connections left when it starts: each
|
|
69
|
+
* takes a small pool, and the session of its lock.
|
|
87
70
|
*/
|
|
88
|
-
async function
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
try {
|
|
92
|
-
await server.query(statement).catch((error: unknown) => {
|
|
93
|
-
if (codeOf(error) !== OTHER_SESSIONS) {
|
|
94
|
-
throw error;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
return server.query(statement);
|
|
98
|
-
});
|
|
99
|
-
} catch (error) {
|
|
100
|
-
throw refusalOf(error, database);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
async function drop(server: pg.Client, name: string): Promise<void> {
|
|
105
|
-
await server.query('drop database if exists ' + quoted(name) + ' with (force)');
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/** A server nobody migrated answers `relation does not exist` at the first statement of a spec: said here, with the command. */
|
|
109
|
-
async function refuseWithoutTable(clone: DatabaseClone, database: string): Promise<void> {
|
|
110
|
-
const connection = new pg.Client({ connectionString: clone.url });
|
|
111
|
-
|
|
112
|
-
await connection.connect();
|
|
113
|
-
|
|
114
|
-
const { rows } = await connection.query(
|
|
115
|
-
"select 1 from information_schema.tables where table_schema not in ('pg_catalog', 'information_schema') limit 1",
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
await connection.end();
|
|
119
|
-
|
|
120
|
-
if (rows.length === 0) {
|
|
121
|
-
await clone.drop();
|
|
122
|
-
|
|
123
|
-
throw new Error(`The database "${database}" holds no table: migrate it first (npm run db:migrate).`);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
function refusalOf(error: unknown, database: string): unknown {
|
|
128
|
-
const refusal = REFUSALS[codeOf(error)];
|
|
129
|
-
|
|
130
|
-
return refusal === undefined ? error : new Error(refusal(database), { cause: error });
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** The SQLSTATE of an error of the server, empty for any other error. */
|
|
134
|
-
function codeOf(error: unknown): string {
|
|
135
|
-
const code: unknown = error instanceof Error ? Reflect.get(error, 'code') : undefined;
|
|
136
|
-
|
|
137
|
-
return typeof code === 'string' ? code : '';
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function copyName(database: string, seconds: number): string {
|
|
141
|
-
return prefixOf(database) + String(seconds) + '_' + randomBytes(4).toString('hex');
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
/** When the copy named `name` was made, in seconds; undefined for a database that is not a copy of `database`. */
|
|
145
|
-
function createdAt(name: string, database: string): number | undefined {
|
|
146
|
-
const prefix = prefixOf(database);
|
|
147
|
-
const [seconds, random, ...rest] = name.slice(prefix.length).split('_');
|
|
148
|
-
|
|
149
|
-
if (!name.startsWith(prefix) || seconds === undefined || random === undefined || rest.length > 0) {
|
|
150
|
-
return undefined;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
return /^\d{10}$/.test(seconds) && /^[0-9a-f]{8}$/.test(random) ? Number(seconds) : undefined;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
function prefixOf(database: string): string {
|
|
157
|
-
return database.slice(0, KEPT_OF_THE_NAME) + MARKER;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function secondsNow(): number {
|
|
161
|
-
return Math.floor(Date.now() / 1000);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function databaseOf(url: string): string {
|
|
165
|
-
return decodeURIComponent(new URL(url).pathname.slice(1));
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/** `postgres`, which every server has; `template1` when the migrated database is that one. */
|
|
169
|
-
function maintenanceDatabaseOf(url: string): string {
|
|
170
|
-
return databaseOf(url) === 'postgres' ? 'template1' : 'postgres';
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/** The same server, role and parameters, another database. */
|
|
174
|
-
function urlOf(url: string, database: string): string {
|
|
175
|
-
const address = new URL(url);
|
|
176
|
-
|
|
177
|
-
address.pathname = '/' + encodeURIComponent(database);
|
|
178
|
-
|
|
179
|
-
return address.toString();
|
|
180
|
-
}
|
|
71
|
+
async function runOfItsOwn(url: string): Promise<DatabaseClone> {
|
|
72
|
+
const run = await openRun(url, 1);
|
|
181
73
|
|
|
182
|
-
|
|
183
|
-
return '"' + name.replaceAll('"', '""') + '"';
|
|
74
|
+
return { url: urlOf(url, run.template), poolSize: Math.min(run.poolSize, POOL_OF_ITS_OWN), drop: run.end };
|
|
184
75
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { setTimeout as later } from 'node:timers/promises';
|
|
2
|
+
import type pg from 'pg';
|
|
3
|
+
import { codeOf, copying, databaseOf, dropping, oneAtATime, onServer } from './test-database-server{{alias.sibling}}';
|
|
4
|
+
|
|
5
|
+
/** The SQLSTATE of a server that refuses to copy a database other sessions are connected to. */
|
|
6
|
+
const OTHER_SESSIONS = '55006';
|
|
7
|
+
/** The SQLSTATE of a statement somebody cancelled: its session lives. */
|
|
8
|
+
const CANCELLED = '57014';
|
|
9
|
+
/** The SQLSTATE of a session that ended: the server stopped it (57P01 and its neighbours), the connection failed (class 08). */
|
|
10
|
+
const SESSION_ENDED = /^(?:57P|08)/;
|
|
11
|
+
|
|
12
|
+
const REFUSALS: Readonly<Record<string, (database: string) => string>> = {
|
|
13
|
+
[OTHER_SESSIONS]: (database) =>
|
|
14
|
+
`The database "${database}" has other sessions (an application that runs, a console, a migration): PostgreSQL copies a database only while nobody else is connected to it. Close them, or give the tests a database of their own.`,
|
|
15
|
+
'42501': (database) =>
|
|
16
|
+
`The role of DATABASE_URL may not copy the database "${database}", and each spec file runs on a copy of it: the role creates databases (alter role <role> createdb) and owns that one (alter database "${database}" owner to <role>).`,
|
|
17
|
+
'3D000': (database) =>
|
|
18
|
+
`The server of DATABASE_URL has no database "${database}": create it, then migrate it (npm run db:migrate).`,
|
|
19
|
+
// The sessions of a run set no timeout (test-database-server.ts): the statement was cancelled from outside, and is not taken again.
|
|
20
|
+
[CANCELLED]: (database) =>
|
|
21
|
+
`The copy of the database "${database}" was cancelled: the run sets no statement timeout on its own sessions, so somebody or a tool of the server cancelled the statement (pg_cancel_backend, a job that cancels the statements that last). Run again, or find what cancels it in the log of the server.`,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Copies the migrated database `url` names as `template`, one run at a time on the server: two
|
|
26
|
+
* copies at once slow each other. The copy has a session of its own, and a session can end while
|
|
27
|
+
* it works (the server restarts or fails over, an administrator ends it): what is left of the copy
|
|
28
|
+
* is then dropped and the copy made once more, on another session.
|
|
29
|
+
*/
|
|
30
|
+
export async function copied(url: string, template: string): Promise<void> {
|
|
31
|
+
const once = (): Promise<void> =>
|
|
32
|
+
onServer(url, (server) => oneAtATime(server, '0', () => copiedOn(server, databaseOf(url), template)));
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
await once().catch(async (error: unknown) => {
|
|
36
|
+
if (!sessionEnded(error)) {
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
await later(1000);
|
|
41
|
+
await onServer(url, (server) => server.query(dropping(template)));
|
|
42
|
+
await once();
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
throw notCopied(databaseOf(url), error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The client says it without a SQLSTATE, the server with one of class 08 or 57P: a cancelled statement (57014) is not an ended session. */
|
|
50
|
+
function sessionEnded(error: unknown): boolean {
|
|
51
|
+
return codeOf(error) === ''
|
|
52
|
+
? /connection|terminat|queryable/i.test(String(error))
|
|
53
|
+
: SESSION_ENDED.test(codeOf(error));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Another session on the migrated database makes the server wait 5 seconds for it to leave, then
|
|
58
|
+
* refuse: asked once more, since a migration or a console that was ending has ended by then.
|
|
59
|
+
*/
|
|
60
|
+
async function copiedOn(server: pg.Client, database: string, template: string): Promise<void> {
|
|
61
|
+
await server.query(copying(database, template)).catch((error: unknown) => {
|
|
62
|
+
if (codeOf(error) !== OTHER_SESSIONS) {
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return server.query(copying(database, template));
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function notCopied(database: string, error: unknown): unknown {
|
|
71
|
+
const refusal = REFUSALS[codeOf(error)]?.(database);
|
|
72
|
+
const twice = `The session that copied the database "${database}" ended twice before the copy did (${String(error)}): the server restarts, fails over, or ends the sessions of the run. Run again once it is steady.`;
|
|
73
|
+
const said = refusal ?? (sessionEnded(error) ? twice : undefined);
|
|
74
|
+
|
|
75
|
+
return said === undefined ? error : new Error(said, { cause: error });
|
|
76
|
+
}
|