depcurfew 1.4.0 → 1.4.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/README.md CHANGED
@@ -617,7 +617,7 @@ jobs:
617
617
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
618
618
  with:
619
619
  persist-credentials: false
620
- - uses: DevXord/depcurfew@acb23f6f7e85ffce7190593a7fc98cfb73231549 # v1.3.0
620
+ - uses: DevXord/depcurfew@20fcc21389f308180a2f9a3a404a486f08705c15 # v1.4.0
621
621
  ```
622
622
  <!-- END GENERATED: action-workflow -->
623
623
 
package/dist/cli.js CHANGED
@@ -38,7 +38,7 @@ function dropKnownWarnings() {
38
38
  });
39
39
  }
40
40
  dropKnownWarnings();
41
- import("./run-NcyQxpTd.js").then((n) => n.n).then(({ run }) => run(process.argv.slice(2), {
41
+ import("./run-CjAxgfPK.js").then((n) => n.n).then(({ run }) => run(process.argv.slice(2), {
42
42
  stdout: quietWhenClosed(process.stdout),
43
43
  stderr: quietWhenClosed(process.stderr),
44
44
  colors: {
package/dist/index.d.ts CHANGED
@@ -2292,6 +2292,10 @@ interface DetectOptions {
2292
2292
  /** The directories listed in projects in depcurfew.json, relative to the root (decision D-137). */
2293
2293
  projects?: readonly string[];
2294
2294
  }
2295
+ /**
2296
+ * Describes the repository at `root`. Never executes anything from the repository and never leaves it;
2297
+ * problems with individual files become warnings.
2298
+ */
2295
2299
  export declare function detectProject(root: string, tools?: readonly ToolKnowledge[], environment?: EnvironmentKnowledge, options?: DetectOptions): Detection;
2296
2300
  /** Every doctor rule, in the order they are documented. unreadable-config runs last, after every other rule has read its files. */
2297
2301
  export declare const RULES: readonly Rule[];
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { A as toDurationString, C as warningText, D as validatePolicy, E as parsePolicy, F as SCHEMA_URL, I as renderPolicy, L as detectProject, M as parseDuration, N as DEFAULT_POLICY, O as convertCooldown, P as POLICY_FILE, R as getVersion, S as APPLY_WARNINGS, T as formatIssue, _ as botDuration, a as toSarif, b as planRepository, c as renderText, d as scanCommandLine, f as checkSpec, g as applyProject, h as PolicyError, i as runDoctor, j as formatDuration, k as convertMinutes, l as PopularNames, m as ApplyWriteError, o as RULES, p as checkSpecs, r as runDoctorWithOsv, s as countLevels, t as run, u as queryOsv, v as loadPolicy, w as unifiedDiff, x as APPLY_ERRORS, y as planApply } from "./run-NcyQxpTd.js";
1
+ import { A as toDurationString, C as warningText, D as validatePolicy, E as parsePolicy, F as SCHEMA_URL, I as renderPolicy, L as detectProject, M as parseDuration, N as DEFAULT_POLICY, O as convertCooldown, P as POLICY_FILE, R as getVersion, S as APPLY_WARNINGS, T as formatIssue, _ as botDuration, a as toSarif, b as planRepository, c as renderText, d as scanCommandLine, f as checkSpec, g as applyProject, h as PolicyError, i as runDoctor, j as formatDuration, k as convertMinutes, l as PopularNames, m as ApplyWriteError, o as RULES, p as checkSpecs, r as runDoctorWithOsv, s as countLevels, t as run, u as queryOsv, v as loadPolicy, w as unifiedDiff, x as APPLY_ERRORS, y as planApply } from "./run-CjAxgfPK.js";
2
2
  import { n as EXIT_OK, r as EXIT_USAGE, t as EXIT_FAILURE } from "./io-eBMDYKV0.js";
3
3
  export { APPLY_ERRORS, APPLY_WARNINGS, ApplyWriteError, DEFAULT_POLICY, EXIT_FAILURE, EXIT_OK, EXIT_USAGE, POLICY_FILE, PolicyError, PopularNames, RULES, SCHEMA_URL, applyProject, botDuration, checkSpec, checkSpecs, convertCooldown, convertMinutes, countLevels, detectProject, formatDuration, formatIssue, getVersion, loadPolicy, parseDuration, parsePolicy, planApply, planRepository, queryOsv, renderPolicy, renderText, run, runDoctor, runDoctorWithOsv, scanCommandLine, toDurationString, toSarif, unifiedDiff, validatePolicy, warningText };
@@ -7138,7 +7138,7 @@ const uv$2 = {
7138
7138
  environmentNames: release14$1.verified([{
7139
7139
  prefix: "",
7140
7140
  match: "exact"
7141
- }], CLI, "The options take their variables through clap (env = EnvVars::UV_PROJECT and the others), and clap_builder Arg::env reads the variable with env::var_os(name) (https://github.com/clap-rs/clap/blob/v4.5.40/clap_builder/src/builder/arg.rs), which outside Windows finds only that spelling, so uv_project sets nothing (decision D-143)."),
7141
+ }], CLI, "The options take their variables through clap (env = EnvVars::UV_PROJECT and the others), and clap_builder Arg::env reads the variable with env::var_os(name) (https://github.com/clap-rs/clap/blob/v4.6.7/clap_builder/src/builder/arg.rs, the clap_builder version in the Cargo.lock of uv), which outside Windows finds only that spelling, so uv_project sets nothing (decision D-143)."),
7142
7142
  registrySettings: release13.verified([
7143
7143
  {
7144
7144
  file: "pyproject.toml",
@@ -12276,10 +12276,6 @@ function configFiles(repository, manager, directories, project) {
12276
12276
  return directories.flatMap((directory) => [...manager.configFiles.map((file) => joinPath(directory, file)).filter((file) => repository.isFile(file)), ...table !== void 0 && tomlAt(readToml(repository, joinPath(directory, project)), table) !== void 0 ? [joinPath(directory, project)] : []]).sort(byPath);
12277
12277
  }
12278
12278
  /**
12279
- * Describes the repository at `root`. Never executes anything from the repository and never leaves it;
12280
- * problems with individual files become warnings.
12281
- */
12282
- /**
12283
12279
  * What the project .npmrc of the repository says about optional dependencies (omit, include and optional, as npm
12284
12280
  * reads them: the last line of a key wins, key[] lines add to the list), for the npm installs of CI jobs and
12285
12281
  * Dockerfiles, whose command line and variables override it key by key (decision D-143). The installs are read with
@@ -12326,6 +12322,10 @@ function withProjectOptional(facts, repository) {
12326
12322
  }
12327
12323
  };
12328
12324
  }
12325
+ /**
12326
+ * Describes the repository at `root`. Never executes anything from the repository and never leaves it;
12327
+ * problems with individual files become warnings.
12328
+ */
12329
12329
  function detectProject(root, tools = knowledgeBase, environment$2 = environment, options = {}) {
12330
12330
  const repository = new Repository(root);
12331
12331
  const facts = withProjectOptional(detectionFacts(tools, environment$2), repository);
@@ -32696,7 +32696,29 @@ function wordSets(text, command, shell) {
32696
32696
  for (const match of text.matchAll(/\$\{([A-Za-z_][A-Za-z0-9_]*)(?:\[[^\][]*\])?:?=/gu)) noteSet(match[1], command, shell);
32697
32697
  if (![...text.matchAll(IDENTIFIERS)].some((match) => variableKey(match[0], shell) !== void 0)) return;
32698
32698
  for (const match of text.matchAll(/\[([^\][]*)\]/gu)) arithmeticSets(match[1], command, shell);
32699
- for (const match of text.matchAll(/\$\{[A-Za-z_][A-Za-z0-9_]*(?:\[[^\][]*\])?:(?![-=+?])([^}]{0,4096})\}/gu)) arithmeticSets(match[1], command, shell);
32699
+ offsetSets(text, command, shell);
32700
+ }
32701
+ /** The start of ${NAME:offset} or ${NAME[i]:offset}, not ${NAME:-…}, ${NAME:=…}, ${NAME:+…} or ${NAME:?…}. */
32702
+ const OFFSET_START = /\$\{[A-Za-z_][A-Za-z0-9_]*(?:\[[^\][]*\])?:(?![-=+?])/gu;
32703
+ /** The longest body of an offset whose arithmetic is read. */
32704
+ const MAX_OFFSET = 4096;
32705
+ /**
32706
+ * The arithmetic of the offsets of ${s:offset:length}: a body runs from its start to the first } after it, up to
32707
+ * MAX_OFFSET characters. Starts before the same } share it, so the body of the first of them that is short enough
32708
+ * holds the others, and it is read once: one pass, so a word of many starts without a } is read in linear time instead
32709
+ * of scanning up to MAX_OFFSET characters from each start (decision D-146).
32710
+ */
32711
+ function offsetSets(text, command, shell) {
32712
+ let close = -1;
32713
+ let read = -1;
32714
+ for (const match of text.matchAll(OFFSET_START)) {
32715
+ const body = match.index + match[0].length;
32716
+ if (close < body) close = text.indexOf("}", body);
32717
+ if (close === -1) return;
32718
+ if (close === read || close - body > MAX_OFFSET) continue;
32719
+ arithmeticSets(text.slice(body, close), command, shell);
32720
+ read = close;
32721
+ }
32700
32722
  }
32701
32723
  /**
32702
32724
  * An assignment word (NAME=…, NAME+=…, NAME[…]=…): the name when its value is not read as written, and the names in a
@@ -49077,13 +49099,26 @@ function pinsOf(scope) {
49077
49099
  /** The installs a command list makes with the pinned tool. */
49078
49100
  const installsWith = (tool) => (command) => command.kind === "install" && command.tool === tool;
49079
49101
  /**
49102
+ * The one release an install spec names, read as manager-version-too-old reads npm install -g npm@<spec>: 11.19.1,
49103
+ * v11.19.1, =11.19.1 and 11.19.1+sha512... all name 11.19.1 (decision D-146); a range, a tag or a variable names none.
49104
+ */
49105
+ function exactRelease(spec) {
49106
+ const exact = parseVersion$1(spec);
49107
+ if (exact !== void 0) return exact;
49108
+ const lowest = lowestVersion(spec);
49109
+ return lowest.kind === "exact" && lowest.prerelease === void 0 ? lowest.version : void 0;
49110
+ }
49111
+ /**
49080
49112
  * The tool installing a release of itself before the install (npm install -g npm@11.19.1, decision D-144): the pinned
49081
- * release then runs there without Corepack, so nothing is reported; another release runs instead of the pin.
49113
+ * release then runs there without Corepack, so nothing is reported; another release runs instead of the pin. The spec
49114
+ * and the pin are compared as releases, not as text (decision D-146).
49082
49115
  */
49083
49116
  function ownRelease(before, pin) {
49084
49117
  const own = before.filter((command) => command.kind === "upgrade" && command.tool === pin.tool && command.version !== void 0).at(-1);
49085
49118
  if (own === void 0) return {};
49086
- return own.version === pin.version ? void 0 : { other: own };
49119
+ const installed = exactRelease(own.version ?? "");
49120
+ const pinned = parseVersion$1(pin.version);
49121
+ return installed !== void 0 && pinned !== void 0 && compareVersions$3(installed, pinned) === 0 ? void 0 : { other: own };
49087
49122
  }
49088
49123
  /** The stage a Dockerfile declaration belongs to, by its name or its number from 0. */
49089
49124
  function stageOf(file, declaration) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "depcurfew",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "One supply-chain security policy for npm, pnpm, Yarn, Bun, Deno, uv, pip, Poetry, PDM, Pipenv, Composer, Renovate and Dependabot, plus a doctor that finds config that silently does nothing.",
5
5
  "license": "MIT",
6
6
  "author": "depcurfew",