@ykdz/template 0.1.0-experimental.1 → 0.2.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/dist/application.d.ts +18 -48
- package/dist/application.js +164 -111
- package/dist/input-schemas.d.ts +21 -44
- package/dist/input-schemas.js +46 -43
- package/dist/input-validation.js +3 -30
- package/dist/main.js +116 -218
- package/dist/preset-catalog.d.ts +410 -29
- package/dist/preset-catalog.js +4 -30
- package/dist/result-schemas.d.ts +146 -250
- package/dist/result-schemas.js +57 -59
- package/node_modules/@ykdz/default-content-authoring/dist/contracts.d.ts +240 -0
- package/node_modules/@ykdz/default-content-authoring/dist/environment-needs.d.ts +16 -0
- package/node_modules/@ykdz/default-content-authoring/dist/preset-root-contribution.d.ts +36 -0
- package/node_modules/@ykdz/default-content-authoring/dist/preset-root-contribution.js +1 -0
- package/node_modules/@ykdz/default-content-authoring/dist/reference-package.d.ts +65 -0
- package/node_modules/@ykdz/default-content-authoring/dist/reference-package.js +742 -0
- package/node_modules/@ykdz/default-content-authoring/package.json +59 -0
- package/node_modules/@ykdz/preset-rust-bin/native/package.json +2 -0
- package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts +2 -40
- package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-rust-bin/native/template-dist/definition.js +3 -2
- package/node_modules/@ykdz/preset-ts-cli/native/package.json +4 -0
- package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts +2 -15
- package/node_modules/@ykdz/preset-ts-cli/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-ts-lib/native/package.json +3 -0
- package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts +2 -15
- package/node_modules/@ykdz/preset-ts-lib/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-vike-app/native/package.json +3 -0
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts +40 -23
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/definition.js +19 -36
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts +54 -17
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-vike-app/native/template-dist/deployment.js +393 -207
- package/node_modules/@ykdz/preset-vike-app/package.json +2 -1
- package/node_modules/@ykdz/preset-vue-app/native/package.json +2 -0
- package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts +2 -15
- package/node_modules/@ykdz/preset-vue-app/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-vue-hono-app/native/package.json +4 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts +49 -23
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/definition.js +31 -102
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/joint-e2e.d.ts +42 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/joint-e2e.d.ts.map +1 -0
- package/node_modules/@ykdz/preset-vue-hono-app/native/template-dist/joint-e2e.js +173 -0
- package/node_modules/@ykdz/reference-hono-api/native/package.json +3 -1
- package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.d.ts +1 -1
- package/node_modules/@ykdz/reference-hono-api/native/template-dist/definition.js +51 -18
- package/node_modules/@ykdz/reference-hono-api/native/tsconfig.json +1 -1
- package/node_modules/@ykdz/reference-hono-api/native/turbo.json +2 -2
- package/node_modules/@ykdz/reference-hono-api/package.json +3 -2
- package/node_modules/@ykdz/reference-npm-publication/native/README.md +14 -6
- package/node_modules/@ykdz/reference-npm-publication/native/package.json +2 -2
- package/node_modules/@ykdz/reference-npm-publication/native/resources/release.yml +4 -1
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts +8 -4
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/definition.js +68 -21
- package/node_modules/@ykdz/reference-npm-publication/package.json +1 -2
- package/node_modules/@ykdz/reference-rust-bin/native/package.json +13 -3
- package/node_modules/@ykdz/reference-rust-bin/native/resources/gitignore +5 -0
- package/node_modules/@ykdz/reference-rust-bin/native/resources/npmignore +1 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template/rust-toolchain.toml +1 -1
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts +86 -12
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/definition.js +227 -106
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/environment.d.ts +6 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/environment.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/environment.js +44 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-package-projection.d.ts +19 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-package-projection.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-package-projection.js +65 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-toolchain-projection.d.ts +15 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-toolchain-projection.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-rust-bin/native/template-dist/rust-toolchain-projection.js +44 -0
- package/node_modules/@ykdz/reference-rust-bin/native/turbo.json +3 -1
- package/node_modules/@ykdz/reference-rust-bin/package.json +6 -1
- package/node_modules/@ykdz/reference-tooling-config/native/package.json +4 -5
- package/node_modules/@ykdz/reference-tooling-config/native/template/workspace/oxfmt.config.ts +1 -0
- package/node_modules/@ykdz/reference-tooling-config/native/template/workspace/oxlint.config.ts +4 -0
- package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.d.ts +1 -27
- package/node_modules/@ykdz/reference-tooling-config/native/template-dist/definition.js +53 -11
- package/node_modules/@ykdz/reference-tooling-config/native/tsconfig.json +1 -1
- package/node_modules/@ykdz/reference-tooling-config/native/turbo.json +5 -4
- package/node_modules/@ykdz/reference-tooling-config/package.json +5 -1
- package/node_modules/@ykdz/reference-ts-cli/native/package.json +8 -8
- package/node_modules/@ykdz/reference-ts-cli/native/resources/gitignore +5 -0
- package/node_modules/@ykdz/reference-ts-cli/native/resources/npmignore +1 -0
- package/node_modules/@ykdz/reference-ts-cli/native/src/cli-command-identity.ts +18 -0
- package/node_modules/@ykdz/reference-ts-cli/native/src/cli.ts +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/src/main.ts +9 -19
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts +8 -6
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.d.ts.map +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/definition.js +119 -59
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.d.ts +7 -0
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-ts-cli/native/template-dist/package-manifest.js +28 -0
- package/node_modules/@ykdz/reference-ts-cli/native/test/e2e/journeys/lookup.journey.ts +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/test/integration/command.test.ts +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/test/unit/cli-command-identity.test.ts +7 -55
- package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.build.json +1 -1
- package/node_modules/@ykdz/reference-ts-cli/native/tsconfig.node.json +8 -2
- package/node_modules/@ykdz/reference-ts-cli/native/turbo.json +11 -3
- package/node_modules/@ykdz/reference-ts-cli/package.json +3 -2
- package/node_modules/@ykdz/reference-ts-lib/native/package.json +4 -2
- package/node_modules/@ykdz/reference-ts-lib/native/resources/gitignore +3 -0
- package/node_modules/@ykdz/reference-ts-lib/native/resources/npmignore +1 -0
- package/node_modules/@ykdz/reference-ts-lib/native/src/index.ts +1 -3
- package/node_modules/@ykdz/reference-ts-lib/native/src/name-schema.ts +2 -2
- package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.d.ts +1 -1
- package/node_modules/@ykdz/reference-ts-lib/native/template-dist/definition.js +70 -26
- package/node_modules/@ykdz/reference-ts-lib/native/tsconfig.node.json +1 -1
- package/node_modules/@ykdz/reference-ts-lib/native/turbo.json +3 -1
- package/node_modules/@ykdz/reference-ts-lib/package.json +3 -2
- package/node_modules/@ykdz/reference-vike-db/native/package.json +3 -1
- package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.d.ts +1 -1
- package/node_modules/@ykdz/reference-vike-db/native/template-dist/definition.js +70 -23
- package/node_modules/@ykdz/reference-vike-db/native/tsconfig.node.json +1 -1
- package/node_modules/@ykdz/reference-vike-db/native/turbo.json +3 -3
- package/node_modules/@ykdz/reference-vike-db/package.json +4 -2
- package/node_modules/@ykdz/reference-vike-migrations/native/package.json +3 -1
- package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.d.ts +2 -1
- package/node_modules/@ykdz/reference-vike-migrations/native/template-dist/definition.js +78 -23
- package/node_modules/@ykdz/reference-vike-migrations/native/tsconfig.json +1 -1
- package/node_modules/@ykdz/reference-vike-migrations/native/turbo.json +3 -3
- package/node_modules/@ykdz/reference-vike-migrations/package.json +4 -2
- package/node_modules/@ykdz/reference-vike-web/native/package.json +3 -1
- package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.d.ts +2 -1
- package/node_modules/@ykdz/reference-vike-web/native/template-dist/definition.js +137 -38
- package/node_modules/@ykdz/reference-vike-web/native/tsconfig.app.json +1 -1
- package/node_modules/@ykdz/reference-vike-web/native/tsconfig.node.json +1 -1
- package/node_modules/@ykdz/reference-vike-web/native/turbo.json +8 -4
- package/node_modules/@ykdz/reference-vike-web/package.json +4 -3
- package/node_modules/@ykdz/reference-vue-app/native/package.json +3 -1
- package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.d.ts +1 -1
- package/node_modules/@ykdz/reference-vue-app/native/template-dist/definition.js +72 -32
- package/node_modules/@ykdz/reference-vue-app/native/tsconfig.app.json +1 -1
- package/node_modules/@ykdz/reference-vue-app/native/tsconfig.node.json +1 -1
- package/node_modules/@ykdz/reference-vue-app/native/turbo.json +2 -2
- package/node_modules/@ykdz/reference-vue-app/package.json +3 -3
- package/node_modules/@ykdz/reference-vue-hono-web/native/package.json +3 -1
- package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.d.ts +3 -1
- package/node_modules/@ykdz/reference-vue-hono-web/native/template-dist/definition.js +78 -28
- package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.app.json +1 -1
- package/node_modules/@ykdz/reference-vue-hono-web/native/tsconfig.node.json +1 -1
- package/node_modules/@ykdz/reference-vue-hono-web/native/turbo.json +2 -2
- package/node_modules/@ykdz/reference-vue-hono-web/package.json +4 -3
- package/node_modules/@ykdz/reference-workspace-root/native/package.json +59 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template/files/turbo.json +40 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/definition.d.ts +10 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/definition.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/definition.js +140 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.d.ts +19 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/editor-customization.js +82 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment-sources.d.ts +6 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment-sources.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment-sources.js +10 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.d.ts +36 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/environment.js +210 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/project-github.d.ts +31 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/project-github.d.ts.map +1 -0
- package/node_modules/@ykdz/reference-workspace-root/native/template-dist/project-github.js +94 -0
- package/node_modules/@ykdz/reference-workspace-root/native/tsconfig.config.json +10 -0
- package/node_modules/@ykdz/reference-workspace-root/native/tsconfig.json +7 -0
- package/node_modules/@ykdz/reference-workspace-root/native/tsconfig.scripts.json +8 -0
- package/node_modules/@ykdz/reference-workspace-root/package.json +33 -0
- package/node_modules/@ykdz/template-content/dist/index.d.ts +10 -10
- package/node_modules/@ykdz/template-content/dist/index.js +3 -3
- package/node_modules/@ykdz/template-content/package.json +2 -1
- package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.d.ts +3 -45
- package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/dist/index.js +18 -23
- package/node_modules/@ykdz/template-content-provider-51cfac9642dc43a4/package.json +2 -2
- package/node_modules/@ykdz/template-core/dist/composition.d.ts +49 -0
- package/node_modules/@ykdz/template-core/dist/composition.js +1 -0
- package/node_modules/@ykdz/template-core/dist/content-identity.d.ts +10 -0
- package/node_modules/@ykdz/template-core/dist/content-identity.js +21 -2
- package/node_modules/@ykdz/template-core/dist/generation-record.d.ts +63 -28
- package/node_modules/@ykdz/template-core/dist/generation-record.js +104 -35
- package/node_modules/@ykdz/template-core/dist/json.d.ts +8 -0
- package/node_modules/@ykdz/template-core/dist/json.js +62 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +29 -12
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +164 -33
- package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +6 -33
- package/node_modules/@ykdz/template-core/dist/preset-definition.js +23 -6
- package/node_modules/@ykdz/template-core/dist/project-blueprint.d.ts +40 -30
- package/node_modules/@ykdz/template-core/dist/project-blueprint.js +145 -140
- package/node_modules/@ykdz/template-core/dist/project-projection.d.ts +91 -33
- package/node_modules/@ykdz/template-core/dist/project-projection.js +639 -323
- package/node_modules/@ykdz/template-core/dist/reference-package.d.ts +101 -0
- package/node_modules/@ykdz/template-core/dist/reference-package.js +14 -0
- package/node_modules/@ykdz/template-core/dist/template-source.d.ts +10 -0
- package/node_modules/@ykdz/template-core/dist/template-source.js +31 -0
- package/node_modules/@ykdz/template-core/package.json +5 -6
- package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.d.ts +2 -3
- package/node_modules/@ykdz/template-environment/dist/development-container-tool-layer.js +2 -6
- package/node_modules/@ykdz/template-environment/package.json +3 -3
- package/node_modules/@ykdz/template-generator/dist/content-source.d.ts +25 -3
- package/node_modules/@ykdz/template-generator/dist/content-source.js +28 -27
- package/node_modules/@ykdz/template-generator/dist/index.d.ts +191 -60
- package/node_modules/@ykdz/template-generator/dist/index.js +1868 -1000
- package/node_modules/@ykdz/template-generator/dist/owner-local-reference.d.ts +8 -0
- package/node_modules/@ykdz/template-generator/dist/owner-local-reference.js +80 -0
- package/node_modules/@ykdz/template-generator/package.json +2 -2
- package/node_modules/@ykdz/template-workspace/dist/application-requirements.d.ts +13 -3
- package/node_modules/@ykdz/template-workspace/dist/application-requirements.js +34 -0
- package/node_modules/@ykdz/template-workspace/dist/ci-diagnostic-artifact.d.ts +1 -6
- package/node_modules/@ykdz/template-workspace/dist/default-composition.d.ts +109 -0
- package/node_modules/@ykdz/template-workspace/dist/default-composition.js +1353 -0
- package/node_modules/@ykdz/template-workspace/dist/default-generation.d.ts +618 -0
- package/node_modules/@ykdz/template-workspace/dist/default-generation.js +638 -0
- package/node_modules/@ykdz/template-workspace/dist/default-package-identity.js +23 -19
- package/node_modules/@ykdz/template-workspace/dist/project-requirements.d.ts +23 -9
- package/node_modules/@ykdz/template-workspace/dist/project-requirements.js +16 -1
- package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.d.ts +1 -1
- package/node_modules/@ykdz/template-workspace/dist/release-toolchain-snapshot.js +1 -1
- package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.d.ts +13 -7
- package/node_modules/@ykdz/template-workspace/dist/rust-toolchain-facts.js +35 -21
- package/node_modules/@ykdz/template-workspace/dist/shared-root-files.d.ts +7 -67
- package/node_modules/@ykdz/template-workspace/dist/shared-root-files.js +18 -50
- package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.d.ts +0 -1
- package/node_modules/@ykdz/template-workspace/dist/workspace-policy-snapshot.js +7 -18
- package/node_modules/@ykdz/template-workspace/package.json +16 -58
- package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.d.ts +38 -2
- package/node_modules/@ykdz/template-workspace-authoring/dist/content-artifact.js +95 -44
- package/node_modules/@ykdz/template-workspace-authoring/package.json +4 -3
- package/node_modules/@ykdz/tooling-config/base.json +15 -0
- package/node_modules/@ykdz/tooling-config/node.json +13 -0
- package/node_modules/@ykdz/tooling-config/oxfmt.config.ts +3 -0
- package/node_modules/@ykdz/tooling-config/oxlint.config.ts +8 -0
- package/node_modules/@ykdz/tooling-config/package.json +36 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +218 -0
- package/node_modules/zod/compile.cjs +96 -0
- package/node_modules/zod/compile.d.cts +1 -0
- package/node_modules/zod/compile.d.ts +1 -0
- package/node_modules/zod/compile.js +52 -0
- package/node_modules/zod/index.cjs +52 -0
- package/node_modules/zod/index.d.cts +3 -0
- package/node_modules/zod/index.d.ts +3 -0
- package/node_modules/zod/index.js +7 -0
- package/node_modules/zod/locales/index.cjs +36 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +51 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +147 -0
- package/node_modules/zod/src/compile.ts +56 -0
- package/node_modules/zod/src/index.ts +7 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -0
- package/node_modules/zod/src/v3/ZodError.ts +340 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +70 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +586 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +261 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +128 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +206 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +24 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +431 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +114 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +922 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +33 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +78 -0
- package/node_modules/zod/src/v4/classic/deep-partial.ts +76 -0
- package/node_modules/zod/src/v4/classic/errors.ts +97 -0
- package/node_modules/zod/src/v4/classic/external.ts +57 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +944 -0
- package/node_modules/zod/src/v4/classic/in-out.ts +45 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +20 -0
- package/node_modules/zod/src/v4/classic/parse.ts +88 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2937 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +291 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +402 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +89 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +604 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +572 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +704 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +374 -0
- package/node_modules/zod/src/v4/classic/tests/credit-card.test.ts +76 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/cyclic-data.test.ts +985 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +316 -0
- package/node_modules/zod/src/v4/classic/tests/deep-partial.test.ts +380 -0
- package/node_modules/zod/src/v4/classic/tests/default-locale.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +455 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +221 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +942 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +305 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +917 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +1108 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +1467 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +391 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +67 -0
- package/node_modules/zod/src/v4/classic/tests/iban.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/in-out.test.ts +159 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +958 -0
- package/node_modules/zod/src/v4/classic/tests/instance-footprint.test.ts +319 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +334 -0
- package/node_modules/zod/src/v4/classic/tests/issue-schema.test.ts +215 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +262 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +128 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +349 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +401 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +1006 -0
- package/node_modules/zod/src/v4/classic/tests/optin-ladder.test.ts +235 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +366 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +497 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +144 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +44 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/properties.test.ts +141 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +184 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +885 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +707 -0
- package/node_modules/zod/src/v4/classic/tests/redos.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +693 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +153 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1440 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +124 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +812 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +4733 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +511 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +310 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -0
- package/node_modules/zod/src/v4/classic/tests/validate.test.ts +645 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1875 -0
- package/node_modules/zod/src/v4/core/checks.ts +1266 -0
- package/node_modules/zod/src/v4/core/compile.ts +2322 -0
- package/node_modules/zod/src/v4/core/core.ts +230 -0
- package/node_modules/zod/src/v4/core/doc.ts +52 -0
- package/node_modules/zod/src/v4/core/errors.ts +543 -0
- package/node_modules/zod/src/v4/core/index.ts +19 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +131 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +934 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +148 -0
- package/node_modules/zod/src/v4/core/memoizer.ts +331 -0
- package/node_modules/zod/src/v4/core/parse.ts +309 -0
- package/node_modules/zod/src/v4/core/regexes.ts +217 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +5226 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/cached.test.ts +54 -0
- package/node_modules/zod/src/v4/core/tests/compile-differential.test.ts +1004 -0
- package/node_modules/zod/src/v4/core/tests/compile-generative.test.ts +445 -0
- package/node_modules/zod/src/v4/core/tests/compile-global.test.ts +89 -0
- package/node_modules/zod/src/v4/core/tests/compile-off-by-default.test.ts +26 -0
- package/node_modules/zod/src/v4/core/tests/compile-stats.test.ts +34 -0
- package/node_modules/zod/src/v4/core/tests/compile.test.ts +2036 -0
- package/node_modules/zod/src/v4/core/tests/email-regex.test.ts +140 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/el.test.ts +214 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +180 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/parity.test.ts +42 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tg.test.ts +85 -0
- package/node_modules/zod/src/v4/core/tests/locales/tk.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/polyfill-collision.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/tests/treeshake.test.ts +51 -0
- package/node_modules/zod/src/v4/core/tests/url-no-canparse.test.ts +133 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +857 -0
- package/node_modules/zod/src/v4/core/util.ts +1293 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/visit.ts +193 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +120 -0
- package/node_modules/zod/src/v4/locales/az.ts +116 -0
- package/node_modules/zod/src/v4/locales/be.ts +188 -0
- package/node_modules/zod/src/v4/locales/bg.ts +133 -0
- package/node_modules/zod/src/v4/locales/bn.ts +123 -0
- package/node_modules/zod/src/v4/locales/ca.ts +121 -0
- package/node_modules/zod/src/v4/locales/ckb.ts +140 -0
- package/node_modules/zod/src/v4/locales/cs.ts +123 -0
- package/node_modules/zod/src/v4/locales/da.ts +128 -0
- package/node_modules/zod/src/v4/locales/de.ts +121 -0
- package/node_modules/zod/src/v4/locales/el.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +136 -0
- package/node_modules/zod/src/v4/locales/eo.ts +123 -0
- package/node_modules/zod/src/v4/locales/es.ts +145 -0
- package/node_modules/zod/src/v4/locales/fa.ts +131 -0
- package/node_modules/zod/src/v4/locales/fi.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr.ts +139 -0
- package/node_modules/zod/src/v4/locales/gu.ts +123 -0
- package/node_modules/zod/src/v4/locales/he.ts +253 -0
- package/node_modules/zod/src/v4/locales/hi.ts +126 -0
- package/node_modules/zod/src/v4/locales/hr.ts +135 -0
- package/node_modules/zod/src/v4/locales/hu.ts +122 -0
- package/node_modules/zod/src/v4/locales/hy.ts +175 -0
- package/node_modules/zod/src/v4/locales/id.ts +120 -0
- package/node_modules/zod/src/v4/locales/index.ts +63 -0
- package/node_modules/zod/src/v4/locales/is.ts +124 -0
- package/node_modules/zod/src/v4/locales/it.ts +121 -0
- package/node_modules/zod/src/v4/locales/ja.ts +119 -0
- package/node_modules/zod/src/v4/locales/ka.ts +128 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +124 -0
- package/node_modules/zod/src/v4/locales/kn.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +126 -0
- package/node_modules/zod/src/v4/locales/lt.ts +243 -0
- package/node_modules/zod/src/v4/locales/mk.ts +123 -0
- package/node_modules/zod/src/v4/locales/ms.ts +120 -0
- package/node_modules/zod/src/v4/locales/ne.ts +128 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/nn.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +121 -0
- package/node_modules/zod/src/v4/locales/ota.ts +122 -0
- package/node_modules/zod/src/v4/locales/pl.ts +123 -0
- package/node_modules/zod/src/v4/locales/ps.ts +131 -0
- package/node_modules/zod/src/v4/locales/pt-BR.ts +161 -0
- package/node_modules/zod/src/v4/locales/pt.ts +159 -0
- package/node_modules/zod/src/v4/locales/ro.ts +132 -0
- package/node_modules/zod/src/v4/locales/ru.ts +188 -0
- package/node_modules/zod/src/v4/locales/sk.ts +123 -0
- package/node_modules/zod/src/v4/locales/sl.ts +123 -0
- package/node_modules/zod/src/v4/locales/sv.ts +124 -0
- package/node_modules/zod/src/v4/locales/ta.ts +123 -0
- package/node_modules/zod/src/v4/locales/tg.ts +135 -0
- package/node_modules/zod/src/v4/locales/th.ts +124 -0
- package/node_modules/zod/src/v4/locales/tk.ts +113 -0
- package/node_modules/zod/src/v4/locales/tr.ts +116 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +122 -0
- package/node_modules/zod/src/v4/locales/ur.ts +124 -0
- package/node_modules/zod/src/v4/locales/uz.ts +120 -0
- package/node_modules/zod/src/v4/locales/vi.ts +122 -0
- package/node_modules/zod/src/v4/locales/yo.ts +129 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +121 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +120 -0
- package/node_modules/zod/src/v4/mini/checks.ts +33 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/deep-partial.ts +73 -0
- package/node_modules/zod/src/v4/mini/external.ts +52 -0
- package/node_modules/zod/src/v4/mini/in-out.ts +45 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +16 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +2051 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +57 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +190 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +158 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +582 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +30 -0
- package/node_modules/zod/src/v4/mini/tests/cyclic-data.test.ts +84 -0
- package/node_modules/zod/src/v4/mini/tests/deep-partial.test.ts +54 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +41 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +14 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +1146 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +109 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +292 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +341 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +396 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -0
- package/node_modules/zod/v3/ZodError.cjs +167 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +143 -0
- package/node_modules/zod/v3/errors.cjs +36 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +41 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +28 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +143 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +21 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +21 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +156 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +52 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +112 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/package.json +7 -0
- package/node_modules/zod/v3/standard-schema.cjs +21 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3798 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3697 -0
- package/node_modules/zod/v4/classic/checks.cjs +53 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +66 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +80 -0
- package/node_modules/zod/v4/classic/compat.d.cts +48 -0
- package/node_modules/zod/v4/classic/compat.d.ts +48 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/classic/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/classic/deep-partial.js +13 -0
- package/node_modules/zod/v4/classic/errors.cjs +102 -0
- package/node_modules/zod/v4/classic/errors.d.cts +29 -0
- package/node_modules/zod/v4/classic/errors.d.ts +29 -0
- package/node_modules/zod/v4/classic/errors.js +57 -0
- package/node_modules/zod/v4/classic/external.cjs +97 -0
- package/node_modules/zod/v4/classic/external.d.cts +19 -0
- package/node_modules/zod/v4/classic/external.d.ts +19 -0
- package/node_modules/zod/v4/classic/external.js +17 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +926 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +881 -0
- package/node_modules/zod/v4/classic/in-out.cjs +82 -0
- package/node_modules/zod/v4/classic/in-out.d.cts +8 -0
- package/node_modules/zod/v4/classic/in-out.d.ts +8 -0
- package/node_modules/zod/v4/classic/in-out.js +36 -0
- package/node_modules/zod/v4/classic/index.cjs +52 -0
- package/node_modules/zod/v4/classic/index.d.cts +3 -0
- package/node_modules/zod/v4/classic/index.d.ts +3 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +68 -0
- package/node_modules/zod/v4/classic/iso.d.cts +7 -0
- package/node_modules/zod/v4/classic/iso.d.ts +7 -0
- package/node_modules/zod/v4/classic/iso.js +15 -0
- package/node_modules/zod/v4/classic/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +63 -0
- package/node_modules/zod/v4/classic/parse.d.cts +44 -0
- package/node_modules/zod/v4/classic/parse.d.ts +44 -0
- package/node_modules/zod/v4/classic/parse.js +16 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1676 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +816 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +816 -0
- package/node_modules/zod/v4/classic/schemas.js +1535 -0
- package/node_modules/zod/v4/core/api.cjs +1269 -0
- package/node_modules/zod/v4/core/api.d.cts +335 -0
- package/node_modules/zod/v4/core/api.d.ts +335 -0
- package/node_modules/zod/v4/core/api.js +1107 -0
- package/node_modules/zod/v4/core/checks.cjs +561 -0
- package/node_modules/zod/v4/core/checks.d.cts +294 -0
- package/node_modules/zod/v4/core/checks.d.ts +294 -0
- package/node_modules/zod/v4/core/checks.js +516 -0
- package/node_modules/zod/v4/core/compile.cjs +1916 -0
- package/node_modules/zod/v4/core/compile.d.cts +65 -0
- package/node_modules/zod/v4/core/compile.d.ts +65 -0
- package/node_modules/zod/v4/core/compile.js +1866 -0
- package/node_modules/zod/v4/core/core.cjs +167 -0
- package/node_modules/zod/v4/core/core.d.cts +82 -0
- package/node_modules/zod/v4/core/core.d.ts +82 -0
- package/node_modules/zod/v4/core/core.js +141 -0
- package/node_modules/zod/v4/core/doc.cjs +61 -0
- package/node_modules/zod/v4/core/doc.d.cts +16 -0
- package/node_modules/zod/v4/core/doc.d.ts +16 -0
- package/node_modules/zod/v4/core/doc.js +38 -0
- package/node_modules/zod/v4/core/errors.cjs +317 -0
- package/node_modules/zod/v4/core/errors.d.cts +225 -0
- package/node_modules/zod/v4/core/errors.d.ts +225 -0
- package/node_modules/zod/v4/core/errors.js +267 -0
- package/node_modules/zod/v4/core/index.cjs +70 -0
- package/node_modules/zod/v4/core/index.d.cts +19 -0
- package/node_modules/zod/v4/core/index.d.ts +19 -0
- package/node_modules/zod/v4/core/index.js +19 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +122 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +99 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +929 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +843 -0
- package/node_modules/zod/v4/core/json-schema.cjs +21 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +89 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +89 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/memoizer.cjs +360 -0
- package/node_modules/zod/v4/core/memoizer.d.cts +15 -0
- package/node_modules/zod/v4/core/memoizer.d.ts +15 -0
- package/node_modules/zod/v4/core/memoizer.js +311 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +233 -0
- package/node_modules/zod/v4/core/parse.d.cts +52 -0
- package/node_modules/zod/v4/core/parse.d.ts +52 -0
- package/node_modules/zod/v4/core/parse.js +175 -0
- package/node_modules/zod/v4/core/regexes.cjs +209 -0
- package/node_modules/zod/v4/core/regexes.d.cts +90 -0
- package/node_modules/zod/v4/core/regexes.d.ts +90 -0
- package/node_modules/zod/v4/core/regexes.js +156 -0
- package/node_modules/zod/v4/core/registries.cjs +75 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +2699 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1275 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1275 -0
- package/node_modules/zod/v4/core/schemas.js +2636 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +21 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +681 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +154 -0
- package/node_modules/zod/v4/core/to-json-schema.js +651 -0
- package/node_modules/zod/v4/core/util.cjs +964 -0
- package/node_modules/zod/v4/core/util.d.cts +280 -0
- package/node_modules/zod/v4/core/util.d.ts +280 -0
- package/node_modules/zod/v4/core/util.js +873 -0
- package/node_modules/zod/v4/core/versions.cjs +27 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/core/visit.cjs +214 -0
- package/node_modules/zod/v4/core/visit.d.cts +30 -0
- package/node_modules/zod/v4/core/visit.d.ts +30 -0
- package/node_modules/zod/v4/core/visit.js +169 -0
- package/node_modules/zod/v4/index.cjs +51 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +4 -0
- package/node_modules/zod/v4/locales/ar.cjs +138 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +111 -0
- package/node_modules/zod/v4/locales/az.cjs +137 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +110 -0
- package/node_modules/zod/v4/locales/be.cjs +195 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +168 -0
- package/node_modules/zod/v4/locales/bg.cjs +152 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +125 -0
- package/node_modules/zod/v4/locales/bn.cjs +140 -0
- package/node_modules/zod/v4/locales/bn.d.cts +5 -0
- package/node_modules/zod/v4/locales/bn.d.ts +4 -0
- package/node_modules/zod/v4/locales/bn.js +113 -0
- package/node_modules/zod/v4/locales/ca.cjs +139 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +112 -0
- package/node_modules/zod/v4/locales/ckb.cjs +160 -0
- package/node_modules/zod/v4/locales/ckb.d.cts +5 -0
- package/node_modules/zod/v4/locales/ckb.d.ts +4 -0
- package/node_modules/zod/v4/locales/ckb.js +133 -0
- package/node_modules/zod/v4/locales/cs.cjs +143 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +116 -0
- package/node_modules/zod/v4/locales/da.cjs +147 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +120 -0
- package/node_modules/zod/v4/locales/de.cjs +140 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +113 -0
- package/node_modules/zod/v4/locales/el.cjs +139 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +112 -0
- package/node_modules/zod/v4/locales/en.cjs +152 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +125 -0
- package/node_modules/zod/v4/locales/eo.cjs +141 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +114 -0
- package/node_modules/zod/v4/locales/es.cjs +163 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +136 -0
- package/node_modules/zod/v4/locales/fa.cjs +146 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +119 -0
- package/node_modules/zod/v4/locales/fi.cjs +144 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +117 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +139 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +112 -0
- package/node_modules/zod/v4/locales/fr.cjs +156 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +129 -0
- package/node_modules/zod/v4/locales/gu.cjs +140 -0
- package/node_modules/zod/v4/locales/gu.d.cts +5 -0
- package/node_modules/zod/v4/locales/gu.d.ts +4 -0
- package/node_modules/zod/v4/locales/gu.js +113 -0
- package/node_modules/zod/v4/locales/he.cjs +248 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +221 -0
- package/node_modules/zod/v4/locales/hi.cjs +138 -0
- package/node_modules/zod/v4/locales/hi.d.cts +5 -0
- package/node_modules/zod/v4/locales/hi.d.ts +4 -0
- package/node_modules/zod/v4/locales/hi.js +111 -0
- package/node_modules/zod/v4/locales/hr.cjs +153 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +126 -0
- package/node_modules/zod/v4/locales/hu.cjs +140 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +113 -0
- package/node_modules/zod/v4/locales/hy.cjs +185 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +158 -0
- package/node_modules/zod/v4/locales/id.cjs +138 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +111 -0
- package/node_modules/zod/v4/locales/index.cjs +152 -0
- package/node_modules/zod/v4/locales/index.d.cts +63 -0
- package/node_modules/zod/v4/locales/index.d.ts +63 -0
- package/node_modules/zod/v4/locales/index.js +63 -0
- package/node_modules/zod/v4/locales/is.cjs +141 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +114 -0
- package/node_modules/zod/v4/locales/it.cjs +140 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +113 -0
- package/node_modules/zod/v4/locales/ja.cjs +139 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +112 -0
- package/node_modules/zod/v4/locales/ka.cjs +144 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +117 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +142 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +115 -0
- package/node_modules/zod/v4/locales/kn.cjs +143 -0
- package/node_modules/zod/v4/locales/kn.d.cts +5 -0
- package/node_modules/zod/v4/locales/kn.d.ts +4 -0
- package/node_modules/zod/v4/locales/kn.js +116 -0
- package/node_modules/zod/v4/locales/ko.cjs +143 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +116 -0
- package/node_modules/zod/v4/locales/lt.cjs +234 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +207 -0
- package/node_modules/zod/v4/locales/mk.cjs +141 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +114 -0
- package/node_modules/zod/v4/locales/ms.cjs +139 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +112 -0
- package/node_modules/zod/v4/locales/ne.cjs +138 -0
- package/node_modules/zod/v4/locales/ne.d.cts +5 -0
- package/node_modules/zod/v4/locales/ne.d.ts +4 -0
- package/node_modules/zod/v4/locales/ne.js +111 -0
- package/node_modules/zod/v4/locales/nl.cjs +142 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +115 -0
- package/node_modules/zod/v4/locales/nn.cjs +140 -0
- package/node_modules/zod/v4/locales/nn.d.cts +5 -0
- package/node_modules/zod/v4/locales/nn.d.ts +4 -0
- package/node_modules/zod/v4/locales/nn.js +113 -0
- package/node_modules/zod/v4/locales/no.cjs +140 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +113 -0
- package/node_modules/zod/v4/locales/ota.cjs +141 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +114 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +141 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +114 -0
- package/node_modules/zod/v4/locales/ps.cjs +146 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +119 -0
- package/node_modules/zod/v4/locales/pt-BR.cjs +170 -0
- package/node_modules/zod/v4/locales/pt-BR.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt-BR.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt-BR.js +143 -0
- package/node_modules/zod/v4/locales/pt.cjs +169 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +142 -0
- package/node_modules/zod/v4/locales/ro.cjs +149 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +122 -0
- package/node_modules/zod/v4/locales/ru.cjs +195 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +168 -0
- package/node_modules/zod/v4/locales/sk.cjs +143 -0
- package/node_modules/zod/v4/locales/sk.d.cts +5 -0
- package/node_modules/zod/v4/locales/sk.d.ts +4 -0
- package/node_modules/zod/v4/locales/sk.js +116 -0
- package/node_modules/zod/v4/locales/sl.cjs +141 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +114 -0
- package/node_modules/zod/v4/locales/sv.cjs +142 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +115 -0
- package/node_modules/zod/v4/locales/ta.cjs +142 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +115 -0
- package/node_modules/zod/v4/locales/tg.cjs +144 -0
- package/node_modules/zod/v4/locales/tg.d.cts +5 -0
- package/node_modules/zod/v4/locales/tg.d.ts +4 -0
- package/node_modules/zod/v4/locales/tg.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +142 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +115 -0
- package/node_modules/zod/v4/locales/tk.cjs +134 -0
- package/node_modules/zod/v4/locales/tk.d.cts +5 -0
- package/node_modules/zod/v4/locales/tk.d.ts +4 -0
- package/node_modules/zod/v4/locales/tk.js +107 -0
- package/node_modules/zod/v4/locales/tr.cjs +137 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +110 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +140 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +113 -0
- package/node_modules/zod/v4/locales/ur.cjs +142 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +115 -0
- package/node_modules/zod/v4/locales/uz.cjs +140 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +113 -0
- package/node_modules/zod/v4/locales/vi.cjs +140 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +113 -0
- package/node_modules/zod/v4/locales/yo.cjs +139 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +112 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +141 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +114 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +139 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +112 -0
- package/node_modules/zod/v4/mini/checks.cjs +54 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +71 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +22 -0
- package/node_modules/zod/v4/mini/deep-partial.cjs +58 -0
- package/node_modules/zod/v4/mini/deep-partial.d.cts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.d.ts +14 -0
- package/node_modules/zod/v4/mini/deep-partial.js +13 -0
- package/node_modules/zod/v4/mini/external.cjs +95 -0
- package/node_modules/zod/v4/mini/external.d.cts +16 -0
- package/node_modules/zod/v4/mini/external.d.ts +16 -0
- package/node_modules/zod/v4/mini/external.js +16 -0
- package/node_modules/zod/v4/mini/in-out.cjs +82 -0
- package/node_modules/zod/v4/mini/in-out.d.cts +8 -0
- package/node_modules/zod/v4/mini/in-out.d.ts +8 -0
- package/node_modules/zod/v4/mini/in-out.js +36 -0
- package/node_modules/zod/v4/mini/index.cjs +51 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +83 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +37 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +1147 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +480 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +480 -0
- package/node_modules/zod/v4/mini/schemas.js +1002 -0
- package/node_modules/zod/v4/package.json +7 -0
- package/node_modules/zod/v4-mini/index.cjs +51 -0
- package/node_modules/zod/v4-mini/index.d.cts +3 -0
- package/node_modules/zod/v4-mini/index.d.ts +3 -0
- package/node_modules/zod/v4-mini/index.js +3 -0
- package/node_modules/zod/v4-mini/package.json +7 -0
- package/package.json +15 -10
- package/dist/standard-schema.d.ts +0 -3
- package/dist/standard-schema.js +0 -21
- package/node_modules/@typescript/typescript-linux-x64/LICENSE +0 -55
- package/node_modules/@typescript/typescript-linux-x64/NOTICE.txt +0 -436
- package/node_modules/@typescript/typescript-linux-x64/README.md +0 -3
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.d.ts +0 -20
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.d.ts +0 -382
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.decorators.legacy.d.ts +0 -20
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.asynciterable.d.ts +0 -18
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.d.ts +0 -45125
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.dom.iterable.d.ts +0 -18
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.collection.d.ts +0 -159
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.core.d.ts +0 -595
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.d.ts +0 -26
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.generator.d.ts +0 -75
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.iterable.d.ts +0 -603
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.promise.d.ts +0 -79
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.proxy.d.ts +0 -126
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.reflect.d.ts +0 -142
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.d.ts +0 -44
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2015.symbol.wellknown.d.ts +0 -324
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.array.include.d.ts +0 -114
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.d.ts +0 -19
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.full.d.ts +0 -21
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2016.intl.d.ts +0 -29
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.arraybuffer.d.ts +0 -19
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.d.ts +0 -24
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.date.d.ts +0 -29
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.full.d.ts +0 -21
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.intl.d.ts +0 -42
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.object.d.ts +0 -47
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.sharedmemory.d.ts +0 -133
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.string.d.ts +0 -47
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2017.typedarrays.d.ts +0 -51
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asyncgenerator.d.ts +0 -75
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.asynciterable.d.ts +0 -51
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.intl.d.ts +0 -81
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.promise.d.ts +0 -28
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2018.regexp.d.ts +0 -35
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.array.d.ts +0 -77
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.intl.d.ts +0 -21
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.object.d.ts +0 -31
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.string.d.ts +0 -35
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2019.symbol.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.bigint.d.ts +0 -763
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.d.ts +0 -25
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.date.d.ts +0 -40
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.intl.d.ts +0 -472
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.number.d.ts +0 -26
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.promise.d.ts +0 -45
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.sharedmemory.d.ts +0 -97
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.string.d.ts +0 -42
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2020.symbol.wellknown.d.ts +0 -39
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.d.ts +0 -21
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.intl.d.ts +0 -164
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.promise.d.ts +0 -46
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.string.d.ts +0 -31
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2021.weakref.d.ts +0 -76
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.array.d.ts +0 -119
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.d.ts +0 -23
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.error.d.ts +0 -73
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.intl.d.ts +0 -143
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.object.d.ts +0 -24
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.regexp.d.ts +0 -37
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2022.string.d.ts +0 -23
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.array.d.ts +0 -922
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.collection.d.ts +0 -19
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.d.ts +0 -20
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2023.intl.d.ts +0 -62
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.arraybuffer.d.ts +0 -63
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.collection.d.ts +0 -27
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.d.ts +0 -24
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.object.d.ts +0 -27
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.promise.d.ts +0 -33
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.regexp.d.ts +0 -23
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.sharedmemory.d.ts +0 -66
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2024.string.d.ts +0 -27
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.collection.d.ts +0 -94
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.d.ts +0 -23
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.float16.d.ts +0 -443
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.intl.d.ts +0 -200
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.iterator.d.ts +0 -146
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.promise.d.ts +0 -32
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es2025.regexp.d.ts +0 -30
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es5.d.ts +0 -4599
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.es6.d.ts +0 -21
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.array.d.ts +0 -33
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.collection.d.ts +0 -47
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.d.ts +0 -27
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.date.d.ts +0 -21
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.decorators.d.ts +0 -26
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.disposable.d.ts +0 -191
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.error.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.full.d.ts +0 -22
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.intl.d.ts +0 -107
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.sharedmemory.d.ts +0 -23
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.temporal.d.ts +0 -485
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.esnext.typedarrays.d.ts +0 -90
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.scripthost.d.ts +0 -320
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.asynciterable.d.ts +0 -18
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.d.ts +0 -15606
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.importscripts.d.ts +0 -21
- package/node_modules/@typescript/typescript-linux-x64/lib/lib.webworker.iterable.d.ts +0 -18
- package/node_modules/@typescript/typescript-linux-x64/lib/tsc +0 -0
- package/node_modules/@typescript/typescript-linux-x64/lib/tsc.sig +0 -11
- package/node_modules/@typescript/typescript-linux-x64/package.json +0 -45
- package/node_modules/@valibot/to-json-schema/LICENSE.md +0 -9
- package/node_modules/@valibot/to-json-schema/README.md +0 -475
- package/node_modules/@valibot/to-json-schema/dist/index.cjs +0 -800
- package/node_modules/@valibot/to-json-schema/dist/index.d.cts +0 -991
- package/node_modules/@valibot/to-json-schema/dist/index.d.mts +0 -991
- package/node_modules/@valibot/to-json-schema/dist/index.min.cjs +0 -1
- package/node_modules/@valibot/to-json-schema/dist/index.min.mjs +0 -1
- package/node_modules/@valibot/to-json-schema/dist/index.mjs +0 -795
- package/node_modules/@valibot/to-json-schema/package.json +0 -75
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts +0 -13
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.d.ts.map +0 -1
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/target.js +0 -30
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts +0 -11
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.d.ts.map +0 -1
- package/node_modules/@ykdz/reference-npm-publication/native/template-dist/workspace.js +0 -51
- package/node_modules/@ykdz/reference-rust-bin/native/tsconfig.json +0 -8
- package/node_modules/@ykdz/reference-ts-cli/native/src/publication/cli-command-identity.ts +0 -88
- package/node_modules/@ykdz/template-content/dist/template-members.d.ts +0 -9
- package/node_modules/@ykdz/template-content/dist/template-members.js +0 -16
- package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.d.ts +0 -1
- package/node_modules/@ykdz/template-core/dist/renderer-policy-snapshot.js +0 -2
- package/node_modules/@ykdz/template-core/dist/renderer.d.ts +0 -101
- package/node_modules/@ykdz/template-core/dist/renderer.js +0 -386
- package/node_modules/@ykdz/template-core/dist/workspace-strategy.d.ts +0 -188
- package/node_modules/@ykdz/template-core/dist/workspace-strategy.js +0 -1
- package/node_modules/@ykdz/template-workspace/assets/tsconfig.config.json +0 -6
- package/node_modules/@ykdz/template-workspace/assets/tsconfig.json +0 -7
- package/node_modules/@ykdz/template-workspace/assets/turbo.json +0 -64
- package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.d.ts +0 -5
- package/node_modules/@ykdz/template-workspace/dist/default-environment-sources.js +0 -8
- package/node_modules/@ykdz/template-workspace/dist/default-environment.d.ts +0 -9
- package/node_modules/@ykdz/template-workspace/dist/default-environment.js +0 -5
- package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.d.ts +0 -89
- package/node_modules/@ykdz/template-workspace/dist/default-workspace-strategy.js +0 -967
- package/node_modules/@ykdz/template-workspace/dist/development-container.d.ts +0 -3
- package/node_modules/@ykdz/template-workspace/dist/development-container.js +0 -36
- package/node_modules/@ykdz/template-workspace/dist/development-environment.d.ts +0 -36
- package/node_modules/@ykdz/template-workspace/dist/development-environment.js +0 -241
- package/node_modules/@ykdz/template-workspace/dist/editor-customization.d.ts +0 -18
- package/node_modules/@ykdz/template-workspace/dist/editor-customization.js +0 -83
- package/node_modules/@ykdz/template-workspace/dist/environment-needs.d.ts +0 -51
- package/node_modules/@ykdz/template-workspace/dist/generation-context.d.ts +0 -14
- package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.d.ts +0 -21
- package/node_modules/@ykdz/template-workspace/dist/package-addition-facts.js +0 -90
- package/node_modules/@ykdz/template-workspace/dist/package-contribution.d.ts +0 -64
- package/node_modules/@ykdz/template-workspace/dist/package-contribution.js +0 -65
- package/node_modules/@ykdz/template-workspace/dist/project-github.d.ts +0 -24
- package/node_modules/@ykdz/template-workspace/dist/project-github.js +0 -98
- package/node_modules/@ykdz/template-workspace/dist/project-linking.d.ts +0 -48
- package/node_modules/@ykdz/template-workspace/dist/project-linking.js +0 -218
- package/node_modules/@ykdz/template-workspace/dist/reference-package.d.ts +0 -146
- package/node_modules/@ykdz/template-workspace/dist/reference-package.js +0 -521
- package/node_modules/@ykdz/template-workspace/dist/root-projection.d.ts +0 -29
- package/node_modules/@ykdz/template-workspace/dist/root-projection.js +0 -144
- package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.d.ts +0 -35
- package/node_modules/@ykdz/template-workspace/dist/rust-target-projection.js +0 -74
- package/node_modules/@ykdz/template-workspace/dist/workspace-resources.d.ts +0 -23
- package/node_modules/@ykdz/template-workspace/dist/workspace-resources.js +0 -83
- package/node_modules/@ykdz/template-workspace/resources/oxfmt.config.ts +0 -1
- package/node_modules/@ykdz/template-workspace/resources/oxlint.config.ts +0 -4
- package/node_modules/typescript-7/LICENSE +0 -55
- package/node_modules/typescript-7/NOTICE.txt +0 -436
- package/node_modules/typescript-7/README.md +0 -49
- package/node_modules/typescript-7/bin/tsc +0 -2
- package/node_modules/typescript-7/dist/api/async/api.d.ts +0 -529
- package/node_modules/typescript-7/dist/api/async/api.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/async/api.js +0 -1657
- package/node_modules/typescript-7/dist/api/async/api.js.map +0 -1
- package/node_modules/typescript-7/dist/api/async/client.d.ts +0 -39
- package/node_modules/typescript-7/dist/api/async/client.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/async/client.js +0 -211
- package/node_modules/typescript-7/dist/api/async/client.js.map +0 -1
- package/node_modules/typescript-7/dist/api/async/types.d.ts +0 -310
- package/node_modules/typescript-7/dist/api/async/types.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/async/types.js +0 -2
- package/node_modules/typescript-7/dist/api/async/types.js.map +0 -1
- package/node_modules/typescript-7/dist/api/compilerOptions.d.ts +0 -109
- package/node_modules/typescript-7/dist/api/compilerOptions.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/compilerOptions.js +0 -2
- package/node_modules/typescript-7/dist/api/compilerOptions.js.map +0 -1
- package/node_modules/typescript-7/dist/api/fs.d.ts +0 -23
- package/node_modules/typescript-7/dist/api/fs.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/fs.js +0 -109
- package/node_modules/typescript-7/dist/api/fs.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/encoder.d.ts +0 -15
- package/node_modules/typescript-7/dist/api/node/encoder.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts +0 -5
- package/node_modules/typescript-7/dist/api/node/encoder.generated.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/encoder.generated.js +0 -74
- package/node_modules/typescript-7/dist/api/node/encoder.generated.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/encoder.js +0 -287
- package/node_modules/typescript-7/dist/api/node/encoder.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/msgpack.d.ts +0 -32
- package/node_modules/typescript-7/dist/api/node/msgpack.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/msgpack.js +0 -213
- package/node_modules/typescript-7/dist/api/node/msgpack.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/node.d.ts +0 -76
- package/node_modules/typescript-7/dist/api/node/node.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/node.generated.d.ts +0 -182
- package/node_modules/typescript-7/dist/api/node/node.generated.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/node.generated.js +0 -835
- package/node_modules/typescript-7/dist/api/node/node.generated.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts +0 -62
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.js +0 -122
- package/node_modules/typescript-7/dist/api/node/node.infrastructure.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/node.js +0 -298
- package/node_modules/typescript-7/dist/api/node/node.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/protocol.d.ts +0 -29
- package/node_modules/typescript-7/dist/api/node/protocol.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts +0 -4
- package/node_modules/typescript-7/dist/api/node/protocol.generated.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/protocol.generated.js +0 -241
- package/node_modules/typescript-7/dist/api/node/protocol.generated.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/protocol.js +0 -30
- package/node_modules/typescript-7/dist/api/node/protocol.js.map +0 -1
- package/node_modules/typescript-7/dist/api/node/wtf8.d.ts +0 -6
- package/node_modules/typescript-7/dist/api/node/wtf8.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/node/wtf8.js +0 -61
- package/node_modules/typescript-7/dist/api/node/wtf8.js.map +0 -1
- package/node_modules/typescript-7/dist/api/options.d.ts +0 -32
- package/node_modules/typescript-7/dist/api/options.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/options.js +0 -11
- package/node_modules/typescript-7/dist/api/options.js.map +0 -1
- package/node_modules/typescript-7/dist/api/path.d.ts +0 -110
- package/node_modules/typescript-7/dist/api/path.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/path.js +0 -508
- package/node_modules/typescript-7/dist/api/path.js.map +0 -1
- package/node_modules/typescript-7/dist/api/proto.d.ts +0 -239
- package/node_modules/typescript-7/dist/api/proto.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/proto.js +0 -37
- package/node_modules/typescript-7/dist/api/proto.js.map +0 -1
- package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts +0 -79
- package/node_modules/typescript-7/dist/api/sourceFileCache.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/sourceFileCache.js +0 -169
- package/node_modules/typescript-7/dist/api/sourceFileCache.js.map +0 -1
- package/node_modules/typescript-7/dist/api/sync/api.d.ts +0 -529
- package/node_modules/typescript-7/dist/api/sync/api.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/sync/api.js +0 -1665
- package/node_modules/typescript-7/dist/api/sync/api.js.map +0 -1
- package/node_modules/typescript-7/dist/api/sync/client.d.ts +0 -30
- package/node_modules/typescript-7/dist/api/sync/client.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/sync/client.js +0 -124
- package/node_modules/typescript-7/dist/api/sync/client.js.map +0 -1
- package/node_modules/typescript-7/dist/api/sync/types.d.ts +0 -310
- package/node_modules/typescript-7/dist/api/sync/types.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/sync/types.js +0 -2
- package/node_modules/typescript-7/dist/api/sync/types.js.map +0 -1
- package/node_modules/typescript-7/dist/api/syncChannel.d.ts +0 -114
- package/node_modules/typescript-7/dist/api/syncChannel.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/syncChannel.js +0 -508
- package/node_modules/typescript-7/dist/api/syncChannel.js.map +0 -1
- package/node_modules/typescript-7/dist/api/timing.d.ts +0 -175
- package/node_modules/typescript-7/dist/api/timing.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/api/timing.js +0 -149
- package/node_modules/typescript-7/dist/api/timing.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/ast.d.ts +0 -100
- package/node_modules/typescript-7/dist/ast/ast.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/ast.generated.d.ts +0 -1161
- package/node_modules/typescript-7/dist/ast/ast.generated.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/ast.generated.js +0 -4
- package/node_modules/typescript-7/dist/ast/ast.generated.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/ast.js +0 -7
- package/node_modules/typescript-7/dist/ast/ast.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/astnav.d.ts +0 -19
- package/node_modules/typescript-7/dist/ast/astnav.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/astnav.js +0 -596
- package/node_modules/typescript-7/dist/ast/astnav.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/clone.d.ts +0 -16
- package/node_modules/typescript-7/dist/ast/clone.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/clone.js +0 -104
- package/node_modules/typescript-7/dist/ast/clone.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/factory.generated.d.ts +0 -520
- package/node_modules/typescript-7/dist/ast/factory.generated.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/factory.generated.js +0 -3057
- package/node_modules/typescript-7/dist/ast/factory.generated.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/index.d.ts +0 -20
- package/node_modules/typescript-7/dist/ast/index.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/index.js +0 -20
- package/node_modules/typescript-7/dist/ast/index.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/is.d.ts +0 -35
- package/node_modules/typescript-7/dist/ast/is.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/is.generated.d.ts +0 -329
- package/node_modules/typescript-7/dist/ast/is.generated.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/is.generated.js +0 -1103
- package/node_modules/typescript-7/dist/ast/is.generated.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/is.js +0 -233
- package/node_modules/typescript-7/dist/ast/is.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/jsdoc.d.ts +0 -11
- package/node_modules/typescript-7/dist/ast/jsdoc.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/jsdoc.js +0 -202
- package/node_modules/typescript-7/dist/ast/jsdoc.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/scanner.d.ts +0 -97
- package/node_modules/typescript-7/dist/ast/scanner.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/scanner.js +0 -2230
- package/node_modules/typescript-7/dist/ast/scanner.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/utils.d.ts +0 -17
- package/node_modules/typescript-7/dist/ast/utils.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/utils.js +0 -67
- package/node_modules/typescript-7/dist/ast/utils.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/visitor.d.ts +0 -14
- package/node_modules/typescript-7/dist/ast/visitor.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts +0 -50
- package/node_modules/typescript-7/dist/ast/visitor.generated.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/ast/visitor.generated.js +0 -978
- package/node_modules/typescript-7/dist/ast/visitor.generated.js.map +0 -1
- package/node_modules/typescript-7/dist/ast/visitor.js +0 -47
- package/node_modules/typescript-7/dist/ast/visitor.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/characterCodes.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/characterCodes.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts +0 -129
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.js +0 -132
- package/node_modules/typescript-7/dist/enums/characterCodes.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/characterCodes.js +0 -130
- package/node_modules/typescript-7/dist/enums/characterCodes.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts +0 -5
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js +0 -6
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.js +0 -6
- package/node_modules/typescript-7/dist/enums/commentDirectiveType.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/completionItemKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts +0 -28
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js +0 -30
- package/node_modules/typescript-7/dist/enums/completionItemKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/completionItemKind.js +0 -30
- package/node_modules/typescript-7/dist/enums/completionItemKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts +0 -7
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js +0 -9
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.js +0 -9
- package/node_modules/typescript-7/dist/enums/diagnosticCategory.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/elementFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/elementFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts +0 -12
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.js +0 -14
- package/node_modules/typescript-7/dist/enums/elementFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/elementFlags.js +0 -14
- package/node_modules/typescript-7/dist/enums/elementFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/internalSymbolName.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts +0 -23
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js +0 -25
- package/node_modules/typescript-7/dist/enums/internalSymbolName.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/internalSymbolName.js +0 -25
- package/node_modules/typescript-7/dist/enums/internalSymbolName.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/jsxEmit.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts +0 -9
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js +0 -11
- package/node_modules/typescript-7/dist/enums/jsxEmit.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/jsxEmit.js +0 -11
- package/node_modules/typescript-7/dist/enums/jsxEmit.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/languageVariant.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/languageVariant.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts +0 -5
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.js +0 -6
- package/node_modules/typescript-7/dist/enums/languageVariant.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/languageVariant.js +0 -6
- package/node_modules/typescript-7/dist/enums/languageVariant.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/modifierFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts +0 -42
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js +0 -44
- package/node_modules/typescript-7/dist/enums/modifierFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/modifierFlags.js +0 -44
- package/node_modules/typescript-7/dist/enums/modifierFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts +0 -7
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js +0 -9
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js +0 -9
- package/node_modules/typescript-7/dist/enums/moduleDetectionKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/moduleKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts +0 -17
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.js +0 -19
- package/node_modules/typescript-7/dist/enums/moduleKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleKind.js +0 -19
- package/node_modules/typescript-7/dist/enums/moduleKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts +0 -9
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js +0 -11
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js +0 -11
- package/node_modules/typescript-7/dist/enums/moduleResolutionKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/newLineKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/newLineKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts +0 -6
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.js +0 -8
- package/node_modules/typescript-7/dist/enums/newLineKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/newLineKind.js +0 -8
- package/node_modules/typescript-7/dist/enums/newLineKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts +0 -36
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js +0 -38
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js +0 -38
- package/node_modules/typescript-7/dist/enums/nodeBuilderFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/nodeFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts +0 -44
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js +0 -46
- package/node_modules/typescript-7/dist/enums/nodeFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/nodeFlags.js +0 -46
- package/node_modules/typescript-7/dist/enums/nodeFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/objectFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/objectFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts +0 -50
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.js +0 -52
- package/node_modules/typescript-7/dist/enums/objectFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/objectFlags.js +0 -52
- package/node_modules/typescript-7/dist/enums/objectFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts +0 -16
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js +0 -18
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js +0 -18
- package/node_modules/typescript-7/dist/enums/outerExpressionKinds.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts +0 -13
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js +0 -14
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js +0 -14
- package/node_modules/typescript-7/dist/enums/regularExpressionFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/scriptKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts +0 -11
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.js +0 -12
- package/node_modules/typescript-7/dist/enums/scriptKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptKind.js +0 -12
- package/node_modules/typescript-7/dist/enums/scriptKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/scriptTarget.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts +0 -17
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js +0 -18
- package/node_modules/typescript-7/dist/enums/scriptTarget.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/scriptTarget.js +0 -18
- package/node_modules/typescript-7/dist/enums/scriptTarget.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/signatureFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts +0 -15
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js +0 -17
- package/node_modules/typescript-7/dist/enums/signatureFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureFlags.js +0 -17
- package/node_modules/typescript-7/dist/enums/signatureFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/signatureKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts +0 -5
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.js +0 -7
- package/node_modules/typescript-7/dist/enums/signatureKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/signatureKind.js +0 -7
- package/node_modules/typescript-7/dist/enums/signatureKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/symbolFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts +0 -71
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js +0 -73
- package/node_modules/typescript-7/dist/enums/symbolFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/symbolFlags.js +0 -73
- package/node_modules/typescript-7/dist/enums/symbolFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/syntaxKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts +0 -389
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js +0 -391
- package/node_modules/typescript-7/dist/enums/syntaxKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/syntaxKind.js +0 -391
- package/node_modules/typescript-7/dist/enums/syntaxKind.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/tokenFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts +0 -30
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js +0 -32
- package/node_modules/typescript-7/dist/enums/tokenFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/tokenFlags.js +0 -32
- package/node_modules/typescript-7/dist/enums/tokenFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/typeFlags.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/typeFlags.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts +0 -76
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.js +0 -78
- package/node_modules/typescript-7/dist/enums/typeFlags.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/typeFlags.js +0 -78
- package/node_modules/typescript-7/dist/enums/typeFlags.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts +0 -2
- package/node_modules/typescript-7/dist/enums/typePredicateKind.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts +0 -7
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js +0 -9
- package/node_modules/typescript-7/dist/enums/typePredicateKind.enum.js.map +0 -1
- package/node_modules/typescript-7/dist/enums/typePredicateKind.js +0 -9
- package/node_modules/typescript-7/dist/enums/typePredicateKind.js.map +0 -1
- package/node_modules/typescript-7/dist/internal/utils.d.ts +0 -23
- package/node_modules/typescript-7/dist/internal/utils.d.ts.map +0 -1
- package/node_modules/typescript-7/dist/internal/utils.js +0 -25
- package/node_modules/typescript-7/dist/internal/utils.js.map +0 -1
- package/node_modules/typescript-7/lib/getExePath.d.ts +0 -2
- package/node_modules/typescript-7/lib/getExePath.js +0 -70
- package/node_modules/typescript-7/lib/tsc.js +0 -28
- package/node_modules/typescript-7/lib/version.cjs +0 -3
- package/node_modules/typescript-7/lib/version.d.cts +0 -2
- package/node_modules/typescript-7/package.json +0 -87
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/License.txt +0 -11
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/README.md +0 -54
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.d.ts +0 -17
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/main.js +0 -83
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +0 -22
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/browser/ril.js +0 -210
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.d.ts +0 -14
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/api.js +0 -87
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +0 -32
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/cancellation.js +0 -132
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.d.ts +0 -367
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/connection.js +0 -1271
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +0 -9
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/disposable.js +0 -16
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +0 -52
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/encoding.js +0 -70
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.d.ts +0 -39
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/events.js +0 -135
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.d.ts +0 -7
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/is.js +0 -34
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +0 -55
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/linkedMap.js +0 -412
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +0 -18
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +0 -155
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +0 -77
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageReader.js +0 -246
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +0 -60
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messageWriter.js +0 -157
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.d.ts +0 -369
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/messages.js +0 -436
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.d.ts +0 -74
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/ral.js +0 -23
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +0 -10
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/semaphore.js +0 -74
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +0 -15
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -77
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.d.ts +0 -58
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/main.js +0 -289
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.d.ts +0 -12
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/lib/node/ril.js +0 -163
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/package.json +0 -54
- package/node_modules/typescript-7/vendor/vscode-jsonrpc/typings/thenable.d.ts +0 -5
- package/node_modules/valibot/LICENSE.md +0 -9
- package/node_modules/valibot/README.md +0 -94
- package/node_modules/valibot/dist/index.cjs +0 -7897
- package/node_modules/valibot/dist/index.d.cts +0 -16579
- package/node_modules/valibot/dist/index.d.mts +0 -16579
- package/node_modules/valibot/dist/index.min.cjs +0 -2
- package/node_modules/valibot/dist/index.min.mjs +0 -2
- package/node_modules/valibot/dist/index.mjs +0 -7577
- package/node_modules/valibot/package.json +0 -84
- /package/node_modules/@ykdz/{template-workspace/dist/generation-context.js → default-content-authoring/dist/contracts.js} +0 -0
- /package/node_modules/@ykdz/{template-workspace → default-content-authoring}/dist/environment-needs.js +0 -0
- /package/node_modules/@ykdz/{template-workspace/dist/default-package-role.d.ts → default-content-authoring/dist/package-role.d.ts} +0 -0
- /package/node_modules/@ykdz/{template-workspace/dist/default-package-role.js → default-content-authoring/dist/package-role.js} +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets/environment → reference-rust-bin/native/resources}/devcontainer/rust.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/agent-instructions.md +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/base.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/browser-test.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/github-cli.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/shellcheck.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/devcontainer/workspace-template.json +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/environment/editor-customization/capabilities.json +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/github/check.yml +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/github/dependabot.yml +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/gitignore +0 -0
- /package/node_modules/@ykdz/{template-workspace/assets → reference-workspace-root/native/resources}/next-steps.md +0 -0
- /package/node_modules/@ykdz/{template-workspace → reference-workspace-root/native}/scripts/task-gates.ts +0 -0
|
@@ -1,1147 +1,2015 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { lstat, readFile } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { isDeepStrictEqual } from "node:util";
|
|
5
5
|
import { assertContentIdentity, contentIdentityKey, contentIdentityLabel, createContentIndex, } from "@ykdz/template-core/content-identity";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
import { assertGenerationRecordMatchesBlueprint, parseGenerationRecordStructure, } from "@ykdz/template-core/generation-record";
|
|
7
|
+
import { assertJsonValue, printCanonicalJson, } from "@ykdz/template-core/json";
|
|
8
|
+
import { projectPackageContributions, } from "@ykdz/template-core/package-contribution";
|
|
9
|
+
import { assertProjectBlueprint, ProjectBlueprintValidationError, } from "@ykdz/template-core/project-blueprint";
|
|
10
|
+
import { commitProjectProjectionPlan, planProjectProjections, readProjectProjectionCurrent, } from "@ykdz/template-core/project-projection";
|
|
11
|
+
import { resolveReferenceDependencyIdentity } from "./owner-local-reference.js";
|
|
12
|
+
export { generationRecordSchema, parseGenerationRecordStructure, } from "@ykdz/template-core/generation-record";
|
|
13
|
+
export const generatorMetadataPaths = Object.freeze({
|
|
14
|
+
blueprint: ".template/blueprint.json",
|
|
15
|
+
generationRecord: ".template/generation.json",
|
|
16
|
+
});
|
|
17
|
+
export { resolveReferenceDependencyIdentity } from "./owner-local-reference.js";
|
|
18
|
+
function isRecord(value) {
|
|
19
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20
|
+
}
|
|
21
|
+
function packageId(value) {
|
|
22
|
+
const digest = createHash("sha256")
|
|
23
|
+
.update(printCanonicalJson(value))
|
|
24
|
+
.digest("hex");
|
|
25
|
+
return `package-${digest}`;
|
|
26
|
+
}
|
|
27
|
+
function selectionId(value) {
|
|
28
|
+
const digest = createHash("sha256")
|
|
29
|
+
.update(printCanonicalJson(value))
|
|
30
|
+
.digest("hex");
|
|
31
|
+
return `selection-${digest}`;
|
|
32
|
+
}
|
|
33
|
+
function comparePaths(left, right) {
|
|
34
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
35
|
+
}
|
|
36
|
+
function mergeProjectionSources(...groups) {
|
|
37
|
+
const sources = new Map();
|
|
38
|
+
for (const group of groups) {
|
|
39
|
+
for (const source of group ?? []) {
|
|
40
|
+
if (!sources.has(source.identity)) {
|
|
41
|
+
sources.set(source.identity, { ...source });
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return [...sources.values()];
|
|
46
|
+
}
|
|
47
|
+
function projectionPath(packagePath, relativePath) {
|
|
48
|
+
return packagePath === "." ? relativePath : `${packagePath}/${relativePath}`;
|
|
49
|
+
}
|
|
50
|
+
function errorMessage(error) {
|
|
51
|
+
return error instanceof Error ? error.message : String(error);
|
|
52
|
+
}
|
|
53
|
+
function dependencyIdentityCacheKey(consumer, dependencyKey) {
|
|
54
|
+
return JSON.stringify([contentIdentityKey(consumer), dependencyKey]);
|
|
55
|
+
}
|
|
56
|
+
function conflictReason(conflicts) {
|
|
57
|
+
return conflicts.map((conflict) => conflict.reason).join("\n");
|
|
58
|
+
}
|
|
59
|
+
function preserveProjectionPaths(before, after) {
|
|
60
|
+
const entries = new Map(after.entries.map((entry) => [entry.path, entry]));
|
|
61
|
+
for (const entry of before.entries) {
|
|
62
|
+
if (!entries.has(entry.path))
|
|
63
|
+
entries.set(entry.path, entry);
|
|
64
|
+
}
|
|
65
|
+
const reconciliation = new Map(after.reconciliation.map((policy) => [policy.path, policy]));
|
|
66
|
+
for (const policy of before.reconciliation) {
|
|
67
|
+
if (!reconciliation.has(policy.path)) {
|
|
68
|
+
reconciliation.set(policy.path, policy);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
13
71
|
return {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
role: definition.role,
|
|
72
|
+
entries: [...entries.values()].toSorted((left, right) => comparePaths(left.path, right.path)),
|
|
73
|
+
reconciliation: [...reconciliation.values()].toSorted((left, right) => comparePaths(left.path, right.path)),
|
|
17
74
|
};
|
|
18
75
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
76
|
+
function isCanonicalRelativeFilePath(value) {
|
|
77
|
+
return (value.length > 0 &&
|
|
78
|
+
!value.includes("\0") &&
|
|
79
|
+
!value.includes("\\") &&
|
|
80
|
+
!value.startsWith("/") &&
|
|
81
|
+
value !== "." &&
|
|
82
|
+
value
|
|
83
|
+
.split("/")
|
|
84
|
+
.every((part) => part.length > 0 && part !== "." && part !== ".."));
|
|
21
85
|
}
|
|
22
|
-
function
|
|
23
|
-
return
|
|
86
|
+
function isNestedDirectory(parent, child) {
|
|
87
|
+
return parent === "." ? child !== "." : child.startsWith(`${parent}/`);
|
|
24
88
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
89
|
+
function packageDefinition(value) {
|
|
90
|
+
assertProjectBlueprint({
|
|
91
|
+
schemaVersion: 4,
|
|
92
|
+
packages: [{ packageDefinitionId: `package-${"0".repeat(64)}`, ...value }],
|
|
93
|
+
packageLinkIntents: [],
|
|
94
|
+
});
|
|
95
|
+
return { ...value };
|
|
96
|
+
}
|
|
97
|
+
function preparationSnapshot(value) {
|
|
98
|
+
if (!isRecord(value) || !Array.isArray(value.resources)) {
|
|
99
|
+
throw new Error("参考包准备结果必须是资源快照");
|
|
100
|
+
}
|
|
101
|
+
const paths = new Set();
|
|
102
|
+
const resources = value.resources.map((resource) => {
|
|
103
|
+
if (!isRecord(resource) ||
|
|
104
|
+
typeof resource.path !== "string" ||
|
|
105
|
+
!isCanonicalRelativeFilePath(resource.path) ||
|
|
106
|
+
!(resource.content instanceof Uint8Array) ||
|
|
107
|
+
!Number.isInteger(resource.mode) ||
|
|
108
|
+
resource.mode < 0 ||
|
|
109
|
+
(resource.mode & ~0o111) !== 0) {
|
|
110
|
+
throw new Error("参考包准备结果包含无效资源文件");
|
|
111
|
+
}
|
|
112
|
+
if (paths.has(resource.path)) {
|
|
113
|
+
throw new Error(`参考包准备结果包含重复资源:${resource.path}`);
|
|
114
|
+
}
|
|
115
|
+
paths.add(resource.path);
|
|
116
|
+
return {
|
|
117
|
+
path: resource.path,
|
|
118
|
+
content: resource.content.slice(),
|
|
119
|
+
mode: resource.mode,
|
|
120
|
+
};
|
|
121
|
+
});
|
|
122
|
+
return {
|
|
123
|
+
resources,
|
|
124
|
+
facts: structuredClone(value.facts),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function clonePreparation(value) {
|
|
128
|
+
return {
|
|
129
|
+
resources: value.resources.map((resource) => ({
|
|
130
|
+
path: resource.path,
|
|
131
|
+
content: resource.content.slice(),
|
|
132
|
+
mode: resource.mode,
|
|
133
|
+
})),
|
|
134
|
+
facts: structuredClone(value.facts),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function requireParsedCreationInput(content, value) {
|
|
138
|
+
if (value === undefined)
|
|
139
|
+
return undefined;
|
|
140
|
+
const parsed = content.definition.parseCreationInput(value);
|
|
141
|
+
assertJsonValue(parsed, "包创建输入");
|
|
142
|
+
return parsed;
|
|
30
143
|
}
|
|
31
144
|
function mergeCreationInput(defaults, supplied) {
|
|
32
145
|
if (defaults === undefined)
|
|
33
146
|
return supplied;
|
|
34
147
|
if (supplied === undefined)
|
|
35
148
|
return defaults;
|
|
149
|
+
if (!isRecord(defaults) || !isRecord(supplied)) {
|
|
150
|
+
throw new Error("预设创建输入只能通过对象进行补充");
|
|
151
|
+
}
|
|
36
152
|
return { ...defaults, ...supplied };
|
|
37
153
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
154
|
+
function excludedPackagePaths(definition, selectedPaths) {
|
|
155
|
+
return selectedPaths
|
|
156
|
+
.filter((candidate) => isNestedDirectory(definition.path, candidate))
|
|
157
|
+
.map((candidate) => definition.path === "."
|
|
158
|
+
? candidate
|
|
159
|
+
: candidate.slice(definition.path.length + 1));
|
|
160
|
+
}
|
|
161
|
+
function packageNodePaths(roots) {
|
|
162
|
+
const paths = [];
|
|
163
|
+
const visited = new Set();
|
|
164
|
+
const visit = (root) => {
|
|
165
|
+
if (visited.has(root))
|
|
166
|
+
return;
|
|
167
|
+
visited.add(root);
|
|
168
|
+
paths.push(root.definition.path);
|
|
169
|
+
for (const dependency of root.dependencies) {
|
|
170
|
+
visit(dependency.package);
|
|
171
|
+
}
|
|
46
172
|
};
|
|
173
|
+
for (const root of roots)
|
|
174
|
+
visit(root);
|
|
175
|
+
return paths;
|
|
47
176
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
177
|
+
function assertAcyclicPackageDrafts(roots, explicitlySelectedSharedReferences) {
|
|
178
|
+
const visiting = new Set();
|
|
179
|
+
const completed = new Map();
|
|
180
|
+
const packageIdFor = (node, parentId, dependencyKey) => {
|
|
181
|
+
if (node.restored !== undefined) {
|
|
182
|
+
return node.restored.packageDefinitionId;
|
|
183
|
+
}
|
|
184
|
+
const identityKey = contentIdentityKey(node.content.identity);
|
|
185
|
+
const shared = node.content.definition.instance === "shared";
|
|
186
|
+
const explicitRoot = shared ? undefined : node.explicitRoot;
|
|
187
|
+
const createdBy = explicitRoot?.createdBy ??
|
|
188
|
+
(shared
|
|
189
|
+
? explicitlySelectedSharedReferences.get(identityKey)
|
|
190
|
+
: undefined) ??
|
|
191
|
+
(parentId === undefined ? "initialization" : "shared-dependency");
|
|
192
|
+
const discriminator = shared
|
|
193
|
+
? "shared-reference"
|
|
194
|
+
: explicitRoot === undefined
|
|
195
|
+
? parentId === undefined || dependencyKey === undefined
|
|
196
|
+
? undefined
|
|
197
|
+
: `${parentId}:${dependencyKey}`
|
|
198
|
+
: `${explicitRoot.selectionId}:${explicitRoot.nodeIdentity}`;
|
|
199
|
+
if (discriminator === undefined) {
|
|
200
|
+
throw new Error("参考包实例缺少明确的创建地址");
|
|
201
|
+
}
|
|
202
|
+
return packageId({
|
|
203
|
+
contentIdentity: node.content.identity,
|
|
204
|
+
definition: node.definition,
|
|
205
|
+
creationInput: node.creationInput ?? null,
|
|
206
|
+
createdBy,
|
|
207
|
+
discriminator,
|
|
52
208
|
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return value.map((item) => {
|
|
68
|
-
const selection = readJson(item, "生成记录预设选择");
|
|
69
|
-
assertContentIdentity(selection);
|
|
70
|
-
const key = presetSelectionKey(selection);
|
|
71
|
-
if (seen.has(key))
|
|
72
|
-
throw new Error("生成记录的预设选择重复");
|
|
73
|
-
seen.add(key);
|
|
74
|
-
return { ...selection };
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
export function parseGenerationRecord(value) {
|
|
78
|
-
const record = parseGenerationRecordStructure(value);
|
|
79
|
-
const nodeInstances = record.nodeInstances;
|
|
80
|
-
const packageIds = new Set();
|
|
81
|
-
for (const packageRecord of record.packages) {
|
|
82
|
-
assertContentIdentity(packageRecord.contentIdentity);
|
|
83
|
-
if (packageIds.has(packageRecord.packageDefinitionId)) {
|
|
84
|
-
throw new Error("生成记录包含重复包实例:" + packageRecord.packageDefinitionId);
|
|
85
|
-
}
|
|
86
|
-
packageIds.add(packageRecord.packageDefinitionId);
|
|
87
|
-
}
|
|
88
|
-
for (const packageRecord of record.packages) {
|
|
89
|
-
for (const [identity, packageDefinitionId] of Object.entries(packageRecord.bindings)) {
|
|
90
|
-
if (identity.length === 0 || !packageIds.has(packageDefinitionId)) {
|
|
91
|
-
throw new Error(`生成记录中的内容 ${contentIdentityLabel(packageRecord.contentIdentity)} 包含无效实例绑定:${identity}`);
|
|
209
|
+
};
|
|
210
|
+
const visit = (node, parentId, dependencyKey) => {
|
|
211
|
+
const id = packageIdFor(node, parentId, dependencyKey);
|
|
212
|
+
if (visiting.has(id)) {
|
|
213
|
+
throw new Error("预设节点依赖形成循环");
|
|
214
|
+
}
|
|
215
|
+
const edges = node.dependencies.map((dependency) => ({
|
|
216
|
+
key: dependency.key,
|
|
217
|
+
packageId: packageIdFor(dependency.package, id, dependency.key),
|
|
218
|
+
}));
|
|
219
|
+
const previousEdges = completed.get(id);
|
|
220
|
+
if (previousEdges !== undefined) {
|
|
221
|
+
if (!isDeepStrictEqual(previousEdges, edges)) {
|
|
222
|
+
throw new Error("共享参考包的依赖绑定不一致");
|
|
92
223
|
}
|
|
224
|
+
return;
|
|
93
225
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
typeof packageDefinitionId !== "string" ||
|
|
98
|
-
!packageIds.has(packageDefinitionId)) {
|
|
99
|
-
throw new Error("生成记录的节点实例映射无效");
|
|
226
|
+
visiting.add(id);
|
|
227
|
+
for (const dependency of node.dependencies) {
|
|
228
|
+
visit(dependency.package, id, dependency.key);
|
|
100
229
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return {
|
|
104
|
-
schemaVersion: 4,
|
|
105
|
-
strategyIdentity: record.strategyIdentity,
|
|
106
|
-
strategyState: record.strategyState,
|
|
107
|
-
packages: record.packages,
|
|
108
|
-
nodeInstances: nodeInstances,
|
|
109
|
-
presetSelections,
|
|
230
|
+
visiting.delete(id);
|
|
231
|
+
completed.set(id, edges);
|
|
110
232
|
};
|
|
233
|
+
for (const root of roots)
|
|
234
|
+
visit(root);
|
|
111
235
|
}
|
|
112
|
-
function
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
? facts
|
|
123
|
-
: { facts, occupied: [...options.occupied].toSorted(), nonce };
|
|
124
|
-
const candidate = "package-" +
|
|
125
|
-
createHash("sha256").update(JSON.stringify(value)).digest("hex");
|
|
126
|
-
if (!options.occupied.has(candidate)) {
|
|
127
|
-
return candidate;
|
|
128
|
-
}
|
|
129
|
-
nonce += 1;
|
|
236
|
+
function requireUniqueNodes(roots) {
|
|
237
|
+
const seen = new Set();
|
|
238
|
+
for (const root of roots) {
|
|
239
|
+
if (!/^[a-z][a-z0-9-]*$/u.test(root.nodeIdentity)) {
|
|
240
|
+
throw new Error(`选择节点标识无效:${root.nodeIdentity}`);
|
|
241
|
+
}
|
|
242
|
+
if (seen.has(root.nodeIdentity)) {
|
|
243
|
+
throw new Error(`选择节点标识必须唯一:${root.nodeIdentity}`);
|
|
244
|
+
}
|
|
245
|
+
seen.add(root.nodeIdentity);
|
|
130
246
|
}
|
|
131
247
|
}
|
|
132
248
|
export function createGenerator(options) {
|
|
249
|
+
assertContentIdentity(options.composition.identity);
|
|
133
250
|
const contentIndex = createContentIndex(options.content);
|
|
134
|
-
const
|
|
135
|
-
const
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
content,
|
|
139
|
-
]));
|
|
140
|
-
const preparations = new WeakMap();
|
|
141
|
-
const preparedDefinitions = new WeakSet();
|
|
142
|
-
const prepareContent = (content) => {
|
|
143
|
-
const definition = content.definition;
|
|
144
|
-
if (preparedDefinitions.has(definition))
|
|
145
|
-
return preparations.get(definition);
|
|
146
|
-
const preparation = definition.prepare?.();
|
|
147
|
-
preparations.set(definition, preparation);
|
|
148
|
-
preparedDefinitions.add(definition);
|
|
149
|
-
return preparation;
|
|
251
|
+
const composition = options.composition;
|
|
252
|
+
const emptyProjectProjection = {
|
|
253
|
+
entries: [],
|
|
254
|
+
reconciliation: [],
|
|
150
255
|
};
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
256
|
+
const pendingPlans = new WeakMap();
|
|
257
|
+
const readMetadataFact = async (targetRoot, metadataPath) => {
|
|
258
|
+
const filePath = path.join(targetRoot, metadataPath);
|
|
259
|
+
try {
|
|
260
|
+
const stat = await lstat(filePath);
|
|
261
|
+
if (!stat.isFile()) {
|
|
262
|
+
return {
|
|
263
|
+
path: metadataPath,
|
|
264
|
+
kind: stat.isDirectory()
|
|
265
|
+
? "directory"
|
|
266
|
+
: stat.isSymbolicLink()
|
|
267
|
+
? "symbolic-link"
|
|
268
|
+
: "other",
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
path: metadataPath,
|
|
273
|
+
kind: "file",
|
|
274
|
+
content: new Uint8Array(await readFile(filePath)),
|
|
275
|
+
mode: stat.mode & 0o111,
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
if (error instanceof Error &&
|
|
280
|
+
"code" in error &&
|
|
281
|
+
(error.code === "ENOENT" || error.code === "ENOTDIR")) {
|
|
282
|
+
return { path: metadataPath, kind: "missing" };
|
|
283
|
+
}
|
|
284
|
+
throw error;
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
const readRestoredProject = async (targetRoot) => {
|
|
288
|
+
const paths = [
|
|
289
|
+
generatorMetadataPaths.blueprint,
|
|
290
|
+
generatorMetadataPaths.generationRecord,
|
|
291
|
+
];
|
|
292
|
+
const readFacts = await Promise.all(paths.map((metadataPath) => readMetadataFact(targetRoot, metadataPath)));
|
|
293
|
+
const [blueprintFact, generationRecordFact] = readFacts;
|
|
294
|
+
if (blueprintFact?.kind !== "file" ||
|
|
295
|
+
generationRecordFact?.kind !== "file") {
|
|
296
|
+
throw new Error("目标项目缺少可读取的 schema4 蓝图或 schema6 生成记录");
|
|
297
|
+
}
|
|
298
|
+
let blueprintValue;
|
|
299
|
+
let generationRecordValue;
|
|
300
|
+
try {
|
|
301
|
+
blueprintValue = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(blueprintFact.content));
|
|
302
|
+
generationRecordValue = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(generationRecordFact.content));
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
throw new Error(`生成元数据不是有效 JSON:${errorMessage(error)}`, {
|
|
306
|
+
cause: error,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
const blueprint = assertProjectBlueprint(blueprintValue);
|
|
310
|
+
const generationRecord = parseGenerationRecordStructure(generationRecordValue);
|
|
311
|
+
assertGenerationRecordMatchesBlueprint(generationRecord, blueprint);
|
|
312
|
+
return { restored: { blueprint, generationRecord }, readFacts };
|
|
313
|
+
};
|
|
314
|
+
const resolveReference = (selector) => contentIndex.resolve(selector, "reference");
|
|
315
|
+
const normalizeDependencyIdentity = (consumer, dependency, cache) => {
|
|
316
|
+
const cacheKey = dependencyIdentityCacheKey(consumer.identity, dependency.key);
|
|
317
|
+
const cached = cache.get(cacheKey);
|
|
318
|
+
if (cached !== undefined)
|
|
319
|
+
return cached.contentIdentity;
|
|
320
|
+
const identity = resolveReferenceDependencyIdentity({
|
|
321
|
+
consumerIdentity: consumer.identity,
|
|
322
|
+
dependency,
|
|
323
|
+
members: contentIndex.members,
|
|
324
|
+
});
|
|
325
|
+
cache.set(cacheKey, {
|
|
326
|
+
consumerContentIdentity: consumer.identity,
|
|
327
|
+
key: dependency.key,
|
|
328
|
+
contentIdentity: identity,
|
|
329
|
+
});
|
|
330
|
+
return identity;
|
|
331
|
+
};
|
|
332
|
+
const createPackageNodeDraft = (request) => {
|
|
333
|
+
const identityKey = contentIdentityKey(request.content.identity);
|
|
334
|
+
const sharedKey = request.content.definition.instance === "shared"
|
|
335
|
+
? identityKey
|
|
336
|
+
: undefined;
|
|
337
|
+
const cached = sharedKey === undefined
|
|
338
|
+
? undefined
|
|
339
|
+
: request.sharedDrafts?.get(sharedKey);
|
|
340
|
+
if (cached !== undefined) {
|
|
341
|
+
if (!isDeepStrictEqual(cached.definition, request.definition) ||
|
|
342
|
+
!isDeepStrictEqual(cached.creationInput ?? null, request.creationInput ?? null)) {
|
|
343
|
+
throw new Error(`共享参考包的创建事实不一致:${contentIdentityLabel(request.content.identity)}`);
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
...cached,
|
|
347
|
+
nodeIdentity: request.nodeIdentity,
|
|
348
|
+
layout: request.layout,
|
|
349
|
+
...(request.explicitRoot === undefined
|
|
350
|
+
? {}
|
|
351
|
+
: { explicitRoot: request.explicitRoot }),
|
|
352
|
+
dependencies: [...cached.dependencies],
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
const draft = {
|
|
356
|
+
content: request.content,
|
|
357
|
+
definition: request.definition,
|
|
358
|
+
creationInput: request.creationInput,
|
|
359
|
+
layout: request.layout,
|
|
360
|
+
nodeIdentity: request.nodeIdentity,
|
|
361
|
+
...(request.explicitRoot === undefined
|
|
362
|
+
? {}
|
|
363
|
+
: { explicitRoot: request.explicitRoot }),
|
|
364
|
+
...(request.restored === undefined ? {} : { restored: request.restored }),
|
|
365
|
+
dependencies: [],
|
|
366
|
+
};
|
|
367
|
+
if (sharedKey !== undefined)
|
|
368
|
+
request.sharedDrafts?.set(sharedKey, draft);
|
|
369
|
+
return draft;
|
|
370
|
+
};
|
|
371
|
+
const populatePackageNodeDraft = (options) => {
|
|
372
|
+
const { draft } = options;
|
|
373
|
+
const identityKey = contentIdentityKey(draft.content.identity);
|
|
374
|
+
if (options.ancestry.includes(identityKey)) {
|
|
375
|
+
throw new Error(`参考包依赖形成循环:${[...options.ancestry, identityKey].join(" → ")}`);
|
|
376
|
+
}
|
|
377
|
+
const dependencies = draft.content.definition.dependencies ?? [];
|
|
378
|
+
const dependencyKeys = new Set();
|
|
379
|
+
const bindings = options.dependencyBindings ?? {};
|
|
380
|
+
const bindingEntries = Object.entries(bindings);
|
|
381
|
+
for (const [key, target] of bindingEntries) {
|
|
382
|
+
if (key.trim().length === 0) {
|
|
383
|
+
throw new Error(`选择节点依赖绑定无效:${draft.nodeIdentity}/${key}`);
|
|
384
|
+
}
|
|
385
|
+
if (typeof target === "string") {
|
|
386
|
+
if (target.trim().length === 0 ||
|
|
387
|
+
!options.explicitTargets?.has(target)) {
|
|
388
|
+
throw new Error(`选择节点依赖绑定目标不存在:${draft.nodeIdentity}/${key}`);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
else if (!isRecord(target) ||
|
|
392
|
+
typeof target.packageDefinitionId !== "string" ||
|
|
393
|
+
target.packageDefinitionId.trim().length === 0 ||
|
|
394
|
+
!options.restoredTargets?.has(target.packageDefinitionId)) {
|
|
395
|
+
throw new Error(`选择节点依赖绑定目标不存在:${draft.nodeIdentity}/${key}`);
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
const populated = [];
|
|
399
|
+
const restoredDependencies = draft.restored === undefined
|
|
400
|
+
? new Map()
|
|
401
|
+
: new Map(draft.dependencies.map((dependency) => [
|
|
402
|
+
dependency.key,
|
|
403
|
+
dependency.package,
|
|
404
|
+
]));
|
|
405
|
+
for (const dependency of dependencies) {
|
|
406
|
+
if (dependency.key.trim().length === 0 ||
|
|
407
|
+
dependencyKeys.has(dependency.key)) {
|
|
408
|
+
throw new Error(`参考包依赖键不能为空且不能重复:${dependency.key}`);
|
|
409
|
+
}
|
|
410
|
+
dependencyKeys.add(dependency.key);
|
|
411
|
+
const providerIdentity = normalizeDependencyIdentity(draft.content, dependency, options.dependencyIdentities);
|
|
412
|
+
const restoredDependency = restoredDependencies.get(dependency.key);
|
|
413
|
+
const bindingTarget = bindings[dependency.key];
|
|
414
|
+
if (bindingTarget !== undefined) {
|
|
415
|
+
const selectedTarget = typeof bindingTarget === "string"
|
|
416
|
+
? options.explicitTargets?.get(bindingTarget)
|
|
417
|
+
: options.restoredTargets?.get(bindingTarget.packageDefinitionId);
|
|
418
|
+
if (selectedTarget === undefined) {
|
|
419
|
+
throw new Error(`选择节点依赖绑定目标不存在:${draft.nodeIdentity}/${dependency.key}`);
|
|
420
|
+
}
|
|
421
|
+
if (contentIdentityKey(selectedTarget.content.identity) !==
|
|
422
|
+
contentIdentityKey(providerIdentity)) {
|
|
423
|
+
throw new Error(`选择节点依赖绑定身份不一致:${draft.nodeIdentity}/${dependency.key}`);
|
|
424
|
+
}
|
|
425
|
+
if (dependency.creationInput !== undefined) {
|
|
426
|
+
const expectedInput = requireParsedCreationInput(selectedTarget.content, dependency.creationInput);
|
|
427
|
+
if (!isDeepStrictEqual(selectedTarget.creationInput ?? null, expectedInput ?? null)) {
|
|
428
|
+
throw new Error(`选择节点依赖创建输入不一致:${draft.nodeIdentity}/${dependency.key}`);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
const selectedTargetNode = selectedTarget.explicitRoot;
|
|
432
|
+
const existingSelection = options.existingSelection;
|
|
433
|
+
const selectedTargetId = selectedTarget.restored?.packageDefinitionId ??
|
|
434
|
+
(selectedTargetNode !== undefined &&
|
|
435
|
+
existingSelection !== undefined &&
|
|
436
|
+
selectedTargetNode.selectionId === existingSelection.selectionId
|
|
437
|
+
? existingSelection.recordedNodeIds?.[selectedTargetNode.nodeIdentity]
|
|
438
|
+
: undefined);
|
|
439
|
+
if (restoredDependency !== undefined &&
|
|
440
|
+
selectedTargetId !== restoredDependency.restored?.packageDefinitionId) {
|
|
441
|
+
throw new Error(`生成记录中的依赖绑定不一致:${draft.nodeIdentity} → ${dependency.key}`);
|
|
442
|
+
}
|
|
443
|
+
populated.push({
|
|
444
|
+
key: dependency.key,
|
|
445
|
+
package: restoredDependency ?? selectedTarget,
|
|
163
446
|
});
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
if (restoredDependency !== undefined) {
|
|
450
|
+
if (contentIdentityKey(restoredDependency.content.identity) !==
|
|
451
|
+
contentIdentityKey(providerIdentity)) {
|
|
452
|
+
throw new Error(`生成记录包含无效依赖绑定:${draft.nodeIdentity} → ${dependency.key}`);
|
|
453
|
+
}
|
|
454
|
+
if (dependency.creationInput !== undefined) {
|
|
455
|
+
const expectedInput = requireParsedCreationInput(restoredDependency.content, dependency.creationInput);
|
|
456
|
+
if (!isDeepStrictEqual(restoredDependency.creationInput ?? null, expectedInput ?? null)) {
|
|
457
|
+
throw new Error(`生成记录中的依赖创建事实不一致:${draft.nodeIdentity} → ${dependency.key}`);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
populated.push({ key: dependency.key, package: restoredDependency });
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
const provider = resolveReference(providerIdentity);
|
|
464
|
+
const providerCreationInput = requireParsedCreationInput(provider, dependency.creationInput);
|
|
465
|
+
const providerDefinition = packageDefinition(provider.definition.createDefinition({
|
|
466
|
+
conventions: options.conventions,
|
|
467
|
+
creationInput: providerCreationInput,
|
|
468
|
+
}));
|
|
469
|
+
const providerNode = createPackageNodeDraft({
|
|
470
|
+
content: provider,
|
|
471
|
+
nodeIdentity: `${draft.nodeIdentity}-${dependency.key}`,
|
|
472
|
+
creationInput: providerCreationInput,
|
|
473
|
+
definition: providerDefinition,
|
|
474
|
+
layout: undefined,
|
|
475
|
+
sharedDrafts: options.sharedDrafts,
|
|
476
|
+
});
|
|
477
|
+
populatePackageNodeDraft({
|
|
478
|
+
draft: providerNode,
|
|
479
|
+
conventions: options.conventions,
|
|
480
|
+
ancestry: [...options.ancestry, identityKey],
|
|
481
|
+
sharedDrafts: options.sharedDrafts,
|
|
482
|
+
dependencyIdentities: options.dependencyIdentities,
|
|
483
|
+
...(options.existingSelection === undefined
|
|
484
|
+
? {}
|
|
485
|
+
: { existingSelection: options.existingSelection }),
|
|
486
|
+
});
|
|
487
|
+
populated.push({ key: dependency.key, package: providerNode });
|
|
488
|
+
}
|
|
489
|
+
if (draft.restored !== undefined) {
|
|
490
|
+
for (const dependency of draft.dependencies) {
|
|
491
|
+
if (!dependencyKeys.has(dependency.key))
|
|
492
|
+
populated.push(dependency);
|
|
164
493
|
}
|
|
165
|
-
|
|
166
|
-
|
|
494
|
+
}
|
|
495
|
+
for (const [key] of bindingEntries) {
|
|
496
|
+
if (!dependencyKeys.has(key)) {
|
|
497
|
+
throw new Error(`选择节点依赖绑定键不存在:${draft.nodeIdentity}/${key}`);
|
|
167
498
|
}
|
|
168
499
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
options_.configuration !== undefined) &&
|
|
187
|
-
nodes.length !== 1) {
|
|
188
|
-
throw new Error("多节点预设不能接收单一包创建输入");
|
|
189
|
-
}
|
|
190
|
-
return nodes.map(([nodeIdentity, node]) => {
|
|
191
|
-
const creationInput = mergeCreationInput(node.creationInput?.[options_.operation], options_.creationInput);
|
|
192
|
-
const reference = contentIndex.fromDefinition(node.reference, "reference", { namespace: options_.preset.identity.namespace });
|
|
500
|
+
draft.dependencies = populated;
|
|
501
|
+
};
|
|
502
|
+
const preparePackageNode = async (draft, selectedPaths, preparedDrafts) => {
|
|
503
|
+
const existing = preparedDrafts.get(draft);
|
|
504
|
+
if (existing !== undefined)
|
|
505
|
+
return existing;
|
|
506
|
+
const pending = (async () => {
|
|
507
|
+
const preparedDependencies = [];
|
|
508
|
+
for (const dependency of draft.dependencies) {
|
|
509
|
+
preparedDependencies.push({
|
|
510
|
+
key: dependency.key,
|
|
511
|
+
package: await preparePackageNode(dependency.package, selectedPaths, preparedDrafts),
|
|
512
|
+
});
|
|
513
|
+
}
|
|
514
|
+
const prepared = preparationSnapshot(await draft.content.definition.prepare({
|
|
515
|
+
excludedPackagePaths: excludedPackagePaths(draft.definition, selectedPaths),
|
|
516
|
+
}));
|
|
193
517
|
return {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
518
|
+
content: draft.content,
|
|
519
|
+
preparation: prepared,
|
|
520
|
+
definition: draft.definition,
|
|
521
|
+
creationInput: draft.creationInput,
|
|
522
|
+
layout: draft.layout,
|
|
523
|
+
nodeIdentity: draft.nodeIdentity,
|
|
524
|
+
...(draft.explicitRoot === undefined
|
|
525
|
+
? {}
|
|
526
|
+
: { explicitRoot: draft.explicitRoot }),
|
|
527
|
+
...(draft.restored === undefined ? {} : { restored: draft.restored }),
|
|
528
|
+
dependencies: preparedDependencies,
|
|
201
529
|
};
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
530
|
+
})();
|
|
531
|
+
preparedDrafts.set(draft, pending);
|
|
532
|
+
return pending;
|
|
533
|
+
};
|
|
534
|
+
const restoredSelectionDrafts = (restored, dependencyIdentities = new Map()) => {
|
|
535
|
+
const { generationRecord, blueprint } = restored;
|
|
536
|
+
for (const requirement of restored.normalizedDependencies ?? []) {
|
|
537
|
+
const key = dependencyIdentityCacheKey(requirement.consumerContentIdentity, requirement.key);
|
|
538
|
+
const existing = dependencyIdentities.get(key);
|
|
539
|
+
if (existing !== undefined &&
|
|
540
|
+
contentIdentityKey(existing.contentIdentity) !==
|
|
541
|
+
contentIdentityKey(requirement.contentIdentity)) {
|
|
542
|
+
throw new Error("缓存的内容依赖身份不一致");
|
|
543
|
+
}
|
|
544
|
+
dependencyIdentities.set(key, requirement);
|
|
208
545
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
546
|
+
if (contentIdentityKey(generationRecord.composition.identity) !==
|
|
547
|
+
contentIdentityKey(composition.identity)) {
|
|
548
|
+
throw new Error("目标项目使用了不兼容的组合定义");
|
|
549
|
+
}
|
|
550
|
+
assertGenerationRecordMatchesBlueprint(generationRecord, blueprint);
|
|
551
|
+
const conventions = composition.parseConventions(generationRecord.composition.conventions);
|
|
552
|
+
assertJsonValue(conventions, "组合约定");
|
|
553
|
+
if (!isDeepStrictEqual(conventions, generationRecord.composition.conventions)) {
|
|
554
|
+
throw new Error("生成记录中的组合约定不符合当前组合定义");
|
|
555
|
+
}
|
|
556
|
+
const recordsById = new Map(generationRecord.packages.map((item) => [item.packageDefinitionId, item]));
|
|
219
557
|
const definitionsById = new Map(blueprint.packages.map((definition) => [
|
|
220
558
|
definition.packageDefinitionId,
|
|
221
559
|
definition,
|
|
222
560
|
]));
|
|
223
|
-
|
|
224
|
-
|
|
561
|
+
const contentsById = new Map();
|
|
562
|
+
const inputsById = new Map();
|
|
563
|
+
const draftsById = new Map();
|
|
564
|
+
const sharedIdentities = new Set();
|
|
565
|
+
for (const item of generationRecord.packages) {
|
|
566
|
+
const content = resolveReference(item.contentIdentity);
|
|
567
|
+
const definition = definitionsById.get(item.packageDefinitionId);
|
|
568
|
+
if (definition === undefined) {
|
|
569
|
+
throw new Error(`项目蓝图缺少包实例:${item.packageDefinitionId}`);
|
|
570
|
+
}
|
|
571
|
+
const creationInput = item.creationInput === null
|
|
572
|
+
? undefined
|
|
573
|
+
: requireParsedCreationInput(content, item.creationInput);
|
|
574
|
+
if (!isDeepStrictEqual(creationInput ?? null, item.creationInput)) {
|
|
575
|
+
throw new Error(`生成记录中的创建事实不规范:${item.packageDefinitionId}`);
|
|
576
|
+
}
|
|
577
|
+
contentsById.set(item.packageDefinitionId, content);
|
|
578
|
+
inputsById.set(item.packageDefinitionId, creationInput);
|
|
579
|
+
if (content.definition.instance === "shared") {
|
|
580
|
+
const identity = contentIdentityKey(content.identity);
|
|
581
|
+
if (sharedIdentities.has(identity)) {
|
|
582
|
+
throw new Error(`共享参考包必须只有一个实例:${contentIdentityLabel(content.identity)}`);
|
|
583
|
+
}
|
|
584
|
+
sharedIdentities.add(identity);
|
|
585
|
+
}
|
|
225
586
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
587
|
+
const explicitBindingsByConsumer = new Map();
|
|
588
|
+
for (const selection of generationRecord.selections) {
|
|
589
|
+
if (selection.presetIdentity === null)
|
|
590
|
+
continue;
|
|
591
|
+
const preset = contentIndex.resolve(selection.presetIdentity, "preset");
|
|
592
|
+
const definition = preset.definition;
|
|
593
|
+
if (!isRecord(definition) ||
|
|
594
|
+
definition.kind !== "preset" ||
|
|
595
|
+
!isRecord(definition.nodes)) {
|
|
596
|
+
throw new Error(`预设定义无效:${contentIdentityLabel(preset.identity)}`);
|
|
229
597
|
}
|
|
598
|
+
const presetNodes = Object.entries(definition.nodes);
|
|
599
|
+
if (presetNodes.length !== Object.keys(selection.nodes).length ||
|
|
600
|
+
presetNodes.some(([nodeIdentity]) => !Object.hasOwn(selection.nodes, nodeIdentity))) {
|
|
601
|
+
throw new Error(`生成记录中的预设选择与当前定义不一致:${contentIdentityLabel(preset.identity)}`);
|
|
602
|
+
}
|
|
603
|
+
for (const [nodeIdentity, rawNode] of presetNodes) {
|
|
604
|
+
if (!isRecord(rawNode) || !isRecord(rawNode.reference)) {
|
|
605
|
+
throw new Error(`预设节点定义无效:${nodeIdentity}`);
|
|
606
|
+
}
|
|
607
|
+
const consumerId = selection.nodes[nodeIdentity];
|
|
608
|
+
const consumerRecord = consumerId === undefined ? undefined : recordsById.get(consumerId);
|
|
609
|
+
const consumer = consumerId === undefined ? undefined : contentsById.get(consumerId);
|
|
610
|
+
const expected = resolveReference({
|
|
611
|
+
alias: String(rawNode.reference.alias),
|
|
612
|
+
namespace: preset.identity.namespace,
|
|
613
|
+
});
|
|
614
|
+
if (consumerId === undefined ||
|
|
615
|
+
consumerRecord === undefined ||
|
|
616
|
+
consumer === undefined ||
|
|
617
|
+
contentIdentityKey(consumer.identity) !==
|
|
618
|
+
contentIdentityKey(expected.identity)) {
|
|
619
|
+
throw new Error(`生成记录中的预设节点引用不一致:${nodeIdentity}`);
|
|
620
|
+
}
|
|
621
|
+
const rawBindings = rawNode.dependencyBindings;
|
|
622
|
+
if (rawBindings === undefined)
|
|
623
|
+
continue;
|
|
624
|
+
if (!isRecord(rawBindings)) {
|
|
625
|
+
throw new Error(`预设节点依赖绑定无效:${nodeIdentity}`);
|
|
626
|
+
}
|
|
627
|
+
const declarations = consumer.definition.dependencies ?? [];
|
|
628
|
+
const declaredKeys = new Set(declarations.map(({ key }) => key));
|
|
629
|
+
for (const [key, targetNodeIdentity] of Object.entries(rawBindings)) {
|
|
630
|
+
if (key.trim().length === 0 ||
|
|
631
|
+
typeof targetNodeIdentity !== "string" ||
|
|
632
|
+
targetNodeIdentity.trim().length === 0) {
|
|
633
|
+
throw new Error(`预设节点依赖绑定无效:${nodeIdentity}/${key}`);
|
|
634
|
+
}
|
|
635
|
+
if (!declaredKeys.has(key)) {
|
|
636
|
+
throw new Error(`预设节点依赖绑定键不存在:${nodeIdentity}/${key}`);
|
|
637
|
+
}
|
|
638
|
+
const providerId = selection.nodes[targetNodeIdentity];
|
|
639
|
+
const providerRecord = providerId === undefined ? undefined : recordsById.get(providerId);
|
|
640
|
+
const provider = providerId === undefined ? undefined : contentsById.get(providerId);
|
|
641
|
+
const dependency = declarations.find((item) => item.key === key);
|
|
642
|
+
if (providerId === undefined ||
|
|
643
|
+
providerRecord === undefined ||
|
|
644
|
+
provider === undefined ||
|
|
645
|
+
dependency === undefined) {
|
|
646
|
+
throw new Error(`预设节点依赖绑定目标不存在:${nodeIdentity}/${key}`);
|
|
647
|
+
}
|
|
648
|
+
const expectedIdentity = normalizeDependencyIdentity(consumer, dependency, dependencyIdentities);
|
|
649
|
+
if (contentIdentityKey(provider.identity) !==
|
|
650
|
+
contentIdentityKey(expectedIdentity) ||
|
|
651
|
+
consumerRecord.dependencyBindings[key] !== providerId) {
|
|
652
|
+
throw new Error(`生成记录中的预设节点依赖绑定不一致:${consumerId} → ${key}`);
|
|
653
|
+
}
|
|
654
|
+
const bindings = explicitBindingsByConsumer.get(consumerId) ?? new Map();
|
|
655
|
+
const existingProviderId = bindings.get(key);
|
|
656
|
+
if (existingProviderId !== undefined &&
|
|
657
|
+
existingProviderId !== providerId) {
|
|
658
|
+
throw new Error(`生成记录中的预设节点依赖绑定不一致:${consumerId} → ${key}`);
|
|
659
|
+
}
|
|
660
|
+
bindings.set(key, providerId);
|
|
661
|
+
explicitBindingsByConsumer.set(consumerId, bindings);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
const visiting = new Set();
|
|
666
|
+
const buildDraft = (id) => {
|
|
667
|
+
const existing = draftsById.get(id);
|
|
668
|
+
if (existing !== undefined)
|
|
669
|
+
return existing;
|
|
670
|
+
if (visiting.has(id))
|
|
671
|
+
throw new Error("生成记录依赖包含循环");
|
|
672
|
+
const item = recordsById.get(id);
|
|
673
|
+
const persistedDefinition = definitionsById.get(id);
|
|
674
|
+
const content = contentsById.get(id);
|
|
675
|
+
if (item === undefined ||
|
|
676
|
+
persistedDefinition === undefined ||
|
|
677
|
+
content === undefined) {
|
|
678
|
+
throw new Error(`生成记录引用了未知包实例:${id}`);
|
|
679
|
+
}
|
|
680
|
+
visiting.add(id);
|
|
681
|
+
const declarations = content.definition.dependencies ?? [];
|
|
682
|
+
const declaredKeys = new Set();
|
|
683
|
+
for (const dependency of declarations) {
|
|
684
|
+
if (dependency.key.trim().length === 0 ||
|
|
685
|
+
declaredKeys.has(dependency.key)) {
|
|
686
|
+
throw new Error(`参考包依赖键不能为空且不能重复:${dependency.key}`);
|
|
687
|
+
}
|
|
688
|
+
declaredKeys.add(dependency.key);
|
|
689
|
+
}
|
|
690
|
+
const recordedBindings = Object.entries(item.dependencyBindings);
|
|
691
|
+
if (recordedBindings.some(([key]) => key.trim().length === 0)) {
|
|
692
|
+
throw new Error(`生成记录中的依赖绑定与当前参考包不一致:${id}`);
|
|
693
|
+
}
|
|
694
|
+
const recordedKeys = new Set(recordedBindings.map(([key]) => key));
|
|
695
|
+
if (declarations.some(({ key }) => !recordedKeys.has(key))) {
|
|
696
|
+
throw new Error(`生成记录中的依赖绑定与当前参考包不一致:${id}`);
|
|
697
|
+
}
|
|
698
|
+
const dependencies = recordedBindings.map(([key, providerId]) => {
|
|
699
|
+
const providerRecord = providerId === undefined ? undefined : recordsById.get(providerId);
|
|
700
|
+
const providerContent = providerId === undefined ? undefined : contentsById.get(providerId);
|
|
701
|
+
if (providerId === undefined ||
|
|
702
|
+
providerRecord === undefined ||
|
|
703
|
+
providerContent === undefined) {
|
|
704
|
+
throw new Error(`生成记录包含无效依赖绑定:${id} → ${key}`);
|
|
705
|
+
}
|
|
706
|
+
const dependency = declarations.find((item) => item.key === key);
|
|
707
|
+
if (dependency !== undefined) {
|
|
708
|
+
const consumer = contentsById.get(id);
|
|
709
|
+
if (consumer === undefined) {
|
|
710
|
+
throw new Error(`生成记录引用了未知内容实例:${id}`);
|
|
711
|
+
}
|
|
712
|
+
const declaredIdentity = normalizeDependencyIdentity(consumer, dependency, dependencyIdentities);
|
|
713
|
+
if (contentIdentityKey(providerContent.identity) !==
|
|
714
|
+
contentIdentityKey(declaredIdentity)) {
|
|
715
|
+
throw new Error(`生成记录包含无效依赖绑定:${id} → ${key}`);
|
|
716
|
+
}
|
|
717
|
+
const explicitProviderId = explicitBindingsByConsumer
|
|
718
|
+
.get(id)
|
|
719
|
+
?.get(key);
|
|
720
|
+
if (explicitProviderId !== undefined &&
|
|
721
|
+
providerId !== explicitProviderId) {
|
|
722
|
+
throw new Error(`生成记录中的预设节点依赖绑定不一致:${id} → ${key}`);
|
|
723
|
+
}
|
|
724
|
+
const expectedInput = requireParsedCreationInput(providerContent, dependency.creationInput);
|
|
725
|
+
if (dependency.creationInput !== undefined &&
|
|
726
|
+
!isDeepStrictEqual(inputsById.get(providerId) ?? null, expectedInput ?? null)) {
|
|
727
|
+
throw new Error(`生成记录中的依赖创建事实不一致:${id} → ${key}`);
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
return { key, package: buildDraft(providerId) };
|
|
731
|
+
});
|
|
732
|
+
visiting.delete(id);
|
|
733
|
+
const { packageDefinitionId: _id, ...definition } = persistedDefinition;
|
|
734
|
+
const draft = {
|
|
735
|
+
content,
|
|
736
|
+
definition,
|
|
737
|
+
creationInput: inputsById.get(id),
|
|
738
|
+
layout: undefined,
|
|
739
|
+
nodeIdentity: `restored-${id}`,
|
|
740
|
+
restored: {
|
|
741
|
+
packageDefinitionId: id,
|
|
742
|
+
createdBy: item.createdBy,
|
|
743
|
+
},
|
|
744
|
+
dependencies,
|
|
745
|
+
};
|
|
746
|
+
draftsById.set(id, draft);
|
|
747
|
+
return draft;
|
|
748
|
+
};
|
|
749
|
+
const reachable = new Set();
|
|
750
|
+
const collectReachable = (id) => {
|
|
751
|
+
if (reachable.has(id))
|
|
752
|
+
return;
|
|
753
|
+
reachable.add(id);
|
|
754
|
+
const item = recordsById.get(id);
|
|
755
|
+
if (item === undefined)
|
|
756
|
+
throw new Error(`未知包实例:${id}`);
|
|
757
|
+
for (const providerId of Object.values(item.dependencyBindings)) {
|
|
758
|
+
collectReachable(providerId);
|
|
759
|
+
}
|
|
760
|
+
};
|
|
761
|
+
const result = generationRecord.selections.map((selection) => {
|
|
762
|
+
const nodeEntries = Object.entries(selection.nodes);
|
|
763
|
+
requireUniqueNodes(nodeEntries.map(([nodeIdentity]) => ({ nodeIdentity })));
|
|
764
|
+
if (selection.presetIdentity !== null) {
|
|
765
|
+
const preset = contentIndex.resolve(selection.presetIdentity, "preset");
|
|
766
|
+
const definition = preset.definition;
|
|
767
|
+
if (!isRecord(definition) ||
|
|
768
|
+
definition.kind !== "preset" ||
|
|
769
|
+
!isRecord(definition.nodes)) {
|
|
770
|
+
throw new Error(`预设定义无效:${contentIdentityLabel(preset.identity)}`);
|
|
771
|
+
}
|
|
772
|
+
const presetNodes = Object.entries(definition.nodes);
|
|
773
|
+
if (presetNodes.length !== nodeEntries.length ||
|
|
774
|
+
presetNodes.some(([nodeIdentity]) => !Object.hasOwn(selection.nodes, nodeIdentity))) {
|
|
775
|
+
throw new Error(`生成记录中的预设选择与当前定义不一致:${contentIdentityLabel(preset.identity)}`);
|
|
776
|
+
}
|
|
777
|
+
for (const [nodeIdentity, node] of presetNodes) {
|
|
778
|
+
if (!isRecord(node) || !isRecord(node.reference)) {
|
|
779
|
+
throw new Error(`预设节点定义无效:${nodeIdentity}`);
|
|
780
|
+
}
|
|
781
|
+
const rootRecord = recordsById.get(selection.nodes[nodeIdentity]);
|
|
782
|
+
const rootContent = rootRecord === undefined
|
|
783
|
+
? undefined
|
|
784
|
+
: contentsById.get(rootRecord.packageDefinitionId);
|
|
785
|
+
const expected = resolveReference({
|
|
786
|
+
alias: String(node.reference.alias),
|
|
787
|
+
namespace: preset.identity.namespace,
|
|
788
|
+
});
|
|
789
|
+
if (rootContent === undefined ||
|
|
790
|
+
contentIdentityKey(rootContent.identity) !==
|
|
791
|
+
contentIdentityKey(expected.identity)) {
|
|
792
|
+
throw new Error(`生成记录中的预设节点引用不一致:${nodeIdentity}`);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
const roots = nodeEntries.map(([nodeIdentity, id]) => {
|
|
797
|
+
collectReachable(id);
|
|
798
|
+
return { ...buildDraft(id), nodeIdentity };
|
|
799
|
+
});
|
|
800
|
+
// 规范化 JSON 会按键名排序 nodes,无法从记录恢复原始根数组顺序。
|
|
801
|
+
return {
|
|
802
|
+
presetIdentity: selection.presetIdentity,
|
|
803
|
+
selectionId: selection.selectionId,
|
|
804
|
+
recordedNodeIds: selection.nodes,
|
|
805
|
+
roots,
|
|
806
|
+
};
|
|
807
|
+
});
|
|
808
|
+
if (reachable.size !== recordsById.size) {
|
|
809
|
+
throw new Error("生成记录包含未被选择引用的包实例");
|
|
810
|
+
}
|
|
811
|
+
return result;
|
|
812
|
+
};
|
|
813
|
+
async function prepareProjectInternal(prepareOptions) {
|
|
814
|
+
const parsedConventions = prepareOptions.restored
|
|
815
|
+
? composition.parseConventions(prepareOptions.restored.generationRecord.composition.conventions)
|
|
816
|
+
: composition.parseConventions(prepareOptions.conventions);
|
|
817
|
+
const conventions = parsedConventions;
|
|
818
|
+
assertJsonValue(conventions, "组合约定");
|
|
819
|
+
if (prepareOptions.restored &&
|
|
820
|
+
!isDeepStrictEqual(conventions, prepareOptions.restored.generationRecord.composition.conventions)) {
|
|
821
|
+
throw new Error("生成记录中的组合约定不符合当前组合定义");
|
|
822
|
+
}
|
|
823
|
+
const dependencyIdentities = prepareOptions.dependencyIdentities ??
|
|
824
|
+
new Map();
|
|
825
|
+
const selectionDrafts = prepareOptions.restored
|
|
826
|
+
? restoredSelectionDrafts(prepareOptions.restored, dependencyIdentities)
|
|
827
|
+
: [];
|
|
828
|
+
const restoredTargetsById = new Map();
|
|
829
|
+
const indexRestoredTargets = (roots) => {
|
|
830
|
+
for (const root of roots) {
|
|
831
|
+
if (root.restored !== undefined) {
|
|
832
|
+
restoredTargetsById.set(root.restored.packageDefinitionId, root);
|
|
833
|
+
}
|
|
834
|
+
indexRestoredTargets(root.dependencies.map(({ package: item }) => item));
|
|
835
|
+
}
|
|
836
|
+
};
|
|
837
|
+
for (const selectionDraft of selectionDrafts) {
|
|
838
|
+
indexRestoredTargets(selectionDraft.roots);
|
|
839
|
+
}
|
|
840
|
+
const sharedDrafts = new Map();
|
|
841
|
+
const indexSharedDrafts = (roots) => {
|
|
842
|
+
for (const root of roots) {
|
|
843
|
+
if (root.content.definition.instance === "shared") {
|
|
844
|
+
sharedDrafts.set(contentIdentityKey(root.content.identity), root);
|
|
845
|
+
}
|
|
846
|
+
indexSharedDrafts(root.dependencies.map((item) => item.package));
|
|
847
|
+
}
|
|
848
|
+
};
|
|
849
|
+
for (const selectionDraft of selectionDrafts) {
|
|
850
|
+
indexSharedDrafts(selectionDraft.roots);
|
|
851
|
+
}
|
|
852
|
+
const operation = prepareOptions.operation;
|
|
853
|
+
const createdBy = operation === "init" ? "initialization" : "addition";
|
|
854
|
+
const identifyDraftSelection = (presetIdentity, roots) => selectionId({
|
|
855
|
+
compositionIdentity: composition.identity,
|
|
856
|
+
presetIdentity,
|
|
857
|
+
roots: roots.map((root) => ({
|
|
858
|
+
nodeIdentity: root.nodeIdentity,
|
|
859
|
+
contentIdentity: root.content.identity,
|
|
860
|
+
creationInput: root.creationInput ?? null,
|
|
861
|
+
definition: root.definition,
|
|
862
|
+
})),
|
|
863
|
+
});
|
|
864
|
+
const selectionRootFacts = (root, existingSelection) => {
|
|
865
|
+
const declaredKeys = new Set((root.content.definition.dependencies ?? []).map(({ key }) => key));
|
|
866
|
+
return {
|
|
867
|
+
nodeIdentity: root.nodeIdentity,
|
|
868
|
+
identity: contentIdentityKey(root.content.identity),
|
|
869
|
+
creationInput: root.creationInput ?? null,
|
|
870
|
+
definition: root.definition,
|
|
871
|
+
dependencies: root.dependencies
|
|
872
|
+
.filter(({ key }) => declaredKeys.has(key))
|
|
873
|
+
.map(({ key, package: dependency }) => {
|
|
874
|
+
if (dependency.restored !== undefined) {
|
|
875
|
+
return {
|
|
876
|
+
key,
|
|
877
|
+
target: {
|
|
878
|
+
packageDefinitionId: dependency.restored.packageDefinitionId,
|
|
879
|
+
},
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
if (dependency.explicitRoot !== undefined) {
|
|
883
|
+
const packageDefinitionId = dependency.explicitRoot.selectionId ===
|
|
884
|
+
existingSelection.selectionId
|
|
885
|
+
? existingSelection.recordedNodeIds?.[dependency.explicitRoot.nodeIdentity]
|
|
886
|
+
: undefined;
|
|
887
|
+
return {
|
|
888
|
+
key,
|
|
889
|
+
target: packageDefinitionId === undefined
|
|
890
|
+
? {
|
|
891
|
+
selectionId: dependency.explicitRoot.selectionId,
|
|
892
|
+
nodeIdentity: dependency.explicitRoot.nodeIdentity,
|
|
893
|
+
}
|
|
894
|
+
: { packageDefinitionId },
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
const existingRoot = existingSelection.roots.find((candidate) => candidate.nodeIdentity === root.nodeIdentity);
|
|
898
|
+
const existingDependency = existingRoot?.dependencies.find((candidate) => candidate.key === key)?.package;
|
|
899
|
+
const recordedPackageDefinitionId = existingDependency?.restored?.packageDefinitionId;
|
|
900
|
+
if (existingDependency !== undefined &&
|
|
901
|
+
recordedPackageDefinitionId !== undefined &&
|
|
902
|
+
contentIdentityKey(existingDependency.content.identity) ===
|
|
903
|
+
contentIdentityKey(dependency.content.identity) &&
|
|
904
|
+
isDeepStrictEqual(existingDependency.creationInput ?? null, dependency.creationInput ?? null) &&
|
|
905
|
+
isDeepStrictEqual(existingDependency.definition, dependency.definition)) {
|
|
906
|
+
return {
|
|
907
|
+
key,
|
|
908
|
+
target: { packageDefinitionId: recordedPackageDefinitionId },
|
|
909
|
+
};
|
|
910
|
+
}
|
|
911
|
+
return {
|
|
912
|
+
key,
|
|
913
|
+
target: {
|
|
914
|
+
identity: contentIdentityKey(dependency.content.identity),
|
|
915
|
+
creationInput: dependency.creationInput ?? null,
|
|
916
|
+
definition: dependency.definition,
|
|
917
|
+
},
|
|
918
|
+
};
|
|
919
|
+
})
|
|
920
|
+
.toSorted((left, right) => left.key < right.key ? -1 : left.key > right.key ? 1 : 0),
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
const appendSelection = (group) => {
|
|
924
|
+
const existing = selectionDrafts.find((candidate) => candidate.selectionId === group.selectionId);
|
|
925
|
+
if (existing !== undefined) {
|
|
926
|
+
const existingRoots = existing.roots
|
|
927
|
+
.map((root) => selectionRootFacts(root, existing))
|
|
928
|
+
.toSorted((left, right) => left.nodeIdentity < right.nodeIdentity
|
|
929
|
+
? -1
|
|
930
|
+
: left.nodeIdentity > right.nodeIdentity
|
|
931
|
+
? 1
|
|
932
|
+
: 0);
|
|
933
|
+
const requestedRoots = group.roots
|
|
934
|
+
.map((root) => selectionRootFacts(root, existing))
|
|
935
|
+
.toSorted((left, right) => left.nodeIdentity < right.nodeIdentity
|
|
936
|
+
? -1
|
|
937
|
+
: left.nodeIdentity > right.nodeIdentity
|
|
938
|
+
? 1
|
|
939
|
+
: 0);
|
|
940
|
+
const existingPresetIdentity = existing.presetIdentity === null
|
|
941
|
+
? null
|
|
942
|
+
: contentIdentityKey(existing.presetIdentity);
|
|
943
|
+
const requestedPresetIdentity = group.presetIdentity === null
|
|
944
|
+
? null
|
|
945
|
+
: contentIdentityKey(group.presetIdentity);
|
|
946
|
+
if (existingPresetIdentity === requestedPresetIdentity) {
|
|
947
|
+
if (!isDeepStrictEqual(existingRoots, requestedRoots)) {
|
|
948
|
+
throw new Error("相同选择标识对应不同的包创建事实");
|
|
949
|
+
}
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
throw new Error("生成记录包含重复选择标识");
|
|
953
|
+
}
|
|
954
|
+
selectionDrafts.push(group);
|
|
955
|
+
};
|
|
956
|
+
const selection = prepareOptions.selection;
|
|
957
|
+
const directRoots = selection?.roots ?? [];
|
|
958
|
+
if (directRoots.length > 0) {
|
|
959
|
+
const selectedRoots = directRoots.map((root) => ({
|
|
960
|
+
content: resolveReference(root.contentIdentity),
|
|
961
|
+
nodeIdentity: root.nodeIdentity,
|
|
962
|
+
rawCreationInput: root.creationInput,
|
|
963
|
+
layout: root.layout,
|
|
964
|
+
dependencyBindings: root.dependencyBindings,
|
|
965
|
+
}));
|
|
966
|
+
const preparedRoots = selectedRoots.map((root) => {
|
|
967
|
+
const creationInput = requireParsedCreationInput(root.content, root.rawCreationInput);
|
|
968
|
+
return {
|
|
969
|
+
...root,
|
|
970
|
+
creationInput,
|
|
971
|
+
definition: packageDefinition(root.content.definition.createDefinition({
|
|
972
|
+
conventions,
|
|
973
|
+
creationInput,
|
|
974
|
+
...(root.layout === undefined ? {} : { layout: root.layout }),
|
|
975
|
+
})),
|
|
976
|
+
};
|
|
977
|
+
});
|
|
978
|
+
const id = identifyDraftSelection(null, preparedRoots);
|
|
979
|
+
const matchedSelection = selectionDrafts.find((candidate) => candidate.selectionId === id);
|
|
980
|
+
const existingSelection = matchedSelection?.selectionId === undefined
|
|
981
|
+
? undefined
|
|
982
|
+
: {
|
|
983
|
+
selectionId: matchedSelection.selectionId,
|
|
984
|
+
...(matchedSelection.recordedNodeIds === undefined
|
|
985
|
+
? {}
|
|
986
|
+
: { recordedNodeIds: matchedSelection.recordedNodeIds }),
|
|
987
|
+
};
|
|
988
|
+
const roots = preparedRoots.map((root) => {
|
|
989
|
+
const explicitRoot = root.content.definition.instance === "independent"
|
|
990
|
+
? {
|
|
991
|
+
selectionId: id,
|
|
992
|
+
nodeIdentity: root.nodeIdentity,
|
|
993
|
+
createdBy,
|
|
994
|
+
}
|
|
995
|
+
: undefined;
|
|
996
|
+
return createPackageNodeDraft({
|
|
997
|
+
...root,
|
|
998
|
+
sharedDrafts,
|
|
999
|
+
...(explicitRoot === undefined ? {} : { explicitRoot }),
|
|
1000
|
+
});
|
|
1001
|
+
});
|
|
1002
|
+
requireUniqueNodes(roots);
|
|
1003
|
+
const rootsByIdentity = new Map(roots.map((root) => [root.nodeIdentity, root]));
|
|
1004
|
+
for (const root of roots) {
|
|
1005
|
+
const dependencyBindings = directRoots.find(({ nodeIdentity }) => nodeIdentity === root.nodeIdentity)?.dependencyBindings;
|
|
1006
|
+
if (dependencyBindings !== undefined && !isRecord(dependencyBindings)) {
|
|
1007
|
+
throw new Error(`选择节点依赖绑定无效:${root.nodeIdentity}`);
|
|
1008
|
+
}
|
|
1009
|
+
populatePackageNodeDraft({
|
|
1010
|
+
draft: root,
|
|
1011
|
+
conventions,
|
|
1012
|
+
ancestry: [],
|
|
1013
|
+
sharedDrafts,
|
|
1014
|
+
dependencyIdentities,
|
|
1015
|
+
explicitTargets: rootsByIdentity,
|
|
1016
|
+
restoredTargets: restoredTargetsById,
|
|
1017
|
+
...(existingSelection === undefined ? {} : { existingSelection }),
|
|
1018
|
+
...(dependencyBindings === undefined ? {} : { dependencyBindings }),
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
appendSelection({
|
|
1022
|
+
presetIdentity: null,
|
|
1023
|
+
selectionId: id,
|
|
1024
|
+
createdBy: operation === "init" ? "initialization" : "addition",
|
|
1025
|
+
roots,
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
for (const presetRequest of selection?.presets ?? []) {
|
|
1029
|
+
const presetMember = contentIndex.resolve(presetRequest.contentIdentity, "preset");
|
|
1030
|
+
const preset = presetMember.definition;
|
|
1031
|
+
if (!isRecord(preset) ||
|
|
1032
|
+
preset.kind !== "preset" ||
|
|
1033
|
+
!isRecord(preset.nodes)) {
|
|
1034
|
+
throw new Error(`预设定义无效:${contentIdentityLabel(presetMember.identity)}`);
|
|
1035
|
+
}
|
|
1036
|
+
const definition = preset;
|
|
1037
|
+
if (!definition.operations.includes(operation)) {
|
|
1038
|
+
throw new Error(`预设不支持${operation === "init" ? "初始化" : "加包"}:${contentIdentityLabel(presetMember.identity)}`);
|
|
1039
|
+
}
|
|
1040
|
+
const entries = Object.entries(definition.nodes);
|
|
1041
|
+
if (entries.length === 0)
|
|
1042
|
+
throw new Error("预设必须至少选择一个软件包节点");
|
|
1043
|
+
if (presetRequest.creationInput !== undefined && entries.length !== 1) {
|
|
1044
|
+
throw new Error("多节点预设不能接收单个软件包创建输入");
|
|
1045
|
+
}
|
|
1046
|
+
const presetRoots = [];
|
|
1047
|
+
for (const [nodeIdentity, node] of entries) {
|
|
1048
|
+
const selectedInput = mergeCreationInput(node.creationInput?.[operation], presetRequest.creationInput);
|
|
1049
|
+
const content = resolveReference({
|
|
1050
|
+
alias: node.reference.alias,
|
|
1051
|
+
namespace: presetMember.identity.namespace,
|
|
1052
|
+
});
|
|
1053
|
+
presetRoots.push({
|
|
1054
|
+
content,
|
|
1055
|
+
nodeIdentity,
|
|
1056
|
+
rawCreationInput: selectedInput,
|
|
1057
|
+
...(node.layout === undefined ? {} : { layout: node.layout }),
|
|
1058
|
+
});
|
|
1059
|
+
}
|
|
1060
|
+
const preparedRoots = presetRoots.map((root) => {
|
|
1061
|
+
const creationInput = requireParsedCreationInput(root.content, root.rawCreationInput);
|
|
1062
|
+
return {
|
|
1063
|
+
...root,
|
|
1064
|
+
creationInput,
|
|
1065
|
+
definition: packageDefinition(root.content.definition.createDefinition({
|
|
1066
|
+
conventions,
|
|
1067
|
+
creationInput,
|
|
1068
|
+
...(root.layout === undefined ? {} : { layout: root.layout }),
|
|
1069
|
+
})),
|
|
1070
|
+
};
|
|
1071
|
+
});
|
|
1072
|
+
const id = identifyDraftSelection(presetMember.identity, preparedRoots);
|
|
1073
|
+
const matchedSelection = selectionDrafts.find((candidate) => candidate.selectionId === id);
|
|
1074
|
+
const existingSelection = matchedSelection?.selectionId === undefined
|
|
1075
|
+
? undefined
|
|
1076
|
+
: {
|
|
1077
|
+
selectionId: matchedSelection.selectionId,
|
|
1078
|
+
...(matchedSelection.recordedNodeIds === undefined
|
|
1079
|
+
? {}
|
|
1080
|
+
: { recordedNodeIds: matchedSelection.recordedNodeIds }),
|
|
1081
|
+
};
|
|
1082
|
+
const rootsByIdentity = new Map();
|
|
1083
|
+
const roots = preparedRoots.map((root) => {
|
|
1084
|
+
const declaration = preset.nodes[root.nodeIdentity];
|
|
1085
|
+
const dependencyBindings = declaration !== undefined && isRecord(declaration)
|
|
1086
|
+
? declaration.dependencyBindings
|
|
1087
|
+
: undefined;
|
|
1088
|
+
if (dependencyBindings !== undefined && !isRecord(dependencyBindings)) {
|
|
1089
|
+
throw new Error(`预设节点依赖绑定无效:${root.nodeIdentity}`);
|
|
1090
|
+
}
|
|
1091
|
+
const explicitRoot = root.content.definition.instance === "independent"
|
|
1092
|
+
? {
|
|
1093
|
+
selectionId: id,
|
|
1094
|
+
nodeIdentity: root.nodeIdentity,
|
|
1095
|
+
createdBy,
|
|
1096
|
+
}
|
|
1097
|
+
: undefined;
|
|
1098
|
+
const draft = createPackageNodeDraft({
|
|
1099
|
+
...root,
|
|
1100
|
+
sharedDrafts,
|
|
1101
|
+
...(explicitRoot === undefined ? {} : { explicitRoot }),
|
|
1102
|
+
});
|
|
1103
|
+
rootsByIdentity.set(root.nodeIdentity, draft);
|
|
1104
|
+
return draft;
|
|
1105
|
+
});
|
|
1106
|
+
requireUniqueNodes(roots);
|
|
1107
|
+
for (const root of roots) {
|
|
1108
|
+
const declaration = preset.nodes[root.nodeIdentity];
|
|
1109
|
+
const dependencyBindings = declaration !== undefined && isRecord(declaration)
|
|
1110
|
+
? declaration.dependencyBindings
|
|
1111
|
+
: undefined;
|
|
1112
|
+
populatePackageNodeDraft({
|
|
1113
|
+
draft: root,
|
|
1114
|
+
conventions,
|
|
1115
|
+
ancestry: [],
|
|
1116
|
+
sharedDrafts,
|
|
1117
|
+
dependencyIdentities,
|
|
1118
|
+
explicitTargets: rootsByIdentity,
|
|
1119
|
+
...(existingSelection === undefined ? {} : { existingSelection }),
|
|
1120
|
+
...(dependencyBindings === undefined ? {} : { dependencyBindings }),
|
|
1121
|
+
});
|
|
1122
|
+
}
|
|
1123
|
+
appendSelection({
|
|
1124
|
+
presetIdentity: presetMember.identity,
|
|
1125
|
+
selectionId: id,
|
|
1126
|
+
createdBy: operation === "init" ? "initialization" : "addition",
|
|
1127
|
+
roots,
|
|
1128
|
+
});
|
|
1129
|
+
}
|
|
1130
|
+
if (selectionDrafts.length === 0) {
|
|
1131
|
+
throw new Error(prepareOptions.restored
|
|
1132
|
+
? "生成记录至少需要一个选择"
|
|
1133
|
+
: operation === "init"
|
|
1134
|
+
? "初始化至少需要选择一个参考包或预设"
|
|
1135
|
+
: "加包至少需要选择一个参考包或预设");
|
|
1136
|
+
}
|
|
1137
|
+
const explicitlySelectedSharedReferences = new Map();
|
|
1138
|
+
for (const selectionDraft of selectionDrafts) {
|
|
1139
|
+
if (selectionDraft.createdBy === undefined)
|
|
1140
|
+
continue;
|
|
1141
|
+
for (const root of selectionDraft.roots) {
|
|
1142
|
+
if (root.content.definition.instance === "shared") {
|
|
1143
|
+
explicitlySelectedSharedReferences.set(contentIdentityKey(root.content.identity), selectionDraft.createdBy);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
assertAcyclicPackageDrafts(selectionDrafts.flatMap((item) => item.roots), explicitlySelectedSharedReferences);
|
|
1148
|
+
const selectedPaths = [
|
|
1149
|
+
...new Set(selectionDrafts.flatMap((selection) => packageNodePaths(selection.roots))),
|
|
1150
|
+
];
|
|
1151
|
+
const selections = [];
|
|
1152
|
+
const preparedDrafts = new WeakMap();
|
|
1153
|
+
for (const selection of selectionDrafts) {
|
|
1154
|
+
const roots = [];
|
|
1155
|
+
for (const root of selection.roots) {
|
|
1156
|
+
roots.push(await preparePackageNode(root, selectedPaths, preparedDrafts));
|
|
1157
|
+
}
|
|
1158
|
+
selections.push({
|
|
1159
|
+
presetIdentity: selection.presetIdentity,
|
|
1160
|
+
...(selection.selectionId === undefined
|
|
1161
|
+
? {}
|
|
1162
|
+
: { selectionId: selection.selectionId }),
|
|
1163
|
+
...(selection.recordedNodeIds === undefined
|
|
1164
|
+
? {}
|
|
1165
|
+
: { recordedNodeIds: selection.recordedNodeIds }),
|
|
1166
|
+
...(selection.createdBy === undefined
|
|
1167
|
+
? {}
|
|
1168
|
+
: { createdBy: selection.createdBy }),
|
|
1169
|
+
roots,
|
|
1170
|
+
});
|
|
230
1171
|
}
|
|
231
|
-
return
|
|
232
|
-
|
|
1172
|
+
return {
|
|
1173
|
+
conventions,
|
|
1174
|
+
composition: options.composition,
|
|
1175
|
+
selections,
|
|
1176
|
+
operationFacts: prepareOptions.operationFacts,
|
|
1177
|
+
...(prepareOptions.restored === undefined
|
|
1178
|
+
? {}
|
|
1179
|
+
: { restored: prepareOptions.restored }),
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1182
|
+
async function prepareProject(prepareOptions) {
|
|
1183
|
+
return prepareProjectInternal({ ...prepareOptions, operation: "init" });
|
|
1184
|
+
}
|
|
1185
|
+
async function restoreProject(restoreOptions) {
|
|
1186
|
+
const targetRoot = path.resolve(restoreOptions.repositoryRoot);
|
|
1187
|
+
const { restored, readFacts } = await readRestoredProject(targetRoot);
|
|
1188
|
+
const dependencyIdentities = new Map();
|
|
1189
|
+
restoredSelectionDrafts(restored, dependencyIdentities);
|
|
1190
|
+
const normalizedDependencies = [...dependencyIdentities.values()];
|
|
1191
|
+
const definitionsById = new Map(restored.blueprint.packages.map((definition) => [
|
|
1192
|
+
definition.packageDefinitionId,
|
|
1193
|
+
definition,
|
|
1194
|
+
]));
|
|
1195
|
+
const packages = restored.generationRecord.packages.map((item) => {
|
|
1196
|
+
const definition = definitionsById.get(item.packageDefinitionId);
|
|
233
1197
|
if (definition === undefined) {
|
|
234
|
-
throw new Error(
|
|
1198
|
+
throw new Error(`项目蓝图缺少包实例:${item.packageDefinitionId}`);
|
|
235
1199
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
1200
|
+
return {
|
|
1201
|
+
...item,
|
|
1202
|
+
definition,
|
|
1203
|
+
};
|
|
1204
|
+
});
|
|
1205
|
+
return {
|
|
1206
|
+
...restored,
|
|
1207
|
+
targetRoot,
|
|
1208
|
+
packages,
|
|
1209
|
+
selections: restored.generationRecord.selections,
|
|
1210
|
+
readFacts,
|
|
1211
|
+
normalizedDependencies,
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
const additionSelection = (selection) => "preset" in selection
|
|
1215
|
+
? {
|
|
1216
|
+
presets: [
|
|
1217
|
+
{
|
|
1218
|
+
contentIdentity: selection.preset,
|
|
1219
|
+
...(selection.creationInput === undefined
|
|
1220
|
+
? {}
|
|
1221
|
+
: { creationInput: selection.creationInput }),
|
|
1222
|
+
},
|
|
1223
|
+
],
|
|
1224
|
+
}
|
|
1225
|
+
: {
|
|
1226
|
+
roots: [
|
|
1227
|
+
{
|
|
1228
|
+
nodeIdentity: selection.nodeIdentity ?? "addition",
|
|
1229
|
+
contentIdentity: selection.contentIdentity,
|
|
1230
|
+
...(selection.creationInput === undefined
|
|
1231
|
+
? {}
|
|
1232
|
+
: { creationInput: selection.creationInput }),
|
|
1233
|
+
...(selection.layout === undefined
|
|
1234
|
+
? {}
|
|
1235
|
+
: { layout: selection.layout }),
|
|
1236
|
+
...(selection.dependencyBindings === undefined
|
|
1237
|
+
? {}
|
|
1238
|
+
: { dependencyBindings: selection.dependencyBindings }),
|
|
1239
|
+
},
|
|
1240
|
+
],
|
|
1241
|
+
};
|
|
1242
|
+
async function prepareAddProject(prepareOptions) {
|
|
1243
|
+
const restored = {
|
|
1244
|
+
blueprint: prepareOptions.restored.blueprint,
|
|
1245
|
+
generationRecord: prepareOptions.restored.generationRecord,
|
|
1246
|
+
normalizedDependencies: prepareOptions.restored.normalizedDependencies,
|
|
1247
|
+
};
|
|
1248
|
+
const dependencyIdentities = new Map(restored.normalizedDependencies?.map((requirement) => [
|
|
1249
|
+
dependencyIdentityCacheKey(requirement.consumerContentIdentity, requirement.key),
|
|
1250
|
+
requirement,
|
|
1251
|
+
]));
|
|
1252
|
+
const common = {
|
|
1253
|
+
restored,
|
|
1254
|
+
operation: "add",
|
|
1255
|
+
operationFacts: prepareOptions.operationFacts,
|
|
1256
|
+
dependencyIdentities,
|
|
1257
|
+
};
|
|
1258
|
+
const before = await prepareProjectInternal(common);
|
|
1259
|
+
const after = await prepareProjectInternal({
|
|
1260
|
+
...common,
|
|
1261
|
+
selection: additionSelection(prepareOptions.selection),
|
|
240
1262
|
});
|
|
1263
|
+
return {
|
|
1264
|
+
restored: prepareOptions.restored,
|
|
1265
|
+
before,
|
|
1266
|
+
after,
|
|
1267
|
+
readFacts: prepareOptions.restored.readFacts,
|
|
1268
|
+
};
|
|
241
1269
|
}
|
|
242
|
-
function
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
const content = requireContent(record.contentIdentity);
|
|
246
|
-
dependenciesByPackageId.set(record.definition.packageDefinitionId, options.strategy.dependencies({
|
|
247
|
-
content,
|
|
248
|
-
contentByIdentity,
|
|
249
|
-
configuration: record.configuration,
|
|
250
|
-
...(record.creationInput === null
|
|
251
|
-
? {}
|
|
252
|
-
: { creationInput: record.creationInput }),
|
|
253
|
-
}));
|
|
1270
|
+
function computeProject(preparedProject) {
|
|
1271
|
+
if (preparedProject.composition !== composition) {
|
|
1272
|
+
throw new Error("准备结果属于另一个组合定义");
|
|
254
1273
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
throw new Error(`生成记录中的内容 ${contentIdentityLabel(record.contentIdentity)} 缺少必要实例绑定:${contentIdentityLabel(dependency)}`);
|
|
269
|
-
}
|
|
270
|
-
const provider = findByPackageId(providers, packageDefinitionId);
|
|
271
|
-
if (contentIdentityKey(provider.contentIdentity) !== dependencyKey) {
|
|
272
|
-
throw new Error(`生成记录中的内容 ${contentIdentityLabel(record.contentIdentity)} 将依赖绑定到错误实例:${contentIdentityLabel(dependency)}`);
|
|
1274
|
+
const nodes = [];
|
|
1275
|
+
const sharedNodes = new Map();
|
|
1276
|
+
const nodesById = new Map();
|
|
1277
|
+
const nodesByPrepared = new WeakMap();
|
|
1278
|
+
const wiringNodes = new Set();
|
|
1279
|
+
const selectionRecords = [];
|
|
1280
|
+
const explicitlySelectedSharedReferences = new Map();
|
|
1281
|
+
for (const selection of preparedProject.selections) {
|
|
1282
|
+
if (selection.createdBy === undefined)
|
|
1283
|
+
continue;
|
|
1284
|
+
for (const root of selection.roots) {
|
|
1285
|
+
if (root.content.definition.instance === "shared") {
|
|
1286
|
+
explicitlySelectedSharedReferences.set(contentIdentityKey(root.content.identity), selection.createdBy);
|
|
273
1287
|
}
|
|
274
1288
|
}
|
|
275
1289
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
1290
|
+
const makeNode = (prepared, createdBy, discriminator) => {
|
|
1291
|
+
const preparedNode = nodesByPrepared.get(prepared);
|
|
1292
|
+
if (preparedNode !== undefined)
|
|
1293
|
+
return preparedNode;
|
|
1294
|
+
const identityKey = contentIdentityKey(prepared.content.identity);
|
|
1295
|
+
const restoredId = prepared.restored?.packageDefinitionId;
|
|
1296
|
+
if (restoredId !== undefined) {
|
|
1297
|
+
const restored = nodesById.get(restoredId);
|
|
1298
|
+
if (restored !== undefined) {
|
|
1299
|
+
if (contentIdentityKey(restored.content.identity) !== identityKey ||
|
|
1300
|
+
!isDeepStrictEqual(restored.definition, {
|
|
1301
|
+
...prepared.definition,
|
|
1302
|
+
packageDefinitionId: restoredId,
|
|
1303
|
+
}) ||
|
|
1304
|
+
!isDeepStrictEqual(restored.creationInput, prepared.creationInput ?? null) ||
|
|
1305
|
+
!isDeepStrictEqual(restored.preparation, prepared.preparation)) {
|
|
1306
|
+
throw new Error(`生成记录中的包实例事实不一致:${restoredId}`);
|
|
1307
|
+
}
|
|
1308
|
+
nodesByPrepared.set(prepared, restored);
|
|
1309
|
+
return restored;
|
|
1310
|
+
}
|
|
283
1311
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
1312
|
+
const sharedKey = prepared.content.definition.instance === "shared"
|
|
1313
|
+
? identityKey
|
|
1314
|
+
: undefined;
|
|
1315
|
+
if (sharedKey !== undefined) {
|
|
1316
|
+
const existing = sharedNodes.get(sharedKey);
|
|
1317
|
+
if (existing !== undefined) {
|
|
1318
|
+
if (!isDeepStrictEqual({
|
|
1319
|
+
name: existing.definition.name,
|
|
1320
|
+
path: existing.definition.path,
|
|
1321
|
+
role: existing.definition.role,
|
|
1322
|
+
}, prepared.definition) ||
|
|
1323
|
+
!isDeepStrictEqual(existing.creationInput, prepared.creationInput ?? null) ||
|
|
1324
|
+
!isDeepStrictEqual(existing.preparation, prepared.preparation)) {
|
|
1325
|
+
throw new Error(`共享参考包的创建事实不一致:${contentIdentityLabel(prepared.content.identity)}`);
|
|
1326
|
+
}
|
|
1327
|
+
if (restoredId !== undefined && existing.id !== restoredId) {
|
|
1328
|
+
throw new Error(`共享实例标识与生成记录不一致:${restoredId}`);
|
|
1329
|
+
}
|
|
1330
|
+
if (wiringNodes.has(existing)) {
|
|
1331
|
+
throw new Error("预设节点依赖形成循环");
|
|
1332
|
+
}
|
|
1333
|
+
wiringNodes.add(existing);
|
|
1334
|
+
const proposedDependencies = prepared.dependencies.map((dependency) => ({
|
|
1335
|
+
key: dependency.key,
|
|
1336
|
+
package: makeNode(dependency.package, "shared-dependency", `${existing.id}:${dependency.key}`),
|
|
1337
|
+
}));
|
|
1338
|
+
wiringNodes.delete(existing);
|
|
1339
|
+
if (proposedDependencies.length !== existing.dependencies.size ||
|
|
1340
|
+
proposedDependencies.some(({ key, package: provider }) => existing.dependencies.get(key)?.id !== provider.id)) {
|
|
1341
|
+
throw new Error("共享参考包的依赖绑定不一致");
|
|
1342
|
+
}
|
|
1343
|
+
nodesByPrepared.set(prepared, existing);
|
|
1344
|
+
return existing;
|
|
1345
|
+
}
|
|
290
1346
|
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
record,
|
|
1347
|
+
const explicitRoot = sharedKey === undefined ? prepared.explicitRoot : undefined;
|
|
1348
|
+
const effectiveCreatedBy = prepared.restored?.createdBy ??
|
|
1349
|
+
(sharedKey === undefined
|
|
1350
|
+
? undefined
|
|
1351
|
+
: explicitlySelectedSharedReferences.get(sharedKey)) ??
|
|
1352
|
+
explicitRoot?.createdBy ??
|
|
1353
|
+
createdBy;
|
|
1354
|
+
const definition = {
|
|
1355
|
+
...prepared.definition,
|
|
1356
|
+
packageDefinitionId: restoredId ??
|
|
1357
|
+
packageId({
|
|
1358
|
+
contentIdentity: prepared.content.identity,
|
|
1359
|
+
definition: prepared.definition,
|
|
1360
|
+
creationInput: prepared.creationInput ?? null,
|
|
1361
|
+
createdBy: effectiveCreatedBy,
|
|
1362
|
+
discriminator: sharedKey !== undefined
|
|
1363
|
+
? "shared-reference"
|
|
1364
|
+
: explicitRoot === undefined
|
|
1365
|
+
? discriminator
|
|
1366
|
+
: `${explicitRoot.selectionId}:${explicitRoot.nodeIdentity}`,
|
|
1367
|
+
}),
|
|
313
1368
|
};
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
1369
|
+
const node = {
|
|
1370
|
+
id: definition.packageDefinitionId,
|
|
1371
|
+
content: prepared.content,
|
|
1372
|
+
definition,
|
|
1373
|
+
createdBy: effectiveCreatedBy,
|
|
1374
|
+
creationInput: prepared.creationInput ?? null,
|
|
1375
|
+
preparation: prepared.preparation,
|
|
1376
|
+
dependencies: new Map(),
|
|
1377
|
+
};
|
|
1378
|
+
nodes.push(node);
|
|
1379
|
+
nodesById.set(node.id, node);
|
|
1380
|
+
nodesByPrepared.set(prepared, node);
|
|
1381
|
+
if (sharedKey !== undefined)
|
|
1382
|
+
sharedNodes.set(sharedKey, node);
|
|
1383
|
+
wiringNodes.add(node);
|
|
1384
|
+
for (const dependency of prepared.dependencies) {
|
|
1385
|
+
const provider = makeNode(dependency.package, "shared-dependency", `${definition.packageDefinitionId}:${dependency.key}`);
|
|
1386
|
+
node.dependencies.set(dependency.key, provider);
|
|
325
1387
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
1388
|
+
wiringNodes.delete(node);
|
|
1389
|
+
return node;
|
|
1390
|
+
};
|
|
1391
|
+
for (const selection of preparedProject.selections) {
|
|
1392
|
+
const id = selection.selectionId ??
|
|
1393
|
+
selectionId({
|
|
1394
|
+
compositionIdentity: composition.identity,
|
|
1395
|
+
presetIdentity: selection.presetIdentity,
|
|
1396
|
+
roots: selection.roots.map((root) => ({
|
|
1397
|
+
nodeIdentity: root.nodeIdentity,
|
|
1398
|
+
contentIdentity: root.content.identity,
|
|
1399
|
+
creationInput: root.creationInput ?? null,
|
|
1400
|
+
definition: root.definition,
|
|
1401
|
+
})),
|
|
1402
|
+
});
|
|
1403
|
+
const nodeIds = {};
|
|
1404
|
+
for (const root of selection.roots) {
|
|
1405
|
+
const node = makeNode(root, selection.createdBy ?? "initialization", `${id}:${root.nodeIdentity}`);
|
|
1406
|
+
const expected = selection.recordedNodeIds?.[root.nodeIdentity];
|
|
1407
|
+
if (expected !== undefined && expected !== node.id) {
|
|
1408
|
+
throw new Error(`生成记录中的选择节点实例不一致:${root.nodeIdentity}`);
|
|
331
1409
|
}
|
|
332
|
-
|
|
1410
|
+
nodeIds[root.nodeIdentity] = node.id;
|
|
333
1411
|
}
|
|
1412
|
+
if (selection.recordedNodeIds !== undefined &&
|
|
1413
|
+
Object.keys(selection.recordedNodeIds).length !==
|
|
1414
|
+
Object.keys(nodeIds).length) {
|
|
1415
|
+
throw new Error(`生成记录中的选择节点数量不一致:${id}`);
|
|
1416
|
+
}
|
|
1417
|
+
selectionRecords.push({
|
|
1418
|
+
selectionId: id,
|
|
1419
|
+
presetIdentity: selection.presetIdentity,
|
|
1420
|
+
nodes: nodeIds,
|
|
1421
|
+
});
|
|
334
1422
|
}
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
const
|
|
341
|
-
|
|
342
|
-
|
|
1423
|
+
if (preparedProject.restored !== undefined) {
|
|
1424
|
+
const recordedOrder = new Map(preparedProject.restored.generationRecord.packages.map((item, index) => [item.packageDefinitionId, index]));
|
|
1425
|
+
nodes.sort((left, right) => (recordedOrder.get(left.id) ?? Number.MAX_SAFE_INTEGER) -
|
|
1426
|
+
(recordedOrder.get(right.id) ?? Number.MAX_SAFE_INTEGER));
|
|
1427
|
+
}
|
|
1428
|
+
const packageRecords = nodes.map((node) => ({
|
|
1429
|
+
packageDefinitionId: node.id,
|
|
1430
|
+
contentIdentity: node.content.identity,
|
|
1431
|
+
createdBy: node.createdBy,
|
|
1432
|
+
creationInput: node.creationInput,
|
|
1433
|
+
dependencyBindings: Object.fromEntries([...node.dependencies.entries()].map(([key, provider]) => [
|
|
1434
|
+
key,
|
|
1435
|
+
provider.id,
|
|
1436
|
+
])),
|
|
1437
|
+
}));
|
|
1438
|
+
const packages = nodes.map((node) => ({
|
|
1439
|
+
packageDefinitionId: node.id,
|
|
1440
|
+
contentIdentity: node.content.identity,
|
|
343
1441
|
definition: node.definition,
|
|
344
|
-
bindings: nativeBindings,
|
|
345
1442
|
createdBy: node.createdBy,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
1443
|
+
creationInput: node.creationInput,
|
|
1444
|
+
dependencyBindings: Object.fromEntries([...node.dependencies.entries()].map(([key, provider]) => [
|
|
1445
|
+
key,
|
|
1446
|
+
provider.id,
|
|
1447
|
+
])),
|
|
1448
|
+
}));
|
|
1449
|
+
const bindingsFor = (node) => {
|
|
1450
|
+
const bindings = new Map();
|
|
1451
|
+
for (const { key } of node.content.definition.dependencies ?? []) {
|
|
1452
|
+
const provider = node.dependencies.get(key);
|
|
1453
|
+
if (provider === undefined) {
|
|
1454
|
+
throw new Error(`参考包依赖尚未绑定:${node.id} → ${key}`);
|
|
1455
|
+
}
|
|
1456
|
+
if (provider.contribution === undefined) {
|
|
1457
|
+
throw new Error(`依赖包尚未求值:${provider.id}`);
|
|
1458
|
+
}
|
|
1459
|
+
bindings.set(key, {
|
|
1460
|
+
packageDefinitionId: provider.id,
|
|
1461
|
+
contentIdentity: provider.content.identity,
|
|
1462
|
+
definition: provider.definition,
|
|
1463
|
+
facts: structuredClone(provider.contribution.facts),
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
return bindings;
|
|
351
1467
|
};
|
|
352
|
-
const
|
|
353
|
-
const contributionDefinition = contribution.definition;
|
|
354
|
-
if (contributionDefinition.name !== node.definition.name ||
|
|
355
|
-
contributionDefinition.path !== node.definition.path ||
|
|
356
|
-
contributionDefinition.role !== node.definition.role ||
|
|
357
|
-
("packageDefinitionId" in contributionDefinition &&
|
|
358
|
-
contributionDefinition.packageDefinitionId !==
|
|
359
|
-
node.record?.packageDefinitionId)) {
|
|
360
|
-
throw new Error(`内容 ${contentIdentityLabel(node.content.identity)} 返回的包定义与已分配实例不一致:${node.definition.path}`);
|
|
361
|
-
}
|
|
362
|
-
assertPackageContribution({
|
|
363
|
-
definition: node.definition,
|
|
364
|
-
operations: contribution.operations,
|
|
365
|
-
}, {
|
|
366
|
-
definitionName: contentIdentityLabel(node.content.identity),
|
|
367
|
-
planner: "内容贡献",
|
|
368
|
-
});
|
|
369
|
-
node.contribution = contribution;
|
|
370
|
-
return node.contribution;
|
|
371
|
-
}
|
|
372
|
-
function storedRecord(state, records, nodeInstances, presetSelections) {
|
|
373
|
-
return {
|
|
1468
|
+
const provisionalBlueprint = assertProjectBlueprint({
|
|
374
1469
|
schemaVersion: 4,
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
1470
|
+
packages: nodes.map((node) => node.definition),
|
|
1471
|
+
packageLinkIntents: [],
|
|
1472
|
+
});
|
|
1473
|
+
const resolution = composition.resolve({
|
|
1474
|
+
conventions: preparedProject.conventions,
|
|
1475
|
+
blueprint: provisionalBlueprint,
|
|
1476
|
+
selections: selectionRecords,
|
|
1477
|
+
packages,
|
|
1478
|
+
operationFacts: preparedProject.operationFacts,
|
|
1479
|
+
});
|
|
1480
|
+
for (const id of resolution.packageInputs.keys()) {
|
|
1481
|
+
if (!nodes.some((node) => node.id === id)) {
|
|
1482
|
+
throw new Error(`组合输入引用了未知软件包实例:${id}`);
|
|
1483
|
+
}
|
|
389
1484
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
1485
|
+
const blueprint = assertProjectBlueprint({
|
|
1486
|
+
...provisionalBlueprint,
|
|
1487
|
+
packageLinkIntents: resolution.packageLinkIntents ?? [],
|
|
1488
|
+
});
|
|
1489
|
+
if (preparedProject.restored !== undefined) {
|
|
1490
|
+
const existingIds = new Set(preparedProject.restored.generationRecord.packages.map((item) => item.packageDefinitionId));
|
|
1491
|
+
const existingBlueprintPackages = blueprint.packages.filter((item) => existingIds.has(item.packageDefinitionId));
|
|
1492
|
+
const recordedBlueprintPackages = preparedProject.restored.blueprint.packages.filter((item) => existingIds.has(item.packageDefinitionId));
|
|
1493
|
+
if (!isDeepStrictEqual(existingBlueprintPackages, recordedBlueprintPackages)) {
|
|
1494
|
+
throw new Error("回放后的包定义与持久蓝图不一致");
|
|
1495
|
+
}
|
|
1496
|
+
const existingLinks = blueprint.packageLinkIntents.filter(({ consumerId, providerId }) => existingIds.has(consumerId) && existingIds.has(providerId));
|
|
1497
|
+
if (!isDeepStrictEqual(existingLinks, preparedProject.restored.blueprint.packageLinkIntents)) {
|
|
1498
|
+
throw new Error("回放后的显式包连接与持久蓝图不一致");
|
|
397
1499
|
}
|
|
398
|
-
await presetMember.definition.validateUpdate?.({
|
|
399
|
-
targetRoot,
|
|
400
|
-
context,
|
|
401
|
-
contributions,
|
|
402
|
-
nodeInstances,
|
|
403
|
-
});
|
|
404
1500
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
1501
|
+
const visiting = new Set();
|
|
1502
|
+
const complete = new Set();
|
|
1503
|
+
const evaluate = (node) => {
|
|
1504
|
+
if (node.contribution !== undefined)
|
|
1505
|
+
return node.contribution;
|
|
1506
|
+
if (visiting.has(node.id))
|
|
1507
|
+
throw new Error("软件包依赖图包含循环");
|
|
1508
|
+
visiting.add(node.id);
|
|
1509
|
+
for (const provider of node.dependencies.values()) {
|
|
1510
|
+
evaluate(provider);
|
|
411
1511
|
}
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
1512
|
+
const contentPreparation = clonePreparation(node.preparation);
|
|
1513
|
+
const contribution = node.content.definition.evaluate({
|
|
1514
|
+
packageDefinitionId: node.id,
|
|
1515
|
+
definition: node.definition,
|
|
1516
|
+
createdBy: node.createdBy,
|
|
1517
|
+
creationInput: node.creationInput,
|
|
1518
|
+
prepared: contentPreparation,
|
|
1519
|
+
bindings: bindingsFor(node),
|
|
1520
|
+
conventions: structuredClone(preparedProject.conventions),
|
|
1521
|
+
stableCommon: structuredClone(resolution.stableCommon),
|
|
1522
|
+
packageInput: structuredClone(resolution.packageInputs.get(node.id)),
|
|
418
1523
|
});
|
|
1524
|
+
if (contribution.packageDefinitionId !== node.id) {
|
|
1525
|
+
throw new Error(`包贡献返回了错误的软件包实例标识:${node.id}`);
|
|
1526
|
+
}
|
|
1527
|
+
node.contribution = contribution;
|
|
1528
|
+
visiting.delete(node.id);
|
|
1529
|
+
complete.add(node.id);
|
|
1530
|
+
return contribution;
|
|
1531
|
+
};
|
|
1532
|
+
for (const node of nodes)
|
|
1533
|
+
evaluate(node);
|
|
1534
|
+
if (complete.size !== nodes.length)
|
|
1535
|
+
throw new Error("部分软件包贡献尚未求值");
|
|
1536
|
+
const compositionPackages = nodes.map((node) => ({
|
|
1537
|
+
package: packages.find((item) => item.packageDefinitionId === node.id),
|
|
1538
|
+
bindings: bindingsFor(node),
|
|
1539
|
+
contribution: node.contribution,
|
|
1540
|
+
}));
|
|
1541
|
+
const combined = composition.combine({
|
|
1542
|
+
conventions: preparedProject.conventions,
|
|
1543
|
+
stableCommon: structuredClone(resolution.stableCommon),
|
|
1544
|
+
blueprint,
|
|
1545
|
+
selections: selectionRecords,
|
|
1546
|
+
packages: compositionPackages,
|
|
419
1547
|
});
|
|
420
|
-
|
|
421
|
-
function project(context, state, blueprint, records, contributions, nodeInstances, presetSelections) {
|
|
422
|
-
const resolvedNodeInstances = resolveNodeInstances(records, nodeInstances);
|
|
423
|
-
const presetProjectContributions = computePresetProjectContributions(context, contributions, resolvedNodeInstances, presetSelections);
|
|
424
|
-
const projection = options.strategy.project({
|
|
425
|
-
context,
|
|
426
|
-
state,
|
|
1548
|
+
const projection = projectPackageContributions({
|
|
427
1549
|
blueprint,
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
1550
|
+
contributions: nodes.map((node) => node.contribution),
|
|
1551
|
+
...(combined.files === undefined
|
|
1552
|
+
? {}
|
|
1553
|
+
: { compositionFiles: combined.files }),
|
|
1554
|
+
...(combined.reconciliation === undefined
|
|
1555
|
+
? {}
|
|
1556
|
+
: { compositionReconciliation: combined.reconciliation }),
|
|
432
1557
|
});
|
|
433
|
-
const
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
1558
|
+
const sourcesByPackage = new Map(nodes.map((node) => [
|
|
1559
|
+
node.id,
|
|
1560
|
+
{
|
|
1561
|
+
identity: `content:${contentIdentityKey(node.content.identity)}:${node.id}`,
|
|
1562
|
+
label: `${contentIdentityLabel(node.content.identity)}(${node.definition.path})`,
|
|
1563
|
+
},
|
|
1564
|
+
]));
|
|
1565
|
+
const packageSources = [...sourcesByPackage.values()];
|
|
1566
|
+
const compositionSource = {
|
|
1567
|
+
identity: `composition:${contentIdentityKey(composition.identity)}`,
|
|
1568
|
+
label: `组合${contentIdentityLabel(composition.identity)}`,
|
|
1569
|
+
};
|
|
1570
|
+
const sourcesByPath = new Map();
|
|
1571
|
+
const addPathSources = (targetPath, sources) => {
|
|
1572
|
+
const existing = sourcesByPath.get(targetPath) ?? [];
|
|
1573
|
+
const definedSources = sources.filter((source) => source !== undefined);
|
|
1574
|
+
sourcesByPath.set(targetPath, mergeProjectionSources(existing, definedSources));
|
|
1575
|
+
};
|
|
1576
|
+
for (const node of nodes) {
|
|
1577
|
+
const source = sourcesByPackage.get(node.id);
|
|
1578
|
+
for (const file of node.contribution.files) {
|
|
1579
|
+
addPathSources(projectionPath(node.definition.path, file.path), [
|
|
1580
|
+
source,
|
|
1581
|
+
]);
|
|
1582
|
+
}
|
|
1583
|
+
for (const policy of node.contribution.reconciliation ?? []) {
|
|
1584
|
+
addPathSources(projectionPath(node.definition.path, policy.path), [
|
|
1585
|
+
source,
|
|
1586
|
+
]);
|
|
446
1587
|
}
|
|
447
|
-
allocatedDefinitions.delete(projectedDefinition.packageDefinitionId);
|
|
448
1588
|
}
|
|
449
|
-
|
|
450
|
-
|
|
1589
|
+
const combinedSources = [compositionSource, ...packageSources];
|
|
1590
|
+
for (const item of combined.files ?? []) {
|
|
1591
|
+
const definition = blueprint.packages.find((candidate) => candidate.packageDefinitionId === item.packageDefinitionId);
|
|
1592
|
+
addPathSources(projectionPath(definition.path, item.file.path), combinedSources);
|
|
1593
|
+
}
|
|
1594
|
+
for (const item of combined.reconciliation ?? []) {
|
|
1595
|
+
const definition = blueprint.packages.find((candidate) => candidate.packageDefinitionId === item.packageDefinitionId);
|
|
1596
|
+
addPathSources(projectionPath(definition.path, item.reconciliation.path), combinedSources);
|
|
451
1597
|
}
|
|
452
|
-
const
|
|
1598
|
+
const annotatedProjection = {
|
|
1599
|
+
entries: projection.entries.map((entry) => {
|
|
1600
|
+
const sources = mergeProjectionSources(entry.sources, sourcesByPath.get(entry.path));
|
|
1601
|
+
return sources.length === 0 ? entry : { ...entry, sources };
|
|
1602
|
+
}),
|
|
1603
|
+
reconciliation: projection.reconciliation.map((policy) => {
|
|
1604
|
+
const sources = mergeProjectionSources(policy.sources, sourcesByPath.get(policy.path));
|
|
1605
|
+
return sources.length === 0 ? policy : { ...policy, sources };
|
|
1606
|
+
}),
|
|
1607
|
+
};
|
|
1608
|
+
const metadataSources = mergeProjectionSources(packageSources, [
|
|
1609
|
+
compositionSource,
|
|
1610
|
+
]);
|
|
1611
|
+
const generationRecord = {
|
|
1612
|
+
schemaVersion: 6,
|
|
1613
|
+
composition: {
|
|
1614
|
+
identity: composition.identity,
|
|
1615
|
+
conventions: preparedProject.conventions,
|
|
1616
|
+
},
|
|
1617
|
+
packages: packageRecords,
|
|
1618
|
+
selections: selectionRecords,
|
|
1619
|
+
};
|
|
1620
|
+
assertGenerationRecordMatchesBlueprint(generationRecord, blueprint);
|
|
1621
|
+
const metadataEntries = [
|
|
1622
|
+
{
|
|
1623
|
+
path: generatorMetadataPaths.blueprint,
|
|
1624
|
+
kind: "file",
|
|
1625
|
+
content: printCanonicalJson(blueprint),
|
|
1626
|
+
mode: 0,
|
|
1627
|
+
sources: metadataSources,
|
|
1628
|
+
},
|
|
1629
|
+
{
|
|
1630
|
+
path: generatorMetadataPaths.generationRecord,
|
|
1631
|
+
kind: "file",
|
|
1632
|
+
content: printCanonicalJson(generationRecord),
|
|
1633
|
+
mode: 0,
|
|
1634
|
+
sources: metadataSources,
|
|
1635
|
+
},
|
|
1636
|
+
];
|
|
1637
|
+
const metadataReconciliation = metadataEntries.map((entry) => ({
|
|
1638
|
+
path: entry.path,
|
|
1639
|
+
driver: "canonical",
|
|
1640
|
+
...(entry.sources === undefined ? {} : { sources: entry.sources }),
|
|
1641
|
+
}));
|
|
1642
|
+
const finalProjection = {
|
|
1643
|
+
entries: [...annotatedProjection.entries, ...metadataEntries].toSorted((left, right) => comparePaths(left.path, right.path)),
|
|
1644
|
+
reconciliation: [
|
|
1645
|
+
...annotatedProjection.reconciliation,
|
|
1646
|
+
...metadataReconciliation,
|
|
1647
|
+
].toSorted((left, right) => comparePaths(left.path, right.path)),
|
|
1648
|
+
};
|
|
453
1649
|
return {
|
|
454
|
-
|
|
455
|
-
blueprint: projectedBlueprint,
|
|
456
|
-
operations: [
|
|
457
|
-
...projection.operations,
|
|
458
|
-
{
|
|
459
|
-
kind: "writeJson",
|
|
460
|
-
to: ".template/generation.json",
|
|
461
|
-
value: generationRecord,
|
|
462
|
-
},
|
|
463
|
-
],
|
|
1650
|
+
blueprint,
|
|
464
1651
|
generationRecord,
|
|
1652
|
+
projection: finalProjection,
|
|
1653
|
+
packages: nodes.map((node) => ({
|
|
1654
|
+
package: packages.find((item) => item.packageDefinitionId === node.id),
|
|
1655
|
+
bindings: bindingsFor(node),
|
|
1656
|
+
contribution: node.contribution,
|
|
1657
|
+
})),
|
|
1658
|
+
ownerFacts: combined.facts,
|
|
465
1659
|
};
|
|
466
1660
|
}
|
|
467
|
-
function
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
if (visiting.has(key)) {
|
|
475
|
-
throw new Error("显式内容依赖形成循环:" +
|
|
476
|
-
contentIdentityLabel(node.content.identity));
|
|
477
|
-
}
|
|
478
|
-
if (expanded.has(key))
|
|
479
|
-
return;
|
|
480
|
-
visiting.add(key);
|
|
481
|
-
if (node.record === undefined)
|
|
482
|
-
newNodes.set(key, node);
|
|
483
|
-
node.preparation = prepareContent(node.content);
|
|
484
|
-
node.preparationComplete = true;
|
|
485
|
-
const dependencies = options.strategy.dependencies({
|
|
486
|
-
content: node.content,
|
|
487
|
-
contentByIdentity,
|
|
488
|
-
configuration: node.configuration,
|
|
489
|
-
...(node.creationInput === undefined
|
|
490
|
-
? {}
|
|
491
|
-
: { creationInput: node.creationInput }),
|
|
1661
|
+
async function planInit(initOptions) {
|
|
1662
|
+
let prepared;
|
|
1663
|
+
try {
|
|
1664
|
+
prepared = await prepareProject({
|
|
1665
|
+
selection: initOptions.selection,
|
|
1666
|
+
conventions: initOptions.conventions,
|
|
1667
|
+
operationFacts: initOptions.operationFacts,
|
|
492
1668
|
});
|
|
493
|
-
for (const dependencyIdentity of dependencies) {
|
|
494
|
-
const dependencyKey = contentIdentityKey(dependencyIdentity);
|
|
495
|
-
const dependency = requireContent(dependencyIdentity);
|
|
496
|
-
const candidates = [...options_.existing, ...newNodes.values()].filter((candidate) => contentIdentityKey(candidate.content.identity) === dependencyKey);
|
|
497
|
-
const boundId = node.record?.bindings[dependencyKey];
|
|
498
|
-
const bound = boundId === undefined
|
|
499
|
-
? undefined
|
|
500
|
-
: candidates.find((candidate) => candidate.record?.packageDefinitionId === boundId);
|
|
501
|
-
if (bound === undefined && candidates.length > 1) {
|
|
502
|
-
throw new Error("依赖内容有多个持久实例,无法唯一绑定:" +
|
|
503
|
-
contentIdentityLabel(dependencyIdentity));
|
|
504
|
-
}
|
|
505
|
-
let provider = bound ?? candidates[0];
|
|
506
|
-
if (provider === undefined) {
|
|
507
|
-
if (dependency.definition.instance !== "shared") {
|
|
508
|
-
throw new Error("缺少明确的独立依赖实例:" +
|
|
509
|
-
contentIdentityLabel(dependencyIdentity));
|
|
510
|
-
}
|
|
511
|
-
const definition = options.strategy.createDefinition({
|
|
512
|
-
context: options_.context,
|
|
513
|
-
content: dependency,
|
|
514
|
-
});
|
|
515
|
-
const occupied = [...options_.existing, ...newNodes.values()].find((candidate) => candidate.definition.name === definition.name ||
|
|
516
|
-
candidate.definition.path === definition.path);
|
|
517
|
-
if (occupied !== undefined) {
|
|
518
|
-
throw new Error("共享依赖默认身份已被占用:" + definition.path);
|
|
519
|
-
}
|
|
520
|
-
provider = {
|
|
521
|
-
content: dependency,
|
|
522
|
-
definition,
|
|
523
|
-
createdBy: "shared-dependency",
|
|
524
|
-
configuration: normalizeConfiguration(dependency, undefined),
|
|
525
|
-
providers: new Map(),
|
|
526
|
-
};
|
|
527
|
-
newNodes.set(dependencyKey + "\u0000" + definition.path, provider);
|
|
528
|
-
}
|
|
529
|
-
node.providers.set(dependencyKey, provider);
|
|
530
|
-
visit(provider);
|
|
531
|
-
}
|
|
532
|
-
visiting.delete(key);
|
|
533
|
-
expanded.add(key);
|
|
534
|
-
};
|
|
535
|
-
const explicitByContent = new Set();
|
|
536
|
-
const explicitByPath = new Set();
|
|
537
|
-
const explicitByNode = new Set();
|
|
538
|
-
for (const root of options_.roots) {
|
|
539
|
-
const identity = contentIdentityKey(root.content.identity);
|
|
540
|
-
const key = identity + "\u0000" + root.definition.path;
|
|
541
|
-
if (explicitByNode.has(root.nodeIdentity ?? "")) {
|
|
542
|
-
throw new Error("显式初始化节点身份重复:" + root.nodeIdentity);
|
|
543
|
-
}
|
|
544
|
-
explicitByNode.add(root.nodeIdentity ?? "");
|
|
545
|
-
if (root.content.definition.instance === "independent" &&
|
|
546
|
-
explicitByContent.has(identity)) {
|
|
547
|
-
throw new Error("同一独立内容不能重复作为显式根:" +
|
|
548
|
-
contentIdentityLabel(root.content.identity));
|
|
549
|
-
}
|
|
550
|
-
explicitByContent.add(identity);
|
|
551
|
-
if (explicitByPath.has(root.definition.path)) {
|
|
552
|
-
throw new Error("显式初始化根路径重复:" + root.definition.path);
|
|
553
|
-
}
|
|
554
|
-
explicitByPath.add(root.definition.path);
|
|
555
|
-
if (root.record === undefined)
|
|
556
|
-
newNodes.set(key, root);
|
|
557
1669
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
...node.definition,
|
|
564
|
-
packageDefinitionId: packageId({
|
|
565
|
-
contentIdentity: node.content.identity,
|
|
566
|
-
createdBy: node.createdBy,
|
|
567
|
-
definition: node.definition,
|
|
568
|
-
occupied: options_.occupiedIds,
|
|
569
|
-
}),
|
|
570
|
-
};
|
|
571
|
-
options_.occupiedIds.add(persisted.packageDefinitionId);
|
|
572
|
-
node.definition = persisted;
|
|
573
|
-
node.record = {
|
|
574
|
-
contentIdentity: node.content.identity,
|
|
575
|
-
createdBy: node.createdBy,
|
|
576
|
-
packageDefinitionId: persisted.packageDefinitionId,
|
|
577
|
-
creationInput: node.creationInput ?? null,
|
|
578
|
-
configuration: node.configuration,
|
|
579
|
-
bindings: {},
|
|
1670
|
+
catch (error) {
|
|
1671
|
+
return {
|
|
1672
|
+
status: "operation-failure",
|
|
1673
|
+
phase: "preparation",
|
|
1674
|
+
error: { message: errorMessage(error) },
|
|
580
1675
|
};
|
|
581
1676
|
}
|
|
582
|
-
|
|
583
|
-
const bindings = Object.fromEntries([...node.providers].map(([identity, provider]) => {
|
|
584
|
-
if (provider.record === undefined) {
|
|
585
|
-
throw new Error("内容闭包绑定缺少包实例:" + identity);
|
|
586
|
-
}
|
|
587
|
-
return [identity, provider.record.packageDefinitionId];
|
|
588
|
-
}));
|
|
589
|
-
node.record = { ...node.record, bindings };
|
|
590
|
-
}
|
|
591
|
-
return nodes;
|
|
592
|
-
}
|
|
593
|
-
function persistedContributions(nodes, context, records, nodeInstances) {
|
|
594
|
-
return nodes.map((node) => createContribution(node, context, records, nodeInstances));
|
|
595
|
-
}
|
|
596
|
-
async function init(initOptions) {
|
|
1677
|
+
let computed;
|
|
597
1678
|
try {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
...(root.creationInput === undefined
|
|
1679
|
+
computed = computeProject(prepared);
|
|
1680
|
+
}
|
|
1681
|
+
catch (error) {
|
|
1682
|
+
const packageIdentityIssues = error instanceof ProjectBlueprintValidationError
|
|
1683
|
+
? error.packageIdentityIssues
|
|
1684
|
+
: [];
|
|
1685
|
+
return {
|
|
1686
|
+
status: "operation-failure",
|
|
1687
|
+
phase: "calculation",
|
|
1688
|
+
error: {
|
|
1689
|
+
message: errorMessage(error),
|
|
1690
|
+
...(packageIdentityIssues.length === 0
|
|
611
1691
|
? {}
|
|
612
|
-
: {
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
}
|
|
628
|
-
if (rootsByIdentity.has(root.nodeIdentity)) {
|
|
629
|
-
throw new Error("显式初始化节点身份重复:" + root.nodeIdentity);
|
|
630
|
-
}
|
|
631
|
-
rootsByIdentity.add(root.nodeIdentity);
|
|
632
|
-
requireContent(root.contentIdentity);
|
|
633
|
-
}
|
|
634
|
-
const prepared = options.strategy.initialize({
|
|
1692
|
+
: { packageIdentityIssues }),
|
|
1693
|
+
},
|
|
1694
|
+
};
|
|
1695
|
+
}
|
|
1696
|
+
try {
|
|
1697
|
+
const sources = mergeProjectionSources(...computed.projection.entries.map((entry) => entry.sources), ...computed.projection.reconciliation.map((policy) => policy.sources));
|
|
1698
|
+
const preconditions = [
|
|
1699
|
+
{
|
|
1700
|
+
path: ".",
|
|
1701
|
+
kind: "directory-empty-or-missing",
|
|
1702
|
+
reason: "初始化要求目标目录为空或不存在",
|
|
1703
|
+
...(sources.length === 0 ? {} : { sources }),
|
|
1704
|
+
},
|
|
1705
|
+
];
|
|
1706
|
+
const current = await readProjectProjectionCurrent({
|
|
635
1707
|
targetRoot: initOptions.targetRoot,
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
1708
|
+
before: emptyProjectProjection,
|
|
1709
|
+
after: computed.projection,
|
|
1710
|
+
preconditions,
|
|
639
1711
|
});
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
? {}
|
|
648
|
-
: { creationInput: root.creationInput }),
|
|
649
|
-
});
|
|
1712
|
+
const planning = planProjectProjections({
|
|
1713
|
+
before: emptyProjectProjection,
|
|
1714
|
+
current,
|
|
1715
|
+
after: computed.projection,
|
|
1716
|
+
preconditions,
|
|
1717
|
+
});
|
|
1718
|
+
if (!planning.ok) {
|
|
650
1719
|
return {
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
configuration: normalizeConfiguration(content, root.configuration),
|
|
656
|
-
...(root.creationInput === undefined
|
|
657
|
-
? {}
|
|
658
|
-
: { creationInput: root.creationInput }),
|
|
659
|
-
providers: new Map(),
|
|
1720
|
+
status: "conflict",
|
|
1721
|
+
reason: conflictReason(planning.conflicts),
|
|
1722
|
+
conflicts: planning.conflicts,
|
|
1723
|
+
actions: [],
|
|
660
1724
|
};
|
|
661
|
-
});
|
|
662
|
-
const nodes = expandDependencies({
|
|
663
|
-
roots,
|
|
664
|
-
existing: [],
|
|
665
|
-
context: prepared.context,
|
|
666
|
-
occupiedIds: new Set(),
|
|
667
|
-
});
|
|
668
|
-
const records = nodes.flatMap((node) => node.record === undefined ? [] : [node.record]);
|
|
669
|
-
const nodeInstances = Object.fromEntries(roots.map((root) => {
|
|
670
|
-
if (root.record === undefined) {
|
|
671
|
-
throw new Error("显式初始化节点没有持久实例:" + root.nodeIdentity);
|
|
672
|
-
}
|
|
673
|
-
return [root.nodeIdentity, root.record.packageDefinitionId];
|
|
674
|
-
}));
|
|
675
|
-
const blueprint = assertProjectBlueprint({
|
|
676
|
-
schemaVersion: 3,
|
|
677
|
-
packages: nodes.map((node) => node.definition),
|
|
678
|
-
});
|
|
679
|
-
const packageStates = resolvePackageStates(records, blueprint);
|
|
680
|
-
validateRequiredBindings(packageStates);
|
|
681
|
-
validateNodeInstances(packageStates, nodeInstances);
|
|
682
|
-
const contributions = persistedContributions(nodes, prepared.context, packageStates, resolveNodeInstances(packageStates, nodeInstances));
|
|
683
|
-
const projectPlan = project(prepared.context, prepared.state, blueprint, packageStates, contributions, nodeInstances, presetSelections);
|
|
684
|
-
await materializeProjectProjection({
|
|
685
|
-
operations: projectPlan.operations,
|
|
686
|
-
reconciliation: projectPlan.reconciliation,
|
|
687
|
-
});
|
|
688
|
-
if (!initOptions.dryRun) {
|
|
689
|
-
try {
|
|
690
|
-
await renderNewProject({
|
|
691
|
-
targetRoot: path.resolve(initOptions.targetRoot),
|
|
692
|
-
operations: [...projectPlan.operations],
|
|
693
|
-
});
|
|
694
|
-
}
|
|
695
|
-
catch (error) {
|
|
696
|
-
return fail("render", error);
|
|
697
|
-
}
|
|
698
1725
|
}
|
|
1726
|
+
pendingPlans.set(planning.plan, {
|
|
1727
|
+
targetRoot: current.targetRoot,
|
|
1728
|
+
computed,
|
|
1729
|
+
});
|
|
699
1730
|
return {
|
|
700
|
-
status: "
|
|
701
|
-
|
|
702
|
-
blueprint:
|
|
703
|
-
generationRecord:
|
|
704
|
-
projection:
|
|
705
|
-
|
|
1731
|
+
status: "planned",
|
|
1732
|
+
plan: planning.plan,
|
|
1733
|
+
blueprint: computed.blueprint,
|
|
1734
|
+
generationRecord: computed.generationRecord,
|
|
1735
|
+
projection: computed.projection,
|
|
1736
|
+
ownerFacts: computed.ownerFacts,
|
|
1737
|
+
actions: planning.plan.actions,
|
|
706
1738
|
};
|
|
707
1739
|
}
|
|
708
1740
|
catch (error) {
|
|
709
|
-
return
|
|
1741
|
+
return {
|
|
1742
|
+
status: "operation-failure",
|
|
1743
|
+
phase: "planning",
|
|
1744
|
+
error: { message: errorMessage(error) },
|
|
1745
|
+
};
|
|
710
1746
|
}
|
|
711
1747
|
}
|
|
712
|
-
async function
|
|
713
|
-
const
|
|
714
|
-
|
|
715
|
-
const record = parseGenerationRecord(JSON.parse(await readFile(path.join(repositoryRoot, ".template/generation.json"), "utf8")));
|
|
716
|
-
if (record.strategyIdentity !== options.strategy.identity) {
|
|
717
|
-
throw new Error("目标仓库使用了不兼容的工作区策略");
|
|
718
|
-
}
|
|
719
|
-
const state = options.strategy.parseState(record.strategyState);
|
|
720
|
-
const packageStates = resolvePackageStates(record.packages, blueprint);
|
|
721
|
-
validateNodeInstances(packageStates, record.nodeInstances);
|
|
722
|
-
validatePresetSelections(record.presetSelections);
|
|
723
|
-
return { blueprint, record, state, packageStates };
|
|
724
|
-
}
|
|
725
|
-
async function add(addOptions) {
|
|
1748
|
+
async function planComputedAdd(options) {
|
|
1749
|
+
const { preparation, before } = options;
|
|
1750
|
+
let after;
|
|
726
1751
|
try {
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
let packageStates;
|
|
731
|
-
let state;
|
|
732
|
-
try {
|
|
733
|
-
({ blueprint, record, state, packageStates } =
|
|
734
|
-
await restoreRepository(repositoryRoot));
|
|
1752
|
+
if (!isDeepStrictEqual(before.generationRecord, preparation.restored.generationRecord) ||
|
|
1753
|
+
!isDeepStrictEqual(before.blueprint, preparation.restored.blueprint)) {
|
|
1754
|
+
throw new Error("Before 计算结果与恢复的项目记录不一致");
|
|
735
1755
|
}
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
1756
|
+
const afterPackages = new Map(options.after.generationRecord.packages.map((item) => [
|
|
1757
|
+
item.packageDefinitionId,
|
|
1758
|
+
item,
|
|
1759
|
+
]));
|
|
1760
|
+
const afterDefinitions = new Map(options.after.blueprint.packages.map((item) => [
|
|
1761
|
+
item.packageDefinitionId,
|
|
1762
|
+
item,
|
|
1763
|
+
]));
|
|
1764
|
+
for (const item of before.generationRecord.packages) {
|
|
1765
|
+
if (!isDeepStrictEqual(afterPackages.get(item.packageDefinitionId), item)) {
|
|
1766
|
+
throw new Error(`After 未保留既有包实例事实:${item.packageDefinitionId}`);
|
|
743
1767
|
}
|
|
744
|
-
requiredDependencies = requiredDependencyIdentities(packageStates);
|
|
745
|
-
}
|
|
746
|
-
catch (error) {
|
|
747
|
-
return fail("planning", error);
|
|
748
|
-
}
|
|
749
|
-
try {
|
|
750
|
-
validateRequiredBindings(packageStates, requiredDependencies);
|
|
751
|
-
}
|
|
752
|
-
catch (error) {
|
|
753
|
-
return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
|
|
754
|
-
}
|
|
755
|
-
const additionRoots = "preset" in addOptions
|
|
756
|
-
? expandPreset({
|
|
757
|
-
preset: resolvePreset(addOptions.preset),
|
|
758
|
-
operation: "add",
|
|
759
|
-
configuration: addOptions.configuration,
|
|
760
|
-
...(addOptions.creationInput === undefined
|
|
761
|
-
? {}
|
|
762
|
-
: { creationInput: addOptions.creationInput }),
|
|
763
|
-
})
|
|
764
|
-
: [
|
|
765
|
-
{
|
|
766
|
-
nodeIdentity: "addition",
|
|
767
|
-
configuration: addOptions.configuration,
|
|
768
|
-
contentIdentity: addOptions.contentIdentity,
|
|
769
|
-
...(addOptions.creationInput === undefined
|
|
770
|
-
? {}
|
|
771
|
-
: { creationInput: addOptions.creationInput }),
|
|
772
|
-
},
|
|
773
|
-
];
|
|
774
|
-
if (additionRoots.length !== 1) {
|
|
775
|
-
throw new Error("加包预设必须恰好包含一个节点");
|
|
776
|
-
}
|
|
777
|
-
const selectionRoot = additionRoots[0];
|
|
778
|
-
if (selectionRoot === undefined) {
|
|
779
|
-
throw new Error("加包预设必须恰好包含一个节点");
|
|
780
1768
|
}
|
|
781
|
-
const
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
const addedPresetMember = "preset" in addOptions ? resolvePreset(addOptions.preset) : undefined;
|
|
785
|
-
const addedPreset = addedPresetMember === undefined
|
|
786
|
-
? undefined
|
|
787
|
-
: selectedPreset(addedPresetMember);
|
|
788
|
-
const addedProjectPreset = addedPresetMember?.definition.project === undefined
|
|
789
|
-
? undefined
|
|
790
|
-
: addedPreset;
|
|
791
|
-
const existingNodes = nodesFromRecords(packageStates);
|
|
792
|
-
const currentNodeInstances = resolveNodeInstances(packageStates, record.nodeInstances);
|
|
793
|
-
try {
|
|
794
|
-
prepareContent(selected);
|
|
795
|
-
}
|
|
796
|
-
catch (error) {
|
|
797
|
-
return fail("planning", error);
|
|
798
|
-
}
|
|
799
|
-
let context;
|
|
800
|
-
try {
|
|
801
|
-
context = await options.strategy.prepareUpdate({
|
|
802
|
-
targetRoot: repositoryRoot,
|
|
803
|
-
state,
|
|
804
|
-
content: selected,
|
|
805
|
-
contentByIdentity,
|
|
806
|
-
configuration,
|
|
807
|
-
packages: packageStates,
|
|
808
|
-
nodeInstances: currentNodeInstances,
|
|
809
|
-
...(creationInput === undefined ? {} : { creationInput }),
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
catch (error) {
|
|
813
|
-
return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
|
|
814
|
-
}
|
|
815
|
-
const existingContributions = existingNodes.map((node) => createContribution(node, context, packageStates, currentNodeInstances));
|
|
816
|
-
const definition = options.strategy.createDefinition({
|
|
817
|
-
context,
|
|
818
|
-
content: selected,
|
|
819
|
-
...(selectionRoot.layout === undefined
|
|
820
|
-
? {}
|
|
821
|
-
: { layout: selectionRoot.layout }),
|
|
822
|
-
...(creationInput === undefined ? {} : { creationInput }),
|
|
823
|
-
});
|
|
824
|
-
const requested = {
|
|
825
|
-
content: selected,
|
|
826
|
-
definition,
|
|
827
|
-
createdBy: "addition",
|
|
828
|
-
configuration,
|
|
829
|
-
...(addedProjectPreset !== undefined
|
|
830
|
-
? { nodeIdentity: selectionRoot.nodeIdentity }
|
|
831
|
-
: {}),
|
|
832
|
-
...(creationInput === undefined ? {} : { creationInput }),
|
|
833
|
-
providers: new Map(),
|
|
834
|
-
};
|
|
835
|
-
let preparedAddition;
|
|
836
|
-
const prepareAdditionNodes = () => {
|
|
837
|
-
if (preparedAddition !== undefined)
|
|
838
|
-
return preparedAddition;
|
|
839
|
-
try {
|
|
840
|
-
const nodes = expandDependencies({
|
|
841
|
-
roots: [requested],
|
|
842
|
-
existing: existingNodes,
|
|
843
|
-
context,
|
|
844
|
-
occupiedIds: new Set(record.packages.map((item) => item.packageDefinitionId)),
|
|
845
|
-
});
|
|
846
|
-
const records = nodes.flatMap((node) => node.record === undefined ? [] : [node.record]);
|
|
847
|
-
const allRecords = [...record.packages, ...records];
|
|
848
|
-
const afterBlueprint = {
|
|
849
|
-
...blueprint,
|
|
850
|
-
packages: [
|
|
851
|
-
...blueprint.packages,
|
|
852
|
-
...nodes.map((node) => node.definition),
|
|
853
|
-
],
|
|
854
|
-
};
|
|
855
|
-
const packages = resolvePackageStates(allRecords, afterBlueprint);
|
|
856
|
-
const addedPackageIds = new Set(records.map((item) => item.packageDefinitionId));
|
|
857
|
-
const addedPackages = packages.filter((item) => addedPackageIds.has(item.packageDefinitionId));
|
|
858
|
-
validateRequiredBindings(addedPackages, requiredDependencyIdentities(addedPackages), packages);
|
|
859
|
-
const nodeInstanceIds = {
|
|
860
|
-
...record.nodeInstances,
|
|
861
|
-
};
|
|
862
|
-
if (addedProjectPreset !== undefined &&
|
|
863
|
-
!Object.hasOwn(nodeInstanceIds, selectionRoot.nodeIdentity)) {
|
|
864
|
-
const addedRoot = nodes.find((node) => node.nodeIdentity === selectionRoot.nodeIdentity);
|
|
865
|
-
if (addedRoot?.record === undefined) {
|
|
866
|
-
throw new Error("加包预设节点没有持久实例:" + selectionRoot.nodeIdentity);
|
|
867
|
-
}
|
|
868
|
-
nodeInstanceIds[selectionRoot.nodeIdentity] =
|
|
869
|
-
addedRoot.record.packageDefinitionId;
|
|
870
|
-
}
|
|
871
|
-
const nodeInstances = resolveNodeInstances(packages, nodeInstanceIds);
|
|
872
|
-
preparedAddition = {
|
|
873
|
-
nodes,
|
|
874
|
-
records,
|
|
875
|
-
packages,
|
|
876
|
-
blueprint: afterBlueprint,
|
|
877
|
-
nodeInstances,
|
|
878
|
-
contributions: persistedContributions(nodes, context, packages, nodeInstances),
|
|
879
|
-
};
|
|
880
|
-
return preparedAddition;
|
|
881
|
-
}
|
|
882
|
-
catch (error) {
|
|
883
|
-
throw new AdditionPlanningFailure(error);
|
|
884
|
-
}
|
|
885
|
-
};
|
|
886
|
-
try {
|
|
887
|
-
await validatePresetUpdate(repositoryRoot, context, existingContributions, currentNodeInstances, record.presetSelections);
|
|
888
|
-
const currentPresetProjectContributions = computePresetProjectContributions(context, existingContributions, currentNodeInstances, record.presetSelections);
|
|
889
|
-
const validation = await options.strategy.validateAddition?.({
|
|
890
|
-
targetRoot: repositoryRoot,
|
|
891
|
-
blueprint,
|
|
892
|
-
content: selected,
|
|
893
|
-
definition,
|
|
894
|
-
...(creationInput === undefined ? {} : { creationInput }),
|
|
895
|
-
packages: packageStates,
|
|
896
|
-
contributions: existingContributions,
|
|
897
|
-
getAdditionContributions: () => prepareAdditionNodes().contributions,
|
|
898
|
-
nodeInstances: currentNodeInstances,
|
|
899
|
-
presetProjectContributions: currentPresetProjectContributions,
|
|
900
|
-
});
|
|
901
|
-
if (validation?.status === "input-invalid")
|
|
902
|
-
return validation;
|
|
903
|
-
if (validation?.status === "conflict") {
|
|
904
|
-
return {
|
|
905
|
-
status: "conflict",
|
|
906
|
-
dryRun: addOptions.dryRun ?? false,
|
|
907
|
-
reason: "工作区策略报告了包加法冲突。",
|
|
908
|
-
conflicts: [],
|
|
909
|
-
ownerConflict: validation.conflict,
|
|
910
|
-
actions: [],
|
|
911
|
-
};
|
|
1769
|
+
for (const item of before.blueprint.packages) {
|
|
1770
|
+
if (!isDeepStrictEqual(afterDefinitions.get(item.packageDefinitionId), item)) {
|
|
1771
|
+
throw new Error(`After 未保留既有包定义:${item.packageDefinitionId}`);
|
|
912
1772
|
}
|
|
913
1773
|
}
|
|
914
|
-
|
|
915
|
-
if (
|
|
916
|
-
|
|
1774
|
+
for (const selection of before.generationRecord.selections) {
|
|
1775
|
+
if (!isDeepStrictEqual(options.after.generationRecord.selections.find((item) => item.selectionId === selection.selectionId), selection)) {
|
|
1776
|
+
throw new Error(`After 未保留既有内容选择:${selection.selectionId}`);
|
|
917
1777
|
}
|
|
918
|
-
return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
|
|
919
1778
|
}
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
if (conflicting !== undefined) {
|
|
923
|
-
const prior = packageStates.find((item) => item.packageDefinitionId === conflicting.packageDefinitionId);
|
|
924
|
-
if (prior !== undefined &&
|
|
925
|
-
contentIdentityKey(prior.contentIdentity) ===
|
|
926
|
-
contentIdentityKey(selected.identity) &&
|
|
927
|
-
prior.definition.name === definition.name &&
|
|
928
|
-
prior.definition.path === definition.path &&
|
|
929
|
-
isDeepStrictEqual(prior.configuration, configuration) &&
|
|
930
|
-
isDeepStrictEqual(prior.creationInput ?? undefined, selectionRoot.creationInput)) {
|
|
931
|
-
return {
|
|
932
|
-
status: "success",
|
|
933
|
-
dryRun: addOptions.dryRun ?? false,
|
|
934
|
-
blueprint,
|
|
935
|
-
generationRecord: record,
|
|
936
|
-
projection: null,
|
|
937
|
-
actions: [],
|
|
938
|
-
};
|
|
939
|
-
}
|
|
940
|
-
const samePackageIdentity = prior !== undefined &&
|
|
941
|
-
contentIdentityKey(prior.contentIdentity) ===
|
|
942
|
-
contentIdentityKey(selected.identity) &&
|
|
943
|
-
prior.definition.name === definition.name &&
|
|
944
|
-
prior.definition.path === definition.path;
|
|
945
|
-
return {
|
|
946
|
-
status: "conflict",
|
|
947
|
-
dryRun: addOptions.dryRun ?? false,
|
|
948
|
-
reason: samePackageIdentity
|
|
949
|
-
? "已存在的包实例不能接受不同的加包输入。"
|
|
950
|
-
: "目标包名称或路径已被其他实例占用。",
|
|
951
|
-
conflicts: [],
|
|
952
|
-
identityConflict: {
|
|
953
|
-
existing: packageIdentity(conflicting),
|
|
954
|
-
requested: packageIdentity(definition),
|
|
955
|
-
},
|
|
956
|
-
actions: [],
|
|
957
|
-
};
|
|
1779
|
+
if (!isDeepStrictEqual(options.after.generationRecord.composition, before.generationRecord.composition)) {
|
|
1780
|
+
throw new Error("After 未保留既有组合事实");
|
|
958
1781
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
const afterBlueprint = assertProjectBlueprint(prepared.blueprint);
|
|
963
|
-
const afterNodeInstanceIds = {
|
|
964
|
-
...record.nodeInstances,
|
|
1782
|
+
after = {
|
|
1783
|
+
...options.after,
|
|
1784
|
+
projection: preserveProjectionPaths(before.projection, options.after.projection),
|
|
965
1785
|
};
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
const
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
const preconditions =
|
|
985
|
-
path
|
|
1786
|
+
}
|
|
1787
|
+
catch (error) {
|
|
1788
|
+
return {
|
|
1789
|
+
status: "operation-failure",
|
|
1790
|
+
phase: "calculation",
|
|
1791
|
+
error: { message: errorMessage(error) },
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
try {
|
|
1795
|
+
const existingIds = new Set(before.blueprint.packages.map((item) => item.packageDefinitionId));
|
|
1796
|
+
const newPackages = after.blueprint.packages.filter((item) => !existingIds.has(item.packageDefinitionId));
|
|
1797
|
+
const sourcesById = new Map(after.packages.map(({ package: item }) => [
|
|
1798
|
+
item.packageDefinitionId,
|
|
1799
|
+
{
|
|
1800
|
+
identity: `content:${contentIdentityKey(item.contentIdentity)}:${item.packageDefinitionId}`,
|
|
1801
|
+
label: `${contentIdentityLabel(item.contentIdentity)}(${item.definition.path})`,
|
|
1802
|
+
},
|
|
1803
|
+
]));
|
|
1804
|
+
const preconditions = newPackages
|
|
1805
|
+
.filter((item) => item.path !== ".")
|
|
1806
|
+
.map((item) => ({
|
|
1807
|
+
path: item.path,
|
|
986
1808
|
kind: "must-not-exist",
|
|
987
|
-
reason:
|
|
1809
|
+
reason: `新包路径必须不存在:${item.path}`,
|
|
1810
|
+
...(sourcesById.get(item.packageDefinitionId) === undefined
|
|
1811
|
+
? {}
|
|
1812
|
+
: { sources: [sourcesById.get(item.packageDefinitionId)] }),
|
|
988
1813
|
}));
|
|
989
|
-
const
|
|
990
|
-
targetRoot:
|
|
991
|
-
before:
|
|
992
|
-
|
|
993
|
-
reconciliation: before.reconciliation,
|
|
994
|
-
},
|
|
995
|
-
after: {
|
|
996
|
-
operations: after.operations,
|
|
997
|
-
reconciliation: after.reconciliation,
|
|
998
|
-
},
|
|
1814
|
+
const current = await readProjectProjectionCurrent({
|
|
1815
|
+
targetRoot: preparation.restored.targetRoot,
|
|
1816
|
+
before: before.projection,
|
|
1817
|
+
after: after.projection,
|
|
999
1818
|
preconditions,
|
|
1000
|
-
...(addOptions.dryRun === undefined
|
|
1001
|
-
? {}
|
|
1002
|
-
: { dryRun: addOptions.dryRun }),
|
|
1003
1819
|
});
|
|
1004
|
-
|
|
1820
|
+
const planning = planProjectProjections({
|
|
1821
|
+
before: before.projection,
|
|
1822
|
+
current,
|
|
1823
|
+
after: after.projection,
|
|
1824
|
+
preconditions,
|
|
1825
|
+
readFacts: [...preparation.readFacts, ...(options.readFacts ?? [])],
|
|
1826
|
+
});
|
|
1827
|
+
if (!planning.ok) {
|
|
1005
1828
|
return {
|
|
1006
1829
|
status: "conflict",
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
conflicts: reconciliation.conflicts,
|
|
1830
|
+
reason: conflictReason(planning.conflicts),
|
|
1831
|
+
conflicts: planning.conflicts,
|
|
1010
1832
|
actions: [],
|
|
1011
1833
|
};
|
|
1012
1834
|
}
|
|
1835
|
+
pendingPlans.set(planning.plan, {
|
|
1836
|
+
targetRoot: current.targetRoot,
|
|
1837
|
+
computed: after,
|
|
1838
|
+
});
|
|
1013
1839
|
return {
|
|
1014
|
-
status: "
|
|
1015
|
-
|
|
1016
|
-
blueprint:
|
|
1840
|
+
status: "planned",
|
|
1841
|
+
plan: planning.plan,
|
|
1842
|
+
blueprint: after.blueprint,
|
|
1017
1843
|
generationRecord: after.generationRecord,
|
|
1018
|
-
projection: after,
|
|
1019
|
-
|
|
1844
|
+
projection: after.projection,
|
|
1845
|
+
ownerFacts: after.ownerFacts,
|
|
1846
|
+
actions: planning.plan.actions,
|
|
1020
1847
|
};
|
|
1021
1848
|
}
|
|
1022
1849
|
catch (error) {
|
|
1023
|
-
return
|
|
1024
|
-
|
|
1025
|
-
: "
|
|
1850
|
+
return {
|
|
1851
|
+
status: "operation-failure",
|
|
1852
|
+
phase: "planning",
|
|
1853
|
+
error: { message: errorMessage(error) },
|
|
1854
|
+
};
|
|
1026
1855
|
}
|
|
1027
1856
|
}
|
|
1028
|
-
async function
|
|
1029
|
-
const
|
|
1857
|
+
async function planAdd(addOptions) {
|
|
1858
|
+
const targetRoot = path.resolve(addOptions.repositoryRoot);
|
|
1030
1859
|
let restored;
|
|
1031
1860
|
try {
|
|
1032
|
-
restored = await
|
|
1861
|
+
restored = await restoreProject({ repositoryRoot: targetRoot });
|
|
1033
1862
|
}
|
|
1034
1863
|
catch (error) {
|
|
1035
|
-
return fail("metadata", error, options.strategy.diagnoseFailure?.(error));
|
|
1036
|
-
}
|
|
1037
|
-
const { blueprint, record, state, packageStates } = restored;
|
|
1038
|
-
const target = packageStates.find((item) => item.packageDefinitionId === configureOptions.packageDefinitionId);
|
|
1039
|
-
if (target === undefined)
|
|
1040
1864
|
return {
|
|
1041
|
-
status: "
|
|
1042
|
-
|
|
1865
|
+
status: "operation-failure",
|
|
1866
|
+
phase: "metadata",
|
|
1867
|
+
error: { message: errorMessage(error) },
|
|
1043
1868
|
};
|
|
1869
|
+
}
|
|
1870
|
+
let preparation;
|
|
1044
1871
|
try {
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1872
|
+
preparation = await prepareAddProject({
|
|
1873
|
+
restored,
|
|
1874
|
+
selection: addOptions,
|
|
1875
|
+
operationFacts: addOptions.operationFacts,
|
|
1876
|
+
});
|
|
1048
1877
|
}
|
|
1049
1878
|
catch (error) {
|
|
1050
|
-
return
|
|
1879
|
+
return {
|
|
1880
|
+
status: "operation-failure",
|
|
1881
|
+
phase: "preparation",
|
|
1882
|
+
error: { message: errorMessage(error) },
|
|
1883
|
+
};
|
|
1051
1884
|
}
|
|
1052
|
-
let
|
|
1885
|
+
let before;
|
|
1886
|
+
let after;
|
|
1053
1887
|
try {
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
state,
|
|
1070
|
-
content: selected,
|
|
1071
|
-
contentByIdentity,
|
|
1072
|
-
configuration,
|
|
1073
|
-
packages: packageStates,
|
|
1074
|
-
nodeInstances: currentNodeInstances,
|
|
1075
|
-
...(target.creationInput === null
|
|
1076
|
-
? {}
|
|
1077
|
-
: { creationInput: target.creationInput }),
|
|
1078
|
-
});
|
|
1079
|
-
const beforeNodes = nodesFromRecords(packageStates);
|
|
1080
|
-
const beforeContributions = persistedContributions(beforeNodes, context, packageStates, currentNodeInstances);
|
|
1081
|
-
await validatePresetUpdate(repositoryRoot, context, beforeContributions, currentNodeInstances, record.presetSelections);
|
|
1082
|
-
const before = project(context, state, blueprint, packageStates, beforeContributions, record.nodeInstances, record.presetSelections);
|
|
1083
|
-
const afterNodes = nodesFromRecords(packageStates.map((item) => item.packageDefinitionId === target.packageDefinitionId
|
|
1084
|
-
? { ...item, configuration }
|
|
1085
|
-
: item));
|
|
1086
|
-
const changed = afterNodes.find((node) => node.record?.packageDefinitionId === target.packageDefinitionId);
|
|
1087
|
-
const additions = expandDependencies({
|
|
1088
|
-
roots: [changed],
|
|
1089
|
-
existing: afterNodes,
|
|
1090
|
-
context,
|
|
1091
|
-
occupiedIds: new Set(record.packages.map((item) => item.packageDefinitionId)),
|
|
1092
|
-
});
|
|
1093
|
-
const allNodes = [...afterNodes, ...additions];
|
|
1094
|
-
const afterBlueprint = assertProjectBlueprint({
|
|
1095
|
-
...blueprint,
|
|
1096
|
-
packages: [
|
|
1097
|
-
...blueprint.packages,
|
|
1098
|
-
...additions.map((node) => node.definition),
|
|
1099
|
-
],
|
|
1100
|
-
});
|
|
1101
|
-
const afterPackages = resolvePackageStates(allNodes.map((node) => node.record), afterBlueprint);
|
|
1102
|
-
validateRequiredBindings(afterPackages);
|
|
1103
|
-
const afterNodeInstances = resolveNodeInstances(afterPackages, record.nodeInstances);
|
|
1104
|
-
const after = project(context, state, afterBlueprint, afterPackages, persistedContributions(allNodes, context, afterPackages, afterNodeInstances), record.nodeInstances, record.presetSelections);
|
|
1105
|
-
phase = "reconciliation";
|
|
1106
|
-
const reconciliation = await reconcileAndApplyProjectProjections({
|
|
1107
|
-
targetRoot: repositoryRoot,
|
|
1108
|
-
before: {
|
|
1109
|
-
operations: before.operations,
|
|
1110
|
-
reconciliation: before.reconciliation,
|
|
1888
|
+
before = computeProject(preparation.before);
|
|
1889
|
+
after = computeProject(preparation.after);
|
|
1890
|
+
}
|
|
1891
|
+
catch (error) {
|
|
1892
|
+
const packageIdentityIssues = error instanceof ProjectBlueprintValidationError
|
|
1893
|
+
? error.packageIdentityIssues
|
|
1894
|
+
: [];
|
|
1895
|
+
return {
|
|
1896
|
+
status: "operation-failure",
|
|
1897
|
+
phase: "calculation",
|
|
1898
|
+
error: {
|
|
1899
|
+
message: errorMessage(error),
|
|
1900
|
+
...(packageIdentityIssues.length === 0
|
|
1901
|
+
? {}
|
|
1902
|
+
: { packageIdentityIssues }),
|
|
1111
1903
|
},
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1904
|
+
};
|
|
1905
|
+
}
|
|
1906
|
+
return planComputedAdd({
|
|
1907
|
+
preparation,
|
|
1908
|
+
before,
|
|
1909
|
+
after,
|
|
1910
|
+
...(addOptions.readFacts === undefined
|
|
1911
|
+
? {}
|
|
1912
|
+
: { readFacts: addOptions.readFacts }),
|
|
1913
|
+
});
|
|
1914
|
+
}
|
|
1915
|
+
async function commitPlan(plan) {
|
|
1916
|
+
const pending = pendingPlans.get(plan);
|
|
1917
|
+
if (pending === undefined) {
|
|
1918
|
+
return {
|
|
1919
|
+
status: "operation-failure",
|
|
1920
|
+
phase: "commit",
|
|
1921
|
+
error: {
|
|
1922
|
+
message: "提交计划必须由当前生成器的 planInit、planAdd 或 planComputedAdd 创建",
|
|
1115
1923
|
},
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
? {}
|
|
1123
|
-
: { dryRun: configureOptions.dryRun }),
|
|
1924
|
+
};
|
|
1925
|
+
}
|
|
1926
|
+
try {
|
|
1927
|
+
const committed = await commitProjectProjectionPlan({
|
|
1928
|
+
targetRoot: pending.targetRoot,
|
|
1929
|
+
plan,
|
|
1124
1930
|
});
|
|
1125
|
-
if (!
|
|
1931
|
+
if (!committed.ok) {
|
|
1126
1932
|
return {
|
|
1127
1933
|
status: "conflict",
|
|
1128
|
-
dryRun:
|
|
1129
|
-
reason:
|
|
1130
|
-
conflicts:
|
|
1934
|
+
dryRun: false,
|
|
1935
|
+
reason: conflictReason(committed.conflicts),
|
|
1936
|
+
conflicts: committed.conflicts,
|
|
1131
1937
|
actions: [],
|
|
1132
1938
|
};
|
|
1939
|
+
}
|
|
1133
1940
|
return {
|
|
1134
1941
|
status: "success",
|
|
1135
|
-
dryRun:
|
|
1136
|
-
blueprint:
|
|
1137
|
-
generationRecord:
|
|
1138
|
-
projection:
|
|
1139
|
-
|
|
1942
|
+
dryRun: false,
|
|
1943
|
+
blueprint: pending.computed.blueprint,
|
|
1944
|
+
generationRecord: pending.computed.generationRecord,
|
|
1945
|
+
projection: pending.computed.projection,
|
|
1946
|
+
ownerFacts: pending.computed.ownerFacts,
|
|
1947
|
+
actions: committed.actions,
|
|
1140
1948
|
};
|
|
1141
1949
|
}
|
|
1142
1950
|
catch (error) {
|
|
1143
|
-
return
|
|
1951
|
+
return {
|
|
1952
|
+
status: "operation-failure",
|
|
1953
|
+
phase: "commit",
|
|
1954
|
+
error: { message: errorMessage(error) },
|
|
1955
|
+
};
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
async function init(initOptions) {
|
|
1959
|
+
const dryRun = initOptions.dryRun ?? false;
|
|
1960
|
+
const planned = await planInit({
|
|
1961
|
+
targetRoot: initOptions.targetRoot,
|
|
1962
|
+
selection: initOptions.selection,
|
|
1963
|
+
conventions: initOptions.conventions,
|
|
1964
|
+
operationFacts: initOptions.operationFacts,
|
|
1965
|
+
});
|
|
1966
|
+
if (planned.status === "operation-failure")
|
|
1967
|
+
return planned;
|
|
1968
|
+
if (planned.status === "conflict") {
|
|
1969
|
+
return { ...planned, dryRun, actions: [] };
|
|
1970
|
+
}
|
|
1971
|
+
if (!dryRun)
|
|
1972
|
+
return commitPlan(planned.plan);
|
|
1973
|
+
return {
|
|
1974
|
+
status: "success",
|
|
1975
|
+
dryRun: true,
|
|
1976
|
+
blueprint: planned.blueprint,
|
|
1977
|
+
generationRecord: planned.generationRecord,
|
|
1978
|
+
projection: planned.projection,
|
|
1979
|
+
ownerFacts: planned.ownerFacts,
|
|
1980
|
+
actions: planned.actions,
|
|
1981
|
+
};
|
|
1982
|
+
}
|
|
1983
|
+
async function add(addOptions) {
|
|
1984
|
+
const { dryRun = false, ...planningOptions } = addOptions;
|
|
1985
|
+
const planned = await planAdd(planningOptions);
|
|
1986
|
+
if (planned.status === "operation-failure")
|
|
1987
|
+
return planned;
|
|
1988
|
+
if (planned.status === "conflict") {
|
|
1989
|
+
return { ...planned, dryRun, actions: [] };
|
|
1144
1990
|
}
|
|
1991
|
+
if (!dryRun)
|
|
1992
|
+
return commitPlan(planned.plan);
|
|
1993
|
+
return {
|
|
1994
|
+
status: "success",
|
|
1995
|
+
dryRun: true,
|
|
1996
|
+
blueprint: planned.blueprint,
|
|
1997
|
+
generationRecord: planned.generationRecord,
|
|
1998
|
+
projection: planned.projection,
|
|
1999
|
+
ownerFacts: planned.ownerFacts,
|
|
2000
|
+
actions: planned.actions,
|
|
2001
|
+
};
|
|
1145
2002
|
}
|
|
1146
|
-
return {
|
|
2003
|
+
return {
|
|
2004
|
+
init,
|
|
2005
|
+
add,
|
|
2006
|
+
planInit,
|
|
2007
|
+
planAdd,
|
|
2008
|
+
planComputedAdd,
|
|
2009
|
+
commitPlan,
|
|
2010
|
+
restoreProject,
|
|
2011
|
+
prepareAddProject,
|
|
2012
|
+
prepareProject,
|
|
2013
|
+
computeProject,
|
|
2014
|
+
};
|
|
1147
2015
|
}
|