@camunda8/cli 4.7.0-alpha.2 → 4.7.0-alpha.4

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 (38) hide show
  1. package/README.md +1 -0
  2. package/dist/commands/deploy.d.ts.map +1 -1
  3. package/dist/commands/deploy.js +46 -7
  4. package/dist/commands/deploy.js.map +1 -1
  5. package/dist/commands/helpers/deploy-helpers.d.ts +83 -2
  6. package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -1
  7. package/dist/commands/helpers/deploy-helpers.js +204 -65
  8. package/dist/commands/helpers/deploy-helpers.js.map +1 -1
  9. package/dist/commands/watch.d.ts.map +1 -1
  10. package/dist/commands/watch.js +301 -16
  11. package/dist/commands/watch.js.map +1 -1
  12. package/dist/default-plugins/cluster/README.md +3 -1
  13. package/dist/default-plugins/cluster/c8ctl-plugin.js +37 -1
  14. package/dist/utils/command-local/setup-detectors.d.ts +51 -0
  15. package/dist/utils/command-local/setup-detectors.d.ts.map +1 -0
  16. package/dist/utils/command-local/setup-detectors.js +115 -0
  17. package/dist/utils/command-local/setup-detectors.js.map +1 -0
  18. package/dist/utils/command-local/setup-prerequisites.d.ts +67 -0
  19. package/dist/utils/command-local/setup-prerequisites.d.ts.map +1 -0
  20. package/dist/utils/command-local/setup-prerequisites.js +238 -0
  21. package/dist/utils/command-local/setup-prerequisites.js.map +1 -0
  22. package/dist/utils/index.d.ts +3 -0
  23. package/dist/utils/index.d.ts.map +1 -1
  24. package/dist/utils/index.js +3 -0
  25. package/dist/utils/index.js.map +1 -1
  26. package/dist/utils/shared/camunda-json.d.ts +8 -0
  27. package/dist/utils/shared/camunda-json.d.ts.map +1 -1
  28. package/dist/utils/shared/camunda-json.js +3 -0
  29. package/dist/utils/shared/camunda-json.js.map +1 -1
  30. package/dist/utils/shared/deploy-resource-selection.d.ts +173 -0
  31. package/dist/utils/shared/deploy-resource-selection.d.ts.map +1 -0
  32. package/dist/utils/shared/deploy-resource-selection.js +476 -0
  33. package/dist/utils/shared/deploy-resource-selection.js.map +1 -0
  34. package/dist/utils/shared/ignore.d.ts +26 -0
  35. package/dist/utils/shared/ignore.d.ts.map +1 -1
  36. package/dist/utils/shared/ignore.js +6 -2
  37. package/dist/utils/shared/ignore.js.map +1 -1
  38. package/package.json +1 -1
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Watch command - monitor files for changes and auto-deploy
3
3
  */
4
- import { existsSync, realpathSync, statSync, watch } from "node:fs";
5
- import { basename, extname, resolve } from "node:path";
6
- import { createClient, normalizeToError } from "../core/index.js";
4
+ import { existsSync, realpathSync, statSync, unwatchFile, watch, watchFile, } from "node:fs";
5
+ import { basename, dirname, extname, join, resolve, sep } from "node:path";
6
+ import { createClient, normalizeToError, SilentError } from "../core/index.js";
7
7
  import { defineCommand } from "../framework/index.js";
8
- import { ALL_DEPLOYABLE_EXTENSIONS, CAMUNDA_PROJECT_FILE, DEPLOY_COOLDOWN, DEPLOYABLE_EXTENSIONS, isIgnored, loadIgnoreRules, resolveIgnoreBaseDir, } from "../utils/index.js";
9
- import { checkServerSupportsExtensions, deployResources, findProjectRoot, logMessage, } from "./helpers/deploy-helpers.js";
8
+ import { ALL_DEPLOYABLE_EXTENSIONS, CAMUNDA_PROJECT_FILE, DEPLOY_COOLDOWN, DEPLOY_RESOURCES_FIELD, DEPLOYABLE_EXTENSIONS, DeployResourcesError, deployResourcesStateOf, isIgnored, loadIgnoreRules, readDeployResourcesState, readProjectDescriptor, resolveDeployResources, resolveIgnoreBaseDir, } from "../utils/index.js";
9
+ import { checkServerSupportsExtensions, deployResources, findProjectRoot, logMessage, rejectSelectionFlagsForDescriptor, } from "./helpers/deploy-helpers.js";
10
10
  export { DEPLOY_COOLDOWN };
11
11
  const DEBOUNCE_DELAY = 200; // ms to wait after last fs event before deploying
12
12
  // ─── defineCommand ───────────────────────────────────────────────────────────
@@ -60,12 +60,18 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
60
60
  logMessage("Warning: --process-application/--pa is deprecated, use --project instead.");
61
61
  }
62
62
  let projectRoot = null;
63
+ // The descriptor read while finding the project root: the startup
64
+ // decisions below use this single read, so an edit landing between
65
+ // separate reads can't downgrade a deployResources project to the
66
+ // default scan. Later changes are picked up by the watcher.
67
+ const startupDescriptors = new Map();
68
+ let startupDescriptor = null;
63
69
  if (projectMode) {
64
70
  // Resolve the project root from every watched path and verify they
65
71
  // all belong to the same Camunda project.
66
72
  let resolvedRoot;
67
73
  for (const p of resolvedPaths) {
68
- const root = findProjectRoot(p);
74
+ const root = findProjectRoot(p, undefined, startupDescriptors);
69
75
  if (!root) {
70
76
  throw new Error(`--project: no camunda.json or .process-application marker found above ${p}. ` +
71
77
  "Place a camunda.json file at the root of your Camunda project.");
@@ -79,6 +85,7 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
79
85
  `but earlier paths resolved to ${resolvedRoot}`);
80
86
  }
81
87
  resolvedRoot = normalizedRoot;
88
+ startupDescriptor = startupDescriptors.get(root) ?? null;
82
89
  }
83
90
  // Invariant: resolvedPaths always has ≥1 entry (defaults to ["."]),
84
91
  // so the loop above always runs at least once and sets resolvedRoot.
@@ -92,10 +99,95 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
92
99
  resolvedPaths.length = 0;
93
100
  resolvedPaths.push(projectRoot);
94
101
  }
102
+ // ── deployResources (project mode) ─────────────────────────────────
103
+ // When the project descriptor declares `deployResources`, the watcher
104
+ // tracks the descriptor-selected set instead of an extension list:
105
+ // changes to selected files (create, modify, delete, rename) redeploy
106
+ // the re-resolved set, and a camunda.json edit redeploys only when it
107
+ // changes the set. `--force` keeps its meaning of "continue after
108
+ // errors" (including invalid configuration / empty selection).
109
+ const descriptorMode = startupDescriptor !== null &&
110
+ Object.hasOwn(startupDescriptor, DEPLOY_RESOURCES_FIELD);
111
+ if (descriptorMode && projectRoot) {
112
+ rejectSelectionFlagsForDescriptor({
113
+ descriptorRoots: [projectRoot],
114
+ extensions: flags.extensions,
115
+ allExtensions: flags["all-extensions"],
116
+ });
117
+ }
118
+ /**
119
+ * Resolve the current selection; throws on invalid config / empty set.
120
+ * Returns `null` while camunda.json is momentarily missing (an editor
121
+ * saving by delete-and-recreate): the change is resolved again once the
122
+ * new file appears, never via the default scan.
123
+ */
124
+ // Descriptor read discipline (see `planDeployPaths`): at startup the
125
+ // descriptor read while finding the project root decides everything;
126
+ // afterwards each re-resolution reads it once (`resolveSelection`) and
127
+ // the redeploy uses exactly that snapshot (`resolvedPatterns`). The
128
+ // polling and the check after arming only detect changes and route
129
+ // them to a re-resolution; they never decide what is deployed.
130
+ // Patterns of the last successful resolution: the redeploy uses them
131
+ // instead of re-reading camunda.json, which may change mid-deploy.
132
+ let resolvedPatterns = [];
133
+ const resolveSelection = (root) => {
134
+ const state = readDeployResourcesState(root);
135
+ if (state.kind === "no-descriptor")
136
+ return null;
137
+ if (state.kind === "no-field") {
138
+ throw new Error('"deployResources" was removed from camunda.json. ' +
139
+ "Restart `c8 watch --project` to watch the default resource scan.");
140
+ }
141
+ const files = resolveDeployResources(root, state.patterns);
142
+ resolvedPatterns = state.patterns;
143
+ return files;
144
+ };
145
+ let selected = [];
146
+ // Real paths of the selected files, so an event reported under another
147
+ // path of the same file (a symlink alias and its target) still counts
148
+ // as a change to a selected file. Kept from the previous resolution for
149
+ // deletions, whose files can no longer be resolved.
150
+ let selectedIdentities = new Set();
151
+ /** Real path of a project-relative path; for a missing file, its real
152
+ * parent joined with the name (best effort). */
153
+ const identityOf = (root, rel) => {
154
+ const abs = join(root, ...rel.split("/"));
155
+ try {
156
+ return realpathSync(abs);
157
+ }
158
+ catch {
159
+ try {
160
+ return join(realpathSync(dirname(abs)), basename(abs));
161
+ }
162
+ catch {
163
+ return abs;
164
+ }
165
+ }
166
+ };
167
+ if (descriptorMode && projectRoot) {
168
+ try {
169
+ const state = deployResourcesStateOf(startupDescriptor, projectRoot);
170
+ if (state.kind === "patterns") {
171
+ selected = resolveDeployResources(projectRoot, state.patterns);
172
+ resolvedPatterns = state.patterns;
173
+ }
174
+ const root = projectRoot;
175
+ selectedIdentities = new Set(selected.map((rel) => identityOf(root, rel)));
176
+ }
177
+ catch (error) {
178
+ if (!flags.force)
179
+ throw error;
180
+ logger.error("Invalid resource selection", normalizeToError(error, "Invalid resource selection"));
181
+ }
182
+ }
95
183
  // ── Pre-flight version check ──
96
- // Always perform the topology check — --force means "continue after
97
- // deploy errors", not "bypass extension filtering".
98
- const serverSupportsExtensions = await checkServerSupportsExtensions(createClient(ctx.profile));
184
+ // Always perform the topology check for extension-based watching —
185
+ // --force means "continue after deploy errors", not "bypass extension
186
+ // filtering". A `deployResources` selection is independent of the
187
+ // server version, so it needs no check.
188
+ const serverSupportsExtensions = descriptorMode
189
+ ? true
190
+ : await checkServerSupportsExtensions(createClient(ctx.profile));
99
191
  // Clamp watched extensions on servers that don't support extended types.
100
192
  // Note: explicit file paths bypass extension filtering by design, so
101
193
  // this only gates which fs events trigger a deploy.
@@ -110,8 +202,9 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
110
202
  }
111
203
  // Load .c8ignore rules from the target directory (not cwd) so that
112
204
  // `c8 watch <target>` picks up the .c8ignore inside the target. (#258)
205
+ // A `deployResources` selection ignores .c8ignore, so it is not read.
113
206
  const ignoreBaseDir = resolveIgnoreBaseDir(resolvedPaths);
114
- const ig = loadIgnoreRules(ignoreBaseDir);
207
+ const ig = descriptorMode ? null : loadIgnoreRules(ignoreBaseDir);
115
208
  // Keep track of recently deployed files to avoid duplicate deploys
116
209
  const recentlyDeployed = new Map();
117
210
  // Debounce timers per file to let writes settle before deploying
@@ -122,6 +215,139 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
122
215
  // Set on SIGINT to short-circuit any debounce callback that fires
123
216
  // between signal receipt and the synchronous shutdown work below.
124
217
  let shuttingDown = false;
218
+ // Rejects the lifecycle promise below — used to stop watching on an
219
+ // invalid `deployResources` configuration when --force is not set.
220
+ let failWatch;
221
+ // Project-relative paths changed since the last descriptor-mode
222
+ // resolution (collapsed by the debounce window).
223
+ const pendingChanges = new Set();
224
+ // Descriptor-mode resolutions and deploys run one at a time, so a
225
+ // change made during an in-flight deploy is deployed after it and the
226
+ // newest content always lands last.
227
+ let descriptorQueue = Promise.resolve();
228
+ let descriptorBusy = false;
229
+ /**
230
+ * Descriptor mode: re-resolve the selection after a burst of changes
231
+ * and redeploy when a selected file changed or the selected set did.
232
+ */
233
+ const onDescriptorModeChange = async (root) => {
234
+ // Pending changes are kept until a resolution succeeds, so edits made
235
+ // while the descriptor is invalid (--force) are deployed on recovery.
236
+ const changed = [...pendingChanges];
237
+ let next;
238
+ try {
239
+ const resolved = resolveSelection(root);
240
+ if (resolved === null) {
241
+ // Keep the pending changes: the descriptor is being replaced,
242
+ // and its re-creation triggers another resolution.
243
+ logger.info("camunda.json is missing — waiting for it to be written again");
244
+ return;
245
+ }
246
+ next = resolved;
247
+ pendingChanges.clear();
248
+ }
249
+ catch (error) {
250
+ const err = normalizeToError(error, "Invalid resource selection");
251
+ logger.error("Invalid resource selection", err);
252
+ if (flags.force) {
253
+ logger.info("Continuing to watch (--force).");
254
+ return;
255
+ }
256
+ failWatch?.(new SilentError(err.message));
257
+ return;
258
+ }
259
+ const previous = new Set(selected);
260
+ const current = new Set(next);
261
+ selected = next;
262
+ const previousIdentities = selectedIdentities;
263
+ const currentIdentities = new Set(next.map((rel) => identityOf(root, rel)));
264
+ selectedIdentities = currentIdentities;
265
+ const setChanged = previous.size !== current.size || next.some((rel) => !previous.has(rel));
266
+ const identities = [...previousIdentities, ...currentIdentities];
267
+ const touches = (rel) => {
268
+ if ([...previous, ...current].some((file) => file === rel || file.startsWith(`${rel}/`))) {
269
+ return true;
270
+ }
271
+ const identity = identityOf(root, rel);
272
+ return identities.some((file) => file === identity || file.startsWith(`${identity}${sep}`));
273
+ };
274
+ const selectedFileChanged = changed.some((rel) => rel !== CAMUNDA_PROJECT_FILE && touches(rel));
275
+ if (!setChanged && !selectedFileChanged) {
276
+ if (changed.includes(CAMUNDA_PROJECT_FILE)) {
277
+ logger.info("camunda.json changed; the selected resources are unchanged — not redeploying");
278
+ }
279
+ return;
280
+ }
281
+ logger.info(`\n🔄 Change detected: ${changed.join(", ")} — deploying ${next.length} selected resource(s)`);
282
+ recentlyDeployed.set(root, Date.now());
283
+ const ac = new AbortController();
284
+ inflightDeploys.add(ac);
285
+ try {
286
+ await deployResources([root], {
287
+ profile: ctx.profile,
288
+ continueOnError: flags.force,
289
+ continueOnUserError: true,
290
+ signal: ac.signal,
291
+ verbose: ctx.verbose,
292
+ plan: [{ kind: "descriptor", path: root, patterns: resolvedPatterns }],
293
+ });
294
+ }
295
+ catch (error) {
296
+ if (ac.signal.aborted)
297
+ return;
298
+ // A selected file that cannot be read is a selection error, not a
299
+ // deployment error: nothing was sent, and it stops watching unless
300
+ // --force is set (same as invalid configuration).
301
+ if (error instanceof DeployResourcesError) {
302
+ logger.error("Invalid resource selection", error);
303
+ if (flags.force) {
304
+ logger.info("Continuing to watch (--force).");
305
+ return;
306
+ }
307
+ failWatch?.(new SilentError(error.message));
308
+ return;
309
+ }
310
+ logger.error("Failed to deploy project", normalizeToError(error, "Deployment request failed"));
311
+ }
312
+ finally {
313
+ inflightDeploys.delete(ac);
314
+ }
315
+ };
316
+ /** Debounce descriptor-mode changes into one re-resolution. */
317
+ const scheduleDescriptorModeChange = (root, delay) => {
318
+ const existing = debounceTimers.get(root);
319
+ if (existing)
320
+ clearTimeout(existing);
321
+ debounceTimers.set(root, setTimeout(() => {
322
+ debounceTimers.delete(root);
323
+ if (shuttingDown)
324
+ return;
325
+ // Within the cooldown, postpone rather than drop: the pending
326
+ // changes must still be resolved once the window passes.
327
+ const lastDeploy = recentlyDeployed.get(root);
328
+ const remaining = lastDeploy
329
+ ? DEPLOY_COOLDOWN - (Date.now() - lastDeploy)
330
+ : 0;
331
+ if (remaining > 0) {
332
+ scheduleDescriptorModeChange(root, remaining);
333
+ return;
334
+ }
335
+ if (descriptorBusy) {
336
+ logger.info("⏳ Waiting for the in-flight deployment to finish before redeploying");
337
+ }
338
+ descriptorQueue = descriptorQueue.then(async () => {
339
+ if (shuttingDown)
340
+ return;
341
+ descriptorBusy = true;
342
+ try {
343
+ await onDescriptorModeChange(root);
344
+ }
345
+ finally {
346
+ descriptorBusy = false;
347
+ }
348
+ });
349
+ }, delay));
350
+ };
125
351
  // Watch each path
126
352
  const watchers = resolvedPaths.map((path) => {
127
353
  const stats = statSync(path);
@@ -130,6 +356,11 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
130
356
  if (!filename)
131
357
  return;
132
358
  const file = filename;
359
+ if (descriptorMode && projectRoot) {
360
+ pendingChanges.add(filename.split(sep).join("/"));
361
+ scheduleDescriptorModeChange(projectRoot, DEBOUNCE_DELAY);
362
+ return;
363
+ }
133
364
  const ext = extname(filename);
134
365
  if (!effectiveExtensions.includes(ext)) {
135
366
  return;
@@ -142,7 +373,7 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
142
373
  }
143
374
  const fullPath = isDirectory ? resolve(path, filename) : path;
144
375
  // Skip files matching .c8ignore rules
145
- if (isIgnored(ig, fullPath, ignoreBaseDir)) {
376
+ if (ig && isIgnored(ig, fullPath, ignoreBaseDir)) {
146
377
  return;
147
378
  }
148
379
  // In project mode, key debounce/cooldown by the project root
@@ -213,6 +444,44 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
213
444
  });
214
445
  return watcher;
215
446
  });
447
+ // Editors often save by replacing the file (write a temp file, then
448
+ // rename). On some platforms (Linux with Node 22) the recursive watcher
449
+ // then stops reporting later changes to that path, so the descriptor
450
+ // is also polled by path, which survives replacement. Events from both
451
+ // sources collapse in the debounce window.
452
+ const descriptorFile = descriptorMode && projectRoot
453
+ ? join(projectRoot, CAMUNDA_PROJECT_FILE)
454
+ : null;
455
+ if (descriptorFile && projectRoot) {
456
+ const root = projectRoot;
457
+ // Change detection only (stat polling): never decides the selection.
458
+ watchFile(descriptorFile, { interval: 250 }, (current, previous) => {
459
+ if (current.mtimeMs === previous.mtimeMs &&
460
+ current.ino === previous.ino &&
461
+ current.size === previous.size) {
462
+ return;
463
+ }
464
+ pendingChanges.add(CAMUNDA_PROJECT_FILE);
465
+ scheduleDescriptorModeChange(root, DEBOUNCE_DELAY);
466
+ });
467
+ // The startup decisions used the descriptor read while finding the
468
+ // project root. Now that changes are observed, check once whether it
469
+ // changed in between (edited, removed or broken): if so, resolve it
470
+ // again through the normal change path.
471
+ let unchanged = false;
472
+ try {
473
+ unchanged =
474
+ JSON.stringify(readProjectDescriptor(root)) ===
475
+ JSON.stringify(startupDescriptor);
476
+ }
477
+ catch {
478
+ unchanged = false;
479
+ }
480
+ if (!unchanged) {
481
+ pendingChanges.add(CAMUNDA_PROJECT_FILE);
482
+ scheduleDescriptorModeChange(root, DEBOUNCE_DELAY);
483
+ }
484
+ }
216
485
  // Block until SIGINT, then close watchers, cancel any pending debounced
217
486
  // deploys, abort any in-flight HTTP deploys, and resolve so the handler
218
487
  // returns naturally. The framework treats this as `{ kind: "never" }`
@@ -227,20 +496,31 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
227
496
  // `signal.aborted` and swallow the AbortError instead of logging.
228
497
  // Together these drain the event loop within one tick, so the framework
229
498
  // can return naturally and own the exit code.
230
- await new Promise((resolveSignal) => {
231
- process.once("SIGINT", () => {
499
+ await new Promise((resolveSignal, rejectSignal) => {
500
+ const shutdown = () => {
232
501
  shuttingDown = true;
233
- logger.info("\n\n🍹 - bottoms up.");
234
502
  for (const w of watchers)
235
503
  w.close();
504
+ if (descriptorFile)
505
+ unwatchFile(descriptorFile);
236
506
  for (const timer of debounceTimers.values())
237
507
  clearTimeout(timer);
238
508
  debounceTimers.clear();
239
509
  for (const ac of inflightDeploys)
240
510
  ac.abort();
241
511
  inflightDeploys.clear();
512
+ };
513
+ const onSigint = () => {
514
+ logger.info("\n\n🍹 - bottoms up.");
515
+ shutdown();
242
516
  resolveSignal();
243
- });
517
+ };
518
+ failWatch = (error) => {
519
+ process.off("SIGINT", onSigint);
520
+ shutdown();
521
+ rejectSignal(error);
522
+ };
523
+ process.once("SIGINT", onSigint);
244
524
  // Emit the readiness banner ONLY AFTER both the fs watchers and the
245
525
  // SIGINT handler are registered. Tests poll the "Watching for
246
526
  // changes" line as a readiness signal before dropping a file or
@@ -250,7 +530,12 @@ export const watchCommand = defineCommand("watch", "", async (ctx, flags) => {
250
530
  // FSEvents on macOS, ReadDirectoryChangesW on Windows) and the
251
531
  // file event is silently lost.
252
532
  logger.info(`👁️ Watching for changes in: ${resolvedPaths.join(", ")}`);
253
- logger.info(`📋 Monitoring extensions: ${effectiveExtensions.join(", ")}`);
533
+ if (descriptorMode) {
534
+ logger.info(`📋 Monitoring ${selected.length} resource(s) selected by "deployResources" in camunda.json`);
535
+ }
536
+ else {
537
+ logger.info(`📋 Monitoring extensions: ${effectiveExtensions.join(", ")}`);
538
+ }
254
539
  if (projectMode && projectRoot) {
255
540
  logger.info(`📦 Project mode: deploying all resources from ${projectRoot}`);
256
541
  }
@@ -1 +1 @@
1
- {"version":3,"file":"watch.js","sourceRoot":"","sources":["../../src/commands/watch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EACN,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,qBAAqB,EACrB,SAAS,EACT,eAAe,EACf,oBAAoB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,6BAA6B,EAC7B,eAAe,EACf,eAAe,EACf,UAAU,GACV,MAAM,6B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CAAC,CAAC;YAChC,QAAQ,EAAE,CAAC;YACX,YAAY,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAEjC,oEAAoE;QACpE,8DAA8D;QAC9D,gEAAgE;QAChE,kEAAkE;QAClE,gEAAgE;QAChE,6DAA6D;QAC7D,+DAA+D;QAC/D,+BAA+B;QAC/B,MAAM,CAAC,IAAI,CAAC,iCAAiC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzE,IAAI,cAAc,EAAE,CAAC;YACpB,MAAM,CAAC,IAAI,CACV,iBAAiB,QAAQ,CAAC,MAAM,4DAA4D,CAC5F,CAAC;QACH,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,IAAI,CACV,6BAA6B,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7D,CAAC;QACH,CAAC;QACD,IAAI,WAAW,IAAI,WAAW,EAAE,CAAC;YAChC,MAAM,CAAC,IAAI,CACV,iDAAiD,WAAW,EAAE,CAC9D,CAAC;QACH,CAAC;QACD,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CACV,+DAA+D,CAC/D,CAAC;QACH,CAAC;QACD,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AAC1B,CAAC,CAAC,CAAC"}
@@ -161,9 +161,11 @@ Set the version to the actual installed cache version. The test uses temporary t
161
161
  ## Supported platforms
162
162
 
163
163
  - macOS (x86_64, aarch64)
164
- - Linux (x86_64, aarch64)
164
+ - Linux (x86_64)
165
165
  - Windows (x86_64)
166
166
 
167
+ These are the platforms the Camunda Download Center publishes Camunda 8 Run for. On any other platform, such as Linux or Windows on arm64, `c8 cluster install` and `c8 cluster start` stop with an explanation instead of downloading. To use your own build, set `C8CTL_C8RUN_DOWNLOAD_URL` to a mirror with the same layout that hosts it.
168
+
167
169
  ## License
168
170
 
169
171
  MIT
@@ -414,7 +414,7 @@ const CLUSTER_STARTUP_TIMEOUT_MS = 120000;
414
414
  const HEALTH_CHECK_TIMEOUT_MS = 3_000;
415
415
  const ALIAS_COLUMN_WIDTH = 22;
416
416
 
417
- function getCacheDir() {
417
+ export function getCacheDir() {
418
418
  const envDir = process.env.C8RUN_CACHE_DIR;
419
419
  if (envDir) {
420
420
  return envDir;
@@ -440,6 +440,38 @@ function getCacheDir() {
440
440
  }
441
441
  }
442
442
 
443
+ /**
444
+ * Platform/architecture pairs the Camunda Download Center publishes a
445
+ * Camunda 8 Run build for: darwin-aarch64, darwin-x86_64, linux-x86_64 and
446
+ * windows-x86_64. There is no Linux or Windows arm64 build.
447
+ */
448
+ const PUBLISHED_PLATFORMS = {
449
+ darwin: ['x64', 'arm64'],
450
+ linux: ['x64'],
451
+ win32: ['x64'],
452
+ };
453
+
454
+ /**
455
+ * Why Camunda 8 Run cannot be downloaded for this platform, or null when it
456
+ * can. A mirror (C8CTL_C8RUN_DOWNLOAD_URL) may host other builds, so any
457
+ * platform is allowed when one is set.
458
+ */
459
+ export function unpublishedPlatformMessage({
460
+ platform = osPlatform(),
461
+ arch = osArch(),
462
+ mirror = process.env.C8CTL_C8RUN_DOWNLOAD_URL,
463
+ } = {}) {
464
+ if (mirror) return null;
465
+ if (Object.hasOwn(PUBLISHED_PLATFORMS, platform) && PUBLISHED_PLATFORMS[platform].includes(arch)) {
466
+ return null;
467
+ }
468
+ return (
469
+ `Camunda 8 Run is not published for ${platform} ${arch}. ` +
470
+ 'The Camunda Download Center has builds for macOS (x64, arm64), Linux (x64) and Windows (x64). ' +
471
+ 'To use your own build, set C8CTL_C8RUN_DOWNLOAD_URL to a mirror with the same layout that hosts it.'
472
+ );
473
+ }
474
+
443
475
  function getPlatformIdentifier() {
444
476
  const platform = osPlatform();
445
477
  const arch = osArch();
@@ -1179,6 +1211,10 @@ async function downloadC8Run(config) {
1179
1211
  const logger = getLogger();
1180
1212
  const version = config.version;
1181
1213
 
1214
+ // Fail before requesting an archive that was never published.
1215
+ const unpublished = unpublishedPlatformMessage();
1216
+ if (unpublished) throw new Error(unpublished);
1217
+
1182
1218
  const downloadUrl = getDownloadUrl(version);
1183
1219
 
1184
1220
  logger.info(`Downloading Camunda ${version} for ${getPlatformIdentifier().platform}...`);
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Done-checks for `c8ctl setup`: whether Camunda 8 Run is installed and
3
+ * whether the local cluster is healthy. Setup re-checks these on every run
4
+ * instead of trusting a record of earlier runs.
5
+ *
6
+ * Built-in code cannot import the cluster plugin, so the install checks
7
+ * follow its rules (cache location, install layout, binary name). Tests
8
+ * compare them with the plugin's own functions.
9
+ */
10
+ type Env = Readonly<Record<string, string | undefined>>;
11
+ /** Where the cluster plugin keeps Camunda 8 Run installs. */
12
+ export declare function c8runCacheDir({ env, platform, home, }?: {
13
+ env?: Env;
14
+ platform?: string;
15
+ home?: string;
16
+ }): string;
17
+ /**
18
+ * Whether `version`'s Camunda 8 Run binary is present: in a
19
+ * `c8run-<version>*` subdirectory of `c8run-<version>`, or directly in it.
20
+ */
21
+ export declare function isCamunda8RunInstalled({ version, cacheDir, platform, }: {
22
+ version: string;
23
+ cacheDir?: string;
24
+ platform?: string;
25
+ }): boolean;
26
+ /** Installed versions whose binary is present, in version order. */
27
+ export declare function installedCamunda8RunVersions({ cacheDir, platform, }?: {
28
+ cacheDir?: string;
29
+ platform?: string;
30
+ }): string[];
31
+ /** The endpoint the cluster plugin polls to decide a started cluster is ready. */
32
+ export declare const LOCAL_CLUSTER_HEALTH_URL = "http://localhost:9600/actuator/health";
33
+ /** The `fetch` subset the health check uses. */
34
+ export type HealthFetch = (url: string, init: {
35
+ signal: AbortSignal;
36
+ }) => Promise<Response>;
37
+ export interface ClusterHealth {
38
+ readonly healthy: boolean;
39
+ /** e.g. "status UP", "HTTP 503", "not reachable (ECONNREFUSED)". */
40
+ readonly detail: string;
41
+ }
42
+ /**
43
+ * Whether a local cluster is running and healthy: its health endpoint
44
+ * reports `UP`. One request, no retries.
45
+ */
46
+ export declare function checkLocalClusterHealth({ fetch, timeoutMs, }?: {
47
+ fetch?: HealthFetch;
48
+ timeoutMs?: number;
49
+ }): Promise<ClusterHealth>;
50
+ export {};
51
+ //# sourceMappingURL=setup-detectors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup-detectors.d.ts","sourceRoot":"","sources":["../../../src/utils/command-local/setup-detectors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,KAAK,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AAIxD,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,EAC7B,GAAiB,EACjB,QAA2B,EAC3B,IAAgB,GAChB,GAAE;IACF,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACT,GAAG,MAAM,CAcd;AAKD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,EACtC,OAAO,EACP,QAA0B,EAC1B,QAA2B,GAC3B,EAAE;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAWV;AAED,oEAAoE;AACpE,wBAAgB,4BAA4B,CAAC,EAC5C,QAA0B,EAC1B,QAA2B,GAC3B,GAAE;IACF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACb,GAAG,MAAM,EAAE,CAShB;AAID,kFAAkF;AAClF,eAAO,MAAM,wBAAwB,0CAA0C,CAAC;AAGhF,gDAAgD;AAChD,MAAM,MAAM,WAAW,GAAG,CACzB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