@stll/oxlint-config 1.8.0 → 1.9.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 +6 -4
- package/dist/cloud-setup-cli.cjs +6 -1
- package/dist/cloud-setup-cli.cjs.map +1 -1
- package/dist/cloud-setup-cli.mjs +6 -1
- package/dist/cloud-setup-cli.mjs.map +1 -1
- package/dist/toolchain-bun.cjs +34 -0
- package/dist/toolchain-bun.cjs.map +1 -0
- package/dist/toolchain-bun.mjs +23 -0
- package/dist/toolchain-bun.mjs.map +1 -0
- package/dist/toolchain-guard.cjs +8 -3
- package/dist/toolchain-guard.cjs.map +1 -1
- package/dist/toolchain-guard.mjs +8 -3
- package/dist/toolchain-guard.mjs.map +1 -1
- package/dist/toolchain-schema.cjs +67 -2
- package/dist/toolchain-schema.cjs.map +1 -1
- package/dist/toolchain-schema.mjs +67 -3
- package/dist/toolchain-schema.mjs.map +1 -1
- package/dist/typecheck-parity.cjs +2 -1
- package/dist/typecheck-parity.cjs.map +1 -1
- package/dist/typecheck-parity.mjs +2 -1
- package/dist/typecheck-parity.mjs.map +1 -1
- package/package.json +1 -1
- package/toolchain.json +1 -1
package/README.md
CHANGED
|
@@ -75,10 +75,12 @@ Shared-pin Dependabot ignores must contain only `dependency-name` and
|
|
|
75
75
|
`version-update:semver-minor`, and `version-update:semver-patch`. This ignores
|
|
76
76
|
version updates while preserving security update pull requests.
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
files, and mise/asdf
|
|
78
|
+
The policy's `bun` value is the minimum Bun. Set `packageManager` to `bun@`
|
|
79
|
+
followed by one exact release at or above it, and pin `bun-types` to that same
|
|
80
|
+
release. Dependency pins can live in default or named catalogs, including
|
|
81
|
+
Bun's `workspaces` catalogs. Bun image tags, version files, and mise/asdf
|
|
82
|
+
entries also inherit the repository's pin, so a repository can take a newer
|
|
83
|
+
Bun without a policy release.
|
|
82
84
|
|
|
83
85
|
Configure `oven-sh/setup-bun` with a tracked manifest as its version source:
|
|
84
86
|
|
package/dist/cloud-setup-cli.cjs
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_generated_file = require("./generated-file.cjs");
|
|
4
4
|
const require_toolchain_inputs = require("./toolchain-inputs.cjs");
|
|
5
|
+
const require_toolchain_bun = require("./toolchain-bun.cjs");
|
|
5
6
|
const require_toolchain_guard = require("./toolchain-guard.cjs");
|
|
6
7
|
const require_toolchain_schema = require("./toolchain-schema.cjs");
|
|
7
8
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -56,7 +57,11 @@ const main = async () => {
|
|
|
56
57
|
if (cloud === void 0) throw new Error("requires an explicit cloud declaration");
|
|
57
58
|
const nodeVersion = files[".node-version"];
|
|
58
59
|
if (nodeVersion === void 0) throw new Error("requires tracked root .node-version");
|
|
59
|
-
const
|
|
60
|
+
const sharedPolicy = require_toolchain_schema.parseToolchainPolicy(JSON.parse(await (0, node_fs_promises.readFile)(new URL("../toolchain.json", require("url").pathToFileURL(__filename).href), "utf8")));
|
|
61
|
+
const policy = {
|
|
62
|
+
...sharedPolicy,
|
|
63
|
+
bun: require_toolchain_bun.repositoryBun(sharedPolicy.bun, files["package.json"])
|
|
64
|
+
};
|
|
60
65
|
const script = require_toolchain_inputs.generateCloudSetup({
|
|
61
66
|
policy,
|
|
62
67
|
cloud,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-setup-cli.cjs","names":["checkGeneratedOutput","open","constants","cloudClaudeSettingsPath","cloudSessionStartFix","realpath","readToolchainInputs","join","cloudSetupPath","generationDiagnostics","parseToolchainConfiguration","parseToolchainPolicy","readFile","generateCloudSetup","mergeCloudClaudeSettings","writeGeneratedFile"],"sources":["../src/cloud-setup-cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { constants } from \"node:fs\";\nimport { open, readFile, realpath } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport { cloudSetupPath, generateCloudSetup } from \"./cloud-setup\";\nimport {\n cloudClaudeSettingsPath,\n cloudSessionStartFix,\n mergeCloudClaudeSettings,\n} from \"./cloud-setup-claude\";\nimport {\n checkGeneratedOutput,\n generationDiagnostics,\n writeGeneratedFile,\n} from \"./generated-file\";\nimport {\n parseToolchainConfiguration,\n readToolchainInputs,\n} from \"./toolchain-guard\";\nimport { parseToolchainPolicy } from \"./toolchain-schema\";\n\nconst usage =\n \"Usage: stll-cloud-setup (run from repository root)\\n stll-cloud-setup --help\";\nconst readClaudeSettings = async (destination: string) => {\n try {\n if ((await checkGeneratedOutput(destination)) === undefined)\n return undefined;\n const input = await open(\n destination,\n constants.O_RDONLY | constants.O_NOFOLLOW,\n );\n try {\n const opened = await input.stat();\n if (!opened.isFile() || opened.nlink !== 1)\n throw new Error(\n \"settings must be a single-link regular repository file\",\n );\n return { text: await input.readFile(\"utf8\"), mode: opened.mode & 0o777 };\n } finally {\n await input.close();\n }\n } catch (error) {\n throw new Error(\n `cannot safely merge ${cloudClaudeSettingsPath}: ${error instanceof Error ? error.message : String(error)}; ${cloudSessionStartFix}`,\n );\n }\n};\n\nconst main = async () => {\n const args = process.argv.slice(2);\n if (args.length === 1 && args.at(0) === \"--help\") {\n process.stdout.write(`${usage}\\n`);\n return;\n }\n if (args.length !== 0) throw new Error(usage);\n const root = await realpath(process.cwd());\n const { files, diagnostics } = readToolchainInputs(root);\n const destination = join(root, cloudSetupPath);\n const settingsDestination = join(root, cloudClaudeSettingsPath);\n // Validate settings separately to retain actionable merge diagnostics.\n const settings = await readClaudeSettings(settingsDestination);\n const remainingDiagnostics = await generationDiagnostics({\n diagnostics,\n outputs: [\n { relative: cloudSetupPath, destination },\n { relative: cloudClaudeSettingsPath, destination: settingsDestination },\n ],\n });\n if (remainingDiagnostics.length > 0)\n throw new Error(\n remainingDiagnostics\n .map(\n ({ path, message }) =>\n `${path}: ${message}${path === cloudClaudeSettingsPath ? `; ${cloudSessionStartFix}` : \"\"}`,\n )\n .join(\"\\n\"),\n );\n const text = files[\"stll-toolchain.json\"];\n if (text === undefined)\n throw new Error(\"requires tracked stll-toolchain.json\");\n const { cloud, rustExceptions } = parseToolchainConfiguration(\n JSON.parse(text),\n );\n if (cloud === undefined)\n throw new Error(\"requires an explicit cloud declaration\");\n const nodeVersion = files[\".node-version\"];\n if (nodeVersion === undefined)\n throw new Error(\"requires tracked root .node-version\");\n const
|
|
1
|
+
{"version":3,"file":"cloud-setup-cli.cjs","names":["checkGeneratedOutput","open","constants","cloudClaudeSettingsPath","cloudSessionStartFix","realpath","readToolchainInputs","join","cloudSetupPath","generationDiagnostics","parseToolchainConfiguration","parseToolchainPolicy","readFile","repositoryBun","generateCloudSetup","mergeCloudClaudeSettings","writeGeneratedFile"],"sources":["../src/cloud-setup-cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { constants } from \"node:fs\";\nimport { open, readFile, realpath } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport { cloudSetupPath, generateCloudSetup } from \"./cloud-setup\";\nimport {\n cloudClaudeSettingsPath,\n cloudSessionStartFix,\n mergeCloudClaudeSettings,\n} from \"./cloud-setup-claude\";\nimport {\n checkGeneratedOutput,\n generationDiagnostics,\n writeGeneratedFile,\n} from \"./generated-file\";\nimport { repositoryBun } from \"./toolchain-bun\";\nimport {\n parseToolchainConfiguration,\n readToolchainInputs,\n} from \"./toolchain-guard\";\nimport { parseToolchainPolicy } from \"./toolchain-schema\";\n\nconst usage =\n \"Usage: stll-cloud-setup (run from repository root)\\n stll-cloud-setup --help\";\nconst readClaudeSettings = async (destination: string) => {\n try {\n if ((await checkGeneratedOutput(destination)) === undefined)\n return undefined;\n const input = await open(\n destination,\n constants.O_RDONLY | constants.O_NOFOLLOW,\n );\n try {\n const opened = await input.stat();\n if (!opened.isFile() || opened.nlink !== 1)\n throw new Error(\n \"settings must be a single-link regular repository file\",\n );\n return { text: await input.readFile(\"utf8\"), mode: opened.mode & 0o777 };\n } finally {\n await input.close();\n }\n } catch (error) {\n throw new Error(\n `cannot safely merge ${cloudClaudeSettingsPath}: ${error instanceof Error ? error.message : String(error)}; ${cloudSessionStartFix}`,\n );\n }\n};\n\nconst main = async () => {\n const args = process.argv.slice(2);\n if (args.length === 1 && args.at(0) === \"--help\") {\n process.stdout.write(`${usage}\\n`);\n return;\n }\n if (args.length !== 0) throw new Error(usage);\n const root = await realpath(process.cwd());\n const { files, diagnostics } = readToolchainInputs(root);\n const destination = join(root, cloudSetupPath);\n const settingsDestination = join(root, cloudClaudeSettingsPath);\n // Validate settings separately to retain actionable merge diagnostics.\n const settings = await readClaudeSettings(settingsDestination);\n const remainingDiagnostics = await generationDiagnostics({\n diagnostics,\n outputs: [\n { relative: cloudSetupPath, destination },\n { relative: cloudClaudeSettingsPath, destination: settingsDestination },\n ],\n });\n if (remainingDiagnostics.length > 0)\n throw new Error(\n remainingDiagnostics\n .map(\n ({ path, message }) =>\n `${path}: ${message}${path === cloudClaudeSettingsPath ? `; ${cloudSessionStartFix}` : \"\"}`,\n )\n .join(\"\\n\"),\n );\n const text = files[\"stll-toolchain.json\"];\n if (text === undefined)\n throw new Error(\"requires tracked stll-toolchain.json\");\n const { cloud, rustExceptions } = parseToolchainConfiguration(\n JSON.parse(text),\n );\n if (cloud === undefined)\n throw new Error(\"requires an explicit cloud declaration\");\n const nodeVersion = files[\".node-version\"];\n if (nodeVersion === undefined)\n throw new Error(\"requires tracked root .node-version\");\n const sharedPolicy = parseToolchainPolicy(\n JSON.parse(\n await readFile(new URL(\"../toolchain.json\", import.meta.url), \"utf8\"),\n ),\n );\n const policy = {\n ...sharedPolicy,\n bun: repositoryBun(sharedPolicy.bun, files[\"package.json\"]),\n };\n const script = generateCloudSetup({\n policy,\n cloud,\n nodeVersion: nodeVersion.trim(),\n files,\n rustExceptions,\n });\n const mergedSettings = mergeCloudClaudeSettings(settings?.text);\n await writeGeneratedFile({ destination, text: script, mode: 0o755 });\n if (mergedSettings !== settings?.text)\n await writeGeneratedFile({\n destination: settingsDestination,\n text: mergedSettings,\n mode: settings?.mode ?? 0o644,\n });\n process.stdout.write(\n `Generated ${cloudSetupPath} and ${cloudClaudeSettingsPath}\\n`,\n );\n};\n\nmain().catch((error: unknown) => {\n process.stderr.write(\n `cloud-setup: ${error instanceof Error ? error.message : String(error)}\\n`,\n );\n process.exitCode = 1;\n});\n"],"mappings":";;;;;;;;;;;AAuBA,MAAM,QACJ;AACF,MAAM,qBAAqB,OAAO,gBAAwB;CACxD,IAAI;EACF,IAAK,MAAMA,uBAAAA,qBAAqB,WAAW,MAAO,KAAA,GAChD,OAAO,KAAA;EACT,MAAM,QAAQ,OAAA,GAAMC,iBAAAA,KAAAA,CAClB,aACAC,QAAAA,UAAU,WAAWA,QAAAA,UAAU,UACjC;EACA,IAAI;GACF,MAAM,SAAS,MAAM,MAAM,KAAK;GAChC,IAAI,CAAC,OAAO,OAAO,KAAK,OAAO,UAAU,GACvC,MAAM,IAAI,MACR,wDACF;GACF,OAAO;IAAE,MAAM,MAAM,MAAM,SAAS,MAAM;IAAG,MAAM,OAAO,OAAO;GAAM;EACzE,UAAU;GACR,MAAM,MAAM,MAAM;EACpB;CACF,SAAS,OAAO;EACd,MAAM,IAAI,MACR,uBAAuBC,yBAAAA,wBAAwB,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,IAAIC,yBAAAA,sBAChH;CACF;AACF;AAEA,MAAM,OAAO,YAAY;CACvB,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CACjC,IAAI,KAAK,WAAW,KAAK,KAAK,GAAG,CAAC,MAAM,UAAU;EAChD,QAAQ,OAAO,MAAM,GAAG,MAAM,GAAG;EACjC;CACF;CACA,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,MAAM,KAAK;CAC5C,MAAM,OAAO,OAAA,GAAMC,iBAAAA,SAAAA,CAAS,QAAQ,IAAI,CAAC;CACzC,MAAM,EAAE,OAA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A,yBAAyB,UAAU,IAAI;CAC9D,MAAMC,uBAAAA,mBAAmB;EAAE;EAAa,MAAM;EAAQ,MAAM;CAAM,CAAC;CACnE,IAAI,mBAAmB,UAAU,MAC/B,MAAMA,uBAAAA,mBAAmB;EACvB,aAAa;EACb,MAAM;EACN,MAAM,UAAU,QAAQ;CAC1B,CAAC;CACH,QAAQ,OAAO,MACb,aAAaR,yBAAAA,eAAe,OAAOL,yBAAAA,wBAAwB,GAC7D;AACF;AAEA,KAAK,CAAC,CAAC,OAAO,UAAmB;CAC/B,QAAQ,OAAO,MACb,gBAAgB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,GACzE;CACA,QAAQ,WAAW;AACrB,CAAC"}
|
package/dist/cloud-setup-cli.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as generationDiagnostics, r as writeGeneratedFile, t as checkGeneratedOutput } from "./generated-file.mjs";
|
|
3
3
|
import { C as cloudSetupPath, S as mergeCloudClaudeSettings, v as cloudClaudeSettingsPath, w as generateCloudSetup, y as cloudSessionStartFix } from "./toolchain-inputs.mjs";
|
|
4
|
+
import { t as repositoryBun } from "./toolchain-bun.mjs";
|
|
4
5
|
import { n as parseToolchainConfiguration, r as readToolchainInputs } from "./toolchain-guard.mjs";
|
|
5
6
|
import { t as parseToolchainPolicy } from "./toolchain-schema.mjs";
|
|
6
7
|
import { open, readFile, realpath } from "node:fs/promises";
|
|
@@ -55,7 +56,11 @@ const main = async () => {
|
|
|
55
56
|
if (cloud === void 0) throw new Error("requires an explicit cloud declaration");
|
|
56
57
|
const nodeVersion = files[".node-version"];
|
|
57
58
|
if (nodeVersion === void 0) throw new Error("requires tracked root .node-version");
|
|
58
|
-
const
|
|
59
|
+
const sharedPolicy = parseToolchainPolicy(JSON.parse(await readFile(new URL("../toolchain.json", import.meta.url), "utf8")));
|
|
60
|
+
const policy = {
|
|
61
|
+
...sharedPolicy,
|
|
62
|
+
bun: repositoryBun(sharedPolicy.bun, files["package.json"])
|
|
63
|
+
};
|
|
59
64
|
const script = generateCloudSetup({
|
|
60
65
|
policy,
|
|
61
66
|
cloud,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-setup-cli.mjs","names":[],"sources":["../src/cloud-setup-cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { constants } from \"node:fs\";\nimport { open, readFile, realpath } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport { cloudSetupPath, generateCloudSetup } from \"./cloud-setup\";\nimport {\n cloudClaudeSettingsPath,\n cloudSessionStartFix,\n mergeCloudClaudeSettings,\n} from \"./cloud-setup-claude\";\nimport {\n checkGeneratedOutput,\n generationDiagnostics,\n writeGeneratedFile,\n} from \"./generated-file\";\nimport {\n parseToolchainConfiguration,\n readToolchainInputs,\n} from \"./toolchain-guard\";\nimport { parseToolchainPolicy } from \"./toolchain-schema\";\n\nconst usage =\n \"Usage: stll-cloud-setup (run from repository root)\\n stll-cloud-setup --help\";\nconst readClaudeSettings = async (destination: string) => {\n try {\n if ((await checkGeneratedOutput(destination)) === undefined)\n return undefined;\n const input = await open(\n destination,\n constants.O_RDONLY | constants.O_NOFOLLOW,\n );\n try {\n const opened = await input.stat();\n if (!opened.isFile() || opened.nlink !== 1)\n throw new Error(\n \"settings must be a single-link regular repository file\",\n );\n return { text: await input.readFile(\"utf8\"), mode: opened.mode & 0o777 };\n } finally {\n await input.close();\n }\n } catch (error) {\n throw new Error(\n `cannot safely merge ${cloudClaudeSettingsPath}: ${error instanceof Error ? error.message : String(error)}; ${cloudSessionStartFix}`,\n );\n }\n};\n\nconst main = async () => {\n const args = process.argv.slice(2);\n if (args.length === 1 && args.at(0) === \"--help\") {\n process.stdout.write(`${usage}\\n`);\n return;\n }\n if (args.length !== 0) throw new Error(usage);\n const root = await realpath(process.cwd());\n const { files, diagnostics } = readToolchainInputs(root);\n const destination = join(root, cloudSetupPath);\n const settingsDestination = join(root, cloudClaudeSettingsPath);\n // Validate settings separately to retain actionable merge diagnostics.\n const settings = await readClaudeSettings(settingsDestination);\n const remainingDiagnostics = await generationDiagnostics({\n diagnostics,\n outputs: [\n { relative: cloudSetupPath, destination },\n { relative: cloudClaudeSettingsPath, destination: settingsDestination },\n ],\n });\n if (remainingDiagnostics.length > 0)\n throw new Error(\n remainingDiagnostics\n .map(\n ({ path, message }) =>\n `${path}: ${message}${path === cloudClaudeSettingsPath ? `; ${cloudSessionStartFix}` : \"\"}`,\n )\n .join(\"\\n\"),\n );\n const text = files[\"stll-toolchain.json\"];\n if (text === undefined)\n throw new Error(\"requires tracked stll-toolchain.json\");\n const { cloud, rustExceptions } = parseToolchainConfiguration(\n JSON.parse(text),\n );\n if (cloud === undefined)\n throw new Error(\"requires an explicit cloud declaration\");\n const nodeVersion = files[\".node-version\"];\n if (nodeVersion === undefined)\n throw new Error(\"requires tracked root .node-version\");\n const
|
|
1
|
+
{"version":3,"file":"cloud-setup-cli.mjs","names":[],"sources":["../src/cloud-setup-cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { constants } from \"node:fs\";\nimport { open, readFile, realpath } from \"node:fs/promises\";\nimport { join } from \"node:path\";\n\nimport { cloudSetupPath, generateCloudSetup } from \"./cloud-setup\";\nimport {\n cloudClaudeSettingsPath,\n cloudSessionStartFix,\n mergeCloudClaudeSettings,\n} from \"./cloud-setup-claude\";\nimport {\n checkGeneratedOutput,\n generationDiagnostics,\n writeGeneratedFile,\n} from \"./generated-file\";\nimport { repositoryBun } from \"./toolchain-bun\";\nimport {\n parseToolchainConfiguration,\n readToolchainInputs,\n} from \"./toolchain-guard\";\nimport { parseToolchainPolicy } from \"./toolchain-schema\";\n\nconst usage =\n \"Usage: stll-cloud-setup (run from repository root)\\n stll-cloud-setup --help\";\nconst readClaudeSettings = async (destination: string) => {\n try {\n if ((await checkGeneratedOutput(destination)) === undefined)\n return undefined;\n const input = await open(\n destination,\n constants.O_RDONLY | constants.O_NOFOLLOW,\n );\n try {\n const opened = await input.stat();\n if (!opened.isFile() || opened.nlink !== 1)\n throw new Error(\n \"settings must be a single-link regular repository file\",\n );\n return { text: await input.readFile(\"utf8\"), mode: opened.mode & 0o777 };\n } finally {\n await input.close();\n }\n } catch (error) {\n throw new Error(\n `cannot safely merge ${cloudClaudeSettingsPath}: ${error instanceof Error ? error.message : String(error)}; ${cloudSessionStartFix}`,\n );\n }\n};\n\nconst main = async () => {\n const args = process.argv.slice(2);\n if (args.length === 1 && args.at(0) === \"--help\") {\n process.stdout.write(`${usage}\\n`);\n return;\n }\n if (args.length !== 0) throw new Error(usage);\n const root = await realpath(process.cwd());\n const { files, diagnostics } = readToolchainInputs(root);\n const destination = join(root, cloudSetupPath);\n const settingsDestination = join(root, cloudClaudeSettingsPath);\n // Validate settings separately to retain actionable merge diagnostics.\n const settings = await readClaudeSettings(settingsDestination);\n const remainingDiagnostics = await generationDiagnostics({\n diagnostics,\n outputs: [\n { relative: cloudSetupPath, destination },\n { relative: cloudClaudeSettingsPath, destination: settingsDestination },\n ],\n });\n if (remainingDiagnostics.length > 0)\n throw new Error(\n remainingDiagnostics\n .map(\n ({ path, message }) =>\n `${path}: ${message}${path === cloudClaudeSettingsPath ? `; ${cloudSessionStartFix}` : \"\"}`,\n )\n .join(\"\\n\"),\n );\n const text = files[\"stll-toolchain.json\"];\n if (text === undefined)\n throw new Error(\"requires tracked stll-toolchain.json\");\n const { cloud, rustExceptions } = parseToolchainConfiguration(\n JSON.parse(text),\n );\n if (cloud === undefined)\n throw new Error(\"requires an explicit cloud declaration\");\n const nodeVersion = files[\".node-version\"];\n if (nodeVersion === undefined)\n throw new Error(\"requires tracked root .node-version\");\n const sharedPolicy = parseToolchainPolicy(\n JSON.parse(\n await readFile(new URL(\"../toolchain.json\", import.meta.url), \"utf8\"),\n ),\n );\n const policy = {\n ...sharedPolicy,\n bun: repositoryBun(sharedPolicy.bun, files[\"package.json\"]),\n };\n const script = generateCloudSetup({\n policy,\n cloud,\n nodeVersion: nodeVersion.trim(),\n files,\n rustExceptions,\n });\n const mergedSettings = mergeCloudClaudeSettings(settings?.text);\n await writeGeneratedFile({ destination, text: script, mode: 0o755 });\n if (mergedSettings !== settings?.text)\n await writeGeneratedFile({\n destination: settingsDestination,\n text: mergedSettings,\n mode: settings?.mode ?? 0o644,\n });\n process.stdout.write(\n `Generated ${cloudSetupPath} and ${cloudClaudeSettingsPath}\\n`,\n );\n};\n\nmain().catch((error: unknown) => {\n process.stderr.write(\n `cloud-setup: ${error instanceof Error ? error.message : String(error)}\\n`,\n );\n process.exitCode = 1;\n});\n"],"mappings":";;;;;;;;;;AAuBA,MAAM,QACJ;AACF,MAAM,qBAAqB,OAAO,gBAAwB;CACxD,IAAI;EACF,IAAK,MAAM,qBAAqB,WAAW,MAAO,KAAA,GAChD,OAAO,KAAA;EACT,MAAM,QAAQ,MAAM,KAClB,aACA,UAAU,WAAW,UAAU,UACjC;EACA,IAAI;GACF,MAAM,SAAS,MAAM,MAAM,KAAK;GAChC,IAAI,CAAC,OAAO,OAAO,KAAK,OAAO,UAAU,GACvC,MAAM,IAAI,MACR,wDACF;GACF,OAAO;IAAE,MAAM,MAAM,MAAM,SAAS,MAAM;IAAG,MAAM,OAAO,OAAO;GAAM;EACzE,UAAU;GACR,MAAM,MAAM,MAAM;EACpB;CACF,SAAS,OAAO;EACd,MAAM,IAAI,MACR,uBAAuB,wBAAwB,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,IAAI,sBAChH;CACF;AACF;AAEA,MAAM,OAAO,YAAY;CACvB,MAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;CACjC,IAAI,KAAK,WAAW,KAAK,KAAK,GAAG,CAAC,MAAM,UAAU;EAChD,QAAQ,OAAO,MAAM,GAAG,MAAM,GAAG;EACjC;CACF;CACA,IAAI,KAAK,WAAW,GAAG,MAAM,IAAI,MAAM,KAAK;CAC5C,MAAM,OAAO,MAAM,SAAS,QAAQ,IAAI,CAAC;CACzC,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OAAO,MACb,aAAa,eAAe,OAAO,wBAAwB,GAC7D;AACF;AAEA,KAAK,CAAC,CAAC,OAAO,UAAmB;CAC/B,QAAQ,OAAO,MACb,gBAAgB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,EAAE,GACzE;CACA,QAAQ,WAAW;AACrB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
let semver = require("semver");
|
|
2
|
+
//#region src/toolchain-bun.ts
|
|
3
|
+
const STABLE_RELEASE = /^\d+\.\d+\.\d+$/u;
|
|
4
|
+
/**
|
|
5
|
+
* The shared policy names the minimum Bun. A repository pins one exact
|
|
6
|
+
* release at or above it in its root packageManager, and every other Bun
|
|
7
|
+
* reference in the repository must equal that release.
|
|
8
|
+
*/
|
|
9
|
+
const repositoryBun = (floor, manifest) => {
|
|
10
|
+
let packageManager;
|
|
11
|
+
try {
|
|
12
|
+
const parsed = JSON.parse(manifest ?? "");
|
|
13
|
+
if (typeof parsed === "object" && parsed !== null) packageManager = Reflect.get(parsed, "packageManager");
|
|
14
|
+
} catch {}
|
|
15
|
+
const version = typeof packageManager === "string" ? /^bun@(.+)$/.exec(packageManager)?.[1] : void 0;
|
|
16
|
+
return version !== void 0 && STABLE_RELEASE.test(version) && (0, semver.valid)(version) === version && (0, semver.gte)(version, floor) ? version : floor;
|
|
17
|
+
};
|
|
18
|
+
/** A selected runtime satisfies the policy when it is an exact release at or above the floor. */
|
|
19
|
+
const satisfiesBunFloor = (version, floor) => STABLE_RELEASE.test(version) && (0, semver.valid)(version) === version && (0, semver.gte)(version, floor);
|
|
20
|
+
//#endregion
|
|
21
|
+
Object.defineProperty(exports, "repositoryBun", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return repositoryBun;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "satisfiesBunFloor", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return satisfiesBunFloor;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=toolchain-bun.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolchain-bun.cjs","names":["valid","gte"],"sources":["../src/toolchain-bun.ts"],"sourcesContent":["import { gte, valid } from \"semver\";\n\n// Stable releases only: a prerelease never satisfies the shared minimum.\nconst STABLE_RELEASE = /^\\d+\\.\\d+\\.\\d+$/u;\n\n/**\n * The shared policy names the minimum Bun. A repository pins one exact\n * release at or above it in its root packageManager, and every other Bun\n * reference in the repository must equal that release.\n */\nexport const repositoryBun = (floor: string, manifest: string | undefined) => {\n let packageManager: unknown;\n try {\n const parsed: unknown = JSON.parse(manifest ?? \"\");\n if (typeof parsed === \"object\" && parsed !== null)\n packageManager = Reflect.get(parsed, \"packageManager\");\n } catch {\n // Manifest diagnostics report a malformed root package.json.\n }\n const version =\n typeof packageManager === \"string\"\n ? /^bun@(.+)$/.exec(packageManager)?.[1]\n : undefined;\n return version !== undefined &&\n STABLE_RELEASE.test(version) &&\n valid(version) === version &&\n gte(version, floor)\n ? version\n : floor;\n};\n\n/** A selected runtime satisfies the policy when it is an exact release at or above the floor. */\nexport const satisfiesBunFloor = (version: string, floor: string) =>\n STABLE_RELEASE.test(version) &&\n valid(version) === version &&\n gte(version, floor);\n"],"mappings":";;AAGA,MAAM,iBAAiB;;;;;;AAOvB,MAAa,iBAAiB,OAAe,aAAiC;CAC5E,IAAI;CACJ,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,YAAY,EAAE;EACjD,IAAI,OAAO,WAAW,YAAY,WAAW,MAC3C,iBAAiB,QAAQ,IAAI,QAAQ,gBAAgB;CACzD,QAAQ,CAER;CACA,MAAM,UACJ,OAAO,mBAAmB,WACtB,aAAa,KAAK,cAAc,CAAC,GAAG,KACpC,KAAA;CACN,OAAO,YAAY,KAAA,KACjB,eAAe,KAAK,OAAO,MAAA,GAC3BA,OAAAA,MAAAA,CAAM,OAAO,MAAM,YAAA,GACnBC,OAAAA,IAAAA,CAAI,SAAS,KAAK,IAChB,UACA;AACN;;AAGA,MAAa,qBAAqB,SAAiB,UACjD,eAAe,KAAK,OAAO,MAAA,GAC3BD,OAAAA,MAAAA,CAAM,OAAO,MAAM,YAAA,GACnBC,OAAAA,IAAAA,CAAI,SAAS,KAAK"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { gte, valid } from "semver";
|
|
2
|
+
//#region src/toolchain-bun.ts
|
|
3
|
+
const STABLE_RELEASE = /^\d+\.\d+\.\d+$/u;
|
|
4
|
+
/**
|
|
5
|
+
* The shared policy names the minimum Bun. A repository pins one exact
|
|
6
|
+
* release at or above it in its root packageManager, and every other Bun
|
|
7
|
+
* reference in the repository must equal that release.
|
|
8
|
+
*/
|
|
9
|
+
const repositoryBun = (floor, manifest) => {
|
|
10
|
+
let packageManager;
|
|
11
|
+
try {
|
|
12
|
+
const parsed = JSON.parse(manifest ?? "");
|
|
13
|
+
if (typeof parsed === "object" && parsed !== null) packageManager = Reflect.get(parsed, "packageManager");
|
|
14
|
+
} catch {}
|
|
15
|
+
const version = typeof packageManager === "string" ? /^bun@(.+)$/.exec(packageManager)?.[1] : void 0;
|
|
16
|
+
return version !== void 0 && STABLE_RELEASE.test(version) && valid(version) === version && gte(version, floor) ? version : floor;
|
|
17
|
+
};
|
|
18
|
+
/** A selected runtime satisfies the policy when it is an exact release at or above the floor. */
|
|
19
|
+
const satisfiesBunFloor = (version, floor) => STABLE_RELEASE.test(version) && valid(version) === version && gte(version, floor);
|
|
20
|
+
//#endregion
|
|
21
|
+
export { satisfiesBunFloor as n, repositoryBun as t };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=toolchain-bun.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolchain-bun.mjs","names":[],"sources":["../src/toolchain-bun.ts"],"sourcesContent":["import { gte, valid } from \"semver\";\n\n// Stable releases only: a prerelease never satisfies the shared minimum.\nconst STABLE_RELEASE = /^\\d+\\.\\d+\\.\\d+$/u;\n\n/**\n * The shared policy names the minimum Bun. A repository pins one exact\n * release at or above it in its root packageManager, and every other Bun\n * reference in the repository must equal that release.\n */\nexport const repositoryBun = (floor: string, manifest: string | undefined) => {\n let packageManager: unknown;\n try {\n const parsed: unknown = JSON.parse(manifest ?? \"\");\n if (typeof parsed === \"object\" && parsed !== null)\n packageManager = Reflect.get(parsed, \"packageManager\");\n } catch {\n // Manifest diagnostics report a malformed root package.json.\n }\n const version =\n typeof packageManager === \"string\"\n ? /^bun@(.+)$/.exec(packageManager)?.[1]\n : undefined;\n return version !== undefined &&\n STABLE_RELEASE.test(version) &&\n valid(version) === version &&\n gte(version, floor)\n ? version\n : floor;\n};\n\n/** A selected runtime satisfies the policy when it is an exact release at or above the floor. */\nexport const satisfiesBunFloor = (version: string, floor: string) =>\n STABLE_RELEASE.test(version) &&\n valid(version) === version &&\n gte(version, floor);\n"],"mappings":";;AAGA,MAAM,iBAAiB;;;;;;AAOvB,MAAa,iBAAiB,OAAe,aAAiC;CAC5E,IAAI;CACJ,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,YAAY,EAAE;EACjD,IAAI,OAAO,WAAW,YAAY,WAAW,MAC3C,iBAAiB,QAAQ,IAAI,QAAQ,gBAAgB;CACzD,QAAQ,CAER;CACA,MAAM,UACJ,OAAO,mBAAmB,WACtB,aAAa,KAAK,cAAc,CAAC,GAAG,KACpC,KAAA;CACN,OAAO,YAAY,KAAA,KACjB,eAAe,KAAK,OAAO,KAC3B,MAAM,OAAO,MAAM,WACnB,IAAI,SAAS,KAAK,IAChB,UACA;AACN;;AAGA,MAAa,qBAAqB,SAAiB,UACjD,eAAe,KAAK,OAAO,KAC3B,MAAM,OAAO,MAAM,WACnB,IAAI,SAAS,KAAK"}
|
package/dist/toolchain-guard.cjs
CHANGED
|
@@ -2,6 +2,7 @@ const require_rolldown_runtime = require("./rolldown-runtime.cjs");
|
|
|
2
2
|
const require_quarantine_policy = require("./quarantine-policy2.cjs");
|
|
3
3
|
const require_toolchain_inputs = require("./toolchain-inputs.cjs");
|
|
4
4
|
const require_git_tracked_output = require("./git-tracked-output.cjs");
|
|
5
|
+
const require_toolchain_bun = require("./toolchain-bun.cjs");
|
|
5
6
|
const require_consumer_node_support = require("./consumer-node-support.cjs");
|
|
6
7
|
const require_toolchain_dependabot = require("./toolchain-dependabot.cjs");
|
|
7
8
|
const require_toolchain_schema = require("./toolchain-schema.cjs");
|
|
@@ -17,7 +18,7 @@ picomatch = require_rolldown_runtime.__toESM(picomatch, 1);
|
|
|
17
18
|
let node_module = require("node:module");
|
|
18
19
|
//#endregion
|
|
19
20
|
//#region src/toolchain-consumer-checks.ts
|
|
20
|
-
const consumerRunnerVersion = "1.
|
|
21
|
+
const consumerRunnerVersion = "1.9.0";
|
|
21
22
|
const consumerCheckWorkflow = "stella/.github/.github/workflows/package-consumer-compat.yml";
|
|
22
23
|
const record$10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23
24
|
const repositoryDirectory = (value) => typeof value === "string" && value !== "" && !value.includes("\\") && !value.includes("${{") && !value.split("").some((character) => {
|
|
@@ -1131,7 +1132,7 @@ const checkPackageFiles = ({ files, policy }) => {
|
|
|
1131
1132
|
rule: "bun-pins",
|
|
1132
1133
|
key: "packageManager",
|
|
1133
1134
|
value: manager,
|
|
1134
|
-
message: `packageManager Bun version must be ${policy.bun}, found ${JSON.stringify(manager)}`
|
|
1135
|
+
message: `packageManager Bun version must be ${policy.bun} (one exact release at or above the shared minimum, the same in every manifest), found ${JSON.stringify(manager)}`
|
|
1135
1136
|
});
|
|
1136
1137
|
const checkEntries = (entries, location) => {
|
|
1137
1138
|
if (!record$7(entries)) return;
|
|
@@ -3974,8 +3975,12 @@ const readToolchainInputs = (root, { bunLock = "presence" } = {}) => {
|
|
|
3974
3975
|
diagnostics
|
|
3975
3976
|
};
|
|
3976
3977
|
};
|
|
3977
|
-
const checkToolchain = ({ root, policy, onDelegated, onWarning, now }) => {
|
|
3978
|
+
const checkToolchain = ({ root, policy: sharedPolicy, onDelegated, onWarning, now }) => {
|
|
3978
3979
|
const { files, trackedFiles, diagnostics } = readToolchainInputs(root, { bunLock: "content" });
|
|
3980
|
+
const policy = {
|
|
3981
|
+
...sharedPolicy,
|
|
3982
|
+
bun: require_toolchain_bun.repositoryBun(sharedPolicy.bun, files["package.json"])
|
|
3983
|
+
};
|
|
3979
3984
|
let repository;
|
|
3980
3985
|
try {
|
|
3981
3986
|
const origin = (0, node_child_process.execFileSync)("git", [
|