@stll/oxlint-config 1.3.0 → 1.4.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 +254 -17
- package/dist/cloud-setup-cli.cjs +18 -38
- package/dist/cloud-setup-cli.cjs.map +1 -1
- package/dist/cloud-setup-cli.mjs +21 -41
- package/dist/cloud-setup-cli.mjs.map +1 -1
- package/dist/consumer-compat-cli.cjs +50 -249
- package/dist/consumer-compat-cli.cjs.map +1 -1
- package/dist/consumer-compat-cli.mjs +6 -205
- package/dist/consumer-compat-cli.mjs.map +1 -1
- package/dist/consumer-node-support.cjs +497 -0
- package/dist/consumer-node-support.cjs.map +1 -0
- package/dist/consumer-node-support.mjs +381 -0
- package/dist/consumer-node-support.mjs.map +1 -0
- package/dist/dependabot-cli.cjs +67 -0
- package/dist/dependabot-cli.cjs.map +1 -0
- package/dist/dependabot-cli.d.cts +1 -0
- package/dist/dependabot-cli.d.mts +1 -0
- package/dist/dependabot-cli.mjs +67 -0
- package/dist/dependabot-cli.mjs.map +1 -0
- package/dist/dependabot.cjs +5 -0
- package/dist/dependabot.d.cts +108 -0
- package/dist/dependabot.d.mts +108 -0
- package/dist/dependabot.mjs +3 -0
- package/dist/generated-file.cjs +61 -0
- package/dist/generated-file.cjs.map +1 -0
- package/dist/generated-file.mjs +44 -0
- package/dist/generated-file.mjs.map +1 -0
- package/dist/publish-artifact-syntax.cjs +1309 -0
- package/dist/publish-artifact-syntax.cjs.map +1 -0
- package/dist/publish-artifact-syntax.mjs +1265 -0
- package/dist/publish-artifact-syntax.mjs.map +1 -0
- package/dist/publish-contract-cli.cjs +53 -12
- package/dist/publish-contract-cli.cjs.map +1 -1
- package/dist/publish-contract-cli.mjs +49 -8
- package/dist/publish-contract-cli.mjs.map +1 -1
- package/dist/toolchain-changed.cjs +5 -1
- package/dist/toolchain-changed.cjs.map +1 -1
- package/dist/toolchain-changed.mjs +6 -2
- package/dist/toolchain-changed.mjs.map +1 -1
- package/dist/toolchain-dependabot.cjs +455 -0
- package/dist/toolchain-dependabot.cjs.map +1 -0
- package/dist/toolchain-dependabot.mjs +423 -0
- package/dist/toolchain-dependabot.mjs.map +1 -0
- package/dist/toolchain-guard.cjs +1096 -424
- package/dist/toolchain-guard.cjs.map +1 -1
- package/dist/toolchain-guard.mjs +1085 -413
- package/dist/toolchain-guard.mjs.map +1 -1
- package/dist/toolchain-inputs.cjs +122 -22
- package/dist/toolchain-inputs.cjs.map +1 -1
- package/dist/toolchain-inputs.mjs +117 -23
- package/dist/toolchain-inputs.mjs.map +1 -1
- package/dist/toolchain-schema.cjs +0 -493
- package/dist/toolchain-schema.cjs.map +1 -1
- package/dist/toolchain-schema.mjs +3 -379
- package/dist/toolchain-schema.mjs.map +1 -1
- package/dist/typecheck-parity.cjs +1 -1
- package/dist/typecheck-probe-cli.cjs +1 -1
- package/dist/typecheck-probe-cli.cjs.map +1 -1
- package/dist/typecheck-probe-cli.mjs +1 -1
- package/dist/typecheck-probe-cli.mjs.map +1 -1
- package/package.json +13 -1
- package/dist/publish-contract.cjs +0 -431
- package/dist/publish-contract.cjs.map +0 -1
- package/dist/publish-contract.mjs +0 -396
- package/dist/publish-contract.mjs.map +0 -1
|
@@ -0,0 +1,455 @@
|
|
|
1
|
+
const require_rolldown_runtime = require("./rolldown-runtime.cjs");
|
|
2
|
+
const require_toolchain_inputs = require("./toolchain-inputs.cjs");
|
|
3
|
+
let node_path = require("node:path");
|
|
4
|
+
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
5
|
+
let smol_toml = require("smol-toml");
|
|
6
|
+
let yaml = require("yaml");
|
|
7
|
+
let picomatch = require("picomatch");
|
|
8
|
+
picomatch = require_rolldown_runtime.__toESM(picomatch, 1);
|
|
9
|
+
//#region src/toolchain-images.ts
|
|
10
|
+
/** Docker Hub spellings accepted by the shared runtime policy. */
|
|
11
|
+
const dockerHubRegistries = [
|
|
12
|
+
"docker.io",
|
|
13
|
+
"index.docker.io",
|
|
14
|
+
"registry-1.docker.io"
|
|
15
|
+
];
|
|
16
|
+
/** Expand the full accepted repository alias class without parsing Dockerfile instructions. */
|
|
17
|
+
const ownedDockerImageAliases = (images) => {
|
|
18
|
+
const aliases = /* @__PURE__ */ new Set();
|
|
19
|
+
for (const image of images) for (const repository of [image, `library/${image}`]) {
|
|
20
|
+
aliases.add(repository);
|
|
21
|
+
for (const registry of dockerHubRegistries) aliases.add(`${registry}/${repository}`);
|
|
22
|
+
}
|
|
23
|
+
return [...aliases].sort();
|
|
24
|
+
};
|
|
25
|
+
/** Preserve tag/digest spelling while normalizing registry and namespace aliases. */
|
|
26
|
+
const canonicalDockerRuntime = (image) => {
|
|
27
|
+
const registry = dockerHubRegistries.find((entry) => image.toLowerCase().startsWith(`${entry}/`));
|
|
28
|
+
return (registry === void 0 ? image : image.slice(registry.length + 1)).replace(/^library\//i, "");
|
|
29
|
+
};
|
|
30
|
+
/** Preserve Rust release identity across official Debian slim and Alpine variants. */
|
|
31
|
+
const rustImageVersion = (tag) => tag.replace(/-(?:alpine(?:\d+(?:\.\d+)*)?|(?:bookworm|bullseye|trixie|buster)(?:-slim)?|slim(?:-(?:bookworm|bullseye|trixie|buster))?)$/, "");
|
|
32
|
+
//#endregion
|
|
33
|
+
//#region src/toolchain-dependabot.ts
|
|
34
|
+
const dependabotRules = ["dependabot-policy"];
|
|
35
|
+
const record = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
36
|
+
const strings = (value) => Array.isArray(value) && value.every((entry) => typeof entry === "string");
|
|
37
|
+
const sameStrings = (value, expected) => {
|
|
38
|
+
if (!strings(value) || value.length !== expected.length) return false;
|
|
39
|
+
const sortedExpected = [...expected].sort();
|
|
40
|
+
return [...value].sort().every((entry, index) => entry === sortedExpected[index]);
|
|
41
|
+
};
|
|
42
|
+
const pinnedVersionUpdateTypes = [
|
|
43
|
+
"version-update:semver-major",
|
|
44
|
+
"version-update:semver-minor",
|
|
45
|
+
"version-update:semver-patch"
|
|
46
|
+
];
|
|
47
|
+
const versionOnlyIgnore = (entry) => record(entry) && Object.keys(entry).length === 2 && typeof entry["dependency-name"] === "string" && sameStrings(entry["update-types"], pinnedVersionUpdateTypes);
|
|
48
|
+
const directoryOf = (file) => {
|
|
49
|
+
const directory = node_path.default.posix.dirname(file);
|
|
50
|
+
return directory === "." ? "/" : `/${directory}`;
|
|
51
|
+
};
|
|
52
|
+
const workspaceManifests = {
|
|
53
|
+
npm: "package.json",
|
|
54
|
+
cargo: "Cargo.toml",
|
|
55
|
+
uv: "pyproject.toml"
|
|
56
|
+
};
|
|
57
|
+
const workspaceTable = (parsed, ecosystem) => {
|
|
58
|
+
switch (ecosystem) {
|
|
59
|
+
case "npm": return parsed["workspaces"];
|
|
60
|
+
case "cargo": return parsed["workspace"];
|
|
61
|
+
case "uv": {
|
|
62
|
+
const tool = parsed["tool"];
|
|
63
|
+
const uv = record(tool) ? tool["uv"] : void 0;
|
|
64
|
+
return record(uv) ? uv["workspace"] : void 0;
|
|
65
|
+
}
|
|
66
|
+
default: throw new Error("unknown workspace ecosystem", { cause: ecosystem });
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const declaresJavascriptInstallation = (text) => {
|
|
70
|
+
try {
|
|
71
|
+
const manifest = JSON.parse(text ?? "");
|
|
72
|
+
if (!record(manifest)) return false;
|
|
73
|
+
if (typeof manifest["packageManager"] === "string") return true;
|
|
74
|
+
return [
|
|
75
|
+
"dependencies",
|
|
76
|
+
"devDependencies",
|
|
77
|
+
"optionalDependencies",
|
|
78
|
+
"peerDependencies"
|
|
79
|
+
].some((field) => {
|
|
80
|
+
const dependencies = manifest[field];
|
|
81
|
+
return record(dependencies) && Object.keys(dependencies).length > 0;
|
|
82
|
+
});
|
|
83
|
+
} catch {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
/** Dependency-bearing projects and workspace members need coverage without requiring a lock. */
|
|
88
|
+
const workspaceRoots = (files, ecosystem) => {
|
|
89
|
+
const manifests = Object.keys(files).filter((file) => node_path.default.posix.basename(file) === workspaceManifests[ecosystem] || ecosystem === "npm" && node_path.default.posix.basename(file) === "pnpm-workspace.yaml");
|
|
90
|
+
const workspaces = /* @__PURE__ */ new Map();
|
|
91
|
+
const npmWorkspaceErrors = /* @__PURE__ */ new Map();
|
|
92
|
+
for (const file of manifests) {
|
|
93
|
+
if (ecosystem === "npm") {
|
|
94
|
+
const directory = node_path.default.posix.dirname(file);
|
|
95
|
+
const workspaceFile = node_path.default.posix.join(directory, "pnpm-workspace.yaml");
|
|
96
|
+
const text = files[workspaceFile];
|
|
97
|
+
if (text !== void 0) {
|
|
98
|
+
try {
|
|
99
|
+
const document = (0, yaml.parseDocument)(text);
|
|
100
|
+
if (document.errors.length > 0) throw new Error(`${workspaceFile}:1: invalid pnpm workspace YAML`);
|
|
101
|
+
const parsed = document.toJS({ maxAliasCount: 100 });
|
|
102
|
+
if (!record(parsed)) throw new Error(`${workspaceFile}:1: pnpm workspace must contain an object`);
|
|
103
|
+
const patterns = parsed["packages"] ?? [];
|
|
104
|
+
if (!strings(patterns)) throw new Error(`${workspaceFile}:1: pnpm packages must be a string array`);
|
|
105
|
+
workspaces.set(directory, patterns.map((pattern) => pattern.startsWith("!") ? `!${node_path.default.posix.normalize(pattern.slice(1))}` : node_path.default.posix.normalize(pattern)));
|
|
106
|
+
} catch (error) {
|
|
107
|
+
npmWorkspaceErrors.set(directory, error instanceof Error ? error : new Error(String(error)));
|
|
108
|
+
}
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
try {
|
|
113
|
+
const parsed = ecosystem === "npm" ? JSON.parse(files[file] ?? "") : (0, smol_toml.parse)(files[file] ?? "");
|
|
114
|
+
if (!record(parsed)) continue;
|
|
115
|
+
if (ecosystem === "npm" && typeof parsed["packageManager"] === "string" && parsed["packageManager"].startsWith("pnpm@")) continue;
|
|
116
|
+
const value = workspaceTable(parsed, ecosystem);
|
|
117
|
+
const patterns = record(value) ? value[ecosystem === "npm" ? "packages" : "members"] : value;
|
|
118
|
+
const members = ecosystem === "cargo" && record(value) && patterns === void 0 ? [] : patterns;
|
|
119
|
+
if (strings(members)) {
|
|
120
|
+
const excluded = ecosystem !== "npm" && record(value) && strings(value["exclude"]) ? value["exclude"].map((pattern) => `!${pattern}`) : [];
|
|
121
|
+
workspaces.set(node_path.default.posix.dirname(file), [...members, ...excluded]);
|
|
122
|
+
}
|
|
123
|
+
} catch {}
|
|
124
|
+
}
|
|
125
|
+
const implicitCargoMembers = /* @__PURE__ */ new Map();
|
|
126
|
+
const declaredMember = (root, patterns, directory) => {
|
|
127
|
+
const relative = node_path.default.posix.relative(root, directory);
|
|
128
|
+
if (relative === "" || relative === ".." || relative.startsWith("../")) return false;
|
|
129
|
+
return require_toolchain_inputs.workspaceContains({
|
|
130
|
+
directory: root,
|
|
131
|
+
file: node_path.default.posix.join(directory, "package.json"),
|
|
132
|
+
patterns,
|
|
133
|
+
rootMembership: "patterns"
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
const installable = /* @__PURE__ */ new Set(["."]);
|
|
137
|
+
if (ecosystem === "npm") {
|
|
138
|
+
for (const file of manifests) {
|
|
139
|
+
const directory = node_path.default.posix.dirname(file);
|
|
140
|
+
if (declaresJavascriptInstallation(files[node_path.default.posix.join(directory, "package.json")]) || require_toolchain_inputs.javascriptDependencyLockfiles.some((name) => files[node_path.default.posix.join(directory, name)] !== void 0)) installable.add(directory);
|
|
141
|
+
}
|
|
142
|
+
let changed = true;
|
|
143
|
+
while (changed) {
|
|
144
|
+
changed = false;
|
|
145
|
+
for (const [root, patterns] of workspaces) {
|
|
146
|
+
if (!installable.has(root)) {
|
|
147
|
+
if (![...installable].some((directory) => declaredMember(root, patterns, directory))) continue;
|
|
148
|
+
installable.add(root);
|
|
149
|
+
changed = true;
|
|
150
|
+
}
|
|
151
|
+
for (const file of manifests) {
|
|
152
|
+
const directory = node_path.default.posix.dirname(file);
|
|
153
|
+
if (installable.has(directory) || !declaredMember(root, patterns, directory)) continue;
|
|
154
|
+
installable.add(directory);
|
|
155
|
+
changed = true;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (ecosystem === "npm") {
|
|
161
|
+
for (const [directory, error] of npmWorkspaceErrors) if (installable.has(directory)) throw error;
|
|
162
|
+
}
|
|
163
|
+
if (ecosystem === "cargo") for (const [root, patterns] of workspaces) {
|
|
164
|
+
const includes = patterns.filter((pattern) => !pattern.startsWith("!"));
|
|
165
|
+
const excludes = patterns.filter((pattern) => pattern.startsWith("!"));
|
|
166
|
+
const memberDirectories = /* @__PURE__ */ new Set([root]);
|
|
167
|
+
for (const file of manifests) {
|
|
168
|
+
const directory = node_path.default.posix.dirname(file);
|
|
169
|
+
const relative = node_path.default.posix.relative(root, directory);
|
|
170
|
+
if (includes.some((pattern) => picomatch.default.isMatch(relative, pattern)) && !excludes.some((pattern) => picomatch.default.isMatch(relative, pattern.slice(1)))) memberDirectories.add(directory);
|
|
171
|
+
}
|
|
172
|
+
for (const directory of memberDirectories) try {
|
|
173
|
+
const parsed = (0, smol_toml.parse)(files[node_path.default.posix.join(directory, "Cargo.toml")] ?? "");
|
|
174
|
+
const workspace = (0, smol_toml.parse)(files[node_path.default.posix.join(root, "Cargo.toml")] ?? "")["workspace"];
|
|
175
|
+
const inherited = record(workspace) ? workspace["dependencies"] : void 0;
|
|
176
|
+
const dependencyOwners = [parsed];
|
|
177
|
+
const targets = parsed["target"];
|
|
178
|
+
if (record(targets)) {
|
|
179
|
+
for (const target of Object.values(targets)) if (record(target)) dependencyOwners.push(target);
|
|
180
|
+
}
|
|
181
|
+
for (const owner of dependencyOwners) for (const key of [
|
|
182
|
+
"dependencies",
|
|
183
|
+
"dev-dependencies",
|
|
184
|
+
"build-dependencies"
|
|
185
|
+
]) {
|
|
186
|
+
const dependencies = owner[key];
|
|
187
|
+
if (!record(dependencies)) continue;
|
|
188
|
+
for (const [name, dependency] of Object.entries(dependencies)) {
|
|
189
|
+
if (!record(dependency)) continue;
|
|
190
|
+
const isInherited = dependency["workspace"] === true;
|
|
191
|
+
const resolved = isInherited && record(inherited) ? inherited[name] : dependency;
|
|
192
|
+
if (!record(resolved) || typeof resolved["path"] !== "string") continue;
|
|
193
|
+
if (node_path.default.posix.isAbsolute(resolved["path"]) || /\\|\$|^[A-Za-z]:/.test(resolved["path"])) continue;
|
|
194
|
+
const target = node_path.default.posix.normalize(node_path.default.posix.join(isInherited ? root : directory, resolved["path"]));
|
|
195
|
+
const relative = node_path.default.posix.relative(root, target);
|
|
196
|
+
if (relative.startsWith("../") || relative === ".." || files[node_path.default.posix.join(target, "Cargo.toml")] === void 0 || excludes.some((pattern) => picomatch.default.isMatch(relative, pattern.slice(1)))) continue;
|
|
197
|
+
memberDirectories.add(target);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
} catch {}
|
|
201
|
+
implicitCargoMembers.set(root, memberDirectories);
|
|
202
|
+
}
|
|
203
|
+
return manifests.filter((file) => ecosystem !== "npm" || installable.has(node_path.default.posix.dirname(file))).filter((file) => {
|
|
204
|
+
const directory = node_path.default.posix.dirname(file);
|
|
205
|
+
return ![...workspaces].some(([root, patterns]) => {
|
|
206
|
+
if (ecosystem === "npm" && !installable.has(root)) return false;
|
|
207
|
+
const relative = node_path.default.posix.relative(root, directory);
|
|
208
|
+
if (relative === "" || relative.startsWith("../")) return false;
|
|
209
|
+
const includes = patterns.filter((pattern) => !pattern.startsWith("!"));
|
|
210
|
+
const excludes = patterns.filter((pattern) => pattern.startsWith("!"));
|
|
211
|
+
return (implicitCargoMembers.get(root)?.has(directory) === true || (ecosystem === "npm" ? declaredMember(root, patterns, directory) : includes.some((pattern) => picomatch.default.isMatch(relative, pattern)))) && !excludes.some((pattern) => picomatch.default.isMatch(relative, pattern.slice(1)));
|
|
212
|
+
});
|
|
213
|
+
}).map(directoryOf).filter((directory, index, values) => values.indexOf(directory) === index);
|
|
214
|
+
};
|
|
215
|
+
const javascriptEcosystem = (directory, files) => {
|
|
216
|
+
let root = directory === "/" ? "." : directory.slice(1);
|
|
217
|
+
for (;;) {
|
|
218
|
+
if (files[node_path.default.posix.join(root, "bun.lock")] !== void 0) return "bun";
|
|
219
|
+
try {
|
|
220
|
+
const manifest = JSON.parse(files[node_path.default.posix.join(root, "package.json")] ?? "{}");
|
|
221
|
+
if (record(manifest) && typeof manifest["packageManager"] === "string") return manifest["packageManager"].startsWith("bun@") ? "bun" : "npm";
|
|
222
|
+
} catch {}
|
|
223
|
+
for (const name of require_toolchain_inputs.javascriptDependencyLockfiles) if (files[node_path.default.posix.join(root, name)] !== void 0) return "npm";
|
|
224
|
+
if (root === ".") return "npm";
|
|
225
|
+
root = node_path.default.posix.dirname(root);
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
const pythonEcosystem = (file, files) => {
|
|
229
|
+
const manifestKind = require_toolchain_inputs.pythonDependencyManifestKind(file);
|
|
230
|
+
if (manifestKind === "pipfile" || manifestKind === "pipfile-lock" || manifestKind === "setup") return "pip";
|
|
231
|
+
const root = node_path.default.posix.dirname(file);
|
|
232
|
+
if (files[node_path.default.posix.join(root, "uv.lock")] !== void 0 || files[node_path.default.posix.join(root, "uv.toml")] !== void 0) return "uv";
|
|
233
|
+
const pyproject = files[node_path.default.posix.join(root, "pyproject.toml")];
|
|
234
|
+
if (pyproject !== void 0) try {
|
|
235
|
+
const tool = (0, smol_toml.parse)(pyproject)["tool"];
|
|
236
|
+
if (record(tool) && record(tool["uv"])) return "uv";
|
|
237
|
+
} catch {}
|
|
238
|
+
return "pip";
|
|
239
|
+
};
|
|
240
|
+
const ecosystemRoots = (files) => {
|
|
241
|
+
const roots = /* @__PURE__ */ new Map();
|
|
242
|
+
const requireRoot = (ecosystem, directory) => {
|
|
243
|
+
const directories = roots.get(ecosystem) ?? /* @__PURE__ */ new Set();
|
|
244
|
+
directories.add(directory);
|
|
245
|
+
roots.set(ecosystem, directories);
|
|
246
|
+
};
|
|
247
|
+
for (const directory of workspaceRoots(files, "npm")) requireRoot(javascriptEcosystem(directory, files), directory);
|
|
248
|
+
for (const directory of workspaceRoots(files, "cargo")) requireRoot("cargo", directory);
|
|
249
|
+
for (const directory of workspaceRoots(files, "uv")) {
|
|
250
|
+
const root = directory === "/" ? "." : directory.slice(1);
|
|
251
|
+
requireRoot(pythonEcosystem(node_path.default.posix.join(root, "pyproject.toml"), files), directory);
|
|
252
|
+
}
|
|
253
|
+
for (const file of Object.keys(files)) {
|
|
254
|
+
if (require_toolchain_inputs.isDependabotGithubActionsPath(file)) requireRoot("github-actions", "/");
|
|
255
|
+
const name = node_path.default.posix.basename(file);
|
|
256
|
+
const manifestEcosystem = require_toolchain_inputs.dependabotManifestEcosystem(file);
|
|
257
|
+
if (manifestEcosystem !== void 0) requireRoot(manifestEcosystem, directoryOf(file));
|
|
258
|
+
if (require_toolchain_inputs.isDockerDefinitionPath(file)) requireRoot("docker", directoryOf(file));
|
|
259
|
+
if (require_toolchain_inputs.isComposeDefinitionPath(file) || require_toolchain_inputs.isKubernetesDefinitionPath(file)) for (const document of (0, yaml.parseAllDocuments)(files[file] ?? "", { merge: true })) {
|
|
260
|
+
if (document.errors.length > 0) continue;
|
|
261
|
+
try {
|
|
262
|
+
const classified = require_toolchain_inputs.containerDocumentImages(document.toJS({ maxAliasCount: 100 }), file);
|
|
263
|
+
if (classified !== void 0) requireRoot(classified.ecosystem, directoryOf(file));
|
|
264
|
+
} catch {}
|
|
265
|
+
}
|
|
266
|
+
if (name === "uv.lock" || name === "uv.toml" || name !== "pyproject.toml" && require_toolchain_inputs.isPythonDependencyManifest(file)) requireRoot(pythonEcosystem(file, files), directoryOf(file));
|
|
267
|
+
}
|
|
268
|
+
return roots;
|
|
269
|
+
};
|
|
270
|
+
const ignoredFor = (ecosystem, policy) => {
|
|
271
|
+
if (ecosystem === "npm" || ecosystem === "bun") return policy.ignoredPackages;
|
|
272
|
+
if (ecosystem === "github-actions") return policy.ignoredActions;
|
|
273
|
+
if (ecosystem === "docker" || ecosystem === "docker-compose") return ownedDockerImageAliases(policy.ignoredImages);
|
|
274
|
+
return [];
|
|
275
|
+
};
|
|
276
|
+
/** Generate canonical YAML from the same ecosystem enumeration used by the guard. */
|
|
277
|
+
const generateDependabotConfig = ({ files, policy }) => {
|
|
278
|
+
const updates = [...ecosystemRoots(files)].sort(([left], [right]) => left.localeCompare(right)).map(([ecosystem, roots]) => {
|
|
279
|
+
const directories = [...roots].sort();
|
|
280
|
+
const ignored = ignoredFor(ecosystem, policy);
|
|
281
|
+
const time = new yaml.Scalar(policy.schedule.time);
|
|
282
|
+
time.type = yaml.Scalar.QUOTE_DOUBLE;
|
|
283
|
+
return {
|
|
284
|
+
"package-ecosystem": ecosystem,
|
|
285
|
+
directory: directories.length === 1 ? directories.at(0) : void 0,
|
|
286
|
+
directories: directories.length > 1 ? directories : void 0,
|
|
287
|
+
schedule: {
|
|
288
|
+
interval: policy.schedule.interval,
|
|
289
|
+
day: policy.schedule.day,
|
|
290
|
+
time,
|
|
291
|
+
timezone: policy.schedule.timezone
|
|
292
|
+
},
|
|
293
|
+
cooldown: { "default-days": policy.cooldown.defaultDays },
|
|
294
|
+
groups: Object.fromEntries(Object.entries(policy.groups).map(([name, group]) => [name, {
|
|
295
|
+
patterns: group.patterns,
|
|
296
|
+
"update-types": group.updateTypes
|
|
297
|
+
}])),
|
|
298
|
+
ignore: ignored.length > 0 ? ignored.map((name) => ({
|
|
299
|
+
"dependency-name": name,
|
|
300
|
+
"update-types": pinnedVersionUpdateTypes
|
|
301
|
+
})) : void 0
|
|
302
|
+
};
|
|
303
|
+
});
|
|
304
|
+
return (0, yaml.stringify)({
|
|
305
|
+
version: 2,
|
|
306
|
+
updates
|
|
307
|
+
}, { aliasDuplicateObjects: false });
|
|
308
|
+
};
|
|
309
|
+
/** Validate the shared update policy against a hermetic tracked-file snapshot. */
|
|
310
|
+
const checkDependabot = ({ files, policy }) => {
|
|
311
|
+
const roots = ecosystemRoots(files);
|
|
312
|
+
const paths = [".github/dependabot.yml", ".github/dependabot.yaml"].filter((file) => files[file] !== void 0);
|
|
313
|
+
if (roots.size === 0 && paths.length === 0) return [];
|
|
314
|
+
const file = paths.at(0) ?? ".github/dependabot.yml";
|
|
315
|
+
const diagnostics = [];
|
|
316
|
+
const add = (message, line = 1) => {
|
|
317
|
+
diagnostics.push({
|
|
318
|
+
rule: "dependabot-policy",
|
|
319
|
+
path: file,
|
|
320
|
+
line,
|
|
321
|
+
message
|
|
322
|
+
});
|
|
323
|
+
};
|
|
324
|
+
if (paths.length === 0) {
|
|
325
|
+
add("add a Dependabot configuration for the repository's package ecosystems");
|
|
326
|
+
return diagnostics;
|
|
327
|
+
}
|
|
328
|
+
if (paths.length > 1) add("keep one Dependabot configuration file");
|
|
329
|
+
const lineCounter = new yaml.LineCounter();
|
|
330
|
+
const document = (0, yaml.parseDocument)(files[file] ?? "", { lineCounter });
|
|
331
|
+
if (document.errors.length > 0) {
|
|
332
|
+
for (const error of document.errors) add(`invalid Dependabot YAML: ${error.message}`, lineCounter.linePos(error.pos[0]).line);
|
|
333
|
+
return diagnostics;
|
|
334
|
+
}
|
|
335
|
+
let parsed;
|
|
336
|
+
try {
|
|
337
|
+
parsed = document.toJS({ maxAliasCount: 100 });
|
|
338
|
+
} catch {
|
|
339
|
+
add("cannot resolve Dependabot YAML aliases");
|
|
340
|
+
return diagnostics;
|
|
341
|
+
}
|
|
342
|
+
if (!record(parsed) || parsed["version"] !== 2 || !Array.isArray(parsed["updates"])) {
|
|
343
|
+
add("Dependabot must declare version: 2 and an updates array");
|
|
344
|
+
return diagnostics;
|
|
345
|
+
}
|
|
346
|
+
const covered = /* @__PURE__ */ new Map();
|
|
347
|
+
let legacy;
|
|
348
|
+
try {
|
|
349
|
+
const legacyDocument = (0, yaml.parseDocument)(files[file] ?? "", {
|
|
350
|
+
version: "1.1",
|
|
351
|
+
schema: "yaml-1.1"
|
|
352
|
+
});
|
|
353
|
+
if (legacyDocument.errors.length === 0) legacy = legacyDocument.toJS({ maxAliasCount: 100 });
|
|
354
|
+
} catch {}
|
|
355
|
+
const legacyUpdates = record(legacy) && Array.isArray(legacy["updates"]) ? legacy["updates"] : [];
|
|
356
|
+
const rootClaims = /* @__PURE__ */ new Map();
|
|
357
|
+
const directoryClaims = /* @__PURE__ */ new Map();
|
|
358
|
+
for (const [index, update] of parsed["updates"].entries()) {
|
|
359
|
+
const lineOf = (key) => {
|
|
360
|
+
const node = document.getIn([
|
|
361
|
+
"updates",
|
|
362
|
+
index,
|
|
363
|
+
key
|
|
364
|
+
], true);
|
|
365
|
+
const offset = (0, yaml.isNode)(node) ? node.range?.[0] : void 0;
|
|
366
|
+
return offset === void 0 ? 1 : lineCounter.linePos(offset).line;
|
|
367
|
+
};
|
|
368
|
+
const report = (key, message) => add(message, lineOf(key));
|
|
369
|
+
if (!record(update) || typeof update["package-ecosystem"] !== "string") {
|
|
370
|
+
report("package-ecosystem", "each Dependabot update must declare a package ecosystem");
|
|
371
|
+
continue;
|
|
372
|
+
}
|
|
373
|
+
const ecosystem = update["package-ecosystem"];
|
|
374
|
+
if (update["target-branch"] !== void 0) report("target-branch", `${ecosystem}: shared updates must target the default branch`);
|
|
375
|
+
if (update["open-pull-requests-limit"] === 0) report("open-pull-requests-limit", `${ecosystem}: version updates must remain enabled`);
|
|
376
|
+
const single = update["directory"];
|
|
377
|
+
const multiple = update["directories"];
|
|
378
|
+
let directories = [];
|
|
379
|
+
if (typeof single === "string" && multiple === void 0) directories = [single];
|
|
380
|
+
else if (single === void 0 && strings(multiple)) directories = multiple;
|
|
381
|
+
const validDirectories = directories.filter((directory) => directory.startsWith("/") && !directory.split("/").includes(".."));
|
|
382
|
+
if (directories.length === 0 || validDirectories.length !== directories.length) report("directory", `${ecosystem}: declare directory or nonempty directories with absolute repository paths`);
|
|
383
|
+
const normalizedDirectories = Array.from(new Set(validDirectories.map((value) => node_path.default.posix.normalize(value).replace(/\/+$/, "") || "/")));
|
|
384
|
+
const matches = covered.get(ecosystem) ?? /* @__PURE__ */ new Set();
|
|
385
|
+
const claimedDirectories = directoryClaims.get(ecosystem) ?? /* @__PURE__ */ new Map();
|
|
386
|
+
for (const directory of normalizedDirectories) {
|
|
387
|
+
const previous = claimedDirectories.get(directory);
|
|
388
|
+
if (previous !== void 0) report(multiple === void 0 ? "directory" : "directories", `${ecosystem}: directory ${directory} overlaps update entry ${previous + 1}`);
|
|
389
|
+
else claimedDirectories.set(directory, index);
|
|
390
|
+
}
|
|
391
|
+
directoryClaims.set(ecosystem, claimedDirectories);
|
|
392
|
+
const claimedRoots = rootClaims.get(ecosystem) ?? /* @__PURE__ */ new Map();
|
|
393
|
+
for (const root of roots.get(ecosystem) ?? []) if (normalizedDirectories.some((directory) => directory === root || multiple !== void 0 && picomatch.default.isMatch(root, directory))) {
|
|
394
|
+
const previous = claimedRoots.get(root);
|
|
395
|
+
if (previous !== void 0) report(multiple === void 0 ? "directory" : "directories", `${ecosystem}: update root ${root} overlaps update entry ${previous + 1}`);
|
|
396
|
+
else claimedRoots.set(root, index);
|
|
397
|
+
matches.add(root);
|
|
398
|
+
}
|
|
399
|
+
rootClaims.set(ecosystem, claimedRoots);
|
|
400
|
+
covered.set(ecosystem, matches);
|
|
401
|
+
const schedule = update["schedule"];
|
|
402
|
+
const legacyUpdate = legacyUpdates.at(index);
|
|
403
|
+
const legacySchedule = record(legacyUpdate) ? legacyUpdate["schedule"] : void 0;
|
|
404
|
+
if (record(schedule) && schedule["time"] === policy.schedule.time && (!record(legacySchedule) || legacySchedule["time"] !== policy.schedule.time)) report("schedule", `${ecosystem}: quote schedule time to preserve its string value in YAML 1.1`);
|
|
405
|
+
if (!record(schedule) || Object.keys(schedule).length !== Object.keys(policy.schedule).length || Object.entries(policy.schedule).some(([key, value]) => schedule[key] !== value)) report("schedule", `${ecosystem}: schedule must match the shared policy`);
|
|
406
|
+
const cooldown = update["cooldown"];
|
|
407
|
+
if (!record(cooldown) || Object.keys(cooldown).length !== 1 || cooldown["default-days"] !== policy.cooldown.defaultDays) report("cooldown", `${ecosystem}: cooldown must contain only default-days: ${policy.cooldown.defaultDays}`);
|
|
408
|
+
const groups = update["groups"];
|
|
409
|
+
if (!record(groups) || Object.keys(groups).length !== Object.keys(policy.groups).length || Object.entries(policy.groups).some(([name, expected]) => {
|
|
410
|
+
const group = groups[name];
|
|
411
|
+
return !record(group) || Object.keys(group).length !== 2 || !sameStrings(group["patterns"], expected.patterns) || !sameStrings(group["update-types"], expected.updateTypes);
|
|
412
|
+
})) report("groups", `${ecosystem}: groups must match the shared policy`);
|
|
413
|
+
const ignored = ignoredFor(ecosystem, policy);
|
|
414
|
+
const ignore = update["ignore"];
|
|
415
|
+
if (ignore !== void 0 && (!Array.isArray(ignore) || ignore.length === 0)) report("ignore", `${ecosystem}: omit ignore or provide a nonempty array`);
|
|
416
|
+
if (Array.isArray(ignore) && ignore.some((entry) => !record(entry) || typeof entry["dependency-name"] !== "string" || !ignored.includes(entry["dependency-name"]))) report("ignore", `${ecosystem}: ignore only packages owned by the shared policy`);
|
|
417
|
+
if (Array.isArray(ignore) && ignore.some((entry) => !versionOnlyIgnore(entry))) report("ignore", `${ecosystem}: each shared-pin ignore must contain only dependency-name and update-types for semver-major, semver-minor, and semver-patch version updates; security updates must remain enabled`);
|
|
418
|
+
for (const name of ignored) if (!Array.isArray(ignore) || !ignore.some((entry) => record(entry) && entry["dependency-name"] === name && versionOnlyIgnore(entry))) report("ignore", `${ecosystem}: ignore all version updates for shared pin ${name}`);
|
|
419
|
+
}
|
|
420
|
+
for (const [ecosystem, directories] of roots) for (const directory of directories) if (!covered.get(ecosystem)?.has(directory)) add(`add a ${ecosystem} update entry covering ${directory}`);
|
|
421
|
+
return diagnostics;
|
|
422
|
+
};
|
|
423
|
+
//#endregion
|
|
424
|
+
Object.defineProperty(exports, "canonicalDockerRuntime", {
|
|
425
|
+
enumerable: true,
|
|
426
|
+
get: function() {
|
|
427
|
+
return canonicalDockerRuntime;
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
Object.defineProperty(exports, "checkDependabot", {
|
|
431
|
+
enumerable: true,
|
|
432
|
+
get: function() {
|
|
433
|
+
return checkDependabot;
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
Object.defineProperty(exports, "dependabotRules", {
|
|
437
|
+
enumerable: true,
|
|
438
|
+
get: function() {
|
|
439
|
+
return dependabotRules;
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
Object.defineProperty(exports, "generateDependabotConfig", {
|
|
443
|
+
enumerable: true,
|
|
444
|
+
get: function() {
|
|
445
|
+
return generateDependabotConfig;
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
Object.defineProperty(exports, "rustImageVersion", {
|
|
449
|
+
enumerable: true,
|
|
450
|
+
get: function() {
|
|
451
|
+
return rustImageVersion;
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
//# sourceMappingURL=toolchain-dependabot.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolchain-dependabot.cjs","names":["path","unexpected","parseDocument","parseToml","workspaceContains","javascriptDependencyLockfiles","pythonDependencyManifestKind","isDependabotGithubActionsPath","dependabotManifestEcosystem","isDockerDefinitionPath","isComposeDefinitionPath","isKubernetesDefinitionPath","parseAllDocuments","containerDocumentImages","isPythonDependencyManifest","Scalar","stringify","LineCounter","isNode"],"sources":["../src/toolchain-images.ts","../src/toolchain-dependabot.ts"],"sourcesContent":["/** Docker Hub spellings accepted by the shared runtime policy. */\nexport const dockerHubRegistries = [\n \"docker.io\",\n \"index.docker.io\",\n \"registry-1.docker.io\",\n] as const;\n\n/** Expand the full accepted repository alias class without parsing Dockerfile instructions. */\nexport const ownedDockerImageAliases = (images: readonly string[]) => {\n const aliases = new Set<string>();\n for (const image of images) {\n for (const repository of [image, `library/${image}`]) {\n aliases.add(repository);\n for (const registry of dockerHubRegistries)\n aliases.add(`${registry}/${repository}`);\n }\n }\n return [...aliases].sort();\n};\n\n/** Preserve tag/digest spelling while normalizing registry and namespace aliases. */\nexport const canonicalDockerRuntime = (image: string) => {\n const registry = dockerHubRegistries.find((entry) =>\n image.toLowerCase().startsWith(`${entry}/`),\n );\n const repository =\n registry === undefined ? image : image.slice(registry.length + 1);\n return repository.replace(/^library\\//i, \"\");\n};\n\n/** Preserve Rust release identity across official Debian slim and Alpine variants. */\nexport const rustImageVersion = (tag: string) =>\n tag.replace(\n /-(?:alpine(?:\\d+(?:\\.\\d+)*)?|(?:bookworm|bullseye|trixie|buster)(?:-slim)?|slim(?:-(?:bookworm|bullseye|trixie|buster))?)$/,\n \"\",\n );\n","import path from \"node:path\";\nimport picomatch from \"picomatch\";\nimport { parse as parseToml } from \"smol-toml\";\nimport {\n isNode,\n LineCounter,\n parseAllDocuments,\n parseDocument,\n Scalar,\n stringify,\n} from \"yaml\";\n\nimport {\n containerDocumentImages,\n isComposeDefinitionPath,\n isKubernetesDefinitionPath,\n} from \"./toolchain-container-inputs\";\nimport { ownedDockerImageAliases } from \"./toolchain-images\";\nimport {\n isDependabotGithubActionsPath,\n isDockerDefinitionPath,\n pythonDependencyManifestKind,\n isPythonDependencyManifest,\n javascriptDependencyLockfiles,\n dependabotManifestEcosystem,\n} from \"./toolchain-inputs\";\nimport { workspaceContains } from \"./toolchain-workspaces\";\n\nexport const dependabotRules = [\"dependabot-policy\"] as const;\n\ntype DependabotPolicy = {\n schedule: { interval: string; day: string; time: string; timezone: string };\n cooldown: { defaultDays: number };\n groups: Record<\n string,\n { patterns: readonly string[]; updateTypes: readonly string[] }\n >;\n ignoredPackages: readonly string[];\n ignoredActions: readonly string[];\n ignoredImages: readonly string[];\n};\n\ntype Diagnostic = {\n rule: (typeof dependabotRules)[number];\n path: string;\n line: number;\n message: string;\n};\n\nconst record = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nconst strings = (value: unknown): value is string[] =>\n Array.isArray(value) &&\n value.every((entry: unknown) => typeof entry === \"string\");\n\nconst sameStrings = (value: unknown, expected: readonly string[]) => {\n if (!strings(value) || value.length !== expected.length) return false;\n const sortedExpected = [...expected].sort();\n return [...value]\n .sort()\n .every((entry, index) => entry === sortedExpected[index]);\n};\n\nconst pinnedVersionUpdateTypes = [\n \"version-update:semver-major\",\n \"version-update:semver-minor\",\n \"version-update:semver-patch\",\n];\n\nconst versionOnlyIgnore = (entry: unknown) =>\n record(entry) &&\n Object.keys(entry).length === 2 &&\n typeof entry[\"dependency-name\"] === \"string\" &&\n sameStrings(entry[\"update-types\"], pinnedVersionUpdateTypes);\n\nconst directoryOf = (file: string) => {\n const directory = path.posix.dirname(file);\n return directory === \".\" ? \"/\" : `/${directory}`;\n};\n\nconst workspaceManifests = {\n npm: \"package.json\",\n cargo: \"Cargo.toml\",\n uv: \"pyproject.toml\",\n} as const;\n\nconst workspaceTable = (\n parsed: Record<string, unknown>,\n ecosystem: keyof typeof workspaceManifests,\n) => {\n switch (ecosystem) {\n case \"npm\":\n return parsed[\"workspaces\"];\n case \"cargo\":\n return parsed[\"workspace\"];\n case \"uv\": {\n const tool = parsed[\"tool\"];\n const uv = record(tool) ? tool[\"uv\"] : undefined;\n return record(uv) ? uv[\"workspace\"] : undefined;\n }\n default: {\n const unexpected: never = ecosystem;\n throw new Error(\"unknown workspace ecosystem\", { cause: unexpected });\n }\n }\n};\n\nconst declaresJavascriptInstallation = (text: string | undefined) => {\n try {\n const manifest: unknown = JSON.parse(text ?? \"\");\n if (!record(manifest)) return false;\n if (typeof manifest[\"packageManager\"] === \"string\") return true;\n return [\n \"dependencies\",\n \"devDependencies\",\n \"optionalDependencies\",\n \"peerDependencies\",\n ].some((field) => {\n const dependencies = manifest[field];\n return record(dependencies) && Object.keys(dependencies).length > 0;\n });\n } catch {\n // Manifest validation reports invalid JSON independently.\n return false;\n }\n};\n\n/** Dependency-bearing projects and workspace members need coverage without requiring a lock. */\nconst workspaceRoots = (\n files: Record<string, string>,\n ecosystem: keyof typeof workspaceManifests,\n) => {\n const manifests = Object.keys(files).filter(\n (file) =>\n path.posix.basename(file) === workspaceManifests[ecosystem] ||\n (ecosystem === \"npm\" &&\n path.posix.basename(file) === \"pnpm-workspace.yaml\"),\n );\n const workspaces = new Map<string, string[]>();\n const npmWorkspaceErrors = new Map<string, Error>();\n for (const file of manifests) {\n if (ecosystem === \"npm\") {\n const directory = path.posix.dirname(file);\n const workspaceFile = path.posix.join(directory, \"pnpm-workspace.yaml\");\n const text = files[workspaceFile];\n if (text !== undefined) {\n try {\n const document = parseDocument(text);\n if (document.errors.length > 0)\n throw new Error(`${workspaceFile}:1: invalid pnpm workspace YAML`);\n const parsed: unknown = document.toJS({ maxAliasCount: 100 });\n if (!record(parsed))\n throw new Error(\n `${workspaceFile}:1: pnpm workspace must contain an object`,\n );\n const patterns = parsed[\"packages\"] ?? [];\n if (!strings(patterns))\n throw new Error(\n `${workspaceFile}:1: pnpm packages must be a string array`,\n );\n workspaces.set(\n directory,\n patterns.map((pattern) =>\n pattern.startsWith(\"!\")\n ? `!${path.posix.normalize(pattern.slice(1))}`\n : path.posix.normalize(pattern),\n ),\n );\n } catch (error) {\n npmWorkspaceErrors.set(\n directory,\n error instanceof Error ? error : new Error(String(error)),\n );\n }\n continue;\n }\n }\n try {\n const parsed: unknown =\n ecosystem === \"npm\"\n ? JSON.parse(files[file] ?? \"\")\n : parseToml(files[file] ?? \"\");\n if (!record(parsed)) continue;\n if (\n ecosystem === \"npm\" &&\n typeof parsed[\"packageManager\"] === \"string\" &&\n parsed[\"packageManager\"].startsWith(\"pnpm@\")\n )\n continue;\n const value = workspaceTable(parsed, ecosystem);\n const patterns = record(value)\n ? value[ecosystem === \"npm\" ? \"packages\" : \"members\"]\n : value;\n const members =\n ecosystem === \"cargo\" && record(value) && patterns === undefined\n ? []\n : patterns;\n if (strings(members)) {\n const excluded =\n ecosystem !== \"npm\" && record(value) && strings(value[\"exclude\"])\n ? value[\"exclude\"].map((pattern) => `!${pattern}`)\n : [];\n workspaces.set(path.posix.dirname(file), [...members, ...excluded]);\n }\n } catch {\n // Other toolchain rules validate manifests; retain the update root here.\n }\n }\n const implicitCargoMembers = new Map<string, Set<string>>();\n const declaredMember = (\n root: string,\n patterns: string[],\n directory: string,\n ) => {\n const relative = path.posix.relative(root, directory);\n if (relative === \"\" || relative === \"..\" || relative.startsWith(\"../\"))\n return false;\n return workspaceContains({\n directory: root,\n file: path.posix.join(directory, \"package.json\"),\n patterns,\n rootMembership: \"patterns\",\n });\n };\n const installable = new Set([\".\"]);\n if (ecosystem === \"npm\") {\n for (const file of manifests) {\n const directory = path.posix.dirname(file);\n if (\n declaresJavascriptInstallation(\n files[path.posix.join(directory, \"package.json\")],\n ) ||\n javascriptDependencyLockfiles.some(\n (name) => files[path.posix.join(directory, name)] !== undefined,\n )\n )\n installable.add(directory);\n }\n let changed = true;\n while (changed) {\n changed = false;\n for (const [root, patterns] of workspaces) {\n if (!installable.has(root)) {\n if (\n ![...installable].some((directory) =>\n declaredMember(root, patterns, directory),\n )\n )\n continue;\n installable.add(root);\n changed = true;\n }\n for (const file of manifests) {\n const directory = path.posix.dirname(file);\n if (\n installable.has(directory) ||\n !declaredMember(root, patterns, directory)\n )\n continue;\n installable.add(directory);\n changed = true;\n }\n }\n }\n }\n if (ecosystem === \"npm\") {\n for (const [directory, error] of npmWorkspaceErrors)\n if (installable.has(directory)) throw error;\n }\n if (ecosystem === \"cargo\") {\n for (const [root, patterns] of workspaces) {\n const includes = patterns.filter((pattern) => !pattern.startsWith(\"!\"));\n const excludes = patterns.filter((pattern) => pattern.startsWith(\"!\"));\n const memberDirectories = new Set([root]);\n for (const file of manifests) {\n const directory = path.posix.dirname(file);\n const relative = path.posix.relative(root, directory);\n if (\n includes.some((pattern) => picomatch.isMatch(relative, pattern)) &&\n !excludes.some((pattern) =>\n picomatch.isMatch(relative, pattern.slice(1)),\n )\n )\n memberDirectories.add(directory);\n }\n for (const directory of memberDirectories) {\n try {\n const parsed = parseToml(\n files[path.posix.join(directory, \"Cargo.toml\")] ?? \"\",\n );\n const rootParsed = parseToml(\n files[path.posix.join(root, \"Cargo.toml\")] ?? \"\",\n );\n const workspace = rootParsed[\"workspace\"];\n const inherited = record(workspace)\n ? workspace[\"dependencies\"]\n : undefined;\n const dependencyOwners = [parsed];\n const targets = parsed[\"target\"];\n if (record(targets)) {\n for (const target of Object.values(targets))\n if (record(target)) dependencyOwners.push(target);\n }\n for (const owner of dependencyOwners) {\n for (const key of [\n \"dependencies\",\n \"dev-dependencies\",\n \"build-dependencies\",\n ]) {\n const dependencies = owner[key];\n if (!record(dependencies)) continue;\n for (const [name, dependency] of Object.entries(dependencies)) {\n if (!record(dependency)) continue;\n const isInherited = dependency[\"workspace\"] === true;\n const resolved =\n isInherited && record(inherited)\n ? inherited[name]\n : dependency;\n if (!record(resolved) || typeof resolved[\"path\"] !== \"string\")\n continue;\n if (\n path.posix.isAbsolute(resolved[\"path\"]) ||\n /\\\\|\\$|^[A-Za-z]:/.test(resolved[\"path\"])\n )\n continue;\n const target = path.posix.normalize(\n path.posix.join(\n isInherited ? root : directory,\n resolved[\"path\"],\n ),\n );\n const relative = path.posix.relative(root, target);\n if (\n relative.startsWith(\"../\") ||\n relative === \"..\" ||\n files[path.posix.join(target, \"Cargo.toml\")] === undefined ||\n excludes.some((pattern) =>\n picomatch.isMatch(relative, pattern.slice(1)),\n )\n )\n continue;\n memberDirectories.add(target);\n }\n }\n }\n } catch {\n // Manifest validation diagnoses malformed TOML independently.\n }\n }\n implicitCargoMembers.set(root, memberDirectories);\n }\n }\n return manifests\n .filter(\n (file) =>\n ecosystem !== \"npm\" || installable.has(path.posix.dirname(file)),\n )\n .filter((file) => {\n const directory = path.posix.dirname(file);\n return ![...workspaces].some(([root, patterns]) => {\n if (ecosystem === \"npm\" && !installable.has(root)) return false;\n const relative = path.posix.relative(root, directory);\n if (relative === \"\" || relative.startsWith(\"../\")) return false;\n const includes = patterns.filter((pattern) => !pattern.startsWith(\"!\"));\n const excludes = patterns.filter((pattern) => pattern.startsWith(\"!\"));\n return (\n (implicitCargoMembers.get(root)?.has(directory) === true ||\n (ecosystem === \"npm\"\n ? declaredMember(root, patterns, directory)\n : includes.some((pattern) =>\n picomatch.isMatch(relative, pattern),\n ))) &&\n !excludes.some((pattern) =>\n picomatch.isMatch(relative, pattern.slice(1)),\n )\n );\n });\n })\n .map(directoryOf)\n .filter((directory, index, values) => values.indexOf(directory) === index);\n};\n\ntype CheckDependabotOptions = {\n files: Record<string, string>;\n policy: DependabotPolicy;\n};\n\nconst javascriptEcosystem = (\n directory: string,\n files: Record<string, string>,\n) => {\n let root = directory === \"/\" ? \".\" : directory.slice(1);\n for (;;) {\n if (files[path.posix.join(root, \"bun.lock\")] !== undefined) return \"bun\";\n try {\n const manifest: unknown = JSON.parse(\n files[path.posix.join(root, \"package.json\")] ?? \"{}\",\n );\n if (record(manifest) && typeof manifest[\"packageManager\"] === \"string\")\n return manifest[\"packageManager\"].startsWith(\"bun@\") ? \"bun\" : \"npm\";\n } catch {\n // Package rules diagnose malformed JSON; retain its update coverage.\n }\n for (const name of javascriptDependencyLockfiles)\n if (files[path.posix.join(root, name)] !== undefined) return \"npm\";\n if (root === \".\") return \"npm\";\n root = path.posix.dirname(root);\n }\n};\n\nconst pythonEcosystem = (file: string, files: Record<string, string>) => {\n const manifestKind = pythonDependencyManifestKind(file);\n if (\n manifestKind === \"pipfile\" ||\n manifestKind === \"pipfile-lock\" ||\n manifestKind === \"setup\"\n )\n return \"pip\";\n const root = path.posix.dirname(file);\n if (\n files[path.posix.join(root, \"uv.lock\")] !== undefined ||\n files[path.posix.join(root, \"uv.toml\")] !== undefined\n )\n return \"uv\";\n const pyproject = files[path.posix.join(root, \"pyproject.toml\")];\n if (pyproject !== undefined) {\n try {\n const parsed = parseToml(pyproject);\n const tool = parsed[\"tool\"];\n if (record(tool) && record(tool[\"uv\"])) return \"uv\";\n } catch {\n // Runtime rules diagnose malformed TOML; retain its update coverage.\n }\n }\n return \"pip\";\n};\n\nconst ecosystemRoots = (files: Record<string, string>) => {\n const roots = new Map<string, Set<string>>();\n const requireRoot = (ecosystem: string, directory: string) => {\n const directories = roots.get(ecosystem) ?? new Set<string>();\n directories.add(directory);\n roots.set(ecosystem, directories);\n };\n for (const directory of workspaceRoots(files, \"npm\"))\n requireRoot(javascriptEcosystem(directory, files), directory);\n for (const directory of workspaceRoots(files, \"cargo\"))\n requireRoot(\"cargo\", directory);\n for (const directory of workspaceRoots(files, \"uv\")) {\n const root = directory === \"/\" ? \".\" : directory.slice(1);\n requireRoot(\n pythonEcosystem(path.posix.join(root, \"pyproject.toml\"), files),\n directory,\n );\n }\n for (const file of Object.keys(files)) {\n if (isDependabotGithubActionsPath(file)) requireRoot(\"github-actions\", \"/\");\n const name = path.posix.basename(file);\n const manifestEcosystem = dependabotManifestEcosystem(file);\n if (manifestEcosystem !== undefined)\n requireRoot(manifestEcosystem, directoryOf(file));\n if (isDockerDefinitionPath(file)) requireRoot(\"docker\", directoryOf(file));\n if (isComposeDefinitionPath(file) || isKubernetesDefinitionPath(file)) {\n for (const document of parseAllDocuments(files[file] ?? \"\", {\n merge: true,\n })) {\n if (document.errors.length > 0) continue;\n try {\n const classified = containerDocumentImages(\n document.toJS({ maxAliasCount: 100 }),\n file,\n );\n if (classified !== undefined)\n requireRoot(classified.ecosystem, directoryOf(file));\n } catch {\n // Runtime validation reports malformed or excessive YAML aliases.\n }\n }\n }\n if (\n name === \"uv.lock\" ||\n name === \"uv.toml\" ||\n (name !== \"pyproject.toml\" && isPythonDependencyManifest(file))\n )\n requireRoot(pythonEcosystem(file, files), directoryOf(file));\n }\n return roots;\n};\n\nconst ignoredFor = (ecosystem: string, policy: DependabotPolicy) => {\n if (ecosystem === \"npm\" || ecosystem === \"bun\") return policy.ignoredPackages;\n if (ecosystem === \"github-actions\") return policy.ignoredActions;\n if (ecosystem === \"docker\" || ecosystem === \"docker-compose\")\n return ownedDockerImageAliases(policy.ignoredImages);\n return [];\n};\n\n/** Generate canonical YAML from the same ecosystem enumeration used by the guard. */\nexport const generateDependabotConfig = ({\n files,\n policy,\n}: CheckDependabotOptions) => {\n const updates = [...ecosystemRoots(files)]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([ecosystem, roots]) => {\n const directories = [...roots].sort();\n const ignored = ignoredFor(ecosystem, policy);\n const time = new Scalar(policy.schedule.time);\n time.type = Scalar.QUOTE_DOUBLE;\n return {\n \"package-ecosystem\": ecosystem,\n directory: directories.length === 1 ? directories.at(0) : undefined,\n directories: directories.length > 1 ? directories : undefined,\n schedule: {\n interval: policy.schedule.interval,\n day: policy.schedule.day,\n time,\n timezone: policy.schedule.timezone,\n },\n cooldown: { \"default-days\": policy.cooldown.defaultDays },\n groups: Object.fromEntries(\n Object.entries(policy.groups).map(([name, group]) => [\n name,\n { patterns: group.patterns, \"update-types\": group.updateTypes },\n ]),\n ),\n ignore:\n ignored.length > 0\n ? ignored.map((name) => ({\n \"dependency-name\": name,\n \"update-types\": pinnedVersionUpdateTypes,\n }))\n : undefined,\n };\n });\n return stringify({ version: 2, updates }, { aliasDuplicateObjects: false });\n};\n\n/** Validate the shared update policy against a hermetic tracked-file snapshot. */\nexport const checkDependabot = ({\n files,\n policy,\n}: CheckDependabotOptions): Diagnostic[] => {\n const roots = ecosystemRoots(files);\n const paths = [\".github/dependabot.yml\", \".github/dependabot.yaml\"].filter(\n (file) => files[file] !== undefined,\n );\n if (roots.size === 0 && paths.length === 0) return [];\n const file = paths.at(0) ?? \".github/dependabot.yml\";\n const diagnostics: Diagnostic[] = [];\n const add = (message: string, line = 1) => {\n diagnostics.push({ rule: \"dependabot-policy\", path: file, line, message });\n };\n if (paths.length === 0) {\n add(\n \"add a Dependabot configuration for the repository's package ecosystems\",\n );\n return diagnostics;\n }\n if (paths.length > 1) add(\"keep one Dependabot configuration file\");\n const lineCounter = new LineCounter();\n const document = parseDocument(files[file] ?? \"\", {\n lineCounter,\n });\n if (document.errors.length > 0) {\n for (const error of document.errors)\n add(\n `invalid Dependabot YAML: ${error.message}`,\n lineCounter.linePos(error.pos[0]).line,\n );\n return diagnostics;\n }\n let parsed: unknown;\n try {\n parsed = document.toJS({ maxAliasCount: 100 });\n } catch {\n add(\"cannot resolve Dependabot YAML aliases\");\n return diagnostics;\n }\n if (\n !record(parsed) ||\n parsed[\"version\"] !== 2 ||\n !Array.isArray(parsed[\"updates\"])\n ) {\n add(\"Dependabot must declare version: 2 and an updates array\");\n return diagnostics;\n }\n const covered = new Map<string, Set<string>>();\n let legacy: unknown;\n try {\n const legacyDocument = parseDocument(files[file] ?? \"\", {\n version: \"1.1\",\n schema: \"yaml-1.1\",\n });\n if (legacyDocument.errors.length === 0)\n legacy = legacyDocument.toJS({ maxAliasCount: 100 });\n } catch {\n // The canonical parser reports invalid aliases; incompatible times fail below.\n }\n const legacyUpdates =\n record(legacy) && Array.isArray(legacy[\"updates\"]) ? legacy[\"updates\"] : [];\n const rootClaims = new Map<string, Map<string, number>>();\n const directoryClaims = new Map<string, Map<string, number>>();\n for (const [index, update] of parsed[\"updates\"].entries()) {\n const lineOf = (key: string) => {\n const node: unknown = document.getIn([\"updates\", index, key], true);\n const offset = isNode(node) ? node.range?.[0] : undefined;\n return offset === undefined ? 1 : lineCounter.linePos(offset).line;\n };\n const report = (key: string, message: string) => add(message, lineOf(key));\n if (!record(update) || typeof update[\"package-ecosystem\"] !== \"string\") {\n report(\n \"package-ecosystem\",\n \"each Dependabot update must declare a package ecosystem\",\n );\n continue;\n }\n const ecosystem = update[\"package-ecosystem\"];\n if (update[\"target-branch\"] !== undefined)\n report(\n \"target-branch\",\n `${ecosystem}: shared updates must target the default branch`,\n );\n if (update[\"open-pull-requests-limit\"] === 0)\n report(\n \"open-pull-requests-limit\",\n `${ecosystem}: version updates must remain enabled`,\n );\n const single = update[\"directory\"];\n const multiple = update[\"directories\"];\n let directories: string[] = [];\n if (typeof single === \"string\" && multiple === undefined)\n directories = [single];\n else if (single === undefined && strings(multiple)) directories = multiple;\n const validDirectories = directories.filter(\n (directory) =>\n directory.startsWith(\"/\") && !directory.split(\"/\").includes(\"..\"),\n );\n if (\n directories.length === 0 ||\n validDirectories.length !== directories.length\n ) {\n report(\n \"directory\",\n `${ecosystem}: declare directory or nonempty directories with absolute repository paths`,\n );\n }\n const normalizedDirectories = Array.from(\n new Set(\n validDirectories.map(\n (value) => path.posix.normalize(value).replace(/\\/+$/, \"\") || \"/\",\n ),\n ),\n );\n const matches = covered.get(ecosystem) ?? new Set<string>();\n const claimedDirectories =\n directoryClaims.get(ecosystem) ?? new Map<string, number>();\n for (const directory of normalizedDirectories) {\n const previous = claimedDirectories.get(directory);\n if (previous !== undefined)\n report(\n multiple === undefined ? \"directory\" : \"directories\",\n `${ecosystem}: directory ${directory} overlaps update entry ${previous + 1}`,\n );\n else claimedDirectories.set(directory, index);\n }\n directoryClaims.set(ecosystem, claimedDirectories);\n const claimedRoots = rootClaims.get(ecosystem) ?? new Map<string, number>();\n for (const root of roots.get(ecosystem) ?? []) {\n if (\n normalizedDirectories.some(\n (directory) =>\n directory === root ||\n (multiple !== undefined && picomatch.isMatch(root, directory)),\n )\n ) {\n const previous = claimedRoots.get(root);\n if (previous !== undefined)\n report(\n multiple === undefined ? \"directory\" : \"directories\",\n `${ecosystem}: update root ${root} overlaps update entry ${previous + 1}`,\n );\n else claimedRoots.set(root, index);\n matches.add(root);\n }\n }\n rootClaims.set(ecosystem, claimedRoots);\n covered.set(ecosystem, matches);\n const schedule = update[\"schedule\"];\n const legacyUpdate: unknown = legacyUpdates.at(index);\n const legacySchedule = record(legacyUpdate)\n ? legacyUpdate[\"schedule\"]\n : undefined;\n if (\n record(schedule) &&\n schedule[\"time\"] === policy.schedule.time &&\n (!record(legacySchedule) ||\n legacySchedule[\"time\"] !== policy.schedule.time)\n )\n report(\n \"schedule\",\n `${ecosystem}: quote schedule time to preserve its string value in YAML 1.1`,\n );\n if (\n !record(schedule) ||\n Object.keys(schedule).length !== Object.keys(policy.schedule).length ||\n Object.entries(policy.schedule).some(\n ([key, value]) => schedule[key] !== value,\n )\n )\n report(\"schedule\", `${ecosystem}: schedule must match the shared policy`);\n const cooldown = update[\"cooldown\"];\n if (\n !record(cooldown) ||\n Object.keys(cooldown).length !== 1 ||\n cooldown[\"default-days\"] !== policy.cooldown.defaultDays\n )\n report(\n \"cooldown\",\n `${ecosystem}: cooldown must contain only default-days: ${policy.cooldown.defaultDays}`,\n );\n const groups = update[\"groups\"];\n if (\n !record(groups) ||\n Object.keys(groups).length !== Object.keys(policy.groups).length ||\n Object.entries(policy.groups).some(([name, expected]) => {\n const group = groups[name];\n return (\n !record(group) ||\n Object.keys(group).length !== 2 ||\n !sameStrings(group[\"patterns\"], expected.patterns) ||\n !sameStrings(group[\"update-types\"], expected.updateTypes)\n );\n })\n )\n report(\"groups\", `${ecosystem}: groups must match the shared policy`);\n const ignored = ignoredFor(ecosystem, policy);\n const ignore = update[\"ignore\"];\n if (ignore !== undefined && (!Array.isArray(ignore) || ignore.length === 0))\n report(\"ignore\", `${ecosystem}: omit ignore or provide a nonempty array`);\n if (\n Array.isArray(ignore) &&\n ignore.some(\n (entry: unknown) =>\n !record(entry) ||\n typeof entry[\"dependency-name\"] !== \"string\" ||\n !ignored.includes(entry[\"dependency-name\"]),\n )\n )\n report(\n \"ignore\",\n `${ecosystem}: ignore only packages owned by the shared policy`,\n );\n if (\n Array.isArray(ignore) &&\n ignore.some((entry: unknown) => !versionOnlyIgnore(entry))\n )\n report(\n \"ignore\",\n `${ecosystem}: each shared-pin ignore must contain only dependency-name and update-types for semver-major, semver-minor, and semver-patch version updates; security updates must remain enabled`,\n );\n for (const name of ignored) {\n if (\n !Array.isArray(ignore) ||\n !ignore.some(\n (entry: unknown) =>\n record(entry) &&\n entry[\"dependency-name\"] === name &&\n versionOnlyIgnore(entry),\n )\n )\n report(\n \"ignore\",\n `${ecosystem}: ignore all version updates for shared pin ${name}`,\n );\n }\n }\n for (const [ecosystem, directories] of roots) {\n for (const directory of directories) {\n if (!covered.get(ecosystem)?.has(directory))\n add(`add a ${ecosystem} update ent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