@ariestools/toolchain 10.0.5 → 10.0.6

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.
package/dist/bin/xyex.mjs CHANGED
@@ -617,9 +617,9 @@ function formatDeclaredRange(dep, range) {
617
617
  }
618
618
  //#endregion
619
619
  //#region src/lib/bundledCliPath.ts
620
- const require$8 = createRequire(import.meta.url);
620
+ const require$7 = createRequire(import.meta.url);
621
621
  function toolchainPackageRoot() {
622
- return PATH.dirname(require$8.resolve("@ariestools/toolchain/package.json"));
622
+ return PATH.dirname(require$7.resolve("@ariestools/toolchain/package.json"));
623
623
  }
624
624
  function bundledCliPath(name) {
625
625
  return PATH.resolve(toolchainPackageRoot(), "dist/bin", name);
@@ -6861,12 +6861,9 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6861
6861
  }));
6862
6862
  //#endregion
6863
6863
  //#region src/lib/toolchainVersion.ts
6864
- const require$7 = createRequire(import.meta.url);
6864
+ createRequire(import.meta.url);
6865
6865
  function bundledToolchainVersion() {
6866
- const pkgPath = require$7.resolve("@ariestools/toolchain/package.json");
6867
- const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
6868
- if (pkg.version == null || pkg.version.length === 0) throw new Error("Could not read @ariestools/toolchain version");
6869
- return pkg.version;
6866
+ return "10.0.6";
6870
6867
  }
6871
6868
  function bundledToolchainRange() {
6872
6869
  return `^${bundledToolchainVersion()}`;
@@ -11808,7 +11805,7 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
11808
11805
  exports.cosmiconfigSync = cosmiconfigSync;
11809
11806
  }));
11810
11807
  //#endregion
11811
- //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.5.0_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/typescript-compile-error.mjs
11808
+ //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.5.1_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/typescript-compile-error.mjs
11812
11809
  var TypeScriptCompileError = class _TypeScriptCompileError extends Error {
11813
11810
  constructor(message) {
11814
11811
  super(message);
@@ -11824,7 +11821,7 @@ ${error.message}`;
11824
11821
  }
11825
11822
  };
11826
11823
  //#endregion
11827
- //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.5.0_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/loader.mjs
11824
+ //#region ../../node_modules/.pnpm/cosmiconfig-typescript-loader@6.3.0_@types+node@26.5.1_cosmiconfig@10.0.1_typescript@6.0.3/node_modules/cosmiconfig-typescript-loader/dist/esm/loader.mjs
11828
11825
  function TypeScriptLoader(options) {
11829
11826
  const loader = createJiti("", {
11830
11827
  interopDefault: true,
@@ -21456,6 +21453,20 @@ function tryRunLocalScript(commandName, options = {}) {
21456
21453
  }).status ?? 1;
21457
21454
  }
21458
21455
  //#endregion
21456
+ //#region src/lib/updo/isRegistryDependencySpec.ts
21457
+ /**
21458
+ * Registry ranges and tags have no protocol or path. Preserve local, Git,
21459
+ * tarball, catalog, and other indirect references instead of looking up their
21460
+ * declaration names on the registry or replacing them with version ranges.
21461
+ * Supported npm aliases still refer to registry versions.
21462
+ */
21463
+ function isRegistryDependencySpec(spec) {
21464
+ const normalized = spec.trim();
21465
+ const versionSpec = parseAliasSpec(normalized)?.range ?? normalized;
21466
+ if (versionSpec === "." || versionSpec === ".." || /\.(?:tgz|tar\.gz)$/i.test(versionSpec)) return false;
21467
+ return !/^[a-z][a-z\d+.-]*:/i.test(versionSpec) && !/[/\\]/.test(versionSpec);
21468
+ }
21469
+ //#endregion
21459
21470
  //#region src/lib/updo/applyUpdates.ts
21460
21471
  function isSimpleRange(range) {
21461
21472
  const trimmed = range.trim();
@@ -21466,6 +21477,7 @@ function shouldApplyToBag(bag, updateMap) {
21466
21477
  if (!bag) return false;
21467
21478
  let isChanged = false;
21468
21479
  for (const name of Object.keys(bag)) {
21480
+ if (!isRegistryDependencySpec(bag[name])) continue;
21469
21481
  const update = updateMap.get(name);
21470
21482
  if (!update) continue;
21471
21483
  if (bag[name] !== update.targetRange) {
@@ -21480,6 +21492,7 @@ function shouldApplyToPeerBag(pkg, updateMap) {
21480
21492
  if (peer === void 0) return false;
21481
21493
  let isChanged = false;
21482
21494
  for (const name of Object.keys(peer)) {
21495
+ if (!isRegistryDependencySpec(peer[name])) continue;
21483
21496
  const update = updateMap.get(name);
21484
21497
  if (!update) continue;
21485
21498
  if (pkg.dependencies?.[name] !== void 0) continue;
@@ -21880,13 +21893,13 @@ async function fetchAllRegistryInfo(packageNames, options = {}) {
21880
21893
  return await fetchAllRegistryInfoDirect(packageNames, options);
21881
21894
  }
21882
21895
  //#endregion
21883
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/key.js
21896
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/key.js
21884
21897
  const isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
21885
21898
  const isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
21886
21899
  const isSpaceKey = (key) => key.name === "space";
21887
21900
  const isEnterKey = (key) => key.name === "enter" || key.name === "return";
21888
21901
  //#endregion
21889
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/errors.js
21902
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/errors.js
21890
21903
  var AbortPromptError = class extends Error {
21891
21904
  name = "AbortPromptError";
21892
21905
  message = "Prompt was aborted";
@@ -21909,7 +21922,7 @@ var ValidationError = class extends Error {
21909
21922
  name = "ValidationError";
21910
21923
  };
21911
21924
  //#endregion
21912
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/hook-engine.js
21925
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/hook-engine.js
21913
21926
  const hookStorage = new AsyncLocalStorage();
21914
21927
  function createStore(rl) {
21915
21928
  return {
@@ -22005,7 +22018,7 @@ const effectScheduler = {
22005
22018
  }
22006
22019
  };
22007
22020
  //#endregion
22008
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/use-state.js
22021
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/use-state.js
22009
22022
  function isFactory(value) {
22010
22023
  return typeof value === "function";
22011
22024
  }
@@ -22029,7 +22042,7 @@ function useState(defaultValue) {
22029
22042
  });
22030
22043
  }
22031
22044
  //#endregion
22032
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/use-effect.js
22045
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/use-effect.js
22033
22046
  function useEffect(cb, depArray) {
22034
22047
  withPointer((pointer) => {
22035
22048
  const oldDeps = pointer.get();
@@ -22038,12 +22051,12 @@ function useEffect(cb, depArray) {
22038
22051
  });
22039
22052
  }
22040
22053
  //#endregion
22041
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/use-ref.js
22054
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/use-ref.js
22042
22055
  function useRef(val) {
22043
22056
  return useState({ current: val })[0];
22044
22057
  }
22045
22058
  //#endregion
22046
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/use-keypress.js
22059
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/use-keypress.js
22047
22060
  function useKeypress(userHandler) {
22048
22061
  const signal = useRef(userHandler);
22049
22062
  signal.current = userHandler;
@@ -22371,7 +22384,7 @@ function wrapAnsi$1(string, columns, options) {
22371
22384
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec$2(line, columns, options)).join("\n");
22372
22385
  }
22373
22386
  //#endregion
22374
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/utils.js
22387
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/utils.js
22375
22388
  var import_cli_width = /* @__PURE__ */ __toESM(require_cli_width(), 1);
22376
22389
  /**
22377
22390
  * Force line returns at specific width. This function is ANSI code friendly and it'll
@@ -22711,7 +22724,7 @@ const eraseLine = "\x1B[2K";
22711
22724
  /** Erase the specified number of lines above the cursor */
22712
22725
  const eraseLines = (lines) => lines > 0 ? (eraseLine + cursorUp(1)).repeat(lines - 1) + "\x1B[2K\x1B[G" : "";
22713
22726
  //#endregion
22714
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/screen-manager.js
22727
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/screen-manager.js
22715
22728
  const height = (content) => content.split("\n").length;
22716
22729
  const lastLine = (content) => content.split("\n").pop() ?? "";
22717
22730
  var ScreenManager = class {
@@ -22768,7 +22781,7 @@ var ScreenManager = class {
22768
22781
  }
22769
22782
  };
22770
22783
  //#endregion
22771
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
22784
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/promise-polyfill.js
22772
22785
  var PromisePolyfill = class extends Promise {
22773
22786
  static withResolver() {
22774
22787
  let resolve;
@@ -22784,9 +22797,21 @@ var PromisePolyfill = class extends Promise {
22784
22797
  }
22785
22798
  };
22786
22799
  //#endregion
22787
- //#region ../../node_modules/.pnpm/@inquirer+core@12.0.2_@types+node@26.5.0/node_modules/@inquirer/core/dist/lib/create-prompt.js
22800
+ //#region ../../node_modules/.pnpm/@inquirer+core@12.0.3_@types+node@26.5.1/node_modules/@inquirer/core/dist/lib/create-prompt.js
22788
22801
  var import_lib = /* @__PURE__ */ __toESM(require_lib(), 1);
22789
22802
  const nativeSetImmediate = globalThis.setImmediate;
22803
+ /**
22804
+ * Register an event listener and return its disposer, so registrations collapse
22805
+ * into a single statement: `cleanups.add(listenTo(rl, 'close', handler))`.
22806
+ */
22807
+ function listenTo(target, event, listener) {
22808
+ if ("on" in target) {
22809
+ target.on(event, listener);
22810
+ return () => target.removeListener(event, listener);
22811
+ }
22812
+ target.addEventListener(event, listener);
22813
+ return () => target.removeEventListener(event, listener);
22814
+ }
22790
22815
  function getCallSites() {
22791
22816
  const savedPrepareStackTrace = Error.prepareStackTrace;
22792
22817
  let result = [];
@@ -22818,36 +22843,44 @@ function createPrompt(view) {
22818
22843
  output.mute();
22819
22844
  const screen = new ScreenManager(rl);
22820
22845
  const { promise, resolve, reject } = PromisePolyfill.withResolver();
22821
- const cancel = () => reject(new CancelPromptError());
22822
- if (signal) {
22823
- const abort = () => reject(new AbortPromptError({ cause: signal.reason }));
22824
- if (signal.aborted) {
22825
- abort();
22826
- return Object.assign(promise, { cancel });
22827
- }
22828
- signal.addEventListener("abort", abort);
22829
- cleanups.add(() => signal.removeEventListener("abort", abort));
22830
- }
22831
- cleanups.add(onExit((code, signal) => {
22832
- reject(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`));
22833
- }));
22834
- const sigint = () => reject(new ExitPromptError(`User force closed the prompt with SIGINT`));
22835
- rl.on("SIGINT", sigint);
22836
- cleanups.add(() => rl.removeListener("SIGINT", sigint));
22837
22846
  return withHooks(rl, (cycle) => {
22838
- const hooksCleanup = AsyncResource.bind(() => effectScheduler.clearAll());
22839
- rl.on("close", hooksCleanup);
22840
- cleanups.add(() => rl.removeListener("close", hooksCleanup));
22847
+ const clearEffects = AsyncResource.bind(() => effectScheduler.clearAll());
22848
+ const settlePrompt = (settle) => {
22849
+ try {
22850
+ clearEffects();
22851
+ settle();
22852
+ } catch (error) {
22853
+ reject(error);
22854
+ }
22855
+ };
22856
+ const resolvePrompt = (value) => settlePrompt(() => resolve(value));
22857
+ const rejectPrompt = (error) => settlePrompt(() => reject(error));
22858
+ const promptPromise = Object.assign(promise.finally(() => {
22859
+ cleanups.forEach((cleanup) => cleanup());
22860
+ screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
22861
+ output.end();
22862
+ }).then(() => promise), { cancel: () => rejectPrompt(new CancelPromptError()) });
22863
+ if (signal) {
22864
+ const abort = () => rejectPrompt(new AbortPromptError({ cause: signal.reason }));
22865
+ if (signal.aborted) {
22866
+ abort();
22867
+ return promptPromise;
22868
+ }
22869
+ cleanups.add(listenTo(signal, "abort", abort));
22870
+ }
22871
+ cleanups.add(onExit((code, signal) => {
22872
+ rejectPrompt(new ExitPromptError(`User force closed the prompt with ${code} ${signal}`));
22873
+ }));
22874
+ cleanups.add(listenTo(rl, "SIGINT", () => rejectPrompt(new ExitPromptError(`User force closed the prompt with SIGINT`))));
22875
+ cleanups.add(listenTo(rl, "close", clearEffects));
22841
22876
  const startCycle = () => {
22842
- const checkCursorPos = () => screen.checkCursorPos();
22843
- rl.input.on("keypress", checkCursorPos);
22844
- cleanups.add(() => rl.input.removeListener("keypress", checkCursorPos));
22877
+ cleanups.add(listenTo(rl.input, "keypress", () => screen.checkCursorPos()));
22845
22878
  let pendingDone = null;
22846
22879
  cycle(() => {
22847
22880
  let effectsSettled = false;
22848
22881
  try {
22849
22882
  const nextView = view(config, (value) => {
22850
- if (effectsSettled) resolve(value);
22883
+ if (effectsSettled) resolvePrompt(value);
22851
22884
  else pendingDone = { value };
22852
22885
  });
22853
22886
  if (nextView === void 0) {
@@ -22859,29 +22892,19 @@ function createPrompt(view) {
22859
22892
  screen.render(content, bottomContent);
22860
22893
  effectScheduler.run();
22861
22894
  } catch (error) {
22862
- reject(error);
22895
+ rejectPrompt(error);
22863
22896
  }
22864
22897
  effectsSettled = true;
22865
22898
  if (pendingDone !== null) {
22866
22899
  const { value } = pendingDone;
22867
22900
  pendingDone = null;
22868
- resolve(value);
22901
+ resolvePrompt(value);
22869
22902
  }
22870
22903
  });
22871
22904
  };
22872
22905
  if ("readableFlowing" in input) nativeSetImmediate(startCycle);
22873
22906
  else startCycle();
22874
- return Object.assign(promise.then((answer) => {
22875
- effectScheduler.clearAll();
22876
- return answer;
22877
- }, (error) => {
22878
- effectScheduler.clearAll();
22879
- throw error;
22880
- }).finally(() => {
22881
- cleanups.forEach((cleanup) => cleanup());
22882
- screen.done({ clearContent: Boolean(context.clearPromptOnDone) });
22883
- output.end();
22884
- }).then(() => promise), { cancel });
22907
+ return promptPromise;
22885
22908
  });
22886
22909
  };
22887
22910
  return prompt;
@@ -23435,7 +23458,7 @@ async function runUpdo(pm, options = {}) {
23435
23458
  const workspaceNames = new Set(workspaces.map((ws) => ws.name));
23436
23459
  const uniqueDependencyNames = /* @__PURE__ */ new Set();
23437
23460
  console.log(chalk.gray("Scanning workspace dependencies..."));
23438
- const declaredDeps = collectWorkspaceDeps(cwd, workspaces, workspaceNames);
23461
+ const declaredDeps = collectWorkspaceDeps(cwd, workspaces, workspaceNames).filter((dep) => isRegistryDependencySpec(dep.range));
23439
23462
  for (const dep of declaredDeps) uniqueDependencyNames.add(dep.registryName);
23440
23463
  console.log(chalk.gray(` Found ${uniqueDependencyNames.size} unique dependencies across ${workspaces.length} workspaces`));
23441
23464
  const minReleaseAge = resolveMinReleaseAgeFilter(pm.name, cwd);
@@ -65574,7 +65597,7 @@ const xyBase = async (options = {}) => {
65574
65597
  ].includes(a))) return;
65575
65598
  console.error(chalk.yellow(`Command not found [${chalk.magenta(cmd)}]`));
65576
65599
  console.log(chalk.gray(`Try '${cliLabel} --help' for list of commands`));
65577
- }).version().help().argv;
65600
+ }).version(bundledToolchainVersion()).help().argv;
65578
65601
  };
65579
65602
  function registerLifecyclePlugins(args, channel) {
65580
65603
  let result = xyInstallCommands(xyDeployCommands(args));