@ariestools/toolchain 9.2.1 → 10.0.1
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/actions/cleanRuleCatalog.d.ts +2 -10
- package/dist/actions/cleanRuleCatalog.d.ts.map +1 -1
- package/dist/actions/dead/dead.d.ts.map +1 -1
- package/dist/actions/dead/evaluateRules.d.ts +1 -0
- package/dist/actions/dead/evaluateRules.d.ts.map +1 -1
- package/dist/actions/dead/ruleChecks.d.ts +32 -0
- package/dist/actions/dead/ruleChecks.d.ts.map +1 -0
- package/dist/actions/dead/runDeadAnalysis.d.ts +4 -3
- package/dist/actions/dead/runDeadAnalysis.d.ts.map +1 -1
- package/dist/actions/package/cleanRules.d.ts +4 -0
- package/dist/actions/package/cleanRules.d.ts.map +1 -1
- package/dist/actions/ruleCatalog.d.ts +1 -1
- package/dist/actions/ruleCatalog.d.ts.map +1 -1
- package/dist/actions/ruleCatalogRender.d.ts +12 -0
- package/dist/actions/ruleCatalogRender.d.ts.map +1 -1
- package/dist/actions/ruleRunner.d.ts +15 -1
- package/dist/actions/ruleRunner.d.ts.map +1 -1
- package/dist/bin/package/build.mjs +0 -4
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +34 -29
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +0 -4
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +34 -29
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/xy.mjs +290 -351
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/bin/xyex.mjs +290 -351
- package/dist/bin/xyex.mjs.map +1 -1
- package/dist/lib/ruleCommandRegistry.d.ts +0 -4
- package/dist/lib/ruleCommandRegistry.d.ts.map +1 -1
- package/dist/xy/common/gitlintCommand.d.ts +0 -1
- package/dist/xy/common/gitlintCommand.d.ts.map +1 -1
- package/dist/xy/common/index.d.ts.map +1 -1
- package/dist/xy/lint/index.d.ts.map +1 -1
- package/dist/xy/lint/lintlintCommand.d.ts +0 -1
- package/dist/xy/lint/lintlintCommand.d.ts.map +1 -1
- package/dist/xy/lint/nodeLintCommand.d.ts +0 -1
- package/dist/xy/lint/nodeLintCommand.d.ts.map +1 -1
- package/dist/xy/stability.d.ts +0 -4
- package/dist/xy/stability.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -8979,7 +8979,6 @@ const RULE_COMMANDS = {
|
|
|
8979
8979
|
title: "Fix Rules"
|
|
8980
8980
|
},
|
|
8981
8981
|
gitLint: {
|
|
8982
|
-
aliases: ["gitlint"],
|
|
8983
8982
|
command: "git lint",
|
|
8984
8983
|
configKey: "gitLint",
|
|
8985
8984
|
includeInRoot: true,
|
|
@@ -8992,14 +8991,12 @@ const RULE_COMMANDS = {
|
|
|
8992
8991
|
title: "Lint Rules"
|
|
8993
8992
|
},
|
|
8994
8993
|
lintLint: {
|
|
8995
|
-
aliases: ["lintlint"],
|
|
8996
8994
|
command: "lint lint",
|
|
8997
8995
|
configKey: "lintLint",
|
|
8998
8996
|
includeInRoot: true,
|
|
8999
8997
|
title: "Lint Lint Rules"
|
|
9000
8998
|
},
|
|
9001
8999
|
nodeLint: {
|
|
9002
|
-
aliases: ["node-lint"],
|
|
9003
9000
|
command: "node lint",
|
|
9004
9001
|
configKey: "nodeLint",
|
|
9005
9002
|
includeInRoot: true,
|
|
@@ -9018,7 +9015,6 @@ const RULE_COMMANDS = {
|
|
|
9018
9015
|
title: "Plan Lint Rules"
|
|
9019
9016
|
},
|
|
9020
9017
|
publint: {
|
|
9021
|
-
aliases: ["republint"],
|
|
9022
9018
|
command: "publint",
|
|
9023
9019
|
configKey: "publint",
|
|
9024
9020
|
includeInRoot: true,
|
|
@@ -10919,7 +10915,7 @@ function resolveSafeCleanPatterns(patterns, baseDir, rootDir) {
|
|
|
10919
10915
|
return resolvedPatterns;
|
|
10920
10916
|
}
|
|
10921
10917
|
//#endregion
|
|
10922
|
-
//#region src/actions/
|
|
10918
|
+
//#region src/actions/ruleRunner.ts
|
|
10923
10919
|
const RULE_LEVELS = /* @__PURE__ */ new Set([
|
|
10924
10920
|
"error",
|
|
10925
10921
|
"off",
|
|
@@ -10928,29 +10924,34 @@ const RULE_LEVELS = /* @__PURE__ */ new Set([
|
|
|
10928
10924
|
function isRuleLevel(value) {
|
|
10929
10925
|
return typeof value === "string" && RULE_LEVELS.has(value);
|
|
10930
10926
|
}
|
|
10931
|
-
function
|
|
10932
|
-
if (setting.level !== void 0) {
|
|
10933
|
-
if (!isRuleLevel(setting.level)) throw new TypeError(`${location}.level must be "error", "warn", or "off"`);
|
|
10934
|
-
return setting.level;
|
|
10935
|
-
}
|
|
10936
|
-
if (setting.enabled !== void 0) {
|
|
10937
|
-
if (typeof setting.enabled !== "boolean") throw new TypeError(`${location}.enabled must be a boolean`);
|
|
10938
|
-
return setting.enabled ? defaultLevel : "off";
|
|
10939
|
-
}
|
|
10940
|
-
throw new TypeError(`${location} must be a rule level, boolean, [level, options], or { level?, enabled? } object`);
|
|
10941
|
-
}
|
|
10942
|
-
/**
|
|
10943
|
-
* Local parse of rule level settings — kept here to avoid a circular import
|
|
10944
|
-
* through `ruleRunner` → `package/index` → `cleanRules`.
|
|
10945
|
-
*/
|
|
10946
|
-
function parseCleanRuleLevel(location, setting, defaultLevel) {
|
|
10927
|
+
function parseRuleLevelSetting(location, setting, defaultLevel) {
|
|
10947
10928
|
if (setting === void 0) return defaultLevel;
|
|
10948
10929
|
if (typeof setting === "boolean") return setting ? "warn" : "off";
|
|
10949
10930
|
if (isRuleLevel(setting)) return setting;
|
|
10950
|
-
if (Array.isArray(setting) && setting.length > 0
|
|
10951
|
-
|
|
10931
|
+
if (Array.isArray(setting) && setting.length > 0) {
|
|
10932
|
+
const [level] = setting;
|
|
10933
|
+
if (isRuleLevel(level)) return level;
|
|
10934
|
+
}
|
|
10935
|
+
if (typeof setting === "object" && setting !== null && !Array.isArray(setting)) {
|
|
10936
|
+
const record = setting;
|
|
10937
|
+
if (record.level !== void 0) {
|
|
10938
|
+
if (!isRuleLevel(record.level)) throw new TypeError(`${location}.level must be "error", "warn", or "off"`);
|
|
10939
|
+
return record.level;
|
|
10940
|
+
}
|
|
10941
|
+
if (record.enabled !== void 0) {
|
|
10942
|
+
if (typeof record.enabled !== "boolean") throw new TypeError(`${location}.enabled must be a boolean`);
|
|
10943
|
+
return record.enabled ? defaultLevel : "off";
|
|
10944
|
+
}
|
|
10945
|
+
}
|
|
10952
10946
|
throw new TypeError(`${location} must be a rule level, boolean, [level, options], or { level?, enabled? } object`);
|
|
10953
10947
|
}
|
|
10948
|
+
function validateConfiguredRuleIds(commandName, configKey, rules, config) {
|
|
10949
|
+
const known = new Set(rules.flatMap((rule) => [rule.id, ...rule.aliases ?? []]));
|
|
10950
|
+
const unknown = Object.keys(config?.rules ?? {}).filter((id) => !known.has(id));
|
|
10951
|
+
if (unknown.length > 0) throw new TypeError(`Unknown ${commandName} rule ${unknown.map((id) => `"${id}"`).join(", ")} in commands.${configKey}.rules`);
|
|
10952
|
+
}
|
|
10953
|
+
//#endregion
|
|
10954
|
+
//#region src/actions/package/cleanRules.ts
|
|
10954
10955
|
/**
|
|
10955
10956
|
Hard safety rules — always enforced; cannot be disabled via config.
|
|
10956
10957
|
*/
|
|
@@ -10973,7 +10974,6 @@ const CLEAN_CONFIGURABLE_RULES = [{
|
|
|
10973
10974
|
description: "Also delete every path under the package that is matched by .gitignore",
|
|
10974
10975
|
id: "clean.gitignored-all"
|
|
10975
10976
|
}];
|
|
10976
|
-
const CONFIGURABLE_RULE_IDS = new Set(CLEAN_CONFIGURABLE_RULES.map((rule) => rule.id));
|
|
10977
10977
|
const HARD_RULE_IDS = new Set(CLEAN_HARD_RULES.map((rule) => rule.id));
|
|
10978
10978
|
/**
|
|
10979
10979
|
Immutable exclude entries — always skipped by clean, cannot be overridden.
|
|
@@ -10999,17 +10999,22 @@ function defaultLevelForRule(ruleId) {
|
|
|
10999
10999
|
return CLEAN_CONFIGURABLE_RULES.find((rule) => rule.id === ruleId)?.defaultLevel ?? "off";
|
|
11000
11000
|
}
|
|
11001
11001
|
/**
|
|
11002
|
+
* Reject config references to hard (non-configurable) safety rules.
|
|
11003
|
+
*/
|
|
11004
|
+
function assertCleanConfigurableRules(config) {
|
|
11005
|
+
const configured = Object.keys(config?.rules ?? {});
|
|
11006
|
+
for (const ruleId of configured) if (HARD_RULE_IDS.has(ruleId)) throw new TypeError(`commands.clean.rules["${ruleId}"] cannot be configured — hard safety rules are always enforced`);
|
|
11007
|
+
}
|
|
11008
|
+
/**
|
|
11002
11009
|
* Resolve configurable clean rule levels from config. Throws if the config
|
|
11003
11010
|
* references hard (non-configurable) rules or unknown rule ids.
|
|
11004
11011
|
*/
|
|
11005
11012
|
function resolveCleanRules(config) {
|
|
11006
11013
|
const rules = config?.rules ?? {};
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
if (!CONFIGURABLE_RULE_IDS.has(ruleId)) throw new TypeError(`Unknown clean rule "${ruleId}" in commands.clean.rules. Configurable rules: ${[...CONFIGURABLE_RULE_IDS].join(", ")}`);
|
|
11010
|
-
}
|
|
11014
|
+
assertCleanConfigurableRules(config);
|
|
11015
|
+
validateConfiguredRuleIds("clean", "clean", CLEAN_CONFIGURABLE_RULES, config);
|
|
11011
11016
|
const level = (ruleId, setting) => {
|
|
11012
|
-
return
|
|
11017
|
+
return parseRuleLevelSetting(`commands.clean.rules["${ruleId}"]`, setting, defaultLevelForRule(ruleId));
|
|
11013
11018
|
};
|
|
11014
11019
|
return {
|
|
11015
11020
|
gitignoredAll: level("clean.gitignored-all", rules["clean.gitignored-all"]),
|