@ykdz/template 0.0.23 → 0.0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (452) 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 +83 -0
  145. package/node_modules/@ykdz/template-builtin-presets/dist/src/foundation.js +804 -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 +114 -0
  150. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.d.ts +33 -0
  151. package/node_modules/@ykdz/template-builtin-presets/dist/src/shared/vue.js +88 -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 +114 -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 +382 -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 +92 -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 +162 -0
  162. package/node_modules/@ykdz/template-builtin-presets/package.json +68 -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/TODO.md.template +5 -0
  168. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/devcontainer.json +16 -0
  169. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/gitignore +8 -0
  170. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +19 -0
  171. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +28 -0
  172. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/extensions.json +3 -0
  173. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/.vscode/settings.json +5 -0
  174. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/rust/devcontainer/devcontainer.json +21 -0
  175. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/check-boundaries.ts +12 -0
  176. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/scripts/run-root-owned-task.ts +69 -0
  177. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/tsconfig.json +9 -0
  178. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/turbo.json +25 -0
  179. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/.github/dependabot.yml +5 -0
  180. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/workflows/check.yml +23 -0
  181. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/extensions.json +3 -0
  182. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.vscode/settings.json +5 -0
  183. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.lock +16 -0
  184. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.toml +27 -0
  185. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/devcontainer.json +21 -0
  186. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/devcontainer/rust.Dockerfile +16 -0
  187. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/rust-toolchain.toml +3 -0
  188. package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/node-pnpm.Dockerfile +12 -0
  189. package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/shellcheck.Dockerfile +3 -0
  190. package/node_modules/@ykdz/template-builtin-presets/templates/shared/editor-customization/capabilities.json +38 -0
  191. package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/node/oxlint.config.ts +6 -0
  192. package/node_modules/@ykdz/template-builtin-presets/templates/shared/oxc/oxfmt.config.ts +3 -0
  193. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/shared/oxc/tsconfig.config.json +2 -2
  194. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.app.json +25 -0
  195. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.json +8 -0
  196. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.node.json +30 -0
  197. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/tsconfig.test.json +9 -0
  198. package/node_modules/@ykdz/template-builtin-presets/templates/shared/vue/typescript/run-vue-tsc.ts +12 -0
  199. package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app → template-builtin-presets/templates/ts-lib}/.github/dependabot.yml +5 -0
  200. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/workflows/check.yml +19 -0
  201. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/src/index.ts +1 -3
  202. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/tsconfig.json +13 -0
  203. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/readiness.ts +2 -2
  204. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/src/types.d.ts +1 -0
  205. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db/tsconfig.json +26 -0
  206. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/turbo.json +1 -1
  207. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/drizzle.config.ts +17 -0
  208. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/scripts/prepare-database.ts +45 -0
  209. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/tsconfig.json +22 -0
  210. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/db-migrations/turbo.json +10 -0
  211. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/Dockerfile +20 -30
  212. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/index/+Page.telefunc.ts +0 -2
  213. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/index/+Page.vue +2 -1
  214. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/playwright.config.ts +1 -1
  215. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/scripts/check-standalone-deployment.ts +84 -22
  216. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/scripts/container-entrypoint.sh +33 -0
  217. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/test/e2e/app.spec.ts +3 -1
  218. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.app.json +34 -0
  219. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.json +9 -0
  220. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.node.json +31 -0
  221. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.test.json +11 -0
  222. package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/vike-app/web}/turbo.json +3 -2
  223. package/node_modules/@ykdz/{template-builtin-source/templates/vike-app → template-builtin-presets/templates/vue-app}/.github/dependabot.yml +5 -4
  224. package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app/web → template-builtin-presets/templates/vue-app}/turbo.json +4 -3
  225. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/typescript/tsconfig.json +8 -0
  226. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/src/index.ts +3 -0
  227. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/src/server.ts +1 -1
  228. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/test/app.test.ts +1 -1
  229. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.build.json +9 -0
  230. package/node_modules/@ykdz/template-builtin-presets/templates/vue-hono-app/api/tsconfig.json +25 -0
  231. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/turbo.json +1 -1
  232. package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/playwright.config.ts +1 -1
  233. package/node_modules/@ykdz/{template-builtin-source/templates/vike-app → template-builtin-presets/templates/vue-hono-app}/web/turbo.json +2 -2
  234. package/node_modules/@ykdz/template-core/dist/Cargo.toml +1 -1
  235. package/node_modules/@ykdz/template-core/dist/dependency-catalog.d.ts +8 -0
  236. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +48 -12
  237. package/node_modules/@ykdz/template-core/dist/devcontainer.d.ts +11 -3
  238. package/node_modules/@ykdz/template-core/dist/devcontainer.js +17 -3
  239. package/node_modules/@ykdz/template-core/dist/editor-customization.d.ts +5 -9
  240. package/node_modules/@ykdz/template-core/dist/editor-customization.js +8 -46
  241. package/node_modules/@ykdz/template-core/dist/module-graph.d.ts +64 -33
  242. package/node_modules/@ykdz/template-core/dist/module-graph.js +117 -135
  243. package/node_modules/@ykdz/template-core/dist/package-contribution.d.ts +41 -0
  244. package/node_modules/@ykdz/template-core/dist/package-contribution.js +24 -0
  245. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +22 -8
  246. package/node_modules/@ykdz/template-core/dist/preset-definition.d.ts +42 -0
  247. package/node_modules/@ykdz/template-core/dist/preset-definition.js +1 -0
  248. package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.d.ts +33 -0
  249. package/node_modules/@ykdz/template-core/dist/project-blueprint-v2.js +161 -0
  250. package/node_modules/@ykdz/template-core/dist/project-github.d.ts +17 -2
  251. package/node_modules/@ykdz/template-core/dist/project-github.js +87 -14
  252. package/node_modules/@ykdz/template-core/dist/project-linking-v2.d.ts +20 -0
  253. package/node_modules/@ykdz/template-core/dist/project-linking-v2.js +37 -0
  254. package/node_modules/@ykdz/template-core/dist/renderer.d.ts +40 -5
  255. package/node_modules/@ykdz/template-core/dist/renderer.js +115 -30
  256. package/node_modules/@ykdz/template-core/dist/template-boundary-check.d.ts +21 -15
  257. package/node_modules/@ykdz/template-core/dist/template-boundary-check.js +100 -50
  258. package/node_modules/@ykdz/template-core/dist/toolchain-baseline-update.d.ts +45 -0
  259. package/node_modules/@ykdz/template-core/dist/toolchain-baseline-update.js +27 -0
  260. package/node_modules/@ykdz/template-core/dist/toolchain-resolution.d.ts +1 -0
  261. package/node_modules/@ykdz/template-core/dist/toolchain-resolution.js +50 -52
  262. package/node_modules/@ykdz/template-core/package.json +10 -8
  263. package/node_modules/semver/LICENSE +15 -0
  264. package/node_modules/semver/README.md +680 -0
  265. package/node_modules/semver/bin/semver.js +195 -0
  266. package/node_modules/semver/classes/comparator.js +143 -0
  267. package/node_modules/semver/classes/index.js +7 -0
  268. package/node_modules/semver/classes/range.js +577 -0
  269. package/node_modules/semver/classes/semver.js +350 -0
  270. package/node_modules/semver/functions/clean.js +8 -0
  271. package/node_modules/semver/functions/cmp.js +54 -0
  272. package/node_modules/semver/functions/coerce.js +62 -0
  273. package/node_modules/semver/functions/compare-build.js +9 -0
  274. package/node_modules/semver/functions/compare-loose.js +5 -0
  275. package/node_modules/semver/functions/compare.js +7 -0
  276. package/node_modules/semver/functions/diff.js +60 -0
  277. package/node_modules/semver/functions/eq.js +5 -0
  278. package/node_modules/semver/functions/gt.js +5 -0
  279. package/node_modules/semver/functions/gte.js +5 -0
  280. package/node_modules/semver/functions/inc.js +21 -0
  281. package/node_modules/semver/functions/lt.js +5 -0
  282. package/node_modules/semver/functions/lte.js +5 -0
  283. package/node_modules/semver/functions/major.js +5 -0
  284. package/node_modules/semver/functions/minor.js +5 -0
  285. package/node_modules/semver/functions/neq.js +5 -0
  286. package/node_modules/semver/functions/parse.js +18 -0
  287. package/node_modules/semver/functions/patch.js +5 -0
  288. package/node_modules/semver/functions/prerelease.js +8 -0
  289. package/node_modules/semver/functions/rcompare.js +5 -0
  290. package/node_modules/semver/functions/rsort.js +5 -0
  291. package/node_modules/semver/functions/satisfies.js +12 -0
  292. package/node_modules/semver/functions/sort.js +5 -0
  293. package/node_modules/semver/functions/truncate.js +48 -0
  294. package/node_modules/semver/functions/valid.js +8 -0
  295. package/node_modules/semver/index.js +93 -0
  296. package/node_modules/semver/internal/constants.js +37 -0
  297. package/node_modules/semver/internal/debug.js +11 -0
  298. package/node_modules/semver/internal/identifiers.js +29 -0
  299. package/node_modules/semver/internal/lrucache.js +42 -0
  300. package/node_modules/semver/internal/parse-options.js +17 -0
  301. package/node_modules/semver/internal/re.js +223 -0
  302. package/node_modules/semver/package.json +78 -0
  303. package/node_modules/semver/preload.js +4 -0
  304. package/node_modules/semver/range.bnf +17 -0
  305. package/node_modules/semver/ranges/gtr.js +6 -0
  306. package/node_modules/semver/ranges/intersects.js +9 -0
  307. package/node_modules/semver/ranges/ltr.js +6 -0
  308. package/node_modules/semver/ranges/max-satisfying.js +27 -0
  309. package/node_modules/semver/ranges/min-satisfying.js +26 -0
  310. package/node_modules/semver/ranges/min-version.js +63 -0
  311. package/node_modules/semver/ranges/outside.js +82 -0
  312. package/node_modules/semver/ranges/simplify.js +49 -0
  313. package/node_modules/semver/ranges/subset.js +249 -0
  314. package/node_modules/semver/ranges/to-comparators.js +10 -0
  315. package/node_modules/semver/ranges/valid.js +13 -0
  316. package/node_modules/typescript/LICENSE.txt +55 -0
  317. package/node_modules/typescript/README.md +9 -0
  318. package/node_modules/typescript/bin/tsc6 +2 -0
  319. package/node_modules/typescript/lib/tsc.js +1 -0
  320. package/node_modules/typescript/lib/tsserverlibrary.d.ts +2 -0
  321. package/node_modules/typescript/lib/tsserverlibrary.js +1 -0
  322. package/node_modules/typescript/lib/typescript.d.ts +2 -0
  323. package/node_modules/typescript/lib/typescript.js +1 -0
  324. package/node_modules/typescript/package.json +39 -0
  325. package/node_modules/valibot/LICENSE.md +9 -0
  326. package/node_modules/valibot/README.md +94 -0
  327. package/node_modules/valibot/dist/index.cjs +7974 -0
  328. package/node_modules/valibot/dist/index.d.cts +16184 -0
  329. package/node_modules/valibot/dist/index.d.mts +16184 -0
  330. package/node_modules/valibot/dist/index.min.cjs +2 -0
  331. package/node_modules/valibot/dist/index.min.mjs +2 -0
  332. package/node_modules/valibot/dist/index.mjs +7663 -0
  333. package/node_modules/valibot/package.json +79 -0
  334. package/package.json +18 -12
  335. package/LICENSE +0 -21
  336. package/node_modules/@ykdz/template-builtin-source/dist/src/index.d.ts +0 -22
  337. package/node_modules/@ykdz/template-builtin-source/dist/src/index.js +0 -103
  338. package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.d.ts +0 -7
  339. package/node_modules/@ykdz/template-builtin-source/dist/templates/projection-plans.js +0 -98
  340. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.d.ts +0 -2
  341. package/node_modules/@ykdz/template-builtin-source/dist/templates/registry.js +0 -15
  342. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.d.ts +0 -9
  343. package/node_modules/@ykdz/template-builtin-source/dist/templates/rust-bin/projection.js +0 -105
  344. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.d.ts +0 -6
  345. package/node_modules/@ykdz/template-builtin-source/dist/templates/ts-lib/projection.js +0 -197
  346. package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.d.ts +0 -5
  347. package/node_modules/@ykdz/template-builtin-source/dist/templates/vike-app/projection.js +0 -71
  348. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.d.ts +0 -6
  349. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-app/projection.js +0 -281
  350. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.d.ts +0 -8
  351. package/node_modules/@ykdz/template-builtin-source/dist/templates/vue-hono-app/projection.js +0 -154
  352. package/node_modules/@ykdz/template-builtin-source/package.json +0 -93
  353. package/node_modules/@ykdz/template-builtin-source/templates/preset-source.json +0 -524
  354. package/node_modules/@ykdz/template-builtin-source/templates/shared/devcontainer/node-pnpm.Dockerfile +0 -6
  355. package/node_modules/@ykdz/template-builtin-source/templates/shared/editor-customization/capabilities.json +0 -56
  356. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/node/oxlint.config.ts +0 -34
  357. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/oxfmt.config.ts +0 -8
  358. package/node_modules/@ykdz/template-builtin-source/templates/shared/oxc/vue/oxlint.config.ts +0 -36
  359. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/.github/workflows/check.yml +0 -22
  360. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/db/drizzle.config.ts +0 -10
  361. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/container-entrypoint.sh +0 -52
  362. package/node_modules/@ykdz/template-builtin-source/templates/vike-app/web/scripts/prepare-database.sh +0 -6
  363. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/api/src/index.ts +0 -3
  364. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/main.ts +0 -8
  365. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/stores/counter.ts +0 -12
  366. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/src/style.css +0 -1
  367. package/node_modules/@ykdz/template-builtin-source/templates/vue-hono-app/web/test/app.test.ts +0 -14
  368. package/node_modules/@ykdz/template-core/dist/declarations.d.ts +0 -2
  369. package/node_modules/@ykdz/template-core/dist/declarations.js +0 -1
  370. package/node_modules/@ykdz/template-core/dist/generated-scenarios.d.ts +0 -76
  371. package/node_modules/@ykdz/template-core/dist/generated-scenarios.js +0 -658
  372. package/node_modules/@ykdz/template-core/dist/generation-context.d.ts +0 -23
  373. package/node_modules/@ykdz/template-core/dist/generation-context.js +0 -20
  374. package/node_modules/@ykdz/template-core/dist/next-step-instructions.d.ts +0 -30
  375. package/node_modules/@ykdz/template-core/dist/next-step-instructions.js +0 -181
  376. package/node_modules/@ykdz/template-core/dist/package-addition-support.d.ts +0 -6
  377. package/node_modules/@ykdz/template-core/dist/package-addition-support.js +0 -2
  378. package/node_modules/@ykdz/template-core/dist/package-addition.d.ts +0 -12
  379. package/node_modules/@ykdz/template-core/dist/package-addition.js +0 -665
  380. package/node_modules/@ykdz/template-core/dist/package-linking.d.ts +0 -75
  381. package/node_modules/@ykdz/template-core/dist/package-linking.js +0 -157
  382. package/node_modules/@ykdz/template-core/dist/preset-projection.d.ts +0 -68
  383. package/node_modules/@ykdz/template-core/dist/preset-projection.js +0 -8
  384. package/node_modules/@ykdz/template-core/dist/preset-source.d.ts +0 -14
  385. package/node_modules/@ykdz/template-core/dist/preset-source.js +0 -294
  386. package/node_modules/@ykdz/template-core/dist/projection-capabilities.d.ts +0 -31
  387. package/node_modules/@ykdz/template-core/dist/projection-capabilities.js +0 -2170
  388. package/node_modules/@ykdz/template-core/dist/runtime-paths.d.ts +0 -1
  389. package/node_modules/@ykdz/template-core/dist/runtime-paths.js +0 -13
  390. package/node_modules/@ykdz/template-shared/dist/index.d.ts +0 -645
  391. package/node_modules/@ykdz/template-shared/dist/index.js +0 -1408
  392. package/node_modules/@ykdz/template-shared/package.json +0 -37
  393. /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
  394. /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
  395. /package/node_modules/@ykdz/{template-builtin-source/templates/ts-lib → template-builtin-presets/templates/foundation}/.github/workflows/check.yml +0 -0
  396. /package/node_modules/@ykdz/{template-builtin-source/templates/shared → template-builtin-presets/templates/foundation/rust}/devcontainer/rust.Dockerfile +0 -0
  397. /package/node_modules/@ykdz/{template-builtin-source/templates/rust-bin → template-builtin-presets/templates/foundation/rust}/rust-toolchain.toml +0 -0
  398. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/rustfmt.toml +0 -0
  399. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/src/main.rs +0 -0
  400. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/rust-bin/turbo.json +0 -0
  401. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/shared/devcontainer/browser-test.Dockerfile +0 -0
  402. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/main.ts +0 -0
  403. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/stores/counter.ts +0 -0
  404. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/src/style.css +0 -0
  405. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-app → template-builtin-presets/templates/shared/vue}/test/app.test.ts +0 -0
  406. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/src/name-schema.ts +0 -0
  407. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/ts-lib/turbo.json +0 -0
  408. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/scripts/seed-example.ts +0 -0
  409. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/db.ts +0 -0
  410. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/index.ts +0 -0
  411. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/queries/todos.ts +0 -0
  412. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/schema.ts +0 -0
  413. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/src/seed/example.ts +0 -0
  414. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/db/test/todos.test.ts +0 -0
  415. /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
  416. /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
  417. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/+server.ts +0 -0
  418. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/.env.example +0 -0
  419. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/Dockerfile.dockerignore +0 -0
  420. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/assets/logo.svg +0 -0
  421. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/components/CounterButton.vue +0 -0
  422. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/components/PageShell.vue +0 -0
  423. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+Head.vue +0 -0
  424. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+Layout.vue +0 -0
  425. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/+config.ts +0 -0
  426. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/pages/tailwind.css +0 -0
  427. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/scripts/run-playwright.ts +0 -0
  428. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/server/api.ts +0 -0
  429. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/server/app.ts +0 -0
  430. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/types/env.d.ts +0 -0
  431. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/types/global.d.ts +0 -0
  432. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/vite.config.ts +0 -0
  433. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vike-app/web/vitest.config.ts +0 -0
  434. /package/node_modules/@ykdz/{template-builtin-source/templates/vue-hono-app → template-builtin-presets/templates/vue-app}/.github/workflows/check.yml +0 -0
  435. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/env.d.ts +0 -0
  436. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/index.html +0 -0
  437. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/playwright.config.ts +0 -0
  438. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/scripts/run-playwright.ts +0 -0
  439. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/src/App.vue +0 -0
  440. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/test/e2e/app.spec.ts +0 -0
  441. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/vite.config.ts +0 -0
  442. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-app/vitest.config.ts +0 -0
  443. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/src/runtime.ts +0 -0
  444. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/api/vitest.config.ts +0 -0
  445. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/env.d.ts +0 -0
  446. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/index.html +0 -0
  447. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/scripts/run-playwright.ts +0 -0
  448. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/src/App.vue +0 -0
  449. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/src/api.ts +0 -0
  450. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/test/e2e/app.spec.ts +0 -0
  451. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/vite.config.ts +0 -0
  452. /package/node_modules/@ykdz/{template-builtin-source → template-builtin-presets}/templates/vue-hono-app/web/vitest.config.ts +0 -0
@@ -0,0 +1,804 @@
1
+ import { existsSync, readFileSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { fileURLToPath } from "node:url";
4
+ import { collectGeneratedManifestCatalogReferences, selectTemplateDependencyCatalogEntries, } from "@ykdz/template-core/dependency-catalog";
5
+ import { browserTestToolLayer } from "@ykdz/template-core/devcontainer";
6
+ import { editorCustomizationForCapabilities, loadEditorCustomizationDeclarations, } from "@ykdz/template-core/editor-customization";
7
+ import { checkEnvironmentNeedFact, checkEnvironmentNeedFromFact, deploymentEnvironmentNeedFact, deploymentEnvironmentNeedFromFact, renderDeploymentCheckCommand, renderFixCommand, renderRootCheckCommand, } from "@ykdz/template-core/module-graph";
8
+ import { assertPackageContribution, } from "@ykdz/template-core/package-contribution";
9
+ import { assertProjectBlueprintV2, validateProjectBlueprintV2 as validateCoreProjectBlueprintV2, } from "@ykdz/template-core/project-blueprint-v2";
10
+ import { projectCheckWorkflowTemplateReplacements, projectDependabotTemplateReplacements, } from "@ykdz/template-core/project-github";
11
+ import { planExplicitProjectLinks } from "@ykdz/template-core/project-linking-v2";
12
+ import { resolveTemplateSource, } from "@ykdz/template-core/renderer";
13
+ import { rustBinDefinition } from "./rust-bin/definition.js";
14
+ import { vuePnpmDependencyOverrides } from "./shared/vue.js";
15
+ import { templateSources } from "./template-sources.js";
16
+ import { tsLibDefinition } from "./ts-lib/definition.js";
17
+ import { vikeAppDefinition } from "./vike-app/definition.js";
18
+ import { vueAppDefinition } from "./vue-app/definition.js";
19
+ import { vueHonoAppDefinition } from "./vue-hono-app/definition.js";
20
+ const environmentNeedsPath = ".template/environment-needs.json";
21
+ /**
22
+ * The Foundation persists the non-rendering half of every Package
23
+ * Contribution with the Generated Repository. Package Addition cannot infer
24
+ * fix, deployment, or maintenance semantics from a package name (or
25
+ * from a lossy subset of scripts), so this is the durable topology it reads.
26
+ */
27
+ /** Resolve an owned source handle for diagnostics and source checks. */
28
+ export function resolveBuiltInTemplateSource(source, relativePath) {
29
+ return resolveTemplateSource(source, relativePath);
30
+ }
31
+ export function validateProjectBlueprintV2(value) {
32
+ return validateCoreProjectBlueprintV2(value);
33
+ }
34
+ class PresetRegistry {
35
+ #definitions;
36
+ constructor(definitions) {
37
+ const names = definitions.map((definition) => definition.metadata.name);
38
+ if (names.some((name) => name.length === 0) ||
39
+ new Set(names).size !== names.length) {
40
+ throw new Error("Preset Registry requires unique non-empty Definition names");
41
+ }
42
+ this.#definitions = [...definitions].toSorted((left, right) => left.metadata.name.localeCompare(right.metadata.name));
43
+ }
44
+ all() {
45
+ return this.#definitions;
46
+ }
47
+ require(name) {
48
+ const definition = this.#definitions.find((item) => item.metadata.name === name);
49
+ if (!definition)
50
+ throw new Error(`Unknown Built-in Preset: ${name}`);
51
+ return definition;
52
+ }
53
+ }
54
+ export const builtInPresetRegistry = new PresetRegistry([
55
+ tsLibDefinition,
56
+ rustBinDefinition,
57
+ vueAppDefinition,
58
+ vueHonoAppDefinition,
59
+ vikeAppDefinition,
60
+ ]);
61
+ /** Registry-derived Template Source roots checked independently of render plans. */
62
+ export function builtInPresetTemplateSourceContexts() {
63
+ return [
64
+ ...builtInPresetRegistry.all().map((definition) => ({
65
+ name: definition.metadata.name,
66
+ root: resolveBuiltInTemplateSource(definition.source, "."),
67
+ })),
68
+ {
69
+ name: "foundation",
70
+ root: resolveBuiltInTemplateSource(templateSources.foundation, "."),
71
+ },
72
+ {
73
+ name: "shared-devcontainer",
74
+ root: resolveBuiltInTemplateSource(templateSources.sharedDevcontainer, "."),
75
+ },
76
+ {
77
+ name: "shared-oxc",
78
+ root: resolveBuiltInTemplateSource(templateSources.sharedOxc, "."),
79
+ },
80
+ {
81
+ name: "shared-vue",
82
+ root: resolveBuiltInTemplateSource(templateSources.vue, "."),
83
+ },
84
+ ];
85
+ }
86
+ /**
87
+ * Derives direct Template Source checks from every registered Definition's
88
+ * actual initial contributions, without maintaining a second Preset catalog.
89
+ */
90
+ export function builtInPresetTemplateSourceCheckContexts() {
91
+ return builtInPresetRegistry.all().flatMap((definition) => {
92
+ const context = createGenerationContext({
93
+ targetDir: path.join("generated-repository", "template-source", definition.metadata.name),
94
+ toolchain: { nodeLtsMajor: "24", packageManagerPin: "pnpm@11.11.0" },
95
+ });
96
+ const plan = planGeneratedRepositoryInitialization({ definition, context });
97
+ const contributions = definition.planInitializationContributions?.(context) ?? [definition.planInitialization(context)];
98
+ return contributions.map((contribution) => ({
99
+ definition,
100
+ contribution,
101
+ plan,
102
+ }));
103
+ });
104
+ }
105
+ export function createGenerationContext(options) {
106
+ const projectName = path.basename(path.resolve(options.targetDir));
107
+ return {
108
+ targetDir: options.targetDir,
109
+ projectName,
110
+ scope: options.scope ?? projectName,
111
+ toolchain: options.toolchain,
112
+ };
113
+ }
114
+ function isRecord(value) {
115
+ return typeof value === "object" && value !== null && !Array.isArray(value);
116
+ }
117
+ function environmentNeedOwner(value) {
118
+ if (!isRecord(value))
119
+ return undefined;
120
+ if (value.kind === "workspace-orchestration" && value.path === ".") {
121
+ return { kind: "workspace-orchestration", path: "." };
122
+ }
123
+ if (value.kind === "package-boundary" && typeof value.path === "string") {
124
+ return { kind: "package-boundary", path: value.path };
125
+ }
126
+ return undefined;
127
+ }
128
+ function persistedCheckEnvironmentNeedFact(value) {
129
+ if (!isRecord(value))
130
+ return undefined;
131
+ const owner = environmentNeedOwner(value.owner);
132
+ if (owner === undefined)
133
+ return undefined;
134
+ switch (value.kind) {
135
+ case "playwright-browser-assets":
136
+ return value.browser === "chromium"
137
+ ? { kind: value.kind, browser: value.browser, owner }
138
+ : undefined;
139
+ case "shellcheck-command":
140
+ return { kind: value.kind, owner };
141
+ case "rust-toolchain":
142
+ return value.toolchain === "stable"
143
+ ? { kind: value.kind, toolchain: value.toolchain, owner }
144
+ : undefined;
145
+ default:
146
+ return undefined;
147
+ }
148
+ }
149
+ function readPersistedEnvironmentNeeds(targetDir) {
150
+ const filePath = path.join(targetDir, environmentNeedsPath);
151
+ if (!existsSync(filePath)) {
152
+ throw new Error(`Package Addition requires explicit Check Environment Need facts: ${environmentNeedsPath} is missing`);
153
+ }
154
+ let value;
155
+ try {
156
+ value = JSON.parse(readFileSync(filePath, "utf8"));
157
+ }
158
+ catch (error) {
159
+ throw new Error(`Package Addition requires valid Check Environment Need facts: ${error instanceof Error ? error.message : String(error)}`);
160
+ }
161
+ if (!isRecord(value) ||
162
+ value.schemaVersion !== 1 ||
163
+ !Array.isArray(value.check) ||
164
+ !Array.isArray(value.deployment)) {
165
+ throw new Error(`Package Addition requires valid Check Environment Need facts in ${environmentNeedsPath}`);
166
+ }
167
+ const check = value.check.map(persistedCheckEnvironmentNeedFact);
168
+ if (check.some((fact) => fact === undefined)) {
169
+ throw new Error(`Package Addition requires supported Check Environment Need facts in ${environmentNeedsPath}`);
170
+ }
171
+ if (value.deployment.some((fact) => !isRecord(fact) || fact.kind !== "docker-engine")) {
172
+ throw new Error(`Package Addition requires supported deployment Environment Need facts in ${environmentNeedsPath}`);
173
+ }
174
+ return {
175
+ check: check.map(checkEnvironmentNeedFromFact),
176
+ deployment: value.deployment.map((fact) => deploymentEnvironmentNeedFromFact(fact)),
177
+ };
178
+ }
179
+ function uniqueEnvironmentNeeds(needs) {
180
+ const seen = new Set();
181
+ return needs.filter((need) => {
182
+ const key = JSON.stringify(need);
183
+ if (seen.has(key))
184
+ return false;
185
+ seen.add(key);
186
+ return true;
187
+ });
188
+ }
189
+ /**
190
+ * Package Addition reconstructs generic current facts from the Blueprint,
191
+ * manifest truth, and explicit persisted Environment Need facts. Environment
192
+ * preparation is never derived from task script text.
193
+ */
194
+ function existingPackageContribution(options) {
195
+ const packageRoot = path.join(options.context.targetDir, options.definition.path);
196
+ const manifestPath = path.join(packageRoot, "package.json");
197
+ if (!existsSync(manifestPath)) {
198
+ throw new Error(`Package Addition requires manifest truth for ${options.definition.path}: package.json is missing`);
199
+ }
200
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
201
+ if (typeof manifest !== "object" ||
202
+ manifest === null ||
203
+ Array.isArray(manifest) ||
204
+ manifest.name !== options.definition.name) {
205
+ throw new Error(`Package Addition requires manifest truth for ${options.definition.path}: expected name ${options.definition.name}`);
206
+ }
207
+ const record = manifest;
208
+ const dependencyMaintenance = existingDependencyMaintenancePolicy(options.context.targetDir);
209
+ const environmentNeeds = options.environmentNeeds.filter((need) => need.owner.kind === "package-boundary" &&
210
+ need.owner.path === options.definition.path);
211
+ const rust = environmentNeeds.some((need) => need.kind === "rust-toolchain");
212
+ const editorRecommendationsPath = path.join(options.context.targetDir, ".vscode/extensions.json");
213
+ const editorRecommendations = existsSync(editorRecommendationsPath)
214
+ ? JSON.parse(readFileSync(editorRecommendationsPath, "utf8")).recommendations
215
+ : [];
216
+ const existingExtensions = Array.isArray(editorRecommendations)
217
+ ? new Set(editorRecommendations.filter((item) => typeof item === "string"))
218
+ : new Set();
219
+ const editorCapabilities = rust
220
+ ? ["rust-tooling"]
221
+ : [
222
+ "oxc-format-lint",
223
+ ...(existingExtensions.has("Vue.volar") ? ["vue"] : []),
224
+ ...(existingExtensions.has("bradlc.vscode-tailwindcss")
225
+ ? ["tailwind"]
226
+ : []),
227
+ ...(existingExtensions.has("vitest.explorer")
228
+ ? ["vitest"]
229
+ : []),
230
+ ];
231
+ return {
232
+ definition: options.definition,
233
+ manifest: record,
234
+ exposure: {
235
+ exports: typeof record.exports === "object" && record.exports !== null
236
+ ? record.exports
237
+ : {},
238
+ imports: typeof record.imports === "object" && record.imports !== null
239
+ ? record.imports
240
+ : {},
241
+ },
242
+ operations: [],
243
+ environmentNeeds,
244
+ foundation: {
245
+ toolchains: rust
246
+ ? { rust: { toolchain: "stable", components: ["rustfmt", "clippy"] } }
247
+ : {},
248
+ editorCapabilities,
249
+ dependencyMaintenance: {
250
+ ...dependencyMaintenance,
251
+ },
252
+ },
253
+ };
254
+ }
255
+ /**
256
+ * Dependabot is the Foundation-owned durable declaration of maintenance
257
+ * coverage. Package Addition reads it back so rebuilding root policy cannot
258
+ * silently discard a base repository's non-default directories.
259
+ */
260
+ function existingDependencyMaintenancePolicy(targetDir) {
261
+ const dependabotPath = path.join(targetDir, ".github/dependabot.yml");
262
+ if (!existsSync(dependabotPath)) {
263
+ throw new Error("Package Addition requires maintenance truth: .github/dependabot.yml is missing");
264
+ }
265
+ const ecosystems = [];
266
+ const directories = {};
267
+ const extraDirectories = {};
268
+ const supportedEcosystems = new Set([
269
+ "npm",
270
+ "cargo",
271
+ "github-actions",
272
+ "docker",
273
+ "rust-toolchain",
274
+ ]);
275
+ let ecosystem;
276
+ for (const line of readFileSync(dependabotPath, "utf8").split("\n")) {
277
+ const ecosystemMatch = /^\s*- package-ecosystem: (\S+)\s*$/u.exec(line);
278
+ if (ecosystemMatch) {
279
+ if (!supportedEcosystems.has(ecosystemMatch[1])) {
280
+ throw new Error(`Package Addition requires supported Dependabot ecosystems: ${ecosystemMatch[1]}`);
281
+ }
282
+ ecosystem = ecosystemMatch[1];
283
+ if (!ecosystems.includes(ecosystem))
284
+ ecosystems.push(ecosystem);
285
+ continue;
286
+ }
287
+ const directoryMatch = /^\s+directory: "?(\/[^"\s]*)"?\s*$/u.exec(line);
288
+ if (!directoryMatch || ecosystem === undefined)
289
+ continue;
290
+ const directory = directoryMatch[1];
291
+ if (directories[ecosystem] === undefined) {
292
+ directories[ecosystem] = directory;
293
+ }
294
+ else {
295
+ (extraDirectories[ecosystem] ??= []).push(directory);
296
+ }
297
+ }
298
+ if (ecosystems.length === 0) {
299
+ throw new Error("Package Addition requires maintenance truth: .github/dependabot.yml has no update entries");
300
+ }
301
+ return {
302
+ ecosystems,
303
+ directories,
304
+ ...(Object.keys(extraDirectories).length === 0 ? {} : { extraDirectories }),
305
+ interval: "weekly",
306
+ };
307
+ }
308
+ function devcontainerDockerfileOperations(options) {
309
+ const hasBrowserTests = options.environmentNeeds.some((need) => need.kind === "playwright-browser-assets");
310
+ const hasShellChecks = options.environmentNeeds.some((need) => need.kind === "shellcheck-command");
311
+ const browserLayer = hasBrowserTests ? browserTestToolLayer() : undefined;
312
+ return [
313
+ {
314
+ kind: "writeTextTemplate",
315
+ source: templateSources.foundation,
316
+ from: "devcontainer.json",
317
+ to: ".devcontainer/devcontainer.json",
318
+ replacements: {
319
+ PROJECT_NAME: options.context.projectName,
320
+ NODE_LTS_MAJOR: options.context.toolchain.nodeLtsMajor,
321
+ PACKAGE_MANAGER_PIN: options.context.toolchain.packageManagerPin,
322
+ PLAYWRIGHT_CLI_PACKAGE: browserLayer?.playwrightCliPackage ?? "unused",
323
+ },
324
+ },
325
+ {
326
+ kind: "writeTextFromFragments",
327
+ to: ".devcontainer/Dockerfile",
328
+ fragments: [
329
+ {
330
+ source: templateSources.sharedDevcontainer,
331
+ from: "node-pnpm.Dockerfile",
332
+ },
333
+ ...(browserLayer === undefined
334
+ ? []
335
+ : [
336
+ {
337
+ source: templateSources.sharedDevcontainer,
338
+ from: "browser-test.Dockerfile",
339
+ },
340
+ ]),
341
+ ...(hasShellChecks
342
+ ? [
343
+ {
344
+ source: templateSources.sharedDevcontainer,
345
+ from: "shellcheck.Dockerfile",
346
+ },
347
+ ]
348
+ : []),
349
+ ],
350
+ },
351
+ ];
352
+ }
353
+ function foundationPlan(options) {
354
+ assertProjectBlueprintV2(options.blueprint);
355
+ const environmentNeeds = uniqueEnvironmentNeeds(options.contributions.flatMap((item) => item.environmentNeeds));
356
+ const deploymentEnvironmentNeeds = uniqueEnvironmentNeeds([
357
+ ...(options.existingDeploymentEnvironmentNeeds ?? []),
358
+ ...options.contributions.flatMap((item) => item.deploymentEnvironmentNeeds ?? []),
359
+ ]);
360
+ const persistedEnvironmentNeeds = {
361
+ schemaVersion: 1,
362
+ check: environmentNeeds.map(checkEnvironmentNeedFact),
363
+ deployment: deploymentEnvironmentNeeds.map(deploymentEnvironmentNeedFact),
364
+ };
365
+ const hasDeploymentTask = options.contributions.some((contribution) => {
366
+ const scripts = contribution.manifest.scripts;
367
+ return (typeof scripts === "object" &&
368
+ scripts !== null &&
369
+ typeof scripts.deployment === "string");
370
+ });
371
+ const packagePaths = options.contributions.map((contribution) => contribution.definition.path);
372
+ if (new Set(packagePaths).size !== packagePaths.length)
373
+ throw new Error("Package Contributions must have unique Package Paths");
374
+ const packageNames = options.contributions.map((contribution) => contribution.definition.name);
375
+ if (new Set(packageNames).size !== packageNames.length)
376
+ throw new Error("Package Contributions must have unique package names");
377
+ const rustToolchain = options.contributions
378
+ .map((contribution) => contribution.foundation.toolchains.rust)
379
+ .find((toolchain) => toolchain !== undefined);
380
+ if (options.contributions.some((contribution) => contribution.foundation.toolchains.rust !== undefined &&
381
+ contribution.foundation.toolchains.rust !== rustToolchain)) {
382
+ throw new Error("Foundation requires one coordinated Rust toolchain");
383
+ }
384
+ const workspacePackageGlobs = [
385
+ "apps/*",
386
+ "packages/*",
387
+ ...new Set([
388
+ ...options.blueprint.packages
389
+ .map((definition) => `${definition.path.split("/")[0]}/*`)
390
+ .filter((glob) => glob !== "apps/*" && glob !== "packages/*"),
391
+ ...options.contributions
392
+ .flatMap((contribution) => contribution.foundation.workspacePackageGlobs ?? [])
393
+ .filter((glob) => glob !== "apps/*" && glob !== "packages/*"),
394
+ ]),
395
+ ];
396
+ const editorCustomization = editorCustomizationForCapabilities(options.contributions.flatMap((contribution) => contribution.foundation.editorCapabilities), loadEditorCustomizationDeclarations(resolveTemplateSource(templateSources.editorCustomization, "capabilities.json")));
397
+ const dependencyMaintenancePolicy = {
398
+ ecosystems: [
399
+ ...new Set(options.contributions.flatMap((contribution) => contribution.foundation.dependencyMaintenance.ecosystems)),
400
+ ],
401
+ directories: Object.assign({}, ...options.contributions.map((contribution) => contribution.foundation.dependencyMaintenance.directories ?? {})),
402
+ extraDirectories: Object.assign({}, ...options.contributions.map((contribution) => contribution.foundation.dependencyMaintenance.extraDirectories ?? {})),
403
+ interval: "weekly",
404
+ };
405
+ const rootManifest = {
406
+ name: options.context.projectName,
407
+ version: "0.0.0",
408
+ private: true,
409
+ type: "module",
410
+ scripts: {
411
+ check: renderRootCheckCommand(),
412
+ boundaries: "node scripts/check-boundaries.ts",
413
+ ...(hasDeploymentTask
414
+ ? { "check:deployment": renderDeploymentCheckCommand() }
415
+ : {}),
416
+ fix: renderFixCommand(),
417
+ "format:check": "node scripts/run-root-owned-task.ts format:check",
418
+ "format:write": "node scripts/run-root-owned-task.ts format:write",
419
+ lint: "node scripts/run-root-owned-task.ts lint",
420
+ "lint:fix": "node scripts/run-root-owned-task.ts lint:fix",
421
+ typecheck: "tsc -p tsconfig.json --noEmit --pretty false",
422
+ },
423
+ devDependencies: {
424
+ "@types/node": "catalog:",
425
+ oxfmt: "catalog:",
426
+ oxlint: "catalog:",
427
+ "oxlint-tsgolint": "catalog:",
428
+ turbo: "catalog:",
429
+ "typescript-7": "catalog:",
430
+ },
431
+ engines: { node: options.context.toolchain.nodeLtsMajor },
432
+ packageManager: options.context.toolchain.packageManagerPin,
433
+ };
434
+ const dependencyCatalog = selectTemplateDependencyCatalogEntries(collectGeneratedManifestCatalogReferences([
435
+ ...options.contributions.map((contribution) => contribution.manifest),
436
+ rootManifest,
437
+ ]));
438
+ const dependencyOverrides = {
439
+ ...(Object.hasOwn(dependencyCatalog, "vue") ||
440
+ Object.hasOwn(dependencyCatalog, "pinia")
441
+ ? vuePnpmDependencyOverrides
442
+ : {}),
443
+ };
444
+ const requiresCoordinatedWorkspaceRefresh = true;
445
+ const workspaceOperation = requiresCoordinatedWorkspaceRefresh
446
+ ? {
447
+ kind: "writeTextTemplate",
448
+ source: templateSources.foundation,
449
+ from: "pnpm-workspace.dynamic.txt",
450
+ to: "pnpm-workspace.yaml",
451
+ replacements: {
452
+ WORKSPACE_PACKAGE_GLOBS: workspacePackageGlobs
453
+ .map((glob) => ` - ${glob}`)
454
+ .join("\n"),
455
+ DEPENDENCY_CATALOG: Object.entries(dependencyCatalog)
456
+ .toSorted(([left], [right]) => left.localeCompare(right))
457
+ .map(([name, version]) => ` ${JSON.stringify(name)}: ${String(version)}`)
458
+ .join("\n"),
459
+ DEPENDENCY_OVERRIDES_SECTION: Object.keys(dependencyOverrides).length === 0
460
+ ? ""
461
+ : [
462
+ "",
463
+ "overrides:",
464
+ ...Object.entries(dependencyOverrides)
465
+ .toSorted(([left], [right]) => left.localeCompare(right))
466
+ .map(([dependency, version]) => ` ${JSON.stringify(dependency)}: ${JSON.stringify(version)}`),
467
+ "",
468
+ ].join("\n"),
469
+ },
470
+ ...(options.mode === "addition" ? { overwrite: true } : {}),
471
+ }
472
+ : {
473
+ kind: "copyFile",
474
+ source: templateSources.foundation,
475
+ from: "pnpm-workspace.yaml",
476
+ to: "pnpm-workspace.yaml",
477
+ };
478
+ const workflowOperation = {
479
+ kind: "writeTextTemplate",
480
+ source: templateSources.foundation,
481
+ from: ".github/workflows/check.dynamic.template",
482
+ to: ".github/workflows/check.yml",
483
+ replacements: projectCheckWorkflowTemplateReplacements({
484
+ environment: { needs: environmentNeeds },
485
+ deploymentEnvironmentNeeds,
486
+ hasDeploymentTask,
487
+ }),
488
+ ...(options.mode === "addition" ? { overwrite: true } : {}),
489
+ };
490
+ const workflowOperations = [
491
+ workflowOperation,
492
+ {
493
+ kind: "writeTextTemplate",
494
+ source: templateSources.foundation,
495
+ from: ".github/dependabot.dynamic.template",
496
+ to: ".github/dependabot.yml",
497
+ replacements: projectDependabotTemplateReplacements(dependencyMaintenancePolicy),
498
+ ...(options.mode === "addition" ? { overwrite: true } : {}),
499
+ },
500
+ ];
501
+ const projectLinkPlan = planExplicitProjectLinks({
502
+ blueprint: options.blueprint,
503
+ contributions: options.contributions,
504
+ });
505
+ const initializationFoundationOperations = [
506
+ { kind: "writeJson", to: "package.json", value: rootManifest },
507
+ workspaceOperation,
508
+ {
509
+ kind: "copyFile",
510
+ source: templateSources.foundation,
511
+ from: "gitignore",
512
+ to: ".gitignore",
513
+ },
514
+ {
515
+ kind: "copyFile",
516
+ source: templateSources.foundation,
517
+ from: "turbo.json",
518
+ to: "turbo.json",
519
+ },
520
+ {
521
+ kind: "copyFile",
522
+ source: templateSources.foundation,
523
+ from: "scripts/check-boundaries.ts",
524
+ to: "scripts/check-boundaries.ts",
525
+ },
526
+ {
527
+ kind: "copyFile",
528
+ source: templateSources.foundation,
529
+ from: "scripts/run-root-owned-task.ts",
530
+ to: "scripts/run-root-owned-task.ts",
531
+ },
532
+ {
533
+ kind: "copyFile",
534
+ source: templateSources.foundation,
535
+ from: "tsconfig.json",
536
+ to: "tsconfig.json",
537
+ },
538
+ {
539
+ kind: "copyFile",
540
+ source: templateSources.sharedOxc,
541
+ from: "tsconfig.config.json",
542
+ to: "tsconfig.config.json",
543
+ },
544
+ {
545
+ kind: "copyFile",
546
+ source: templateSources.sharedOxc,
547
+ from: "node/oxlint.config.ts",
548
+ to: "oxlint.config.ts",
549
+ },
550
+ {
551
+ kind: "copyFile",
552
+ source: templateSources.sharedOxc,
553
+ from: "oxfmt.config.ts",
554
+ to: "oxfmt.config.ts",
555
+ },
556
+ {
557
+ kind: "writeJson",
558
+ to: ".vscode/extensions.json",
559
+ value: { recommendations: editorCustomization.extensions },
560
+ ...(editorCustomization.extensions.length > 2
561
+ ? { multilineArrays: ["recommendations"] }
562
+ : {}),
563
+ },
564
+ {
565
+ kind: "writeJson",
566
+ to: ".vscode/settings.json",
567
+ value: editorCustomization.settings,
568
+ },
569
+ ...(rustToolchain === undefined
570
+ ? [
571
+ ...devcontainerDockerfileOperations({
572
+ context: options.context,
573
+ environmentNeeds,
574
+ }),
575
+ ]
576
+ : [
577
+ {
578
+ kind: "writeTextTemplate",
579
+ source: templateSources.foundation,
580
+ from: "rust/rust-toolchain.toml",
581
+ to: "rust-toolchain.toml",
582
+ replacements: { RUST_TOOLCHAIN: rustToolchain.toolchain },
583
+ },
584
+ {
585
+ kind: "writeTextTemplate",
586
+ source: templateSources.foundation,
587
+ from: "rust/devcontainer/devcontainer.json",
588
+ to: ".devcontainer/devcontainer.json",
589
+ replacements: {
590
+ PROJECT_NAME: options.context.projectName,
591
+ NODE_LTS_MAJOR: options.context.toolchain.nodeLtsMajor,
592
+ PACKAGE_MANAGER_PIN: options.context.toolchain.packageManagerPin,
593
+ RUST_TOOLCHAIN: rustToolchain.toolchain,
594
+ },
595
+ },
596
+ {
597
+ kind: "writeTextFromFragments",
598
+ to: ".devcontainer/Dockerfile",
599
+ fragments: [
600
+ {
601
+ source: templateSources.sharedDevcontainer,
602
+ from: "node-pnpm.Dockerfile",
603
+ },
604
+ {
605
+ source: templateSources.foundation,
606
+ from: "rust/devcontainer/rust.Dockerfile",
607
+ },
608
+ ...(environmentNeeds.some((need) => need.kind === "playwright-browser-assets")
609
+ ? [
610
+ {
611
+ source: templateSources.sharedDevcontainer,
612
+ from: "browser-test.Dockerfile",
613
+ },
614
+ ]
615
+ : []),
616
+ ...(environmentNeeds.some((need) => need.kind === "shellcheck-command")
617
+ ? [
618
+ {
619
+ source: templateSources.sharedDevcontainer,
620
+ from: "shellcheck.Dockerfile",
621
+ },
622
+ ]
623
+ : []),
624
+ ],
625
+ },
626
+ ]),
627
+ ...workflowOperations,
628
+ {
629
+ kind: "writeJson",
630
+ to: ".template/blueprint.json",
631
+ value: options.blueprint,
632
+ },
633
+ {
634
+ kind: "writeJson",
635
+ to: environmentNeedsPath,
636
+ value: persistedEnvironmentNeeds,
637
+ },
638
+ {
639
+ kind: "writeJson",
640
+ to: ".template/generation.json",
641
+ value: {
642
+ preset: options.definition.metadata.name,
643
+ templateVersion: "0.0.0",
644
+ toolchain: options.context.toolchain,
645
+ },
646
+ },
647
+ ];
648
+ const refreshFoundationOperation = (operation) => {
649
+ switch (operation.kind) {
650
+ case "copyFile":
651
+ case "writeTextTemplate":
652
+ case "writeTextFromFragments":
653
+ case "writeJson":
654
+ return { ...operation, overwrite: true };
655
+ case "mergeJson":
656
+ case "replaceAnchors":
657
+ case "setExecutable":
658
+ case "writeText":
659
+ return operation;
660
+ }
661
+ };
662
+ const plannedFoundationOperations = options.mode === "addition"
663
+ ? initializationFoundationOperations
664
+ .filter((operation) => !("to" in operation &&
665
+ operation.to === ".template/generation.json"))
666
+ .map(refreshFoundationOperation)
667
+ : initializationFoundationOperations;
668
+ const linkOperations = [
669
+ ...projectLinkPlan.manifestDependenciesByPackagePath,
670
+ ].map(([packagePath, dependencies]) => ({
671
+ kind: "mergeJson",
672
+ to: `${packagePath}/package.json`,
673
+ value: { dependencies },
674
+ multilineArrays: ["files"],
675
+ }));
676
+ const contributionProvenance = {
677
+ definitionName: options.definition.metadata.name,
678
+ plannerSourceFile: options.definition.plannerSourceFile,
679
+ planningContribution: options.mode === "addition"
680
+ ? "planPackageAddition"
681
+ : "planInitialization",
682
+ ownershipRule: "Package Contribution may write only its owned Package Boundary",
683
+ };
684
+ const foundationProvenance = {
685
+ definitionName: options.definition.metadata.name,
686
+ plannerSourceFile: fileURLToPath(import.meta.url),
687
+ planningContribution: "foundationPlan",
688
+ ownershipRule: "Foundation owns coordinated root outputs",
689
+ };
690
+ const withProvenance = (operation, provenance) => ({ ...operation, provenance });
691
+ const operations = [
692
+ ...(options.renderContributions ?? options.contributions)
693
+ .map((item) => assertPackageContribution(item, {
694
+ definitionName: options.definition.metadata.name,
695
+ planner: options.mode === "addition"
696
+ ? "planPackageAddition"
697
+ : "planInitialization",
698
+ }))
699
+ .flatMap((item) => item.operations.map((operation) => operation.kind === "writeJson" &&
700
+ operation.to.endsWith("/package.json")
701
+ ? { ...operation, value: item.manifest }
702
+ : operation))
703
+ .map((operation) => withProvenance(operation, contributionProvenance)),
704
+ ...plannedFoundationOperations.map((operation) => withProvenance(operation, foundationProvenance)),
705
+ ...linkOperations.map((operation) => withProvenance(operation, foundationProvenance)),
706
+ ];
707
+ return {
708
+ definitionName: options.definition.metadata.name,
709
+ plannerSourceFile: options.definition.plannerSourceFile,
710
+ planningContribution: options.mode === "addition"
711
+ ? "planPackageAddition"
712
+ : "planInitialization",
713
+ blueprint: options.blueprint,
714
+ generationRecord: {
715
+ preset: options.definition.metadata.name,
716
+ templateVersion: "0.0.0",
717
+ toolchain: options.context.toolchain,
718
+ },
719
+ operations,
720
+ environmentNeeds,
721
+ deploymentEnvironmentNeeds,
722
+ manifests: [
723
+ ...options.contributions.map((item) => item.manifest),
724
+ rootManifest,
725
+ ],
726
+ dependencyCatalog,
727
+ dependencyMaintenancePolicy,
728
+ nextStepInstructions: [
729
+ { display: "pnpm install" },
730
+ ...environmentNeeds.map((need) => ({ display: need.nextStep.display })),
731
+ { display: "pnpm run fix" },
732
+ { display: "pnpm run check" },
733
+ ],
734
+ };
735
+ }
736
+ export function planGeneratedRepositoryInitialization(options) {
737
+ const blueprint = options.definition.blueprint(options.context);
738
+ return foundationPlan({
739
+ definition: options.definition,
740
+ context: options.context,
741
+ blueprint,
742
+ contributions: options.definition.planInitializationContributions?.(options.context) ?? [options.definition.planInitialization(options.context)],
743
+ mode: "initialization",
744
+ });
745
+ }
746
+ export function planGeneratedRepositoryPackageAddition(options) {
747
+ assertProjectBlueprintV2(options.blueprint);
748
+ if (!options.definition.planPackageAddition)
749
+ throw new Error(`Built-in Preset ${options.definition.metadata.name} does not support Package Addition`);
750
+ const packagePath = options.packagePath ??
751
+ options.definition.defaultPackagePath?.({
752
+ context: options.context,
753
+ packageLeafName: options.packageLeafName,
754
+ });
755
+ if (packagePath === undefined) {
756
+ throw new Error(`Built-in Preset ${options.definition.metadata.name} must own a default Package Path or receive an explicit Package Path`);
757
+ }
758
+ const contribution = options.definition.planPackageAddition({
759
+ context: options.context,
760
+ packageLeafName: options.packageLeafName,
761
+ packagePath,
762
+ });
763
+ const conflictingPackage = options.blueprint.packages.find((existing) => existing.name === contribution.definition.name ||
764
+ existing.path === contribution.definition.path);
765
+ if (conflictingPackage !== undefined) {
766
+ throw new Error(`Package Addition conflicts with existing Package Definition ${conflictingPackage.name} at ${conflictingPackage.path}`);
767
+ }
768
+ const blueprint = {
769
+ ...options.blueprint,
770
+ packages: [...options.blueprint.packages, contribution.definition],
771
+ ...(options.linkFrom && options.linkFrom.length > 0
772
+ ? {
773
+ packageLinkIntents: [
774
+ ...(options.blueprint.packageLinkIntents ?? []),
775
+ ...[...new Set(options.linkFrom)].map((consumerPackagePath) => ({
776
+ consumerPackagePath,
777
+ providerPackagePath: contribution.definition.path,
778
+ })),
779
+ ],
780
+ }
781
+ : {}),
782
+ };
783
+ assertProjectBlueprintV2(blueprint);
784
+ const persistedEnvironmentNeeds = readPersistedEnvironmentNeeds(options.context.targetDir);
785
+ const existingContributions = options.blueprint.packages.map((definition) => existingPackageContribution({
786
+ context: options.context,
787
+ definition,
788
+ environmentNeeds: persistedEnvironmentNeeds.check,
789
+ }));
790
+ if (existingContributions.length !== options.blueprint.packages.length ||
791
+ existingContributions.some((existing) => !options.blueprint.packages.some((definition) => definition.path === existing.definition.path &&
792
+ definition.name === existing.definition.name))) {
793
+ throw new Error("Migration Package Addition check Contributions must match the current Project Blueprint");
794
+ }
795
+ return foundationPlan({
796
+ definition: options.definition,
797
+ context: options.context,
798
+ blueprint,
799
+ contributions: [...existingContributions, contribution],
800
+ renderContributions: [contribution],
801
+ existingDeploymentEnvironmentNeeds: persistedEnvironmentNeeds.deployment,
802
+ mode: "addition",
803
+ });
804
+ }