@ariestools/toolchain 8.6.12 → 8.7.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 (74) hide show
  1. package/dist/actions/api-exposure/config.d.ts.map +1 -1
  2. package/dist/actions/deplint/packageJsonEditor.d.ts +1 -1
  3. package/dist/actions/deplint/ruleConfig.d.ts.map +1 -1
  4. package/dist/actions/deplint/types.d.ts +1 -1
  5. package/dist/actions/gitlint.d.ts +2 -0
  6. package/dist/actions/gitlint.d.ts.map +1 -1
  7. package/dist/actions/lintlint.d.ts +31 -0
  8. package/dist/actions/lintlint.d.ts.map +1 -1
  9. package/dist/actions/node-lint.d.ts +7 -0
  10. package/dist/actions/node-lint.d.ts.map +1 -1
  11. package/dist/actions/package/compile/MonolithConfig.d.ts +23 -4
  12. package/dist/actions/package/compile/MonolithConfig.d.ts.map +1 -1
  13. package/dist/actions/package/compile/PublintConfig.d.ts +4 -2
  14. package/dist/actions/package/compile/PublintConfig.d.ts.map +1 -1
  15. package/dist/actions/package/compile/XyConfig.d.ts +18 -6
  16. package/dist/actions/package/compile/XyConfig.d.ts.map +1 -1
  17. package/dist/actions/package/compile/index.d.ts +1 -0
  18. package/dist/actions/package/compile/index.d.ts.map +1 -1
  19. package/dist/actions/package/compile/monolithCompileEntries.d.ts +8 -6
  20. package/dist/actions/package/compile/monolithCompileEntries.d.ts.map +1 -1
  21. package/dist/actions/package/compile/monolithCompileLayout.d.ts +2 -0
  22. package/dist/actions/package/compile/monolithCompileLayout.d.ts.map +1 -1
  23. package/dist/actions/package/compile/monolithReexport.d.ts +45 -0
  24. package/dist/actions/package/compile/monolithReexport.d.ts.map +1 -0
  25. package/dist/actions/package/compile/packageCompileMonolith.d.ts.map +1 -1
  26. package/dist/actions/package/publintRules.d.ts +4 -1
  27. package/dist/actions/package/publintRules.d.ts.map +1 -1
  28. package/dist/actions/package-lint.d.ts.map +1 -1
  29. package/dist/actions/packman/lint.d.ts +14 -0
  30. package/dist/actions/packman/lint.d.ts.map +1 -1
  31. package/dist/actions/ruleCatalog.d.ts +4 -2
  32. package/dist/actions/ruleCatalog.d.ts.map +1 -1
  33. package/dist/actions/ruleRunner.d.ts +4 -1
  34. package/dist/actions/ruleRunner.d.ts.map +1 -1
  35. package/dist/actions/skills/lint.d.ts +13 -0
  36. package/dist/actions/skills/lint.d.ts.map +1 -1
  37. package/dist/bin/package/build.mjs +412 -55
  38. package/dist/bin/package/build.mjs.map +1 -1
  39. package/dist/bin/package/compile.mjs +249 -21
  40. package/dist/bin/package/compile.mjs.map +1 -1
  41. package/dist/bin/package/publint.mjs +163 -34
  42. package/dist/bin/package/publint.mjs.map +1 -1
  43. package/dist/bin/package/recompile.mjs +249 -21
  44. package/dist/bin/package/recompile.mjs.map +1 -1
  45. package/dist/bin/package/sync-layout.mjs +47 -7
  46. package/dist/bin/package/sync-layout.mjs.map +1 -1
  47. package/dist/bin/xy.mjs +6942 -621
  48. package/dist/bin/xy.mjs.map +1 -1
  49. package/dist/lib/index.d.ts +1 -0
  50. package/dist/lib/index.d.ts.map +1 -1
  51. package/dist/lib/loadConfig.d.ts +1 -0
  52. package/dist/lib/loadConfig.d.ts.map +1 -1
  53. package/dist/lib/ruleCommandRegistry.d.ts +100 -0
  54. package/dist/lib/ruleCommandRegistry.d.ts.map +1 -0
  55. package/dist/xy/common/gitCommand.d.ts +3 -0
  56. package/dist/xy/common/gitCommand.d.ts.map +1 -0
  57. package/dist/xy/common/gitlintCommand.d.ts +2 -0
  58. package/dist/xy/common/gitlintCommand.d.ts.map +1 -1
  59. package/dist/xy/common/index.d.ts.map +1 -1
  60. package/dist/xy/deprecatedCommand.d.ts +2 -0
  61. package/dist/xy/deprecatedCommand.d.ts.map +1 -0
  62. package/dist/xy/lint/index.d.ts.map +1 -1
  63. package/dist/xy/lint/lint/index.d.ts.map +1 -1
  64. package/dist/xy/lint/lint/runCommand.d.ts.map +1 -1
  65. package/dist/xy/lint/lintlintCommand.d.ts +2 -0
  66. package/dist/xy/lint/lintlintCommand.d.ts.map +1 -1
  67. package/dist/xy/lint/nodeCommand.d.ts +3 -0
  68. package/dist/xy/lint/nodeCommand.d.ts.map +1 -0
  69. package/dist/xy/lint/nodeLintCommand.d.ts +2 -0
  70. package/dist/xy/lint/nodeLintCommand.d.ts.map +1 -1
  71. package/dist/xy/lint/publintCommand.d.ts.map +1 -1
  72. package/dist/xy/lint/relintCommand.d.ts.map +1 -1
  73. package/dist/xy/lint/republintCommand.d.ts.map +1 -1
  74. package/package.json +5 -4
@@ -9174,8 +9174,8 @@ var require_ExplorerSync = /* @__PURE__ */ __commonJSMin(((exports) => {
9174
9174
  exports.ExplorerSync = ExplorerSync;
9175
9175
  }));
9176
9176
  //#endregion
9177
- //#region src/lib/loadConfig.ts
9178
- var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
9177
+ //#region ../../node_modules/.pnpm/cosmiconfig@9.0.2_typescript@6.0.3/node_modules/cosmiconfig/dist/index.js
9178
+ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
9179
9179
  Object.defineProperty(exports, "__esModule", { value: true });
9180
9180
  exports.defaultLoadersSync = exports.defaultLoaders = exports.globalConfigSearchPlacesSync = exports.globalConfigSearchPlaces = exports.getDefaultSearchPlacesSync = exports.getDefaultSearchPlaces = void 0;
9181
9181
  exports.cosmiconfig = cosmiconfig;
@@ -9307,7 +9307,111 @@ var import_dist = (/* @__PURE__ */ __commonJSMin(((exports) => {
9307
9307
  clearCaches: explorer.clearCaches.bind(explorer)
9308
9308
  };
9309
9309
  }
9310
- })))();
9310
+ }));
9311
+ //#endregion
9312
+ //#region src/lib/ruleCommandRegistry.ts
9313
+ const RULE_COMMANDS = {
9314
+ apiExposure: {
9315
+ command: "api-exposure",
9316
+ configKey: "apiExposure",
9317
+ includeInRoot: true,
9318
+ title: "API Exposure Rules"
9319
+ },
9320
+ check: {
9321
+ command: "check",
9322
+ includeInRoot: true,
9323
+ title: "Check Rules"
9324
+ },
9325
+ cycle: {
9326
+ command: "cycle",
9327
+ includeInRoot: true,
9328
+ title: "Cycle Rules"
9329
+ },
9330
+ dead: {
9331
+ command: "dead",
9332
+ configKey: "dead",
9333
+ includeInRoot: true,
9334
+ title: "Dead Rules"
9335
+ },
9336
+ deplint: {
9337
+ command: "deplint",
9338
+ configKey: "deplint",
9339
+ includeInRoot: true,
9340
+ title: "Deplint Rules"
9341
+ },
9342
+ fix: {
9343
+ command: "fix",
9344
+ includeInRoot: false,
9345
+ title: "Fix Rules"
9346
+ },
9347
+ gitLint: {
9348
+ aliases: ["gitlint"],
9349
+ command: "git lint",
9350
+ configKey: "gitLint",
9351
+ includeInRoot: true,
9352
+ title: "Git Lint Rules"
9353
+ },
9354
+ lint: {
9355
+ aliases: ["relint"],
9356
+ command: "lint",
9357
+ includeInRoot: true,
9358
+ title: "Lint Rules"
9359
+ },
9360
+ lintLint: {
9361
+ aliases: ["lintlint"],
9362
+ command: "lint lint",
9363
+ configKey: "lintLint",
9364
+ includeInRoot: true,
9365
+ title: "Lint Lint Rules"
9366
+ },
9367
+ nodeLint: {
9368
+ aliases: ["node-lint"],
9369
+ command: "node lint",
9370
+ configKey: "nodeLint",
9371
+ includeInRoot: true,
9372
+ title: "Node Lint Rules"
9373
+ },
9374
+ packman: {
9375
+ command: "packman lint",
9376
+ configKey: "packman",
9377
+ includeInRoot: true,
9378
+ title: "Packman Lint Rules"
9379
+ },
9380
+ publint: {
9381
+ aliases: ["republint"],
9382
+ command: "publint",
9383
+ configKey: "publint",
9384
+ includeInRoot: true,
9385
+ title: "Publint Rules"
9386
+ },
9387
+ repoLint: {
9388
+ command: "repo lint",
9389
+ configKey: "repoLint",
9390
+ includeInRoot: true,
9391
+ title: "Repo Lint Rules"
9392
+ },
9393
+ skillsLint: {
9394
+ command: "skills lint",
9395
+ configKey: "skillsLint",
9396
+ includeInRoot: true,
9397
+ title: "Skills Lint Rules"
9398
+ }
9399
+ };
9400
+ const DEPRECATED_CONFIG_KEY_ALIASES = {
9401
+ gitLint: ["gitlint"],
9402
+ lintLint: ["lintlint"]
9403
+ };
9404
+ const CONFIG_ALIAS_TO_CANONICAL = new Map(Object.entries(DEPRECATED_CONFIG_KEY_ALIASES).flatMap(([canonical, aliases]) => aliases.map((alias) => [alias, canonical])));
9405
+ const RULE_CONFIG_COMMAND_KEYS = new Set(Object.values(RULE_COMMANDS).flatMap((command) => "configKey" in command ? [command.configKey] : []));
9406
+ function canonicalRuleConfigKey(commandName) {
9407
+ return CONFIG_ALIAS_TO_CANONICAL.get(commandName) ?? commandName;
9408
+ }
9409
+ function deprecatedRuleConfigAliases(configKey) {
9410
+ return Object.entries(DEPRECATED_CONFIG_KEY_ALIASES).find(([canonical]) => canonical === configKey)?.[1] ?? [];
9411
+ }
9412
+ //#endregion
9413
+ //#region src/lib/loadConfig.ts
9414
+ var import_dist = require_dist();
9311
9415
  const configState = {
9312
9416
  config: void 0,
9313
9417
  rootConfigPath: void 0
@@ -9355,21 +9459,30 @@ async function loadWorkspaceConfig(workspaceDir) {
9355
9459
  }
9356
9460
  /** Deprecated top-level fields that should be under `commands`. */
9357
9461
  const DEPRECATED_COMMAND_FIELDS = /* @__PURE__ */ new Set(["deplint", "publint"]);
9462
+ function warnOnce(key, message) {
9463
+ if (deprecationWarned.has(key)) return;
9464
+ deprecationWarned.add(key);
9465
+ console.warn(chalk.yellow(message));
9466
+ }
9358
9467
  /**
9359
9468
  * Resolves a command's config field from a config object.
9360
9469
  * Prefers `commands.[name]` over top-level `[name]`.
9361
9470
  * Warns once per config file when a deprecated top-level field is used.
9362
9471
  */
9363
9472
  function resolveCommandField(cfg, commandName, configPath) {
9364
- const fromCommands = cfg.commands?.[commandName];
9365
- if (fromCommands !== void 0 && typeof fromCommands === "object") return fromCommands;
9366
- const fromTopLevel = cfg[commandName];
9367
- if (fromTopLevel !== void 0 && typeof fromTopLevel === "object" && DEPRECATED_COMMAND_FIELDS.has(commandName)) {
9368
- const key = `${configPath ?? "unknown"}:${commandName}`;
9369
- if (!deprecationWarned.has(key)) {
9370
- deprecationWarned.add(key);
9371
- console.warn(chalk.yellow(`[xy] Deprecated: top-level "${commandName}" in ${configPath ?? "xy.config"} — move to "commands.${commandName}"`));
9372
- }
9473
+ const configKey = canonicalRuleConfigKey(commandName);
9474
+ const commands = isRecord$1(cfg.commands) ? cfg.commands : void 0;
9475
+ const fromCommands = commands?.[configKey];
9476
+ if (isRecord$1(fromCommands)) return fromCommands;
9477
+ for (const alias of deprecatedRuleConfigAliases(configKey)) {
9478
+ const fromAlias = commands?.[alias];
9479
+ if (!isRecord$1(fromAlias)) continue;
9480
+ warnOnce(`${configPath ?? "unknown"}:commands.${alias}`, `[xy] Deprecated: "commands.${alias}" in ${configPath ?? "xy.config"} — use "commands.${configKey}"`);
9481
+ return fromAlias;
9482
+ }
9483
+ const fromTopLevel = cfg[configKey];
9484
+ if (fromTopLevel !== void 0 && typeof fromTopLevel === "object" && DEPRECATED_COMMAND_FIELDS.has(configKey)) {
9485
+ warnOnce(`${configPath ?? "unknown"}:${configKey}`, `[xy] Deprecated: top-level "${configKey}" in ${configPath ?? "xy.config"} — move to "commands.${configKey}"`);
9373
9486
  return fromTopLevel;
9374
9487
  }
9375
9488
  return {};
@@ -9381,20 +9494,9 @@ function mergeRuleConfigs(target, source) {
9381
9494
  };
9382
9495
  return source;
9383
9496
  }
9384
- const RULE_CONFIG_COMMANDS = /* @__PURE__ */ new Set([
9385
- "apiExposure",
9386
- "dead",
9387
- "deplint",
9388
- "gitlint",
9389
- "lintlint",
9390
- "nodeLint",
9391
- "packman",
9392
- "publint",
9393
- "repoLint",
9394
- "skillsLint"
9395
- ]);
9396
9497
  function mergeCommandConfig(rootCmd, workspaceCmd, commandName) {
9397
- return deepMerge(rootCmd, workspaceCmd, { customMerge: (key) => RULE_CONFIG_COMMANDS.has(commandName) && key === "rules" ? mergeRuleConfigs : void 0 });
9498
+ const configKey = canonicalRuleConfigKey(commandName);
9499
+ return deepMerge(rootCmd, workspaceCmd, { customMerge: (key) => RULE_CONFIG_COMMAND_KEYS.has(configKey) && key === "rules" ? mergeRuleConfigs : void 0 });
9398
9500
  }
9399
9501
  /**
9400
9502
  * Loads a command-specific config merged from root and workspace levels.
@@ -9417,8 +9519,9 @@ function isWorkspaceUnderRootConfig(workspaceDir) {
9417
9519
  return relative === "" || !relative.startsWith("..") && !PATH.isAbsolute(relative);
9418
9520
  }
9419
9521
  async function loadWorkspaceCommandConfig(workspaceDir, commandName) {
9522
+ const configKey = canonicalRuleConfigKey(commandName);
9420
9523
  const root = await loadConfig();
9421
- return mergeCommandConfig(isWorkspaceUnderRootConfig(workspaceDir) ? resolveCommandField(root, commandName, configState.rootConfigPath) : {}, resolveCommandField(await loadWorkspaceConfig(workspaceDir), commandName, workspaceConfigCache.has(workspaceDir) ? workspaceDir : void 0), commandName);
9524
+ return mergeCommandConfig(isWorkspaceUnderRootConfig(workspaceDir) ? resolveCommandField(root, configKey, configState.rootConfigPath) : {}, resolveCommandField(await loadWorkspaceConfig(workspaceDir), configKey, workspaceConfigCache.has(workspaceDir) ? workspaceDir : void 0), configKey);
9422
9525
  }
9423
9526
  //#endregion
9424
9527
  //#region src/lib/reporting/xyReporter.ts
@@ -10322,6 +10425,10 @@ const ALL_PUBLINT_CHECKS = [
10322
10425
  "source",
10323
10426
  "types"
10324
10427
  ];
10428
+ function publintRuleId$1(check) {
10429
+ return `pub.${check}`;
10430
+ }
10431
+ ALL_PUBLINT_CHECKS.map(publintRuleId$1);
10325
10432
  /** Checks that only apply to published (non-private) packages */
10326
10433
  const PUBLISH_ONLY_CHECKS = [
10327
10434
  "defaultExportOrder",
@@ -11212,9 +11319,19 @@ const PUBLINT_RULE_LEVELS = /* @__PURE__ */ new Set([
11212
11319
  "off",
11213
11320
  "warn"
11214
11321
  ]);
11322
+ const PUBLINT_RULE_PREFIX = "pub.";
11323
+ const deprecatedPublintRuleWarnings = /* @__PURE__ */ new Set();
11215
11324
  function defaultPublintLevel(check) {
11216
11325
  return check === "platform" || check === "publint" ? "error" : "warn";
11217
11326
  }
11327
+ function publintRuleId(check) {
11328
+ return `${PUBLINT_RULE_PREFIX}${check}`;
11329
+ }
11330
+ function warnDeprecatedPublintRuleName(ruleName) {
11331
+ if (deprecatedPublintRuleWarnings.has(ruleName)) return;
11332
+ deprecatedPublintRuleWarnings.add(ruleName);
11333
+ console.warn(`Deprecated: commands.publint.rules["${ruleName}"] is deprecated; use commands.publint.rules["${publintRuleId(ruleName)}"] instead.`);
11334
+ }
11218
11335
  function normalizePublintConfig$2(value) {
11219
11336
  if (typeof value === "object") return value;
11220
11337
  return {};
@@ -11222,6 +11339,11 @@ function normalizePublintConfig$2(value) {
11222
11339
  function isPublintCheckName(value) {
11223
11340
  return ALL_PUBLINT_CHECKS.includes(value);
11224
11341
  }
11342
+ function normalizePublintRuleName(location, value) {
11343
+ const bareName = value.startsWith(PUBLINT_RULE_PREFIX) ? value.slice(4) : value;
11344
+ if (!isPublintCheckName(bareName)) throw new TypeError(`Unknown publint rule "${value}" in ${location}`);
11345
+ return bareName;
11346
+ }
11225
11347
  function isRuleLevel(value) {
11226
11348
  return typeof value === "string" && PUBLINT_RULE_LEVELS.has(value);
11227
11349
  }
@@ -11241,10 +11363,7 @@ function parseRuleLevel(location, value) {
11241
11363
  throw new TypeError(`${location} must be "error", "warn", "off", boolean, [level, options], or { level?, enabled? }`);
11242
11364
  }
11243
11365
  function normalizePublintRuleNames(location, values) {
11244
- return (values ?? []).map((value) => {
11245
- if (!isPublintCheckName(value)) throw new TypeError(`Unknown publint check "${value}" in ${location}`);
11246
- return value;
11247
- });
11366
+ return (values ?? []).map((value) => normalizePublintRuleName(location, value));
11248
11367
  }
11249
11368
  function defaultLevels() {
11250
11369
  return new Map(ALL_PUBLINT_CHECKS.map((check) => [check, defaultPublintLevel(check)]));
@@ -11265,9 +11384,19 @@ function applyExcluded(levels, explicit, exclude) {
11265
11384
  for (const check of exclude) setRuleLevel(levels, explicit, check, "off");
11266
11385
  }
11267
11386
  function applyConfiguredRules(levels, explicit, rules) {
11268
- for (const [check, setting] of Object.entries(rules ?? {})) {
11269
- if (!isPublintCheckName(check)) throw new TypeError(`Unknown publint check "${check}" in commands.publint.rules`);
11270
- setRuleLevel(levels, explicit, check, parseRuleLevel(`commands.publint.rules["${check}"]`, setting));
11387
+ const configuredRules = Object.entries(rules ?? {});
11388
+ const canonicalRuleIds = new Set(configuredRules.map(([ruleId]) => ruleId).filter((ruleId) => ruleId.startsWith(PUBLINT_RULE_PREFIX)));
11389
+ for (const [check, setting] of configuredRules) {
11390
+ if (check.startsWith(PUBLINT_RULE_PREFIX)) continue;
11391
+ const ruleName = normalizePublintRuleName("commands.publint.rules", check);
11392
+ if (canonicalRuleIds.has(publintRuleId(ruleName))) continue;
11393
+ warnDeprecatedPublintRuleName(ruleName);
11394
+ setRuleLevel(levels, explicit, ruleName, parseRuleLevel(`commands.publint.rules["${publintRuleId(ruleName)}"]`, setting));
11395
+ }
11396
+ for (const [ruleId, setting] of configuredRules) {
11397
+ if (!ruleId.startsWith(PUBLINT_RULE_PREFIX)) continue;
11398
+ const check = normalizePublintRuleName("commands.publint.rules", ruleId);
11399
+ setRuleLevel(levels, explicit, check, parseRuleLevel(`commands.publint.rules["${publintRuleId(check)}"]`, setting));
11271
11400
  }
11272
11401
  }
11273
11402
  function resolvePublintRules(value, cliExclude, cliInclude) {
@@ -11276,9 +11405,9 @@ function resolvePublintRules(value, cliExclude, cliInclude) {
11276
11405
  const configInclude = normalizePublintRuleNames("commands.publint.include", config.include);
11277
11406
  const normalizedCliExclude = normalizePublintRuleNames("--exclude", cliExclude);
11278
11407
  const normalizedCliInclude = normalizePublintRuleNames("--include", cliInclude);
11408
+ if ((configExclude.length > 0 || normalizedCliExclude.length > 0) && (configInclude.length > 0 || normalizedCliInclude.length > 0)) throw new TypeError("Publint: --include and --exclude cannot be used together");
11279
11409
  const levels = defaultLevels();
11280
11410
  const explicit = /* @__PURE__ */ new Set();
11281
- if ((configExclude.length > 0 || normalizedCliExclude.length > 0) && (configInclude.length > 0 || normalizedCliInclude.length > 0)) throw new TypeError("Publint: --include and --exclude cannot be used together");
11282
11411
  applyIncludedOnly(levels, explicit, configInclude);
11283
11412
  applyExcluded(levels, explicit, configExclude);
11284
11413
  applyConfiguredRules(levels, explicit, config.rules);