@quenty/nevermore-cli 4.41.1 → 4.42.1-canary.783.30683193716.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 (207) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/args/global-args.d.ts +13 -0
  3. package/dist/args/global-args.d.ts.map +1 -1
  4. package/dist/commands/batch-command/batch-deploy-command.d.ts +3 -0
  5. package/dist/commands/batch-command/batch-deploy-command.d.ts.map +1 -1
  6. package/dist/commands/batch-command/batch-deploy-command.js +90 -1
  7. package/dist/commands/batch-command/batch-deploy-command.js.map +1 -1
  8. package/dist/commands/batch-command/batch-test-command.d.ts.map +1 -1
  9. package/dist/commands/batch-command/batch-test-command.js +25 -4
  10. package/dist/commands/batch-command/batch-test-command.js.map +1 -1
  11. package/dist/commands/deploy-command/deploy-init.js +1 -1
  12. package/dist/commands/deploy-command/deploy-init.js.map +1 -1
  13. package/dist/commands/deploy-command/index.d.ts +3 -0
  14. package/dist/commands/deploy-command/index.d.ts.map +1 -1
  15. package/dist/commands/deploy-command/index.js +297 -60
  16. package/dist/commands/deploy-command/index.js.map +1 -1
  17. package/dist/commands/deploy-command/select-target.js +1 -1
  18. package/dist/commands/deploy-command/select-target.js.map +1 -1
  19. package/dist/commands/deploy-command/version-command.d.ts.map +1 -1
  20. package/dist/commands/deploy-command/version-command.js +138 -12
  21. package/dist/commands/deploy-command/version-command.js.map +1 -1
  22. package/dist/commands/test-command/test-command.d.ts.map +1 -1
  23. package/dist/commands/test-command/test-command.js +23 -11
  24. package/dist/commands/test-command/test-command.js.map +1 -1
  25. package/dist/nevermore.js +17 -0
  26. package/dist/nevermore.js.map +1 -1
  27. package/dist/utils/batch/changed-packages-utils.d.ts +1 -1
  28. package/dist/utils/batch/changed-packages-utils.d.ts.map +1 -1
  29. package/dist/utils/batch/changed-packages-utils.js +1 -1
  30. package/dist/utils/batch/changed-packages-utils.js.map +1 -1
  31. package/dist/utils/build/base-place-resolver-factory.d.ts +25 -0
  32. package/dist/utils/build/base-place-resolver-factory.d.ts.map +1 -0
  33. package/dist/utils/build/base-place-resolver-factory.js +40 -0
  34. package/dist/utils/build/base-place-resolver-factory.js.map +1 -0
  35. package/dist/utils/build/build.d.ts +13 -2
  36. package/dist/utils/build/build.d.ts.map +1 -1
  37. package/dist/utils/build/build.js.map +1 -1
  38. package/dist/utils/build/upload.d.ts +1 -1
  39. package/dist/utils/build/upload.d.ts.map +1 -1
  40. package/dist/utils/deploy/deploy-metadata.d.ts +1 -1
  41. package/dist/utils/deploy/deploy-metadata.d.ts.map +1 -1
  42. package/dist/utils/job-context/base-job-context.d.ts +3 -1
  43. package/dist/utils/job-context/base-job-context.d.ts.map +1 -1
  44. package/dist/utils/job-context/base-job-context.js +45 -6
  45. package/dist/utils/job-context/base-job-context.js.map +1 -1
  46. package/dist/utils/job-context/batch-script-job-context.d.ts +6 -0
  47. package/dist/utils/job-context/batch-script-job-context.d.ts.map +1 -1
  48. package/dist/utils/job-context/batch-script-job-context.js +13 -0
  49. package/dist/utils/job-context/batch-script-job-context.js.map +1 -1
  50. package/dist/utils/job-context/cloud-job-context.d.ts +2 -1
  51. package/dist/utils/job-context/cloud-job-context.d.ts.map +1 -1
  52. package/dist/utils/job-context/cloud-job-context.js +2 -2
  53. package/dist/utils/job-context/cloud-job-context.js.map +1 -1
  54. package/dist/utils/job-context/local-job-context.d.ts +2 -1
  55. package/dist/utils/job-context/local-job-context.d.ts.map +1 -1
  56. package/dist/utils/job-context/local-job-context.js +2 -2
  57. package/dist/utils/job-context/local-job-context.js.map +1 -1
  58. package/dist/utils/open-cloud/open-cloud-client.d.ts +20 -2
  59. package/dist/utils/open-cloud/open-cloud-client.d.ts.map +1 -1
  60. package/dist/utils/open-cloud/open-cloud-client.js +78 -21
  61. package/dist/utils/open-cloud/open-cloud-client.js.map +1 -1
  62. package/dist/utils/open-cloud/open-cloud-client.test.js +89 -12
  63. package/dist/utils/open-cloud/open-cloud-client.test.js.map +1 -1
  64. package/dist/utils/testing/parsers/batch-log-parser.d.ts +13 -5
  65. package/dist/utils/testing/parsers/batch-log-parser.d.ts.map +1 -1
  66. package/dist/utils/testing/parsers/batch-log-parser.js +114 -68
  67. package/dist/utils/testing/parsers/batch-log-parser.js.map +1 -1
  68. package/dist/utils/testing/parsers/batch-log-parser.test.js +57 -5
  69. package/dist/utils/testing/parsers/batch-log-parser.test.js.map +1 -1
  70. package/dist/utils/testing/parsers/traceback-parser.d.ts +31 -0
  71. package/dist/utils/testing/parsers/traceback-parser.d.ts.map +1 -0
  72. package/dist/utils/testing/parsers/traceback-parser.js +91 -0
  73. package/dist/utils/testing/parsers/traceback-parser.js.map +1 -0
  74. package/dist/utils/testing/parsers/traceback-parser.test.d.ts +2 -0
  75. package/dist/utils/testing/parsers/traceback-parser.test.d.ts.map +1 -0
  76. package/dist/utils/testing/parsers/traceback-parser.test.js +45 -0
  77. package/dist/utils/testing/parsers/traceback-parser.test.js.map +1 -0
  78. package/dist/utils/testing/runner/combined-project-generator.d.ts +1 -1
  79. package/dist/utils/testing/runner/combined-project-generator.d.ts.map +1 -1
  80. package/dist/utils/testing/runner/test-runner.d.ts +9 -1
  81. package/dist/utils/testing/runner/test-runner.d.ts.map +1 -1
  82. package/dist/utils/testing/runner/test-runner.js +28 -3
  83. package/dist/utils/testing/runner/test-runner.js.map +1 -1
  84. package/dist/utils/testing/runner/test-runner.test.d.ts +2 -0
  85. package/dist/utils/testing/runner/test-runner.test.d.ts.map +1 -0
  86. package/dist/utils/testing/runner/test-runner.test.js +18 -0
  87. package/dist/utils/testing/runner/test-runner.test.js.map +1 -0
  88. package/dist/utils/testing/test-log-parser.d.ts +32 -1
  89. package/dist/utils/testing/test-log-parser.d.ts.map +1 -1
  90. package/dist/utils/testing/test-log-parser.js +53 -9
  91. package/dist/utils/testing/test-log-parser.js.map +1 -1
  92. package/dist/utils/testing/test-log-parser.test.d.ts +2 -0
  93. package/dist/utils/testing/test-log-parser.test.d.ts.map +1 -0
  94. package/dist/utils/testing/test-log-parser.test.js +56 -0
  95. package/dist/utils/testing/test-log-parser.test.js.map +1 -0
  96. package/dist/utils/watch/github-context.d.ts +50 -0
  97. package/dist/utils/watch/github-context.d.ts.map +1 -0
  98. package/dist/utils/watch/github-context.js +125 -0
  99. package/dist/utils/watch/github-context.js.map +1 -0
  100. package/dist/utils/watch/github-context.test.d.ts +2 -0
  101. package/dist/utils/watch/github-context.test.d.ts.map +1 -0
  102. package/dist/utils/watch/github-context.test.js +112 -0
  103. package/dist/utils/watch/github-context.test.js.map +1 -0
  104. package/dist/utils/watch/http-watch-registry.d.ts +40 -0
  105. package/dist/utils/watch/http-watch-registry.d.ts.map +1 -0
  106. package/dist/utils/watch/http-watch-registry.js +262 -0
  107. package/dist/utils/watch/http-watch-registry.js.map +1 -0
  108. package/dist/utils/watch/http-watch-registry.test.d.ts +2 -0
  109. package/dist/utils/watch/http-watch-registry.test.d.ts.map +1 -0
  110. package/dist/utils/watch/http-watch-registry.test.js +211 -0
  111. package/dist/utils/watch/http-watch-registry.test.js.map +1 -0
  112. package/dist/utils/watch/local-watch-loop.d.ts +50 -0
  113. package/dist/utils/watch/local-watch-loop.d.ts.map +1 -0
  114. package/dist/utils/watch/local-watch-loop.js +103 -0
  115. package/dist/utils/watch/local-watch-loop.js.map +1 -0
  116. package/dist/utils/watch/local-watch-loop.test.d.ts +2 -0
  117. package/dist/utils/watch/local-watch-loop.test.d.ts.map +1 -0
  118. package/dist/utils/watch/local-watch-loop.test.js +170 -0
  119. package/dist/utils/watch/local-watch-loop.test.js.map +1 -0
  120. package/dist/utils/watch/register-notify-watches.d.ts +41 -0
  121. package/dist/utils/watch/register-notify-watches.d.ts.map +1 -0
  122. package/dist/utils/watch/register-notify-watches.js +159 -0
  123. package/dist/utils/watch/register-notify-watches.js.map +1 -0
  124. package/dist/utils/watch/register-notify-watches.test.d.ts +2 -0
  125. package/dist/utils/watch/register-notify-watches.test.d.ts.map +1 -0
  126. package/dist/utils/watch/register-notify-watches.test.js +225 -0
  127. package/dist/utils/watch/register-notify-watches.test.js.map +1 -0
  128. package/dist/utils/watch/register-watches.d.ts +68 -0
  129. package/dist/utils/watch/register-watches.d.ts.map +1 -0
  130. package/dist/utils/watch/register-watches.js +221 -0
  131. package/dist/utils/watch/register-watches.js.map +1 -0
  132. package/dist/utils/watch/register-watches.test.d.ts +2 -0
  133. package/dist/utils/watch/register-watches.test.d.ts.map +1 -0
  134. package/dist/utils/watch/register-watches.test.js +576 -0
  135. package/dist/utils/watch/register-watches.test.js.map +1 -0
  136. package/dist/utils/watch/stream-watch-loop.d.ts +54 -0
  137. package/dist/utils/watch/stream-watch-loop.d.ts.map +1 -0
  138. package/dist/utils/watch/stream-watch-loop.js +282 -0
  139. package/dist/utils/watch/stream-watch-loop.js.map +1 -0
  140. package/dist/utils/watch/stream-watch-loop.test.d.ts +2 -0
  141. package/dist/utils/watch/stream-watch-loop.test.d.ts.map +1 -0
  142. package/dist/utils/watch/stream-watch-loop.test.js +392 -0
  143. package/dist/utils/watch/stream-watch-loop.test.js.map +1 -0
  144. package/dist/utils/watch/websocket-watch-stream.d.ts +25 -0
  145. package/dist/utils/watch/websocket-watch-stream.d.ts.map +1 -0
  146. package/dist/utils/watch/websocket-watch-stream.js +306 -0
  147. package/dist/utils/watch/websocket-watch-stream.js.map +1 -0
  148. package/dist/utils/watch/websocket-watch-stream.test.d.ts +2 -0
  149. package/dist/utils/watch/websocket-watch-stream.test.d.ts.map +1 -0
  150. package/dist/utils/watch/websocket-watch-stream.test.js +475 -0
  151. package/dist/utils/watch/websocket-watch-stream.test.js.map +1 -0
  152. package/package.json +7 -4
  153. package/src/args/global-args.ts +13 -0
  154. package/src/commands/batch-command/batch-deploy-command.ts +105 -1
  155. package/src/commands/batch-command/batch-test-command.ts +86 -60
  156. package/src/commands/deploy-command/deploy-init.ts +1 -1
  157. package/src/commands/deploy-command/index.ts +327 -32
  158. package/src/commands/deploy-command/select-target.ts +1 -1
  159. package/src/commands/deploy-command/version-command.ts +215 -21
  160. package/src/commands/test-command/test-command.ts +31 -22
  161. package/src/nevermore.ts +19 -0
  162. package/src/utils/batch/changed-packages-utils.ts +1 -1
  163. package/src/utils/build/base-place-resolver-factory.ts +49 -0
  164. package/src/utils/build/build.ts +13 -2
  165. package/src/utils/build/upload.ts +1 -1
  166. package/src/utils/deploy/deploy-metadata.ts +1 -1
  167. package/src/utils/job-context/base-job-context.ts +68 -6
  168. package/src/utils/job-context/batch-script-job-context.ts +18 -0
  169. package/src/utils/job-context/cloud-job-context.ts +7 -2
  170. package/src/utils/job-context/local-job-context.ts +7 -2
  171. package/src/utils/open-cloud/open-cloud-client.test.ts +133 -14
  172. package/src/utils/open-cloud/open-cloud-client.ts +131 -35
  173. package/src/utils/testing/parsers/batch-log-parser.test.ts +70 -5
  174. package/src/utils/testing/parsers/batch-log-parser.ts +141 -80
  175. package/src/utils/testing/parsers/traceback-parser.test.ts +64 -0
  176. package/src/utils/testing/parsers/traceback-parser.ts +122 -0
  177. package/src/utils/testing/runner/combined-project-generator.ts +1 -1
  178. package/src/utils/testing/runner/test-runner.test.ts +29 -0
  179. package/src/utils/testing/runner/test-runner.ts +36 -4
  180. package/src/utils/testing/test-log-parser.test.ts +70 -0
  181. package/src/utils/testing/test-log-parser.ts +80 -10
  182. package/src/utils/watch/github-context.test.ts +154 -0
  183. package/src/utils/watch/github-context.ts +184 -0
  184. package/src/utils/watch/http-watch-registry.test.ts +330 -0
  185. package/src/utils/watch/http-watch-registry.ts +341 -0
  186. package/src/utils/watch/local-watch-loop.test.ts +197 -0
  187. package/src/utils/watch/local-watch-loop.ts +190 -0
  188. package/src/utils/watch/register-notify-watches.test.ts +282 -0
  189. package/src/utils/watch/register-notify-watches.ts +226 -0
  190. package/src/utils/watch/register-watches.test.ts +696 -0
  191. package/src/utils/watch/register-watches.ts +369 -0
  192. package/src/utils/watch/stream-watch-loop.test.ts +625 -0
  193. package/src/utils/watch/stream-watch-loop.ts +411 -0
  194. package/src/utils/watch/websocket-watch-stream.test.ts +581 -0
  195. package/src/utils/watch/websocket-watch-stream.ts +403 -0
  196. package/tsconfig.json +19 -6
  197. package/tsconfig.tsbuildinfo +1 -1
  198. package/dist/utils/build/deploy-config.d.ts +0 -71
  199. package/dist/utils/build/deploy-config.d.ts.map +0 -1
  200. package/dist/utils/build/deploy-config.js +0 -164
  201. package/dist/utils/build/deploy-config.js.map +0 -1
  202. package/dist/utils/build/deploy-config.test.d.ts +0 -2
  203. package/dist/utils/build/deploy-config.test.d.ts.map +0 -1
  204. package/dist/utils/build/deploy-config.test.js +0 -126
  205. package/dist/utils/build/deploy-config.test.js.map +0 -1
  206. package/src/utils/build/deploy-config.test.ts +0 -149
  207. package/src/utils/build/deploy-config.ts +0 -259
@@ -28,6 +28,10 @@ import {
28
28
  import { OpenCloudClient } from '../../utils/open-cloud/open-cloud-client.js';
29
29
  import { RateLimiter } from '../../utils/open-cloud/rate-limiter.js';
30
30
  import { CloudJobContext } from '../../utils/job-context/cloud-job-context.js';
31
+ import {
32
+ createBasePlaceResolver,
33
+ createLockOnlyBasePlaceResolver,
34
+ } from '../../utils/build/base-place-resolver-factory.js';
31
35
  import {
32
36
  type BatchTarget,
33
37
  discoverAllTargetPackagesAsync,
@@ -39,6 +43,8 @@ import {
39
43
  readPackageVersionAsync,
40
44
  } from '../../utils/nevermore-cli-utils.js';
41
45
  import { parseTestLogs } from '../../utils/testing/test-log-parser.js';
46
+ import { parseWatchOption } from '@quenty/nevermore-deploy';
47
+ import { registerWatchesAsync } from '../../utils/watch/register-watches.js';
42
48
 
43
49
  const SMOKE_TEST_SCRIPT_PATH = resolvePackagePath(
44
50
  import.meta.url,
@@ -57,6 +63,9 @@ interface BatchDeployArgs extends NevermoreGlobalArgs {
57
63
  logs?: boolean;
58
64
  target?: string;
59
65
  smokeTest?: boolean;
66
+ watch?: string;
67
+ watchShareApiKey?: boolean;
68
+ watchUseGhAuth?: boolean;
60
69
  }
61
70
 
62
71
  export const batchDeployCommand: CommandModule<
@@ -115,6 +124,28 @@ export const batchDeployCommand: CommandModule<
115
124
  '(executes server scripts via Open Cloud and waits for errors)',
116
125
  type: 'boolean',
117
126
  default: false,
127
+ })
128
+ .option('watch', {
129
+ describe:
130
+ 'After deploying, register a cloud watch for every place with a "watch" field, ' +
131
+ 'so it rebuilds when its base place changes. Takes the register endpoint ' +
132
+ 'URL, ending in the lease: https://<watch-service>/v1/register/7d',
133
+ type: 'string',
134
+ })
135
+ .option('watch-use-gh-auth', {
136
+ describe:
137
+ 'Let the GitHub CLI supply the watch token when no environment variable does. ' +
138
+ 'Off by default: registering sends the token to the watch service, so it should be one you handed over.',
139
+ type: 'boolean',
140
+ default: false,
141
+ })
142
+ .option('watch-share-api-key', {
143
+ describe:
144
+ 'Share the Open Cloud API key with the watch service, so it can read private base places, ' +
145
+ 'see "saved" versions, and report versions in the same vocabulary as the lock file. ' +
146
+ 'Off by default — the key is stored by the service.',
147
+ type: 'boolean',
148
+ default: false,
118
149
  });
119
150
  },
120
151
  handler: async (args) => {
@@ -129,6 +160,9 @@ export const batchDeployCommand: CommandModule<
129
160
 
130
161
  async function _runAsync(args: BatchDeployArgs): Promise<void> {
131
162
  const targetName = args.target ?? 'test';
163
+ // Parsed up front so a typo'd duration fails before anything is deployed.
164
+ const watchOption =
165
+ args.watch == null ? undefined : parseWatchOption(args.watch);
132
166
 
133
167
  const discovered = args.all
134
168
  ? await discoverAllTargetPackagesAsync(targetName)
@@ -159,6 +193,46 @@ async function _runAsync(args: BatchDeployArgs): Promise<void> {
159
193
  OutputHelper.info(
160
194
  `[DRYRUN] Would deploy ${batchTargets.length} targets: ${names}`
161
195
  );
196
+ // Registration is idempotent and derives from committed config plus the
197
+ // lock file, so it runs for real even on a dryrun — that is what makes the
198
+ // watch path testable without shipping a build.
199
+ if (watchOption) {
200
+ OutputHelper.info(
201
+ '[DRYRUN] Registering separate dryrun watches and firing them, to ' +
202
+ 'prove routing works. This does not build or upload here — but ' +
203
+ 'firing really does dispatch the workflow once per package, and ' +
204
+ 'each of those runs a real deploy on the runner.'
205
+ );
206
+ if (args.watchShareApiKey) {
207
+ OutputHelper.warn(
208
+ '[DRYRUN] Registering without the Open Cloud key, so a "saved" base ' +
209
+ 'place is skipped here even though a real run would watch it.'
210
+ );
211
+ }
212
+ const allPackages = await discoverAllTargetPackagesAsync(targetName);
213
+ // Under its own monitor name, never the one a real run owns.
214
+ //
215
+ // Re-registering replaces a monitor's entire watch list, and a dryrun
216
+ // cannot reproduce a real registration: the Open Cloud key is resolved
217
+ // after this point, so it would register anonymously — stripping the key
218
+ // from the live monitor, moving every source back to the anonymous
219
+ // driver and its content-hash vocabulary, dropping the baselines, and
220
+ // deleting any "saved" watch outright, because an anonymous
221
+ // registration skips those.
222
+ await registerWatchesAsync({
223
+ option: watchOption,
224
+ monitorName: `${targetName}/dryrun`,
225
+ resolver: createLockOnlyBasePlaceResolver(),
226
+ useGhAuth: args.watchUseGhAuth,
227
+ triggerAfterRegister: true,
228
+ candidates: flattenToBatchTargets(allPackages).map((buildTarget) => ({
229
+ targetName,
230
+ packageName: buildTarget.packageName,
231
+ packagePath: buildTarget.path,
232
+ place: buildTarget.target,
233
+ })),
234
+ });
235
+ }
162
236
  return;
163
237
  }
164
238
 
@@ -214,7 +288,8 @@ async function _runAsync(args: BatchDeployArgs): Promise<void> {
214
288
  apiKey,
215
289
  rateLimiter: new RateLimiter(),
216
290
  });
217
- const context = new CloudJobContext(reporter, client);
291
+ const basePlaceResolver = createBasePlaceResolver(client, args);
292
+ const context = new CloudJobContext(reporter, client, basePlaceResolver);
218
293
 
219
294
  // Gathered once so every deployed package shares one timestamp and commit.
220
295
  const deployGitInfo = gatherGitDeployInfo();
@@ -309,6 +384,35 @@ async function _runAsync(args: BatchDeployArgs): Promise<void> {
309
384
  },
310
385
  });
311
386
  if (results.summary.failed > 0) exitCode = 1;
387
+
388
+ // Only after a clean run, matching `deploy run`. A package that resolved its
389
+ // base place and then failed to upload has a lock naming a version it never
390
+ // shipped; registering that as the baseline tells the service the watch is
391
+ // up to date, so the rebuild never fires and the next successful run
392
+ // re-registers the same wrong baseline. The failure becomes permanent and
393
+ // invisible.
394
+ if (watchOption && results.summary.failed === 0) {
395
+ // Deliberately every package with this target, not just the ones that
396
+ // deployed. One monitor holds the repo's watches for a target and a
397
+ // re-apply replaces its whole list, so registering only what changed
398
+ // would delete the watches of every package that happened not to change
399
+ // this run. Packages that did not deploy still have a lock entry, which
400
+ // is the correct baseline for them.
401
+ const allPackages = await discoverAllTargetPackagesAsync(targetName);
402
+ await registerWatchesAsync({
403
+ option: watchOption,
404
+ monitorName: targetName,
405
+ resolver: basePlaceResolver,
406
+ useGhAuth: args.watchUseGhAuth,
407
+ robloxApiKey: args.watchShareApiKey ? apiKey : undefined,
408
+ candidates: flattenToBatchTargets(allPackages).map((buildTarget) => ({
409
+ targetName,
410
+ packageName: buildTarget.packageName,
411
+ packagePath: buildTarget.path,
412
+ place: buildTarget.target,
413
+ })),
414
+ });
415
+ }
312
416
  } catch (err) {
313
417
  OutputHelper.error(err instanceof Error ? err.message : String(err));
314
418
  exitCode = 1;
@@ -8,6 +8,7 @@ import {
8
8
  import { NevermoreGlobalArgs } from '../../args/global-args.js';
9
9
  import { getApiKeyAsync } from '@quenty/nevermore-cli-helpers';
10
10
  import { runBatchAsync } from '../../utils/batch/batch-runner.js';
11
+ import { createBasePlaceResolver } from '../../utils/build/base-place-resolver-factory.js';
11
12
  import {
12
13
  type JobContext,
13
14
  BatchScriptJobContext,
@@ -60,64 +61,84 @@ export const batchTestCommand: CommandModule<
60
61
  command: 'test',
61
62
  describe: 'Run tests for changed packages with test targets',
62
63
  builder: (yargs) => {
63
- return yargs
64
- .option('cloud', {
65
- describe: 'Run tests via Open Cloud instead of locally',
66
- type: 'boolean',
67
- default: false,
68
- })
69
- .option('api-key', {
70
- describe: 'Roblox Open Cloud API key (--cloud only)',
71
- type: 'string',
72
- })
73
- .option('all', {
74
- describe: 'Test all packages with test targets, not just changed',
75
- type: 'boolean',
76
- default: false,
77
- })
78
- .option('base', {
79
- describe: 'Git ref to diff against for change detection',
80
- type: 'string',
81
- default: 'origin/main',
82
- })
83
- .option('concurrency', {
84
- describe: 'Max parallel tests (0 = unlimited, default: unlimited)',
85
- type: 'number',
86
- })
87
- .option('output', {
88
- describe: 'Write JSON results to this file',
89
- type: 'string',
90
- })
91
- .option('limit', {
92
- describe: 'Max number of packages to test (for local debugging)',
93
- type: 'number',
94
- })
95
- .option('logs', {
96
- describe: 'Show execution logs for all packages (not just failures)',
97
- type: 'boolean',
98
- default: false,
99
- })
100
- .option('aggregated', {
101
- describe:
102
- 'Build all packages into a single place and execute one batch script',
103
- type: 'boolean',
104
- default: true,
105
- })
106
- .option('batch-place-id', {
107
- describe:
108
- 'Override placeId for the aggregated batch upload (--aggregated only)',
109
- type: 'number',
110
- })
111
- .option('batch-universe-id', {
112
- describe:
113
- 'Override universeId for the aggregated batch upload (--aggregated only)',
114
- type: 'number',
115
- })
116
- .option('timeout', {
117
- describe:
118
- 'Max script execution time in seconds for the whole batch. Sent to the Open Cloud API so Roblox cancels server-side on overrun. Max 300s (API limit). (default: 300)',
119
- type: 'number',
120
- });
64
+ return (
65
+ yargs
66
+ .option('cloud', {
67
+ describe: 'Run tests via Open Cloud instead of locally',
68
+ type: 'boolean',
69
+ default: false,
70
+ })
71
+ .option('api-key', {
72
+ describe: 'Roblox Open Cloud API key (--cloud only)',
73
+ type: 'string',
74
+ })
75
+ .option('all', {
76
+ describe: 'Test all packages with test targets, not just changed',
77
+ type: 'boolean',
78
+ default: false,
79
+ })
80
+ .option('base', {
81
+ describe: 'Git ref to diff against for change detection',
82
+ type: 'string',
83
+ default: 'origin/main',
84
+ })
85
+ .option('concurrency', {
86
+ describe: 'Max parallel tests (0 = unlimited, default: unlimited)',
87
+ type: 'number',
88
+ })
89
+ .option('output', {
90
+ describe: 'Write JSON results to this file',
91
+ type: 'string',
92
+ })
93
+ .option('limit', {
94
+ describe: 'Max number of packages to test (for local debugging)',
95
+ type: 'number',
96
+ })
97
+ .option('logs', {
98
+ describe: 'Show execution logs for all packages (not just failures)',
99
+ type: 'boolean',
100
+ default: false,
101
+ })
102
+ .option('aggregated', {
103
+ describe:
104
+ 'Build all packages into a single place and execute one batch script',
105
+ type: 'boolean',
106
+ default: true,
107
+ })
108
+ .option('batch-place-id', {
109
+ describe:
110
+ 'Override placeId for the aggregated batch upload (--aggregated only)',
111
+ type: 'number',
112
+ })
113
+ .option('batch-universe-id', {
114
+ describe:
115
+ 'Override universeId for the aggregated batch upload (--aggregated only)',
116
+ type: 'number',
117
+ })
118
+ .option('timeout', {
119
+ describe:
120
+ 'Max script execution time in seconds for the whole batch. Sent to the Open Cloud API so Roblox cancels server-side on overrun. Max 300s (API limit). (default: 300)',
121
+ type: 'number',
122
+ })
123
+ // Accepted only to fail with a useful message. A batch runs one shared
124
+ // script across packages, so there is nothing for arbitrary Luau to mean
125
+ // here — but yargs strict mode would otherwise reject it with a bare
126
+ // "Unknown argument" that does not say where to go instead.
127
+ .option('script-text', {
128
+ hidden: true,
129
+ type: 'string',
130
+ })
131
+ .check((args) => {
132
+ if (args.scriptText !== undefined) {
133
+ throw new Error(
134
+ '--script-text is not supported by "batch test", which runs one shared script for all packages.\n' +
135
+ 'Run it against a single package instead:\n' +
136
+ ' cd <package> && nevermore test --cloud --script-text \'print("hi")\''
137
+ );
138
+ }
139
+ return true;
140
+ })
141
+ );
121
142
  },
122
143
  handler: async (args) => {
123
144
  try {
@@ -214,9 +235,14 @@ async function _runAsync(args: BatchTestArgs): Promise<void> {
214
235
  ? _createBroadcastReporter(reporter, packageNames)
215
236
  : reporter;
216
237
 
238
+ // Local runs get a resolver too — a package with a basePlace still has to
239
+ // merge it, and the client resolves its API key lazily so a run that never
240
+ // touches one is not prompted for credentials.
241
+ const basePlaceResolver = createBasePlaceResolver(client, args);
242
+
217
243
  const innerContext: JobContext = cloud
218
- ? new CloudJobContext(innerReporter, client)
219
- : new LocalJobContext(innerReporter, client);
244
+ ? new CloudJobContext(innerReporter, client, basePlaceResolver)
245
+ : new LocalJobContext(innerReporter, client, basePlaceResolver);
220
246
 
221
247
  const context: JobContext = args.aggregated
222
248
  ? new BatchScriptJobContext(innerContext, packages, {
@@ -5,7 +5,7 @@ import { OutputHelper } from '@quenty/cli-output-helpers';
5
5
  import {
6
6
  DeployConfig,
7
7
  discoverUniverseIdAsync,
8
- } from '../../utils/build/deploy-config.js';
8
+ } from '@quenty/nevermore-deploy';
9
9
  import {
10
10
  getRobloxCookieAsync,
11
11
  createPlaceInUniverseAsync,