@cbnventures/nova 0.19.0 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (536) hide show
  1. package/README.md +10 -0
  2. package/bin/nova.mjs +3 -3
  3. package/build/package.json +14 -10
  4. package/build/src/cli/generate/github/funding.js +2 -2
  5. package/build/src/cli/generate/github/funding.js.map +1 -1
  6. package/build/src/cli/generate/github/issue-template.d.ts.map +1 -1
  7. package/build/src/cli/generate/github/issue-template.js +6 -95
  8. package/build/src/cli/generate/github/issue-template.js.map +1 -1
  9. package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts +12 -0
  10. package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts.map +1 -0
  11. package/build/src/cli/generate/github/workflows-blueprint-validate.js +535 -0
  12. package/build/src/cli/generate/github/workflows-blueprint-validate.js.map +1 -0
  13. package/build/src/cli/generate/github/workflows-blueprint-variables.d.ts +9 -0
  14. package/build/src/cli/generate/github/workflows-blueprint-variables.d.ts.map +1 -0
  15. package/build/src/cli/generate/github/workflows-blueprint-variables.js +117 -0
  16. package/build/src/cli/generate/github/workflows-blueprint-variables.js.map +1 -0
  17. package/build/src/cli/generate/github/workflows-blueprint.d.ts +60 -0
  18. package/build/src/cli/generate/github/workflows-blueprint.d.ts.map +1 -0
  19. package/build/src/cli/generate/github/workflows-blueprint.js +2251 -0
  20. package/build/src/cli/generate/github/workflows-blueprint.js.map +1 -0
  21. package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -1
  22. package/build/src/cli/generate/must-haves/agent-conventions.js +14 -5
  23. package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
  24. package/build/src/cli/generate/must-haves/dotenv.d.ts +5 -7
  25. package/build/src/cli/generate/must-haves/dotenv.d.ts.map +1 -1
  26. package/build/src/cli/generate/must-haves/dotenv.js +146 -417
  27. package/build/src/cli/generate/must-haves/dotenv.js.map +1 -1
  28. package/build/src/cli/generate/must-haves/editorconfig.js +2 -2
  29. package/build/src/cli/generate/must-haves/editorconfig.js.map +1 -1
  30. package/build/src/cli/generate/must-haves/gitignore.d.ts +0 -8
  31. package/build/src/cli/generate/must-haves/gitignore.d.ts.map +1 -1
  32. package/build/src/cli/generate/must-haves/gitignore.js +9 -397
  33. package/build/src/cli/generate/must-haves/gitignore.js.map +1 -1
  34. package/build/src/cli/generate/must-haves/license.d.ts.map +1 -1
  35. package/build/src/cli/generate/must-haves/license.js +4 -4
  36. package/build/src/cli/generate/must-haves/license.js.map +1 -1
  37. package/build/src/cli/generate/must-haves/read-me.d.ts +6 -2
  38. package/build/src/cli/generate/must-haves/read-me.d.ts.map +1 -1
  39. package/build/src/cli/generate/must-haves/read-me.js +103 -63
  40. package/build/src/cli/generate/must-haves/read-me.js.map +1 -1
  41. package/build/src/cli/index.js +108 -2
  42. package/build/src/cli/index.js.map +1 -1
  43. package/build/src/cli/recipe/github/sync-features.d.ts.map +1 -1
  44. package/build/src/cli/recipe/github/sync-features.js +5 -3
  45. package/build/src/cli/recipe/github/sync-features.js.map +1 -1
  46. package/build/src/cli/recipe/github/sync-identity.d.ts.map +1 -1
  47. package/build/src/cli/recipe/github/sync-identity.js +6 -4
  48. package/build/src/cli/recipe/github/sync-identity.js.map +1 -1
  49. package/build/src/cli/recipe/github/sync-policies.d.ts.map +1 -1
  50. package/build/src/cli/recipe/github/sync-policies.js +13 -4
  51. package/build/src/cli/recipe/github/sync-policies.js.map +1 -1
  52. package/build/src/cli/recipe/index.d.ts.map +1 -1
  53. package/build/src/cli/recipe/index.js +32 -0
  54. package/build/src/cli/recipe/index.js.map +1 -1
  55. package/build/src/cli/recipe/license/update-copyright.d.ts +7 -0
  56. package/build/src/cli/recipe/license/update-copyright.d.ts.map +1 -0
  57. package/build/src/cli/recipe/license/update-copyright.js +191 -0
  58. package/build/src/cli/recipe/license/update-copyright.js.map +1 -0
  59. package/build/src/cli/recipe/package-json/cleanup.d.ts.map +1 -1
  60. package/build/src/cli/recipe/package-json/cleanup.js +14 -13
  61. package/build/src/cli/recipe/package-json/cleanup.js.map +1 -1
  62. package/build/src/cli/recipe/package-json/normalize-artifacts.d.ts.map +1 -1
  63. package/build/src/cli/recipe/package-json/normalize-artifacts.js +11 -6
  64. package/build/src/cli/recipe/package-json/normalize-artifacts.js.map +1 -1
  65. package/build/src/cli/recipe/package-json/normalize-bundler.d.ts.map +1 -1
  66. package/build/src/cli/recipe/package-json/normalize-bundler.js +11 -6
  67. package/build/src/cli/recipe/package-json/normalize-bundler.js.map +1 -1
  68. package/build/src/cli/recipe/package-json/normalize-dependencies.d.ts.map +1 -1
  69. package/build/src/cli/recipe/package-json/normalize-dependencies.js +18 -10
  70. package/build/src/cli/recipe/package-json/normalize-dependencies.js.map +1 -1
  71. package/build/src/cli/recipe/package-json/normalize-modules.d.ts.map +1 -1
  72. package/build/src/cli/recipe/package-json/normalize-modules.js +11 -6
  73. package/build/src/cli/recipe/package-json/normalize-modules.js.map +1 -1
  74. package/build/src/cli/recipe/package-json/normalize-tooling.d.ts.map +1 -1
  75. package/build/src/cli/recipe/package-json/normalize-tooling.js +12 -7
  76. package/build/src/cli/recipe/package-json/normalize-tooling.js.map +1 -1
  77. package/build/src/cli/recipe/package-json/sync-environment.d.ts.map +1 -1
  78. package/build/src/cli/recipe/package-json/sync-environment.js +46 -14
  79. package/build/src/cli/recipe/package-json/sync-environment.js.map +1 -1
  80. package/build/src/cli/recipe/package-json/sync-identity.d.ts.map +1 -1
  81. package/build/src/cli/recipe/package-json/sync-identity.js +29 -16
  82. package/build/src/cli/recipe/package-json/sync-identity.js.map +1 -1
  83. package/build/src/cli/recipe/package-json/sync-ownership.d.ts.map +1 -1
  84. package/build/src/cli/recipe/package-json/sync-ownership.js +18 -11
  85. package/build/src/cli/recipe/package-json/sync-ownership.js.map +1 -1
  86. package/build/src/cli/recipe/read-me/update-badges.d.ts +6 -0
  87. package/build/src/cli/recipe/read-me/update-badges.d.ts.map +1 -0
  88. package/build/src/cli/recipe/read-me/update-badges.js +115 -0
  89. package/build/src/cli/recipe/read-me/update-badges.js.map +1 -0
  90. package/build/src/cli/recipe/read-me/update-credits.d.ts +6 -0
  91. package/build/src/cli/recipe/read-me/update-credits.d.ts.map +1 -0
  92. package/build/src/cli/recipe/read-me/update-credits.js +115 -0
  93. package/build/src/cli/recipe/read-me/update-credits.js.map +1 -0
  94. package/build/src/cli/recipe/read-me/update-documentation.d.ts +6 -0
  95. package/build/src/cli/recipe/read-me/update-documentation.d.ts.map +1 -0
  96. package/build/src/cli/recipe/read-me/update-documentation.js +115 -0
  97. package/build/src/cli/recipe/read-me/update-documentation.js.map +1 -0
  98. package/build/src/cli/recipe/read-me/update-header.d.ts +6 -0
  99. package/build/src/cli/recipe/read-me/update-header.d.ts.map +1 -0
  100. package/build/src/cli/recipe/read-me/update-header.js +115 -0
  101. package/build/src/cli/recipe/read-me/update-header.js.map +1 -0
  102. package/build/src/cli/recipe/read-me/update-introduction.d.ts +6 -0
  103. package/build/src/cli/recipe/read-me/update-introduction.d.ts.map +1 -0
  104. package/build/src/cli/recipe/read-me/update-introduction.js +115 -0
  105. package/build/src/cli/recipe/read-me/update-introduction.js.map +1 -0
  106. package/build/src/cli/scaffold/starter/base.js +1 -1
  107. package/build/src/cli/scaffold/starter/base.js.map +1 -1
  108. package/build/src/cli/utility/changelog.d.ts +2 -0
  109. package/build/src/cli/utility/changelog.d.ts.map +1 -1
  110. package/build/src/cli/utility/changelog.js +159 -3
  111. package/build/src/cli/utility/changelog.js.map +1 -1
  112. package/build/src/cli/utility/initialize.d.ts +9 -0
  113. package/build/src/cli/utility/initialize.d.ts.map +1 -1
  114. package/build/src/cli/utility/initialize.js +978 -111
  115. package/build/src/cli/utility/initialize.js.map +1 -1
  116. package/build/src/cli/utility/run-scripts.d.ts.map +1 -1
  117. package/build/src/cli/utility/run-scripts.js +4 -4
  118. package/build/src/cli/utility/run-scripts.js.map +1 -1
  119. package/build/src/cli/utility/transpile.js +1 -1
  120. package/build/src/cli/utility/transpile.js.map +1 -1
  121. package/build/src/cli/utility/type-check.js +1 -1
  122. package/build/src/cli/utility/type-check.js.map +1 -1
  123. package/build/src/cli/utility/version.js +1 -1
  124. package/build/src/cli/utility/version.js.map +1 -1
  125. package/build/src/lib/dotenv.d.ts +3 -0
  126. package/build/src/lib/dotenv.d.ts.map +1 -0
  127. package/build/src/lib/dotenv.js +66 -0
  128. package/build/src/lib/dotenv.js.map +1 -0
  129. package/build/src/lib/env-github.d.ts +4 -0
  130. package/build/src/lib/env-github.d.ts.map +1 -0
  131. package/build/src/lib/env-github.js +57 -0
  132. package/build/src/lib/env-github.js.map +1 -0
  133. package/build/src/lib/env-managed-set.d.ts +3 -0
  134. package/build/src/lib/env-managed-set.d.ts.map +1 -0
  135. package/build/src/lib/env-managed-set.js +102 -0
  136. package/build/src/lib/env-managed-set.js.map +1 -0
  137. package/build/src/lib/env-namespace.d.ts +3 -0
  138. package/build/src/lib/env-namespace.d.ts.map +1 -0
  139. package/build/src/lib/env-namespace.js +11 -0
  140. package/build/src/lib/env-namespace.js.map +1 -0
  141. package/build/src/lib/env-reconcile.d.ts +3 -0
  142. package/build/src/lib/env-reconcile.d.ts.map +1 -0
  143. package/build/src/lib/env-reconcile.js +109 -0
  144. package/build/src/lib/env-reconcile.js.map +1 -0
  145. package/build/src/lib/env-status.d.ts +3 -0
  146. package/build/src/lib/env-status.d.ts.map +1 -0
  147. package/build/src/lib/env-status.js +113 -0
  148. package/build/src/lib/env-status.js.map +1 -0
  149. package/build/src/lib/file-discovery.d.ts +3 -0
  150. package/build/src/lib/file-discovery.d.ts.map +1 -0
  151. package/build/src/lib/file-discovery.js +32 -0
  152. package/build/src/lib/file-discovery.js.map +1 -0
  153. package/build/src/lib/item.d.ts +4 -1
  154. package/build/src/lib/item.d.ts.map +1 -1
  155. package/build/src/lib/item.js +35 -0
  156. package/build/src/lib/item.js.map +1 -1
  157. package/build/src/lib/markdown-slug.d.ts +4 -0
  158. package/build/src/lib/markdown-slug.d.ts.map +1 -0
  159. package/build/src/lib/markdown-slug.js +25 -0
  160. package/build/src/lib/markdown-slug.js.map +1 -0
  161. package/build/src/lib/nova-config.d.ts +14 -2
  162. package/build/src/lib/nova-config.d.ts.map +1 -1
  163. package/build/src/lib/nova-config.js +507 -78
  164. package/build/src/lib/nova-config.js.map +1 -1
  165. package/build/src/lib/read-me-regions.d.ts +4 -0
  166. package/build/src/lib/read-me-regions.d.ts.map +1 -0
  167. package/build/src/lib/read-me-regions.js +33 -0
  168. package/build/src/lib/read-me-regions.js.map +1 -0
  169. package/build/src/lib/regex.d.ts +73 -0
  170. package/build/src/lib/regex.d.ts.map +1 -1
  171. package/build/src/lib/regex.js +75 -2
  172. package/build/src/lib/regex.js.map +1 -1
  173. package/build/src/lib/scaffold.d.ts.map +1 -1
  174. package/build/src/lib/scaffold.js +33 -14
  175. package/build/src/lib/scaffold.js.map +1 -1
  176. package/build/src/lib/type-declaration-engine.d.ts +32 -0
  177. package/build/src/lib/type-declaration-engine.d.ts.map +1 -0
  178. package/build/src/lib/type-declaration-engine.js +796 -0
  179. package/build/src/lib/type-declaration-engine.js.map +1 -0
  180. package/build/src/lib/utility.d.ts +2 -1
  181. package/build/src/lib/utility.d.ts.map +1 -1
  182. package/build/src/lib/utility.js +47 -15
  183. package/build/src/lib/utility.js.map +1 -1
  184. package/build/src/lib/workflow-templates.d.ts.map +1 -1
  185. package/build/src/lib/workflow-templates.js +86 -60
  186. package/build/src/lib/workflow-templates.js.map +1 -1
  187. package/build/src/presets/eslint/dx-code-style.d.ts.map +1 -1
  188. package/build/src/presets/eslint/dx-code-style.js +6 -0
  189. package/build/src/presets/eslint/dx-code-style.js.map +1 -1
  190. package/build/src/presets/eslint/fw-astro.d.ts +4 -0
  191. package/build/src/presets/eslint/fw-astro.d.ts.map +1 -0
  192. package/build/src/presets/eslint/fw-astro.js +13 -0
  193. package/build/src/presets/eslint/fw-astro.js.map +1 -0
  194. package/build/src/presets/eslint/index.d.ts +1 -0
  195. package/build/src/presets/eslint/index.d.ts.map +1 -1
  196. package/build/src/presets/eslint/index.js +1 -0
  197. package/build/src/presets/eslint/index.js.map +1 -1
  198. package/build/src/presets/tsconfig/fw-astro.json +15 -0
  199. package/build/src/rules/eslint/conventions/no-implicit-boolean.d.ts.map +1 -1
  200. package/build/src/rules/eslint/conventions/no-implicit-boolean.js +3 -2
  201. package/build/src/rules/eslint/conventions/no-implicit-boolean.js.map +1 -1
  202. package/build/src/rules/eslint/conventions/require-hash-private.js +1 -1
  203. package/build/src/rules/eslint/conventions/require-hash-private.js.map +1 -1
  204. package/build/src/rules/eslint/conventions/require-kebab-case-filename.d.ts.map +1 -1
  205. package/build/src/rules/eslint/conventions/require-kebab-case-filename.js +4 -1
  206. package/build/src/rules/eslint/conventions/require-kebab-case-filename.js.map +1 -1
  207. package/build/src/rules/eslint/conventions/require-node-protocol.d.ts +11 -0
  208. package/build/src/rules/eslint/conventions/require-node-protocol.d.ts.map +1 -0
  209. package/build/src/rules/eslint/conventions/require-node-protocol.js +76 -0
  210. package/build/src/rules/eslint/conventions/require-node-protocol.js.map +1 -0
  211. package/build/src/rules/eslint/formatting/no-raw-text-in-code.d.ts.map +1 -1
  212. package/build/src/rules/eslint/formatting/no-raw-text-in-code.js +2 -1
  213. package/build/src/rules/eslint/formatting/no-raw-text-in-code.js.map +1 -1
  214. package/build/src/rules/eslint/formatting/require-padding-lines.d.ts.map +1 -1
  215. package/build/src/rules/eslint/formatting/require-padding-lines.js +7 -3
  216. package/build/src/rules/eslint/formatting/require-padding-lines.js.map +1 -1
  217. package/build/src/rules/eslint/formatting/require-ternary-parens.d.ts.map +1 -1
  218. package/build/src/rules/eslint/formatting/require-ternary-parens.js +7 -17
  219. package/build/src/rules/eslint/formatting/require-ternary-parens.js.map +1 -1
  220. package/build/src/rules/eslint/index.d.ts +4 -0
  221. package/build/src/rules/eslint/index.d.ts.map +1 -1
  222. package/build/src/rules/eslint/index.js +4 -0
  223. package/build/src/rules/eslint/index.js.map +1 -1
  224. package/build/src/rules/eslint/jsdoc/require-jsdoc-body.d.ts +3 -2
  225. package/build/src/rules/eslint/jsdoc/require-jsdoc-body.d.ts.map +1 -1
  226. package/build/src/rules/eslint/jsdoc/require-jsdoc-body.js +22 -0
  227. package/build/src/rules/eslint/jsdoc/require-jsdoc-body.js.map +1 -1
  228. package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +2 -1
  229. package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts.map +1 -1
  230. package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js +19 -4
  231. package/build/src/rules/eslint/jsdoc/require-jsdoc-hierarchy.js.map +1 -1
  232. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.d.ts.map +1 -1
  233. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js +3 -2
  234. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-alignment.js.map +1 -1
  235. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.d.ts.map +1 -1
  236. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js +10 -6
  237. package/build/src/rules/eslint/jsdoc/require-jsdoc-param-name.js.map +1 -1
  238. package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.d.ts +12 -0
  239. package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.d.ts.map +1 -0
  240. package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.js +169 -0
  241. package/build/src/rules/eslint/jsdoc/require-jsdoc-presence.js.map +1 -0
  242. package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.d.ts +11 -0
  243. package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.d.ts.map +1 -0
  244. package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.js +80 -0
  245. package/build/src/rules/eslint/jsdoc/require-jsdoc-returns.js.map +1 -0
  246. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts +1 -1
  247. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.d.ts.map +1 -1
  248. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js +102 -6
  249. package/build/src/rules/eslint/jsdoc/require-jsdoc-since.js.map +1 -1
  250. package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.d.ts +15 -0
  251. package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.d.ts.map +1 -0
  252. package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.js +290 -0
  253. package/build/src/rules/eslint/jsdoc/require-jsdoc-tag-order.js.map +1 -0
  254. package/build/src/rules/eslint/patterns/no-await-in-loop.js +1 -1
  255. package/build/src/rules/eslint/patterns/no-await-in-loop.js.map +1 -1
  256. package/build/src/rules/eslint/patterns/no-bracket-method-call.d.ts.map +1 -1
  257. package/build/src/rules/eslint/patterns/no-bracket-method-call.js +4 -0
  258. package/build/src/rules/eslint/patterns/no-bracket-method-call.js.map +1 -1
  259. package/build/src/rules/eslint/regex/no-regex-literals.d.ts +1 -0
  260. package/build/src/rules/eslint/regex/no-regex-literals.d.ts.map +1 -1
  261. package/build/src/rules/eslint/regex/no-regex-literals.js +39 -1
  262. package/build/src/rules/eslint/regex/no-regex-literals.js.map +1 -1
  263. package/build/src/rules/eslint/typescript/no-inline-type-annotation.d.ts.map +1 -1
  264. package/build/src/rules/eslint/typescript/no-inline-type-annotation.js +4 -1
  265. package/build/src/rules/eslint/typescript/no-inline-type-annotation.js.map +1 -1
  266. package/build/src/rules/eslint/typescript/require-bracket-property-access.d.ts.map +1 -1
  267. package/build/src/rules/eslint/typescript/require-bracket-property-access.js +8 -1
  268. package/build/src/rules/eslint/typescript/require-bracket-property-access.js.map +1 -1
  269. package/build/src/rules/eslint/typescript/require-type-naming.js +2 -2
  270. package/build/src/rules/eslint/typescript/require-type-naming.js.map +1 -1
  271. package/build/src/rules/vitest/active-vitest.d.ts +5 -0
  272. package/build/src/rules/vitest/active-vitest.d.ts.map +1 -0
  273. package/build/src/rules/vitest/active-vitest.js +19 -0
  274. package/build/src/rules/vitest/active-vitest.js.map +1 -0
  275. package/build/src/rules/vitest/dotenv/register.d.ts +3 -0
  276. package/build/src/rules/vitest/dotenv/register.d.ts.map +1 -0
  277. package/build/src/rules/vitest/dotenv/register.js +22 -0
  278. package/build/src/rules/vitest/dotenv/register.js.map +1 -0
  279. package/build/src/rules/vitest/dotenv/rules.d.ts +3 -0
  280. package/build/src/rules/vitest/dotenv/rules.d.ts.map +1 -0
  281. package/build/src/rules/vitest/dotenv/rules.js +32 -0
  282. package/build/src/rules/vitest/dotenv/rules.js.map +1 -0
  283. package/build/src/rules/vitest/enable.d.ts +3 -0
  284. package/build/src/rules/vitest/enable.d.ts.map +1 -0
  285. package/build/src/rules/vitest/enable.js +7 -0
  286. package/build/src/rules/vitest/enable.js.map +1 -0
  287. package/build/src/rules/vitest/frontmatter/register.d.ts +3 -0
  288. package/build/src/rules/vitest/frontmatter/register.d.ts.map +1 -0
  289. package/build/src/rules/vitest/frontmatter/register.js +52 -0
  290. package/build/src/rules/vitest/frontmatter/register.js.map +1 -0
  291. package/build/src/rules/vitest/frontmatter/rules.d.ts +15 -0
  292. package/build/src/rules/vitest/frontmatter/rules.d.ts.map +1 -0
  293. package/build/src/rules/vitest/frontmatter/rules.js +498 -0
  294. package/build/src/rules/vitest/frontmatter/rules.js.map +1 -0
  295. package/build/src/rules/vitest/index.d.ts +8 -0
  296. package/build/src/rules/vitest/index.d.ts.map +1 -0
  297. package/build/src/rules/vitest/index.js +7 -0
  298. package/build/src/rules/vitest/index.js.map +1 -0
  299. package/build/src/rules/vitest/link/register.d.ts +3 -0
  300. package/build/src/rules/vitest/link/register.d.ts.map +1 -0
  301. package/build/src/rules/vitest/link/register.js +44 -0
  302. package/build/src/rules/vitest/link/register.js.map +1 -0
  303. package/build/src/rules/vitest/link/rules.d.ts +12 -0
  304. package/build/src/rules/vitest/link/rules.d.ts.map +1 -0
  305. package/build/src/rules/vitest/link/rules.js +313 -0
  306. package/build/src/rules/vitest/link/rules.js.map +1 -0
  307. package/build/src/rules/vitest/markdown-table/register.d.ts +3 -0
  308. package/build/src/rules/vitest/markdown-table/register.d.ts.map +1 -0
  309. package/build/src/rules/vitest/markdown-table/register.js +26 -0
  310. package/build/src/rules/vitest/markdown-table/register.js.map +1 -0
  311. package/build/src/rules/vitest/markdown-table/rules.d.ts +3 -0
  312. package/build/src/rules/vitest/markdown-table/rules.d.ts.map +1 -0
  313. package/build/src/rules/vitest/markdown-table/rules.js +99 -0
  314. package/build/src/rules/vitest/markdown-table/rules.js.map +1 -0
  315. package/build/src/rules/vitest/terminology/register.d.ts +3 -0
  316. package/build/src/rules/vitest/terminology/register.d.ts.map +1 -0
  317. package/build/src/rules/vitest/terminology/register.js +39 -0
  318. package/build/src/rules/vitest/terminology/register.js.map +1 -0
  319. package/build/src/rules/vitest/terminology/rules.d.ts +10 -0
  320. package/build/src/rules/vitest/terminology/rules.d.ts.map +1 -0
  321. package/build/src/rules/vitest/terminology/rules.js +202 -0
  322. package/build/src/rules/vitest/terminology/rules.js.map +1 -0
  323. package/build/src/rules/vitest/type-declarations/register.d.ts +3 -0
  324. package/build/src/rules/vitest/type-declarations/register.d.ts.map +1 -0
  325. package/build/src/rules/vitest/type-declarations/register.js +33 -0
  326. package/build/src/rules/vitest/type-declarations/register.js.map +1 -0
  327. package/build/src/rules/vitest/type-declarations/rules.d.ts +13 -0
  328. package/build/src/rules/vitest/type-declarations/rules.d.ts.map +1 -0
  329. package/build/src/rules/vitest/type-declarations/rules.js +736 -0
  330. package/build/src/rules/vitest/type-declarations/rules.js.map +1 -0
  331. package/build/src/toolkit/index.d.ts +1 -0
  332. package/build/src/toolkit/index.d.ts.map +1 -1
  333. package/build/src/toolkit/index.js +1 -0
  334. package/build/src/toolkit/index.js.map +1 -1
  335. package/build/src/toolkit/logger.d.ts.map +1 -1
  336. package/build/src/toolkit/logger.js +3 -1
  337. package/build/src/toolkit/logger.js.map +1 -1
  338. package/build/src/toolkit/markdown-table.js +1 -1
  339. package/build/src/toolkit/markdown-table.js.map +1 -1
  340. package/build/src/toolkit/nova-identity.d.ts +19 -0
  341. package/build/src/toolkit/nova-identity.d.ts.map +1 -0
  342. package/build/src/toolkit/nova-identity.js +141 -0
  343. package/build/src/toolkit/nova-identity.js.map +1 -0
  344. package/build/src/types/cli/generate/github/funding.d.ts +4 -4
  345. package/build/src/types/cli/generate/github/issue-template.d.ts +15 -35
  346. package/build/src/types/cli/generate/github/workflows-blueprint-validate.d.ts +351 -0
  347. package/build/src/types/cli/generate/github/workflows-blueprint-variables.d.ts +131 -0
  348. package/build/src/types/cli/generate/github/workflows-blueprint.d.ts +1180 -0
  349. package/build/src/types/cli/generate/must-haves/agent-conventions.d.ts +9 -2
  350. package/build/src/types/cli/generate/must-haves/dotenv.d.ts +101 -314
  351. package/build/src/types/cli/generate/must-haves/editorconfig.d.ts +2 -2
  352. package/build/src/types/cli/generate/must-haves/gitignore.d.ts +13 -343
  353. package/build/src/types/cli/generate/must-haves/license.d.ts +5 -5
  354. package/build/src/types/cli/generate/must-haves/read-me.d.ts +136 -88
  355. package/build/src/types/cli/index.d.ts +14 -0
  356. package/build/src/types/cli/recipe/github/handle-gh-failure.d.ts +2 -2
  357. package/build/src/types/cli/recipe/github/sync-features.d.ts +20 -13
  358. package/build/src/types/cli/recipe/github/sync-identity.d.ts +20 -13
  359. package/build/src/types/cli/recipe/github/sync-policies.d.ts +24 -15
  360. package/build/src/types/cli/recipe/index.d.ts +7 -3
  361. package/build/src/types/cli/recipe/license/update-copyright.d.ts +142 -0
  362. package/build/src/types/cli/recipe/package-json/cleanup.d.ts +26 -22
  363. package/build/src/types/cli/recipe/package-json/normalize-artifacts.d.ts +22 -16
  364. package/build/src/types/cli/recipe/package-json/normalize-bundler.d.ts +20 -14
  365. package/build/src/types/cli/recipe/package-json/normalize-dependencies.d.ts +31 -19
  366. package/build/src/types/cli/recipe/package-json/normalize-modules.d.ts +20 -14
  367. package/build/src/types/cli/recipe/package-json/normalize-tooling.d.ts +20 -14
  368. package/build/src/types/cli/recipe/package-json/sync-environment.d.ts +46 -22
  369. package/build/src/types/cli/recipe/package-json/sync-identity.d.ts +36 -19
  370. package/build/src/types/cli/recipe/package-json/sync-ownership.d.ts +33 -23
  371. package/build/src/types/cli/recipe/read-me/update-badges.d.ts +77 -0
  372. package/build/src/types/cli/recipe/read-me/update-credits.d.ts +77 -0
  373. package/build/src/types/cli/recipe/read-me/update-documentation.d.ts +77 -0
  374. package/build/src/types/cli/recipe/read-me/update-header.d.ts +77 -0
  375. package/build/src/types/cli/recipe/read-me/update-introduction.d.ts +77 -0
  376. package/build/src/types/cli/scaffold/starter/base.d.ts +2 -2
  377. package/build/src/types/cli/utility/changelog.d.ts +165 -73
  378. package/build/src/types/cli/utility/initialize.d.ts +1007 -350
  379. package/build/src/types/cli/utility/run-scripts.d.ts +1 -1
  380. package/build/src/types/cli/utility/transpile.d.ts +8 -3
  381. package/build/src/types/cli/utility/type-check.d.ts +9 -3
  382. package/build/src/types/cli/utility/version.d.ts +32 -32
  383. package/build/src/types/lib/constants.d.ts +1 -1
  384. package/build/src/types/lib/dotenv.d.ts +67 -0
  385. package/build/src/types/lib/env-github.d.ts +67 -0
  386. package/build/src/types/lib/env-managed-set.d.ts +90 -0
  387. package/build/src/types/lib/env-namespace.d.ts +22 -0
  388. package/build/src/types/lib/env-reconcile.d.ts +71 -0
  389. package/build/src/types/lib/env-status.d.ts +102 -0
  390. package/build/src/types/lib/file-discovery.d.ts +40 -0
  391. package/build/src/types/lib/item.d.ts +42 -0
  392. package/build/src/types/lib/markdown-slug.d.ts +25 -0
  393. package/build/src/types/lib/nova-config.d.ts +455 -68
  394. package/build/src/types/lib/read-me-regions.d.ts +51 -0
  395. package/build/src/types/lib/regex.d.ts +193 -18
  396. package/build/src/types/lib/scaffold.d.ts +43 -23
  397. package/build/src/types/lib/type-declaration-engine.d.ts +1052 -0
  398. package/build/src/types/lib/utility.d.ts +40 -6
  399. package/build/src/types/lib/workflow-templates.d.ts +11 -75
  400. package/build/src/types/presets/eslint/fw-astro.d.ts +8 -0
  401. package/build/src/types/rules/eslint/conventions/no-implicit-boolean.d.ts +7 -0
  402. package/build/src/types/rules/eslint/conventions/require-naming-convention.d.ts +8 -4
  403. package/build/src/types/rules/eslint/conventions/require-node-protocol.d.ts +56 -0
  404. package/build/src/types/rules/eslint/formatting/require-padding-lines.d.ts +2 -0
  405. package/build/src/types/rules/eslint/formatting/require-ternary-parens.d.ts +8 -3
  406. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-body.d.ts +16 -0
  407. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-hierarchy.d.ts +19 -15
  408. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-param-name.d.ts +3 -1
  409. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-presence.d.ts +125 -0
  410. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-returns.d.ts +48 -0
  411. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-since.d.ts +71 -1
  412. package/build/src/types/rules/eslint/jsdoc/require-jsdoc-tag-order.d.ts +204 -0
  413. package/build/src/types/rules/eslint/patterns/no-await-in-loop.d.ts +1 -1
  414. package/build/src/types/rules/eslint/patterns/no-bracket-method-call.d.ts +1 -1
  415. package/build/src/types/rules/eslint/regex/no-regex-literals.d.ts +44 -0
  416. package/build/src/types/rules/eslint/typescript/require-bracket-property-access.d.ts +19 -7
  417. package/build/src/types/rules/eslint/typescript/require-type-naming.d.ts +3 -3
  418. package/build/src/types/rules/vitest/active-vitest.d.ts +31 -0
  419. package/build/src/types/rules/vitest/dotenv/register.d.ts +31 -0
  420. package/build/src/types/rules/vitest/dotenv/rules.d.ts +29 -0
  421. package/build/src/types/rules/vitest/enable.d.ts +12 -0
  422. package/build/src/types/rules/vitest/frontmatter/register.d.ts +63 -0
  423. package/build/src/types/rules/vitest/frontmatter/rules.d.ts +430 -0
  424. package/build/src/types/rules/vitest/index.d.ts +419 -0
  425. package/build/src/types/rules/vitest/link/register.d.ts +79 -0
  426. package/build/src/types/rules/vitest/link/rules.d.ts +368 -0
  427. package/build/src/types/rules/vitest/markdown-table/register.d.ts +33 -0
  428. package/build/src/types/rules/vitest/markdown-table/rules.d.ts +55 -0
  429. package/build/src/types/rules/vitest/terminology/register.d.ts +48 -0
  430. package/build/src/types/rules/vitest/terminology/rules.d.ts +190 -0
  431. package/build/src/types/rules/vitest/type-declarations/register.d.ts +46 -0
  432. package/build/src/types/rules/vitest/type-declarations/rules.d.ts +894 -0
  433. package/build/src/types/shared.d.ts +727 -26
  434. package/build/src/types/tests/cli/generate/github/funding.test.d.ts +14 -10
  435. package/build/src/types/tests/cli/generate/github/issue-template.test.d.ts +38 -17
  436. package/build/src/types/tests/cli/generate/github/workflows-blueprint-generate.test.d.ts +199 -0
  437. package/build/src/types/tests/cli/generate/github/workflows-blueprint-parity.test.d.ts +75 -0
  438. package/build/src/types/tests/cli/generate/github/workflows-blueprint-publish-parity.test.d.ts +295 -0
  439. package/build/src/types/tests/cli/generate/github/workflows-blueprint-validate.test.d.ts +901 -0
  440. package/build/src/types/tests/cli/generate/github/workflows-blueprint-variables.test.d.ts +144 -0
  441. package/build/src/types/tests/cli/generate/github/workflows-blueprint.test.d.ts +332 -0
  442. package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +83 -11
  443. package/build/src/types/tests/cli/generate/must-haves/dotenv.test.d.ts +142 -12
  444. package/build/src/types/tests/cli/generate/must-haves/editorconfig.test.d.ts +12 -8
  445. package/build/src/types/tests/cli/generate/must-haves/gitignore.test.d.ts +14 -19
  446. package/build/src/types/tests/cli/generate/must-haves/read-me.test.d.ts +33 -10
  447. package/build/src/types/tests/cli/recipe/github/handle-gh-failure.test.d.ts +28 -24
  448. package/build/src/types/tests/cli/recipe/github/sync-features.test.d.ts +115 -111
  449. package/build/src/types/tests/cli/recipe/github/sync-identity.test.d.ts +192 -142
  450. package/build/src/types/tests/cli/recipe/github/sync-policies.test.d.ts +199 -126
  451. package/build/src/types/tests/cli/recipe/license/update-copyright.test.d.ts +617 -0
  452. package/build/src/types/tests/cli/recipe/package-json/normalize-dependencies.test.d.ts +27 -0
  453. package/build/src/types/tests/cli/recipe/package-json/sync-environment.test.d.ts +21 -0
  454. package/build/src/types/tests/cli/recipe/package-json/sync-identity.test.d.ts +52 -0
  455. package/build/src/types/tests/cli/recipe/read-me/update-badges.test.d.ts +258 -0
  456. package/build/src/types/tests/cli/recipe/read-me/update-credits.test.d.ts +258 -0
  457. package/build/src/types/tests/cli/recipe/read-me/update-documentation.test.d.ts +258 -0
  458. package/build/src/types/tests/cli/recipe/read-me/update-header.test.d.ts +258 -0
  459. package/build/src/types/tests/cli/recipe/read-me/update-introduction.test.d.ts +258 -0
  460. package/build/src/types/tests/cli/scaffold/docs/docusaurus.test.d.ts +4 -0
  461. package/build/src/types/tests/cli/utility/changelog.test.d.ts +293 -0
  462. package/build/src/types/tests/cli/utility/initialize.test.d.ts +148 -1
  463. package/build/src/types/tests/lib/dotenv.test.d.ts +95 -0
  464. package/build/src/types/tests/lib/file-discovery.test.d.ts +37 -0
  465. package/build/src/types/tests/lib/item.test.d.ts +21 -0
  466. package/build/src/types/tests/lib/markdown-slug.test.d.ts +24 -0
  467. package/build/src/types/tests/lib/nova-config.test.d.ts +503 -83
  468. package/build/src/types/tests/lib/read-me-regions.test.d.ts +43 -0
  469. package/build/src/types/tests/lib/regex.test.d.ts +252 -0
  470. package/build/src/types/tests/lib/utility.test.d.ts +35 -0
  471. package/build/src/types/tests/lib/workflow-templates.test.d.ts +18 -2
  472. package/build/src/types/tests/rules/eslint/conventions/require-node-protocol.test.d.ts +8 -0
  473. package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-presence.test.d.ts +8 -0
  474. package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-returns.test.d.ts +8 -0
  475. package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-since.test.d.ts +18 -0
  476. package/build/src/types/tests/rules/eslint/jsdoc/require-jsdoc-tag-order.test.d.ts +8 -0
  477. package/build/src/types/tests/rules/vitest/active-vitest.test.d.ts +56 -0
  478. package/build/src/types/tests/rules/vitest/dotenv.test.d.ts +19 -0
  479. package/build/src/types/tests/rules/vitest/enable.test.d.ts +27 -0
  480. package/build/src/types/tests/rules/vitest/frontmatter.test.d.ts +22 -0
  481. package/build/src/types/tests/rules/vitest/link.test.d.ts +74 -0
  482. package/build/src/types/tests/rules/vitest/markdown-table.test.d.ts +28 -0
  483. package/build/src/types/tests/rules/vitest/terminology.test.d.ts +43 -0
  484. package/build/src/types/tests/rules/vitest/type-declarations.test.d.ts +10 -0
  485. package/build/src/types/tests/scaffold-version-drift.test.d.ts +42 -0
  486. package/build/src/types/tests/since-version.test.d.ts +137 -0
  487. package/build/src/types/tests/toolkit/logger.test.d.ts +70 -5
  488. package/build/src/types/tests/toolkit/nova-identity.test.d.ts +118 -0
  489. package/build/src/types/tests/type-declarations.test.d.ts +40 -1813
  490. package/build/src/types/toolkit/logger.d.ts +4 -0
  491. package/build/src/types/toolkit/nova-identity.d.ts +313 -0
  492. package/build/templates/generators/github/workflows/check-sponsor-gated-issues/base.yml +1 -1
  493. package/build/templates/generators/github/workflows/publish/base.yml +3 -1
  494. package/build/templates/generators/github/workflows/publish/targets/cloudflare-pages-docusaurus.yml +1 -1
  495. package/build/templates/generators/github/workflows/publish/targets/cloudflare-workers.yml +36 -0
  496. package/build/templates/generators/github/workflows/publish/targets/docker-hub.yml +1 -1
  497. package/build/templates/generators/github/workflows/publish/targets/ghcr.yml +1 -1
  498. package/build/templates/generators/github/workflows/publish/targets/github-action.yml +1 -1
  499. package/build/templates/generators/github/workflows/publish/targets/github-packages.yml +1 -1
  500. package/build/templates/generators/github/workflows/publish/targets/github-pages-docusaurus.yml +4 -4
  501. package/build/templates/generators/github/workflows/publish/targets/npm.yml +1 -1
  502. package/build/templates/generators/github/workflows/publish/targets/vercel-nextjs.yml +1 -1
  503. package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +1 -2
  504. package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +1 -2
  505. package/build/templates/generators/must-haves/agent-conventions/conventions/java.md +5 -5
  506. package/build/templates/generators/must-haves/agent-conventions/conventions/kotlin.md +4 -4
  507. package/build/templates/generators/must-haves/agent-conventions/conventions/php.md +2 -2
  508. package/build/templates/generators/must-haves/agent-conventions/conventions/typescript.md +6 -6
  509. package/build/templates/generators/must-haves/agent-conventions/conventions/universal.md +2 -0
  510. package/build/templates/generators/must-haves/dotenv/env +5 -2
  511. package/build/templates/generators/must-haves/dotenv/env.sample +6 -3
  512. package/build/templates/generators/must-haves/gitignore/gitignore +6 -0
  513. package/build/templates/scaffold/app/express/package.json +5 -5
  514. package/build/templates/scaffold/app/nextjs/package.json +7 -7
  515. package/build/templates/scaffold/app/vite/package.json +3 -3
  516. package/build/templates/scaffold/app/workers/package.json +3 -3
  517. package/build/templates/scaffold/docs/docusaurus/docs/intro.md +6 -0
  518. package/build/templates/scaffold/docs/docusaurus/docusaurus.config.ts +9 -3
  519. package/build/templates/scaffold/docs/docusaurus/package.json +14 -7
  520. package/build/templates/scaffold/docs/docusaurus/src/tests/frontmatter.test.ts +25 -0
  521. package/build/templates/scaffold/docs/docusaurus/src/tests/link.test.ts +16 -0
  522. package/build/templates/scaffold/docs/docusaurus/src/tests/markdown-table.test.ts +16 -0
  523. package/build/templates/scaffold/docs/docusaurus/src/tests/terminology.test.ts +16 -0
  524. package/build/templates/scaffold/docs/docusaurus/src/tests/type-declarations.test.ts +17 -0
  525. package/build/templates/scaffold/docs/docusaurus/vitest.config.ts +22 -0
  526. package/build/templates/scaffold/docs/docusaurus/vitest.setup.ts +26 -0
  527. package/package.json +14 -10
  528. package/build/src/cli/generate/github/workflows.d.ts +0 -17
  529. package/build/src/cli/generate/github/workflows.d.ts.map +0 -1
  530. package/build/src/cli/generate/github/workflows.js +0 -856
  531. package/build/src/cli/generate/github/workflows.js.map +0 -1
  532. package/build/src/types/cli/generate/github/workflows.d.ts +0 -596
  533. package/build/src/types/tests/cli/generate/github/workflows-helpers.test.d.ts +0 -239
  534. package/build/src/types/tests/cli/generate/github/workflows.test.d.ts +0 -587
  535. package/build/templates/generators/github/workflows/publish/targets/aws-amplify-nextjs.yml +0 -32
  536. package/build/templates/generators/must-haves/agent-conventions/cursorrules +0 -55
@@ -1,10 +1,15 @@
1
- import { promises as fs } from 'fs';
2
- import { join, relative, sep } from 'path';
1
+ import { promises as fs } from 'node:fs';
2
+ import { join, relative, sep } from 'node:path';
3
3
  import chalk from 'chalk';
4
4
  import prompts from 'prompts';
5
- import { libItemAllowedPoliciesByRole, libItemAllowedRecipes, libItemSyncRoles, libItemValidEntityRoles, } from '../../lib/item.js';
5
+ import { libEnvGithub } from '../../lib/env-github.js';
6
+ import { libEnvManagedSet } from '../../lib/env-managed-set.js';
7
+ import { libEnvNamespace } from '../../lib/env-namespace.js';
8
+ import { libEnvReconcile } from '../../lib/env-reconcile.js';
9
+ import { libEnvStatus } from '../../lib/env-status.js';
10
+ import { libItemAllowedAgents, libItemAllowedPoliciesByRole, libItemAllowedRecipes, libItemSyncRoles, libItemValidEntityRoles, } from '../../lib/item.js';
6
11
  import { Runner as LibNovaConfig } from '../../lib/nova-config.js';
7
- import { LIB_REGEX_PATTERN_EMAIL_SIMPLE, LIB_REGEX_PATTERN_SLUG_SCOPED, LIB_REGEX_PATTERN_SLUG_SIMPLE, LIB_REGEX_PATTERN_YML_EXTENSION, } from '../../lib/regex.js';
12
+ import { LIB_REGEX_LINEBREAK_CRLF_OR_LF, LIB_REGEX_PATTERN_EMAIL_SIMPLE, LIB_REGEX_PATTERN_ENV_VAR_KEY, LIB_REGEX_PATTERN_SLUG_SCOPED, LIB_REGEX_PATTERN_SLUG_SIMPLE, LIB_REGEX_PATTERN_YML_EXTENSION, } from '../../lib/regex.js';
8
13
  import { discoverPathsWithFile, pathExists, resolveTemplatePath } from '../../lib/utility.js';
9
14
  import { libWorkflowTemplatesMetadata } from '../../lib/workflow-templates.js';
10
15
  import { Logger } from '../../toolkit/index.js';
@@ -33,6 +38,10 @@ export class Runner {
33
38
  }
34
39
  const novaConfig = new LibNovaConfig();
35
40
  const workingFile = await novaConfig.load();
41
+ if (options['status'] === true) {
42
+ await Runner.promptEnvironmentReconcile(workingFile, false);
43
+ return;
44
+ }
36
45
  const promptFlowResult = await Runner.promptFlow(workingFile);
37
46
  if (promptFlowResult === 'cancel') {
38
47
  Logger.customize({
@@ -95,6 +104,21 @@ export class Runner {
95
104
  description: 'Review workspace packages, assigning roles and policies.',
96
105
  handler: Runner['promptWorkspaces'],
97
106
  },
107
+ gitignore: {
108
+ label: 'Ignores',
109
+ description: 'Manage project-specific .gitignore excludes.',
110
+ handler: Runner['promptGitignore'],
111
+ },
112
+ agents: {
113
+ label: 'AI Tools',
114
+ description: 'Select the AI tools (Claude Code, Codex) to generate conventions for.',
115
+ handler: Runner['promptAgents'],
116
+ },
117
+ environment: {
118
+ label: 'Environment',
119
+ description: 'Manage environment variables and secrets, prefixes, and GitHub provisioning.',
120
+ handler: Runner['promptEnvironment'],
121
+ },
98
122
  };
99
123
  while (true) {
100
124
  const categoryKeys = Object.keys(category);
@@ -888,10 +912,10 @@ export class Runner {
888
912
  }
889
913
  const repoOutputResult = repoOutput['result'];
890
914
  const githubRepoInput = repoOutputResult.githubRepo.trim();
891
- const existingRecipes = github['recipes'];
892
- const syncIdentityInitial = (existingRecipes !== undefined && existingRecipes['sync-identity'] !== undefined) ? existingRecipes['sync-identity'] : true;
893
- const syncFeaturesInitial = (existingRecipes !== undefined && existingRecipes['sync-features'] !== undefined) ? existingRecipes['sync-features'] : false;
894
- const syncPoliciesInitial = (existingRecipes !== undefined && existingRecipes['sync-policies'] !== undefined) ? existingRecipes['sync-policies'] : false;
915
+ const existingRecipes = (config['recipes'] !== undefined) ? config['recipes']['github'] : undefined;
916
+ const syncIdentityInitial = (existingRecipes !== undefined && existingRecipes['sync-identity'] !== undefined) ? existingRecipes['sync-identity']['enabled'] : true;
917
+ const syncFeaturesInitial = (existingRecipes !== undefined && existingRecipes['sync-features'] !== undefined) ? existingRecipes['sync-features']['enabled'] : false;
918
+ const syncPoliciesInitial = (existingRecipes !== undefined && existingRecipes['sync-policies'] !== undefined) ? existingRecipes['sync-policies']['enabled'] : false;
895
919
  const recipesOutput = await Runner.promptWithCancel([
896
920
  {
897
921
  type: 'confirm',
@@ -917,9 +941,15 @@ export class Runner {
917
941
  }
918
942
  const recipesOutputResult = recipesOutput['result'];
919
943
  const githubRecipesInput = {
920
- 'sync-identity': recipesOutputResult.githubRecipeSyncIdentity,
921
- 'sync-features': recipesOutputResult.githubRecipeSyncFeatures,
922
- 'sync-policies': recipesOutputResult.githubRecipeSyncPolicies,
944
+ 'sync-identity': {
945
+ enabled: recipesOutputResult.githubRecipeSyncIdentity,
946
+ },
947
+ 'sync-features': {
948
+ enabled: recipesOutputResult.githubRecipeSyncFeatures,
949
+ },
950
+ 'sync-policies': {
951
+ enabled: recipesOutputResult.githubRecipeSyncPolicies,
952
+ },
923
953
  };
924
954
  const existingTopics = github['topics'];
925
955
  const topicsHasExisting = (existingTopics !== undefined) && existingTopics.length > 0;
@@ -1293,19 +1323,97 @@ export class Runner {
1293
1323
  githubPoliciesInput = {
1294
1324
  ...((githubPoliciesVisibilityValue !== 'skip') ? { visibility: githubPoliciesVisibilityValue } : {}),
1295
1325
  ...((githubPoliciesDefaultBranchValue !== 'skip') ? { defaultBranch: githubPoliciesDefaultBranchValue } : {}),
1296
- ...(githubPoliciesMergeMethodsInput !== undefined ? { mergeMethods: githubPoliciesMergeMethodsInput } : {}),
1326
+ ...((githubPoliciesMergeMethodsInput !== undefined) ? { mergeMethods: githubPoliciesMergeMethodsInput } : {}),
1297
1327
  ...((githubPoliciesAutoDeleteValue !== 'skip') ? { autoDeleteHeadBranch: githubPoliciesAutoDeleteValue } : {}),
1298
1328
  };
1299
1329
  }
1330
+ const existingGithubForIssueTemplate = (config['github'] !== undefined) ? config['github']['issueTemplate'] : undefined;
1331
+ const existingBugReportFields = (existingGithubForIssueTemplate !== undefined) ? (existingGithubForIssueTemplate['bugReportFields'] ?? []) : [];
1332
+ const issueTemplateOutput = await Runner.promptWithCancel({
1333
+ type: 'multiselect',
1334
+ name: 'bugReportFields',
1335
+ message: 'Issue-template bug-report fields (space to select)',
1336
+ choices: [
1337
+ {
1338
+ title: 'Node.js',
1339
+ value: 'nodejs.yml',
1340
+ selected: existingBugReportFields.includes('nodejs.yml'),
1341
+ },
1342
+ {
1343
+ title: 'Apple',
1344
+ value: 'apple.yml',
1345
+ selected: existingBugReportFields.includes('apple.yml'),
1346
+ },
1347
+ {
1348
+ title: 'Android',
1349
+ value: 'android.yml',
1350
+ selected: existingBugReportFields.includes('android.yml'),
1351
+ },
1352
+ {
1353
+ title: 'C# / .NET',
1354
+ value: 'csharp.yml',
1355
+ selected: existingBugReportFields.includes('csharp.yml'),
1356
+ },
1357
+ {
1358
+ title: 'PHP',
1359
+ value: 'php.yml',
1360
+ selected: existingBugReportFields.includes('php.yml'),
1361
+ },
1362
+ {
1363
+ title: 'Python',
1364
+ value: 'python.yml',
1365
+ selected: existingBugReportFields.includes('python.yml'),
1366
+ },
1367
+ {
1368
+ title: 'Homebridge',
1369
+ value: 'homebridge.yml',
1370
+ selected: existingBugReportFields.includes('homebridge.yml'),
1371
+ },
1372
+ {
1373
+ title: 'pfSense',
1374
+ value: 'pfsense.yml',
1375
+ selected: existingBugReportFields.includes('pfsense.yml'),
1376
+ },
1377
+ {
1378
+ title: 'Synology',
1379
+ value: 'synology.yml',
1380
+ selected: existingBugReportFields.includes('synology.yml'),
1381
+ },
1382
+ {
1383
+ title: 'Docker',
1384
+ value: 'docker.yml',
1385
+ selected: existingBugReportFields.includes('docker.yml'),
1386
+ },
1387
+ {
1388
+ title: 'Web Browser',
1389
+ value: 'web.yml',
1390
+ selected: existingBugReportFields.includes('web.yml'),
1391
+ },
1392
+ {
1393
+ title: 'Screenshots',
1394
+ value: 'screenshots.yml',
1395
+ selected: existingBugReportFields.includes('screenshots.yml'),
1396
+ },
1397
+ ],
1398
+ hint: '- Space to select. Return to submit',
1399
+ });
1400
+ if (issueTemplateOutput['cancelled'] === true) {
1401
+ return 'back';
1402
+ }
1403
+ const bugReportFields = issueTemplateOutput['result'].bugReportFields ?? [];
1404
+ const issueTemplateInput = (bugReportFields.length > 0) ? { bugReportFields } : undefined;
1300
1405
  const githubConfig = {
1301
1406
  owner: githubOwnerInput,
1302
1407
  repo: githubRepoInput,
1303
- recipes: githubRecipesInput,
1304
- ...(githubTopicsInput !== undefined ? { topics: githubTopicsInput } : {}),
1305
- ...(githubFeaturesInput !== undefined ? { features: githubFeaturesInput } : {}),
1306
- ...(githubPoliciesInput !== undefined ? { policies: githubPoliciesInput } : {}),
1408
+ ...((githubTopicsInput !== undefined) ? { topics: githubTopicsInput } : {}),
1409
+ ...((githubFeaturesInput !== undefined) ? { features: githubFeaturesInput } : {}),
1410
+ ...((githubPoliciesInput !== undefined) ? { policies: githubPoliciesInput } : {}),
1411
+ ...((issueTemplateInput !== undefined) ? { issueTemplate: issueTemplateInput } : {}),
1307
1412
  };
1308
1413
  Object.assign(config, { github: githubConfig });
1414
+ const recipesConfig = (config['recipes'] !== undefined) ? { ...(config['recipes']) } : {};
1415
+ recipesConfig.github = githubRecipesInput;
1416
+ Object.assign(config, { recipes: recipesConfig });
1309
1417
  Logger.customize({
1310
1418
  name: 'Runner.promptGithub',
1311
1419
  purpose: 'updated',
@@ -1527,16 +1635,17 @@ export class Runner {
1527
1635
  static async promptWorkflows(config) {
1528
1636
  const workflows = [];
1529
1637
  if (Array.isArray(config['workflows']) === true) {
1530
- for (const configWorkflow of config['workflows']) {
1638
+ const configWorkflows = config['workflows'];
1639
+ for (const configWorkflow of configWorkflows) {
1531
1640
  const clonedWorkflow = { ...configWorkflow };
1532
1641
  if (Array.isArray(configWorkflow['triggers']) === true) {
1533
1642
  clonedWorkflow.triggers = [...configWorkflow['triggers']];
1534
1643
  }
1535
- if (configWorkflow['settings'] !== undefined) {
1536
- clonedWorkflow.settings = { ...configWorkflow['settings'] };
1644
+ if (configWorkflow['with'] !== undefined) {
1645
+ clonedWorkflow.with = { ...configWorkflow['with'] };
1537
1646
  }
1538
1647
  else {
1539
- Reflect.deleteProperty(clonedWorkflow, 'settings');
1648
+ Reflect.deleteProperty(clonedWorkflow, 'with');
1540
1649
  }
1541
1650
  workflows.push(clonedWorkflow);
1542
1651
  }
@@ -1548,17 +1657,11 @@ export class Runner {
1548
1657
  if (Array.isArray(workflow['triggers']) === true && workflow['triggers'].length > 0) {
1549
1658
  normalizedWorkflow.triggers = [...workflow['triggers']];
1550
1659
  }
1551
- if (Array.isArray(workflow['depends-on']) === true && workflow['depends-on'].length > 0) {
1552
- Reflect.set(normalizedWorkflow, 'depends-on', [...workflow['depends-on']]);
1553
- }
1554
- else {
1555
- Reflect.deleteProperty(normalizedWorkflow, 'depends-on');
1556
- }
1557
- if (workflow['settings'] !== undefined && Object.keys(workflow['settings']).length > 0) {
1558
- normalizedWorkflow.settings = { ...workflow['settings'] };
1660
+ if (workflow['with'] !== undefined && Object.keys(workflow['with']).length > 0) {
1661
+ normalizedWorkflow.with = { ...workflow['with'] };
1559
1662
  }
1560
1663
  else {
1561
- Reflect.deleteProperty(normalizedWorkflow, 'settings');
1664
+ Reflect.deleteProperty(normalizedWorkflow, 'with');
1562
1665
  }
1563
1666
  return normalizedWorkflow;
1564
1667
  });
@@ -1577,8 +1680,8 @@ export class Runner {
1577
1680
  if (templateCompare !== 0) {
1578
1681
  return templateCompare;
1579
1682
  }
1580
- const suffixA = (a !== undefined && typeof a['suffix'] === 'string') ? a['suffix'] : '';
1581
- const suffixB = (b !== undefined && typeof b['suffix'] === 'string') ? b['suffix'] : '';
1683
+ const suffixA = (a !== undefined && typeof a['name'] === 'string') ? a['name'] : '';
1684
+ const suffixB = (b !== undefined && typeof b['name'] === 'string') ? b['name'] : '';
1582
1685
  return suffixA.localeCompare(suffixB);
1583
1686
  });
1584
1687
  const choices = [];
@@ -1588,8 +1691,9 @@ export class Runner {
1588
1691
  continue;
1589
1692
  }
1590
1693
  const template = (typeof workflow['template'] === 'string') ? workflow['template'].trim() : '';
1591
- const suffix = (typeof workflow['suffix'] === 'string') ? workflow['suffix'].trim() : '';
1694
+ const suffix = (typeof workflow['name'] === 'string') ? workflow['name'].trim() : '';
1592
1695
  const triggers = (Array.isArray(workflow['triggers']) === true) ? workflow['triggers'] : [];
1696
+ const triggerNames = triggers.map((trigger) => (typeof trigger === 'string') ? trigger : trigger['name']);
1593
1697
  let label = `Workflow ${i + 1}`;
1594
1698
  if (template !== '' && suffix !== '') {
1595
1699
  label = `${template}-${suffix}`;
@@ -1597,7 +1701,7 @@ export class Runner {
1597
1701
  else if (template !== '') {
1598
1702
  label = template;
1599
1703
  }
1600
- const triggersLabel = (triggers.length > 0) ? ` [${triggers.join(', ')}]` : '';
1704
+ const triggersLabel = (triggerNames.length > 0) ? ` [${triggerNames.join(', ')}]` : '';
1601
1705
  const outputFileName = (suffix !== '') ? `nova-${template}-${suffix}.yml` : `nova-${template}.yml`;
1602
1706
  const description = (template !== '') ? `${outputFileName}${triggersLabel}` : 'Update this workflow.';
1603
1707
  choices.push({
@@ -1691,7 +1795,7 @@ export class Runner {
1691
1795
  continue;
1692
1796
  }
1693
1797
  const removeTemplate = (typeof workflowToRemove['template'] === 'string') ? workflowToRemove['template'].trim() : '';
1694
- const removeSuffix = (typeof workflowToRemove['suffix'] === 'string') ? workflowToRemove['suffix'].trim() : '';
1798
+ const removeSuffix = (typeof workflowToRemove['name'] === 'string') ? workflowToRemove['name'].trim() : '';
1695
1799
  let workflowLabel = `Workflow ${removeWorkflowIndex + 1}`;
1696
1800
  if (removeTemplate !== '' && removeSuffix !== '') {
1697
1801
  workflowLabel = `${removeTemplate}-${removeSuffix}`;
@@ -1716,11 +1820,21 @@ export class Runner {
1716
1820
  }
1717
1821
  static async promptWorkflowsForm(workflow, mode, workflows, config) {
1718
1822
  const existingTemplate = (workflow !== undefined && typeof workflow['template'] === 'string') ? workflow['template'] : '';
1719
- const existingSuffix = (workflow !== undefined && typeof workflow['suffix'] === 'string') ? workflow['suffix'] : '';
1823
+ const existingSuffix = (workflow !== undefined && typeof workflow['name'] === 'string') ? workflow['name'] : '';
1720
1824
  const existingTriggers = (workflow !== undefined && Array.isArray(workflow['triggers']) === true) ? workflow['triggers'] : [];
1721
- const existingDependsOn = (workflow !== undefined && Array.isArray(workflow['depends-on']) === true) ? workflow['depends-on'] : [];
1722
- const existingTargets = (workflow !== undefined && Array.isArray(workflow['targets']) === true) ? workflow['targets'] : [];
1723
- const existingScopes = (workflow !== undefined && Array.isArray(workflow['scopes']) === true) ? workflow['scopes'] : [];
1825
+ const existingTriggerNames = existingTriggers.map((trigger) => (typeof trigger === 'string') ? trigger : trigger['name']);
1826
+ const existingDependsOn = [];
1827
+ for (const trigger of existingTriggers) {
1828
+ if (typeof trigger !== 'string' && Array.isArray(trigger['workflows']) === true) {
1829
+ for (const upstream of trigger['workflows']) {
1830
+ if (existingDependsOn.includes(upstream) === false) {
1831
+ existingDependsOn.push(upstream);
1832
+ }
1833
+ }
1834
+ }
1835
+ }
1836
+ const existingTargets = (workflow !== undefined && Array.isArray(workflow['deploy']) === true) ? workflow['deploy'] : [];
1837
+ const existingScopes = (workflow !== undefined && Array.isArray(workflow['build']) === true) ? workflow['build'] : [];
1724
1838
  const templateChoices = libWorkflowTemplatesMetadata.map((entry) => ({
1725
1839
  title: entry['name'],
1726
1840
  description: entry['description'],
@@ -1750,12 +1864,12 @@ export class Runner {
1750
1864
  const suffixOutput = await Runner.promptWithCancel({
1751
1865
  type: 'text',
1752
1866
  name: 'suffix',
1753
- message: 'Workflow suffix (used in filename and workflow name)',
1867
+ message: 'Workflow name (used in filename and workflow name)',
1754
1868
  initial: existingSuffix,
1755
1869
  validate: (value) => {
1756
1870
  const trimmed = (typeof value === 'string') ? value.trim() : '';
1757
1871
  if (trimmed === '') {
1758
- return 'Suffix is required.';
1872
+ return 'Name is required.';
1759
1873
  }
1760
1874
  const compositeKey = `${selectedTemplate}-${trimmed}`;
1761
1875
  const editIndex = (workflow !== undefined) ? workflows.indexOf(workflow) : -1;
@@ -1763,11 +1877,11 @@ export class Runner {
1763
1877
  if (i === editIndex) {
1764
1878
  return false;
1765
1879
  }
1766
- const existingKey = `${w['template']}-${w['suffix'] ?? ''}`;
1880
+ const existingKey = `${w['template']}-${w['name'] ?? ''}`;
1767
1881
  return existingKey === compositeKey;
1768
1882
  });
1769
1883
  if (isDuplicate === true) {
1770
- return 'A workflow with this template and suffix already exists.';
1884
+ return 'A workflow with this template and name already exists.';
1771
1885
  }
1772
1886
  return true;
1773
1887
  },
@@ -1789,7 +1903,7 @@ export class Runner {
1789
1903
  return {
1790
1904
  title: triggerName,
1791
1905
  value: triggerName,
1792
- selected: existingTriggers.includes(triggerName),
1906
+ selected: existingTriggerNames.includes(triggerName),
1793
1907
  };
1794
1908
  });
1795
1909
  const triggersOutput = await Runner.promptWithCancel({
@@ -1825,7 +1939,7 @@ export class Runner {
1825
1939
  && typeof w['template'] === 'string'
1826
1940
  && w['template'].trim() !== '')
1827
1941
  .map((w) => {
1828
- const dependsOnKey = (typeof w['suffix'] === 'string' && w['suffix'].trim() !== '') ? `${w['template']}-${w['suffix']}` : w['template'];
1942
+ const dependsOnKey = (typeof w['name'] === 'string' && w['name'].trim() !== '') ? `${w['template']}-${w['name']}` : w['template'];
1829
1943
  return {
1830
1944
  title: dependsOnKey,
1831
1945
  value: dependsOnKey,
@@ -1852,8 +1966,7 @@ export class Runner {
1852
1966
  const workspaceKeys = Object.keys(config['workspaces'] ?? {});
1853
1967
  const selectedTargets = [...existingTargets];
1854
1968
  if (matchedMetadata !== undefined && matchedMetadata['supportsTargets'] === true) {
1855
- const targetsMetadata = matchedMetadata['targets'] ?? {};
1856
- const availableTargetTypes = Object.keys(targetsMetadata);
1969
+ const availableTargetTypes = Object.keys(matchedMetadata['targets'] ?? {});
1857
1970
  while (true) {
1858
1971
  const targetMenuChoices = [];
1859
1972
  for (let i = 0; i < selectedTargets.length; i += 1) {
@@ -1861,8 +1974,8 @@ export class Runner {
1861
1974
  if (currentTarget === undefined) {
1862
1975
  continue;
1863
1976
  }
1864
- const currentTargetType = currentTarget['type'];
1865
- const currentTargetWorkingDir = currentTarget['workingDir'];
1977
+ const currentTargetType = currentTarget['to'];
1978
+ const currentTargetWorkingDir = currentTarget['path'];
1866
1979
  targetMenuChoices.push({
1867
1980
  title: `${chalk.yellow.bold('[EDIT]')} ${currentTargetType} → ${currentTargetWorkingDir}`,
1868
1981
  value: {
@@ -1916,7 +2029,7 @@ export class Runner {
1916
2029
  if (targetMenuAction['kind'] === 'add' || targetMenuAction['kind'] === 'edit') {
1917
2030
  const targetEditIndex = (targetMenuAction['kind'] === 'edit') ? targetMenuAction['index'] : -1;
1918
2031
  const targetToEdit = (targetEditIndex >= 0) ? selectedTargets[targetEditIndex] : undefined;
1919
- const targetTypeInitial = (targetToEdit !== undefined) ? availableTargetTypes.indexOf(targetToEdit['type']) : 0;
2032
+ const targetTypeInitial = (targetToEdit !== undefined) ? availableTargetTypes.indexOf(targetToEdit['to']) : 0;
1920
2033
  const targetTypeChoices = availableTargetTypes.map((availableTargetType) => ({
1921
2034
  title: availableTargetType,
1922
2035
  value: availableTargetType,
@@ -1933,7 +2046,7 @@ export class Runner {
1933
2046
  }
1934
2047
  const targetTypeOutputResultValue = targetTypeOutput['result'];
1935
2048
  const selectedTargetType = targetTypeOutputResultValue.targetType;
1936
- const targetWorkingDirInitial = (targetToEdit !== undefined) ? workspaceKeys.indexOf(targetToEdit['workingDir']) : 0;
2049
+ const targetWorkingDirInitial = (targetToEdit !== undefined) ? workspaceKeys.indexOf(targetToEdit['path']) : 0;
1937
2050
  const targetWorkingDirChoices = workspaceKeys.map((workspaceKey) => ({
1938
2051
  title: workspaceKey,
1939
2052
  value: workspaceKey,
@@ -1954,7 +2067,7 @@ export class Runner {
1954
2067
  if (selectedTargetIndex === targetEditIndex) {
1955
2068
  return false;
1956
2069
  }
1957
- return selectedTarget['type'] === selectedTargetType && selectedTarget['workingDir'] === selectedTargetWorkingDir;
2070
+ return selectedTarget['to'] === selectedTargetType && selectedTarget['path'] === selectedTargetWorkingDir;
1958
2071
  });
1959
2072
  if (targetIsDuplicate === true) {
1960
2073
  Logger.customize({
@@ -1966,17 +2079,17 @@ export class Runner {
1966
2079
  continue;
1967
2080
  }
1968
2081
  let selectedTargetNeeds = undefined;
1969
- const targetToEditExistingNeeds = (targetToEdit !== undefined && Array.isArray(targetToEdit['needs']) === true) ? targetToEdit['needs'] : [];
2082
+ const targetToEditExistingNeeds = (targetToEdit !== undefined && Array.isArray(targetToEdit['after']) === true) ? targetToEdit['after'] : [];
1970
2083
  const targetNeedsChoices = selectedTargets
1971
2084
  .filter((candidate, candidateIndex) => {
1972
- return candidate['type'] === selectedTargetType
2085
+ return candidate['to'] === selectedTargetType
1973
2086
  && candidateIndex !== targetEditIndex
1974
- && candidate['workingDir'] !== selectedTargetWorkingDir;
2087
+ && candidate['path'] !== selectedTargetWorkingDir;
1975
2088
  })
1976
2089
  .map((candidate) => ({
1977
- title: candidate['workingDir'],
1978
- value: candidate['workingDir'],
1979
- selected: targetToEditExistingNeeds.includes(candidate['workingDir']),
2090
+ title: candidate['path'],
2091
+ value: candidate['path'],
2092
+ selected: targetToEditExistingNeeds.includes(candidate['path']),
1980
2093
  }));
1981
2094
  if (targetNeedsChoices.length > 0) {
1982
2095
  const targetNeedsOutput = await Runner.promptWithCancel({
@@ -1992,11 +2105,11 @@ export class Runner {
1992
2105
  selectedTargetNeeds = (Array.isArray(targetNeedsOutputResultValue.targetNeeds) === true && targetNeedsOutputResultValue.targetNeeds.length > 0) ? targetNeedsOutputResultValue.targetNeeds : undefined;
1993
2106
  }
1994
2107
  const newTarget = {
1995
- type: selectedTargetType,
1996
- workingDir: selectedTargetWorkingDir,
2108
+ to: selectedTargetType,
2109
+ path: selectedTargetWorkingDir,
1997
2110
  };
1998
2111
  if (selectedTargetNeeds !== undefined) {
1999
- Reflect.set(newTarget, 'needs', selectedTargetNeeds);
2112
+ Reflect.set(newTarget, 'after', selectedTargetNeeds);
2000
2113
  }
2001
2114
  if (targetEditIndex >= 0) {
2002
2115
  Reflect.set(selectedTargets, targetEditIndex, newTarget);
@@ -2010,7 +2123,7 @@ export class Runner {
2010
2123
  }
2011
2124
  let selectedScopes = [];
2012
2125
  if (matchedMetadata !== undefined && matchedMetadata['supportsScopes'] === true) {
2013
- const lockedPaths = new Set(selectedTargets.map((selectedTarget) => selectedTarget['workingDir']));
2126
+ const lockedPaths = new Set(selectedTargets.map((selectedTarget) => selectedTarget['path']));
2014
2127
  const extraWorkspaceKeys = workspaceKeys.filter((workspaceKey) => lockedPaths.has(workspaceKey) === false);
2015
2128
  selectedScopes = [...lockedPaths];
2016
2129
  if (extraWorkspaceKeys.length > 0) {
@@ -2044,8 +2157,8 @@ export class Runner {
2044
2157
  const mergedVariables = { ...matchedMetadata['variables'] };
2045
2158
  const variableNameToTargetWorkingDir = {};
2046
2159
  for (const selectedTarget of selectedTargets) {
2047
- const targetType = selectedTarget['type'];
2048
- const targetWorkingDir = selectedTarget['workingDir'];
2160
+ const targetType = selectedTarget['to'];
2161
+ const targetWorkingDir = selectedTarget['path'];
2049
2162
  const targetMetadata = matchedMetadata['targets'] ?? {};
2050
2163
  const targetVariables = (targetMetadata[targetType] !== undefined) ? targetMetadata[targetType]['variables'] : {};
2051
2164
  const targetVarEntries = Object.entries(targetVariables);
@@ -2081,6 +2194,9 @@ export class Runner {
2081
2194
  promptMessage = `Variable: ${variableName}`;
2082
2195
  initialValue = (typeof variableConfig['default'] === 'string') ? variableConfig['default'] : '';
2083
2196
  }
2197
+ if (variableName === 'ROOT_WORKING_DIR' && initialValue === '') {
2198
+ initialValue = './';
2199
+ }
2084
2200
  const parts = [];
2085
2201
  if (typeof variableConfig['description'] === 'string') {
2086
2202
  parts.push(variableConfig['description']);
@@ -2098,9 +2214,9 @@ export class Runner {
2098
2214
  promptMessage = `${promptMessage} (${parts.join(', ')})`;
2099
2215
  }
2100
2216
  if (workflow !== undefined
2101
- && workflow['settings'] !== undefined
2102
- && typeof workflow['settings'][variableName] === 'string') {
2103
- initialValue = workflow['settings'][variableName];
2217
+ && workflow['with'] !== undefined
2218
+ && typeof workflow['with'][variableName] === 'string') {
2219
+ initialValue = workflow['with'][variableName];
2104
2220
  }
2105
2221
  const settingsOutput = await Runner.promptWithCancel({
2106
2222
  type: 'text',
@@ -2116,27 +2232,34 @@ export class Runner {
2116
2232
  }
2117
2233
  const settingsOutputResultValue = settingsOutput['result'];
2118
2234
  const settingValue = (typeof settingsOutputResultValue.settingValue === 'string') ? settingsOutputResultValue.settingValue.trim().replaceAll('\\n', '\n') : '';
2119
- if (settingValue !== '') {
2235
+ const isDefaultRootWorkingDir = variableName === 'ROOT_WORKING_DIR' && settingValue === './';
2236
+ if (settingValue !== '' && isDefaultRootWorkingDir === false) {
2120
2237
  Reflect.set(settings, variableName, settingValue);
2121
2238
  }
2122
2239
  }
2123
2240
  }
2241
+ const resolvedTriggers = selectedTriggers.map((trigger) => {
2242
+ if (trigger.startsWith('workflow-run') === true && selectedDependsOn !== undefined) {
2243
+ return {
2244
+ name: trigger,
2245
+ workflows: selectedDependsOn,
2246
+ };
2247
+ }
2248
+ return trigger;
2249
+ });
2124
2250
  const resolvedWorkflow = {
2125
2251
  template: selectedTemplate,
2126
- suffix: selectedSuffix,
2127
- triggers: selectedTriggers,
2252
+ name: selectedSuffix,
2253
+ triggers: resolvedTriggers,
2128
2254
  };
2129
- if (selectedDependsOn !== undefined) {
2130
- Reflect.set(resolvedWorkflow, 'depends-on', selectedDependsOn);
2255
+ if (selectedScopes.length > 0) {
2256
+ Reflect.set(resolvedWorkflow, 'build', selectedScopes);
2131
2257
  }
2132
2258
  if (selectedTargets.length > 0) {
2133
- Reflect.set(resolvedWorkflow, 'targets', selectedTargets);
2134
- }
2135
- if (selectedScopes.length > 0) {
2136
- Reflect.set(resolvedWorkflow, 'scopes', selectedScopes);
2259
+ Reflect.set(resolvedWorkflow, 'deploy', selectedTargets);
2137
2260
  }
2138
2261
  if (Object.keys(settings).length > 0) {
2139
- resolvedWorkflow.settings = settings;
2262
+ resolvedWorkflow.with = settings;
2140
2263
  }
2141
2264
  if (mode === 'create' && selectedTemplate.trim() === '') {
2142
2265
  return {
@@ -2161,8 +2284,728 @@ export class Runner {
2161
2284
  const confirmOutputResult = confirmOutput['result'];
2162
2285
  return confirmOutputResult.confirm;
2163
2286
  }
2287
+ static async promptGitignore(config) {
2288
+ const existing = config['gitignore'];
2289
+ const excludes = (existing !== undefined && Array.isArray(existing['projectExcludes']) === true) ? [...existing['projectExcludes']] : [];
2290
+ if (excludes.length === 0) {
2291
+ const imported = await Runner.importGitignoreExcludes();
2292
+ excludes.push(...imported);
2293
+ }
2294
+ const sync = () => {
2295
+ if (excludes.length > 0) {
2296
+ Object.assign(config, {
2297
+ gitignore: {
2298
+ projectExcludes: [...excludes],
2299
+ },
2300
+ });
2301
+ }
2302
+ else {
2303
+ Reflect.deleteProperty(config, 'gitignore');
2304
+ }
2305
+ return;
2306
+ };
2307
+ while (true) {
2308
+ const choices = [];
2309
+ for (let i = 0; i < excludes.length; i += 1) {
2310
+ const pattern = excludes[i];
2311
+ if (pattern === undefined) {
2312
+ continue;
2313
+ }
2314
+ choices.push({
2315
+ title: `${chalk.yellow.bold('[EDIT]')} ${pattern}`,
2316
+ description: 'Update this pattern.',
2317
+ value: {
2318
+ kind: 'edit',
2319
+ index: i,
2320
+ },
2321
+ });
2322
+ choices.push({
2323
+ title: `${chalk.red.bold('[REMOVE]')} ${pattern}`,
2324
+ description: 'Delete this pattern.',
2325
+ value: {
2326
+ kind: 'remove',
2327
+ index: i,
2328
+ },
2329
+ });
2330
+ }
2331
+ choices.push({
2332
+ title: 'Add a pattern',
2333
+ description: 'Add a new ".gitignore" exclude.',
2334
+ value: {
2335
+ kind: 'add',
2336
+ },
2337
+ });
2338
+ choices.push({
2339
+ title: 'Back',
2340
+ description: 'Return to the category selection.',
2341
+ value: {
2342
+ kind: 'back',
2343
+ },
2344
+ });
2345
+ const menuOutput = await Runner.promptWithCancel({
2346
+ type: 'select',
2347
+ name: 'action',
2348
+ message: (excludes.length > 0) ? 'Select a pattern to manage.' : 'No patterns found. Choose an option.',
2349
+ choices,
2350
+ });
2351
+ if (menuOutput['cancelled'] === true) {
2352
+ sync();
2353
+ return 'back';
2354
+ }
2355
+ const menuOutputResultValue = menuOutput['result'];
2356
+ if (menuOutputResultValue.action === undefined
2357
+ || menuOutputResultValue.action['kind'] === 'back') {
2358
+ sync();
2359
+ return 'back';
2360
+ }
2361
+ if (menuOutputResultValue.action['kind'] === 'add') {
2362
+ const addOutput = await Runner.promptWithCancel({
2363
+ type: 'text',
2364
+ name: 'pattern',
2365
+ message: 'Pattern to ignore (e.g. logs/):',
2366
+ validate: Runner['isNonEmptyLiteralInput'],
2367
+ });
2368
+ if (addOutput['cancelled'] === true) {
2369
+ continue;
2370
+ }
2371
+ const addOutputResultValue = addOutput['result'];
2372
+ const addPattern = addOutputResultValue.pattern.trim();
2373
+ if (addPattern === '') {
2374
+ continue;
2375
+ }
2376
+ excludes.push(addPattern);
2377
+ sync();
2378
+ Logger.customize({
2379
+ name: 'Runner.promptGitignore',
2380
+ purpose: 'add',
2381
+ padTop: 1,
2382
+ padBottom: 1,
2383
+ }).info('Added new pattern.');
2384
+ continue;
2385
+ }
2386
+ if (menuOutputResultValue.action['kind'] === 'edit') {
2387
+ const editIndex = menuOutputResultValue.action['index'];
2388
+ if (editIndex < 0 || editIndex >= excludes.length) {
2389
+ continue;
2390
+ }
2391
+ const patternToEdit = excludes[editIndex];
2392
+ if (patternToEdit === undefined) {
2393
+ continue;
2394
+ }
2395
+ const editOutput = await Runner.promptWithCancel({
2396
+ type: 'text',
2397
+ name: 'pattern',
2398
+ message: 'Pattern to ignore (e.g. logs/):',
2399
+ initial: patternToEdit,
2400
+ validate: Runner['isNonEmptyLiteralInput'],
2401
+ });
2402
+ if (editOutput['cancelled'] === true) {
2403
+ continue;
2404
+ }
2405
+ const editOutputResultValue = editOutput['result'];
2406
+ const editPattern = editOutputResultValue.pattern.trim();
2407
+ if (editPattern === '') {
2408
+ continue;
2409
+ }
2410
+ Reflect.set(excludes, editIndex, editPattern);
2411
+ sync();
2412
+ Logger.customize({
2413
+ name: 'Runner.promptGitignore',
2414
+ purpose: 'edit',
2415
+ padTop: 1,
2416
+ padBottom: 1,
2417
+ }).info('Updated pattern.');
2418
+ continue;
2419
+ }
2420
+ if (menuOutputResultValue.action['kind'] === 'remove') {
2421
+ const removeIndex = menuOutputResultValue.action['index'];
2422
+ if (removeIndex < 0 || removeIndex >= excludes.length) {
2423
+ continue;
2424
+ }
2425
+ const patternToRemove = excludes[removeIndex];
2426
+ if (patternToRemove === undefined) {
2427
+ continue;
2428
+ }
2429
+ const removeOutput = await Runner.promptWithCancel({
2430
+ type: 'confirm',
2431
+ name: 'confirm',
2432
+ message: `Remove pattern "${patternToRemove}"?`,
2433
+ initial: false,
2434
+ });
2435
+ if (removeOutput['cancelled'] === true) {
2436
+ continue;
2437
+ }
2438
+ const removeOutputResultValue = removeOutput['result'];
2439
+ if (removeOutputResultValue.confirm !== true) {
2440
+ continue;
2441
+ }
2442
+ excludes.splice(removeIndex, 1);
2443
+ sync();
2444
+ Logger.customize({
2445
+ name: 'Runner.promptGitignore',
2446
+ purpose: 'remove',
2447
+ padTop: 1,
2448
+ padBottom: 1,
2449
+ }).info('Removed pattern.');
2450
+ }
2451
+ }
2452
+ }
2453
+ static async promptAgents(config) {
2454
+ const existing = (Array.isArray(config['agents']) === true) ? config['agents'] : [];
2455
+ const choices = libItemAllowedAgents.map((allowedAgent) => ({
2456
+ title: (allowedAgent === 'claude-code') ? 'Claude Code' : 'Codex',
2457
+ value: allowedAgent,
2458
+ selected: existing.includes(allowedAgent),
2459
+ }));
2460
+ const agentsOutput = await Runner.promptWithCancel({
2461
+ type: 'multiselect',
2462
+ name: 'agents',
2463
+ message: 'AI tools to generate conventions for',
2464
+ choices,
2465
+ min: 1,
2466
+ });
2467
+ if (agentsOutput['cancelled'] === true) {
2468
+ return 'back';
2469
+ }
2470
+ const agentsInput = agentsOutput['result'].agents;
2471
+ const agents = libItemAllowedAgents.filter((allowedAgent) => agentsInput.includes(allowedAgent));
2472
+ if (agents.length > 0) {
2473
+ Object.assign(config, {
2474
+ agents,
2475
+ });
2476
+ }
2477
+ else {
2478
+ Reflect.deleteProperty(config, 'agents');
2479
+ }
2480
+ return 'back';
2481
+ }
2482
+ static async importGitignoreExcludes() {
2483
+ const gitignorePath = join(process.cwd(), '.gitignore');
2484
+ const exists = await pathExists(gitignorePath);
2485
+ if (exists === false) {
2486
+ return [];
2487
+ }
2488
+ const raw = await fs.readFile(gitignorePath, 'utf-8');
2489
+ const lines = raw.split('\n');
2490
+ const markerIndex = lines.findIndex((line) => line.includes('#### Project Excludes ####'));
2491
+ if (markerIndex === -1) {
2492
+ return [];
2493
+ }
2494
+ const result = [];
2495
+ for (const line of lines.slice(markerIndex + 1)) {
2496
+ const trimmed = line.trim();
2497
+ if (trimmed !== '' && trimmed.startsWith('#') === false) {
2498
+ result.push(trimmed);
2499
+ }
2500
+ }
2501
+ return result;
2502
+ }
2503
+ static async promptEnvironment(config) {
2504
+ while (true) {
2505
+ const environment = (config['environment'] !== undefined) ? config['environment'] : {};
2506
+ const globalScope = environment['global'];
2507
+ const apps = (environment['apps'] !== undefined) ? environment['apps'] : {};
2508
+ const workspaces = (config['workspaces'] !== undefined) ? config['workspaces'] : {};
2509
+ const appPaths = [];
2510
+ for (const workspaceEntry of Object.entries(workspaces)) {
2511
+ if (workspaceEntry[1]['role'] === 'app' && appPaths.includes(workspaceEntry[0]) === false) {
2512
+ appPaths.push(workspaceEntry[0]);
2513
+ }
2514
+ }
2515
+ for (const appPath of Object.keys(apps)) {
2516
+ if (appPaths.includes(appPath) === false) {
2517
+ appPaths.push(appPath);
2518
+ }
2519
+ }
2520
+ const choices = [];
2521
+ const globalVariables = (globalScope !== undefined && globalScope['variables'] !== undefined) ? globalScope['variables'] : [];
2522
+ const globalSummary = (globalScope !== undefined) ? `${globalScope['prefix']} · ${globalVariables.length} value(s)` : 'Not configured yet.';
2523
+ choices.push({
2524
+ title: 'Global keys',
2525
+ description: globalSummary,
2526
+ value: {
2527
+ kind: 'scope',
2528
+ scope: 'global',
2529
+ },
2530
+ });
2531
+ for (const appPath of appPaths) {
2532
+ const appScope = apps[appPath];
2533
+ const appVariables = (appScope !== undefined && appScope['variables'] !== undefined) ? appScope['variables'] : [];
2534
+ const appSummary = (appScope !== undefined) ? `${appScope['prefix']} · ${appVariables.length} value(s)` : 'Not configured yet.';
2535
+ choices.push({
2536
+ title: appPath,
2537
+ description: appSummary,
2538
+ value: {
2539
+ kind: 'scope',
2540
+ scope: 'app',
2541
+ appPath,
2542
+ },
2543
+ });
2544
+ }
2545
+ choices.push({
2546
+ title: 'View GitHub status',
2547
+ description: 'Read-only classification of every managed key on GitHub.',
2548
+ value: {
2549
+ kind: 'status',
2550
+ },
2551
+ });
2552
+ choices.push({
2553
+ title: 'Provision & reconcile on GitHub',
2554
+ description: 'Create missing, delete stale, and restore mismatched key names.',
2555
+ value: {
2556
+ kind: 'reconcile',
2557
+ },
2558
+ });
2559
+ choices.push({
2560
+ title: 'Back',
2561
+ description: 'Return to the category selection.',
2562
+ value: {
2563
+ kind: 'back',
2564
+ },
2565
+ });
2566
+ const menuOutput = await Runner.promptWithCancel({
2567
+ type: 'select',
2568
+ name: 'action',
2569
+ message: 'Select an environment namespace or action.',
2570
+ choices,
2571
+ });
2572
+ if (menuOutput['cancelled'] === true) {
2573
+ return 'back';
2574
+ }
2575
+ const menuOutputResultValue = menuOutput['result'];
2576
+ if (menuOutputResultValue.action === undefined
2577
+ || menuOutputResultValue.action['kind'] === 'back') {
2578
+ return 'back';
2579
+ }
2580
+ if (menuOutputResultValue.action['kind'] === 'status') {
2581
+ await Runner.promptEnvironmentReconcile(config, false);
2582
+ continue;
2583
+ }
2584
+ if (menuOutputResultValue.action['kind'] === 'reconcile') {
2585
+ await Runner.promptEnvironmentReconcile(config, true);
2586
+ continue;
2587
+ }
2588
+ if (menuOutputResultValue.action['kind'] === 'scope') {
2589
+ await Runner.promptEnvironmentScope(config, {
2590
+ scope: menuOutputResultValue.action['scope'],
2591
+ appPath: menuOutputResultValue.action['appPath'],
2592
+ });
2593
+ }
2594
+ }
2595
+ }
2596
+ static async readLocalFilledKeys(config) {
2597
+ const environment = config['environment'] ?? {};
2598
+ const apps = environment['apps'] ?? {};
2599
+ const result = {};
2600
+ for (const appPath of Object.keys(apps)) {
2601
+ const filled = [];
2602
+ const envPath = join(process.cwd(), appPath, '.env');
2603
+ try {
2604
+ const raw = await fs.readFile(envPath, 'utf-8');
2605
+ for (const line of raw.split(LIB_REGEX_LINEBREAK_CRLF_OR_LF)) {
2606
+ const keyMatch = line.match(LIB_REGEX_PATTERN_ENV_VAR_KEY);
2607
+ if (keyMatch === null) {
2608
+ continue;
2609
+ }
2610
+ const separatorIndex = line.indexOf('=');
2611
+ const rawValue = line.slice(separatorIndex + 1).trim();
2612
+ let inner = rawValue;
2613
+ if ((inner.startsWith('"') === true
2614
+ && inner.endsWith('"') === true)
2615
+ || (inner.startsWith('\'') === true
2616
+ && inner.endsWith('\'') === true)) {
2617
+ inner = inner.slice(1, -1);
2618
+ }
2619
+ if (inner.trim() !== '') {
2620
+ filled.push(keyMatch[1] ?? '');
2621
+ }
2622
+ }
2623
+ }
2624
+ catch {
2625
+ }
2626
+ Reflect.set(result, appPath, filled);
2627
+ }
2628
+ return result;
2629
+ }
2630
+ static async promptEnvironmentReconcile(config, mutate) {
2631
+ const environment = (config['environment'] !== undefined) ? config['environment'] : {};
2632
+ const managedSet = libEnvManagedSet.compute(config);
2633
+ const githubState = await libEnvGithub.read();
2634
+ if (githubState['available'] === false) {
2635
+ Logger.customize({
2636
+ name: 'Runner.promptEnvironmentReconcile',
2637
+ purpose: 'unavailable',
2638
+ padTop: 1,
2639
+ padBottom: 1,
2640
+ }).warn('The "gh" CLI is not installed or not authenticated. Install and run "gh auth login" to view or reconcile GitHub keys.');
2641
+ return;
2642
+ }
2643
+ const status = libEnvStatus.classify(managedSet, githubState, environment);
2644
+ const statusLines = status.map((entry) => `${entry['name']}: ${entry['state']}`);
2645
+ const localEnv = await Runner.readLocalFilledKeys(config);
2646
+ const localOrphanEntries = libEnvStatus.localOrphans(environment, localEnv);
2647
+ const localOrphanLines = localOrphanEntries.map((entry) => `${entry['name']}: ${entry['state']}`);
2648
+ const combinedLines = [
2649
+ ...statusLines,
2650
+ ...localOrphanLines,
2651
+ ];
2652
+ const statusMessage = (combinedLines.length > 0) ? combinedLines.join('\n') : 'No managed keys were found on GitHub.';
2653
+ Logger.customize({
2654
+ name: 'Runner.promptEnvironmentReconcile',
2655
+ purpose: 'status',
2656
+ padTop: 1,
2657
+ padBottom: 1,
2658
+ }).info(statusMessage);
2659
+ if (mutate === false) {
2660
+ return;
2661
+ }
2662
+ const plan = libEnvReconcile.plan(status);
2663
+ const secretByName = {};
2664
+ for (const managed of managedSet) {
2665
+ Reflect.set(secretByName, managed['name'], managed['secret']);
2666
+ }
2667
+ const applyResult = await libEnvReconcile.apply(plan, secretByName, Runner['promptEnvironmentReconcileConfirm']);
2668
+ if (applyResult['available'] === false) {
2669
+ Logger.customize({
2670
+ name: 'Runner.promptEnvironmentReconcile',
2671
+ purpose: 'unavailable',
2672
+ padTop: 1,
2673
+ padBottom: 1,
2674
+ }).warn('The "gh" CLI became unavailable before changes could be applied.');
2675
+ return;
2676
+ }
2677
+ const resultMessage = `Reconcile complete. Applied ${applyResult['done'].length}, remaining ${applyResult['remaining'].length}.`;
2678
+ Logger.customize({
2679
+ name: 'Runner.promptEnvironmentReconcile',
2680
+ purpose: 'applied',
2681
+ padTop: 1,
2682
+ padBottom: 1,
2683
+ }).info(resultMessage);
2684
+ const createdStubs = plan['create'].filter((createName) => applyResult['done'].includes(createName) === true);
2685
+ if (createdStubs.length > 0) {
2686
+ const stubNotice = [
2687
+ `Created placeholder stubs on GitHub: ${createdStubs.join(', ')}.`,
2688
+ 'Set their real values in GitHub before deploying.',
2689
+ ].join('\n');
2690
+ Logger.customize({
2691
+ name: 'Runner.promptEnvironmentReconcile',
2692
+ purpose: 'stub-notice',
2693
+ padTop: 1,
2694
+ padBottom: 1,
2695
+ }).warn(stubNotice);
2696
+ }
2697
+ return;
2698
+ }
2699
+ static async promptEnvironmentReconcileConfirm(pendingPlan) {
2700
+ const summary = `create ${pendingPlan['create'].length}, delete ${pendingPlan['delete'].length}, restore ${pendingPlan['restore'].length}`;
2701
+ const confirmOutput = await Runner.promptWithCancel({
2702
+ type: 'confirm',
2703
+ name: 'confirm',
2704
+ message: `Apply these GitHub changes (${summary})?`,
2705
+ initial: false,
2706
+ });
2707
+ if (confirmOutput['cancelled'] === true) {
2708
+ return false;
2709
+ }
2710
+ return confirmOutput['result'].confirm === true;
2711
+ }
2712
+ static async promptEnvironmentScope(config, options) {
2713
+ const isApp = options['scope'] === 'app';
2714
+ const appPath = options['appPath'];
2715
+ const environment = (config['environment'] !== undefined) ? config['environment'] : {};
2716
+ const existingApps = (environment['apps'] !== undefined) ? environment['apps'] : {};
2717
+ const existingBlock = (isApp === true && appPath !== undefined) ? existingApps[appPath] : environment['global'];
2718
+ let prefix = (existingBlock !== undefined) ? existingBlock['prefix'] : '';
2719
+ const variables = (existingBlock !== undefined && existingBlock['variables'] !== undefined) ? [...existingBlock['variables']] : [];
2720
+ const sync = () => {
2721
+ const hasContent = prefix !== '' || variables.length > 0;
2722
+ const nextEnvironment = (config['environment'] !== undefined) ? config['environment'] : {};
2723
+ if (isApp === true && appPath !== undefined) {
2724
+ const nextApps = (nextEnvironment['apps'] !== undefined) ? nextEnvironment['apps'] : {};
2725
+ if (hasContent === true) {
2726
+ const appBlock = { prefix };
2727
+ if (variables.length > 0) {
2728
+ Object.assign(appBlock, { variables: [...variables] });
2729
+ }
2730
+ Reflect.set(nextApps, appPath, appBlock);
2731
+ }
2732
+ else {
2733
+ Reflect.deleteProperty(nextApps, appPath);
2734
+ }
2735
+ if (Object.keys(nextApps).length > 0) {
2736
+ Object.assign(nextEnvironment, { apps: nextApps });
2737
+ }
2738
+ else {
2739
+ Reflect.deleteProperty(nextEnvironment, 'apps');
2740
+ }
2741
+ }
2742
+ else if (hasContent === true) {
2743
+ const globalBlock = { prefix };
2744
+ if (variables.length > 0) {
2745
+ Object.assign(globalBlock, { variables: [...variables] });
2746
+ }
2747
+ Object.assign(nextEnvironment, { global: globalBlock });
2748
+ }
2749
+ else {
2750
+ Reflect.deleteProperty(nextEnvironment, 'global');
2751
+ }
2752
+ if (Object.keys(nextEnvironment).length > 0) {
2753
+ Object.assign(config, { environment: nextEnvironment });
2754
+ }
2755
+ else {
2756
+ Reflect.deleteProperty(config, 'environment');
2757
+ }
2758
+ return;
2759
+ };
2760
+ while (true) {
2761
+ const choices = [];
2762
+ const prefixDisplay = (prefix !== '') ? prefix : '(unset)';
2763
+ choices.push({
2764
+ title: `${chalk.cyan.bold('[PREFIX]')} ${prefixDisplay}`,
2765
+ description: 'Set the GitHub name prefix for this namespace.',
2766
+ value: {
2767
+ kind: 'prefix',
2768
+ },
2769
+ });
2770
+ for (let i = 0; i < variables.length; i += 1) {
2771
+ const variable = variables[i];
2772
+ if (variable === undefined) {
2773
+ continue;
2774
+ }
2775
+ const variableKind = (variable['secret'] === true) ? 'secret' : 'variable';
2776
+ const variableLabel = `${variable['key']} (${variableKind})`;
2777
+ choices.push({
2778
+ title: `${chalk.yellow.bold('[EDIT]')} ${variableLabel}`,
2779
+ description: 'Update this value.',
2780
+ value: {
2781
+ kind: 'edit',
2782
+ index: i,
2783
+ },
2784
+ });
2785
+ choices.push({
2786
+ title: `${chalk.red.bold('[REMOVE]')} ${variableLabel}`,
2787
+ description: 'Delete this value.',
2788
+ value: {
2789
+ kind: 'remove',
2790
+ index: i,
2791
+ },
2792
+ });
2793
+ }
2794
+ choices.push({
2795
+ title: 'Add a value',
2796
+ description: 'Add a new environment value to this namespace.',
2797
+ value: {
2798
+ kind: 'add',
2799
+ },
2800
+ });
2801
+ choices.push({
2802
+ title: 'Back',
2803
+ description: 'Return to the environment menu.',
2804
+ value: {
2805
+ kind: 'back',
2806
+ },
2807
+ });
2808
+ const menuOutput = await Runner.promptWithCancel({
2809
+ type: 'select',
2810
+ name: 'action',
2811
+ message: (isApp === true && appPath !== undefined) ? `Manage environment for "${appPath}".` : 'Manage the global environment namespace.',
2812
+ choices,
2813
+ });
2814
+ if (menuOutput['cancelled'] === true) {
2815
+ sync();
2816
+ return 'back';
2817
+ }
2818
+ const menuOutputResultValue = menuOutput['result'];
2819
+ if (menuOutputResultValue.action === undefined
2820
+ || menuOutputResultValue.action['kind'] === 'back') {
2821
+ sync();
2822
+ return 'back';
2823
+ }
2824
+ if (menuOutputResultValue.action['kind'] === 'prefix') {
2825
+ const prefixOutput = await Runner.promptWithCancel({
2826
+ type: 'text',
2827
+ name: 'prefix',
2828
+ message: 'GitHub name prefix (e.g. "CBN_"):',
2829
+ initial: prefix,
2830
+ validate: Runner['isNonEmptyLiteralInput'],
2831
+ });
2832
+ if (prefixOutput['cancelled'] === true) {
2833
+ continue;
2834
+ }
2835
+ const prefixInput = prefixOutput['result'].prefix.trim().toUpperCase();
2836
+ if (prefixInput === '') {
2837
+ continue;
2838
+ }
2839
+ if (libEnvNamespace.isReservedPrefix(prefixInput) === true) {
2840
+ Logger.customize({
2841
+ name: 'Runner.promptEnvironmentScope',
2842
+ purpose: 'reservedPrefix',
2843
+ padTop: 1,
2844
+ padBottom: 1,
2845
+ }).error(`The prefix "${prefixInput}" is reserved by GitHub. Choose a prefix that does not start with "GITHUB_".`);
2846
+ continue;
2847
+ }
2848
+ prefix = prefixInput;
2849
+ sync();
2850
+ Logger.customize({
2851
+ name: 'Runner.promptEnvironmentScope',
2852
+ purpose: 'prefix',
2853
+ padTop: 1,
2854
+ padBottom: 1,
2855
+ }).info(`Set prefix to "${prefix}".`);
2856
+ continue;
2857
+ }
2858
+ if (menuOutputResultValue.action['kind'] === 'add') {
2859
+ const addValue = await Runner.promptEnvironmentValueForm(undefined, isApp);
2860
+ if (addValue === undefined) {
2861
+ continue;
2862
+ }
2863
+ variables.push(addValue);
2864
+ sync();
2865
+ Logger.customize({
2866
+ name: 'Runner.promptEnvironmentScope',
2867
+ purpose: 'add',
2868
+ padTop: 1,
2869
+ padBottom: 1,
2870
+ }).info(`Added value "${addValue['key']}".`);
2871
+ continue;
2872
+ }
2873
+ if (menuOutputResultValue.action['kind'] === 'edit') {
2874
+ const editIndex = menuOutputResultValue.action['index'];
2875
+ if (editIndex < 0 || editIndex >= variables.length) {
2876
+ continue;
2877
+ }
2878
+ const editValue = await Runner.promptEnvironmentValueForm(variables[editIndex], isApp);
2879
+ if (editValue === undefined) {
2880
+ continue;
2881
+ }
2882
+ Reflect.set(variables, editIndex, editValue);
2883
+ sync();
2884
+ Logger.customize({
2885
+ name: 'Runner.promptEnvironmentScope',
2886
+ purpose: 'edit',
2887
+ padTop: 1,
2888
+ padBottom: 1,
2889
+ }).info(`Updated value "${editValue['key']}".`);
2890
+ continue;
2891
+ }
2892
+ if (menuOutputResultValue.action['kind'] === 'remove') {
2893
+ const removeIndex = menuOutputResultValue.action['index'];
2894
+ if (removeIndex < 0 || removeIndex >= variables.length) {
2895
+ continue;
2896
+ }
2897
+ const variableToRemove = variables[removeIndex];
2898
+ if (variableToRemove === undefined) {
2899
+ continue;
2900
+ }
2901
+ const removeOutput = await Runner.promptWithCancel({
2902
+ type: 'confirm',
2903
+ name: 'confirm',
2904
+ message: `Remove value "${variableToRemove['key']}"?`,
2905
+ initial: false,
2906
+ });
2907
+ if (removeOutput['cancelled'] === true) {
2908
+ continue;
2909
+ }
2910
+ if (removeOutput['result'].confirm !== true) {
2911
+ continue;
2912
+ }
2913
+ const dropLocalOutput = await Runner.promptWithCancel({
2914
+ type: 'confirm',
2915
+ name: 'dropLocal',
2916
+ message: `Also remove "${variableToRemove['key']}" from your local ".env" on the next dotenv run?`,
2917
+ initial: false,
2918
+ });
2919
+ if (dropLocalOutput['cancelled'] === false && dropLocalOutput['result'].dropLocal === true) {
2920
+ Logger.customize({
2921
+ name: 'Runner.promptEnvironmentScope',
2922
+ purpose: 'dropLocal',
2923
+ padTop: 1,
2924
+ padBottom: 1,
2925
+ }).info(`To also drop "${variableToRemove['key']}" from your local ".env", run "generate must-haves dotenv --prune".`);
2926
+ }
2927
+ variables.splice(removeIndex, 1);
2928
+ sync();
2929
+ Logger.customize({
2930
+ name: 'Runner.promptEnvironmentScope',
2931
+ purpose: 'remove',
2932
+ padTop: 1,
2933
+ padBottom: 1,
2934
+ }).info(`Removed value "${variableToRemove['key']}".`);
2935
+ }
2936
+ }
2937
+ }
2938
+ static async promptEnvironmentValueForm(existing, isApp) {
2939
+ const keyOutput = await Runner.promptWithCancel({
2940
+ type: 'text',
2941
+ name: 'key',
2942
+ message: 'Value key (SCREAMING_SNAKE_CASE, without the prefix):',
2943
+ initial: (existing !== undefined) ? existing['key'] : '',
2944
+ validate: Runner['isNonEmptyLiteralInput'],
2945
+ });
2946
+ if (keyOutput['cancelled'] === true) {
2947
+ return undefined;
2948
+ }
2949
+ const key = keyOutput['result'].key.trim().toUpperCase();
2950
+ if (libEnvNamespace.isGithubLegalName(key) === false) {
2951
+ Logger.customize({
2952
+ name: 'Runner.promptEnvironmentValueForm',
2953
+ purpose: 'illegalKey',
2954
+ padTop: 1,
2955
+ padBottom: 1,
2956
+ }).error(`The key "${key}" is not a legal GitHub name. Use letters, digits, and underscores, and do not start with a digit or "GITHUB_".`);
2957
+ return undefined;
2958
+ }
2959
+ const secretOutput = await Runner.promptWithCancel({
2960
+ type: 'confirm',
2961
+ name: 'secret',
2962
+ message: 'Store as a GitHub Secret (encrypted)? Choose no for a Variable (plaintext).',
2963
+ initial: (existing !== undefined) ? existing['secret'] : true,
2964
+ });
2965
+ if (secretOutput['cancelled'] === true) {
2966
+ return undefined;
2967
+ }
2968
+ const secret = secretOutput['result'].secret === true;
2969
+ const value = {
2970
+ key,
2971
+ secret,
2972
+ };
2973
+ if (isApp === true) {
2974
+ const buildOnlyOutput = await Runner.promptWithCancel({
2975
+ type: 'confirm',
2976
+ name: 'buildOnly',
2977
+ message: 'Deliver only to the build (.env)? Choose no to sync it to the running server.',
2978
+ initial: (existing !== undefined && existing['buildOnly'] !== undefined) ? existing['buildOnly'] : true,
2979
+ });
2980
+ if (buildOnlyOutput['cancelled'] === true) {
2981
+ return undefined;
2982
+ }
2983
+ Object.assign(value, {
2984
+ buildOnly: buildOnlyOutput['result'].buildOnly === true,
2985
+ });
2986
+ }
2987
+ if (secret === false) {
2988
+ const defaultValueOutput = await Runner.promptWithCancel({
2989
+ type: 'text',
2990
+ name: 'defaultValue',
2991
+ message: 'Default value for the committed ".env.sample" (optional):',
2992
+ initial: (existing !== undefined && existing['defaultValue'] !== undefined) ? existing['defaultValue'] : '',
2993
+ });
2994
+ if (defaultValueOutput['cancelled'] === false) {
2995
+ const defaultValue = defaultValueOutput['result'].defaultValue.trim();
2996
+ if (defaultValue !== '') {
2997
+ Object.assign(value, {
2998
+ defaultValue,
2999
+ });
3000
+ }
3001
+ }
3002
+ }
3003
+ return value;
3004
+ }
2164
3005
  static async promptWorkspaces(config) {
2165
3006
  const workspaces = (config['workspaces'] !== undefined) ? { ...(config['workspaces']) } : {};
3007
+ const recipes = (config['recipes'] !== undefined) ? { ...(config['recipes']) } : {};
3008
+ const packageJsonRecipes = (recipes['package-json'] !== undefined) ? { ...(recipes['package-json']) } : {};
2166
3009
  const rawWorkspacePaths = await discoverPathsWithFile('package.json', 'forward');
2167
3010
  const workspacePaths = rawWorkspacePaths.map((rawWorkspacePath) => {
2168
3011
  const currentWorkingDirectory = process.cwd();
@@ -2218,6 +3061,7 @@ export class Runner {
2218
3061
  const formResult = await Runner.promptWorkspacesForm({
2219
3062
  workspacePath,
2220
3063
  existingWorkspace: workspaces[workspacePath],
3064
+ existingPackageJsonRecipes: packageJsonRecipes[workspacePath],
2221
3065
  projectSlug: (config['project'] !== undefined && config['project']['name'] !== undefined) ? config['project']['name']['slug'] : undefined,
2222
3066
  });
2223
3067
  if (formResult['action'] === 'back') {
@@ -2225,6 +3069,19 @@ export class Runner {
2225
3069
  }
2226
3070
  Reflect.set(workspaces, workspacePath, formResult['workspace']);
2227
3071
  Object.assign(config, { workspaces });
3072
+ if (Object.keys(formResult['packageJsonRecipes']).length > 0) {
3073
+ Reflect.set(packageJsonRecipes, workspacePath, formResult['packageJsonRecipes']);
3074
+ }
3075
+ else {
3076
+ Reflect.deleteProperty(packageJsonRecipes, workspacePath);
3077
+ }
3078
+ if (Object.keys(packageJsonRecipes).length > 0) {
3079
+ Reflect.set(recipes, 'package-json', packageJsonRecipes);
3080
+ }
3081
+ else {
3082
+ Reflect.deleteProperty(recipes, 'package-json');
3083
+ }
3084
+ Object.assign(config, { recipes });
2228
3085
  Logger.customize({
2229
3086
  name: 'Runner.promptWorkspaces',
2230
3087
  purpose: 'updated',
@@ -2372,16 +3229,15 @@ export class Runner {
2372
3229
  };
2373
3230
  }
2374
3231
  const workspaceDisplayNameInput = Runner.normalizeText(displayNamePrompt['result'].workspaceDisplayName, Infinity)['sanitized'];
2375
- const existingRecipes = (options['existingWorkspace'] !== undefined && options['existingWorkspace']['recipes'] !== undefined) ? options['existingWorkspace']['recipes'] : undefined;
3232
+ const existingRecipes = options['existingPackageJsonRecipes'];
2376
3233
  const recipesPrompt = await Runner.promptWithCancel({
2377
3234
  type: 'multiselect',
2378
3235
  name: 'workspaceRecipes',
2379
3236
  message: 'Select recipes to enable',
2380
3237
  choices: libItemAllowedRecipes.map((recipe) => {
2381
- const recipeTuple = (existingRecipes !== undefined) ? Reflect.get(existingRecipes, recipe) : undefined;
2382
- const recipeSelected = (Array.isArray(recipeTuple)
2383
- && recipeTuple.length > 0
2384
- && recipeTuple[0] === true);
3238
+ const recipeEntry = (existingRecipes !== undefined) ? Reflect.get(existingRecipes, recipe) : undefined;
3239
+ const recipeSelected = (recipeEntry !== undefined
3240
+ && recipeEntry['enabled'] === true);
2385
3241
  return {
2386
3242
  title: recipe,
2387
3243
  value: recipe,
@@ -2397,9 +3253,8 @@ export class Runner {
2397
3253
  const selectedRecipes = recipesPrompt['result'].workspaceRecipes;
2398
3254
  const recipes = {};
2399
3255
  for (const recipe of selectedRecipes) {
2400
- const existingTupleRaw = (existingRecipes !== undefined) ? Reflect.get(existingRecipes, recipe) : undefined;
2401
- const existingTuple = (Array.isArray(existingTupleRaw) === true) ? existingTupleRaw : undefined;
2402
- const existingSettings = (existingTuple !== undefined && existingTuple.length > 1) ? existingTuple[1] : undefined;
3256
+ const existingEntry = (existingRecipes !== undefined) ? Reflect.get(existingRecipes, recipe) : undefined;
3257
+ const existingSettings = (existingEntry !== undefined) ? existingEntry['settings'] : undefined;
2403
3258
  if (recipe === 'sync-identity' && selectedPolicy === 'distributable') {
2404
3259
  const identitySettingsPrompt = await Runner.promptWithCancel({
2405
3260
  type: 'multiselect',
@@ -2429,13 +3284,15 @@ export class Runner {
2429
3284
  for (const setting of identitySelectedSettings) {
2430
3285
  Reflect.set(identitySettings, setting, true);
2431
3286
  }
2432
- Reflect.set(recipes, recipe, [
2433
- true,
2434
- identitySettings,
2435
- ]);
3287
+ Reflect.set(recipes, recipe, {
3288
+ enabled: true,
3289
+ settings: identitySettings,
3290
+ });
2436
3291
  }
2437
3292
  else {
2438
- Reflect.set(recipes, recipe, [true]);
3293
+ Reflect.set(recipes, recipe, {
3294
+ enabled: true,
3295
+ });
2439
3296
  }
2440
3297
  }
2441
3298
  else if (recipe === 'sync-ownership' && selectedPolicy === 'distributable') {
@@ -2487,13 +3344,15 @@ export class Runner {
2487
3344
  for (const setting of ownershipSelectedSettings) {
2488
3345
  Reflect.set(ownershipSettings, setting, true);
2489
3346
  }
2490
- Reflect.set(recipes, recipe, [
2491
- true,
2492
- ownershipSettings,
2493
- ]);
3347
+ Reflect.set(recipes, recipe, {
3348
+ enabled: true,
3349
+ settings: ownershipSettings,
3350
+ });
2494
3351
  }
2495
3352
  else {
2496
- Reflect.set(recipes, recipe, [true]);
3353
+ Reflect.set(recipes, recipe, {
3354
+ enabled: true,
3355
+ });
2497
3356
  }
2498
3357
  }
2499
3358
  else if (recipe === 'sync-environment') {
@@ -2518,13 +3377,15 @@ export class Runner {
2518
3377
  for (const setting of environmentSelectedSettings) {
2519
3378
  Reflect.set(environmentSettings, setting, true);
2520
3379
  }
2521
- Reflect.set(recipes, recipe, [
2522
- true,
2523
- environmentSettings,
2524
- ]);
3380
+ Reflect.set(recipes, recipe, {
3381
+ enabled: true,
3382
+ settings: environmentSettings,
3383
+ });
2525
3384
  }
2526
3385
  else {
2527
- Reflect.set(recipes, recipe, [true]);
3386
+ Reflect.set(recipes, recipe, {
3387
+ enabled: true,
3388
+ });
2528
3389
  }
2529
3390
  }
2530
3391
  else if (recipe === 'cleanup') {
@@ -2556,13 +3417,15 @@ export class Runner {
2556
3417
  for (const setting of cleanupSelectedSettings) {
2557
3418
  Reflect.set(cleanupSettings, setting, true);
2558
3419
  }
2559
- Reflect.set(recipes, recipe, [
2560
- true,
2561
- cleanupSettings,
2562
- ]);
3420
+ Reflect.set(recipes, recipe, {
3421
+ enabled: true,
3422
+ settings: cleanupSettings,
3423
+ });
2563
3424
  }
2564
3425
  else {
2565
- Reflect.set(recipes, recipe, [true]);
3426
+ Reflect.set(recipes, recipe, {
3427
+ enabled: true,
3428
+ });
2566
3429
  }
2567
3430
  }
2568
3431
  else if (recipe === 'normalize-dependencies') {
@@ -2594,17 +3457,21 @@ export class Runner {
2594
3457
  for (const setting of dependenciesSelectedSettings) {
2595
3458
  Reflect.set(dependenciesSettings, setting, true);
2596
3459
  }
2597
- Reflect.set(recipes, recipe, [
2598
- true,
2599
- dependenciesSettings,
2600
- ]);
3460
+ Reflect.set(recipes, recipe, {
3461
+ enabled: true,
3462
+ settings: dependenciesSettings,
3463
+ });
2601
3464
  }
2602
3465
  else {
2603
- Reflect.set(recipes, recipe, [true]);
3466
+ Reflect.set(recipes, recipe, {
3467
+ enabled: true,
3468
+ });
2604
3469
  }
2605
3470
  }
2606
3471
  else {
2607
- Reflect.set(recipes, recipe, [true]);
3472
+ Reflect.set(recipes, recipe, {
3473
+ enabled: true,
3474
+ });
2608
3475
  }
2609
3476
  }
2610
3477
  return {
@@ -2614,8 +3481,8 @@ export class Runner {
2614
3481
  ...(workspaceDisplayNameInput !== undefined) ? { displayName: workspaceDisplayNameInput } : {},
2615
3482
  role: selectedRole,
2616
3483
  policy: selectedPolicy,
2617
- ...(Object.keys(recipes).length > 0) ? { recipes } : {},
2618
3484
  },
3485
+ packageJsonRecipes: recipes,
2619
3486
  };
2620
3487
  }
2621
3488
  static async promptWithCancel(questions) {