@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.
- package/README.md +90 -14
- package/dist/cloud-setup-cli.cjs +3 -3
- package/dist/cloud-setup-cli.mjs +3 -3
- package/dist/consumer-compat-cli.cjs +2 -2
- package/dist/consumer-compat-cli.mjs +2 -2
- package/dist/dependabot-cli.cjs +34 -10
- package/dist/dependabot-cli.cjs.map +1 -1
- package/dist/dependabot-cli.mjs +35 -11
- package/dist/dependabot-cli.mjs.map +1 -1
- package/dist/dependabot.cjs +2 -0
- package/dist/dependabot.d.cts +12 -2
- package/dist/dependabot.d.mts +12 -2
- package/dist/dependabot.mjs +2 -2
- package/dist/generated-file.cjs +2 -2
- package/dist/generated-file.mjs +2 -2
- package/dist/git-tracked-output.cjs +2 -2
- package/dist/git-tracked-output.mjs +1 -1
- package/dist/jsonc.cjs +66 -0
- package/dist/jsonc.cjs.map +1 -0
- package/dist/jsonc.mjs +61 -0
- package/dist/jsonc.mjs.map +1 -0
- package/dist/publish-artifact-syntax.cjs +2 -2
- package/dist/publish-artifact-syntax.mjs +2 -2
- package/dist/publish-build-target-vite-dts-helper2.cjs +1 -1
- package/dist/publish-build-target-vite-dts-helper2.mjs +1 -1
- package/dist/publish-contract-cli.cjs +2 -2
- package/dist/publish-contract-cli.mjs +1 -1
- package/dist/quarantine-cli.cjs +66 -0
- package/dist/quarantine-cli.cjs.map +1 -0
- package/dist/quarantine-cli.d.cts +1 -0
- package/dist/quarantine-cli.d.mts +1 -0
- package/dist/quarantine-cli.mjs +66 -0
- package/dist/quarantine-cli.mjs.map +1 -0
- package/dist/quarantine-policy.cjs +10 -0
- package/dist/quarantine-policy.d.cts +27 -0
- package/dist/quarantine-policy.d.mts +27 -0
- package/dist/quarantine-policy.mjs +1 -0
- package/dist/quarantine-policy2.cjs +399 -0
- package/dist/quarantine-policy2.cjs.map +1 -0
- package/dist/quarantine-policy2.mjs +352 -0
- package/dist/quarantine-policy2.mjs.map +1 -0
- package/dist/toolchain-changed.cjs +11 -66
- package/dist/toolchain-changed.cjs.map +1 -1
- package/dist/toolchain-changed.mjs +13 -68
- package/dist/toolchain-changed.mjs.map +1 -1
- package/dist/toolchain-check-cli.cjs +1 -0
- package/dist/toolchain-check-cli.cjs.map +1 -1
- package/dist/toolchain-check-cli.mjs +1 -0
- package/dist/toolchain-check-cli.mjs.map +1 -1
- package/dist/toolchain-dependabot.cjs +77 -3
- package/dist/toolchain-dependabot.cjs.map +1 -1
- package/dist/toolchain-dependabot.mjs +66 -4
- package/dist/toolchain-dependabot.mjs.map +1 -1
- package/dist/toolchain-guard.cjs +49 -10
- package/dist/toolchain-guard.cjs.map +1 -1
- package/dist/toolchain-guard.mjs +51 -12
- package/dist/toolchain-guard.mjs.map +1 -1
- package/dist/toolchain-inputs.cjs +104 -18
- package/dist/toolchain-inputs.cjs.map +1 -1
- package/dist/toolchain-inputs.mjs +106 -20
- package/dist/toolchain-inputs.mjs.map +1 -1
- package/dist/typecheck-parity.cjs +4 -3
- package/dist/typecheck-parity.cjs.map +1 -1
- package/dist/typecheck-parity.mjs +4 -3
- package/dist/typecheck-parity.mjs.map +1 -1
- package/dist/typecheck-probe-cli.cjs +2 -2
- package/dist/typecheck-probe-cli.mjs +2 -2
- package/package.json +13 -1
- package/toolchain.json +11 -4
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { t as parseJsonc } from "./jsonc.mjs";
|
|
1
2
|
import { a as isMiseConfigPath, d as containerDocumentImages, f as isComposeDefinitionPath, i as isDockerDefinitionPath, m as workspaceContains, n as githubAutomationFileKind, p as isKubernetesDefinitionPath } from "./toolchain-inputs.mjs";
|
|
2
3
|
import { n as isCompilerPackage } from "./compiler-packages.mjs";
|
|
3
|
-
import { execFile, spawn } from "node:child_process";
|
|
4
4
|
import path from "node:path";
|
|
5
|
+
import { parse } from "smol-toml";
|
|
6
|
+
import { execFile, spawn } from "node:child_process";
|
|
5
7
|
import { satisfies, valid, validRange } from "semver";
|
|
6
|
-
import { parse as parse$1 } from "smol-toml";
|
|
7
8
|
import { promisify } from "node:util";
|
|
8
9
|
import { parseAllDocuments, parseDocument } from "yaml";
|
|
9
10
|
//#region src/toolchain-changed-locks.ts
|
|
@@ -56,62 +57,6 @@ const changedCompilerPatches = ({ value, stringsArePaths, compilerNames }) => {
|
|
|
56
57
|
}
|
|
57
58
|
return patches;
|
|
58
59
|
};
|
|
59
|
-
/** JSONC permits comments and trailing commas, never alterations inside strings. */
|
|
60
|
-
const parseChangedJson = (text) => {
|
|
61
|
-
let clean = "";
|
|
62
|
-
let quote = false;
|
|
63
|
-
for (let index = 0; index < text.length; index++) {
|
|
64
|
-
const char = text[index];
|
|
65
|
-
if (quote) {
|
|
66
|
-
clean += char;
|
|
67
|
-
if (char === "\\") {
|
|
68
|
-
index++;
|
|
69
|
-
clean += text[index] ?? "";
|
|
70
|
-
} else if (char === "\"") quote = false;
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
if (char === "\"") {
|
|
74
|
-
quote = true;
|
|
75
|
-
clean += char;
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
if (char === "/" && text[index + 1] === "/") {
|
|
79
|
-
while (index < text.length && text[index] !== "\n") index++;
|
|
80
|
-
clean += "\n";
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
if (char === "/" && text[index + 1] === "*") {
|
|
84
|
-
index += 2;
|
|
85
|
-
while (index < text.length && !(text[index] === "*" && text[index + 1] === "/")) index++;
|
|
86
|
-
if (index >= text.length) throw new Error("Unterminated JSONC comment");
|
|
87
|
-
index++;
|
|
88
|
-
clean += " ";
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
clean += char;
|
|
92
|
-
}
|
|
93
|
-
let result = "";
|
|
94
|
-
quote = false;
|
|
95
|
-
for (let index = 0; index < clean.length; index++) {
|
|
96
|
-
const char = clean[index];
|
|
97
|
-
if (quote) {
|
|
98
|
-
result += char;
|
|
99
|
-
if (char === "\\") {
|
|
100
|
-
index++;
|
|
101
|
-
result += clean[index] ?? "";
|
|
102
|
-
} else if (char === "\"") quote = false;
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
if (char === "\"") quote = true;
|
|
106
|
-
if (char === ",") {
|
|
107
|
-
let next = index + 1;
|
|
108
|
-
while (/\s/.test(clean[next] ?? "") && next < clean.length) next++;
|
|
109
|
-
if (clean[next] === "}" || clean[next] === "]") continue;
|
|
110
|
-
}
|
|
111
|
-
result += char;
|
|
112
|
-
}
|
|
113
|
-
return JSON.parse(result);
|
|
114
|
-
};
|
|
115
60
|
const changedYarnSelectors = (location) => location.replace(/"/g, "").split(/,\s*/).map((selector) => selector.trim());
|
|
116
61
|
const packageDescriptor = (descriptor) => {
|
|
117
62
|
const match = /^(@[^/]+\/[^@]+|[^@]+)@(.+)$/.exec(descriptor.replace(/^\//, ""));
|
|
@@ -285,7 +230,7 @@ const parseChangedLock = ({ file, text }) => {
|
|
|
285
230
|
const resolutions = [];
|
|
286
231
|
const importers = {};
|
|
287
232
|
if (file.endsWith("bun.lock")) {
|
|
288
|
-
const parsed =
|
|
233
|
+
const parsed = parseJsonc(text);
|
|
289
234
|
if (!changedRecord(parsed) || !BUN_TEXT_LOCKFILE_VERSIONS.has(Number(parsed["lockfileVersion"])) || !changedRecord(parsed["packages"]) || !changedRecord(parsed["workspaces"])) throw new Error("Unsupported Bun lockfile shape");
|
|
290
235
|
for (const [directory, workspace] of Object.entries(parsed["workspaces"])) importers[directory || "."] = importerDependencies(workspace);
|
|
291
236
|
for (const [location, value] of Object.entries(parsed["packages"])) {
|
|
@@ -383,7 +328,7 @@ const parseChangedLock = ({ file, text }) => {
|
|
|
383
328
|
}
|
|
384
329
|
}
|
|
385
330
|
} else {
|
|
386
|
-
const parsed =
|
|
331
|
+
const parsed = parseJsonc(text);
|
|
387
332
|
if (!changedRecord(parsed) || ![
|
|
388
333
|
1,
|
|
389
334
|
2,
|
|
@@ -709,7 +654,7 @@ const compilerInstallationNames = (snapshot) => {
|
|
|
709
654
|
for (const file of snapshot.entries.keys()) {
|
|
710
655
|
const basename = path.posix.basename(file);
|
|
711
656
|
if (basename === "package.json") {
|
|
712
|
-
const manifest =
|
|
657
|
+
const manifest = parseJsonc(snapshotText({
|
|
713
658
|
snapshot,
|
|
714
659
|
file
|
|
715
660
|
}));
|
|
@@ -769,7 +714,7 @@ const effectiveCatalogSpecifier = ({ snapshot, file, dependency, specifier }) =>
|
|
|
769
714
|
const document = parseDocument(text);
|
|
770
715
|
if (document.errors.length > 0) throw new Error(`Invalid catalog YAML: ${owner}`);
|
|
771
716
|
value = document.toJS({ maxAliasCount: 100 });
|
|
772
|
-
} else value =
|
|
717
|
+
} else value = parseJsonc(text);
|
|
773
718
|
if (!changedRecord(value)) continue;
|
|
774
719
|
const sources = [value];
|
|
775
720
|
if (changedRecord(value["workspaces"])) sources.push(value["workspaces"]);
|
|
@@ -806,7 +751,7 @@ const compilerPatches = (snapshot) => {
|
|
|
806
751
|
const document = parseDocument(text);
|
|
807
752
|
if (document.errors.length > 0) throw new Error(`Invalid compiler patch YAML: ${file}`);
|
|
808
753
|
value = document.toJS({ maxAliasCount: 100 });
|
|
809
|
-
} else value =
|
|
754
|
+
} else value = parseJsonc(text);
|
|
810
755
|
const sources = [value];
|
|
811
756
|
if (name === "package.json" && changedRecord(value)) sources.push(value["pnpm"]);
|
|
812
757
|
for (const source of sources) for (const patch of changedCompilerPatches({
|
|
@@ -998,7 +943,7 @@ const setupRuntimeFileVersion = ({ snapshot, file, runtime }) => {
|
|
|
998
943
|
file
|
|
999
944
|
}).trim();
|
|
1000
945
|
if (runtime === "bun" && file.endsWith(".json")) {
|
|
1001
|
-
const manifest =
|
|
946
|
+
const manifest = parseJsonc(text);
|
|
1002
947
|
const manager = changedRecord(manifest) ? manifest["packageManager"] : void 0;
|
|
1003
948
|
if (typeof manager !== "string" || !manager.startsWith("bun@")) throw new Error("Bun selector manifest lacks an exact Bun packageManager");
|
|
1004
949
|
return stableVersion(manager.slice(4));
|
|
@@ -1016,7 +961,7 @@ const setupRuntimeFileVersion = ({ snapshot, file, runtime }) => {
|
|
|
1016
961
|
return stableVersion(toolchain.slice(2));
|
|
1017
962
|
}
|
|
1018
963
|
if (file.endsWith(".toml")) {
|
|
1019
|
-
const value = parse
|
|
964
|
+
const value = parse(text);
|
|
1020
965
|
if (!changedRecord(value)) throw new Error("Unclassifiable setup runtime TOML");
|
|
1021
966
|
if (runtime === "rust" && changedRecord(value["toolchain"])) return setupRuntimeVersion(value["toolchain"]["channel"]);
|
|
1022
967
|
if (runtime === "python") return setupRuntimeVersion(value["python-version"]);
|
|
@@ -1194,7 +1139,7 @@ const parseSnapshot = (snapshot) => {
|
|
|
1194
1139
|
if (compilerPatchPackageFile(file, compilerNames)) tools.typescript.add(`patch-package:${file}:${text}`);
|
|
1195
1140
|
for (const tool of selectedFiles.get(file) ?? []) tools[tool].add(`selector-file:${file}:${text}`);
|
|
1196
1141
|
if (name === "package.json") {
|
|
1197
|
-
const manifest =
|
|
1142
|
+
const manifest = parseJsonc(text);
|
|
1198
1143
|
if (!changedRecord(manifest)) throw new Error(`Invalid tracked manifest: ${file}`);
|
|
1199
1144
|
if (typeof manifest["name"] === "string" && changedPackageTool(manifest["name"]) === "typescript") throw new Error(`Tracked compiler source has no immutable artifact identity: ${file}`);
|
|
1200
1145
|
manifests.set(file, manifest);
|
|
@@ -1230,7 +1175,7 @@ const parseSnapshot = (snapshot) => {
|
|
|
1230
1175
|
else if (otherRuntimeFiles.has(name)) tools.shared.add(`${file}:${text}`);
|
|
1231
1176
|
else if (name === ".node-version" || name === ".nvmrc") tools.node.add(`${file}:${stableVersion(text)}`);
|
|
1232
1177
|
else if (name === "toolchain.json") {
|
|
1233
|
-
const policy =
|
|
1178
|
+
const policy = parseJsonc(text);
|
|
1234
1179
|
if (!changedRecord(policy)) throw new Error("Invalid shared toolchain policy");
|
|
1235
1180
|
tools.shared.add(`${file}:${stableJson(policy)}`);
|
|
1236
1181
|
if (typeof policy["bun"] === "string") addBun(policy["bun"]);
|
|
@@ -1246,7 +1191,7 @@ const parseSnapshot = (snapshot) => {
|
|
|
1246
1191
|
} else if (isMiseConfigPath(file)) {
|
|
1247
1192
|
tools.bun.add(`${file}:${text}`);
|
|
1248
1193
|
tools.typescript.add(`${file}:${text}`);
|
|
1249
|
-
const parsed = parse
|
|
1194
|
+
const parsed = parse(text);
|
|
1250
1195
|
if (changedRecord(parsed) && changedRecord(parsed["tools"])) for (const [tool, selector] of Object.entries(parsed["tools"])) {
|
|
1251
1196
|
const value = changedRecord(selector) ? selector["version"] : selector;
|
|
1252
1197
|
const values = Array.isArray(value) ? value : [value];
|