@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
@@ -1147,6 +1147,8 @@ NODE_DIR="/opt/stll-cloud/node/$NODE_VERSION"
1147
1147
  BUN_DIR="/opt/stll-cloud/bun/$BUN_VERSION"
1148
1148
  export PATH="$NODE_DIR/bin:$BUN_DIR:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
1149
1149
  BUN_CACHE="/var/cache/stll-cloud/bun/$OUTPUT_UID"
1150
+ DEPENDENCY_STATE_ROOT=/var/lib/stll-cloud
1151
+ DEPENDENCY_STAMP="$DEPENDENCY_STATE_ROOT/dependencies-$(printf '%s' "$REPO_ROOT" | sha256sum | cut -d' ' -f1).sha256"
1150
1152
  @ENV_ASSIGNMENTS@
1151
1153
  [[ -f "$REPO_ROOT/.node-version" && ! -L "$REPO_ROOT/.node-version" ]] || fail 'A regular root .node-version is required'
1152
1154
  [[ "$(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'
@@ -1304,6 +1306,47 @@ process.stdout.write([...hosts].sort().join(","));
1304
1306
  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@
1305
1307
  }
1306
1308
 
1309
+ dependency_hash() {
1310
+ [[ -f bun.lock && ! -L bun.lock ]] || fail 'A regular root bun.lock is required'
1311
+ sha256sum -- bun.lock | cut -d ' ' -f1
1312
+ }
1313
+ prepare_dependency_state() {
1314
+ [[ ! -L "$DEPENDENCY_STATE_ROOT" ]] || fail 'Dependency state root must not be a symlink'
1315
+ if [[ -e "$DEPENDENCY_STATE_ROOT" ]]; then
1316
+ [[ -d "$DEPENDENCY_STATE_ROOT" && "$(stat -c '%u:%a' "$DEPENDENCY_STATE_ROOT")" == 0:755 ]] || fail 'Invalid dependency state root'
1317
+ else
1318
+ install -d -m 755 -o root -g root "$DEPENDENCY_STATE_ROOT"
1319
+ fi
1320
+ [[ ! -L "$DEPENDENCY_STAMP" ]] || fail 'Dependency stamp must not be a symlink'
1321
+ if [[ -e "$DEPENDENCY_STAMP" ]]; then
1322
+ [[ -f "$DEPENDENCY_STAMP" && "$(stat -c '%u:%a' "$DEPENDENCY_STAMP")" == 0:644 ]] || fail 'Invalid dependency stamp'
1323
+ fi
1324
+ }
1325
+ write_dependency_stamp() {
1326
+ local temporary
1327
+ prepare_dependency_state
1328
+ temporary="$(mktemp "$DEPENDENCY_STATE_ROOT/.dependencies.XXXXXX")"
1329
+ chmod 644 "$temporary"
1330
+ dependency_hash > "$temporary"
1331
+ mv -f -- "$temporary" "$DEPENDENCY_STAMP"
1332
+ }
1333
+ install_dependencies() {
1334
+ prepare_dependency_state
1335
+ rm -f -- "$DEPENDENCY_STAMP"
1336
+ dependency_install
1337
+ write_dependency_stamp
1338
+ }
1339
+ sync_dependencies() {
1340
+ local expected installed=''
1341
+ prepare_dependency_state
1342
+ expected="$(dependency_hash)"
1343
+ if [[ -f "$DEPENDENCY_STAMP" ]]; then IFS= read -r installed < "$DEPENDENCY_STAMP" || true; fi
1344
+ [[ "$installed" == "$expected" ]] && return
1345
+ rm -f -- "$DEPENDENCY_STAMP"
1346
+ dependency_install || fail 'bun.lock mismatch; dependency installation failed'
1347
+ write_dependency_stamp
1348
+ }
1349
+
1307
1350
  @SERVICE_INSTALL@
1308
1351
  @SERVICE_START@
1309
1352
 
@@ -1322,13 +1365,14 @@ if [[ "$MODE" == install ]]; then
1322
1365
  step services install_services
1323
1366
  step tools install_tools
1324
1367
  step shell install_shell_environment
1325
- step dependencies dependency_install
1368
+ step dependencies install_dependencies
1326
1369
  @PREPARE_STEP@
1327
1370
  exit 0
1328
1371
  fi
1329
1372
  @ENV_INITIALIZE@
1330
1373
  start_environment() {
1331
1374
  step runtime-check runtime_ready
1375
+ step dependencies sync_dependencies
1332
1376
  step tool-check verify_tools
1333
1377
  step shell install_shell_environment
1334
1378
  step shell-check verify_shell_environment
@@ -1394,6 +1438,39 @@ emit_session_environment() {
1394
1438
  }
1395
1439
  `;
1396
1440
  const shellQuote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
1441
+ const renderWasmBindgenLockValidation = (version) => `[[ -f 'Cargo.lock' && ! -L 'Cargo.lock' ]] && awk -v expected=${shellQuote(version)} '${String.raw`
1442
+ function validate_package() {
1443
+ if (in_package && name == "wasm-bindgen") {
1444
+ count++
1445
+ if (version != expected) mismatch = 1
1446
+ }
1447
+ }
1448
+ /^\[\[package\]\][[:space:]]*$/ {
1449
+ validate_package()
1450
+ in_package = 1
1451
+ name = ""
1452
+ version = ""
1453
+ next
1454
+ }
1455
+ /^\[/ {
1456
+ validate_package()
1457
+ in_package = 0
1458
+ next
1459
+ }
1460
+ in_package && /^[[:space:]]*name[[:space:]]*=/ {
1461
+ name = $0
1462
+ sub(/^[^=]*=[[:space:]]*"/, "", name)
1463
+ sub(/"[[:space:]]*$/, "", name)
1464
+ }
1465
+ in_package && /^[[:space:]]*version[[:space:]]*=/ {
1466
+ version = $0
1467
+ sub(/^[^=]*=[[:space:]]*"/, "", version)
1468
+ sub(/"[[:space:]]*$/, "", version)
1469
+ }
1470
+ END {
1471
+ validate_package()
1472
+ exit !(count >= 1 && !mismatch)
1473
+ }`}' 'Cargo.lock' || fail 'Cargo.lock wasm-bindgen version changed; regenerate cloud-setup.sh'`;
1397
1474
  const renderPrepare = (prepare, files) => {
1398
1475
  if (prepare === void 0) return "";
1399
1476
  const manifest = files["package.json"];
@@ -1432,16 +1509,12 @@ const generateCloudSetup = ({ policy, cloud, nodeVersion, files = {}, rustExcept
1432
1509
  bunVersion: policy.bun,
1433
1510
  rust: toolchains.rust
1434
1511
  })],
1435
- ["@INPUT_VALIDATION@", [
1436
- "rust-toolchain.toml",
1437
- "rust-toolchain",
1438
- ...selected.tools?.["wasm-bindgen-cli"] === void 0 ? [] : ["Cargo.lock"]
1439
- ].flatMap((file) => {
1512
+ ["@INPUT_VALIDATION@", ["rust-toolchain.toml", "rust-toolchain"].flatMap((file) => {
1440
1513
  const content = files[file];
1441
1514
  if (content === void 0) return [`[[ ! -e ${shellQuote(file)} && ! -L ${shellQuote(file)} ]] || fail ${shellQuote(`${file} appeared; regenerate cloud-setup.sh`)}`];
1442
1515
  const hash = (0, node_crypto.createHash)("sha256").update(content).digest("hex");
1443
1516
  return [`[[ -f ${shellQuote(file)} && ! -L ${shellQuote(file)} ]] && [[ "$(sha256sum -- ${shellQuote(file)} | cut -d ' ' -f1)" == ${shellQuote(hash)} ]] || fail ${shellQuote(`${file} changed; regenerate cloud-setup.sh`)}`];
1444
- }).join("\n")],
1517
+ }).concat(selected.tools?.["wasm-bindgen-cli"] === void 0 ? [] : [renderWasmBindgenLockValidation(selected.tools["wasm-bindgen-cli"])]).join("\n")],
1445
1518
  ["@BUN@", policy.bun],
1446
1519
  ["@NODE@", exactNode],
1447
1520
  ["@ENV_ASSIGNMENTS@", selected.envFile === void 0 ? "" : `ENV_FILE=${shellQuote(selected.envFile)}\nENV_MARKER=${shellQuote(cloudEnvironmentMarker)}`],
@@ -1837,14 +1910,19 @@ const isDockerDefinitionPath = (file) => {
1837
1910
  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;
1838
1911
  return /^(?:[^./]+\.)*(?:dockerfile|containerfile)(?:\.[^./]+)*$/i.test(name);
1839
1912
  };
1913
+ const isFormatterConfigPath = (file) => {
1914
+ const name = file.split("/").at(-1) ?? "";
1915
+ 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);
1916
+ };
1917
+ const isLefthookConfigPath = (file) => /^\.?lefthook(?:-local)?\.ya?ml$/.test(file);
1840
1918
  /** Executable shell files may have no suffix; the interpreter is then their discriminator. */
1841
1919
  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));
1842
1920
  /** Lockfiles establish ecosystem presence without reading their dependency graphs. */
1843
1921
  const toolchainInputKind = (file, text = "") => {
1844
- if (file === "bunfig.toml" || file === ".agents/cloud-setup.sh" || file === ".claude/settings.json" || file === "Cargo.lock") return "config";
1922
+ if (file === "bunfig.toml" || file === ".agents/cloud-setup.sh" || file === ".claude/settings.json" || file === "Cargo.lock" || file === ".changeset/config.json" || isLefthookConfigPath(file)) return "config";
1845
1923
  if (githubAutomationFileKind(file) !== void 0) return "config";
1846
1924
  if (excludedInputPath(file)) return void 0;
1847
- if (dependabotManifestEcosystem(file) !== void 0 || pythonDependencyManifestKind(file) === "pipfile-lock" || javascriptDependencyLockfiles.some((name) => file.split("/").at(-1) === name) || /(?:^|\/)uv\.lock$/.test(file)) return "presence";
1925
+ 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";
1848
1926
  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";
1849
1927
  };
1850
1928
  //#endregion
@@ -1926,12 +2004,24 @@ Object.defineProperty(exports, "isDockerDefinitionPath", {
1926
2004
  return isDockerDefinitionPath;
1927
2005
  }
1928
2006
  });
2007
+ Object.defineProperty(exports, "isFormatterConfigPath", {
2008
+ enumerable: true,
2009
+ get: function() {
2010
+ return isFormatterConfigPath;
2011
+ }
2012
+ });
1929
2013
  Object.defineProperty(exports, "isKubernetesDefinitionPath", {
1930
2014
  enumerable: true,
1931
2015
  get: function() {
1932
2016
  return isKubernetesDefinitionPath;
1933
2017
  }
1934
2018
  });
2019
+ Object.defineProperty(exports, "isLefthookConfigPath", {
2020
+ enumerable: true,
2021
+ get: function() {
2022
+ return isLefthookConfigPath;
2023
+ }
2024
+ });
1935
2025
  Object.defineProperty(exports, "isMiseConfigPath", {
1936
2026
  enumerable: true,
1937
2027
  get: function() {