@ykdz/template 0.0.23 → 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.
Files changed (451) hide show
  1. package/dist/cli.js +4 -575
  2. package/dist/main.d.ts +1 -0
  3. package/dist/main.js +370 -0
  4. package/node_modules/@typescript/old/LICENSE.txt +55 -0
  5. package/node_modules/@typescript/old/README.md +50 -0
  6. package/node_modules/@typescript/old/SECURITY.md +39 -0
  7. package/node_modules/@typescript/old/ThirdPartyNoticeText.txt +193 -0
  8. package/node_modules/@typescript/old/bin/tsc +2 -0
  9. package/node_modules/@typescript/old/bin/tsserver +2 -0
  10. package/node_modules/@typescript/old/lib/_tsc.js +134465 -0
  11. package/node_modules/@typescript/old/lib/_tsserver.js +659 -0
  12. package/node_modules/@typescript/old/lib/_typingsInstaller.js +222 -0
  13. package/node_modules/@typescript/old/lib/cs/diagnosticMessages.generated.json +2129 -0
  14. package/node_modules/@typescript/old/lib/de/diagnosticMessages.generated.json +2125 -0
  15. package/node_modules/@typescript/old/lib/es/diagnosticMessages.generated.json +2129 -0
  16. package/node_modules/@typescript/old/lib/fr/diagnosticMessages.generated.json +2129 -0
  17. package/node_modules/@typescript/old/lib/it/diagnosticMessages.generated.json +2125 -0
  18. package/node_modules/@typescript/old/lib/ja/diagnosticMessages.generated.json +2129 -0
  19. package/node_modules/@typescript/old/lib/ko/diagnosticMessages.generated.json +2129 -0
  20. package/node_modules/@typescript/old/lib/lib.d.ts +20 -0
  21. package/node_modules/@typescript/old/lib/lib.decorators.d.ts +382 -0
  22. package/node_modules/@typescript/old/lib/lib.decorators.legacy.d.ts +20 -0
  23. package/node_modules/@typescript/old/lib/lib.dom.asynciterable.d.ts +18 -0
  24. package/node_modules/@typescript/old/lib/lib.dom.d.ts +45125 -0
  25. package/node_modules/@typescript/old/lib/lib.dom.iterable.d.ts +18 -0
  26. package/node_modules/@typescript/old/lib/lib.es2015.collection.d.ts +150 -0
  27. package/node_modules/@typescript/old/lib/lib.es2015.core.d.ts +595 -0
  28. package/node_modules/@typescript/old/lib/lib.es2015.d.ts +26 -0
  29. package/node_modules/@typescript/old/lib/lib.es2015.generator.d.ts +75 -0
  30. package/node_modules/@typescript/old/lib/lib.es2015.iterable.d.ts +603 -0
  31. package/node_modules/@typescript/old/lib/lib.es2015.promise.d.ts +79 -0
  32. package/node_modules/@typescript/old/lib/lib.es2015.proxy.d.ts +126 -0
  33. package/node_modules/@typescript/old/lib/lib.es2015.reflect.d.ts +142 -0
  34. package/node_modules/@typescript/old/lib/lib.es2015.symbol.d.ts +44 -0
  35. package/node_modules/@typescript/old/lib/lib.es2015.symbol.wellknown.d.ts +324 -0
  36. package/node_modules/@typescript/old/lib/lib.es2016.array.include.d.ts +114 -0
  37. package/node_modules/@typescript/old/lib/lib.es2016.d.ts +19 -0
  38. package/node_modules/@typescript/old/lib/lib.es2016.full.d.ts +21 -0
  39. package/node_modules/@typescript/old/lib/lib.es2016.intl.d.ts +29 -0
  40. package/node_modules/@typescript/old/lib/lib.es2017.arraybuffer.d.ts +19 -0
  41. package/node_modules/@typescript/old/lib/lib.es2017.d.ts +24 -0
  42. package/node_modules/@typescript/old/lib/lib.es2017.date.d.ts +29 -0
  43. package/node_modules/@typescript/old/lib/lib.es2017.full.d.ts +21 -0
  44. package/node_modules/@typescript/old/lib/lib.es2017.intl.d.ts +42 -0
  45. package/node_modules/@typescript/old/lib/lib.es2017.object.d.ts +47 -0
  46. package/node_modules/@typescript/old/lib/lib.es2017.sharedmemory.d.ts +133 -0
  47. package/node_modules/@typescript/old/lib/lib.es2017.string.d.ts +43 -0
  48. package/node_modules/@typescript/old/lib/lib.es2017.typedarrays.d.ts +51 -0
  49. package/node_modules/@typescript/old/lib/lib.es2018.asyncgenerator.d.ts +75 -0
  50. package/node_modules/@typescript/old/lib/lib.es2018.asynciterable.d.ts +51 -0
  51. package/node_modules/@typescript/old/lib/lib.es2018.d.ts +22 -0
  52. package/node_modules/@typescript/old/lib/lib.es2018.full.d.ts +22 -0
  53. package/node_modules/@typescript/old/lib/lib.es2018.intl.d.ts +81 -0
  54. package/node_modules/@typescript/old/lib/lib.es2018.promise.d.ts +28 -0
  55. package/node_modules/@typescript/old/lib/lib.es2018.regexp.d.ts +35 -0
  56. package/node_modules/@typescript/old/lib/lib.es2019.array.d.ts +77 -0
  57. package/node_modules/@typescript/old/lib/lib.es2019.d.ts +22 -0
  58. package/node_modules/@typescript/old/lib/lib.es2019.full.d.ts +22 -0
  59. package/node_modules/@typescript/old/lib/lib.es2019.intl.d.ts +21 -0
  60. package/node_modules/@typescript/old/lib/lib.es2019.object.d.ts +31 -0
  61. package/node_modules/@typescript/old/lib/lib.es2019.string.d.ts +35 -0
  62. package/node_modules/@typescript/old/lib/lib.es2019.symbol.d.ts +22 -0
  63. package/node_modules/@typescript/old/lib/lib.es2020.bigint.d.ts +763 -0
  64. package/node_modules/@typescript/old/lib/lib.es2020.d.ts +25 -0
  65. package/node_modules/@typescript/old/lib/lib.es2020.date.d.ts +40 -0
  66. package/node_modules/@typescript/old/lib/lib.es2020.full.d.ts +22 -0
  67. package/node_modules/@typescript/old/lib/lib.es2020.intl.d.ts +472 -0
  68. package/node_modules/@typescript/old/lib/lib.es2020.number.d.ts +26 -0
  69. package/node_modules/@typescript/old/lib/lib.es2020.promise.d.ts +45 -0
  70. package/node_modules/@typescript/old/lib/lib.es2020.sharedmemory.d.ts +97 -0
  71. package/node_modules/@typescript/old/lib/lib.es2020.string.d.ts +42 -0
  72. package/node_modules/@typescript/old/lib/lib.es2020.symbol.wellknown.d.ts +39 -0
  73. package/node_modules/@typescript/old/lib/lib.es2021.d.ts +21 -0
  74. package/node_modules/@typescript/old/lib/lib.es2021.full.d.ts +22 -0
  75. package/node_modules/@typescript/old/lib/lib.es2021.intl.d.ts +164 -0
  76. package/node_modules/@typescript/old/lib/lib.es2021.promise.d.ts +46 -0
  77. package/node_modules/@typescript/old/lib/lib.es2021.string.d.ts +31 -0
  78. package/node_modules/@typescript/old/lib/lib.es2021.weakref.d.ts +76 -0
  79. package/node_modules/@typescript/old/lib/lib.es2022.array.d.ts +119 -0
  80. package/node_modules/@typescript/old/lib/lib.es2022.d.ts +23 -0
  81. package/node_modules/@typescript/old/lib/lib.es2022.error.d.ts +73 -0
  82. package/node_modules/@typescript/old/lib/lib.es2022.full.d.ts +22 -0
  83. package/node_modules/@typescript/old/lib/lib.es2022.intl.d.ts +143 -0
  84. package/node_modules/@typescript/old/lib/lib.es2022.object.d.ts +24 -0
  85. package/node_modules/@typescript/old/lib/lib.es2022.regexp.d.ts +37 -0
  86. package/node_modules/@typescript/old/lib/lib.es2022.string.d.ts +23 -0
  87. package/node_modules/@typescript/old/lib/lib.es2023.array.d.ts +922 -0
  88. package/node_modules/@typescript/old/lib/lib.es2023.collection.d.ts +19 -0
  89. package/node_modules/@typescript/old/lib/lib.es2023.d.ts +20 -0
  90. package/node_modules/@typescript/old/lib/lib.es2023.full.d.ts +22 -0
  91. package/node_modules/@typescript/old/lib/lib.es2023.intl.d.ts +62 -0
  92. package/node_modules/@typescript/old/lib/lib.es2024.arraybuffer.d.ts +63 -0
  93. package/node_modules/@typescript/old/lib/lib.es2024.collection.d.ts +27 -0
  94. package/node_modules/@typescript/old/lib/lib.es2024.d.ts +24 -0
  95. package/node_modules/@typescript/old/lib/lib.es2024.full.d.ts +22 -0
  96. package/node_modules/@typescript/old/lib/lib.es2024.object.d.ts +27 -0
  97. package/node_modules/@typescript/old/lib/lib.es2024.promise.d.ts +33 -0
  98. package/node_modules/@typescript/old/lib/lib.es2024.regexp.d.ts +23 -0
  99. package/node_modules/@typescript/old/lib/lib.es2024.sharedmemory.d.ts +66 -0
  100. package/node_modules/@typescript/old/lib/lib.es2024.string.d.ts +27 -0
  101. package/node_modules/@typescript/old/lib/lib.es2025.collection.d.ts +94 -0
  102. package/node_modules/@typescript/old/lib/lib.es2025.d.ts +23 -0
  103. package/node_modules/@typescript/old/lib/lib.es2025.float16.d.ts +443 -0
  104. package/node_modules/@typescript/old/lib/lib.es2025.full.d.ts +22 -0
  105. package/node_modules/@typescript/old/lib/lib.es2025.intl.d.ts +200 -0
  106. package/node_modules/@typescript/old/lib/lib.es2025.iterator.d.ts +146 -0
  107. package/node_modules/@typescript/old/lib/lib.es2025.promise.d.ts +32 -0
  108. package/node_modules/@typescript/old/lib/lib.es2025.regexp.d.ts +30 -0
  109. package/node_modules/@typescript/old/lib/lib.es5.d.ts +4599 -0
  110. package/node_modules/@typescript/old/lib/lib.es6.d.ts +21 -0
  111. package/node_modules/@typescript/old/lib/lib.esnext.array.d.ts +33 -0
  112. package/node_modules/@typescript/old/lib/lib.esnext.collection.d.ts +47 -0
  113. package/node_modules/@typescript/old/lib/lib.esnext.d.ts +27 -0
  114. package/node_modules/@typescript/old/lib/lib.esnext.date.d.ts +21 -0
  115. package/node_modules/@typescript/old/lib/lib.esnext.decorators.d.ts +26 -0
  116. package/node_modules/@typescript/old/lib/lib.esnext.disposable.d.ts +191 -0
  117. package/node_modules/@typescript/old/lib/lib.esnext.error.d.ts +22 -0
  118. package/node_modules/@typescript/old/lib/lib.esnext.full.d.ts +22 -0
  119. package/node_modules/@typescript/old/lib/lib.esnext.intl.d.ts +107 -0
  120. package/node_modules/@typescript/old/lib/lib.esnext.sharedmemory.d.ts +23 -0
  121. package/node_modules/@typescript/old/lib/lib.esnext.temporal.d.ts +485 -0
  122. package/node_modules/@typescript/old/lib/lib.esnext.typedarrays.d.ts +90 -0
  123. package/node_modules/@typescript/old/lib/lib.scripthost.d.ts +320 -0
  124. package/node_modules/@typescript/old/lib/lib.webworker.asynciterable.d.ts +18 -0
  125. package/node_modules/@typescript/old/lib/lib.webworker.d.ts +15606 -0
  126. package/node_modules/@typescript/old/lib/lib.webworker.importscripts.d.ts +21 -0
  127. package/node_modules/@typescript/old/lib/lib.webworker.iterable.d.ts +18 -0
  128. package/node_modules/@typescript/old/lib/pl/diagnosticMessages.generated.json +2129 -0
  129. package/node_modules/@typescript/old/lib/pt-br/diagnosticMessages.generated.json +2129 -0
  130. package/node_modules/@typescript/old/lib/ru/diagnosticMessages.generated.json +2125 -0
  131. package/node_modules/@typescript/old/lib/tr/diagnosticMessages.generated.json +2129 -0
  132. package/node_modules/@typescript/old/lib/tsc.js +8 -0
  133. package/node_modules/@typescript/old/lib/tsserver.js +8 -0
  134. package/node_modules/@typescript/old/lib/tsserverlibrary.d.ts +17 -0
  135. package/node_modules/@typescript/old/lib/tsserverlibrary.js +21 -0
  136. package/node_modules/@typescript/old/lib/typesMap.json +497 -0
  137. package/node_modules/@typescript/old/lib/typescript.d.ts +11448 -0
  138. package/node_modules/@typescript/old/lib/typescript.js +201039 -0
  139. package/node_modules/@typescript/old/lib/typingsInstaller.js +8 -0
  140. package/node_modules/@typescript/old/lib/watchGuard.js +53 -0
  141. package/node_modules/@typescript/old/lib/zh-cn/diagnosticMessages.generated.json +2129 -0
  142. package/node_modules/@typescript/old/lib/zh-tw/diagnosticMessages.generated.json +2125 -0
  143. package/node_modules/@typescript/old/package.json +118 -0
  144. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.d.ts +85 -0
  145. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +797 -0
  146. package/node_modules/@ykdz/template-builtin-presets/dist/src/index.d.ts +3 -0
  147. package/node_modules/@ykdz/template-builtin-presets/dist/src/index.js +2 -0
  148. package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.d.ts +2 -0
  149. package/node_modules/@ykdz/template-builtin-presets/dist/src/rust-bin/definition.js +134 -0
  150. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +36 -0
  151. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +106 -0
  152. package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.d.ts +14 -0
  153. package/node_modules/@ykdz/template-builtin-presets/dist/src/template-sources.js +26 -0
  154. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.d.ts +2 -0
  155. package/node_modules/@ykdz/template-builtin-presets/dist/src/ts-lib/definition.js +138 -0
  156. package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.d.ts +2 -0
  157. package/node_modules/@ykdz/template-builtin-presets/dist/src/vike-app/definition.js +408 -0
  158. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.d.ts +2 -0
  159. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-app/definition.js +94 -0
  160. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.d.ts +2 -0
  161. package/node_modules/@ykdz/template-builtin-presets/dist/src/vue-hono-app/definition.js +179 -0
  162. package/node_modules/@ykdz/template-builtin-presets/package.json +67 -0
  163. package/node_modules/@ykdz/{template-builtin-source/templates/vue-app/.github/dependabot.yml → template-builtin-presets/templates/foundation/.github/dependabot-rust.yml} +13 -0
  164. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/dependabot.dynamic.template +4 -0
  165. package/node_modules/@ykdz/{template-builtin-source/templates/ts-lib → template-builtin-presets/templates/foundation}/.github/dependabot.yml +5 -0
  166. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.dynamic.template +19 -0
  167. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.pnpmfile.cts +14 -0
  168. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/TODO.md.template +5 -0
  169. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/devcontainer.json +16 -0
  170. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/gitignore +8 -0
  171. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +23 -0
  172. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +29 -0
  173. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/extensions.json +3 -0
  174. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/settings.json +5 -0
  175. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/devcontainer/devcontainer.json +21 -0
  176. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/tsconfig.json +4 -0
  177. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +18 -0
  178. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/.github/dependabot.yml +5 -0
  179. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/workflows/check.yml +23 -0
  180. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/extensions.json +3 -0
  181. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/settings.json +5 -0
  182. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.lock +16 -0
  183. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.toml +27 -0
  184. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/devcontainer.json +21 -0
  185. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/rust.Dockerfile +16 -0
  186. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/rust-toolchain.toml +3 -0
  187. package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/node-pnpm.Dockerfile +12 -0
  188. package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/shellcheck.Dockerfile +3 -0
  189. package/node_modules/@ykdz/template-builtin-presets/templates/shared/editor-customization/capabilities.json +38 -0
  190. package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/node/oxlint.config.ts +6 -0
  191. package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/oxfmt.config.ts +3 -0
  192. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/shared/oxc/tsconfig.config.json +2 -2
  193. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.app.json +25 -0
  194. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.json +8 -0
  195. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.node.json +30 -0
  196. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.test.json +9 -0
  197. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/typescript/run-vue-tsc.ts +12 -0
  198. package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app → template-builtin-presets/templates/ts-lib}/.github/dependabot.yml +5 -0
  199. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/workflows/check.yml +19 -0
  200. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/src/index.ts +1 -3
  201. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.json +13 -0
  202. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/readiness.ts +2 -2
  203. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/src/types.d.ts +1 -0
  204. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.json +26 -0
  205. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/drizzle.config.ts +17 -0
  206. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/scripts/prepare-database.ts +45 -0
  207. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/tsconfig.json +22 -0
  208. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/turbo.json +10 -0
  209. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/Dockerfile +21 -30
  210. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/index/+Page.telefunc.ts +0 -2
  211. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/index/+Page.vue +2 -1
  212. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/playwright.config.ts +1 -1
  213. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/scripts/check-standalone-deployment.ts +83 -21
  214. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/container-entrypoint.sh +33 -0
  215. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/test/e2e/app.spec.ts +3 -1
  216. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.app.json +34 -0
  217. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.json +9 -0
  218. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.node.json +31 -0
  219. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.test.json +11 -0
  220. package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/vike-app/web}/turbo.json +1 -0
  221. package/node_modules/@ykdz/{template-builtin-source/templates/vike-app → template-builtin-presets/templates/vue-app}/.github/dependabot.yml +5 -4
  222. package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app/web → template-builtin-presets/templates/vue-app}/turbo.json +2 -1
  223. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/typescript/tsconfig.json +8 -0
  224. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/src/index.ts +3 -0
  225. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/src/server.ts +1 -1
  226. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/test/app.test.ts +1 -1
  227. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.build.json +9 -0
  228. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json +25 -0
  229. package/node_modules/@ykdz/template-core/dist/Cargo.toml +1 -1
  230. package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +9 -0
  231. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +54 -12
  232. package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +11 -3
  233. package/node_modules/@ykdz/template-core/dist/devcontainer.js +17 -3
  234. package/node_modules/@ykdz/template-core/dist/editor-customization.d.ts +5 -9
  235. package/node_modules/@ykdz/template-core/dist/editor-customization.js +8 -46
  236. package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +31 -2
  237. package/node_modules/@ykdz/template-core/dist/module-graph.js +40 -0
  238. package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +43 -0
  239. package/node_modules/@ykdz/template-core/dist/package-contribution.js +24 -0
  240. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +24 -8
  241. package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +42 -0
  242. package/node_modules/@ykdz/template-core/dist/preset-definition.js +1 -0
  243. package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.d.ts +33 -0
  244. package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.js +161 -0
  245. package/node_modules/@ykdz/template-core/dist/project-github.d.ts +8 -1
  246. package/node_modules/@ykdz/template-core/dist/project-github.js +86 -8
  247. package/node_modules/@ykdz/template-core/dist/project-linking-v2.d.ts +20 -0
  248. package/node_modules/@ykdz/template-core/dist/project-linking-v2.js +37 -0
  249. package/node_modules/@ykdz/template-core/dist/renderer.d.ts +40 -5
  250. package/node_modules/@ykdz/template-core/dist/renderer.js +115 -30
  251. package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +21 -15
  252. package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +100 -50
  253. package/node_modules/@ykdz/template-core/dist/toolchain-baseline-update.d.ts +45 -0
  254. package/node_modules/@ykdz/template-core/dist/toolchain-baseline-update.js +27 -0
  255. package/node_modules/@ykdz/template-core/dist/toolchain-resolution.d.ts +1 -0
  256. package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +50 -52
  257. package/node_modules/@ykdz/template-core/package.json +10 -8
  258. package/node_modules/semver/LICENSE +15 -0
  259. package/node_modules/semver/README.md +680 -0
  260. package/node_modules/semver/bin/semver.js +195 -0
  261. package/node_modules/semver/classes/comparator.js +143 -0
  262. package/node_modules/semver/classes/index.js +7 -0
  263. package/node_modules/semver/classes/range.js +577 -0
  264. package/node_modules/semver/classes/semver.js +350 -0
  265. package/node_modules/semver/functions/clean.js +8 -0
  266. package/node_modules/semver/functions/cmp.js +54 -0
  267. package/node_modules/semver/functions/coerce.js +62 -0
  268. package/node_modules/semver/functions/compare-build.js +9 -0
  269. package/node_modules/semver/functions/compare-loose.js +5 -0
  270. package/node_modules/semver/functions/compare.js +7 -0
  271. package/node_modules/semver/functions/diff.js +60 -0
  272. package/node_modules/semver/functions/eq.js +5 -0
  273. package/node_modules/semver/functions/gt.js +5 -0
  274. package/node_modules/semver/functions/gte.js +5 -0
  275. package/node_modules/semver/functions/inc.js +21 -0
  276. package/node_modules/semver/functions/lt.js +5 -0
  277. package/node_modules/semver/functions/lte.js +5 -0
  278. package/node_modules/semver/functions/major.js +5 -0
  279. package/node_modules/semver/functions/minor.js +5 -0
  280. package/node_modules/semver/functions/neq.js +5 -0
  281. package/node_modules/semver/functions/parse.js +18 -0
  282. package/node_modules/semver/functions/patch.js +5 -0
  283. package/node_modules/semver/functions/prerelease.js +8 -0
  284. package/node_modules/semver/functions/rcompare.js +5 -0
  285. package/node_modules/semver/functions/rsort.js +5 -0
  286. package/node_modules/semver/functions/satisfies.js +12 -0
  287. package/node_modules/semver/functions/sort.js +5 -0
  288. package/node_modules/semver/functions/truncate.js +48 -0
  289. package/node_modules/semver/functions/valid.js +8 -0
  290. package/node_modules/semver/index.js +93 -0
  291. package/node_modules/semver/internal/constants.js +37 -0
  292. package/node_modules/semver/internal/debug.js +11 -0
  293. package/node_modules/semver/internal/identifiers.js +29 -0
  294. package/node_modules/semver/internal/lrucache.js +42 -0
  295. package/node_modules/semver/internal/parse-options.js +17 -0
  296. package/node_modules/semver/internal/re.js +223 -0
  297. package/node_modules/semver/package.json +78 -0
  298. package/node_modules/semver/preload.js +4 -0
  299. package/node_modules/semver/range.bnf +17 -0
  300. package/node_modules/semver/ranges/gtr.js +6 -0
  301. package/node_modules/semver/ranges/intersects.js +9 -0
  302. package/node_modules/semver/ranges/ltr.js +6 -0
  303. package/node_modules/semver/ranges/max-satisfying.js +27 -0
  304. package/node_modules/semver/ranges/min-satisfying.js +26 -0
  305. package/node_modules/semver/ranges/min-version.js +63 -0
  306. package/node_modules/semver/ranges/outside.js +82 -0
  307. package/node_modules/semver/ranges/simplify.js +49 -0
  308. package/node_modules/semver/ranges/subset.js +249 -0
  309. package/node_modules/semver/ranges/to-comparators.js +10 -0
  310. package/node_modules/semver/ranges/valid.js +13 -0
  311. package/node_modules/typescript/LICENSE.txt +55 -0
  312. package/node_modules/typescript/README.md +9 -0
  313. package/node_modules/typescript/bin/tsc6 +2 -0
  314. package/node_modules/typescript/lib/tsc.js +1 -0
  315. package/node_modules/typescript/lib/tsserverlibrary.d.ts +2 -0
  316. package/node_modules/typescript/lib/tsserverlibrary.js +1 -0
  317. package/node_modules/typescript/lib/typescript.d.ts +2 -0
  318. package/node_modules/typescript/lib/typescript.js +1 -0
  319. package/node_modules/typescript/package.json +39 -0
  320. package/node_modules/valibot/LICENSE.md +9 -0
  321. package/node_modules/valibot/README.md +94 -0
  322. package/node_modules/valibot/dist/index.cjs +7974 -0
  323. package/node_modules/valibot/dist/index.d.cts +16184 -0
  324. package/node_modules/valibot/dist/index.d.mts +16184 -0
  325. package/node_modules/valibot/dist/index.min.cjs +2 -0
  326. package/node_modules/valibot/dist/index.min.mjs +2 -0
  327. package/node_modules/valibot/dist/index.mjs +7663 -0
  328. package/node_modules/valibot/package.json +79 -0
  329. package/package.json +18 -12
  330. package/LICENSE +0 -21
  331. package/node_modules/@ykdz/template-builtin-source/dist/src/index.d.ts +0 -22
  332. package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +0 -103
  333. package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.d.ts +0 -7
  334. package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.js +0 -98
  335. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.d.ts +0 -2
  336. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +0 -15
  337. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.d.ts +0 -9
  338. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +0 -105
  339. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.d.ts +0 -6
  340. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +0 -197
  341. package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.d.ts +0 -5
  342. package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.js +0 -71
  343. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.d.ts +0 -6
  344. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +0 -281
  345. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.d.ts +0 -8
  346. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +0 -154
  347. package/node_modules/@ykdz/template-builtin-source/package.json +0 -93
  348. package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +0 -524
  349. package/node_modules/@ykdz/template-builtin-source/templates/shared/devcontainer/node-pnpm.Dockerfile +0 -6
  350. package/node_modules/@ykdz/template-builtin-source/templates/shared/editor-customization/capabilities.json +0 -56
  351. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/node/oxlint.config.ts +0 -34
  352. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/oxfmt.config.ts +0 -8
  353. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/vue/oxlint.config.ts +0 -36
  354. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.github/workflows/check.yml +0 -22
  355. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/db/drizzle.config.ts +0 -10
  356. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/container-entrypoint.sh +0 -52
  357. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/prepare-database.sh +0 -6
  358. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/api/src/index.ts +0 -3
  359. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/main.ts +0 -8
  360. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/stores/counter.ts +0 -12
  361. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/style.css +0 -1
  362. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/test/app.test.ts +0 -14
  363. package/node_modules/@ykdz/template-core/dist/declarations.d.ts +0 -2
  364. package/node_modules/@ykdz/template-core/dist/declarations.js +0 -1
  365. package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +0 -76
  366. package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +0 -658
  367. package/node_modules/@ykdz/template-core/dist/generation-context.d.ts +0 -23
  368. package/node_modules/@ykdz/template-core/dist/generation-context.js +0 -20
  369. package/node_modules/@ykdz/template-core/dist/next-step-instructions.d.ts +0 -30
  370. package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +0 -181
  371. package/node_modules/@ykdz/template-core/dist/package-addition-support.d.ts +0 -6
  372. package/node_modules/@ykdz/template-core/dist/package-addition-support.js +0 -2
  373. package/node_modules/@ykdz/template-core/dist/package-addition.d.ts +0 -12
  374. package/node_modules/@ykdz/template-core/dist/package-addition.js +0 -665
  375. package/node_modules/@ykdz/template-core/dist/package-linking.d.ts +0 -75
  376. package/node_modules/@ykdz/template-core/dist/package-linking.js +0 -157
  377. package/node_modules/@ykdz/template-core/dist/preset-projection.d.ts +0 -68
  378. package/node_modules/@ykdz/template-core/dist/preset-projection.js +0 -8
  379. package/node_modules/@ykdz/template-core/dist/preset-source.d.ts +0 -14
  380. package/node_modules/@ykdz/template-core/dist/preset-source.js +0 -294
  381. package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +0 -31
  382. package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +0 -2170
  383. package/node_modules/@ykdz/template-core/dist/runtime-paths.d.ts +0 -1
  384. package/node_modules/@ykdz/template-core/dist/runtime-paths.js +0 -13
  385. package/node_modules/@ykdz/template-shared/dist/index.d.ts +0 -645
  386. package/node_modules/@ykdz/template-shared/dist/index.js +0 -1408
  387. package/node_modules/@ykdz/template-shared/package.json +0 -37
  388. /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
  389. /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
  390. /package/node_modules/@ykdz/{template-builtin-source/templates/ts-lib → template-builtin-presets/templates/foundation}/.github/workflows/check.yml +0 -0
  391. /package/node_modules/@ykdz/{template-builtin-source/templates/shared → template-builtin-presets/templates/foundation/rust}/devcontainer/rust.Dockerfile +0 -0
  392. /package/node_modules/@ykdz/{template-builtin-source/templates/rust-bin → template-builtin-presets/templates/foundation/rust}/rust-toolchain.toml +0 -0
  393. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/rustfmt.toml +0 -0
  394. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/src/main.rs +0 -0
  395. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/turbo.json +0 -0
  396. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/shared/devcontainer/browser-test.Dockerfile +0 -0
  397. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/main.ts +0 -0
  398. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/stores/counter.ts +0 -0
  399. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/style.css +0 -0
  400. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/test/app.test.ts +0 -0
  401. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/src/name-schema.ts +0 -0
  402. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/turbo.json +0 -0
  403. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/scripts/seed-example.ts +0 -0
  404. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/db.ts +0 -0
  405. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/index.ts +0 -0
  406. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/queries/todos.ts +0 -0
  407. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/schema.ts +0 -0
  408. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/seed/example.ts +0 -0
  409. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/test/todos.test.ts +0 -0
  410. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/turbo.json +0 -0
  411. /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
  412. /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
  413. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/+server.ts +0 -0
  414. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/.env.example +0 -0
  415. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/Dockerfile.dockerignore +0 -0
  416. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/assets/logo.svg +0 -0
  417. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/components/CounterButton.vue +0 -0
  418. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/components/PageShell.vue +0 -0
  419. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+Head.vue +0 -0
  420. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+Layout.vue +0 -0
  421. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+config.ts +0 -0
  422. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/tailwind.css +0 -0
  423. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/scripts/run-playwright.ts +0 -0
  424. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/server/api.ts +0 -0
  425. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/server/app.ts +0 -0
  426. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/types/env.d.ts +0 -0
  427. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/types/global.d.ts +0 -0
  428. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/vite.config.ts +0 -0
  429. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/vitest.config.ts +0 -0
  430. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app → template-builtin-presets/templates/vue-app}/.github/workflows/check.yml +0 -0
  431. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/env.d.ts +0 -0
  432. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/index.html +0 -0
  433. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/playwright.config.ts +0 -0
  434. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/scripts/run-playwright.ts +0 -0
  435. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/src/App.vue +0 -0
  436. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/test/e2e/app.spec.ts +0 -0
  437. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/vite.config.ts +0 -0
  438. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/vitest.config.ts +0 -0
  439. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/src/runtime.ts +0 -0
  440. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/turbo.json +0 -0
  441. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/vitest.config.ts +0 -0
  442. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/env.d.ts +0 -0
  443. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/index.html +0 -0
  444. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/playwright.config.ts +0 -0
  445. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/scripts/run-playwright.ts +0 -0
  446. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/src/App.vue +0 -0
  447. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/src/api.ts +0 -0
  448. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/test/e2e/app.spec.ts +0 -0
  449. /package/node_modules/@ykdz/{template-builtin-source/templates/vike-app → template-builtin-presets/templates/vue-hono-app}/web/turbo.json +0 -0
  450. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/vite.config.ts +0 -0
  451. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/vitest.config.ts +0 -0
@@ -1,658 +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 { deploymentCheckEnvironmentNeeds, 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 = 2;
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
- function deploymentReplayFingerprint(fingerprint) {
239
- return createHash("sha256")
240
- .update(`${fingerprint}\0docker-engine-available`)
241
- .digest("hex");
242
- }
243
- export function packageLeafNameForAddedPreset(manifest, presetName) {
244
- const preset = manifest.presets.find((entry) => entry.name === presetName);
245
- if (!preset) {
246
- throw new Error(`Unknown fixture Package Addition preset: ${presetName}`);
247
- }
248
- if (preset.packageAdditionSupport !== PackageAdditionSupport.Supported) {
249
- throw new Error(`Preset ${presetName} cannot be used for fixture Package Addition`);
250
- }
251
- const packageLeafName = `fixture-${presetName}`;
252
- if (!/^[a-z0-9][a-z0-9-]*$/.test(packageLeafName)) {
253
- throw new Error(`Fixture Package Addition leaf name for preset ${presetName} must be a lowercase package leaf name using letters, numbers, and hyphens`);
254
- }
255
- return packageLeafName;
256
- }
257
- export async function defaultGeneratedScenarioCommandRunner(command, args, cwd, options = {}) {
258
- const prefix = options.logPrefix ? `[${options.logPrefix}] ` : "";
259
- console.log(`${prefix}$ ${[command, ...args].join(" ")}`);
260
- await execa(command, [...args], {
261
- cwd,
262
- env: generatedScenarioChildProcessEnv(options.env),
263
- extendEnv: false,
264
- stdio: "inherit",
265
- });
266
- }
267
- async function generateScenario(scenario, workspace, options) {
268
- const projectDir = path.join(workspace, `fixture-${scenario.id}`);
269
- await options.runCommand("pnpm", [
270
- "exec",
271
- "tsx",
272
- options.cliPath,
273
- "init",
274
- projectDir,
275
- "--preset",
276
- scenario.basePreset,
277
- "--yes",
278
- ], options.repoRoot, {
279
- env: cliSourceExecutionEnv(options, options.deterministicToolchainEnv),
280
- logPrefix: scenario.label,
281
- });
282
- return projectDir;
283
- }
284
- async function applyPackageAddition(manifest, scenario, projectDir, options) {
285
- if (!scenario.addedPreset) {
286
- return undefined;
287
- }
288
- const packageLeafName = packageLeafNameForAddedPreset(manifest, scenario.addedPreset);
289
- const beforeConsumerSources = await linkedConsumerSourceSnapshots(projectDir, scenario.linkFrom ?? []);
290
- await options.runCommand("pnpm", [
291
- "exec",
292
- "tsx",
293
- options.cliPath,
294
- "add",
295
- "package",
296
- "--preset",
297
- scenario.addedPreset,
298
- "--name",
299
- packageLeafName,
300
- ...linkFromArgs(scenario.linkFrom ?? []),
301
- ], projectDir, {
302
- env: cliSourceExecutionEnv(options),
303
- logPrefix: scenario.label,
304
- });
305
- await assertLinkedConsumerSourcesUnchanged(projectDir, beforeConsumerSources);
306
- return readAddedPackagePath(projectDir, packageLeafName);
307
- }
308
- function linkFromArgs(packagePaths) {
309
- return packagePaths.flatMap((packagePath) => ["--link-from", packagePath]);
310
- }
311
- async function linkedConsumerSourceSnapshots(projectDir, packagePaths) {
312
- const snapshots = new Map();
313
- for (const packagePath of packagePaths) {
314
- snapshots.set(packagePath, await sourceFileSnapshot(path.join(projectDir, packagePath, "src")));
315
- }
316
- return snapshots;
317
- }
318
- async function sourceFileSnapshot(sourceDir, currentDir = sourceDir) {
319
- const snapshot = {};
320
- const entries = await readdir(currentDir, { withFileTypes: true });
321
- for (const entry of entries.toSorted((left, right) => left.name.localeCompare(right.name))) {
322
- const entryPath = path.join(currentDir, entry.name);
323
- if (entry.isDirectory()) {
324
- Object.assign(snapshot, await sourceFileSnapshot(sourceDir, entryPath));
325
- continue;
326
- }
327
- if (entry.isFile()) {
328
- snapshot[path.relative(sourceDir, entryPath)] = await readFile(entryPath, "utf8");
329
- }
330
- }
331
- return snapshot;
332
- }
333
- async function assertLinkedConsumerSourcesUnchanged(projectDir, beforeSnapshots) {
334
- for (const [packagePath, beforeSnapshot] of beforeSnapshots) {
335
- const afterSnapshot = await sourceFileSnapshot(path.join(projectDir, packagePath, "src"));
336
- if (JSON.stringify(afterSnapshot) !== JSON.stringify(beforeSnapshot)) {
337
- throw new Error(`Package Link Intent fixture modified consumer source files for ${packagePath}`);
338
- }
339
- }
340
- }
341
- async function readAddedPackagePath(projectDir, packageLeafName) {
342
- const input = JSON.parse(await readFile(path.join(projectDir, ".template", "blueprint.json"), "utf8"));
343
- const result = v.safeParse(storedBlueprintSchema, input);
344
- if (!result.success) {
345
- throw new Error(`Generated Repository blueprint is invalid: ${result.issues
346
- .map((issue) => issue.message)
347
- .join("; ")}`);
348
- }
349
- const packageDefinition = result.output.packages?.find((pkg) => path.basename(pkg.path) === packageLeafName);
350
- if (!packageDefinition) {
351
- throw new Error(`Package Addition fixture did not record package leaf ${packageLeafName}`);
352
- }
353
- return packageDefinition.path;
354
- }
355
- function projectionPlanForPreset(presetName, projectDir, manifest, options, packageScope) {
356
- const preset = findPresetSourceManifestPreset(manifest, presetName);
357
- if (!preset?.projection) {
358
- throw new Error(`Missing Preset Projection for fixture preset ${presetName}`);
359
- }
360
- const blueprint = blueprintForPresetSourcePreset(preset, {
361
- targetDir: projectDir,
362
- ...(packageScope === undefined ? {} : { scope: packageScope }),
363
- });
364
- return projectPresetSourcePreset({
365
- preset,
366
- sourceRoots: options.projectionSourceRoots,
367
- context: assembleGenerationContext({
368
- targetDir: projectDir,
369
- blueprint,
370
- toolchain: {
371
- nodeLtsMajor: { kind: "NodeLtsMajor", value: "24" },
372
- packageManagerPin: { kind: "PackageManagerPin", value: "pnpm@10.34.4" },
373
- source: "bundled-fallback",
374
- diagnostics: [],
375
- },
376
- }),
377
- });
378
- }
379
- function machineVerifiableNextStepsForPreset(presetName, projectDir, manifest, options) {
380
- const projectionPlan = projectionPlanForPreset(presetName, projectDir, manifest, options);
381
- const plan = planNextStepInstructions({
382
- targetDir: projectDir,
383
- projectionPlan,
384
- });
385
- return plan.steps
386
- .filter((step) => step.machineVerifiable && step.kind === "command")
387
- .map((step) => {
388
- return {
389
- id: step.id,
390
- command: step.command,
391
- args: step.args,
392
- cwd: step.cwd,
393
- display: step.display,
394
- ...(step.environmentNeedKind === undefined
395
- ? {}
396
- : { environmentNeedKind: step.environmentNeedKind }),
397
- };
398
- });
399
- }
400
- function deploymentStepsForPreset(presetName, scenario, projectDir, manifest, options) {
401
- if (scenario.set === "init") {
402
- return [];
403
- }
404
- const deploymentChecks = projectionPlanForPreset(presetName, projectDir, manifest, options).checkPlan
405
- .deploymentChecks ?? [];
406
- const needsDocker = deploymentChecks.some((check) => deploymentCheckEnvironmentNeeds(check).some((need) => need.kind === "docker-engine"));
407
- if (!needsDocker) {
408
- return [];
409
- }
410
- return [
411
- {
412
- id: "check-docker-engine",
413
- command: "docker",
414
- args: ["info", "--format", "{{.ServerVersion}}"],
415
- cwd: projectDir,
416
- display: "docker info --format {{.ServerVersion}}",
417
- environmentNeedKind: "docker-engine",
418
- phase: "deployment-preparation",
419
- },
420
- {
421
- id: "run-deployment-check",
422
- command: "pnpm",
423
- args: ["run", "check:deployment"],
424
- cwd: projectDir,
425
- display: "pnpm run check:deployment",
426
- phase: "deployment",
427
- },
428
- ];
429
- }
430
- function addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackagePath, options) {
431
- if (!scenario.addedPreset || !addedPackagePath) {
432
- return [];
433
- }
434
- return projectionPlanForPreset(scenario.addedPreset, projectDir, manifest, options, path.basename(projectDir)).checkPlan.environmentNeeds.map((need) => {
435
- if (need.owner.kind !== "package-boundary") {
436
- return need;
437
- }
438
- return playwrightBrowserAssetsEnvironmentNeed({
439
- browser: need.browser,
440
- owner: { kind: "package-boundary", path: addedPackagePath },
441
- machineVerifiable: need.nextStep.machineVerifiable,
442
- });
443
- });
444
- }
445
- function environmentNeedStep(need, projectDir) {
446
- return {
447
- id: need.nextStep.id,
448
- command: need.nextStep.command,
449
- args: [...need.nextStep.args],
450
- cwd: projectDir,
451
- display: need.nextStep.display,
452
- environmentNeedKind: need.kind,
453
- };
454
- }
455
- export function generatedScenarioEnvironmentNeedSteps(needs, projectDir) {
456
- return needs
457
- .filter((need) => need.nextStep.machineVerifiable)
458
- .map((need) => environmentNeedStep(need, projectDir));
459
- }
460
- export function generatedScenarioRequiresSerializedRootCheck(steps) {
461
- return steps.some((step) => step.environmentNeedKind === "playwright-browser-assets");
462
- }
463
- export function generatedScenarioQualityGateSteps(manifest, scenario, projectDir, addedPackagePath, options) {
464
- const normalizedOptions = normalizeRunnerOptions(options);
465
- const steps = machineVerifiableNextStepsForPreset(scenario.basePreset, projectDir, manifest, normalizedOptions);
466
- const addedEnvironmentSteps = generatedScenarioEnvironmentNeedSteps(addedPresetEnvironmentNeeds(manifest, scenario, projectDir, addedPackagePath, normalizedOptions), projectDir);
467
- const existingDisplays = new Set(steps.map((step) => step.display));
468
- const extraEnvironmentSteps = addedEnvironmentSteps.filter((step) => !existingDisplays.has(step.display));
469
- const deploymentSteps = deploymentStepsForPreset(scenario.basePreset, scenario, projectDir, manifest, normalizedOptions);
470
- if (extraEnvironmentSteps.length === 0) {
471
- return [...steps, ...deploymentSteps];
472
- }
473
- const rootCheckIndex = steps.findIndex((step) => step.id === "run-root-check");
474
- if (rootCheckIndex === -1) {
475
- return [...steps, ...extraEnvironmentSteps, ...deploymentSteps];
476
- }
477
- return [
478
- ...steps.slice(0, rootCheckIndex),
479
- ...extraEnvironmentSteps,
480
- ...steps.slice(rootCheckIndex),
481
- ...deploymentSteps,
482
- ];
483
- }
484
- async function runGeneratedScenarioQualityGate(manifest, scenario, projectDir, addedPackagePath, options) {
485
- const steps = generatedScenarioQualityGateSteps(manifest, scenario, projectDir, addedPackagePath, options);
486
- const requiresSerializedPlaywrightRootCheck = generatedScenarioRequiresSerializedRootCheck(steps);
487
- let replayFingerprint;
488
- let baseQualityGateReplayed = false;
489
- let baseQualityGateMarkerWritten = false;
490
- for (const step of steps) {
491
- if (step.id === "install-dependencies") {
492
- const installResult = await runGeneratedScenarioInstallStep(step, scenario, options);
493
- replayFingerprint = installResult.fingerprint;
494
- baseQualityGateReplayed = installResult.baseQualityGateReplayed;
495
- continue;
496
- }
497
- if (baseQualityGateReplayed &&
498
- step.phase !== "deployment-preparation" &&
499
- step.phase !== "deployment") {
500
- continue;
501
- }
502
- const env = step.id === "run-root-check" ? { CI: "1" } : undefined;
503
- const runStep = async () => {
504
- await options.runCommand(step.command, [...step.args], step.cwd, {
505
- ...(env === undefined ? {} : { env }),
506
- logPrefix: scenario.label,
507
- });
508
- };
509
- if (step.environmentNeedKind === "docker-engine") {
510
- try {
511
- await runStep();
512
- }
513
- catch (error) {
514
- const reason = error instanceof Error ? error.message : String(error);
515
- options.reporter.info?.(`-- Skipping deployment check for ${scenario.label}: Docker engine is unavailable (${reason})`);
516
- break;
517
- }
518
- continue;
519
- }
520
- if (step.phase === "deployment") {
521
- const deploymentFingerprint = replayFingerprint === undefined
522
- ? undefined
523
- : deploymentReplayFingerprint(replayFingerprint);
524
- if (deploymentFingerprint !== undefined &&
525
- options.replayCache?.read &&
526
- (await scenarioReplayMarkerExists(options.replayCache, deploymentFingerprint))) {
527
- options.reporter.info?.(`-- Replayed passed deployment fixture ${scenario.label}: ${deploymentFingerprint}`);
528
- continue;
529
- }
530
- try {
531
- await runStep();
532
- }
533
- catch (error) {
534
- throw new Error(`Generated deployment command failed for ${scenario.label}; command: ${step.display}. See the cause for the deployment mode, phase, command output, and retained container logs.`, { cause: error });
535
- }
536
- if (deploymentFingerprint !== undefined && options.replayCache?.write) {
537
- await writeScenarioReplayMarker(options.replayCache, deploymentFingerprint, scenario);
538
- options.reporter.info?.(`-- Stored passed deployment fixture replay marker for ${scenario.label}: ${deploymentFingerprint}`);
539
- }
540
- continue;
541
- }
542
- if (step.id === "run-root-check" && requiresSerializedPlaywrightRootCheck) {
543
- await options.rootCheckLock.run(runStep);
544
- }
545
- else {
546
- await runStep();
547
- }
548
- if (step.id === "run-root-check" &&
549
- options.replayCache?.write &&
550
- replayFingerprint !== undefined) {
551
- await writeScenarioReplayMarker(options.replayCache, replayFingerprint, scenario);
552
- baseQualityGateMarkerWritten = true;
553
- options.reporter.info?.(`-- Stored passed fixture replay marker for ${scenario.label}: ${replayFingerprint}`);
554
- }
555
- }
556
- if (options.replayCache?.write &&
557
- replayFingerprint !== undefined &&
558
- !baseQualityGateMarkerWritten &&
559
- !baseQualityGateReplayed) {
560
- await writeScenarioReplayMarker(options.replayCache, replayFingerprint, scenario);
561
- options.reporter.info?.(`-- Stored passed fixture replay marker for ${scenario.label}: ${replayFingerprint}`);
562
- }
563
- }
564
- async function runGeneratedScenarioInstallStep(step, scenario, options) {
565
- await options.runCommand(step.command, ["install", "--lockfile-only", "--prefer-offline", "--no-frozen-lockfile"], step.cwd, { logPrefix: scenario.label });
566
- let replayFingerprint;
567
- if (options.replayCache) {
568
- replayFingerprint = await hashGeneratedScenarioDirectory(scenario, step.cwd);
569
- if (options.replayCache.read &&
570
- (await scenarioReplayMarkerExists(options.replayCache, replayFingerprint))) {
571
- options.reporter.info?.(`-- Replayed passed base quality gate for ${scenario.label}: ${replayFingerprint}`);
572
- return { fingerprint: replayFingerprint, baseQualityGateReplayed: true };
573
- }
574
- }
575
- await options.runCommand(step.command, ["fetch"], step.cwd, {
576
- logPrefix: scenario.label,
577
- });
578
- await options.runCommand(step.command, ["install", "--offline", "--frozen-lockfile"], step.cwd, { logPrefix: scenario.label });
579
- return { fingerprint: replayFingerprint, baseQualityGateReplayed: false };
580
- }
581
- async function checkGeneratedScenario(manifest, scenario, workspace, options) {
582
- options.reporter.info?.(`\n== ${scenario.label} ==`);
583
- const projectDir = await generateScenario(scenario, workspace, options);
584
- const addedPackagePath = await applyPackageAddition(manifest, scenario, projectDir, options);
585
- await runGeneratedScenarioQualityGate(manifest, scenario, projectDir, addedPackagePath, options);
586
- }
587
- export function fixtureConcurrency(scenarioCount) {
588
- const rawValue = process.env.TEMPLATE_FIXTURE_CONCURRENCY;
589
- if (rawValue === undefined || rawValue === "") {
590
- return Math.min(defaultFixtureConcurrency, scenarioCount);
591
- }
592
- const value = Number(rawValue);
593
- if (!Number.isInteger(value) || value < 1) {
594
- throw new Error("TEMPLATE_FIXTURE_CONCURRENCY must be a positive integer");
595
- }
596
- return Math.min(value, scenarioCount);
597
- }
598
- export function errorForFailedGeneratedScenario(scenario, error) {
599
- if (error instanceof Error) {
600
- return new Error(`Fixture scenario failed: ${scenario.label}`, {
601
- cause: error,
602
- });
603
- }
604
- return new Error(`Fixture scenario failed: ${scenario.label}: ${String(error)}`);
605
- }
606
- function normalizeRunnerOptions(options) {
607
- return {
608
- repoRoot: options.repoRoot,
609
- cliPath: options.cliPath,
610
- projectionSourceRoots: options.projectionSourceRoots,
611
- runCommand: options.runCommand ?? defaultGeneratedScenarioCommandRunner,
612
- reporter: options.reporter ?? {
613
- info: console.log,
614
- error: console.error,
615
- },
616
- deterministicToolchainEnv: options.deterministicToolchainEnv ?? defaultDeterministicToolchainEnv,
617
- rootCheckLock: options.rootCheckLock ?? createExclusiveLock(),
618
- replayCache: options.replayCache,
619
- };
620
- }
621
- export async function runGeneratedScenariosConcurrently(manifest, scenarios, workspace, concurrency, options) {
622
- const normalizedOptions = normalizeRunnerOptions(options);
623
- let nextScenarioIndex = 0;
624
- let firstFailure;
625
- async function worker() {
626
- while (firstFailure === undefined) {
627
- const scenario = scenarios[nextScenarioIndex];
628
- nextScenarioIndex += 1;
629
- if (!scenario) {
630
- return;
631
- }
632
- try {
633
- await checkGeneratedScenario(manifest, scenario, workspace, normalizedOptions);
634
- }
635
- catch (error) {
636
- firstFailure ??= errorForFailedGeneratedScenario(scenario, error);
637
- return;
638
- }
639
- }
640
- }
641
- await Promise.all(Array.from({ length: concurrency }, async () => {
642
- await worker();
643
- }));
644
- if (firstFailure) {
645
- throw firstFailure;
646
- }
647
- }
648
- export async function runGeneratedScenarioSet(manifest, set, workspace, options) {
649
- const normalizedOptions = normalizeRunnerOptions(options);
650
- const selection = selectGeneratedScenarios(manifest, set);
651
- const concurrency = fixtureConcurrency(selection.runnable.length);
652
- for (const skippedScenario of selection.skipped) {
653
- normalizedOptions.reporter.info?.(`-- Skipping ${skippedScenario.label}: ${skippedScenario.reason}`);
654
- }
655
- normalizedOptions.reporter.info?.(`Checking ${selection.runnable.length} fixture scenarios with concurrency ${concurrency}.`);
656
- await runGeneratedScenariosConcurrently(manifest, selection.runnable, workspace, concurrency, normalizedOptions);
657
- return selection;
658
- }
@@ -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;