@stll/oxlint-config 1.4.0 → 1.5.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 (69) hide show
  1. package/README.md +90 -14
  2. package/dist/cloud-setup-cli.cjs +3 -3
  3. package/dist/cloud-setup-cli.mjs +3 -3
  4. package/dist/consumer-compat-cli.cjs +2 -2
  5. package/dist/consumer-compat-cli.mjs +2 -2
  6. package/dist/dependabot-cli.cjs +34 -10
  7. package/dist/dependabot-cli.cjs.map +1 -1
  8. package/dist/dependabot-cli.mjs +35 -11
  9. package/dist/dependabot-cli.mjs.map +1 -1
  10. package/dist/dependabot.cjs +2 -0
  11. package/dist/dependabot.d.cts +12 -2
  12. package/dist/dependabot.d.mts +12 -2
  13. package/dist/dependabot.mjs +2 -2
  14. package/dist/generated-file.cjs +2 -2
  15. package/dist/generated-file.mjs +2 -2
  16. package/dist/git-tracked-output.cjs +2 -2
  17. package/dist/git-tracked-output.mjs +1 -1
  18. package/dist/jsonc.cjs +66 -0
  19. package/dist/jsonc.cjs.map +1 -0
  20. package/dist/jsonc.mjs +61 -0
  21. package/dist/jsonc.mjs.map +1 -0
  22. package/dist/publish-artifact-syntax.cjs +2 -2
  23. package/dist/publish-artifact-syntax.mjs +2 -2
  24. package/dist/publish-build-target-vite-dts-helper2.cjs +1 -1
  25. package/dist/publish-build-target-vite-dts-helper2.mjs +1 -1
  26. package/dist/publish-contract-cli.cjs +2 -2
  27. package/dist/publish-contract-cli.mjs +1 -1
  28. package/dist/quarantine-cli.cjs +66 -0
  29. package/dist/quarantine-cli.cjs.map +1 -0
  30. package/dist/quarantine-cli.d.cts +1 -0
  31. package/dist/quarantine-cli.d.mts +1 -0
  32. package/dist/quarantine-cli.mjs +66 -0
  33. package/dist/quarantine-cli.mjs.map +1 -0
  34. package/dist/quarantine-policy.cjs +10 -0
  35. package/dist/quarantine-policy.d.cts +27 -0
  36. package/dist/quarantine-policy.d.mts +27 -0
  37. package/dist/quarantine-policy.mjs +1 -0
  38. package/dist/quarantine-policy2.cjs +399 -0
  39. package/dist/quarantine-policy2.cjs.map +1 -0
  40. package/dist/quarantine-policy2.mjs +352 -0
  41. package/dist/quarantine-policy2.mjs.map +1 -0
  42. package/dist/toolchain-changed.cjs +11 -66
  43. package/dist/toolchain-changed.cjs.map +1 -1
  44. package/dist/toolchain-changed.mjs +13 -68
  45. package/dist/toolchain-changed.mjs.map +1 -1
  46. package/dist/toolchain-check-cli.cjs +1 -0
  47. package/dist/toolchain-check-cli.cjs.map +1 -1
  48. package/dist/toolchain-check-cli.mjs +1 -0
  49. package/dist/toolchain-check-cli.mjs.map +1 -1
  50. package/dist/toolchain-dependabot.cjs +77 -3
  51. package/dist/toolchain-dependabot.cjs.map +1 -1
  52. package/dist/toolchain-dependabot.mjs +66 -4
  53. package/dist/toolchain-dependabot.mjs.map +1 -1
  54. package/dist/toolchain-guard.cjs +49 -10
  55. package/dist/toolchain-guard.cjs.map +1 -1
  56. package/dist/toolchain-guard.mjs +51 -12
  57. package/dist/toolchain-guard.mjs.map +1 -1
  58. package/dist/toolchain-inputs.cjs +104 -18
  59. package/dist/toolchain-inputs.cjs.map +1 -1
  60. package/dist/toolchain-inputs.mjs +106 -20
  61. package/dist/toolchain-inputs.mjs.map +1 -1
  62. package/dist/typecheck-parity.cjs +4 -3
  63. package/dist/typecheck-parity.cjs.map +1 -1
  64. package/dist/typecheck-parity.mjs +4 -3
  65. package/dist/typecheck-parity.mjs.map +1 -1
  66. package/dist/typecheck-probe-cli.cjs +2 -2
  67. package/dist/typecheck-probe-cli.mjs +2 -2
  68. package/package.json +13 -1
  69. package/toolchain.json +11 -4
@@ -1,19 +1,20 @@
1
+ import { t as checkRepositoryQuarantine } from "./quarantine-policy2.mjs";
1
2
  import { E as parseCloudSetup, S as generateCloudSetup, T as nodeSupportRangeMatches, _ as cloudSessionStartFix, a as isMiseConfigPath, d as containerDocumentImages, f as isComposeDefinitionPath, g as cloudClaudeSettingsPath, h as cloudAttributionFix, i as isDockerDefinitionPath, m as workspaceContains, n as githubAutomationFileKind, p as isKubernetesDefinitionPath, s as isShellScript, u as toolchainInputKind, v as hasCloudAttribution, w as nodeSelectorMatches, x as cloudSetupPath, y as hasCloudSessionStartHook } from "./toolchain-inputs.mjs";
2
3
  import { t as readGitTrackedOutput } from "./git-tracked-output.mjs";
3
4
  import { a as assertConsumerFixtureSelection, g as parseConsumerFixtures, h as discoverConsumerPackages, m as discoverConsumerManifests, r as assertConsumerFixtureKind, t as assertConsumerNodeSupport, u as consumerPackageClosure } from "./consumer-node-support.mjs";
4
- import { a as rustImageVersion, i as canonicalDockerRuntime, n as dependabotRules, t as checkDependabot } from "./toolchain-dependabot.mjs";
5
+ import { n as dependabotRules, o as canonicalDockerRuntime, s as rustImageVersion, t as checkDependabot } from "./toolchain-dependabot.mjs";
5
6
  import "./toolchain-schema.mjs";
6
7
  import { createRequire } from "node:module";
8
+ import path, { extname } from "node:path";
7
9
  import { closeSync, lstatSync, openSync, readFileSync, readSync, realpathSync } from "node:fs";
10
+ import { parse } from "smol-toml";
8
11
  import { execFileSync, spawnSync } from "node:child_process";
9
- import path, { extname } from "node:path";
10
12
  import { minVersion, satisfies, valid, validRange } from "semver";
11
- import { parse as parse$1 } from "smol-toml";
12
13
  import { LineCounter, isAlias, isMap, isNode, isScalar, isSeq, parseAllDocuments, parseDocument } from "yaml";
13
14
  import picomatch from "picomatch";
14
15
  //#endregion
15
16
  //#region src/toolchain-consumer-checks.ts
16
- const consumerRunnerVersion = "1.4.0";
17
+ const consumerRunnerVersion = "1.5.0";
17
18
  const consumerCheckWorkflow = "stella/.github/.github/workflows/package-consumer-compat.yml";
18
19
  const record$10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19
20
  const repositoryDirectory = (value) => typeof value === "string" && value !== "" && !value.includes("\\") && !value.includes("${{") && !value.split("").some((character) => {
@@ -2748,7 +2749,7 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2748
2749
  };
2749
2750
  const toml = (rule) => {
2750
2751
  try {
2751
- return parse$1(text);
2752
+ return parse(text);
2752
2753
  } catch {
2753
2754
  add({
2754
2755
  rule,
@@ -2830,7 +2831,7 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2830
2831
  if (candidate === file) return parsed;
2831
2832
  if (!trackedFiles.has(candidate)) return void 0;
2832
2833
  try {
2833
- return parse$1(readFile(candidate) ?? "");
2834
+ return parse(readFile(candidate) ?? "");
2834
2835
  } catch {
2835
2836
  return;
2836
2837
  }
@@ -3883,7 +3884,8 @@ const toolchainRules = [.../* @__PURE__ */ new Set([
3883
3884
  ...runtimeRules,
3884
3885
  ...dependabotRules,
3885
3886
  nodeProjectRule,
3886
- "cloud-setup-drift"
3887
+ "cloud-setup-drift",
3888
+ "quarantine-policy"
3887
3889
  ])];
3888
3890
  const record = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
3889
3891
  const array = (value) => Array.isArray(value);
@@ -3895,6 +3897,7 @@ const parseToolchainConfiguration = (input) => {
3895
3897
  if (!array(optOuts)) throw new Error("optOuts must be an array");
3896
3898
  for (const entry of optOuts) {
3897
3899
  if (!record(entry) || Object.keys(entry).some((key) => key !== "rule" && key !== "reason") || typeof entry["rule"] !== "string" || !toolchainRules.some((rule) => rule === entry["rule"]) || typeof entry["reason"] !== "string" || entry["reason"].trim() === "" || disabled.has(entry["rule"])) throw new Error("each opt-out requires a unique known rule and a nonempty reason");
3900
+ if (entry["rule"] === "quarantine-policy") throw new Error("quarantine-policy cannot be opted out; temporary third-party exclusions require expiry");
3898
3901
  if (entry["rule"] === "rust-version") throw new Error("rust-version requires expiring exact-pin rustExceptions, not an opt-out");
3899
3902
  if (entry["rule"] === "node-engine") throw new Error("node-engine cannot be opted out; engines.node must support the shared Node series");
3900
3903
  if (entry["rule"] === "workflow-trust") throw new Error("workflow-trust cannot be opted out; repository commands must follow the declared trust decision");
@@ -3911,8 +3914,8 @@ const parseToolchainConfiguration = (input) => {
3911
3914
  consumerChecks: parseConsumerChecks(input["consumerChecks"])
3912
3915
  };
3913
3916
  };
3914
- /** Read one tracked configuration snapshot for guards and policy generation. */
3915
- const readToolchainInputs = (root) => {
3917
+ /** Dependency graphs stay opaque unless a caller explicitly needs registry identities. */
3918
+ const readToolchainInputs = (root, { bunLock = "presence" } = {}) => {
3916
3919
  const diagnostics = [];
3917
3920
  const tracked = readGitTrackedOutput(root, "staged").split("\0").filter((entry) => entry !== "" && !entry.startsWith("160000 ")).map((entry) => entry.slice(entry.indexOf(" ") + 1));
3918
3921
  const files = {};
@@ -3924,7 +3927,7 @@ const readToolchainInputs = (root) => {
3924
3927
  if (kind === void 0 && !shebangCandidate) continue;
3925
3928
  try {
3926
3929
  const inputPath = path.join(resolvedRoot, file);
3927
- if (kind === "presence") {
3930
+ if (kind === "presence" && !(file === "bun.lock" && bunLock === "content")) {
3928
3931
  lstatSync(inputPath);
3929
3932
  files[file] = "";
3930
3933
  continue;
@@ -3966,8 +3969,8 @@ const readToolchainInputs = (root) => {
3966
3969
  diagnostics
3967
3970
  };
3968
3971
  };
3969
- const checkToolchain = ({ root, policy, onDelegated }) => {
3970
- const { files, trackedFiles, diagnostics } = readToolchainInputs(root);
3972
+ const checkToolchain = ({ root, policy, onDelegated, onWarning, now }) => {
3973
+ const { files, trackedFiles, diagnostics } = readToolchainInputs(root, { bunLock: "content" });
3971
3974
  let repository;
3972
3975
  try {
3973
3976
  const origin = execFileSync("git", [
@@ -4057,6 +4060,42 @@ const checkToolchain = ({ root, policy, onDelegated }) => {
4057
4060
  files,
4058
4061
  policy
4059
4062
  }));
4063
+ if (Object.entries(files).some(([file, text]) => {
4064
+ if (path.posix.basename(file) === "bun.lock") return true;
4065
+ if (path.posix.basename(file) !== "package.json") return false;
4066
+ try {
4067
+ const manifest = JSON.parse(text);
4068
+ return record(manifest) && typeof manifest["packageManager"] === "string" && /^bun(?:@|$)/u.test(manifest["packageManager"]);
4069
+ } catch {
4070
+ return false;
4071
+ }
4072
+ }) || files["bunfig.toml"] !== void 0) try {
4073
+ if (files["bunfig.toml"] === void 0) throw new Error("Bun repositories require a tracked root bunfig.toml with the five-day quarantine policy; use the documented pinned bunx stll-quarantine --sync bootstrap, then commit bunfig.toml");
4074
+ const result = checkRepositoryQuarantine({
4075
+ files,
4076
+ now,
4077
+ npmrcPresent: trackedFiles.has(".npmrc")
4078
+ });
4079
+ for (const message of result.errors) diagnostics.push({
4080
+ rule: "quarantine-policy",
4081
+ path: "bunfig.toml",
4082
+ line: 1,
4083
+ message
4084
+ });
4085
+ for (const message of result.warnings) onWarning?.({
4086
+ rule: "quarantine-policy",
4087
+ path: "bunfig.toml",
4088
+ line: 1,
4089
+ message
4090
+ });
4091
+ } catch (error) {
4092
+ diagnostics.push({
4093
+ rule: "quarantine-policy",
4094
+ path: "bunfig.toml",
4095
+ line: 1,
4096
+ message: error instanceof Error ? error.message : String(error)
4097
+ });
4098
+ }
4060
4099
  if (files["package.json"] !== void 0) {
4061
4100
  let manifest;
4062
4101
  try {