@ykdz/template 0.0.22 → 0.0.24
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 +85 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +797 -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 +134 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +36 -0
- package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +106 -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 +138 -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 +408 -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 +94 -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 +179 -0
- package/node_modules/@ykdz/template-builtin-presets/package.json +67 -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/.pnpmfile.cts +14 -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 +23 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +29 -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/tsconfig.json +4 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +18 -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-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-presets/templates/vike-app/web/Dockerfile +74 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/index/+Page.telefunc.ts +1 -4
- 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-presets/templates/vike-app/web/playwright.config.ts +79 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/check-standalone-deployment.ts +511 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/container-entrypoint.sh +33 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/run-playwright.ts +151 -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 +1 -0
- 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 +2 -1
- 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-core/dist/Cargo.toml +1 -1
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +9 -0
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +56 -1
- 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 +43 -2
- package/node_modules/@ykdz/template-core/dist/module-graph.js +58 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +43 -0
- package/node_modules/@ykdz/template-core/dist/package-contribution.js +24 -0
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +28 -9
- 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 +8 -9
- package/node_modules/@ykdz/template-core/dist/project-github.js +94 -9
- 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 +114 -29
- 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 +99 -49
- 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 +9 -6
- 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 +20 -13
- 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 -517
- 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 -28
- 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/Dockerfile +0 -47
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/playwright.config.ts +0 -43
- package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/run-playwright.ts +0 -81
- 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 -75
- package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +0 -572
- 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 -69
- 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 -2168
- 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 -36
- 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 → template-builtin-presets}/templates/vike-app/db/turbo.json +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/server/api.ts +0 -0
- package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/server/app.ts +1 -1
- /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/turbo.json +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/playwright.config.ts +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/templates/vike-app → template-builtin-presets/templates/vue-hono-app}/web/turbo.json +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,572 +0,0 @@
|
|
|
1
|
-
import { createHash } from "node:crypto";
|
|
2
|
-
import { mkdir, readdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { PackageAdditionSupport } from "@ykdz/template-shared";
|
|
5
|
-
import { execa } from "execa";
|
|
6
|
-
import * as v from "valibot";
|
|
7
|
-
import { assembleGenerationContext } from "./generation-context.js";
|
|
8
|
-
import { playwrightBrowserAssetsEnvironmentNeed, } from "./module-graph.js";
|
|
9
|
-
import { planNextStepInstructions } from "./next-step-instructions.js";
|
|
10
|
-
import { canPlanPackageLinkIntent, } from "./package-linking.js";
|
|
11
|
-
import { findPresetSourceManifestPreset } from "./preset-source.js";
|
|
12
|
-
import { blueprintForPresetSourcePreset, projectPresetSourcePreset, } from "./projection-capabilities.js";
|
|
13
|
-
const defaultDeterministicToolchainEnv = {
|
|
14
|
-
TEMPLATE_TOOLCHAIN_RESOLUTION: "bundled-fallback",
|
|
15
|
-
};
|
|
16
|
-
const defaultFixtureConcurrency = 2;
|
|
17
|
-
const scenarioFingerprintVersion = 1;
|
|
18
|
-
const storedBlueprintSchema = v.object({
|
|
19
|
-
packages: v.optional(v.array(v.object({
|
|
20
|
-
name: v.string(),
|
|
21
|
-
path: v.string(),
|
|
22
|
-
}))),
|
|
23
|
-
});
|
|
24
|
-
export function generatedScenarioChildProcessEnv(env = {}) {
|
|
25
|
-
const childEnv = { ...process.env, ...env };
|
|
26
|
-
if (childEnv.NO_COLOR !== undefined && childEnv.FORCE_COLOR !== undefined) {
|
|
27
|
-
delete childEnv.FORCE_COLOR;
|
|
28
|
-
}
|
|
29
|
-
return childEnv;
|
|
30
|
-
}
|
|
31
|
-
function cliSourceExecutionEnv(options, env = {}) {
|
|
32
|
-
return {
|
|
33
|
-
...env,
|
|
34
|
-
TSX_TSCONFIG_PATH: path.join(options.repoRoot, "tsconfig.json"),
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export function createExclusiveLock() {
|
|
38
|
-
let tail = Promise.resolve();
|
|
39
|
-
return {
|
|
40
|
-
async run(callback) {
|
|
41
|
-
const previous = tail;
|
|
42
|
-
let release;
|
|
43
|
-
tail = new Promise((resolve) => {
|
|
44
|
-
release = resolve;
|
|
45
|
-
});
|
|
46
|
-
await previous;
|
|
47
|
-
try {
|
|
48
|
-
return await callback();
|
|
49
|
-
}
|
|
50
|
-
finally {
|
|
51
|
-
release();
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export function generatedScenarioId(scenario) {
|
|
57
|
-
if (!scenario.addedPreset) {
|
|
58
|
-
return scenario.basePreset;
|
|
59
|
-
}
|
|
60
|
-
if (scenario.linkFrom && scenario.linkFrom.length > 0) {
|
|
61
|
-
const linkFromId = scenario.linkFrom
|
|
62
|
-
.map((packagePath) => packagePath.replaceAll("/", "-"))
|
|
63
|
-
.join("-");
|
|
64
|
-
return `${scenario.basePreset}-add-${scenario.addedPreset}-link-from-${linkFromId}`;
|
|
65
|
-
}
|
|
66
|
-
return `${scenario.basePreset}-add-${scenario.addedPreset}`;
|
|
67
|
-
}
|
|
68
|
-
export function generatedScenarioLabel(scenario) {
|
|
69
|
-
if (!scenario.addedPreset) {
|
|
70
|
-
return scenario.basePreset;
|
|
71
|
-
}
|
|
72
|
-
if (scenario.linkFrom && scenario.linkFrom.length > 0) {
|
|
73
|
-
return `${scenario.basePreset} + ${scenario.addedPreset} linked from ${scenario.linkFrom.join(", ")}`;
|
|
74
|
-
}
|
|
75
|
-
return `${scenario.basePreset} + ${scenario.addedPreset}`;
|
|
76
|
-
}
|
|
77
|
-
function createGeneratedScenario(set, input) {
|
|
78
|
-
return {
|
|
79
|
-
set,
|
|
80
|
-
basePreset: input.basePreset,
|
|
81
|
-
...(input.addedPreset === undefined
|
|
82
|
-
? {}
|
|
83
|
-
: { addedPreset: input.addedPreset }),
|
|
84
|
-
...(input.linkFrom === undefined ? {} : { linkFrom: [...input.linkFrom] }),
|
|
85
|
-
id: generatedScenarioId(input),
|
|
86
|
-
label: generatedScenarioLabel(input),
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
export function selectGeneratedScenarios(manifest, set) {
|
|
90
|
-
const supportedInitPresets = manifest.presets.filter((preset) => preset.generation === "supported");
|
|
91
|
-
const initScenarios = supportedInitPresets.map((preset) => createGeneratedScenario("init", { basePreset: preset.name }));
|
|
92
|
-
if (set === "init") {
|
|
93
|
-
return { runnable: initScenarios, skipped: [] };
|
|
94
|
-
}
|
|
95
|
-
const addablePresets = manifest.presets.filter((preset) => preset.packageAdditionSupport === PackageAdditionSupport.Supported);
|
|
96
|
-
const focusedScenarios = selectFocusedGeneratedScenarios(manifest, addablePresets);
|
|
97
|
-
if (set === "focused") {
|
|
98
|
-
return {
|
|
99
|
-
runnable: focusedScenarios,
|
|
100
|
-
skipped: [],
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
const matrixScenarios = supportedInitPresets.flatMap((basePreset) => addablePresets.map((addedPreset) => createGeneratedScenario("package-addition-matrix", {
|
|
104
|
-
basePreset: basePreset.name,
|
|
105
|
-
addedPreset: addedPreset.name,
|
|
106
|
-
})));
|
|
107
|
-
return {
|
|
108
|
-
runnable: [...matrixScenarios, ...focusedScenarios],
|
|
109
|
-
skipped: [],
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
function selectFocusedGeneratedScenarios(manifest, addablePresets) {
|
|
113
|
-
return manifest.presets
|
|
114
|
-
.filter((preset) => preset.generation === "supported")
|
|
115
|
-
.flatMap((basePreset) => addablePresets.flatMap((addedPreset) => {
|
|
116
|
-
const consumerPackagePath = focusedPackageLinkConsumerPath(basePreset, addedPreset);
|
|
117
|
-
return consumerPackagePath === undefined
|
|
118
|
-
? []
|
|
119
|
-
: [
|
|
120
|
-
createGeneratedScenario("focused", {
|
|
121
|
-
basePreset: basePreset.name,
|
|
122
|
-
addedPreset: addedPreset.name,
|
|
123
|
-
linkFrom: [consumerPackagePath],
|
|
124
|
-
}),
|
|
125
|
-
];
|
|
126
|
-
}));
|
|
127
|
-
}
|
|
128
|
-
function focusedPackageLinkConsumerPath(basePreset, addedPreset) {
|
|
129
|
-
const providers = packageLinkProviderDefinitions(addedPreset);
|
|
130
|
-
return packageLinkConsumerDefinitions(basePreset).find((consumer) => providers.some((provider) => canPlanPackageLinkIntent({ consumer, provider })))?.path;
|
|
131
|
-
}
|
|
132
|
-
function packageLinkProviderDefinitions(preset) {
|
|
133
|
-
return (preset.projection?.capabilities.flatMap((capability) => {
|
|
134
|
-
if (capability.kind !== "workspace-library-package") {
|
|
135
|
-
return [];
|
|
136
|
-
}
|
|
137
|
-
const packageLeafName = `fixture-${preset.name}`;
|
|
138
|
-
return [
|
|
139
|
-
{
|
|
140
|
-
name: `@fixture/${packageLeafName}`,
|
|
141
|
-
path: `${packageCollection(capability.workspacePackageGlob)}/${packageLeafName}`,
|
|
142
|
-
role: capability.packageRole,
|
|
143
|
-
sourcePreset: capability.packageSourcePreset,
|
|
144
|
-
},
|
|
145
|
-
];
|
|
146
|
-
}) ?? []);
|
|
147
|
-
}
|
|
148
|
-
function packageLinkConsumerDefinitions(preset) {
|
|
149
|
-
return (preset.projection?.capabilities.flatMap((capability) => {
|
|
150
|
-
if (capability.kind !== "workspace-node-packages") {
|
|
151
|
-
return [];
|
|
152
|
-
}
|
|
153
|
-
return capability.packages
|
|
154
|
-
.filter((nodePackage) => nodePackage.sourceFiles.some((sourceFile) => hasSourceDirectoryPath(sourceFile)))
|
|
155
|
-
.map((nodePackage) => ({
|
|
156
|
-
name: `@fixture/${packageLeaf(nodePackage.path)}`,
|
|
157
|
-
path: nodePackage.path,
|
|
158
|
-
role: "runtime-service",
|
|
159
|
-
sourcePreset: nodePackage.kind,
|
|
160
|
-
}));
|
|
161
|
-
}) ?? []);
|
|
162
|
-
}
|
|
163
|
-
function packageCollection(workspacePackageGlob) {
|
|
164
|
-
const [collection, wildcard] = workspacePackageGlob.split("/");
|
|
165
|
-
if (!collection || wildcard !== "*") {
|
|
166
|
-
throw new Error(`Unsupported workspace package glob: ${workspacePackageGlob}`);
|
|
167
|
-
}
|
|
168
|
-
return collection;
|
|
169
|
-
}
|
|
170
|
-
function packageLeaf(packagePath) {
|
|
171
|
-
return packagePath.split("/").at(-1) ?? packagePath;
|
|
172
|
-
}
|
|
173
|
-
function hasSourceDirectoryPath(sourceFile) {
|
|
174
|
-
return sourceFile.startsWith("src/") || sourceFile.includes("/src/");
|
|
175
|
-
}
|
|
176
|
-
function scenarioFingerprintPrefix(scenario) {
|
|
177
|
-
return JSON.stringify({
|
|
178
|
-
version: scenarioFingerprintVersion,
|
|
179
|
-
scenario,
|
|
180
|
-
platform: process.platform,
|
|
181
|
-
arch: process.arch,
|
|
182
|
-
nodeMajor: process.versions.node.split(".")[0],
|
|
183
|
-
qualityGateProtocol: "lockfile-only-snapshot-then-fix-check",
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
async function hashGeneratedScenarioDirectory(scenario, projectDir) {
|
|
187
|
-
const hash = createHash("sha256");
|
|
188
|
-
hash.update(scenarioFingerprintPrefix(scenario));
|
|
189
|
-
await hashDirectoryEntries(projectDir, projectDir, hash);
|
|
190
|
-
return hash.digest("hex");
|
|
191
|
-
}
|
|
192
|
-
async function hashDirectoryEntries(rootDir, currentDir, hash) {
|
|
193
|
-
const entries = await readdir(currentDir, { withFileTypes: true });
|
|
194
|
-
for (const entry of entries.toSorted((left, right) => left.name.localeCompare(right.name))) {
|
|
195
|
-
if (entry.name === "node_modules" || entry.name === ".git") {
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
const entryPath = path.join(currentDir, entry.name);
|
|
199
|
-
const relativePath = path
|
|
200
|
-
.relative(rootDir, entryPath)
|
|
201
|
-
.split(path.sep)
|
|
202
|
-
.join("/");
|
|
203
|
-
if (entry.isDirectory()) {
|
|
204
|
-
hash.update(`dir\0${relativePath}\0`);
|
|
205
|
-
await hashDirectoryEntries(rootDir, entryPath, hash);
|
|
206
|
-
continue;
|
|
207
|
-
}
|
|
208
|
-
if (!entry.isFile()) {
|
|
209
|
-
const fileStat = await stat(entryPath);
|
|
210
|
-
hash.update(`special\0${relativePath}\0${fileStat.mode.toString(8)}\0`);
|
|
211
|
-
continue;
|
|
212
|
-
}
|
|
213
|
-
const fileStat = await stat(entryPath);
|
|
214
|
-
hash.update(`file\0${relativePath}\0${fileStat.mode.toString(8)}\0`);
|
|
215
|
-
hash.update(await readFile(entryPath));
|
|
216
|
-
hash.update("\0");
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
async function scenarioReplayMarkerExists(cache, fingerprint) {
|
|
220
|
-
try {
|
|
221
|
-
await readFile(path.join(cache.directory, `${fingerprint}.passed`), "utf8");
|
|
222
|
-
return true;
|
|
223
|
-
}
|
|
224
|
-
catch (error) {
|
|
225
|
-
if (error &&
|
|
226
|
-
typeof error === "object" &&
|
|
227
|
-
"code" in error &&
|
|
228
|
-
error.code === "ENOENT") {
|
|
229
|
-
return false;
|
|
230
|
-
}
|
|
231
|
-
throw error;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
async function writeScenarioReplayMarker(cache, fingerprint, scenario) {
|
|
235
|
-
await mkdir(cache.directory, { recursive: true });
|
|
236
|
-
await writeFile(path.join(cache.directory, `${fingerprint}.passed`), `${JSON.stringify({ scenario, fingerprint })}\n`, "utf8");
|
|
237
|
-
}
|
|
238
|
-
export function packageLeafNameForAddedPreset(manifest, presetName) {
|
|
239
|
-
const preset = manifest.presets.find((entry) => entry.name === presetName);
|
|
240
|
-
if (!preset) {
|
|
241
|
-
throw new Error(`Unknown fixture Package Addition preset: ${presetName}`);
|
|
242
|
-
}
|
|
243
|
-
if (preset.packageAdditionSupport !== PackageAdditionSupport.Supported) {
|
|
244
|
-
throw new Error(`Preset ${presetName} cannot be used for fixture Package Addition`);
|
|
245
|
-
}
|
|
246
|
-
const packageLeafName = `fixture-${presetName}`;
|
|
247
|
-
if (!/^[a-z0-9][a-z0-9-]*$/.test(packageLeafName)) {
|
|
248
|
-
throw new Error(`Fixture Package Addition leaf name for preset ${presetName} must be a lowercase package leaf name using letters, numbers, and hyphens`);
|
|
249
|
-
}
|
|
250
|
-
return packageLeafName;
|
|
251
|
-
}
|
|
252
|
-
export async function defaultGeneratedScenarioCommandRunner(command, args, cwd, options = {}) {
|
|
253
|
-
const prefix = options.logPrefix ? `[${options.logPrefix}] ` : "";
|
|
254
|
-
console.log(`${prefix}$ ${[command, ...args].join(" ")}`);
|
|
255
|
-
await execa(command, [...args], {
|
|
256
|
-
cwd,
|
|
257
|
-
env: generatedScenarioChildProcessEnv(options.env),
|
|
258
|
-
extendEnv: false,
|
|
259
|
-
stdio: "inherit",
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
async function generateScenario(scenario, workspace, options) {
|
|
263
|
-
const projectDir = path.join(workspace, `fixture-${scenario.id}`);
|
|
264
|
-
await options.runCommand("pnpm", [
|
|
265
|
-
"exec",
|
|
266
|
-
"tsx",
|
|
267
|
-
options.cliPath,
|
|
268
|
-
"init",
|
|
269
|
-
projectDir,
|
|
270
|
-
"--preset",
|
|
271
|
-
scenario.basePreset,
|
|
272
|
-
"--yes",
|
|
273
|
-
], options.repoRoot, {
|
|
274
|
-
env: cliSourceExecutionEnv(options, options.deterministicToolchainEnv),
|
|
275
|
-
logPrefix: scenario.label,
|
|
276
|
-
});
|
|
277
|
-
return projectDir;
|
|
278
|
-
}
|
|
279
|
-
async function applyPackageAddition(manifest, scenario, projectDir, options) {
|
|
280
|
-
if (!scenario.addedPreset) {
|
|
281
|
-
return undefined;
|
|
282
|
-
}
|
|
283
|
-
const packageLeafName = packageLeafNameForAddedPreset(manifest, scenario.addedPreset);
|
|
284
|
-
const beforeConsumerSources = await linkedConsumerSourceSnapshots(projectDir, scenario.linkFrom ?? []);
|
|
285
|
-
await options.runCommand("pnpm", [
|
|
286
|
-
"exec",
|
|
287
|
-
"tsx",
|
|
288
|
-
options.cliPath,
|
|
289
|
-
"add",
|
|
290
|
-
"package",
|
|
291
|
-
"--preset",
|
|
292
|
-
scenario.addedPreset,
|
|
293
|
-
"--name",
|
|
294
|
-
packageLeafName,
|
|
295
|
-
...linkFromArgs(scenario.linkFrom ?? []),
|
|
296
|
-
], projectDir, {
|
|
297
|
-
env: cliSourceExecutionEnv(options),
|
|
298
|
-
logPrefix: scenario.label,
|
|
299
|
-
});
|
|
300
|
-
await assertLinkedConsumerSourcesUnchanged(projectDir, beforeConsumerSources);
|
|
301
|
-
return readAddedPackagePath(projectDir, packageLeafName);
|
|
302
|
-
}
|
|
303
|
-
function linkFromArgs(packagePaths) {
|
|
304
|
-
return packagePaths.flatMap((packagePath) => ["--link-from", packagePath]);
|
|
305
|
-
}
|
|
306
|
-
async function linkedConsumerSourceSnapshots(projectDir, packagePaths) {
|
|
307
|
-
const snapshots = new Map();
|
|
308
|
-
for (const packagePath of packagePaths) {
|
|
309
|
-
snapshots.set(packagePath, await sourceFileSnapshot(path.join(projectDir, packagePath, "src")));
|
|
310
|
-
}
|
|
311
|
-
return snapshots;
|
|
312
|
-
}
|
|
313
|
-
async function sourceFileSnapshot(sourceDir, currentDir = sourceDir) {
|
|
314
|
-
const snapshot = {};
|
|
315
|
-
const entries = await readdir(currentDir, { withFileTypes: true });
|
|
316
|
-
for (const entry of entries.toSorted((left, right) => left.name.localeCompare(right.name))) {
|
|
317
|
-
const entryPath = path.join(currentDir, entry.name);
|
|
318
|
-
if (entry.isDirectory()) {
|
|
319
|
-
Object.assign(snapshot, await sourceFileSnapshot(sourceDir, entryPath));
|
|
320
|
-
continue;
|
|
321
|
-
}
|
|
322
|
-
if (entry.isFile()) {
|
|
323
|
-
snapshot[path.relative(sourceDir, entryPath)] = await readFile(entryPath, "utf8");
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
return snapshot;
|
|
327
|
-
}
|
|
328
|
-
async function assertLinkedConsumerSourcesUnchanged(projectDir, beforeSnapshots) {
|
|
329
|
-
for (const [packagePath, beforeSnapshot] of beforeSnapshots) {
|
|
330
|
-
const afterSnapshot = await sourceFileSnapshot(path.join(projectDir, packagePath, "src"));
|
|
331
|
-
if (JSON.stringify(afterSnapshot) !== JSON.stringify(beforeSnapshot)) {
|
|
332
|
-
throw new Error(`Package Link Intent fixture modified consumer source files for ${packagePath}`);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
async function readAddedPackagePath(projectDir, packageLeafName) {
|
|
337
|
-
const input = JSON.parse(await readFile(path.join(projectDir, ".template", "blueprint.json"), "utf8"));
|
|
338
|
-
const result = v.safeParse(storedBlueprintSchema, input);
|
|
339
|
-
if (!result.success) {
|
|
340
|
-
throw new Error(`Generated Repository blueprint is invalid: ${result.issues
|
|
341
|
-
.map((issue) => issue.message)
|
|
342
|
-
.join("; ")}`);
|
|
343
|
-
}
|
|
344
|
-
const packageDefinition = result.output.packages?.find((pkg) => path.basename(pkg.path) === packageLeafName);
|
|
345
|
-
if (!packageDefinition) {
|
|
346
|
-
throw new Error(`Package Addition fixture did not record package leaf ${packageLeafName}`);
|
|
347
|
-
}
|
|
348
|
-
return packageDefinition.path;
|
|
349
|
-
}
|
|
350
|
-
function projectionPlanForPreset(presetName, projectDir, manifest, options, packageScope) {
|
|
351
|
-
const preset = findPresetSourceManifestPreset(manifest, presetName);
|
|
352
|
-
if (!preset?.projection) {
|
|
353
|
-
throw new Error(`Missing Preset Projection for fixture preset ${presetName}`);
|
|
354
|
-
}
|
|
355
|
-
const blueprint = blueprintForPresetSourcePreset(preset, {
|
|
356
|
-
targetDir: projectDir,
|
|
357
|
-
...(packageScope === undefined ? {} : { scope: packageScope }),
|
|
358
|
-
});
|
|
359
|
-
return projectPresetSourcePreset({
|
|
360
|
-
preset,
|
|
361
|
-
sourceRoots: options.projectionSourceRoots,
|
|
362
|
-
context: assembleGenerationContext({
|
|
363
|
-
targetDir: projectDir,
|
|
364
|
-
blueprint,
|
|
365
|
-
toolchain: {
|
|
366
|
-
nodeLtsMajor: { kind: "NodeLtsMajor", value: "24" },
|
|
367
|
-
packageManagerPin: { kind: "PackageManagerPin", value: "pnpm@10.34.4" },
|
|
368
|
-
source: "bundled-fallback",
|
|
369
|
-
diagnostics: [],
|
|
370
|
-
},
|
|
371
|
-
}),
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
function machineVerifiableNextStepsForPreset(presetName, projectDir, manifest, options) {
|
|
375
|
-
const projectionPlan = projectionPlanForPreset(presetName, projectDir, manifest, options);
|
|
376
|
-
const plan = planNextStepInstructions({
|
|
377
|
-
targetDir: projectDir,
|
|
378
|
-
projectionPlan,
|
|
379
|
-
});
|
|
380
|
-
return plan.steps
|
|
381
|
-
.filter((step) => step.machineVerifiable && step.kind === "command")
|
|
382
|
-
.map((step) => {
|
|
383
|
-
return {
|
|
384
|
-
id: step.id,
|
|
385
|
-
command: step.command,
|
|
386
|
-
args: step.args,
|
|
387
|
-
cwd: step.cwd,
|
|
388
|
-
display: step.display,
|
|
389
|
-
...(step.environmentNeedKind === undefined
|
|
390
|
-
? {}
|
|
391
|
-
: { environmentNeedKind: step.environmentNeedKind }),
|
|
392
|
-
};
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
function addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackagePath, options) {
|
|
396
|
-
if (!scenario.addedPreset || !addedPackagePath) {
|
|
397
|
-
return [];
|
|
398
|
-
}
|
|
399
|
-
return projectionPlanForPreset(scenario.addedPreset, projectDir, manifest, options, path.basename(projectDir)).checkPlan.environmentNeeds.map((need) => {
|
|
400
|
-
if (need.owner.kind !== "package-boundary") {
|
|
401
|
-
return need;
|
|
402
|
-
}
|
|
403
|
-
return playwrightBrowserAssetsEnvironmentNeed({
|
|
404
|
-
browser: need.browser,
|
|
405
|
-
owner: { kind: "package-boundary", path: addedPackagePath },
|
|
406
|
-
machineVerifiable: need.nextStep.machineVerifiable,
|
|
407
|
-
});
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
function environmentNeedStep(need, projectDir) {
|
|
411
|
-
return {
|
|
412
|
-
id: need.nextStep.id,
|
|
413
|
-
command: need.nextStep.command,
|
|
414
|
-
args: [...need.nextStep.args],
|
|
415
|
-
cwd: projectDir,
|
|
416
|
-
display: need.nextStep.display,
|
|
417
|
-
environmentNeedKind: need.kind,
|
|
418
|
-
};
|
|
419
|
-
}
|
|
420
|
-
export function generatedScenarioEnvironmentNeedSteps(needs, projectDir) {
|
|
421
|
-
return needs
|
|
422
|
-
.filter((need) => need.nextStep.machineVerifiable)
|
|
423
|
-
.map((need) => environmentNeedStep(need, projectDir));
|
|
424
|
-
}
|
|
425
|
-
export function generatedScenarioRequiresSerializedRootCheck(steps) {
|
|
426
|
-
return steps.some((step) => step.environmentNeedKind === "playwright-browser-assets");
|
|
427
|
-
}
|
|
428
|
-
export function generatedScenarioQualityGateSteps(manifest, scenario, projectDir, addedPackagePath, options) {
|
|
429
|
-
const normalizedOptions = normalizeRunnerOptions(options);
|
|
430
|
-
const steps = machineVerifiableNextStepsForPreset(scenario.basePreset, projectDir, manifest, normalizedOptions);
|
|
431
|
-
const addedEnvironmentSteps = generatedScenarioEnvironmentNeedSteps(addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackagePath, normalizedOptions), projectDir);
|
|
432
|
-
const existingDisplays = new Set(steps.map((step) => step.display));
|
|
433
|
-
const extraEnvironmentSteps = addedEnvironmentSteps.filter((step) => !existingDisplays.has(step.display));
|
|
434
|
-
if (extraEnvironmentSteps.length === 0) {
|
|
435
|
-
return steps;
|
|
436
|
-
}
|
|
437
|
-
const rootCheckIndex = steps.findIndex((step) => step.id === "run-root-check");
|
|
438
|
-
if (rootCheckIndex === -1) {
|
|
439
|
-
return [...steps, ...extraEnvironmentSteps];
|
|
440
|
-
}
|
|
441
|
-
return [
|
|
442
|
-
...steps.slice(0, rootCheckIndex),
|
|
443
|
-
...extraEnvironmentSteps,
|
|
444
|
-
...steps.slice(rootCheckIndex),
|
|
445
|
-
];
|
|
446
|
-
}
|
|
447
|
-
async function runGeneratedScenarioQualityGate(manifest, scenario, projectDir, addedPackagePath, options) {
|
|
448
|
-
const steps = generatedScenarioQualityGateSteps(manifest, scenario, projectDir, addedPackagePath, options);
|
|
449
|
-
const requiresSerializedPlaywrightRootCheck = generatedScenarioRequiresSerializedRootCheck(steps);
|
|
450
|
-
let replayFingerprint;
|
|
451
|
-
for (const step of steps) {
|
|
452
|
-
if (step.id === "install-dependencies") {
|
|
453
|
-
const installResult = await runGeneratedScenarioInstallStep(step, scenario, options);
|
|
454
|
-
replayFingerprint = installResult.fingerprint;
|
|
455
|
-
if (installResult.replayed) {
|
|
456
|
-
return;
|
|
457
|
-
}
|
|
458
|
-
continue;
|
|
459
|
-
}
|
|
460
|
-
const env = step.id === "run-root-check" ? { CI: "1" } : undefined;
|
|
461
|
-
const runStep = async () => {
|
|
462
|
-
await options.runCommand(step.command, [...step.args], step.cwd, {
|
|
463
|
-
...(env === undefined ? {} : { env }),
|
|
464
|
-
logPrefix: scenario.label,
|
|
465
|
-
});
|
|
466
|
-
};
|
|
467
|
-
if (step.id === "run-root-check" && requiresSerializedPlaywrightRootCheck) {
|
|
468
|
-
await options.rootCheckLock.run(runStep);
|
|
469
|
-
continue;
|
|
470
|
-
}
|
|
471
|
-
await runStep();
|
|
472
|
-
}
|
|
473
|
-
if (options.replayCache?.write && replayFingerprint !== undefined) {
|
|
474
|
-
await writeScenarioReplayMarker(options.replayCache, replayFingerprint, scenario);
|
|
475
|
-
options.reporter.info?.(`-- Stored passed fixture replay marker for ${scenario.label}: ${replayFingerprint}`);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
async function runGeneratedScenarioInstallStep(step, scenario, options) {
|
|
479
|
-
await options.runCommand(step.command, ["install", "--lockfile-only", "--prefer-offline", "--no-frozen-lockfile"], step.cwd, { logPrefix: scenario.label });
|
|
480
|
-
let replayFingerprint;
|
|
481
|
-
if (options.replayCache) {
|
|
482
|
-
replayFingerprint = await hashGeneratedScenarioDirectory(scenario, step.cwd);
|
|
483
|
-
if (options.replayCache.read &&
|
|
484
|
-
(await scenarioReplayMarkerExists(options.replayCache, replayFingerprint))) {
|
|
485
|
-
options.reporter.info?.(`-- Replayed passed fixture ${scenario.label}: ${replayFingerprint}`);
|
|
486
|
-
return { fingerprint: replayFingerprint, replayed: true };
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
await options.runCommand(step.command, ["fetch"], step.cwd, {
|
|
490
|
-
logPrefix: scenario.label,
|
|
491
|
-
});
|
|
492
|
-
await options.runCommand(step.command, ["install", "--offline", "--frozen-lockfile"], step.cwd, { logPrefix: scenario.label });
|
|
493
|
-
return { fingerprint: replayFingerprint, replayed: false };
|
|
494
|
-
}
|
|
495
|
-
async function checkGeneratedScenario(manifest, scenario, workspace, options) {
|
|
496
|
-
options.reporter.info?.(`\n== ${scenario.label} ==`);
|
|
497
|
-
const projectDir = await generateScenario(scenario, workspace, options);
|
|
498
|
-
const addedPackagePath = await applyPackageAddition(manifest, scenario, projectDir, options);
|
|
499
|
-
await runGeneratedScenarioQualityGate(manifest, scenario, projectDir, addedPackagePath, options);
|
|
500
|
-
}
|
|
501
|
-
export function fixtureConcurrency(scenarioCount) {
|
|
502
|
-
const rawValue = process.env.TEMPLATE_FIXTURE_CONCURRENCY;
|
|
503
|
-
if (rawValue === undefined || rawValue === "") {
|
|
504
|
-
return Math.min(defaultFixtureConcurrency, scenarioCount);
|
|
505
|
-
}
|
|
506
|
-
const value = Number(rawValue);
|
|
507
|
-
if (!Number.isInteger(value) || value < 1) {
|
|
508
|
-
throw new Error("TEMPLATE_FIXTURE_CONCURRENCY must be a positive integer");
|
|
509
|
-
}
|
|
510
|
-
return Math.min(value, scenarioCount);
|
|
511
|
-
}
|
|
512
|
-
export function errorForFailedGeneratedScenario(scenario, error) {
|
|
513
|
-
if (error instanceof Error) {
|
|
514
|
-
return new Error(`Fixture scenario failed: ${scenario.label}`, {
|
|
515
|
-
cause: error,
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
return new Error(`Fixture scenario failed: ${scenario.label}: ${String(error)}`);
|
|
519
|
-
}
|
|
520
|
-
function normalizeRunnerOptions(options) {
|
|
521
|
-
return {
|
|
522
|
-
repoRoot: options.repoRoot,
|
|
523
|
-
cliPath: options.cliPath,
|
|
524
|
-
projectionSourceRoots: options.projectionSourceRoots,
|
|
525
|
-
runCommand: options.runCommand ?? defaultGeneratedScenarioCommandRunner,
|
|
526
|
-
reporter: options.reporter ?? {
|
|
527
|
-
info: console.log,
|
|
528
|
-
error: console.error,
|
|
529
|
-
},
|
|
530
|
-
deterministicToolchainEnv: options.deterministicToolchainEnv ?? defaultDeterministicToolchainEnv,
|
|
531
|
-
rootCheckLock: options.rootCheckLock ?? createExclusiveLock(),
|
|
532
|
-
replayCache: options.replayCache,
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
export async function runGeneratedScenariosConcurrently(manifest, scenarios, workspace, concurrency, options) {
|
|
536
|
-
const normalizedOptions = normalizeRunnerOptions(options);
|
|
537
|
-
let nextScenarioIndex = 0;
|
|
538
|
-
let firstFailure;
|
|
539
|
-
async function worker() {
|
|
540
|
-
while (firstFailure === undefined) {
|
|
541
|
-
const scenario = scenarios[nextScenarioIndex];
|
|
542
|
-
nextScenarioIndex += 1;
|
|
543
|
-
if (!scenario) {
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
try {
|
|
547
|
-
await checkGeneratedScenario(manifest, scenario, workspace, normalizedOptions);
|
|
548
|
-
}
|
|
549
|
-
catch (error) {
|
|
550
|
-
firstFailure ??= errorForFailedGeneratedScenario(scenario, error);
|
|
551
|
-
return;
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
await Promise.all(Array.from({ length: concurrency }, async () => {
|
|
556
|
-
await worker();
|
|
557
|
-
}));
|
|
558
|
-
if (firstFailure) {
|
|
559
|
-
throw firstFailure;
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
export async function runGeneratedScenarioSet(manifest, set, workspace, options) {
|
|
563
|
-
const normalizedOptions = normalizeRunnerOptions(options);
|
|
564
|
-
const selection = selectGeneratedScenarios(manifest, set);
|
|
565
|
-
const concurrency = fixtureConcurrency(selection.runnable.length);
|
|
566
|
-
for (const skippedScenario of selection.skipped) {
|
|
567
|
-
normalizedOptions.reporter.info?.(`-- Skipping ${skippedScenario.label}: ${skippedScenario.reason}`);
|
|
568
|
-
}
|
|
569
|
-
normalizedOptions.reporter.info?.(`Checking ${selection.runnable.length} fixture scenarios with concurrency ${concurrency}.`);
|
|
570
|
-
await runGeneratedScenariosConcurrently(manifest, selection.runnable, workspace, concurrency, normalizedOptions);
|
|
571
|
-
return selection;
|
|
572
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { PackageManager, ProjectBlueprint } from "@ykdz/template-shared";
|
|
2
|
-
import type { ResolvedToolchainVersions } from "./toolchain-resolution.js";
|
|
3
|
-
export type ProjectName = {
|
|
4
|
-
readonly kind: "ProjectName";
|
|
5
|
-
readonly value: string;
|
|
6
|
-
};
|
|
7
|
-
export type GenerationPackageManager = {
|
|
8
|
-
readonly kind: "PackageManager";
|
|
9
|
-
readonly value: PackageManager;
|
|
10
|
-
};
|
|
11
|
-
export type GenerationContext = {
|
|
12
|
-
readonly projectName: ProjectName;
|
|
13
|
-
readonly preset: string;
|
|
14
|
-
readonly packageManager?: GenerationPackageManager;
|
|
15
|
-
readonly blueprint: ProjectBlueprint;
|
|
16
|
-
readonly toolchain: ResolvedToolchainVersions;
|
|
17
|
-
};
|
|
18
|
-
export type AssembleGenerationContextOptions = {
|
|
19
|
-
readonly targetDir: string;
|
|
20
|
-
readonly blueprint: ProjectBlueprint;
|
|
21
|
-
readonly toolchain: ResolvedToolchainVersions;
|
|
22
|
-
};
|
|
23
|
-
export declare function assembleGenerationContext(options: AssembleGenerationContextOptions): GenerationContext;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
export function assembleGenerationContext(options) {
|
|
3
|
-
return {
|
|
4
|
-
projectName: {
|
|
5
|
-
kind: "ProjectName",
|
|
6
|
-
value: path.basename(path.resolve(options.targetDir)),
|
|
7
|
-
},
|
|
8
|
-
preset: options.blueprint.preset,
|
|
9
|
-
...(options.blueprint.packageManager
|
|
10
|
-
? {
|
|
11
|
-
packageManager: {
|
|
12
|
-
kind: "PackageManager",
|
|
13
|
-
value: options.blueprint.packageManager,
|
|
14
|
-
},
|
|
15
|
-
}
|
|
16
|
-
: {}),
|
|
17
|
-
blueprint: options.blueprint,
|
|
18
|
-
toolchain: options.toolchain,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { CheckEnvironmentNeed } from "./module-graph.js";
|
|
2
|
-
import type { PresetProjectionPlan } from "./preset-projection.js";
|
|
3
|
-
import type { RenderOperation } from "./renderer.js";
|
|
4
|
-
export type NextStepInstruction = {
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly label: string;
|
|
7
|
-
readonly kind: "navigation" | "command";
|
|
8
|
-
readonly command: string;
|
|
9
|
-
readonly args: readonly string[];
|
|
10
|
-
readonly cwd: string;
|
|
11
|
-
readonly display: string;
|
|
12
|
-
readonly machineVerifiable: boolean;
|
|
13
|
-
readonly environmentNeedKind?: CheckEnvironmentNeed["kind"];
|
|
14
|
-
};
|
|
15
|
-
export type NextStepInstructionPlan = {
|
|
16
|
-
readonly targetDir: string;
|
|
17
|
-
readonly steps: readonly NextStepInstruction[];
|
|
18
|
-
};
|
|
19
|
-
export type PlanNextStepInstructionsOptions = {
|
|
20
|
-
readonly targetDir: string;
|
|
21
|
-
readonly projectionPlan: PresetProjectionPlan;
|
|
22
|
-
};
|
|
23
|
-
export type FollowUpDocumentPlan = {
|
|
24
|
-
readonly enabled: boolean;
|
|
25
|
-
readonly path?: "TODO.md";
|
|
26
|
-
};
|
|
27
|
-
export declare function planNextStepInstructions(options: PlanNextStepInstructionsOptions): NextStepInstructionPlan;
|
|
28
|
-
export declare function formatNextStepInstructionsForCli(plan: NextStepInstructionPlan): string;
|
|
29
|
-
export declare function formatGeneratedFollowUpDocument(plan: NextStepInstructionPlan): string;
|
|
30
|
-
export declare function generatedFollowUpDocumentOperation(plan: NextStepInstructionPlan): RenderOperation;
|