@stll/oxlint-config 1.0.2 → 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 (49) 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.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 +19 -14
  24. package/dist/toolchain-changed.cjs.map +1 -1
  25. package/dist/toolchain-changed.mjs +21 -16
  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 +66 -50
  30. package/dist/toolchain-guard.cjs.map +1 -1
  31. package/dist/toolchain-guard.mjs +73 -57
  32. package/dist/toolchain-guard.mjs.map +1 -1
  33. package/dist/toolchain-inputs.cjs +670 -32
  34. package/dist/toolchain-inputs.cjs.map +1 -1
  35. package/dist/toolchain-inputs.mjs +647 -33
  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 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
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.1.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,
@@ -2108,7 +2111,7 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2108
2111
  };
2109
2112
  const toml = (rule) => {
2110
2113
  try {
2111
- return parse$2(text);
2114
+ return parse$1(text);
2112
2115
  } catch {
2113
2116
  add({
2114
2117
  rule,
@@ -2190,7 +2193,7 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2190
2193
  if (candidate === file) return parsed;
2191
2194
  if (!trackedFiles.has(candidate)) return void 0;
2192
2195
  try {
2193
- return parse$2(readFile(candidate) ?? "");
2196
+ return parse$1(readFile(candidate) ?? "");
2194
2197
  } catch {
2195
2198
  return;
2196
2199
  }
@@ -2201,28 +2204,30 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2201
2204
  if (record$1(defaults) && defaults["rust-version"] !== void 0) rustFloor(defaults["rust-version"]);
2202
2205
  const pkg = parsed["package"];
2203
2206
  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;
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);
2219
2226
  }
2220
- if (explicit !== void 0 || directory === ".") break;
2221
- directory = path.posix.dirname(directory);
2222
2227
  }
2223
2228
  }
2229
+ rustFloor(inherited);
2224
2230
  }
2225
- rustFloor(inherited);
2226
2231
  }
2227
2232
  }
2228
2233
  }
@@ -2843,9 +2848,10 @@ const checkRuntimeFile = ({ file, text, policy, trackedFiles, readFile, reposito
2843
2848
  for (let index = start + 3; index < value.length; index++) {
2844
2849
  const character = value.at(index);
2845
2850
  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++;
2851
+ if (character === quote) {
2852
+ if (quote === "'" && value.at(index + 1) === "'") index++;
2853
+ else quote = void 0;
2854
+ } else if (quote === "\"" && character === "\\") index++;
2849
2855
  continue;
2850
2856
  }
2851
2857
  if (character === "'" || character === "\"") quote = character;
@@ -3339,26 +3345,36 @@ const checkToolchain = ({ root, policy, onDelegated }) => {
3339
3345
  line: 1,
3340
3346
  message: "cloud setup script requires an explicit cloud declaration in stll-toolchain.json"
3341
3347
  });
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({
3348
+ if (cloud !== void 0) {
3349
+ if (!hasCloudSessionStartHook(files[".claude/settings.json"])) diagnostics.push({
3350
3350
  rule: "cloud-setup-drift",
3351
- path: cloudSetupPath,
3351
+ path: cloudClaudeSettingsPath,
3352
3352
  line: 1,
3353
- message: "cloud setup script is missing or differs from shared policy; run stll-cloud-setup"
3354
- });
3355
- } catch (error) {
3356
- diagnostics.push({
3357
- rule: "cloud-setup-drift",
3358
- path: cloudSetupPath,
3359
- line: 1,
3360
- 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}`
3361
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
+ }
3362
3378
  }
3363
3379
  const exercisedFloors = /* @__PURE__ */ new Set();
3364
3380
  const mismatchedFloors = /* @__PURE__ */ new Set();