@ariestools/toolchain 8.7.17 → 8.7.18

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.
@@ -11148,8 +11148,9 @@ function resolveCleanRules(config) {
11148
11148
  gitignoredOnly: level("clean.gitignored-only", rules["clean.gitignored-only"])
11149
11149
  };
11150
11150
  }
11151
- /** Merge immutable + default + config exclude patterns (deduped, order preserved). */
11152
- function resolveCleanExclude(config) {
11151
+ /** Merge exclude patterns (deduped, order preserved). */
11152
+ function resolveCleanExclude(config, mode = "normal") {
11153
+ if (mode === "immutable-only") return [...CLEAN_IMMUTABLE_EXCLUDE];
11153
11154
  const merged = [
11154
11155
  ...CLEAN_IMMUTABLE_EXCLUDE,
11155
11156
  ...CLEAN_DEFAULT_EXCLUDE,
@@ -11172,6 +11173,9 @@ function resolveCleanPatterns(config) {
11172
11173
  init_index_min();
11173
11174
  /** Built-in clean targets — always cleaned (bypass gitignored-only). */
11174
11175
  const BUILTIN_CLEAN_PATTERNS = ["dist", "build"];
11176
+ function excludeModeForFull(fullMode) {
11177
+ return fullMode === "full-all" ? "immutable-only" : "normal";
11178
+ }
11175
11179
  function toPosix(relativePath) {
11176
11180
  return relativePath.split(PATH.sep).join("/");
11177
11181
  }
@@ -11262,14 +11266,14 @@ function applyGitignoredAll(params) {
11262
11266
  * 1. Hard safety on all configured patterns (throws on escape)
11263
11267
  * 2. Expand builtins + include (always-clean; bypass gitignored-only)
11264
11268
  * 3. Expand config patterns; enforce gitignored-only when enabled
11265
- * 4. Optionally add all gitignored paths under the package
11269
+ * 4. Optionally add all gitignored paths (`--full` / `--full-all` or rule)
11266
11270
  * 5. Apply exclude + re-check inside-root
11267
11271
  */
11268
11272
  function buildCleanPlan(options) {
11269
- const { config, extraPatterns = [], gitignore = gitCleanGitignoreBackend, packageDir, rootDir } = options;
11273
+ const { config, extraPatterns = [], fullMode = "none", gitignore = gitCleanGitignoreBackend, packageDir, rootDir } = options;
11270
11274
  const rules = resolveCleanRules(config);
11271
11275
  const issues = [];
11272
- const exclude = resolveCleanExclude(config);
11276
+ const exclude = resolveCleanExclude(config, excludeModeForFull(fullMode));
11273
11277
  const configuredPatterns = [...resolveCleanPatterns(config), ...extraPatterns];
11274
11278
  const safeBuiltin = resolveSafeCleanPatterns([...BUILTIN_CLEAN_PATTERNS], packageDir, rootDir);
11275
11279
  const safeInclude = resolveSafeCleanPatterns(resolveCleanInclude(config), packageDir, rootDir);
@@ -11289,12 +11293,13 @@ function buildCleanPlan(options) {
11289
11293
  targets
11290
11294
  });
11291
11295
  } else for (const absPath of patternCandidates) targets.add(absPath);
11292
- if (isCleanRuleEnabled(rules.gitignoredAll)) applyGitignoredAll({
11296
+ const forceGitignoredAll = fullMode === "full" || fullMode === "full-all";
11297
+ if (forceGitignoredAll || isCleanRuleEnabled(rules.gitignoredAll)) applyGitignoredAll({
11293
11298
  gitignore,
11294
11299
  issues,
11295
11300
  packageDir,
11296
11301
  rootDir,
11297
- ruleLevel: rules.gitignoredAll,
11302
+ ruleLevel: forceGitignoredAll ? "error" : rules.gitignoredAll,
11298
11303
  targets
11299
11304
  });
11300
11305
  return {
@@ -11331,6 +11336,7 @@ const packageCleanOutputs = async (options = {}) => {
11331
11336
  const baseConfig = options.skipConfigLoad ? { patterns: options.extraPatterns } : await loadCleanConfig(pkg);
11332
11337
  const plan = buildCleanPlan({
11333
11338
  config: options.skipConfigLoad ? baseConfig : mergeExtraPatterns(baseConfig, options.extraPatterns),
11339
+ fullMode: options.fullMode ?? "none",
11334
11340
  gitignore: options.gitignore,
11335
11341
  packageDir: pkg,
11336
11342
  rootDir