@stll/oxlint-config 1.0.2 → 1.2.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 (49) hide show
  1. package/README.md +97 -4
  2. package/dist/cloud-setup-cli.cjs +62 -21
  3. package/dist/cloud-setup-cli.cjs.map +1 -1
  4. package/dist/cloud-setup-cli.mjs +63 -22
  5. package/dist/cloud-setup-cli.mjs.map +1 -1
  6. package/dist/consumer-compat-cli.cjs +7 -6
  7. package/dist/consumer-compat-cli.cjs.map +1 -1
  8. package/dist/consumer-compat-cli.mjs +7 -6
  9. package/dist/consumer-compat-cli.mjs.map +1 -1
  10. package/dist/git-tracked-output.cjs.map +1 -1
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/publish-build-target-vite-dts-helper.mjs +1 -2
  13. package/dist/publish-build-target-vite-dts-helper2.cjs +5 -5
  14. package/dist/publish-build-target-vite-dts-helper2.cjs.map +1 -1
  15. package/dist/publish-contract-cli.cjs +17 -16
  16. package/dist/publish-contract-cli.cjs.map +1 -1
  17. package/dist/publish-contract-cli.mjs +6 -5
  18. package/dist/publish-contract-cli.mjs.map +1 -1
  19. package/dist/publish-contract.cjs +1 -1
  20. package/dist/publish-contract.cjs.map +1 -1
  21. package/dist/publish-contract.mjs +1 -1
  22. package/dist/rolldown-runtime.cjs +1 -1
  23. package/dist/toolchain-changed.cjs +25 -15
  24. package/dist/toolchain-changed.cjs.map +1 -1
  25. package/dist/toolchain-changed.mjs +27 -17
  26. package/dist/toolchain-changed.mjs.map +1 -1
  27. package/dist/toolchain-check-cli.cjs.map +1 -1
  28. package/dist/toolchain-check-cli.mjs.map +1 -1
  29. package/dist/toolchain-guard.cjs +72 -48
  30. package/dist/toolchain-guard.cjs.map +1 -1
  31. package/dist/toolchain-guard.mjs +79 -55
  32. package/dist/toolchain-guard.mjs.map +1 -1
  33. package/dist/toolchain-inputs.cjs +803 -40
  34. package/dist/toolchain-inputs.cjs.map +1 -1
  35. package/dist/toolchain-inputs.mjs +768 -41
  36. package/dist/toolchain-inputs.mjs.map +1 -1
  37. package/dist/toolchain-schema.cjs +1 -1
  38. package/dist/toolchain-schema.cjs.map +1 -1
  39. package/dist/toolchain-schema.mjs +2 -2
  40. package/dist/typecheck-parity-cli.cjs.map +1 -1
  41. package/dist/typecheck-parity-cli.mjs.map +1 -1
  42. package/dist/typecheck-parity.cjs +8 -7
  43. package/dist/typecheck-parity.cjs.map +1 -1
  44. package/dist/typecheck-parity.mjs +6 -5
  45. package/dist/typecheck-parity.mjs.map +1 -1
  46. package/dist/typecheck-probe-cli.cjs +1 -1
  47. package/dist/typecheck-probe-cli.cjs.map +1 -1
  48. package/dist/typecheck-probe-cli.mjs +1 -1
  49. package/package.json +6 -6
@@ -1,16 +1,16 @@
1
- import { _ as nodeSelectorMatches, a as isPythonDependencyManifest, c as pythonDependencyManifestKind, d as isComposeDefinitionPath, f as isKubernetesDefinitionPath, h as generateCloudSetup, i as isMiseConfigPath, l as toolchainInputKind, m as cloudSetupPath, n as isDependabotGithubActionsPath, o as isShellScript, p as workspaceContains, r as isDockerDefinitionPath, s as javascriptDependencyLockfiles, t as githubAutomationFileKind, u as containerDocumentImages, v as nodeSupportRangeMatches, y as parseCloudSetup } from "./toolchain-inputs.mjs";
1
+ import { C as nodeSelectorMatches, T as parseCloudSetup, _ as hasCloudAttribution, a as isPythonDependencyManifest, b as cloudSetupPath, c as pythonDependencyManifestKind, d as isComposeDefinitionPath, f as isKubernetesDefinitionPath, g as cloudSessionStartFix, h as cloudClaudeSettingsPath, i as isMiseConfigPath, l as toolchainInputKind, m as cloudAttributionFix, n as isDependabotGithubActionsPath, o as isShellScript, p as workspaceContains, r as isDockerDefinitionPath, s as javascriptDependencyLockfiles, t as githubAutomationFileKind, u as containerDocumentImages, v as hasCloudSessionStartHook, w as nodeSupportRangeMatches, x as generateCloudSetup } from "./toolchain-inputs.mjs";
2
2
  import { t as readGitTrackedOutput } from "./git-tracked-output.mjs";
3
3
  import { _ as parseConsumerFixtures, d as consumerPackageClosure, g as discoverConsumerPackages, i as assertConsumerFixtureKind, n as assertConsumerNodeSupport, o as assertConsumerFixtureSelection } from "./toolchain-schema.mjs";
4
4
  import { closeSync, lstatSync, openSync, readFileSync, readSync, realpathSync } from "node:fs";
5
5
  import { execFileSync } from "node:child_process";
6
6
  import path from "node:path";
7
7
  import { minVersion, satisfies, valid, validRange } from "semver";
8
+ import { parse as parse$1 } from "smol-toml";
8
9
  import { LineCounter, isAlias, isMap, isNode, isScalar, isSeq, parseAllDocuments, parseDocument } from "yaml";
9
10
  import picomatch from "picomatch";
10
- import { parse as parse$2 } from "smol-toml";
11
11
  //#endregion
12
12
  //#region src/toolchain-consumer-checks.ts
13
- const consumerRunnerVersion = "1.0.2";
13
+ const consumerRunnerVersion = "1.2.0";
14
14
  const consumerCheckWorkflow = "stella/.github/.github/workflows/package-consumer-compat.yml";
15
15
  const record$7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
16
16
  const repositoryDirectory = (value) => typeof value === "string" && value !== "" && !value.includes("\\") && !value.includes("${{") && !value.split("").some((character) => {
@@ -192,7 +192,8 @@ const checkConsumerChecks = ({ declarations, files, policy }) => {
192
192
  const fixtureManifest = path.posix.join(declaration.fixturePath, "consumer-compat.json");
193
193
  const fixtureSource = files[fixtureManifest];
194
194
  if (fixtureSource === void 0) throw new Error(`consumerChecks fixture configuration must be tracked: ${fixtureManifest}`);
195
- const fixtures = parseConsumerFixtures(JSON.parse(fixtureSource));
195
+ const fixtureConfiguration = JSON.parse(fixtureSource);
196
+ const fixtures = parseConsumerFixtures(fixtureConfiguration);
196
197
  assertConsumerFixtureSelection({
197
198
  selected: declaration.packages,
198
199
  fixtures
@@ -322,7 +323,7 @@ const workspaceRoots = (files, ecosystem) => {
322
323
  }
323
324
  }
324
325
  try {
325
- const parsed = ecosystem === "npm" ? JSON.parse(files[file] ?? "") : parse$2(files[file] ?? "");
326
+ const parsed = ecosystem === "npm" ? JSON.parse(files[file] ?? "") : parse$1(files[file] ?? "");
326
327
  if (!record$6(parsed)) continue;
327
328
  if (ecosystem === "npm" && typeof parsed["packageManager"] === "string" && parsed["packageManager"].startsWith("pnpm@")) continue;
328
329
  const value = workspaceTable(parsed, ecosystem);
@@ -378,8 +379,8 @@ const workspaceRoots = (files, ecosystem) => {
378
379
  if (includes.some((pattern) => picomatch.isMatch(relative, pattern)) && !excludes.some((pattern) => picomatch.isMatch(relative, pattern.slice(1)))) memberDirectories.add(directory);
379
380
  }
380
381
  for (const directory of memberDirectories) try {
381
- const parsed = parse$2(files[path.posix.join(directory, "Cargo.toml")] ?? "");
382
- const workspace = parse$2(files[path.posix.join(root, "Cargo.toml")] ?? "")["workspace"];
382
+ const parsed = parse$1(files[path.posix.join(directory, "Cargo.toml")] ?? "");
383
+ const workspace = parse$1(files[path.posix.join(root, "Cargo.toml")] ?? "")["workspace"];
383
384
  const inherited = record$6(workspace) ? workspace["dependencies"] : void 0;
384
385
  const dependencyOwners = [parsed];
385
386
  const targets = parsed["target"];
@@ -436,7 +437,7 @@ const pythonEcosystem = (file, files) => {
436
437
  if (files[path.posix.join(root, "uv.lock")] !== void 0 || files[path.posix.join(root, "uv.toml")] !== void 0) return "uv";
437
438
  const pyproject = files[path.posix.join(root, "pyproject.toml")];
438
439
  if (pyproject !== void 0) try {
439
- const tool = parse$2(pyproject)["tool"];
440
+ const tool = parse$1(pyproject)["tool"];
440
441
  if (record$6(tool) && record$6(tool["uv"])) return "uv";
441
442
  } catch {}
442
443
  return "pip";
@@ -1105,14 +1106,15 @@ const shellCommandSegments = (command, grouping = "boundaries") => {
1105
1106
  for (const source of sources) {
1106
1107
  const firstSegment = segments.length;
1107
1108
  segments.push([]);
1108
- for (const { kind, value: word } of shellArgumentTokens(shellTokens(source))) if (kind === "boundary") if ([
1109
- "(",
1110
- ")",
1111
- "{",
1112
- "}"
1113
- ].includes(word) && grouping === "tokens") segments.at(-1)?.push(word);
1114
- else segments.push([]);
1115
- else segments.at(-1)?.push(word);
1109
+ for (const { kind, value: word } of shellArgumentTokens(shellTokens(source))) if (kind === "boundary") {
1110
+ if ([
1111
+ "(",
1112
+ ")",
1113
+ "{",
1114
+ "}"
1115
+ ].includes(word) && grouping === "tokens") segments.at(-1)?.push(word);
1116
+ else segments.push([]);
1117
+ } else segments.at(-1)?.push(word);
1116
1118
  for (const words of segments.slice(firstSegment)) {
1117
1119
  const body = shellCommandBody(words);
1118
1120
  if (body === void 0) continue;
@@ -1606,7 +1608,8 @@ const checkPackageFiles = ({ files, policy }) => {
1606
1608
  if (resolved === specifier) return false;
1607
1609
  if (qualifier === void 0 || validRange(qualifier) === null) return true;
1608
1610
  if (typeof specifier !== "string") return false;
1609
- const release = valid(specifier.startsWith("npm:") ? specifier.slice(specifier.lastIndexOf("@") + 1) : specifier);
1611
+ const versionSpecifier = specifier.startsWith("npm:") ? specifier.slice(specifier.lastIndexOf("@") + 1) : specifier;
1612
+ const release = valid(versionSpecifier);
1610
1613
  return release !== null && satisfies(release, qualifier);
1611
1614
  }) && typeof resolved === "string" && tsSpecifiers.get(name)?.has(resolved)) add({
1612
1615
  file,
@@ -1870,7 +1873,9 @@ const checkRustReferences = (options) => {
1870
1873
  const version = tag === void 0 ? void 0 : rustImageVersion(tag);
1871
1874
  select(version, "Rust service image", lineOf(value));
1872
1875
  } else if (Array.isArray(value)) value.forEach(images);
1873
- else if (record$2(value)) Object.values(value).forEach(images);
1876
+ else if (record$2(value)) {
1877
+ for (const [key, entry] of Object.entries(value)) if (key !== "name") images(entry);
1878
+ }
1874
1879
  };
1875
1880
  try {
1876
1881
  images(JSON.parse(text));
@@ -2108,7 +2113,7 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2108
2113
  };
2109
2114
  const toml = (rule) => {
2110
2115
  try {
2111
- return parse$2(text);
2116
+ return parse$1(text);
2112
2117
  } catch {
2113
2118
  add({
2114
2119
  rule,
@@ -2190,7 +2195,7 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2190
2195
  if (candidate === file) return parsed;
2191
2196
  if (!trackedFiles.has(candidate)) return void 0;
2192
2197
  try {
2193
- return parse$2(readFile(candidate) ?? "");
2198
+ return parse$1(readFile(candidate) ?? "");
2194
2199
  } catch {
2195
2200
  return;
2196
2201
  }
@@ -2201,28 +2206,30 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2201
2206
  if (record$1(defaults) && defaults["rust-version"] !== void 0) rustFloor(defaults["rust-version"]);
2202
2207
  const pkg = parsed["package"];
2203
2208
  const version = record$1(pkg) ? pkg["rust-version"] : void 0;
2204
- if (version !== void 0) if (!record$1(version)) rustFloor(version);
2205
- else {
2206
- let inherited;
2207
- if (version["workspace"] === true && record$1(pkg)) {
2208
- const explicit = pkg["workspace"];
2209
- let directory = path.posix.dirname(file);
2210
- const explicitPath = typeof explicit === "string" && !explicit.includes("\\") && !explicit.includes(":") && !explicit.includes("${{") && !path.posix.isAbsolute(explicit) ? path.posix.normalize(path.posix.join(directory, explicit)) : void 0;
2211
- if (explicit === void 0 || explicitPath !== void 0 && explicitPath !== ".." && !explicitPath.startsWith("../")) {
2212
- if (explicitPath !== void 0) directory = explicitPath;
2213
- while (true) {
2214
- const table = readManifest(path.posix.join(directory, "Cargo.toml"))?.["workspace"];
2215
- if (record$1(table)) {
2216
- const fields = table["package"];
2217
- inherited = record$1(fields) ? fields["rust-version"] : void 0;
2218
- break;
2209
+ if (version !== void 0) {
2210
+ if (!record$1(version)) rustFloor(version);
2211
+ else {
2212
+ let inherited;
2213
+ if (version["workspace"] === true && record$1(pkg)) {
2214
+ const explicit = pkg["workspace"];
2215
+ let directory = path.posix.dirname(file);
2216
+ const explicitPath = typeof explicit === "string" && !explicit.includes("\\") && !explicit.includes(":") && !explicit.includes("${{") && !path.posix.isAbsolute(explicit) ? path.posix.normalize(path.posix.join(directory, explicit)) : void 0;
2217
+ if (explicit === void 0 || explicitPath !== void 0 && explicitPath !== ".." && !explicitPath.startsWith("../")) {
2218
+ if (explicitPath !== void 0) directory = explicitPath;
2219
+ while (true) {
2220
+ const table = readManifest(path.posix.join(directory, "Cargo.toml"))?.["workspace"];
2221
+ if (record$1(table)) {
2222
+ const fields = table["package"];
2223
+ inherited = record$1(fields) ? fields["rust-version"] : void 0;
2224
+ break;
2225
+ }
2226
+ if (explicit !== void 0 || directory === ".") break;
2227
+ directory = path.posix.dirname(directory);
2219
2228
  }
2220
- if (explicit !== void 0 || directory === ".") break;
2221
- directory = path.posix.dirname(directory);
2222
2229
  }
2223
2230
  }
2231
+ rustFloor(inherited);
2224
2232
  }
2225
- rustFloor(inherited);
2226
2233
  }
2227
2234
  }
2228
2235
  }
@@ -2843,9 +2850,10 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2843
2850
  for (let index = start + 3; index < value.length; index++) {
2844
2851
  const character = value.at(index);
2845
2852
  if (quote !== void 0) {
2846
- if (character === quote) if (quote === "'" && value.at(index + 1) === "'") index++;
2847
- else quote = void 0;
2848
- else if (quote === "\"" && character === "\\") index++;
2853
+ if (character === quote) {
2854
+ if (quote === "'" && value.at(index + 1) === "'") index++;
2855
+ else quote = void 0;
2856
+ } else if (quote === "\"" && character === "\\") index++;
2849
2857
  continue;
2850
2858
  }
2851
2859
  if (character === "'" || character === "\"") quote = character;
@@ -3339,26 +3347,42 @@ const checkToolchain = ({ root, policy, onDelegated }) => {
3339
3347
  line: 1,
3340
3348
  message: "cloud setup script requires an explicit cloud declaration in stll-toolchain.json"
3341
3349
  });
3342
- if (cloud !== void 0) try {
3343
- const nodeVersion = files[".node-version"];
3344
- if (nodeVersion === void 0) throw new Error("cloud setup requires a tracked root .node-version with an exact stable release");
3345
- if (script !== generateCloudSetup({
3346
- policy,
3347
- cloud,
3348
- nodeVersion: nodeVersion.trim()
3349
- })) diagnostics.push({
3350
+ if (cloud !== void 0) {
3351
+ if (!hasCloudSessionStartHook(files[".claude/settings.json"])) diagnostics.push({
3350
3352
  rule: "cloud-setup-drift",
3351
- path: cloudSetupPath,
3353
+ path: cloudClaudeSettingsPath,
3352
3354
  line: 1,
3353
- message: "cloud setup script is missing or differs from shared policy; run stll-cloud-setup"
3355
+ message: `tracked Claude cloud SessionStart hook is missing, disabled or differs from shared policy; run stll-cloud-setup; if automatic merge is unsafe, ${cloudSessionStartFix}`
3354
3356
  });
3355
- } catch (error) {
3356
- diagnostics.push({
3357
+ if (!hasCloudAttribution(files[".claude/settings.json"])) diagnostics.push({
3357
3358
  rule: "cloud-setup-drift",
3358
- path: cloudSetupPath,
3359
+ path: cloudClaudeSettingsPath,
3359
3360
  line: 1,
3360
- message: error instanceof Error ? error.message : String(error)
3361
+ message: `tracked Claude attribution is missing or differs from shared policy; run stll-cloud-setup; if automatic merge is unsafe, ${cloudAttributionFix}`
3361
3362
  });
3363
+ try {
3364
+ const nodeVersion = files[".node-version"];
3365
+ if (nodeVersion === void 0) throw new Error("cloud setup requires a tracked root .node-version with an exact stable release");
3366
+ if (script !== generateCloudSetup({
3367
+ policy,
3368
+ cloud,
3369
+ nodeVersion: nodeVersion.trim(),
3370
+ files,
3371
+ rustExceptions: configuration.rustExceptions
3372
+ })) diagnostics.push({
3373
+ rule: "cloud-setup-drift",
3374
+ path: cloudSetupPath,
3375
+ line: 1,
3376
+ message: "cloud setup script is missing or differs from shared policy; run stll-cloud-setup"
3377
+ });
3378
+ } catch (error) {
3379
+ diagnostics.push({
3380
+ rule: "cloud-setup-drift",
3381
+ path: cloudSetupPath,
3382
+ line: 1,
3383
+ message: error instanceof Error ? error.message : String(error)
3384
+ });
3385
+ }
3362
3386
  }
3363
3387
  const exercisedFloors = /* @__PURE__ */ new Set();
3364
3388
  const mismatchedFloors = /* @__PURE__ */ new Set();