@stll/oxlint-config 1.6.2 → 1.7.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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/cloud-setup-cli.mjs +1 -1
  3. package/dist/consumer-compat-cli.cjs.map +1 -1
  4. package/dist/consumer-compat-cli.mjs.map +1 -1
  5. package/dist/consumer-node-support.mjs +1 -1
  6. package/dist/dependabot.d.cts +10 -0
  7. package/dist/dependabot.d.mts +10 -0
  8. package/dist/engine-support-cli.cjs.map +1 -1
  9. package/dist/engine-support-cli.mjs.map +1 -1
  10. package/dist/git-tracked-output.cjs.map +1 -1
  11. package/dist/git-tracked-output.mjs.map +1 -1
  12. package/dist/publish-artifact-syntax.cjs.map +1 -1
  13. package/dist/publish-artifact-syntax.mjs.map +1 -1
  14. package/dist/publish-build-target-vite-dts-helper2.cjs.map +1 -1
  15. package/dist/publish-build-target-vite-dts-helper2.mjs.map +1 -1
  16. package/dist/publish-contract-cli.cjs.map +1 -1
  17. package/dist/publish-contract-cli.mjs.map +1 -1
  18. package/dist/quarantine-policy2.cjs.map +1 -1
  19. package/dist/quarantine-policy2.mjs.map +1 -1
  20. package/dist/toolchain-changed.cjs +1 -3
  21. package/dist/toolchain-changed.cjs.map +1 -1
  22. package/dist/toolchain-changed.mjs +2 -4
  23. package/dist/toolchain-changed.mjs.map +1 -1
  24. package/dist/toolchain-dependabot.cjs.map +1 -1
  25. package/dist/toolchain-dependabot.mjs +1 -1
  26. package/dist/toolchain-dependabot.mjs.map +1 -1
  27. package/dist/toolchain-guard.cjs +11 -4
  28. package/dist/toolchain-guard.cjs.map +1 -1
  29. package/dist/toolchain-guard.mjs +12 -5
  30. package/dist/toolchain-guard.mjs.map +1 -1
  31. package/dist/toolchain-inputs.cjs +99 -9
  32. package/dist/toolchain-inputs.cjs.map +1 -1
  33. package/dist/toolchain-inputs.mjs +88 -10
  34. package/dist/toolchain-inputs.mjs.map +1 -1
  35. package/dist/toolchain-schema.cjs +179 -1
  36. package/dist/toolchain-schema.cjs.map +1 -1
  37. package/dist/toolchain-schema.mjs +167 -3
  38. package/dist/toolchain-schema.mjs.map +1 -1
  39. package/dist/typecheck-parity.cjs.map +1 -1
  40. package/dist/typecheck-parity.mjs.map +1 -1
  41. package/dist/wasi-loader-normalizer-cli.cjs.map +1 -1
  42. package/dist/wasi-loader-normalizer-cli.mjs.map +1 -1
  43. package/package.json +2 -4
  44. package/toolchain.json +54 -12
@@ -1144,6 +1144,8 @@ NODE_DIR="/opt/stll-cloud/node/$NODE_VERSION"
1144
1144
  BUN_DIR="/opt/stll-cloud/bun/$BUN_VERSION"
1145
1145
  export PATH="$NODE_DIR/bin:$BUN_DIR:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
1146
1146
  BUN_CACHE="/var/cache/stll-cloud/bun/$OUTPUT_UID"
1147
+ DEPENDENCY_STATE_ROOT=/var/lib/stll-cloud
1148
+ DEPENDENCY_STAMP="$DEPENDENCY_STATE_ROOT/dependencies-$(printf '%s' "$REPO_ROOT" | sha256sum | cut -d' ' -f1).sha256"
1147
1149
  @ENV_ASSIGNMENTS@
1148
1150
  [[ -f "$REPO_ROOT/.node-version" && ! -L "$REPO_ROOT/.node-version" ]] || fail 'A regular root .node-version is required'
1149
1151
  [[ "$(awk 'NF { if (++count > 1 || NF != 1) exit 1; value=$1 } END { if (count != 1) exit 1; print value }' "$REPO_ROOT/.node-version")" == "$NODE_VERSION" ]] || fail 'Node selector changed; regenerate cloud-setup.sh'
@@ -1301,6 +1303,47 @@ process.stdout.write([...hosts].sort().join(","));
1301
1303
  network_run "$download_hosts" 240 runuser -u "$OUTPUT_USER" -- env HOME="$OUTPUT_HOME" BUN_INSTALL_CACHE_DIR="$BUN_CACHE" PATH="$PATH" BUN_CONFIG_HTTP_IDLE_TIMEOUT=20 "$BUN_DIR/bun" @INSTALL_ARGS@
1302
1304
  }
1303
1305
 
1306
+ dependency_hash() {
1307
+ [[ -f bun.lock && ! -L bun.lock ]] || fail 'A regular root bun.lock is required'
1308
+ sha256sum -- bun.lock | cut -d ' ' -f1
1309
+ }
1310
+ prepare_dependency_state() {
1311
+ [[ ! -L "$DEPENDENCY_STATE_ROOT" ]] || fail 'Dependency state root must not be a symlink'
1312
+ if [[ -e "$DEPENDENCY_STATE_ROOT" ]]; then
1313
+ [[ -d "$DEPENDENCY_STATE_ROOT" && "$(stat -c '%u:%a' "$DEPENDENCY_STATE_ROOT")" == 0:755 ]] || fail 'Invalid dependency state root'
1314
+ else
1315
+ install -d -m 755 -o root -g root "$DEPENDENCY_STATE_ROOT"
1316
+ fi
1317
+ [[ ! -L "$DEPENDENCY_STAMP" ]] || fail 'Dependency stamp must not be a symlink'
1318
+ if [[ -e "$DEPENDENCY_STAMP" ]]; then
1319
+ [[ -f "$DEPENDENCY_STAMP" && "$(stat -c '%u:%a' "$DEPENDENCY_STAMP")" == 0:644 ]] || fail 'Invalid dependency stamp'
1320
+ fi
1321
+ }
1322
+ write_dependency_stamp() {
1323
+ local temporary
1324
+ prepare_dependency_state
1325
+ temporary="$(mktemp "$DEPENDENCY_STATE_ROOT/.dependencies.XXXXXX")"
1326
+ chmod 644 "$temporary"
1327
+ dependency_hash > "$temporary"
1328
+ mv -f -- "$temporary" "$DEPENDENCY_STAMP"
1329
+ }
1330
+ install_dependencies() {
1331
+ prepare_dependency_state
1332
+ rm -f -- "$DEPENDENCY_STAMP"
1333
+ dependency_install
1334
+ write_dependency_stamp
1335
+ }
1336
+ sync_dependencies() {
1337
+ local expected installed=''
1338
+ prepare_dependency_state
1339
+ expected="$(dependency_hash)"
1340
+ if [[ -f "$DEPENDENCY_STAMP" ]]; then IFS= read -r installed < "$DEPENDENCY_STAMP" || true; fi
1341
+ [[ "$installed" == "$expected" ]] && return
1342
+ rm -f -- "$DEPENDENCY_STAMP"
1343
+ dependency_install || fail 'bun.lock mismatch; dependency installation failed'
1344
+ write_dependency_stamp
1345
+ }
1346
+
1304
1347
  @SERVICE_INSTALL@
1305
1348
  @SERVICE_START@
1306
1349
 
@@ -1319,13 +1362,14 @@ if [[ "$MODE" == install ]]; then
1319
1362
  step services install_services
1320
1363
  step tools install_tools
1321
1364
  step shell install_shell_environment
1322
- step dependencies dependency_install
1365
+ step dependencies install_dependencies
1323
1366
  @PREPARE_STEP@
1324
1367
  exit 0
1325
1368
  fi
1326
1369
  @ENV_INITIALIZE@
1327
1370
  start_environment() {
1328
1371
  step runtime-check runtime_ready
1372
+ step dependencies sync_dependencies
1329
1373
  step tool-check verify_tools
1330
1374
  step shell install_shell_environment
1331
1375
  step shell-check verify_shell_environment
@@ -1391,6 +1435,39 @@ emit_session_environment() {
1391
1435
  }
1392
1436
  `;
1393
1437
  const shellQuote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
1438
+ const renderWasmBindgenLockValidation = (version) => `[[ -f 'Cargo.lock' && ! -L 'Cargo.lock' ]] && awk -v expected=${shellQuote(version)} '${String.raw`
1439
+ function validate_package() {
1440
+ if (in_package && name == "wasm-bindgen") {
1441
+ count++
1442
+ if (version != expected) mismatch = 1
1443
+ }
1444
+ }
1445
+ /^\[\[package\]\][[:space:]]*$/ {
1446
+ validate_package()
1447
+ in_package = 1
1448
+ name = ""
1449
+ version = ""
1450
+ next
1451
+ }
1452
+ /^\[/ {
1453
+ validate_package()
1454
+ in_package = 0
1455
+ next
1456
+ }
1457
+ in_package && /^[[:space:]]*name[[:space:]]*=/ {
1458
+ name = $0
1459
+ sub(/^[^=]*=[[:space:]]*"/, "", name)
1460
+ sub(/"[[:space:]]*$/, "", name)
1461
+ }
1462
+ in_package && /^[[:space:]]*version[[:space:]]*=/ {
1463
+ version = $0
1464
+ sub(/^[^=]*=[[:space:]]*"/, "", version)
1465
+ sub(/"[[:space:]]*$/, "", version)
1466
+ }
1467
+ END {
1468
+ validate_package()
1469
+ exit !(count >= 1 && !mismatch)
1470
+ }`}' 'Cargo.lock' || fail 'Cargo.lock wasm-bindgen version changed; regenerate cloud-setup.sh'`;
1394
1471
  const renderPrepare = (prepare, files) => {
1395
1472
  if (prepare === void 0) return "";
1396
1473
  const manifest = files["package.json"];
@@ -1429,16 +1506,12 @@ const generateCloudSetup = ({ policy, cloud, nodeVersion, files = {}, rustExcept
1429
1506
  bunVersion: policy.bun,
1430
1507
  rust: toolchains.rust
1431
1508
  })],
1432
- ["@INPUT_VALIDATION@", [
1433
- "rust-toolchain.toml",
1434
- "rust-toolchain",
1435
- ...selected.tools?.["wasm-bindgen-cli"] === void 0 ? [] : ["Cargo.lock"]
1436
- ].flatMap((file) => {
1509
+ ["@INPUT_VALIDATION@", ["rust-toolchain.toml", "rust-toolchain"].flatMap((file) => {
1437
1510
  const content = files[file];
1438
1511
  if (content === void 0) return [`[[ ! -e ${shellQuote(file)} && ! -L ${shellQuote(file)} ]] || fail ${shellQuote(`${file} appeared; regenerate cloud-setup.sh`)}`];
1439
1512
  const hash = createHash("sha256").update(content).digest("hex");
1440
1513
  return [`[[ -f ${shellQuote(file)} && ! -L ${shellQuote(file)} ]] && [[ "$(sha256sum -- ${shellQuote(file)} | cut -d ' ' -f1)" == ${shellQuote(hash)} ]] || fail ${shellQuote(`${file} changed; regenerate cloud-setup.sh`)}`];
1441
- }).join("\n")],
1514
+ }).concat(selected.tools?.["wasm-bindgen-cli"] === void 0 ? [] : [renderWasmBindgenLockValidation(selected.tools["wasm-bindgen-cli"])]).join("\n")],
1442
1515
  ["@BUN@", policy.bun],
1443
1516
  ["@NODE@", exactNode],
1444
1517
  ["@ENV_ASSIGNMENTS@", selected.envFile === void 0 ? "" : `ENV_FILE=${shellQuote(selected.envFile)}\nENV_MARKER=${shellQuote(cloudEnvironmentMarker)}`],
@@ -1834,17 +1907,22 @@ const isDockerDefinitionPath = (file) => {
1834
1907
  if (/\.(?:[cm]?[jt]sx?|mdx?|rst|txt|html?|py|rs|go|java|sh|c|cc|cpp|cxx|h|hpp|cs|rb|php|swift|kt|css|scss)$/i.test(name)) return false;
1835
1908
  return /^(?:[^./]+\.)*(?:dockerfile|containerfile)(?:\.[^./]+)*$/i.test(name);
1836
1909
  };
1910
+ const isFormatterConfigPath = (file) => {
1911
+ const name = file.split("/").at(-1) ?? "";
1912
+ return /^\.oxfmtrc(?:\.jsonc?)?$/.test(name) || /^oxfmt\.config\.[cm]?[jt]s$/.test(name) || /^\.prettierrc(?:\.[^/]+)?$/.test(name) || /^prettier\.config\.[cm]?[jt]s$/.test(name) || name === ".prettierignore" || /^biome\.jsonc?$/.test(name) || /^\.?dprint\.jsonc?$/.test(name);
1913
+ };
1914
+ const isLefthookConfigPath = (file) => /^\.?lefthook(?:-local)?\.ya?ml$/.test(file);
1837
1915
  /** Executable shell files may have no suffix; the interpreter is then their discriminator. */
1838
1916
  const isShellScript = (file, text = "") => !excludedInputPath(file) && (/\.(?:sh|bash|zsh)$/.test(file) || /^#![ \t]*(?:\/(?:[^ \t\r\n]+\/)*(?:bash|dash|ksh|zsh|sh)|\/usr\/bin\/env[ \t]+(?:-S[ \t]+)?(?:bash|dash|ksh|zsh|sh))(?=[ \t\r\n]|$)/.test(text));
1839
1917
  /** Lockfiles establish ecosystem presence without reading their dependency graphs. */
1840
1918
  const toolchainInputKind = (file, text = "") => {
1841
- if (file === "bunfig.toml" || file === ".agents/cloud-setup.sh" || file === ".claude/settings.json" || file === "Cargo.lock") return "config";
1919
+ if (file === "bunfig.toml" || file === ".agents/cloud-setup.sh" || file === ".claude/settings.json" || file === "Cargo.lock" || file === ".changeset/config.json" || isLefthookConfigPath(file)) return "config";
1842
1920
  if (githubAutomationFileKind(file) !== void 0) return "config";
1843
1921
  if (excludedInputPath(file)) return void 0;
1844
- if (dependabotManifestEcosystem(file) !== void 0 || pythonDependencyManifestKind(file) === "pipfile-lock" || javascriptDependencyLockfiles.some((name) => file.split("/").at(-1) === name) || /(?:^|\/)uv\.lock$/.test(file)) return "presence";
1922
+ if (dependabotManifestEcosystem(file) !== void 0 || pythonDependencyManifestKind(file) === "pipfile-lock" || javascriptDependencyLockfiles.some((name) => file.split("/").at(-1) === name) || /(?:^|\/)uv\.lock$/.test(file) || isFormatterConfigPath(file)) return "presence";
1845
1923
  if (githubAutomationFileKind(file) !== void 0 || isShellScript(file, text) || /(?:^|\/)ci-service-images\.json$/.test(file) || isMiseConfigPath(file) || isPythonDependencyManifest(file) || isDockerDefinitionPath(file) || isComposeDefinitionPath(file) || isKubernetesDefinitionPath(file) || /(?:^|\/)(?:package\.json|consumer-compat\.json|pnpm-workspace\.yaml|stll-toolchain\.json|\.bun-version|\.node-version|\.nvmrc|\.python-version|rust-toolchain(?:\.toml)?|\.tool-versions|\.?mise\.toml|uv\.toml|\.uv\.toml|\.github\/dependabot\.ya?ml|Cargo\.toml)$/.test(file)) return "config";
1846
1924
  };
1847
1925
  //#endregion
1848
- export { nodePolicyValid as C, parseCloudSetup as E, generateCloudSetup as S, nodeSupportRangeMatches as T, cloudSessionStartFix as _, isMiseConfigPath as a, mergeCloudClaudeSettings as b, javascriptDependencyLockfiles as c, containerDocumentImages as d, isComposeDefinitionPath as f, cloudClaudeSettingsPath as g, cloudAttributionFix as h, isDockerDefinitionPath as i, pythonDependencyManifestKind as l, workspaceContains as m, githubAutomationFileKind as n, isPythonDependencyManifest as o, isKubernetesDefinitionPath as p, isDependabotGithubActionsPath as r, isShellScript as s, dependabotManifestEcosystem as t, toolchainInputKind as u, hasCloudAttribution as v, nodeSelectorMatches as w, cloudSetupPath as x, hasCloudSessionStartHook as y };
1926
+ export { cloudSetupPath as C, nodeSupportRangeMatches as D, nodeSelectorMatches as E, parseCloudSetup as O, mergeCloudClaudeSettings as S, nodePolicyValid as T, cloudAttributionFix as _, isFormatterConfigPath as a, hasCloudAttribution as b, isPythonDependencyManifest as c, pythonDependencyManifestKind as d, toolchainInputKind as f, workspaceContains as g, isKubernetesDefinitionPath as h, isDockerDefinitionPath as i, isShellScript as l, isComposeDefinitionPath as m, githubAutomationFileKind as n, isLefthookConfigPath as o, containerDocumentImages as p, isDependabotGithubActionsPath as r, isMiseConfigPath as s, dependabotManifestEcosystem as t, javascriptDependencyLockfiles as u, cloudClaudeSettingsPath as v, generateCloudSetup as w, hasCloudSessionStartHook as x, cloudSessionStartFix as y };
1849
1927
 
1850
1928
  //# sourceMappingURL=toolchain-inputs.mjs.map