@stll/oxlint-config 1.9.0 → 2.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.
- package/README.md +110 -63
- package/dist/cloud-setup-cli.cjs +1 -2
- package/dist/cloud-setup-cli.cjs.map +1 -1
- package/dist/cloud-setup-cli.mjs +1 -2
- package/dist/cloud-setup-cli.mjs.map +1 -1
- package/dist/consumer-node-support.cjs +2 -2
- package/dist/consumer-node-support.mjs +1 -1
- package/dist/dependabot.d.cts +8 -19
- package/dist/dependabot.d.mts +8 -19
- package/dist/publish-artifact-syntax.cjs +1 -1
- package/dist/publish-artifact-syntax.mjs +1 -1
- package/dist/publish-contract-cli.cjs +1 -1
- package/dist/publish-contract-cli.mjs +1 -1
- package/dist/quarantine-cli.cjs +2 -1
- package/dist/quarantine-cli.cjs.map +1 -1
- package/dist/quarantine-cli.mjs +3 -2
- package/dist/quarantine-cli.mjs.map +1 -1
- package/dist/quarantine-policy.d.cts +25 -2
- package/dist/quarantine-policy.d.mts +25 -2
- package/dist/quarantine-policy2.cjs +177 -5
- package/dist/quarantine-policy2.cjs.map +1 -1
- package/dist/quarantine-policy2.mjs +166 -6
- package/dist/quarantine-policy2.mjs.map +1 -1
- package/dist/rust-policy-cli.cjs +481 -0
- package/dist/rust-policy-cli.cjs.map +1 -0
- package/dist/rust-policy-cli.mjs +479 -0
- package/dist/rust-policy-cli.mjs.map +1 -0
- package/dist/toolchain-changed-cli.cjs +1477 -2
- package/dist/toolchain-changed-cli.cjs.map +1 -1
- package/dist/toolchain-changed-cli.mjs +1474 -1
- package/dist/toolchain-changed-cli.mjs.map +1 -1
- package/dist/toolchain-check-cli.cjs +2 -0
- package/dist/toolchain-check-cli.cjs.map +1 -1
- package/dist/toolchain-check-cli.mjs +2 -0
- package/dist/toolchain-check-cli.mjs.map +1 -1
- package/dist/toolchain-dependabot.cjs +1 -1
- package/dist/toolchain-dependabot.mjs +2 -2
- package/dist/toolchain-dependabot.mjs.map +1 -1
- package/dist/toolchain-guard.cjs +353 -244
- package/dist/toolchain-guard.cjs.map +1 -1
- package/dist/toolchain-guard.mjs +348 -245
- package/dist/toolchain-guard.mjs.map +1 -1
- package/dist/toolchain-inputs.cjs +108 -56
- package/dist/toolchain-inputs.cjs.map +1 -1
- package/dist/toolchain-inputs.mjs +102 -56
- package/dist/toolchain-inputs.mjs.map +1 -1
- package/dist/toolchain-schema.cjs +8 -46
- package/dist/toolchain-schema.cjs.map +1 -1
- package/dist/toolchain-schema.mjs +8 -46
- package/dist/toolchain-schema.mjs.map +1 -1
- package/dist/typecheck-probe-cli.cjs +40 -2
- package/dist/typecheck-probe-cli.cjs.map +1 -1
- package/dist/typecheck-probe-cli.mjs +39 -1
- package/dist/typecheck-probe-cli.mjs.map +1 -1
- package/package.json +4 -4
- package/toolchain.json +13 -27
- package/dist/toolchain-bun.cjs +0 -34
- package/dist/toolchain-bun.cjs.map +0 -1
- package/dist/toolchain-bun.mjs +0 -23
- package/dist/toolchain-bun.mjs.map +0 -1
- package/dist/toolchain-changed.cjs +0 -1484
- package/dist/toolchain-changed.cjs.map +0 -1
- package/dist/toolchain-changed.mjs +0 -1477
- package/dist/toolchain-changed.mjs.map +0 -1
- package/dist/typecheck-parity-cli.cjs +0 -71
- package/dist/typecheck-parity-cli.cjs.map +0 -1
- package/dist/typecheck-parity-cli.mjs +0 -71
- package/dist/typecheck-parity-cli.mjs.map +0 -1
- package/dist/typecheck-parity.cjs +0 -908
- package/dist/typecheck-parity.cjs.map +0 -1
- package/dist/typecheck-parity.mjs +0 -897
- package/dist/typecheck-parity.mjs.map +0 -1
- /package/dist/{typecheck-parity-cli.d.cts → rust-policy-cli.d.cts} +0 -0
- /package/dist/{typecheck-parity-cli.d.mts → rust-policy-cli.d.mts} +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { parse } from "smol-toml";
|
|
3
|
+
import picomatch from "picomatch";
|
|
3
4
|
import { createHash } from "node:crypto";
|
|
4
5
|
import { subset, valid, validRange } from "semver";
|
|
5
6
|
import { isDeepStrictEqual } from "node:util";
|
|
6
7
|
import { parseDocument } from "yaml";
|
|
7
|
-
import picomatch from "picomatch";
|
|
8
8
|
//#region src/cloud-setup-install.ts
|
|
9
9
|
const packageInstall = String.raw`
|
|
10
10
|
# Prevent package maintainer scripts from starting unmanaged system services.
|
|
@@ -39,20 +39,20 @@ apt_install() (
|
|
|
39
39
|
policy_state=installed
|
|
40
40
|
printf '%s\n' '#!/bin/sh' 'exit 101' > /usr/sbin/policy-rc.d
|
|
41
41
|
chmod 755 /usr/sbin/policy-rc.d
|
|
42
|
-
|
|
42
|
+
# The network deadline covers downloads only; unpacking and maintainer scripts
|
|
43
|
+
# (for example locale generation or cluster creation) run offline afterwards.
|
|
44
|
+
DEBIAN_FRONTEND=noninteractive apt_network install -y --no-install-recommends --download-only "$@"
|
|
45
|
+
local package pending
|
|
43
46
|
for package in "$@"; do
|
|
44
47
|
if [[ "$package" == */* ]]; then
|
|
45
|
-
# apt
|
|
46
|
-
#
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
# apt rejects --no-download for local archives, so prove instead that
|
|
49
|
+
# only local file: archives remain; --print-uris reads local state only.
|
|
50
|
+
pending="$(set -o pipefail; DEBIAN_FRONTEND=noninteractive apt-get --print-uris -qq -y --no-install-recommends install "$@" | awk '$1 !~ /^\047file:/')"
|
|
51
|
+
[[ -z "$pending" ]] || fail "Package downloads remain after the bounded download step: $pending"
|
|
52
|
+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends "$@"
|
|
50
53
|
return
|
|
51
54
|
fi
|
|
52
55
|
done
|
|
53
|
-
# The network deadline covers downloads only; unpacking and maintainer scripts
|
|
54
|
-
# (for example locale generation or cluster creation) run offline afterwards.
|
|
55
|
-
DEBIAN_FRONTEND=noninteractive apt_network install -y --no-install-recommends --download-only "$@"
|
|
56
56
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-download "$@"
|
|
57
57
|
)
|
|
58
58
|
|
|
@@ -334,6 +334,28 @@ apt_refresh_for() {
|
|
|
334
334
|
}
|
|
335
335
|
`;
|
|
336
336
|
//#endregion
|
|
337
|
+
//#region src/archive-pins.ts
|
|
338
|
+
const record$3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
339
|
+
/** Parse a map from exact releases to their amd64 and arm64 archive SHA256 values. */
|
|
340
|
+
const parseArchiveSha256 = (input, label) => {
|
|
341
|
+
if (input === void 0) return {};
|
|
342
|
+
if (!record$3(input)) throw new Error(`${label} must be a version map`);
|
|
343
|
+
const releases = {};
|
|
344
|
+
for (const [version, value] of Object.entries(input)) {
|
|
345
|
+
if (valid(version) !== version || !record$3(value)) throw new Error(`${label} requires exact release keys`);
|
|
346
|
+
const keys = Object.keys(value);
|
|
347
|
+
if (keys.length !== 2 || !keys.includes("amd64") || !keys.includes("arm64")) throw new Error(`${label} ${version} requires amd64 and arm64 pins`);
|
|
348
|
+
const amd64 = value["amd64"];
|
|
349
|
+
const arm64 = value["arm64"];
|
|
350
|
+
if (typeof amd64 !== "string" || typeof arm64 !== "string" || !/^[a-f0-9]{64}$/.test(amd64) || !/^[a-f0-9]{64}$/.test(arm64)) throw new Error(`${label} ${version} requires lowercase SHA256 pins`);
|
|
351
|
+
releases[version] = {
|
|
352
|
+
amd64,
|
|
353
|
+
arm64
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
return releases;
|
|
357
|
+
};
|
|
358
|
+
//#endregion
|
|
337
359
|
//#region src/cloud-setup-artifacts.ts
|
|
338
360
|
const wasmBindgen0126 = {
|
|
339
361
|
version: "0.2.126",
|
|
@@ -547,6 +569,20 @@ const parseTools = (input) => {
|
|
|
547
569
|
}
|
|
548
570
|
return result;
|
|
549
571
|
};
|
|
572
|
+
const cloudRuntimes = ["node", "bun"];
|
|
573
|
+
const parseRuntimeArchives = (input) => {
|
|
574
|
+
if (input === void 0) return void 0;
|
|
575
|
+
if (!object(input) || Object.keys(input).some((key) => !cloudRuntimes.some((runtime) => runtime === key))) throw new Error("cloud.runtimeArchiveSha256 accepts only node and bun");
|
|
576
|
+
const result = {};
|
|
577
|
+
for (const runtime of cloudRuntimes) {
|
|
578
|
+
if (!Object.hasOwn(input, runtime)) continue;
|
|
579
|
+
const label = `cloud.runtimeArchiveSha256.${runtime}`;
|
|
580
|
+
const pins = parseArchiveSha256(input[runtime], label);
|
|
581
|
+
if (Object.keys(pins).length !== 1) throw new Error(`${label} pins exactly one release`);
|
|
582
|
+
result[runtime] = pins;
|
|
583
|
+
}
|
|
584
|
+
return result;
|
|
585
|
+
};
|
|
550
586
|
const cloudInstallCommand = "bun install --frozen-lockfile";
|
|
551
587
|
const cloudInstallCommands = [cloudInstallCommand, `${cloudInstallCommand} --ignore-scripts`];
|
|
552
588
|
const cloudInstall = (value) => cloudInstallCommands.some((command) => value === command);
|
|
@@ -575,14 +611,18 @@ const parsePrepare = (input) => {
|
|
|
575
611
|
const parseCloudSetup = (input) => {
|
|
576
612
|
if (input === void 0) return void 0;
|
|
577
613
|
if (typeof input !== "object" || input === null || Array.isArray(input)) throw new Error("cloud must be an object");
|
|
578
|
-
for (const key of Object.keys(input)) if (key !== "services" && key !== "install" && key !== "envFile" && key !== "rust" && key !== "tools" && key !== "prepare") throw new Error(`unsupported cloud key: ${key}`);
|
|
614
|
+
for (const key of Object.keys(input)) if (key !== "services" && key !== "install" && key !== "envFile" && key !== "rust" && key !== "tools" && key !== "prepare" && key !== "submodules" && key !== "runtimeArchiveSha256") throw new Error(`unsupported cloud key: ${key}`);
|
|
579
615
|
const rust = parseRust("rust" in input ? input.rust : void 0);
|
|
580
616
|
const tools = parseTools("tools" in input ? input.tools : void 0);
|
|
581
617
|
const prepare = parsePrepare("prepare" in input ? input.prepare : void 0);
|
|
618
|
+
const runtimeArchiveSha256 = parseRuntimeArchives("runtimeArchiveSha256" in input ? input.runtimeArchiveSha256 : void 0);
|
|
619
|
+
const submodules = "submodules" in input ? input.submodules : false;
|
|
620
|
+
if (typeof submodules !== "boolean") throw new Error("cloud.submodules must be a boolean when provided");
|
|
582
621
|
const extensions = {
|
|
583
622
|
...rust === void 0 ? {} : { rust },
|
|
584
623
|
...tools === void 0 ? {} : { tools },
|
|
585
|
-
...prepare === void 0 ? {} : { prepare }
|
|
624
|
+
...prepare === void 0 ? {} : { prepare },
|
|
625
|
+
...runtimeArchiveSha256 === void 0 ? {} : { runtimeArchiveSha256 }
|
|
586
626
|
};
|
|
587
627
|
const selected = "services" in input ? input.services : [];
|
|
588
628
|
if (!Array.isArray(selected)) throw new Error("cloud.services must be an array when provided");
|
|
@@ -599,6 +639,7 @@ const parseCloudSetup = (input) => {
|
|
|
599
639
|
return {
|
|
600
640
|
services,
|
|
601
641
|
install,
|
|
642
|
+
...submodules ? { submodules } : {},
|
|
602
643
|
...extensions,
|
|
603
644
|
...services.length === 0 ? {} : { envFile: parseEnvFile(input) }
|
|
604
645
|
};
|
|
@@ -1144,15 +1185,13 @@ NODE_DIR="/opt/stll-cloud/node/$NODE_VERSION"
|
|
|
1144
1185
|
BUN_DIR="/opt/stll-cloud/bun/$BUN_VERSION"
|
|
1145
1186
|
export PATH="$NODE_DIR/bin:$BUN_DIR:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
1146
1187
|
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"
|
|
1149
1188
|
@ENV_ASSIGNMENTS@
|
|
1150
1189
|
[[ -f "$REPO_ROOT/.node-version" && ! -L "$REPO_ROOT/.node-version" ]] || fail 'A regular root .node-version is required'
|
|
1151
1190
|
[[ "$(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'
|
|
1152
1191
|
cd -- "$REPO_ROOT"
|
|
1153
1192
|
case "$(uname -m)" in
|
|
1154
|
-
x86_64) ARCH=amd64; NODE_ARCH=x64; BUN_ARCH=x64 ;;
|
|
1155
|
-
aarch64|arm64) ARCH=arm64; NODE_ARCH=arm64; BUN_ARCH=aarch64 ;;
|
|
1193
|
+
x86_64) ARCH=amd64; NODE_ARCH=x64; BUN_ARCH=x64; NODE_SHA256='@NODE_AMD64_SHA@'; BUN_SHA256='@BUN_AMD64_SHA@' ;;
|
|
1194
|
+
aarch64|arm64) ARCH=arm64; NODE_ARCH=arm64; BUN_ARCH=aarch64; NODE_SHA256='@NODE_ARM64_SHA@'; BUN_SHA256='@BUN_ARM64_SHA@' ;;
|
|
1156
1195
|
*) fail 'Only amd64 and arm64 are supported' ;;
|
|
1157
1196
|
esac
|
|
1158
1197
|
|
|
@@ -1246,6 +1285,7 @@ install_runtimes() (
|
|
|
1246
1285
|
if ! node_ready; then
|
|
1247
1286
|
node_archive="node-v$NODE_VERSION-linux-$NODE_ARCH.tar.xz"
|
|
1248
1287
|
download_file "https://nodejs.org/dist/v$NODE_VERSION/$node_archive" "$scratch/$node_archive" 120
|
|
1288
|
+
(cd "$scratch"; printf '%s %s\n' "$NODE_SHA256" "$node_archive" | sha256sum --strict -c -)
|
|
1249
1289
|
download_file "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt" "$scratch/node-sums" 45
|
|
1250
1290
|
(cd "$scratch"; awk -v name="$node_archive" '$2 == name { print; count++ } END { if (count != 1) exit 1 }' node-sums | sha256sum --strict -c -)
|
|
1251
1291
|
install -d -m 755 "$NODE_DIR"
|
|
@@ -1255,6 +1295,7 @@ install_runtimes() (
|
|
|
1255
1295
|
bun_folder="bun-linux-$BUN_ARCH"
|
|
1256
1296
|
bun_archive="$bun_folder.zip"
|
|
1257
1297
|
download_file "https://github.com/oven-sh/bun/releases/download/bun-v$BUN_VERSION/$bun_archive" "$scratch/$bun_archive" 120
|
|
1298
|
+
(cd "$scratch"; printf '%s %s\n' "$BUN_SHA256" "$bun_archive" | sha256sum --strict -c -)
|
|
1258
1299
|
download_file "https://github.com/oven-sh/bun/releases/download/bun-v$BUN_VERSION/SHASUMS256.txt" "$scratch/bun-sums" 45
|
|
1259
1300
|
(cd "$scratch"; awk -v name="$bun_archive" '$2 == name || $2 == "*" name { print $1 " " name; count++ } END { if (count != 1) exit 1 }' bun-sums | sha256sum --strict -c -)
|
|
1260
1301
|
unzip -q "$scratch/$bun_archive" -d "$scratch/bun"
|
|
@@ -1305,49 +1346,16 @@ process.stdout.write([...hosts].sort().join(","));
|
|
|
1305
1346
|
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@
|
|
1306
1347
|
}
|
|
1307
1348
|
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
sha256sum -- bun.lock | cut -d ' ' -f1
|
|
1311
|
-
}
|
|
1312
|
-
prepare_dependency_state() {
|
|
1313
|
-
[[ ! -L "$DEPENDENCY_STATE_ROOT" ]] || fail 'Dependency state root must not be a symlink'
|
|
1314
|
-
if [[ -e "$DEPENDENCY_STATE_ROOT" ]]; then
|
|
1315
|
-
[[ -d "$DEPENDENCY_STATE_ROOT" && "$(stat -c '%u:%a' "$DEPENDENCY_STATE_ROOT")" == 0:755 ]] || fail 'Invalid dependency state root'
|
|
1316
|
-
else
|
|
1317
|
-
install -d -m 755 -o root -g root "$DEPENDENCY_STATE_ROOT"
|
|
1318
|
-
fi
|
|
1319
|
-
[[ ! -L "$DEPENDENCY_STAMP" ]] || fail 'Dependency stamp must not be a symlink'
|
|
1320
|
-
if [[ -e "$DEPENDENCY_STAMP" ]]; then
|
|
1321
|
-
[[ -f "$DEPENDENCY_STAMP" && "$(stat -c '%u:%a' "$DEPENDENCY_STAMP")" == 0:644 ]] || fail 'Invalid dependency stamp'
|
|
1322
|
-
fi
|
|
1323
|
-
}
|
|
1324
|
-
write_dependency_stamp() {
|
|
1325
|
-
local temporary
|
|
1326
|
-
prepare_dependency_state
|
|
1327
|
-
temporary="$(mktemp "$DEPENDENCY_STATE_ROOT/.dependencies.XXXXXX")"
|
|
1328
|
-
chmod 644 "$temporary"
|
|
1329
|
-
dependency_hash > "$temporary"
|
|
1330
|
-
mv -f -- "$temporary" "$DEPENDENCY_STAMP"
|
|
1331
|
-
}
|
|
1349
|
+
# The frozen install is the check: it reads every input the package manager
|
|
1350
|
+
# uses and changes nothing on a current tree, so no stamp stands in for it.
|
|
1332
1351
|
install_dependencies() {
|
|
1333
|
-
prepare_dependency_state
|
|
1334
|
-
rm -f -- "$DEPENDENCY_STAMP"
|
|
1335
1352
|
dependency_install
|
|
1336
|
-
write_dependency_stamp
|
|
1337
1353
|
}
|
|
1338
1354
|
sync_dependencies() {
|
|
1339
|
-
local expected installed=''
|
|
1340
|
-
prepare_dependency_state
|
|
1341
|
-
expected="$(dependency_hash)"
|
|
1342
|
-
if [[ -f "$DEPENDENCY_STAMP" ]]; then IFS= read -r installed < "$DEPENDENCY_STAMP" || true; fi
|
|
1343
|
-
# The stamp describes an installation; without node_modules there is none.
|
|
1344
|
-
[[ "$installed" == "$expected" && -d "$REPO_ROOT/node_modules" ]] && return
|
|
1345
|
-
rm -f -- "$DEPENDENCY_STAMP"
|
|
1346
1355
|
dependency_install || fail 'bun.lock mismatch; dependency installation failed'
|
|
1347
|
-
write_dependency_stamp
|
|
1348
1356
|
}
|
|
1349
1357
|
|
|
1350
|
-
@SERVICE_INSTALL@
|
|
1358
|
+
@SUBMODULE_FUNCTION@@SERVICE_INSTALL@
|
|
1351
1359
|
@SERVICE_START@
|
|
1352
1360
|
|
|
1353
1361
|
@TOOL_INSTALL@
|
|
@@ -1367,7 +1375,7 @@ if [[ "$MODE" == install ]]; then
|
|
|
1367
1375
|
step shell install_shell_environment
|
|
1368
1376
|
# Login routes read the installed profile, so they are checked after it.
|
|
1369
1377
|
step routes verify_bun_routes
|
|
1370
|
-
step dependencies install_dependencies
|
|
1378
|
+
@SUBMODULE_STEP@ step dependencies install_dependencies
|
|
1371
1379
|
@PREPARE_STEP@
|
|
1372
1380
|
exit 0
|
|
1373
1381
|
fi
|
|
@@ -1491,11 +1499,40 @@ const renderPrepare = (prepare, files) => {
|
|
|
1491
1499
|
"}"
|
|
1492
1500
|
].join("\n");
|
|
1493
1501
|
};
|
|
1502
|
+
const runtimeArchiveManifests = {
|
|
1503
|
+
node: (version) => `https://nodejs.org/dist/v${version}/SHASUMS256.txt`,
|
|
1504
|
+
bun: (version) => `https://github.com/oven-sh/bun/releases/download/bun-v${version}/SHASUMS256.txt`
|
|
1505
|
+
};
|
|
1506
|
+
const runtimeArchivePins = ({ runtime, version, shared, declared }) => {
|
|
1507
|
+
const key = `cloud.runtimeArchiveSha256.${runtime}`;
|
|
1508
|
+
const sharedPins = shared[version];
|
|
1509
|
+
if (declared !== void 0) {
|
|
1510
|
+
if (sharedPins !== void 0) throw new Error(`the shared policy pins ${runtime} ${version} archives; remove ${key}`);
|
|
1511
|
+
const pins = declared[version];
|
|
1512
|
+
if (pins === void 0) throw new Error(`${key} pins ${Object.keys(declared).join(", ")}, but the repository selects ${runtime} ${version}; update it with the amd64 and arm64 values from ${runtimeArchiveManifests[runtime](version)}`);
|
|
1513
|
+
return pins;
|
|
1514
|
+
}
|
|
1515
|
+
if (sharedPins === void 0) throw new Error(`the shared policy has no ${runtime} ${version} archive SHA256 pins; declare ${key} for ${version} with the amd64 and arm64 values from ${runtimeArchiveManifests[runtime](version)}`);
|
|
1516
|
+
return sharedPins;
|
|
1517
|
+
};
|
|
1494
1518
|
const generateCloudSetup = ({ policy, cloud, nodeVersion, files = {}, rustExceptions = [] }) => {
|
|
1495
1519
|
const selected = parseCloudSetup(cloud);
|
|
1496
1520
|
if (selected === void 0) throw new Error("cloud declaration is required");
|
|
1497
1521
|
const exactNode = nodeVersion.trim();
|
|
1498
1522
|
if (valid(exactNode) !== exactNode || !nodeSelectorMatches(exactNode, policy.node)) throw new Error("cloud requires a tracked exact .node-version within the shared Node series");
|
|
1523
|
+
const bunVersion = policy.bun;
|
|
1524
|
+
const nodeArchiveSha256 = runtimeArchivePins({
|
|
1525
|
+
runtime: "node",
|
|
1526
|
+
version: exactNode,
|
|
1527
|
+
shared: policy.nodeArchiveSha256,
|
|
1528
|
+
declared: selected.runtimeArchiveSha256?.node
|
|
1529
|
+
});
|
|
1530
|
+
const bunArchiveSha256 = runtimeArchivePins({
|
|
1531
|
+
runtime: "bun",
|
|
1532
|
+
version: bunVersion,
|
|
1533
|
+
shared: policy.bunArchiveSha256,
|
|
1534
|
+
declared: selected.runtimeArchiveSha256?.bun
|
|
1535
|
+
});
|
|
1499
1536
|
const toolchains = resolveCloudToolchains({
|
|
1500
1537
|
cloud: selected,
|
|
1501
1538
|
files,
|
|
@@ -1508,7 +1545,7 @@ const generateCloudSetup = ({ policy, cloud, nodeVersion, files = {}, rustExcept
|
|
|
1508
1545
|
["@NETWORK@", renderCloudNetwork()],
|
|
1509
1546
|
["@TOOL_INSTALL@", renderCloudToolInstall(toolchains) + renderCloudShellInstall({
|
|
1510
1547
|
nodeVersion: exactNode,
|
|
1511
|
-
bunVersion
|
|
1548
|
+
bunVersion,
|
|
1512
1549
|
rust: toolchains.rust
|
|
1513
1550
|
})],
|
|
1514
1551
|
["@INPUT_VALIDATION@", ["rust-toolchain.toml", "rust-toolchain"].flatMap((file) => {
|
|
@@ -1517,8 +1554,12 @@ const generateCloudSetup = ({ policy, cloud, nodeVersion, files = {}, rustExcept
|
|
|
1517
1554
|
const hash = createHash("sha256").update(content).digest("hex");
|
|
1518
1555
|
return [`[[ -f ${shellQuote(file)} && ! -L ${shellQuote(file)} ]] && [[ "$(sha256sum -- ${shellQuote(file)} | cut -d ' ' -f1)" == ${shellQuote(hash)} ]] || fail ${shellQuote(`${file} changed; regenerate cloud-setup.sh`)}`];
|
|
1519
1556
|
}).concat(selected.tools?.["wasm-bindgen-cli"] === void 0 ? [] : [renderWasmBindgenLockValidation(selected.tools["wasm-bindgen-cli"])]).join("\n")],
|
|
1520
|
-
["@BUN@",
|
|
1557
|
+
["@BUN@", bunVersion],
|
|
1521
1558
|
["@NODE@", exactNode],
|
|
1559
|
+
["@NODE_AMD64_SHA@", nodeArchiveSha256.amd64],
|
|
1560
|
+
["@NODE_ARM64_SHA@", nodeArchiveSha256.arm64],
|
|
1561
|
+
["@BUN_AMD64_SHA@", bunArchiveSha256.amd64],
|
|
1562
|
+
["@BUN_ARM64_SHA@", bunArchiveSha256.arm64],
|
|
1522
1563
|
["@ENV_ASSIGNMENTS@", selected.envFile === void 0 ? "" : `ENV_FILE=${shellQuote(selected.envFile)}\nENV_MARKER=${shellQuote(cloudEnvironmentMarker)}`],
|
|
1523
1564
|
["@ENV_FUNCTIONS@", selected.envFile === void 0 ? "" : environmentFunctions],
|
|
1524
1565
|
["@ENVIRONMENT_VALUES@", selected.services.length === 0 ? "" : environmentValuesFunction],
|
|
@@ -1528,6 +1569,11 @@ const generateCloudSetup = ({ policy, cloud, nodeVersion, files = {}, rustExcept
|
|
|
1528
1569
|
["@SESSION_ENVIRONMENT_CALL@", selected.services.length === 0 ? "" : "if [[ \"$MODE\" == session ]]; then emit_session_environment; fi"],
|
|
1529
1570
|
["@ENV_WRITE@", selected.envFile === void 0 ? "" : "write_environment"],
|
|
1530
1571
|
["@PREPARE_FUNCTION@", renderPrepare(selected.prepare, files)],
|
|
1572
|
+
["@SUBMODULE_FUNCTION@", selected.submodules ? String.raw`install_submodules() {
|
|
1573
|
+
network_run github.com 240 runuser -u "$OUTPUT_USER" -- env HOME="$OUTPUT_HOME" git submodule sync --recursive
|
|
1574
|
+
network_run github.com 240 runuser -u "$OUTPUT_USER" -- env HOME="$OUTPUT_HOME" git submodule update --init --recursive --depth 1
|
|
1575
|
+
}`.concat("\n\n") : ""],
|
|
1576
|
+
["@SUBMODULE_STEP@", selected.submodules ? " step submodules install_submodules\n" : ""],
|
|
1531
1577
|
["@PREPARE_STEP@", selected.prepare === void 0 ? "" : " step prepare prepare_sources"],
|
|
1532
1578
|
["@SERVICE_INSTALL@", renderCloudServiceInstall({
|
|
1533
1579
|
services,
|
|
@@ -1975,6 +2021,6 @@ const toolchainInputKind = (file, text = "") => {
|
|
|
1975
2021
|
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";
|
|
1976
2022
|
};
|
|
1977
2023
|
//#endregion
|
|
1978
|
-
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 };
|
|
2024
|
+
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, parseArchiveSha256 as k, 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 };
|
|
1979
2025
|
|
|
1980
2026
|
//# sourceMappingURL=toolchain-inputs.mjs.map
|