@cbnventures/nova 0.37.2 → 0.39.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 (220) hide show
  1. package/build/package.json +1 -1
  2. package/build/scaffold-versions.json +20 -0
  3. package/build/src/api/app-store-connect.d.ts +17 -2
  4. package/build/src/api/app-store-connect.d.ts.map +1 -1
  5. package/build/src/api/app-store-connect.js +654 -171
  6. package/build/src/api/app-store-connect.js.map +1 -1
  7. package/build/src/api/github-runner-images.d.ts +13 -0
  8. package/build/src/api/github-runner-images.d.ts.map +1 -0
  9. package/build/src/api/github-runner-images.js +238 -0
  10. package/build/src/api/github-runner-images.js.map +1 -0
  11. package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts +2 -2
  12. package/build/src/cli/generate/github/workflows-blueprint-validate.d.ts.map +1 -1
  13. package/build/src/cli/generate/github/workflows-blueprint-validate.js +226 -3
  14. package/build/src/cli/generate/github/workflows-blueprint-validate.js.map +1 -1
  15. package/build/src/cli/generate/github/workflows-blueprint.d.ts +6 -4
  16. package/build/src/cli/generate/github/workflows-blueprint.d.ts.map +1 -1
  17. package/build/src/cli/generate/github/workflows-blueprint.js +804 -124
  18. package/build/src/cli/generate/github/workflows-blueprint.js.map +1 -1
  19. package/build/src/cli/generate/must-haves/agent-conventions.d.ts.map +1 -1
  20. package/build/src/cli/generate/must-haves/agent-conventions.js +1 -0
  21. package/build/src/cli/generate/must-haves/agent-conventions.js.map +1 -1
  22. package/build/src/cli/index.js +13 -1
  23. package/build/src/cli/index.js.map +1 -1
  24. package/build/src/cli/integration/app-store-connect.d.ts +10 -0
  25. package/build/src/cli/integration/app-store-connect.d.ts.map +1 -1
  26. package/build/src/cli/integration/app-store-connect.js +701 -80
  27. package/build/src/cli/integration/app-store-connect.js.map +1 -1
  28. package/build/src/cli/scaffold/app/astro.d.ts.map +1 -1
  29. package/build/src/cli/scaffold/app/astro.js +8 -0
  30. package/build/src/cli/scaffold/app/astro.js.map +1 -1
  31. package/build/src/cli/scaffold/app/discord-bot.d.ts.map +1 -1
  32. package/build/src/cli/scaffold/app/discord-bot.js +28 -0
  33. package/build/src/cli/scaffold/app/discord-bot.js.map +1 -1
  34. package/build/src/cli/scaffold/app/expressjs.d.ts.map +1 -1
  35. package/build/src/cli/scaffold/app/expressjs.js +28 -0
  36. package/build/src/cli/scaffold/app/expressjs.js.map +1 -1
  37. package/build/src/cli/scaffold/app/nextjs.d.ts.map +1 -1
  38. package/build/src/cli/scaffold/app/nextjs.js +22 -0
  39. package/build/src/cli/scaffold/app/nextjs.js.map +1 -1
  40. package/build/src/cli/scaffold/app/vite.d.ts.map +1 -1
  41. package/build/src/cli/scaffold/app/vite.js +8 -0
  42. package/build/src/cli/scaffold/app/vite.js.map +1 -1
  43. package/build/src/cli/scaffold/docs/docusaurus.d.ts.map +1 -1
  44. package/build/src/cli/scaffold/docs/docusaurus.js +8 -0
  45. package/build/src/cli/scaffold/docs/docusaurus.js.map +1 -1
  46. package/build/src/cli/scaffold/package/github-action.d.ts.map +1 -1
  47. package/build/src/cli/scaffold/package/github-action.js +14 -0
  48. package/build/src/cli/scaffold/package/github-action.js.map +1 -1
  49. package/build/src/cli/scaffold/package/homebridge.d.ts.map +1 -1
  50. package/build/src/cli/scaffold/package/homebridge.js +22 -0
  51. package/build/src/cli/scaffold/package/homebridge.js.map +1 -1
  52. package/build/src/cli/scaffold/package/pfsense.d.ts +3 -0
  53. package/build/src/cli/scaffold/package/pfsense.d.ts.map +1 -1
  54. package/build/src/cli/scaffold/package/pfsense.js +148 -6
  55. package/build/src/cli/scaffold/package/pfsense.js.map +1 -1
  56. package/build/src/cli/scaffold/tool/serverless.d.ts +2 -0
  57. package/build/src/cli/scaffold/tool/serverless.d.ts.map +1 -1
  58. package/build/src/cli/scaffold/tool/serverless.js +86 -1
  59. package/build/src/cli/scaffold/tool/serverless.js.map +1 -1
  60. package/build/src/cli/utility/changelog.d.ts +7 -0
  61. package/build/src/cli/utility/changelog.d.ts.map +1 -1
  62. package/build/src/cli/utility/changelog.js +802 -7
  63. package/build/src/cli/utility/changelog.js.map +1 -1
  64. package/build/src/cli/utility/configure.d.ts +6 -1
  65. package/build/src/cli/utility/configure.d.ts.map +1 -1
  66. package/build/src/cli/utility/configure.js +278 -20
  67. package/build/src/cli/utility/configure.js.map +1 -1
  68. package/build/src/cli/utility/run-workspaces.d.ts.map +1 -1
  69. package/build/src/cli/utility/run-workspaces.js +1 -0
  70. package/build/src/cli/utility/run-workspaces.js.map +1 -1
  71. package/build/src/lib/artifact-assembly.d.ts +7 -0
  72. package/build/src/lib/artifact-assembly.d.ts.map +1 -0
  73. package/build/src/lib/artifact-assembly.js +122 -0
  74. package/build/src/lib/artifact-assembly.js.map +1 -0
  75. package/build/src/lib/docker-packaging.d.ts +3 -1
  76. package/build/src/lib/docker-packaging.d.ts.map +1 -1
  77. package/build/src/lib/docker-packaging.js +83 -2
  78. package/build/src/lib/docker-packaging.js.map +1 -1
  79. package/build/src/lib/env-namespace.d.ts.map +1 -1
  80. package/build/src/lib/env-namespace.js +2 -1
  81. package/build/src/lib/env-namespace.js.map +1 -1
  82. package/build/src/lib/item.d.ts +2 -1
  83. package/build/src/lib/item.d.ts.map +1 -1
  84. package/build/src/lib/item.js +18 -0
  85. package/build/src/lib/item.js.map +1 -1
  86. package/build/src/lib/nova-config-order.d.ts.map +1 -1
  87. package/build/src/lib/nova-config-order.js +1 -0
  88. package/build/src/lib/nova-config-order.js.map +1 -1
  89. package/build/src/lib/nova-config.d.ts +1 -0
  90. package/build/src/lib/nova-config.d.ts.map +1 -1
  91. package/build/src/lib/nova-config.js +150 -4
  92. package/build/src/lib/nova-config.js.map +1 -1
  93. package/build/src/lib/regex.d.ts +14 -0
  94. package/build/src/lib/regex.d.ts.map +1 -1
  95. package/build/src/lib/regex.js +14 -0
  96. package/build/src/lib/regex.js.map +1 -1
  97. package/build/src/lib/run-workspaces.d.ts.map +1 -1
  98. package/build/src/lib/run-workspaces.js +79 -8
  99. package/build/src/lib/run-workspaces.js.map +1 -1
  100. package/build/src/lib/scaffold.d.ts +3 -3
  101. package/build/src/lib/scaffold.d.ts.map +1 -1
  102. package/build/src/lib/scaffold.js +140 -8
  103. package/build/src/lib/scaffold.js.map +1 -1
  104. package/build/src/lib/workflow-templates.d.ts +4 -1
  105. package/build/src/lib/workflow-templates.d.ts.map +1 -1
  106. package/build/src/lib/workflow-templates.js +60 -2
  107. package/build/src/lib/workflow-templates.js.map +1 -1
  108. package/build/src/types/api/app-store-connect.d.ts +476 -33
  109. package/build/src/types/api/github-runner-images.d.ts +199 -0
  110. package/build/src/types/cli/generate/github/workflows-blueprint-validate.d.ts +76 -8
  111. package/build/src/types/cli/generate/github/workflows-blueprint.d.ts +178 -11
  112. package/build/src/types/cli/integration/app-store-connect.d.ts +470 -6
  113. package/build/src/types/cli/scaffold/package/pfsense.d.ts +83 -0
  114. package/build/src/types/cli/scaffold/tool/serverless.d.ts +30 -0
  115. package/build/src/types/cli/utility/changelog.d.ts +327 -1
  116. package/build/src/types/cli/utility/configure.d.ts +150 -4
  117. package/build/src/types/lib/artifact-assembly.d.ts +102 -0
  118. package/build/src/types/lib/docker-packaging.d.ts +54 -1
  119. package/build/src/types/lib/env-namespace.d.ts +4 -1
  120. package/build/src/types/lib/item.d.ts +7 -0
  121. package/build/src/types/lib/nova-config.d.ts +91 -2
  122. package/build/src/types/lib/regex.d.ts +91 -0
  123. package/build/src/types/lib/run-workspaces.d.ts +30 -0
  124. package/build/src/types/lib/scaffold.d.ts +67 -4
  125. package/build/src/types/lib/workflow-templates.d.ts +26 -0
  126. package/build/src/types/shared.d.ts +315 -3
  127. package/build/src/types/tests/api/app-store-connect.test.d.ts +162 -0
  128. package/build/src/types/tests/api/github-runner-images.test.d.ts +113 -0
  129. package/build/src/types/tests/cli/generate/github/workflows-blueprint-generate.test.d.ts +19 -0
  130. package/build/src/types/tests/cli/generate/github/workflows-blueprint-parity.test.d.ts +0 -9
  131. package/build/src/types/tests/cli/generate/github/workflows-blueprint-publish-parity.test.d.ts +109 -26
  132. package/build/src/types/tests/cli/generate/github/workflows-blueprint-validate.test.d.ts +146 -30
  133. package/build/src/types/tests/cli/generate/github/workflows-blueprint.test.d.ts +61 -0
  134. package/build/src/types/tests/cli/generate/github/workflows-version-contract.test.d.ts +2 -2
  135. package/build/src/types/tests/cli/generate/must-haves/agent-conventions.test.d.ts +2 -0
  136. package/build/src/types/tests/cli/integration/app-store-connect.test.d.ts +876 -0
  137. package/build/src/types/tests/cli/scaffold/app/nextjs.test.d.ts +6 -0
  138. package/build/src/types/tests/cli/scaffold/tool/serverless.test.d.ts +21 -0
  139. package/build/src/types/tests/cli/utility/changelog-android.test.d.ts +14 -0
  140. package/build/src/types/tests/cli/utility/changelog-apple.test.d.ts +21 -0
  141. package/build/src/types/tests/cli/utility/changelog-fold.test.d.ts +350 -0
  142. package/build/src/types/tests/cli/utility/changelog.test.d.ts +50 -0
  143. package/build/src/types/tests/cli/utility/configure.test.d.ts +56 -0
  144. package/build/src/types/tests/cli/utility/run-workspaces.test.d.ts +29 -2
  145. package/build/src/types/tests/lib/artifact-assembly.test.d.ts +45 -0
  146. package/build/src/types/tests/lib/docker-packaging.test.d.ts +12 -0
  147. package/build/src/types/tests/lib/nova-config-artifacts.test.d.ts +40 -0
  148. package/build/src/types/tests/lib/nova-config.test.d.ts +28 -0
  149. package/build/src/types/tests/lib/scaffold.test.d.ts +59 -2
  150. package/build/src/types/tests/scaffold-output-contract.test.d.ts +79 -0
  151. package/build/templates/generators/must-haves/agent-conventions/AGENTS.md +1 -0
  152. package/build/templates/generators/must-haves/agent-conventions/CLAUDE.md +1 -0
  153. package/build/templates/generators/must-haves/agent-conventions/conventions/nova.md +7 -1
  154. package/build/templates/generators/must-haves/agent-conventions/conventions/pfsense.md +311 -0
  155. package/build/templates/scaffold/app/android/package.json +1 -1
  156. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-ios-1024.png +0 -0
  157. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-128.png +0 -0
  158. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-128@2x.png +0 -0
  159. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-16.png +0 -0
  160. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-16@2x.png +0 -0
  161. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-256.png +0 -0
  162. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-256@2x.png +0 -0
  163. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-32.png +0 -0
  164. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-32@2x.png +0 -0
  165. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-512.png +0 -0
  166. package/build/templates/scaffold/app/apple/Sources/Assets.xcassets/AppIcon.appiconset/AppIcon-mac-512@2x.png +0 -0
  167. package/build/templates/scaffold/app/apple/package.json +1 -1
  168. package/build/templates/scaffold/app/astro/package.json +1 -1
  169. package/build/templates/scaffold/app/discord-bot/package.json +1 -1
  170. package/build/templates/scaffold/app/express/package.json +1 -1
  171. package/build/templates/scaffold/app/nextjs/package.json +1 -1
  172. package/build/templates/scaffold/app/vite/package.json +1 -1
  173. package/build/templates/scaffold/docs/docusaurus/package.json +2 -2
  174. package/build/templates/scaffold/package/github-action/package.json +1 -1
  175. package/build/templates/scaffold/package/homebridge/package.json +1 -1
  176. package/build/templates/scaffold/package/pfsense/package.json +1 -1
  177. package/build/templates/scaffold/package/pfsense/port/Makefile.template +16 -1
  178. package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__]/FileLock.php +93 -0
  179. package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__]/PackagePaths.php +40 -0
  180. package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__]/UpdateManager.php +1667 -0
  181. package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__].inc +161 -13
  182. package/build/templates/scaffold/package/pfsense/port/files/usr/local/pkg/[__WORKSPACE_NAME__].xml +37 -0
  183. package/build/templates/scaffold/package/pfsense/port/files/usr/local/sbin/[__WORKSPACE_NAME__] +203 -8
  184. package/build/templates/scaffold/package/pfsense/port/files/usr/local/share/pfSense-pkg-[__WORKSPACE_IDENTIFIER__]/logo.svg +12 -0
  185. package/build/templates/scaffold/package/pfsense/port/files/usr/local/share/pfSense-pkg-[__WORKSPACE_IDENTIFIER__]/release-signing.pub +9 -0
  186. package/build/templates/scaffold/package/pfsense/port/files/usr/local/www/[__WORKSPACE_NAME__]-about.php +437 -0
  187. package/build/templates/scaffold/package/pfsense/port/pkg-plist +6 -0
  188. package/build/templates/scaffold/package/pfsense/scripts/build-package.sh +54 -0
  189. package/build/templates/scaffold/package/pfsense/scripts/check-package.mjs +114 -1
  190. package/build/templates/scaffold/package/pfsense/scripts/regex.mjs +10 -0
  191. package/build/templates/scaffold/package/pfsense/tests/updates.php +695 -0
  192. package/build/templates/scaffold-options/app/android-native/app/src/main/res/drawable/ic_launcher_background.xml +1 -1
  193. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
  194. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
  195. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
  196. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
  197. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
  198. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
  199. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
  200. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
  201. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
  202. package/build/templates/scaffold-options/app/android-native/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
  203. package/build/templates/scaffold-options/docker-image/common/Dockerfile +7 -0
  204. package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/package.json +1 -1
  205. package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/types/worker/index.test.d.ts +40 -2
  206. package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/types/worker/landing-page.d.ts +23 -0
  207. package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/worker/index.test.ts +119 -4
  208. package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/worker/index.ts +25 -3
  209. package/build/templates/scaffold-options/tool/serverless/cloudflare-workers/src/worker/landing-page.ts +278 -0
  210. package/build/templates/scaffold-options/tool/serverless/vercel-functions/api/index.test.ts +121 -6
  211. package/build/templates/scaffold-options/tool/serverless/vercel-functions/api/index.ts +49 -12
  212. package/build/templates/scaffold-options/tool/serverless/vercel-functions/package.json +3 -1
  213. package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/function/landing-page.ts +278 -0
  214. package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/types/api/index.d.ts +17 -2
  215. package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/types/api/index.test.d.ts +40 -2
  216. package/build/templates/scaffold-options/tool/serverless/vercel-functions/src/types/function/landing-page.d.ts +23 -0
  217. package/build/templates/scaffold-options/tool/serverless/vercel-functions/tsconfig.functions.json +3 -1
  218. package/build/templates/scaffold-options/tool/serverless/vercel-functions/vercel.json +7 -1
  219. package/package.json +1 -1
  220. package/build/templates/scaffold/package/pfsense-root/.github/workflows/pfsense-[__WORKSPACE_NAME__].yml +0 -62
@@ -2,6 +2,7 @@ import { promises as fs } from 'node:fs';
2
2
  import { join, relative, sep } from 'node:path';
3
3
  import chalk from 'chalk';
4
4
  import prompts from 'prompts';
5
+ import { GITHUB_RUNNER_IMAGES_README_URL, Runner as GithubRunnerImages, } from '../../api/github-runner-images.js';
5
6
  import { libEnvGithub } from '../../lib/env-github.js';
6
7
  import { libEnvManagedSet } from '../../lib/env-managed-set.js';
7
8
  import { libEnvNamespace } from '../../lib/env-namespace.js';
@@ -15,7 +16,7 @@ import { LIB_REGEX_LINEBREAK_CRLF_OR_LF, LIB_REGEX_PATTERN_EMAIL_SIMPLE, LIB_REG
15
16
  import { Runner as LibReleaseHistory } from '../../lib/release-history.js';
16
17
  import { discoverPathsWithFile, isPlainObject, pathExists, resolveTemplatePath, } from '../../lib/utility.js';
17
18
  import { Runner as LibVersionStrategyMigration } from '../../lib/version-strategy-migration.js';
18
- import { libWorkflowTemplatesMetadata } from '../../lib/workflow-templates.js';
19
+ import { libWorkflowStepKinds, libWorkflowTemplatesMetadata, } from '../../lib/workflow-templates.js';
19
20
  import { Logger } from '../../toolkit/index.js';
20
21
  export class Runner {
21
22
  static async run(options) {
@@ -116,6 +117,54 @@ export class Runner {
116
117
  }
117
118
  return (value === true) ? 1 : 2;
118
119
  }
120
+ static isArtifactRecordInput(value) {
121
+ if (typeof value !== 'string') {
122
+ return 'Enter a JSON object of named artifacts.';
123
+ }
124
+ const trimmed = value.trim();
125
+ if (trimmed === '') {
126
+ return true;
127
+ }
128
+ try {
129
+ const parsed = JSON.parse(trimmed);
130
+ if (isPlainObject(parsed) === false) {
131
+ return 'Enter a JSON object of named artifacts.';
132
+ }
133
+ for (const rawArtifactEntry of Object.entries(parsed)) {
134
+ const artifactEntry = rawArtifactEntry;
135
+ const name = artifactEntry[0];
136
+ const artifact = artifactEntry[1];
137
+ if (LIB_REGEX_PATTERN_SLUG_SIMPLE.test(name) === false || isPlainObject(artifact) === false) {
138
+ return 'Every artifact name must be a simple slug mapped to an object.';
139
+ }
140
+ const build = artifact['build'];
141
+ const sources = artifact['sources'];
142
+ if (Array.isArray(build) === false
143
+ || build.length === 0
144
+ || build.some((entry) => (typeof entry !== 'string'
145
+ || entry.trim().length === 0)) === true) {
146
+ return `Artifact "${name}" must declare a non-empty build array.`;
147
+ }
148
+ if (Array.isArray(sources) === false || sources.length === 0) {
149
+ return `Artifact "${name}" must declare a non-empty sources array.`;
150
+ }
151
+ for (const sourceValue of sources) {
152
+ const source = sourceValue;
153
+ if (isPlainObject(source) === false
154
+ || typeof source['from'] !== 'string'
155
+ || source['from'].startsWith('./') === false
156
+ || typeof source['to'] !== 'string'
157
+ || source['to'].startsWith('./') === false) {
158
+ return `Every source for artifact "${name}" must declare project-relative from and to paths.`;
159
+ }
160
+ }
161
+ }
162
+ }
163
+ catch {
164
+ return 'Enter valid JSON for the named artifact map.';
165
+ }
166
+ return true;
167
+ }
119
168
  static isBooleanRecordInput(value) {
120
169
  if (typeof value !== 'string') {
121
170
  return 'Enter a JSON object with boolean values.';
@@ -136,6 +185,16 @@ export class Runner {
136
185
  }
137
186
  return true;
138
187
  }
188
+ static isEnvironmentPrefixInput(value) {
189
+ if (typeof value !== 'string') {
190
+ return 'Use one uppercase word containing only letters or digits, starting with a letter, followed by "_" (for example, "CBN_").';
191
+ }
192
+ const trimmed = value.trim();
193
+ if (libEnvNamespace.isValidPrefix(trimmed) === false) {
194
+ return 'Use one uppercase word containing only letters or digits, starting with a letter, followed by "_" (for example, "CBN_").';
195
+ }
196
+ return true;
197
+ }
139
198
  static isIgnoreFilePathInput(value) {
140
199
  if (typeof value !== 'string') {
141
200
  return 'Enter a project-relative ignore-file path.';
@@ -185,6 +244,41 @@ export class Runner {
185
244
  }
186
245
  return true;
187
246
  }
247
+ static isWorkflowStepTimeoutInput(value) {
248
+ if (typeof value !== 'string') {
249
+ return 'Enter a JSON object keyed by a supported step kind, or leave the field blank.';
250
+ }
251
+ const trimmed = value.trim();
252
+ if (trimmed === '') {
253
+ return true;
254
+ }
255
+ try {
256
+ const parsed = JSON.parse(trimmed);
257
+ if (isPlainObject(parsed) === false) {
258
+ return 'Enter a JSON object keyed by a supported step kind.';
259
+ }
260
+ const entries = Object.entries(parsed);
261
+ for (const entry of entries) {
262
+ const typedEntry = entry;
263
+ const entryKind = typedEntry[0];
264
+ const entryValue = typedEntry[1];
265
+ const isKnownKind = libWorkflowStepKinds.some((stepKind) => stepKind === entryKind);
266
+ if (isKnownKind === false) {
267
+ return `Unknown step kind "${entryKind}". Allowed kinds: ${libWorkflowStepKinds.join(', ')}.`;
268
+ }
269
+ if (typeof entryValue !== 'number'
270
+ || Number.isInteger(entryValue) === false
271
+ || entryValue < 1
272
+ || entryValue > 360) {
273
+ return `Enter a whole number from 1 through 360 for "${entryKind}".`;
274
+ }
275
+ }
276
+ }
277
+ catch {
278
+ return 'Enter valid JSON, for example {"install":10,"deploy":15}.';
279
+ }
280
+ return true;
281
+ }
188
282
  static isPositiveIntegerRecordInput(value) {
189
283
  if (typeof value !== 'string') {
190
284
  return 'Enter a JSON object with positive integer values.';
@@ -256,6 +350,13 @@ export class Runner {
256
350
  }
257
351
  return true;
258
352
  }
353
+ static parseArtifactRecordInput(value) {
354
+ const trimmed = value.trim();
355
+ if (trimmed === '') {
356
+ return undefined;
357
+ }
358
+ return JSON.parse(trimmed);
359
+ }
259
360
  static parseBooleanRecordInput(value) {
260
361
  const trimmed = value.trim();
261
362
  if (trimmed === '') {
@@ -284,6 +385,28 @@ export class Runner {
284
385
  }
285
386
  return JSON.parse(trimmed);
286
387
  }
388
+ static async promptArtifacts(config) {
389
+ const existing = config['artifacts'] ?? {};
390
+ const output = await Runner.promptWithCancel({
391
+ type: 'text',
392
+ name: 'artifacts',
393
+ message: 'Named artifact map as JSON (blank removes all artifacts)',
394
+ initial: (Object.keys(existing).length > 0) ? JSON.stringify(existing) : '',
395
+ validate: Runner['isArtifactRecordInput'],
396
+ });
397
+ if (output['cancelled'] === true) {
398
+ return 'back';
399
+ }
400
+ const outputResult = output['result'];
401
+ const parsed = Runner.parseArtifactRecordInput(outputResult.artifacts);
402
+ if (parsed === undefined) {
403
+ Reflect.deleteProperty(config, 'artifacts');
404
+ }
405
+ else {
406
+ Reflect.set(config, 'artifacts', parsed);
407
+ }
408
+ return 'back';
409
+ }
287
410
  static async promptFlow(config) {
288
411
  const category = {
289
412
  project: {
@@ -326,6 +449,11 @@ export class Runner {
326
449
  description: 'Review workspace packages, assigning roles and policies.',
327
450
  handler: Runner['promptWorkspaces'],
328
451
  },
452
+ artifacts: {
453
+ label: 'Artifacts',
454
+ description: 'Configure named final products assembled beneath the root build folder.',
455
+ handler: Runner['promptArtifacts'],
456
+ },
329
457
  ignoreFiles: {
330
458
  label: 'Ignore Files',
331
459
  description: 'Manage project-specific physical ignore-file patterns.',
@@ -3647,9 +3775,44 @@ export class Runner {
3647
3775
  }
3648
3776
  }
3649
3777
  static async promptWorkflowsForm(workflow, mode, workflows, config) {
3778
+ const runnerImages = await GithubRunnerImages.fetchRunnerImages();
3779
+ if (runnerImages === undefined) {
3780
+ Logger.customize({
3781
+ name: 'Runner.promptWorkflowsForm',
3782
+ purpose: 'runners',
3783
+ }).error(`Could not read GitHub's runner list from ${GITHUB_RUNNER_IMAGES_README_URL}.`);
3784
+ return {
3785
+ action: 'back',
3786
+ };
3787
+ }
3788
+ const selectableRunnerLabels = GithubRunnerImages.selectableLabels(runnerImages);
3789
+ const existingRunsOn = (workflow !== undefined && typeof workflow['runsOn'] === 'string') ? workflow['runsOn'] : '';
3790
+ const runnerChoices = selectableRunnerLabels.map((entry) => {
3791
+ const paidSuffix = (entry['paid'] === true) ? ' (paid)' : '';
3792
+ return {
3793
+ title: `${entry['label']}${paidSuffix}`,
3794
+ description: `${entry['imageName']}, ${entry['architecture']}`,
3795
+ value: entry['label'],
3796
+ };
3797
+ });
3798
+ let runnerInitialIndex = selectableRunnerLabels.findIndex((entry) => entry['label'] === existingRunsOn);
3799
+ if (runnerInitialIndex === -1) {
3800
+ runnerInitialIndex = selectableRunnerLabels.findIndex((entry) => entry['label'].startsWith('ubuntu-') === true && entry['architecture'] === 'x64');
3801
+ }
3802
+ if (runnerInitialIndex === -1) {
3803
+ Logger.customize({
3804
+ name: 'Runner.promptWorkflowsForm',
3805
+ purpose: 'runners',
3806
+ }).error('GitHub\'s runner list does not contain an available pinned Ubuntu x64 label.');
3807
+ return {
3808
+ action: 'back',
3809
+ };
3810
+ }
3650
3811
  const existingTemplate = (workflow !== undefined && typeof workflow['template'] === 'string') ? workflow['template'] : '';
3651
3812
  const existingSuffix = (workflow !== undefined && typeof workflow['name'] === 'string') ? workflow['name'] : '';
3652
3813
  const existingTimeoutMinutes = (workflow !== undefined && typeof workflow['timeoutMinutes'] === 'number') ? workflow['timeoutMinutes'] : undefined;
3814
+ const existingBuildTimeoutMinutes = (workflow !== undefined && typeof workflow['buildTimeoutMinutes'] === 'number') ? workflow['buildTimeoutMinutes'] : undefined;
3815
+ const existingStepTimeoutMinutes = (workflow !== undefined) ? workflow['stepTimeoutMinutes'] : undefined;
3653
3816
  const existingEnvironmentSelection = (workflow !== undefined) ? workflow['environmentSelection'] : undefined;
3654
3817
  const existingContainerPlatforms = (workflow !== undefined
3655
3818
  && Array.isArray(workflow['containerPlatforms']) === true
@@ -3731,11 +3894,8 @@ export class Runner {
3731
3894
  type: 'select',
3732
3895
  name: 'runsOn',
3733
3896
  message: 'GitHub-hosted runner',
3734
- choices: [{
3735
- title: 'ubuntu-latest',
3736
- value: 'ubuntu-latest',
3737
- }],
3738
- initial: 0,
3897
+ choices: runnerChoices,
3898
+ initial: runnerInitialIndex,
3739
3899
  },
3740
3900
  {
3741
3901
  type: 'text',
@@ -3744,6 +3904,20 @@ export class Runner {
3744
3904
  initial: (existingTimeoutMinutes === undefined) ? '' : `${existingTimeoutMinutes}`,
3745
3905
  validate: Runner['isOptionalWorkflowTimeoutInput'],
3746
3906
  },
3907
+ ...((selectedTemplate === 'publish') ? [{
3908
+ type: 'text',
3909
+ name: 'buildTimeoutMinutes',
3910
+ message: 'Publish build job timeout in minutes (1-360; blank inherits the workflow timeout)',
3911
+ initial: (existingBuildTimeoutMinutes === undefined) ? '' : `${existingBuildTimeoutMinutes}`,
3912
+ validate: Runner['isOptionalWorkflowTimeoutInput'],
3913
+ }] : []),
3914
+ {
3915
+ type: 'text',
3916
+ name: 'stepTimeoutMinutes',
3917
+ message: `Step timeouts as JSON (${libWorkflowStepKinds.join(', ')}; blank keeps defaults)`,
3918
+ initial: (existingStepTimeoutMinutes === undefined) ? '' : JSON.stringify(existingStepTimeoutMinutes),
3919
+ validate: Runner['isWorkflowStepTimeoutInput'],
3920
+ },
3747
3921
  ]);
3748
3922
  if (executionOutput['cancelled'] === true) {
3749
3923
  return {
@@ -3751,9 +3925,13 @@ export class Runner {
3751
3925
  };
3752
3926
  }
3753
3927
  const executionOutputResultValue = executionOutput['result'];
3754
- const selectedRunsOn = (executionOutputResultValue.runsOn === 'ubuntu-latest') ? executionOutputResultValue.runsOn : 'ubuntu-latest';
3928
+ const selectedRunsOn = executionOutputResultValue['runsOn'];
3755
3929
  const timeoutMinutesRaw = (typeof executionOutputResultValue.timeoutMinutes === 'string') ? executionOutputResultValue.timeoutMinutes.trim() : '';
3756
3930
  const selectedTimeoutMinutes = (timeoutMinutesRaw === '') ? undefined : Number.parseInt(timeoutMinutesRaw, 10);
3931
+ const buildTimeoutMinutesRaw = (typeof executionOutputResultValue.buildTimeoutMinutes === 'string') ? executionOutputResultValue.buildTimeoutMinutes.trim() : '';
3932
+ const selectedBuildTimeoutMinutes = (buildTimeoutMinutesRaw === '') ? undefined : Number.parseInt(buildTimeoutMinutesRaw, 10);
3933
+ const stepTimeoutMinutesRaw = (typeof executionOutputResultValue.stepTimeoutMinutes === 'string') ? executionOutputResultValue.stepTimeoutMinutes.trim() : '';
3934
+ const selectedStepTimeoutMinutes = (stepTimeoutMinutesRaw === '') ? undefined : JSON.parse(stepTimeoutMinutesRaw);
3757
3935
  const triggersDir = join(resolveTemplatePath(import.meta.url, 'generators/github/workflows'), selectedTemplate, 'triggers');
3758
3936
  const triggersDirExists = await pathExists(triggersDir);
3759
3937
  const triggerChoices = [];
@@ -3894,7 +4072,22 @@ export class Runner {
3894
4072
  if ((matchedMetadata !== undefined
3895
4073
  && matchedMetadata['supportsTargets'] === true)
3896
4074
  || selectedTargets.length > 0) {
3897
- const availableTargetTypes = (matchedMetadata !== undefined) ? Object.keys(matchedMetadata['targets'] ?? {}) : [];
4075
+ const availableTargetTypes = (matchedMetadata !== undefined) ? Object.keys(matchedMetadata['targets'] ?? {}).filter((availableTargetType) => {
4076
+ const availableTargetMetadata = (matchedMetadata['targets'] !== undefined) ? matchedMetadata['targets'][availableTargetType] : undefined;
4077
+ if (availableTargetMetadata === undefined
4078
+ || (availableTargetMetadata['workspaceRole'] === undefined
4079
+ && availableTargetMetadata['workspaceNamePrefix'] === undefined)) {
4080
+ return true;
4081
+ }
4082
+ return workspaceKeys.some((workspaceKey) => {
4083
+ const availableTargetWorkspace = (config['workspaces'] !== undefined) ? config['workspaces'][workspaceKey] : undefined;
4084
+ return (availableTargetWorkspace !== undefined
4085
+ && (availableTargetMetadata['workspaceRole'] === undefined
4086
+ || availableTargetWorkspace['role'] === availableTargetMetadata['workspaceRole'])
4087
+ && (availableTargetMetadata['workspaceNamePrefix'] === undefined
4088
+ || availableTargetWorkspace['name'].startsWith(availableTargetMetadata['workspaceNamePrefix']) === true));
4089
+ });
4090
+ }) : [];
3898
4091
  const existingTargetTypes = selectedTargets.map((target) => target['to']);
3899
4092
  const hasContainerTargetInAnotherWorkflow = workflows.some((candidate) => {
3900
4093
  if (candidate === workflow || Array.isArray(candidate['deploy']) === false) {
@@ -4018,8 +4211,20 @@ export class Runner {
4018
4211
  const isContainerTarget = selectedTargetType === 'docker-hub' || selectedTargetType === 'ghcr';
4019
4212
  let selectedTargetWorkingDir = './';
4020
4213
  if (isContainerTarget === false) {
4021
- const targetWorkingDirInitial = (targetToEdit !== undefined) ? workspaceKeys.indexOf(targetToEdit['path']) : 0;
4022
- const targetWorkingDirChoices = workspaceKeys.map((workspaceKey) => ({
4214
+ const targetPathMetadata = (matchedMetadata !== undefined
4215
+ && matchedMetadata['targets'] !== undefined) ? matchedMetadata['targets'][selectedTargetType] : undefined;
4216
+ const targetWorkspaceKeys = workspaceKeys.filter((workspaceKey) => {
4217
+ const targetPathWorkspace = (config['workspaces'] !== undefined) ? config['workspaces'][workspaceKey] : undefined;
4218
+ return (targetPathWorkspace !== undefined
4219
+ && (targetPathMetadata === undefined
4220
+ || targetPathMetadata['workspaceRole'] === undefined
4221
+ || targetPathWorkspace['role'] === targetPathMetadata['workspaceRole'])
4222
+ && (targetPathMetadata === undefined
4223
+ || targetPathMetadata['workspaceNamePrefix'] === undefined
4224
+ || targetPathWorkspace['name'].startsWith(targetPathMetadata['workspaceNamePrefix']) === true));
4225
+ });
4226
+ const targetWorkingDirInitial = (targetToEdit !== undefined) ? targetWorkspaceKeys.indexOf(targetToEdit['path']) : 0;
4227
+ const targetWorkingDirChoices = targetWorkspaceKeys.map((workspaceKey) => ({
4023
4228
  title: workspaceKey,
4024
4229
  value: workspaceKey,
4025
4230
  }));
@@ -4083,16 +4288,27 @@ export class Runner {
4083
4288
  const targetNeedsOutputResultValue = targetNeedsOutput['result'];
4084
4289
  selectedTargetNeeds = (Array.isArray(targetNeedsOutputResultValue.targetNeeds) === true && targetNeedsOutputResultValue.targetNeeds.length > 0) ? targetNeedsOutputResultValue.targetNeeds : undefined;
4085
4290
  }
4086
- const targetSettingsOutput = await Runner.promptWithCancel({
4087
- type: 'text',
4088
- name: 'targetSettings',
4089
- message: 'Target settings as a JSON object (blank unsets)',
4090
- initial: (targetToEdit !== undefined && targetToEdit['with'] !== undefined) ? JSON.stringify(targetToEdit['with']) : '',
4091
- validate: Runner['isStringRecordInput'],
4092
- });
4291
+ const targetSettingsOutput = await Runner.promptWithCancel([
4292
+ {
4293
+ type: 'text',
4294
+ name: 'targetTimeoutMinutes',
4295
+ message: 'Target job timeout in minutes (1-360; blank inherits the workflow timeout)',
4296
+ initial: (targetToEdit !== undefined && targetToEdit['timeoutMinutes'] !== undefined) ? `${targetToEdit['timeoutMinutes']}` : '',
4297
+ validate: Runner['isOptionalWorkflowTimeoutInput'],
4298
+ },
4299
+ {
4300
+ type: 'text',
4301
+ name: 'targetSettings',
4302
+ message: 'Target settings as a JSON object (blank unsets)',
4303
+ initial: (targetToEdit !== undefined && targetToEdit['with'] !== undefined) ? JSON.stringify(targetToEdit['with']) : '',
4304
+ validate: Runner['isStringRecordInput'],
4305
+ },
4306
+ ]);
4093
4307
  if (targetSettingsOutput['cancelled'] === true) {
4094
4308
  continue;
4095
4309
  }
4310
+ const targetTimeoutMinutesRaw = (typeof targetSettingsOutput['result'].targetTimeoutMinutes === 'string') ? targetSettingsOutput['result'].targetTimeoutMinutes.trim() : '';
4311
+ const selectedTargetTimeoutMinutes = (targetTimeoutMinutesRaw === '') ? undefined : Number.parseInt(targetTimeoutMinutesRaw, 10);
4096
4312
  const targetSettings = Runner.parseStringRecordInput(targetSettingsOutput['result'].targetSettings);
4097
4313
  const selectedTargetMetadata = (matchedMetadata === undefined || matchedMetadata['targets'] === undefined) ? undefined : matchedMetadata['targets'][selectedTargetType];
4098
4314
  const targetRequiredLiterals = (selectedTargetMetadata === undefined || selectedTargetMetadata['requiredLiterals'] === undefined) ? {} : selectedTargetMetadata['requiredLiterals'];
@@ -4127,6 +4343,9 @@ export class Runner {
4127
4343
  to: selectedTargetType,
4128
4344
  path: selectedTargetWorkingDir,
4129
4345
  };
4346
+ if (selectedTargetTimeoutMinutes !== undefined) {
4347
+ Reflect.set(newTarget, 'timeoutMinutes', selectedTargetTimeoutMinutes);
4348
+ }
4130
4349
  if (selectedTargetNeeds !== undefined) {
4131
4350
  Reflect.set(newTarget, 'after', selectedTargetNeeds);
4132
4351
  }
@@ -4399,6 +4618,12 @@ export class Runner {
4399
4618
  if (selectedTimeoutMinutes !== undefined) {
4400
4619
  Reflect.set(resolvedWorkflow, 'timeoutMinutes', selectedTimeoutMinutes);
4401
4620
  }
4621
+ if (selectedBuildTimeoutMinutes !== undefined) {
4622
+ Reflect.set(resolvedWorkflow, 'buildTimeoutMinutes', selectedBuildTimeoutMinutes);
4623
+ }
4624
+ if (selectedStepTimeoutMinutes !== undefined) {
4625
+ Reflect.set(resolvedWorkflow, 'stepTimeoutMinutes', selectedStepTimeoutMinutes);
4626
+ }
4402
4627
  if (selectedEnvironmentSelection !== undefined) {
4403
4628
  Reflect.set(resolvedWorkflow, 'environmentSelection', selectedEnvironmentSelection);
4404
4629
  }
@@ -4943,8 +5168,14 @@ export class Runner {
4943
5168
  const prefixOutput = await Runner.promptWithCancel({
4944
5169
  type: 'text',
4945
5170
  name: 'prefix',
4946
- message: `Prefix for workflow "${workflowName}" (blank removes it)`,
5171
+ message: `Prefix for workflow "${workflowName}" (e.g. "CBN_", blank removes it):`,
4947
5172
  initial: (existing !== undefined) ? existing['prefix'] : '',
5173
+ validate: (value) => {
5174
+ if (typeof value === 'string' && value.trim() === '') {
5175
+ return true;
5176
+ }
5177
+ return Runner.isEnvironmentPrefixInput(value);
5178
+ },
4948
5179
  });
4949
5180
  if (prefixOutput['cancelled'] === true) {
4950
5181
  return 'back';
@@ -4953,6 +5184,24 @@ export class Runner {
4953
5184
  if (prefix === '') {
4954
5185
  Reflect.deleteProperty(workflows, workflowName);
4955
5186
  }
5187
+ else if (libEnvNamespace.isValidPrefix(prefix) === false) {
5188
+ Logger.customize({
5189
+ name: 'Runner.promptEnvironmentWorkflow',
5190
+ purpose: 'prefixFormat',
5191
+ padTop: 1,
5192
+ padBottom: 1,
5193
+ }).error('Use one uppercase word containing only letters or digits, starting with a letter, followed by "_" (for example, "CBN_").');
5194
+ return 'back';
5195
+ }
5196
+ else if (libEnvNamespace.isReservedPrefix(prefix) === true) {
5197
+ Logger.customize({
5198
+ name: 'Runner.promptEnvironmentWorkflow',
5199
+ purpose: 'reservedPrefix',
5200
+ padTop: 1,
5201
+ padBottom: 1,
5202
+ }).error(`The prefix "${prefix}" is reserved by GitHub. Choose a prefix that does not start with "GITHUB_".`);
5203
+ return 'back';
5204
+ }
4956
5205
  else {
4957
5206
  Reflect.set(workflows, workflowName, { prefix });
4958
5207
  }
@@ -5209,15 +5458,24 @@ export class Runner {
5209
5458
  name: 'prefix',
5210
5459
  message: 'GitHub name prefix (e.g. "CBN_"):',
5211
5460
  initial: prefix,
5212
- validate: Runner['isNonEmptyLiteralInput'],
5461
+ validate: Runner['isEnvironmentPrefixInput'],
5213
5462
  });
5214
5463
  if (prefixOutput['cancelled'] === true) {
5215
5464
  continue;
5216
5465
  }
5217
- const prefixInput = prefixOutput['result'].prefix.trim().toUpperCase();
5466
+ const prefixInput = prefixOutput['result'].prefix.trim();
5218
5467
  if (prefixInput === '') {
5219
5468
  continue;
5220
5469
  }
5470
+ if (libEnvNamespace.isValidPrefix(prefixInput) === false) {
5471
+ Logger.customize({
5472
+ name: 'Runner.promptEnvironmentScope',
5473
+ purpose: 'prefixFormat',
5474
+ padTop: 1,
5475
+ padBottom: 1,
5476
+ }).error('Use one uppercase word containing only letters or digits, starting with a letter, followed by "_" (for example, "CBN_").');
5477
+ continue;
5478
+ }
5221
5479
  if (libEnvNamespace.isReservedPrefix(prefixInput) === true) {
5222
5480
  Logger.customize({
5223
5481
  name: 'Runner.promptEnvironmentScope',