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