@ykdz/template 0.0.23 → 0.0.25
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/cli.js +4 -575
- package/dist/main.d.ts +1 -0
- package/dist/main.js +370 -0
- package/node_modules/@typescript/old/LICENSE.txt +55 -0
- package/node_modules/@typescript/old/README.md +50 -0
- package/node_modules/@typescript/old/SECURITY.md +39 -0
- package/node_modules/@typescript/old/ThirdPartyNoticeText.txt +193 -0
- package/node_modules/@typescript/old/bin/tsc +2 -0
- package/node_modules/@typescript/old/bin/tsserver +2 -0
- package/node_modules/@typescript/old/lib/_tsc.js +134465 -0
- package/node_modules/@typescript/old/lib/_tsserver.js +659 -0
- package/node_modules/@typescript/old/lib/_typingsInstaller.js +222 -0
- package/node_modules/@typescript/old/lib/cs/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/de/diagnosticMessages.generated.json +2125 -0
- package/node_modules/@typescript/old/lib/es/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/fr/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/it/diagnosticMessages.generated.json +2125 -0
- package/node_modules/@typescript/old/lib/ja/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/ko/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/lib.d.ts +20 -0
- package/node_modules/@typescript/old/lib/lib.decorators.d.ts +382 -0
- package/node_modules/@typescript/old/lib/lib.decorators.legacy.d.ts +20 -0
- package/node_modules/@typescript/old/lib/lib.dom.asynciterable.d.ts +18 -0
- package/node_modules/@typescript/old/lib/lib.dom.d.ts +45125 -0
- package/node_modules/@typescript/old/lib/lib.dom.iterable.d.ts +18 -0
- package/node_modules/@typescript/old/lib/lib.es2015.collection.d.ts +150 -0
- package/node_modules/@typescript/old/lib/lib.es2015.core.d.ts +595 -0
- package/node_modules/@typescript/old/lib/lib.es2015.d.ts +26 -0
- package/node_modules/@typescript/old/lib/lib.es2015.generator.d.ts +75 -0
- package/node_modules/@typescript/old/lib/lib.es2015.iterable.d.ts +603 -0
- package/node_modules/@typescript/old/lib/lib.es2015.promise.d.ts +79 -0
- package/node_modules/@typescript/old/lib/lib.es2015.proxy.d.ts +126 -0
- package/node_modules/@typescript/old/lib/lib.es2015.reflect.d.ts +142 -0
- package/node_modules/@typescript/old/lib/lib.es2015.symbol.d.ts +44 -0
- package/node_modules/@typescript/old/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
- package/node_modules/@typescript/old/lib/lib.es2016.array.include.d.ts +114 -0
- package/node_modules/@typescript/old/lib/lib.es2016.d.ts +19 -0
- package/node_modules/@typescript/old/lib/lib.es2016.full.d.ts +21 -0
- package/node_modules/@typescript/old/lib/lib.es2016.intl.d.ts +29 -0
- package/node_modules/@typescript/old/lib/lib.es2017.arraybuffer.d.ts +19 -0
- package/node_modules/@typescript/old/lib/lib.es2017.d.ts +24 -0
- package/node_modules/@typescript/old/lib/lib.es2017.date.d.ts +29 -0
- package/node_modules/@typescript/old/lib/lib.es2017.full.d.ts +21 -0
- package/node_modules/@typescript/old/lib/lib.es2017.intl.d.ts +42 -0
- package/node_modules/@typescript/old/lib/lib.es2017.object.d.ts +47 -0
- package/node_modules/@typescript/old/lib/lib.es2017.sharedmemory.d.ts +133 -0
- package/node_modules/@typescript/old/lib/lib.es2017.string.d.ts +43 -0
- package/node_modules/@typescript/old/lib/lib.es2017.typedarrays.d.ts +51 -0
- package/node_modules/@typescript/old/lib/lib.es2018.asyncgenerator.d.ts +75 -0
- package/node_modules/@typescript/old/lib/lib.es2018.asynciterable.d.ts +51 -0
- package/node_modules/@typescript/old/lib/lib.es2018.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2018.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2018.intl.d.ts +81 -0
- package/node_modules/@typescript/old/lib/lib.es2018.promise.d.ts +28 -0
- package/node_modules/@typescript/old/lib/lib.es2018.regexp.d.ts +35 -0
- package/node_modules/@typescript/old/lib/lib.es2019.array.d.ts +77 -0
- package/node_modules/@typescript/old/lib/lib.es2019.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2019.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2019.intl.d.ts +21 -0
- package/node_modules/@typescript/old/lib/lib.es2019.object.d.ts +31 -0
- package/node_modules/@typescript/old/lib/lib.es2019.string.d.ts +35 -0
- package/node_modules/@typescript/old/lib/lib.es2019.symbol.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2020.bigint.d.ts +763 -0
- package/node_modules/@typescript/old/lib/lib.es2020.d.ts +25 -0
- package/node_modules/@typescript/old/lib/lib.es2020.date.d.ts +40 -0
- package/node_modules/@typescript/old/lib/lib.es2020.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2020.intl.d.ts +472 -0
- package/node_modules/@typescript/old/lib/lib.es2020.number.d.ts +26 -0
- package/node_modules/@typescript/old/lib/lib.es2020.promise.d.ts +45 -0
- package/node_modules/@typescript/old/lib/lib.es2020.sharedmemory.d.ts +97 -0
- package/node_modules/@typescript/old/lib/lib.es2020.string.d.ts +42 -0
- package/node_modules/@typescript/old/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
- package/node_modules/@typescript/old/lib/lib.es2021.d.ts +21 -0
- package/node_modules/@typescript/old/lib/lib.es2021.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2021.intl.d.ts +164 -0
- package/node_modules/@typescript/old/lib/lib.es2021.promise.d.ts +46 -0
- package/node_modules/@typescript/old/lib/lib.es2021.string.d.ts +31 -0
- package/node_modules/@typescript/old/lib/lib.es2021.weakref.d.ts +76 -0
- package/node_modules/@typescript/old/lib/lib.es2022.array.d.ts +119 -0
- package/node_modules/@typescript/old/lib/lib.es2022.d.ts +23 -0
- package/node_modules/@typescript/old/lib/lib.es2022.error.d.ts +73 -0
- package/node_modules/@typescript/old/lib/lib.es2022.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2022.intl.d.ts +143 -0
- package/node_modules/@typescript/old/lib/lib.es2022.object.d.ts +24 -0
- package/node_modules/@typescript/old/lib/lib.es2022.regexp.d.ts +37 -0
- package/node_modules/@typescript/old/lib/lib.es2022.string.d.ts +23 -0
- package/node_modules/@typescript/old/lib/lib.es2023.array.d.ts +922 -0
- package/node_modules/@typescript/old/lib/lib.es2023.collection.d.ts +19 -0
- package/node_modules/@typescript/old/lib/lib.es2023.d.ts +20 -0
- package/node_modules/@typescript/old/lib/lib.es2023.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2023.intl.d.ts +62 -0
- package/node_modules/@typescript/old/lib/lib.es2024.arraybuffer.d.ts +63 -0
- package/node_modules/@typescript/old/lib/lib.es2024.collection.d.ts +27 -0
- package/node_modules/@typescript/old/lib/lib.es2024.d.ts +24 -0
- package/node_modules/@typescript/old/lib/lib.es2024.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2024.object.d.ts +27 -0
- package/node_modules/@typescript/old/lib/lib.es2024.promise.d.ts +33 -0
- package/node_modules/@typescript/old/lib/lib.es2024.regexp.d.ts +23 -0
- package/node_modules/@typescript/old/lib/lib.es2024.sharedmemory.d.ts +66 -0
- package/node_modules/@typescript/old/lib/lib.es2024.string.d.ts +27 -0
- package/node_modules/@typescript/old/lib/lib.es2025.collection.d.ts +94 -0
- package/node_modules/@typescript/old/lib/lib.es2025.d.ts +23 -0
- package/node_modules/@typescript/old/lib/lib.es2025.float16.d.ts +443 -0
- package/node_modules/@typescript/old/lib/lib.es2025.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.es2025.intl.d.ts +200 -0
- package/node_modules/@typescript/old/lib/lib.es2025.iterator.d.ts +146 -0
- package/node_modules/@typescript/old/lib/lib.es2025.promise.d.ts +32 -0
- package/node_modules/@typescript/old/lib/lib.es2025.regexp.d.ts +30 -0
- package/node_modules/@typescript/old/lib/lib.es5.d.ts +4599 -0
- package/node_modules/@typescript/old/lib/lib.es6.d.ts +21 -0
- package/node_modules/@typescript/old/lib/lib.esnext.array.d.ts +33 -0
- package/node_modules/@typescript/old/lib/lib.esnext.collection.d.ts +47 -0
- package/node_modules/@typescript/old/lib/lib.esnext.d.ts +27 -0
- package/node_modules/@typescript/old/lib/lib.esnext.date.d.ts +21 -0
- package/node_modules/@typescript/old/lib/lib.esnext.decorators.d.ts +26 -0
- package/node_modules/@typescript/old/lib/lib.esnext.disposable.d.ts +191 -0
- package/node_modules/@typescript/old/lib/lib.esnext.error.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.esnext.full.d.ts +22 -0
- package/node_modules/@typescript/old/lib/lib.esnext.intl.d.ts +107 -0
- package/node_modules/@typescript/old/lib/lib.esnext.sharedmemory.d.ts +23 -0
- package/node_modules/@typescript/old/lib/lib.esnext.temporal.d.ts +485 -0
- package/node_modules/@typescript/old/lib/lib.esnext.typedarrays.d.ts +90 -0
- package/node_modules/@typescript/old/lib/lib.scripthost.d.ts +320 -0
- package/node_modules/@typescript/old/lib/lib.webworker.asynciterable.d.ts +18 -0
- package/node_modules/@typescript/old/lib/lib.webworker.d.ts +15606 -0
- package/node_modules/@typescript/old/lib/lib.webworker.importscripts.d.ts +21 -0
- package/node_modules/@typescript/old/lib/lib.webworker.iterable.d.ts +18 -0
- package/node_modules/@typescript/old/lib/pl/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/pt-br/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/ru/diagnosticMessages.generated.json +2125 -0
- package/node_modules/@typescript/old/lib/tr/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/tsc.js +8 -0
- package/node_modules/@typescript/old/lib/tsserver.js +8 -0
- package/node_modules/@typescript/old/lib/tsserverlibrary.d.ts +17 -0
- package/node_modules/@typescript/old/lib/tsserverlibrary.js +21 -0
- package/node_modules/@typescript/old/lib/typesMap.json +497 -0
- package/node_modules/@typescript/old/lib/typescript.d.ts +11448 -0
- package/node_modules/@typescript/old/lib/typescript.js +201039 -0
- package/node_modules/@typescript/old/lib/typingsInstaller.js +8 -0
- package/node_modules/@typescript/old/lib/watchGuard.js +53 -0
- package/node_modules/@typescript/old/lib/zh-cn/diagnosticMessages.generated.json +2129 -0
- package/node_modules/@typescript/old/lib/zh-tw/diagnosticMessages.generated.json +2125 -0
- package/node_modules/@typescript/old/package.json +118 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +83 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +804 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/index.d.ts +3 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/index.js +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +114 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +33 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +88 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.d.ts +14 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.js +26 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +114 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +382 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +92 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.d.ts +2 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +162 -0
- package/node_modules/@ykdz/template-builtin-presets/package.json +68 -0
- package/node_modules/@ykdz/{template-builtin-source/templates/vue-app/.github/dependabot.yml → template-builtin-presets/templates/foundation/.github/dependabot-rust.yml} +13 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot.dynamic.template +4 -0
- package/node_modules/@ykdz/{template-builtin-source/templates/ts-lib → template-builtin-presets/templates/foundation}/.github/dependabot.yml +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.dynamic.template +19 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/TODO.md.template +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/devcontainer.json +16 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/gitignore +8 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +19 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +28 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/extensions.json +3 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/settings.json +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/devcontainer/devcontainer.json +21 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/check-boundaries.ts +12 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/run-root-owned-task.ts +69 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/tsconfig.json +9 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +25 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/.github/dependabot.yml +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/workflows/check.yml +23 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/extensions.json +3 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/settings.json +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.lock +16 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.toml +27 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/devcontainer.json +21 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/rust.Dockerfile +16 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/rust-toolchain.toml +3 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/node-pnpm.Dockerfile +12 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/shellcheck.Dockerfile +3 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/editor-customization/capabilities.json +38 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/node/oxlint.config.ts +6 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/oxfmt.config.ts +3 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/shared/oxc/tsconfig.config.json +2 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.app.json +25 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.json +8 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.node.json +30 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.test.json +9 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/typescript/run-vue-tsc.ts +12 -0
- package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app → template-builtin-presets/templates/ts-lib}/.github/dependabot.yml +5 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/workflows/check.yml +19 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/src/index.ts +1 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.json +13 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/readiness.ts +2 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/src/types.d.ts +1 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.json +26 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/turbo.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/drizzle.config.ts +17 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/scripts/prepare-database.ts +45 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/tsconfig.json +22 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/turbo.json +10 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/Dockerfile +20 -30
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/index/+Page.telefunc.ts +0 -2
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/index/+Page.vue +2 -1
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/playwright.config.ts +1 -1
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/scripts/check-standalone-deployment.ts +84 -22
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/container-entrypoint.sh +33 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/test/e2e/app.spec.ts +3 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.app.json +34 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.json +9 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.node.json +31 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.test.json +11 -0
- package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/vike-app/web}/turbo.json +3 -2
- package/node_modules/@ykdz/{template-builtin-source/templates/vike-app → template-builtin-presets/templates/vue-app}/.github/dependabot.yml +5 -4
- package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app/web → template-builtin-presets/templates/vue-app}/turbo.json +4 -3
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/typescript/tsconfig.json +8 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/src/index.ts +3 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/src/server.ts +1 -1
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/test/app.test.ts +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.build.json +9 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json +25 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/turbo.json +1 -1
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/playwright.config.ts +1 -1
- package/node_modules/@ykdz/{template-builtin-source/templates/vike-app → template-builtin-presets/templates/vue-hono-app}/web/turbo.json +2 -2
- package/node_modules/@ykdz/template-core/dist/Cargo.toml +1 -1
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +8 -0
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +48 -12
- package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +11 -3
- package/node_modules/@ykdz/template-core/dist/devcontainer.js +17 -3
- package/node_modules/@ykdz/template-core/dist/editor-customization.d.ts +5 -9
- package/node_modules/@ykdz/template-core/dist/editor-customization.js +8 -46
- package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +64 -33
- package/node_modules/@ykdz/template-core/dist/module-graph.js +117 -135
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +41 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +24 -0
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +22 -8
- package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +42 -0
- package/node_modules/@ykdz/template-core/dist/preset-definition.js +1 -0
- package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.d.ts +33 -0
- package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.js +161 -0
- package/node_modules/@ykdz/template-core/dist/project-github.d.ts +17 -2
- package/node_modules/@ykdz/template-core/dist/project-github.js +87 -14
- package/node_modules/@ykdz/template-core/dist/project-linking-v2.d.ts +20 -0
- package/node_modules/@ykdz/template-core/dist/project-linking-v2.js +37 -0
- package/node_modules/@ykdz/template-core/dist/renderer.d.ts +40 -5
- package/node_modules/@ykdz/template-core/dist/renderer.js +115 -30
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +21 -15
- package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +100 -50
- package/node_modules/@ykdz/template-core/dist/toolchain-baseline-update.d.ts +45 -0
- package/node_modules/@ykdz/template-core/dist/toolchain-baseline-update.js +27 -0
- package/node_modules/@ykdz/template-core/dist/toolchain-resolution.d.ts +1 -0
- package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +50 -52
- package/node_modules/@ykdz/template-core/package.json +10 -8
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +680 -0
- package/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +577 -0
- package/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +93 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +17 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/typescript/LICENSE.txt +55 -0
- package/node_modules/typescript/README.md +9 -0
- package/node_modules/typescript/bin/tsc6 +2 -0
- package/node_modules/typescript/lib/tsc.js +1 -0
- package/node_modules/typescript/lib/tsserverlibrary.d.ts +2 -0
- package/node_modules/typescript/lib/tsserverlibrary.js +1 -0
- package/node_modules/typescript/lib/typescript.d.ts +2 -0
- package/node_modules/typescript/lib/typescript.js +1 -0
- package/node_modules/typescript/package.json +39 -0
- package/node_modules/valibot/LICENSE.md +9 -0
- package/node_modules/valibot/README.md +94 -0
- package/node_modules/valibot/dist/index.cjs +7974 -0
- package/node_modules/valibot/dist/index.d.cts +16184 -0
- package/node_modules/valibot/dist/index.d.mts +16184 -0
- package/node_modules/valibot/dist/index.min.cjs +2 -0
- package/node_modules/valibot/dist/index.min.mjs +2 -0
- package/node_modules/valibot/dist/index.mjs +7663 -0
- package/node_modules/valibot/package.json +79 -0
- package/package.json +18 -12
- package/LICENSE +0 -21
- package/node_modules/@ykdz/template-builtin-source/dist/src/index.d.ts +0 -22
- package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +0 -103
- package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.d.ts +0 -7
- package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.js +0 -98
- package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.d.ts +0 -2
- package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +0 -15
- package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.d.ts +0 -9
- package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +0 -105
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.d.ts +0 -6
- package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +0 -197
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.d.ts +0 -5
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.js +0 -71
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.d.ts +0 -6
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +0 -281
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.d.ts +0 -8
- package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +0 -154
- package/node_modules/@ykdz/template-builtin-source/package.json +0 -93
- package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +0 -524
- package/node_modules/@ykdz/template-builtin-source/templates/shared/devcontainer/node-pnpm.Dockerfile +0 -6
- package/node_modules/@ykdz/template-builtin-source/templates/shared/editor-customization/capabilities.json +0 -56
- package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/node/oxlint.config.ts +0 -34
- package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/oxfmt.config.ts +0 -8
- package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/vue/oxlint.config.ts +0 -36
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.github/workflows/check.yml +0 -22
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/db/drizzle.config.ts +0 -10
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/container-entrypoint.sh +0 -52
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/prepare-database.sh +0 -6
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/api/src/index.ts +0 -3
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/main.ts +0 -8
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/stores/counter.ts +0 -12
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/style.css +0 -1
- package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/test/app.test.ts +0 -14
- package/node_modules/@ykdz/template-core/dist/declarations.d.ts +0 -2
- package/node_modules/@ykdz/template-core/dist/declarations.js +0 -1
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +0 -76
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +0 -658
- package/node_modules/@ykdz/template-core/dist/generation-context.d.ts +0 -23
- package/node_modules/@ykdz/template-core/dist/generation-context.js +0 -20
- package/node_modules/@ykdz/template-core/dist/next-step-instructions.d.ts +0 -30
- package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +0 -181
- package/node_modules/@ykdz/template-core/dist/package-addition-support.d.ts +0 -6
- package/node_modules/@ykdz/template-core/dist/package-addition-support.js +0 -2
- package/node_modules/@ykdz/template-core/dist/package-addition.d.ts +0 -12
- package/node_modules/@ykdz/template-core/dist/package-addition.js +0 -665
- package/node_modules/@ykdz/template-core/dist/package-linking.d.ts +0 -75
- package/node_modules/@ykdz/template-core/dist/package-linking.js +0 -157
- package/node_modules/@ykdz/template-core/dist/preset-projection.d.ts +0 -68
- package/node_modules/@ykdz/template-core/dist/preset-projection.js +0 -8
- package/node_modules/@ykdz/template-core/dist/preset-source.d.ts +0 -14
- package/node_modules/@ykdz/template-core/dist/preset-source.js +0 -294
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +0 -31
- package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +0 -2170
- package/node_modules/@ykdz/template-core/dist/runtime-paths.d.ts +0 -1
- package/node_modules/@ykdz/template-core/dist/runtime-paths.js +0 -13
- package/node_modules/@ykdz/template-shared/dist/index.d.ts +0 -645
- package/node_modules/@ykdz/template-shared/dist/index.js +0 -1408
- package/node_modules/@ykdz/template-shared/package.json +0 -37
- /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app/.github/workflows/check.yml → template-builtin-presets/templates/foundation/.github/workflows/check-playwright.yml} +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/rust-bin/.github/workflows/check.yml → template-builtin-presets/templates/foundation/.github/workflows/check-rust.yml} +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/ts-lib → template-builtin-presets/templates/foundation}/.github/workflows/check.yml +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/shared → template-builtin-presets/templates/foundation/rust}/devcontainer/rust.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/rust-bin → template-builtin-presets/templates/foundation/rust}/rust-toolchain.toml +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/rustfmt.toml +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/src/main.rs +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/turbo.json +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/shared/devcontainer/browser-test.Dockerfile +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/main.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/stores/counter.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/style.css +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/test/app.test.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/src/name-schema.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/turbo.json +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/scripts/seed-example.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/db.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/index.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/queries/todos.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/schema.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/seed/example.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/test/todos.test.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/vike-app/db → template-builtin-presets/templates/vike-app/db-migrations}/drizzle/migrations/20260709120325_old_captain_flint/migration.sql +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/vike-app/db → template-builtin-presets/templates/vike-app/db-migrations}/drizzle/migrations/20260709120325_old_captain_flint/snapshot.json +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/+server.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/.env.example +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/Dockerfile.dockerignore +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/assets/logo.svg +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/components/CounterButton.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/components/PageShell.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+Head.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+Layout.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/tailwind.css +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/scripts/run-playwright.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/server/api.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/server/app.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/types/env.d.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/types/global.d.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/vite.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/vitest.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app → template-builtin-presets/templates/vue-app}/.github/workflows/check.yml +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/env.d.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/index.html +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/playwright.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/scripts/run-playwright.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/src/App.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/test/e2e/app.spec.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/vite.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/vitest.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/src/runtime.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/vitest.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/env.d.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/index.html +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/scripts/run-playwright.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/src/App.vue +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/src/api.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/test/e2e/app.spec.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/vite.config.ts +0 -0
- /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/vitest.config.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { renderPlaywrightBrowserInstallCommand, } from "./module-graph.js";
|
|
2
2
|
const defaultCiCapability = {
|
|
3
3
|
workflowName: "Check",
|
|
4
4
|
jobName: "check",
|
|
@@ -15,9 +15,11 @@ export function projectCheckWorkflow(options) {
|
|
|
15
15
|
rustToolchain: false,
|
|
16
16
|
...options.environmentPreparation,
|
|
17
17
|
};
|
|
18
|
+
const requiresRustToolchain = environmentPreparation.rustToolchain ||
|
|
19
|
+
options.environment.needs.some((need) => need.kind === "rust-toolchain");
|
|
18
20
|
const taskLayer = options.taskLayer ?? pnpmTaskLayer;
|
|
19
|
-
const
|
|
20
|
-
const needsDocker =
|
|
21
|
+
const hasDeploymentTask = options.hasDeploymentTask === true;
|
|
22
|
+
const needsDocker = (options.deploymentEnvironmentNeeds ?? []).some((need) => need.kind === "docker-engine");
|
|
21
23
|
const lines = [
|
|
22
24
|
`name: ${capability.workflowName}`,
|
|
23
25
|
"",
|
|
@@ -30,28 +32,83 @@ export function projectCheckWorkflow(options) {
|
|
|
30
32
|
"jobs:",
|
|
31
33
|
` ${capability.jobName}:`,
|
|
32
34
|
` runs-on: ${capability.runner}`,
|
|
35
|
+
...(hasDeploymentTask
|
|
36
|
+
? [" strategy:", " matrix:", " check: [root, deployment]"]
|
|
37
|
+
: []),
|
|
33
38
|
" steps:",
|
|
34
39
|
" - uses: actions/checkout@v7",
|
|
35
40
|
];
|
|
36
41
|
if (environmentPreparation.nodeFromPackageMetadata) {
|
|
37
42
|
lines.push(" - uses: actions/setup-node@v6", " with:", " node-version-file: package.json", " - run: corepack enable");
|
|
38
43
|
}
|
|
39
|
-
if (needsDocker) {
|
|
40
|
-
lines.push(" - uses: docker/setup-buildx-action@v3");
|
|
41
|
-
}
|
|
42
|
-
if (environmentPreparation.rustToolchain) {
|
|
43
|
-
lines.push(" - uses: dtolnay/rust-toolchain@stable", " with:", " components: rustfmt, clippy", " - uses: Swatinem/rust-cache@v2");
|
|
44
|
+
if (hasDeploymentTask && needsDocker) {
|
|
45
|
+
lines.push(" - uses: docker/setup-buildx-action@v3", " if: matrix.check == 'deployment'");
|
|
44
46
|
}
|
|
47
|
+
if (requiresRustToolchain)
|
|
48
|
+
lines.push(...rustCiPreparationLines());
|
|
45
49
|
lines.push(` - run: ${taskLayer.installCommand}`);
|
|
46
|
-
|
|
50
|
+
const checkEnvironmentLines = [];
|
|
51
|
+
for (const need of options.environment.needs) {
|
|
52
|
+
if (need.kind === "rust-toolchain") {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
checkEnvironmentLines.push(` - run: ${renderCiEnvironmentNeedCommand(need)}`);
|
|
56
|
+
if (hasDeploymentTask && need.kind === "shellcheck-command") {
|
|
57
|
+
checkEnvironmentLines.push(" if: matrix.check == 'root'");
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
lines.push(...checkEnvironmentLines);
|
|
47
61
|
lines.push(` - run: ${taskLayer.checkCommand}`);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
if (hasDeploymentTask) {
|
|
63
|
+
lines.push(" if: matrix.check == 'root'");
|
|
64
|
+
}
|
|
65
|
+
if (hasDeploymentTask) {
|
|
66
|
+
lines.push(" - run: pnpm run check:deployment", " if: matrix.check == 'deployment'");
|
|
51
67
|
}
|
|
52
68
|
lines.push("");
|
|
53
69
|
return lines.join("\n");
|
|
54
70
|
}
|
|
71
|
+
function rustCiPreparationLines() {
|
|
72
|
+
return [
|
|
73
|
+
" - uses: dtolnay/rust-toolchain@stable",
|
|
74
|
+
" with:",
|
|
75
|
+
" components: rustfmt, clippy",
|
|
76
|
+
" - uses: Swatinem/rust-cache@v2",
|
|
77
|
+
];
|
|
78
|
+
}
|
|
79
|
+
/** Limited substitutions for the Foundation-owned workflow Template Source. */
|
|
80
|
+
export function projectCheckWorkflowTemplateReplacements(options) {
|
|
81
|
+
const requiresRustToolchain = options.environmentPreparation?.rustToolchain === true ||
|
|
82
|
+
options.environment.needs.some((need) => need.kind === "rust-toolchain");
|
|
83
|
+
const hasDeploymentTask = options.hasDeploymentTask === true;
|
|
84
|
+
const needsDocker = (options.deploymentEnvironmentNeeds ?? []).some((need) => need.kind === "docker-engine");
|
|
85
|
+
const environmentSteps = options.environment.needs
|
|
86
|
+
.filter((need) => need.kind !== "rust-toolchain")
|
|
87
|
+
.map((need) => [
|
|
88
|
+
` - run: ${renderCiEnvironmentNeedCommand(need)}`,
|
|
89
|
+
...(hasDeploymentTask && need.kind === "shellcheck-command"
|
|
90
|
+
? [" if: matrix.check == 'root'"]
|
|
91
|
+
: []),
|
|
92
|
+
].join("\n"));
|
|
93
|
+
return {
|
|
94
|
+
RUST_CI_PREPARATION: requiresRustToolchain
|
|
95
|
+
? `\n${rustCiPreparationLines().join("\n")}`
|
|
96
|
+
: "",
|
|
97
|
+
CHECK_ENVIRONMENT_PREPARATION: environmentSteps.length === 0 ? "" : `\n${environmentSteps.join("\n")}`,
|
|
98
|
+
DEPLOYMENT_MATRIX: hasDeploymentTask
|
|
99
|
+
? "\n strategy:\n matrix:\n check: [root, deployment]"
|
|
100
|
+
: "",
|
|
101
|
+
DEPLOYMENT_DOCKER_PREPARATION: hasDeploymentTask && needsDocker
|
|
102
|
+
? "\n - uses: docker/setup-buildx-action@v3\n if: matrix.check == 'deployment'"
|
|
103
|
+
: "",
|
|
104
|
+
ROOT_CHECK_CONDITION: hasDeploymentTask
|
|
105
|
+
? "\n if: matrix.check == 'root'"
|
|
106
|
+
: "",
|
|
107
|
+
DEPLOYMENT_CHECK: hasDeploymentTask
|
|
108
|
+
? "\n - run: pnpm run check:deployment\n if: matrix.check == 'deployment'"
|
|
109
|
+
: "",
|
|
110
|
+
};
|
|
111
|
+
}
|
|
55
112
|
export function projectDependabotConfig(policy) {
|
|
56
113
|
return [
|
|
57
114
|
"version: 2",
|
|
@@ -65,6 +122,15 @@ export function projectDependabotConfig(policy) {
|
|
|
65
122
|
"",
|
|
66
123
|
].join("\n");
|
|
67
124
|
}
|
|
125
|
+
/** Limited substitution for the Foundation-owned Dependabot Template Source. */
|
|
126
|
+
export function projectDependabotTemplateReplacements(policy) {
|
|
127
|
+
const header = "version: 2\n\nupdates:\n";
|
|
128
|
+
const configuration = projectDependabotConfig(policy);
|
|
129
|
+
if (!configuration.startsWith(header)) {
|
|
130
|
+
throw new Error("Dependabot configuration must retain its Template Source header");
|
|
131
|
+
}
|
|
132
|
+
return { DEPENDABOT_UPDATES: configuration.slice(header.length).trimEnd() };
|
|
133
|
+
}
|
|
68
134
|
function renderDependabotUpdate(ecosystem, directory, interval) {
|
|
69
135
|
const lines = [
|
|
70
136
|
` - package-ecosystem: ${ecosystem}`,
|
|
@@ -73,7 +139,7 @@ function renderDependabotUpdate(ecosystem, directory, interval) {
|
|
|
73
139
|
` interval: ${interval}`,
|
|
74
140
|
];
|
|
75
141
|
if (ecosystem === "npm") {
|
|
76
|
-
lines.push(" groups:", " drizzle:", " patterns:", ' - "drizzle-*"', ' - "drizzle-orm"', " ignore:", ' - dependency-name: "@types/node"', " update-types:", " - version-update:semver-major");
|
|
142
|
+
lines.push(" groups:", " drizzle:", " patterns:", ' - "drizzle-*"', ' - "drizzle-orm"', " ignore:", ' - dependency-name: "@types/node"', " update-types:", " - version-update:semver-major", ' - dependency-name: "pnpm"', " update-types:", " - version-update:semver-major", " - version-update:semver-minor", " - version-update:semver-patch");
|
|
77
143
|
}
|
|
78
144
|
if (ecosystem === "docker" && directory === "/.devcontainer") {
|
|
79
145
|
lines.push(" ignore:", " - dependency-name: mcr.microsoft.com/devcontainers/typescript-node", " update-types:", " - version-update:semver-major");
|
|
@@ -87,5 +153,12 @@ function defaultDependabotDirectory(ecosystem) {
|
|
|
87
153
|
return ecosystem === "docker" ? "/.devcontainer" : "/";
|
|
88
154
|
}
|
|
89
155
|
function renderCiEnvironmentNeedCommand(need) {
|
|
90
|
-
|
|
156
|
+
switch (need.kind) {
|
|
157
|
+
case "playwright-browser-assets":
|
|
158
|
+
return renderPlaywrightBrowserInstallCommand(need, { withDeps: true });
|
|
159
|
+
case "shellcheck-command":
|
|
160
|
+
return need.nextStep.display;
|
|
161
|
+
case "rust-toolchain":
|
|
162
|
+
return need.nextStep.display;
|
|
163
|
+
}
|
|
91
164
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PackageContribution } from "./package-contribution.ts";
|
|
2
|
+
import { type ProjectBlueprintV2 } from "./project-blueprint-v2.ts";
|
|
3
|
+
export type ExplicitProjectLinkPlan = {
|
|
4
|
+
readonly manifestDependenciesByPackagePath: ReadonlyMap<string, Readonly<Record<string, "workspace:*">>>;
|
|
5
|
+
/**
|
|
6
|
+
* Build ordering follows the same explicit package relationships as manifest
|
|
7
|
+
* dependencies. Turbo resolves ^build through the derived workspace
|
|
8
|
+
* dependency rather than through Preset or framework vocabulary.
|
|
9
|
+
*/
|
|
10
|
+
readonly hasBuildOrdering: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Resolves durable Link Intents using the explicit exposures supplied by
|
|
14
|
+
* Package Contributions. No Preset identity or string resource protocol is
|
|
15
|
+
* involved.
|
|
16
|
+
*/
|
|
17
|
+
export declare function planExplicitProjectLinks(options: {
|
|
18
|
+
readonly blueprint: ProjectBlueprintV2;
|
|
19
|
+
readonly contributions: readonly PackageContribution[];
|
|
20
|
+
}): ExplicitProjectLinkPlan;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { assertProjectBlueprintV2, } from "./project-blueprint-v2.js";
|
|
2
|
+
/**
|
|
3
|
+
* Resolves durable Link Intents using the explicit exposures supplied by
|
|
4
|
+
* Package Contributions. No Preset identity or string resource protocol is
|
|
5
|
+
* involved.
|
|
6
|
+
*/
|
|
7
|
+
export function planExplicitProjectLinks(options) {
|
|
8
|
+
const blueprint = assertProjectBlueprintV2(options.blueprint);
|
|
9
|
+
const contributionsByPath = new Map(options.contributions.map((contribution) => [
|
|
10
|
+
contribution.definition.path,
|
|
11
|
+
contribution,
|
|
12
|
+
]));
|
|
13
|
+
const dependencies = new Map();
|
|
14
|
+
for (const intent of blueprint.packageLinkIntents ?? []) {
|
|
15
|
+
const provider = contributionsByPath.get(intent.providerPackagePath);
|
|
16
|
+
const consumer = contributionsByPath.get(intent.consumerPackagePath);
|
|
17
|
+
if (provider === undefined || consumer === undefined) {
|
|
18
|
+
throw new Error("Project Linking requires explicit Package Contributions for every Link Intent endpoint");
|
|
19
|
+
}
|
|
20
|
+
if (Object.keys(provider.exposure.exports).length === 0) {
|
|
21
|
+
throw new Error(`Package Link provider ${provider.definition.path} has no Package Exposure`);
|
|
22
|
+
}
|
|
23
|
+
const consumerDependencies = dependencies.get(intent.consumerPackagePath);
|
|
24
|
+
if (consumerDependencies === undefined) {
|
|
25
|
+
dependencies.set(intent.consumerPackagePath, {
|
|
26
|
+
[provider.definition.name]: "workspace:*",
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
consumerDependencies[provider.definition.name] = "workspace:*";
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
manifestDependenciesByPackagePath: dependencies,
|
|
35
|
+
hasBuildOrdering: dependencies.size > 0,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -1,60 +1,95 @@
|
|
|
1
1
|
type RenderVariables = Record<string, string>;
|
|
2
|
+
export type RenderOperationProvenance = {
|
|
3
|
+
readonly definitionName: string;
|
|
4
|
+
readonly plannerSourceFile: string;
|
|
5
|
+
readonly planningContribution: string;
|
|
6
|
+
readonly ownershipRule: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* An opaque, owned Template Source reference. A renderer operation carries
|
|
10
|
+
* this directly instead of selecting a root from a string-keyed side map.
|
|
11
|
+
*/
|
|
12
|
+
declare const templateSourceHandleBrand: unique symbol;
|
|
13
|
+
export type TemplateSourceHandle = {
|
|
14
|
+
readonly [templateSourceHandleBrand]: true;
|
|
15
|
+
};
|
|
16
|
+
export declare function createTemplateSourceHandle(root: string): TemplateSourceHandle;
|
|
17
|
+
/** Resolves a handle-owned source path while enforcing containment. */
|
|
18
|
+
export declare function resolveTemplateSource(source: TemplateSourceHandle, relativePath: string): string;
|
|
2
19
|
export type CopyFileOperation = {
|
|
3
20
|
kind: "copyFile";
|
|
4
21
|
from: string;
|
|
5
22
|
to: string;
|
|
6
|
-
|
|
23
|
+
source: TemplateSourceHandle;
|
|
24
|
+
/** Foundation refreshes coordinated outputs during Package Addition. */
|
|
25
|
+
overwrite?: boolean;
|
|
26
|
+
provenance?: RenderOperationProvenance;
|
|
7
27
|
};
|
|
8
28
|
export type WriteJsonOperation = {
|
|
9
29
|
kind: "writeJson";
|
|
10
30
|
to: string;
|
|
11
31
|
value: unknown;
|
|
12
32
|
multilineArrays?: string[];
|
|
33
|
+
overwrite?: boolean;
|
|
34
|
+
provenance?: RenderOperationProvenance;
|
|
13
35
|
};
|
|
14
36
|
export type MergeJsonOperation = {
|
|
15
37
|
kind: "mergeJson";
|
|
16
38
|
to: string;
|
|
17
39
|
value: unknown;
|
|
40
|
+
multilineArrays?: string[];
|
|
41
|
+
provenance?: RenderOperationProvenance;
|
|
18
42
|
};
|
|
19
43
|
export type WriteTextOperation = {
|
|
20
44
|
kind: "writeText";
|
|
21
45
|
to: string;
|
|
22
46
|
text: string;
|
|
47
|
+
provenance?: RenderOperationProvenance;
|
|
23
48
|
};
|
|
24
49
|
export type WriteTextFromFragmentsOperation = {
|
|
25
50
|
kind: "writeTextFromFragments";
|
|
26
51
|
to: string;
|
|
27
52
|
fragments: readonly {
|
|
28
53
|
from: string;
|
|
29
|
-
|
|
54
|
+
source: TemplateSourceHandle;
|
|
30
55
|
}[];
|
|
56
|
+
overwrite?: boolean;
|
|
57
|
+
provenance?: RenderOperationProvenance;
|
|
31
58
|
};
|
|
32
59
|
export type WriteTextTemplateOperation = {
|
|
33
60
|
kind: "writeTextTemplate";
|
|
34
61
|
from: string;
|
|
35
62
|
to: string;
|
|
36
|
-
|
|
63
|
+
source: TemplateSourceHandle;
|
|
37
64
|
replacements: Record<string, string>;
|
|
65
|
+
/** Follow-up plans may refresh a coordinated template-owned file. */
|
|
66
|
+
overwrite?: boolean;
|
|
67
|
+
provenance?: RenderOperationProvenance;
|
|
38
68
|
};
|
|
39
69
|
export type SetExecutableOperation = {
|
|
40
70
|
kind: "setExecutable";
|
|
41
71
|
path: string;
|
|
42
72
|
executable: boolean;
|
|
73
|
+
provenance?: RenderOperationProvenance;
|
|
43
74
|
};
|
|
44
75
|
export type ReplaceAnchorsOperation = {
|
|
45
76
|
kind: "replaceAnchors";
|
|
46
77
|
path: string;
|
|
47
78
|
language: "typescript";
|
|
48
79
|
replacements: Record<string, string>;
|
|
80
|
+
provenance?: RenderOperationProvenance;
|
|
49
81
|
};
|
|
50
82
|
export type RenderOperation = CopyFileOperation | WriteJsonOperation | MergeJsonOperation | WriteTextOperation | WriteTextFromFragmentsOperation | WriteTextTemplateOperation | SetExecutableOperation | ReplaceAnchorsOperation;
|
|
51
83
|
export type RenderProjectOptions = {
|
|
52
|
-
sourceRoot: string;
|
|
53
|
-
sourceRoots?: Record<string, string> | undefined;
|
|
54
84
|
targetRoot: string;
|
|
55
85
|
variables?: RenderVariables | undefined;
|
|
56
86
|
operations: RenderOperation[];
|
|
57
87
|
};
|
|
58
88
|
export declare function renderProject(options: RenderProjectOptions): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Applies a follow-up plan in a sibling staging directory. In particular,
|
|
91
|
+
* metadata updates cannot become visible when a later source operation fails.
|
|
92
|
+
*/
|
|
93
|
+
export declare function renderProjectAtomically(options: RenderProjectOptions): Promise<void>;
|
|
59
94
|
export declare function renderNewProject(options: RenderProjectOptions): Promise<void>;
|
|
60
95
|
export {};
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import { constants } from "node:fs";
|
|
2
|
-
import { chmod, copyFile, mkdir, mkdtemp, readFile, readdir, rename, rm, rmdir, stat, writeFile, } from "node:fs/promises";
|
|
2
|
+
import { chmod, cp, copyFile, mkdir, mkdtemp, readFile, readdir, rename, rm, rmdir, stat, writeFile, } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* An opaque, owned Template Source reference. A renderer operation carries
|
|
6
|
+
* this directly instead of selecting a root from a string-keyed side map.
|
|
7
|
+
*/
|
|
8
|
+
const templateSourceHandleBrand = Symbol("template-source");
|
|
9
|
+
const templateSourceRoots = new WeakMap();
|
|
10
|
+
export function createTemplateSourceHandle(root) {
|
|
11
|
+
const handle = Object.freeze({
|
|
12
|
+
[templateSourceHandleBrand]: true,
|
|
13
|
+
});
|
|
14
|
+
templateSourceRoots.set(handle, path.resolve(root));
|
|
15
|
+
return handle;
|
|
16
|
+
}
|
|
17
|
+
/** Resolves a handle-owned source path while enforcing containment. */
|
|
18
|
+
export function resolveTemplateSource(source, relativePath) {
|
|
19
|
+
const root = typeof source === "object" && source !== null
|
|
20
|
+
? templateSourceRoots.get(source)
|
|
21
|
+
: undefined;
|
|
22
|
+
if (root === undefined) {
|
|
23
|
+
throw new Error("Renderer received an unknown Template Source handle");
|
|
24
|
+
}
|
|
25
|
+
return resolveContainedPath(root, relativePath);
|
|
26
|
+
}
|
|
4
27
|
function expandTemplatePath(templatePath, variables) {
|
|
5
28
|
return templatePath.replaceAll(/\{\{([A-Za-z][A-Za-z0-9_]*)\}\}/g, (_, name) => {
|
|
6
29
|
const value = variables[name];
|
|
@@ -31,17 +54,11 @@ function expandOperationPath(relativePath, options) {
|
|
|
31
54
|
}
|
|
32
55
|
async function renderCopyFile(operation, options) {
|
|
33
56
|
const variables = options.variables ?? {};
|
|
34
|
-
const
|
|
35
|
-
? options.sourceRoot
|
|
36
|
-
: options.sourceRoots?.[operation.sourceRoot];
|
|
37
|
-
if (sourceRoot === undefined) {
|
|
38
|
-
throw new Error(`Unknown renderer source root: ${operation.sourceRoot}`);
|
|
39
|
-
}
|
|
40
|
-
const from = resolveContainedPath(sourceRoot, expandTemplatePath(operation.from, variables));
|
|
57
|
+
const from = resolveTemplateSource(operation.source, expandTemplatePath(operation.from, variables));
|
|
41
58
|
const to = resolveContainedPath(options.targetRoot, expandTemplatePath(operation.to, variables));
|
|
42
59
|
const sourceMode = (await stat(from)).mode;
|
|
43
60
|
await mkdir(path.dirname(to), { recursive: true });
|
|
44
|
-
await copyGeneratedFile(from, to);
|
|
61
|
+
await copyGeneratedFile(from, to, operation.overwrite ?? false);
|
|
45
62
|
await chmod(to, sourceMode & 0o777);
|
|
46
63
|
}
|
|
47
64
|
function isRecord(value) {
|
|
@@ -147,7 +164,7 @@ async function writeJsonFile(targetRoot, toPath, value, multilineArrays, overwri
|
|
|
147
164
|
await writeGeneratedFile(to, serializeJson(value, multilineArrays, rootKeyOrderForPath(toPath)), overwrite);
|
|
148
165
|
}
|
|
149
166
|
async function renderWriteJson(operation, options) {
|
|
150
|
-
await writeJsonFile(options.targetRoot, expandOperationPath(operation.to, options), operation.value, operation.multilineArrays);
|
|
167
|
+
await writeJsonFile(options.targetRoot, expandOperationPath(operation.to, options), operation.value, operation.multilineArrays, operation.overwrite);
|
|
151
168
|
}
|
|
152
169
|
async function renderMergeJson(operation, options) {
|
|
153
170
|
const toPath = expandOperationPath(operation.to, options);
|
|
@@ -161,7 +178,7 @@ async function renderMergeJson(operation, options) {
|
|
|
161
178
|
throw error;
|
|
162
179
|
}
|
|
163
180
|
}
|
|
164
|
-
await writeJsonFile(options.targetRoot, toPath, mergeJsonValue(existing, operation.value),
|
|
181
|
+
await writeJsonFile(options.targetRoot, toPath, mergeJsonValue(existing, operation.value), operation.multilineArrays, true);
|
|
165
182
|
}
|
|
166
183
|
const foundationTextFiles = new Set([
|
|
167
184
|
".dockerignore",
|
|
@@ -209,6 +226,9 @@ function assertFoundationTextPath(relativePath) {
|
|
|
209
226
|
if (normalizedPath === ".devcontainer/Dockerfile") {
|
|
210
227
|
return;
|
|
211
228
|
}
|
|
229
|
+
if (normalizedPath === ".devcontainer/devcontainer.json") {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
212
232
|
throw new Error(`Text output is limited to foundation files: ${relativePath}`);
|
|
213
233
|
}
|
|
214
234
|
function assertTextTemplatePath(relativePath) {
|
|
@@ -233,18 +253,12 @@ async function renderWriteTextFromFragments(operation, options) {
|
|
|
233
253
|
assertFoundationTextPath(toPath);
|
|
234
254
|
const to = resolveContainedPath(options.targetRoot, toPath);
|
|
235
255
|
const texts = await Promise.all(operation.fragments.map(async (fragment) => {
|
|
236
|
-
const sourceRoot = fragment.sourceRoot === undefined
|
|
237
|
-
? options.sourceRoot
|
|
238
|
-
: options.sourceRoots?.[fragment.sourceRoot];
|
|
239
|
-
if (sourceRoot === undefined) {
|
|
240
|
-
throw new Error(`Unknown renderer source root: ${fragment.sourceRoot}`);
|
|
241
|
-
}
|
|
242
256
|
const fromPath = expandTemplatePath(fragment.from, options.variables ?? {});
|
|
243
|
-
const from =
|
|
257
|
+
const from = resolveTemplateSource(fragment.source, fromPath);
|
|
244
258
|
return readFile(from, "utf8");
|
|
245
259
|
}));
|
|
246
260
|
await mkdir(path.dirname(to), { recursive: true });
|
|
247
|
-
await writeGeneratedFile(to, texts.map((text) => text.trimEnd()).join("\n\n") + "\n");
|
|
261
|
+
await writeGeneratedFile(to, texts.map((text) => text.trimEnd()).join("\n\n") + "\n", operation.overwrite ?? false);
|
|
248
262
|
}
|
|
249
263
|
function replaceTextTemplateVariables(sourceText, replacements) {
|
|
250
264
|
const used = new Set();
|
|
@@ -264,19 +278,13 @@ function replaceTextTemplateVariables(sourceText, replacements) {
|
|
|
264
278
|
return rendered;
|
|
265
279
|
}
|
|
266
280
|
async function renderWriteTextTemplate(operation, options) {
|
|
267
|
-
const sourceRoot = operation.sourceRoot === undefined
|
|
268
|
-
? options.sourceRoot
|
|
269
|
-
: options.sourceRoots?.[operation.sourceRoot];
|
|
270
|
-
if (sourceRoot === undefined) {
|
|
271
|
-
throw new Error(`Unknown renderer source root: ${operation.sourceRoot}`);
|
|
272
|
-
}
|
|
273
281
|
const toPath = expandOperationPath(operation.to, options);
|
|
274
282
|
assertTextTemplatePath(toPath);
|
|
275
|
-
const from =
|
|
283
|
+
const from = resolveTemplateSource(operation.source, expandTemplatePath(operation.from, options.variables ?? {}));
|
|
276
284
|
const to = resolveContainedPath(options.targetRoot, toPath);
|
|
277
285
|
const sourceText = await readFile(from, "utf8");
|
|
278
286
|
await mkdir(path.dirname(to), { recursive: true });
|
|
279
|
-
await writeGeneratedFile(to, replaceTextTemplateVariables(sourceText, operation.replacements));
|
|
287
|
+
await writeGeneratedFile(to, replaceTextTemplateVariables(sourceText, operation.replacements), operation.overwrite);
|
|
280
288
|
}
|
|
281
289
|
async function renderSetExecutable(operation, options) {
|
|
282
290
|
const filePath = resolveContainedPath(options.targetRoot, expandOperationPath(operation.path, options));
|
|
@@ -296,7 +304,7 @@ function parseAnchorComment(commentText) {
|
|
|
296
304
|
return multiline?.[1];
|
|
297
305
|
}
|
|
298
306
|
async function findTypeScriptAnchorRanges(sourceText) {
|
|
299
|
-
const ts = await import("
|
|
307
|
+
const ts = await import("typescript");
|
|
300
308
|
const sourceFile = ts.createSourceFile("template-anchor.ts", sourceText, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
301
309
|
const anchors = [];
|
|
302
310
|
const seenRanges = new Set();
|
|
@@ -377,9 +385,9 @@ async function targetDirectoryStatus(targetRoot) {
|
|
|
377
385
|
}
|
|
378
386
|
return "empty";
|
|
379
387
|
}
|
|
380
|
-
async function copyGeneratedFile(from, to) {
|
|
388
|
+
async function copyGeneratedFile(from, to, overwrite = false) {
|
|
381
389
|
try {
|
|
382
|
-
await copyFile(from, to, constants.COPYFILE_EXCL);
|
|
390
|
+
await copyFile(from, to, overwrite ? 0 : constants.COPYFILE_EXCL);
|
|
383
391
|
}
|
|
384
392
|
catch (error) {
|
|
385
393
|
if (isNodeError(error) && error.code === "EEXIST") {
|
|
@@ -443,6 +451,83 @@ export async function renderProject(options) {
|
|
|
443
451
|
throw new Error(`Unsupported renderer operation: ${operation.kind}`);
|
|
444
452
|
}
|
|
445
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Applies a follow-up plan in a sibling staging directory. In particular,
|
|
456
|
+
* metadata updates cannot become visible when a later source operation fails.
|
|
457
|
+
*/
|
|
458
|
+
export async function renderProjectAtomically(options) {
|
|
459
|
+
const targetRoot = path.resolve(options.targetRoot);
|
|
460
|
+
await stat(targetRoot);
|
|
461
|
+
const parent = path.dirname(targetRoot);
|
|
462
|
+
const stagingRoot = await mkdtemp(path.join(parent, `.${path.basename(targetRoot)}.template-update-`));
|
|
463
|
+
const backupRoot = await mkdtemp(path.join(parent, `.${path.basename(targetRoot)}.template-backup-`));
|
|
464
|
+
const changedEntries = changedRootEntries(options.operations);
|
|
465
|
+
let committed = false;
|
|
466
|
+
try {
|
|
467
|
+
await cp(targetRoot, stagingRoot, { recursive: true });
|
|
468
|
+
await renderProject({ ...options, targetRoot: stagingRoot });
|
|
469
|
+
// Commit only the entries changed by the staged plan. In particular, do
|
|
470
|
+
// not rename the target directory: callers commonly run `template add`
|
|
471
|
+
// from that directory, and renaming it leaves their shell on a deleted
|
|
472
|
+
// inode. Each entry has a rollback copy before it is made visible.
|
|
473
|
+
for (const entry of changedEntries) {
|
|
474
|
+
const current = path.join(targetRoot, entry);
|
|
475
|
+
try {
|
|
476
|
+
await cp(current, path.join(backupRoot, entry), { recursive: true });
|
|
477
|
+
}
|
|
478
|
+
catch (error) {
|
|
479
|
+
if (!isNodeError(error) || error.code !== "ENOENT")
|
|
480
|
+
throw error;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
try {
|
|
484
|
+
for (const entry of changedEntries) {
|
|
485
|
+
await cp(path.join(stagingRoot, entry), path.join(targetRoot, entry), {
|
|
486
|
+
recursive: true,
|
|
487
|
+
force: true,
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
committed = true;
|
|
491
|
+
}
|
|
492
|
+
catch (error) {
|
|
493
|
+
await rollbackStagedEntries({ targetRoot, backupRoot, changedEntries });
|
|
494
|
+
throw error;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
finally {
|
|
498
|
+
if (!committed)
|
|
499
|
+
await rm(stagingRoot, { recursive: true, force: true });
|
|
500
|
+
await rm(backupRoot, { recursive: true, force: true });
|
|
501
|
+
if (committed)
|
|
502
|
+
await rm(stagingRoot, { recursive: true, force: true });
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
function changedRootEntries(operations) {
|
|
506
|
+
const entries = new Set();
|
|
507
|
+
for (const operation of operations) {
|
|
508
|
+
const outputPath = operation.kind === "setExecutable" || operation.kind === "replaceAnchors"
|
|
509
|
+
? operation.path
|
|
510
|
+
: operation.to;
|
|
511
|
+
const entry = outputPath.split(/[\\/]/)[0];
|
|
512
|
+
if (entry !== undefined && entry.length > 0)
|
|
513
|
+
entries.add(entry);
|
|
514
|
+
}
|
|
515
|
+
return [...entries];
|
|
516
|
+
}
|
|
517
|
+
async function rollbackStagedEntries(options) {
|
|
518
|
+
for (const entry of options.changedEntries) {
|
|
519
|
+
const target = path.join(options.targetRoot, entry);
|
|
520
|
+
const backup = path.join(options.backupRoot, entry);
|
|
521
|
+
await rm(target, { recursive: true, force: true });
|
|
522
|
+
try {
|
|
523
|
+
await cp(backup, target, { recursive: true });
|
|
524
|
+
}
|
|
525
|
+
catch (error) {
|
|
526
|
+
if (!isNodeError(error) || error.code !== "ENOENT")
|
|
527
|
+
throw error;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
446
531
|
async function commitStagedProject(stagingRoot, targetRoot) {
|
|
447
532
|
const targetStatus = await targetDirectoryStatus(targetRoot);
|
|
448
533
|
if (targetStatus === "empty") {
|
|
@@ -1,38 +1,44 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export type TemplateBoundaryDebt = {
|
|
3
|
-
readonly preset: string;
|
|
4
|
-
readonly generatedPath: string;
|
|
5
|
-
readonly owningFunction: string;
|
|
6
|
-
readonly reason: string;
|
|
7
|
-
};
|
|
1
|
+
import { type RenderOperation } from "./renderer.ts";
|
|
8
2
|
export type TemplateBoundaryViolation = {
|
|
9
3
|
readonly preset: string;
|
|
10
4
|
readonly generatedPath: string;
|
|
11
5
|
readonly owningFunction: string;
|
|
12
6
|
readonly operationKind: RenderOperation["kind"];
|
|
13
7
|
readonly sourceFilePath: string;
|
|
14
|
-
|
|
8
|
+
/** Real registry plans retain their Definition and contribution provenance. */
|
|
9
|
+
readonly definitionName?: string;
|
|
10
|
+
readonly planningContribution?: string;
|
|
11
|
+
readonly ownershipRule?: string;
|
|
15
12
|
};
|
|
16
13
|
export type TemplateBoundaryCheckProjection = {
|
|
17
14
|
readonly name: string;
|
|
18
15
|
readonly sourceFilePath: string;
|
|
16
|
+
readonly definitionName?: string;
|
|
17
|
+
readonly planningContribution?: string;
|
|
19
18
|
readonly plan: {
|
|
20
|
-
readonly sourceRoot: string;
|
|
21
|
-
readonly sourceRoots?: Record<string, string> | undefined;
|
|
22
19
|
readonly operations: readonly RenderOperation[];
|
|
23
20
|
};
|
|
24
21
|
};
|
|
22
|
+
/** A Template Source root directly checked independently of any render plan. */
|
|
23
|
+
export type TemplateSourceContext = {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly root: string;
|
|
26
|
+
/** Every readable source file discovered by a direct Template Source check. */
|
|
27
|
+
readonly checkedFiles?: readonly string[];
|
|
28
|
+
};
|
|
25
29
|
export type TemplateBoundaryCheckResult = {
|
|
26
30
|
readonly ok: boolean;
|
|
27
31
|
readonly violations: readonly TemplateBoundaryViolation[];
|
|
28
|
-
readonly allowlistedDebt: readonly TemplateBoundaryViolation[];
|
|
29
|
-
readonly unusedAllowlistEntries: readonly TemplateBoundaryDebt[];
|
|
30
32
|
};
|
|
31
33
|
export type CheckTemplateSourceBoundaryOptions = {
|
|
32
34
|
readonly projections: readonly TemplateBoundaryCheckProjection[];
|
|
35
|
+
readonly templateSourceContexts?: readonly TemplateSourceContext[];
|
|
33
36
|
readonly manifestReferencedSourceFiles?: readonly string[];
|
|
34
|
-
readonly allowlist?: readonly TemplateBoundaryDebt[];
|
|
35
37
|
};
|
|
36
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Reads each registered Template Source context before any plan is inspected.
|
|
40
|
+
* The resulting file sets are an independent proof consumed by the boundary check.
|
|
41
|
+
*/
|
|
42
|
+
export declare function checkTemplateSourceContexts(contexts: readonly Omit<TemplateSourceContext, "checkedFiles">[]): Promise<readonly TemplateSourceContext[]>;
|
|
37
43
|
export declare function isProtectedGeneratedPath(generatedPath: string): boolean;
|
|
38
|
-
export declare function checkTemplateSourceBoundary({ projections,
|
|
44
|
+
export declare function checkTemplateSourceBoundary({ projections, templateSourceContexts, manifestReferencedSourceFiles, }: CheckTemplateSourceBoundaryOptions): Promise<TemplateBoundaryCheckResult>;
|