electrobun 2.0.3-beta.9 → 2.0.5-beta.2
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 +4 -3
- package/bin/resolve-hutch.cjs +19 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,9 +32,10 @@ commands, so the single `electrobun` dependency and its immutable GitHub Release
|
|
|
32
32
|
assets ride the project lockfile together. Hutch
|
|
33
33
|
downloads the matching runtime and SDK into the shared
|
|
34
34
|
`~/.hutch/releases/electrobun` store and projects the SDKs into the project's
|
|
35
|
-
`.hutch/devkit` sysroot.
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
`.hutch/devkit` sysroot. Bun is the default application runtime and Hutch script runner. Cottontail
|
|
36
|
+
is experimental and opt-in; Hutch still uses its paired Cottontail for internal
|
|
37
|
+
config loading and bundling. Application runtimes are independently pinned by
|
|
38
|
+
the resolved Electrobun devkit. Installing a beta bootstrap still uses stable templates
|
|
38
39
|
unless `init` receives `--beta`.
|
|
39
40
|
|
|
40
41
|
`DASH_RELEASE_OFFLINE=1` prevents this bootstrap from downloading a missing
|
package/bin/resolve-hutch.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
// Resolve the exact Hutch release paired with this electrobun npm version.
|
|
4
4
|
// The single npm package stays platform-neutral: each Electrobun GitHub
|
|
5
|
-
// Release carries the
|
|
5
|
+
// Release carries the six Hutch archives, and this shim verifies and caches
|
|
6
6
|
// the host archive on first use. A compatible machine-wide launcher remains
|
|
7
7
|
// a fallback, but Hutch before 0.22 cannot honor the paired default variables.
|
|
8
8
|
|
|
@@ -27,7 +27,7 @@ const { homedir, tmpdir } = require("node:os");
|
|
|
27
27
|
const path = require("node:path");
|
|
28
28
|
|
|
29
29
|
// Stamped by push-version.js from package/hutch.config.ts.
|
|
30
|
-
const PAIRED_HUTCH_VERSION = "0.28.
|
|
30
|
+
const PAIRED_HUTCH_VERSION = "0.28.2-canary.3";
|
|
31
31
|
const ELECTROBUN_VERSION = require("../package.json").version;
|
|
32
32
|
|
|
33
33
|
const MINIMUM_DEFAULTS_HUTCH_VERSION = "0.22.0";
|
|
@@ -64,6 +64,7 @@ const strictSemver =
|
|
|
64
64
|
|
|
65
65
|
const releasedPlatforms = {
|
|
66
66
|
"darwin-arm64": "macos-arm64",
|
|
67
|
+
"darwin-x64": "macos-x64",
|
|
67
68
|
"linux-arm64": "linux-arm64",
|
|
68
69
|
"linux-x64": "linux-x64",
|
|
69
70
|
"win32-x64": "windows-x64",
|
|
@@ -76,12 +77,14 @@ function normalizeHutchChannel(value) {
|
|
|
76
77
|
return null;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
function hutchChannel(environment) {
|
|
80
|
+
function hutchChannel(environment, pairedVersion = PAIRED_HUTCH_VERSION) {
|
|
80
81
|
for (const key of ["ELECTROBUN_HUTCH_CHANNEL", "HUTCH_ACTIVE_CHANNEL"]) {
|
|
81
82
|
const selected = normalizeHutchChannel(environment[key]);
|
|
82
83
|
if (selected) return selected;
|
|
83
84
|
}
|
|
84
|
-
|
|
85
|
+
const paired = parseVersion(pairedVersion);
|
|
86
|
+
if (!paired) throw new Error("paired Hutch version must be an exact SemVer");
|
|
87
|
+
return paired.prerelease === null ? "production" : "canary";
|
|
85
88
|
}
|
|
86
89
|
|
|
87
90
|
function environmentFlagEnabled(environment, name) {
|
|
@@ -245,19 +248,22 @@ function checkedSpawn(command, args, options) {
|
|
|
245
248
|
}
|
|
246
249
|
}
|
|
247
250
|
|
|
248
|
-
async function installHutch(
|
|
251
|
+
async function installHutch(
|
|
252
|
+
{ channel, environment, platform },
|
|
253
|
+
{ downloadInstaller = download, execute = checkedSpawn } = {},
|
|
254
|
+
) {
|
|
249
255
|
const temporary = mkdtempSync(path.join(tmpdir(), "electrobun-hutch-installer-"));
|
|
250
256
|
try {
|
|
251
257
|
if (platform === "win32") {
|
|
252
258
|
const installer = path.join(temporary, "install.ps1");
|
|
253
259
|
writeFileSync(
|
|
254
260
|
installer,
|
|
255
|
-
await
|
|
261
|
+
await downloadInstaller(`${defaultInstallerBaseUrl}/install.ps1`, {
|
|
256
262
|
label: "Hutch installer",
|
|
257
263
|
maxBytes: maxInstallerBytes,
|
|
258
264
|
}),
|
|
259
265
|
);
|
|
260
|
-
|
|
266
|
+
execute(
|
|
261
267
|
"powershell.exe",
|
|
262
268
|
[
|
|
263
269
|
"-NoProfile",
|
|
@@ -268,6 +274,8 @@ async function installHutch({ channel, environment, platform }) {
|
|
|
268
274
|
installer,
|
|
269
275
|
"-Channel",
|
|
270
276
|
channel,
|
|
277
|
+
"-Version",
|
|
278
|
+
PAIRED_HUTCH_VERSION,
|
|
271
279
|
],
|
|
272
280
|
{ env: environment, stdio: "inherit" },
|
|
273
281
|
);
|
|
@@ -275,13 +283,13 @@ async function installHutch({ channel, environment, platform }) {
|
|
|
275
283
|
const installer = path.join(temporary, "install.sh");
|
|
276
284
|
writeFileSync(
|
|
277
285
|
installer,
|
|
278
|
-
await
|
|
286
|
+
await downloadInstaller(`${defaultInstallerBaseUrl}/install.sh`, {
|
|
279
287
|
label: "Hutch installer",
|
|
280
288
|
maxBytes: maxInstallerBytes,
|
|
281
289
|
}),
|
|
282
290
|
{ mode: 0o700 },
|
|
283
291
|
);
|
|
284
|
-
|
|
292
|
+
execute("sh", [installer, "--channel", channel, "--version", PAIRED_HUTCH_VERSION], {
|
|
285
293
|
env: environment,
|
|
286
294
|
stdio: "inherit",
|
|
287
295
|
});
|
|
@@ -1242,7 +1250,7 @@ async function ensureCompatibleGlobal(options) {
|
|
|
1242
1250
|
);
|
|
1243
1251
|
}
|
|
1244
1252
|
console.error(
|
|
1245
|
-
`Electrobun projects use Hutch; installing
|
|
1253
|
+
`Electrobun projects use Hutch; installing paired Hutch ${PAIRED_HUTCH_VERSION} (${channel})...`,
|
|
1246
1254
|
);
|
|
1247
1255
|
await options.install({
|
|
1248
1256
|
channel,
|
|
@@ -1390,6 +1398,7 @@ module.exports = {
|
|
|
1390
1398
|
hutchChannel,
|
|
1391
1399
|
hutchBinaryVersion,
|
|
1392
1400
|
hutchPlatformKey,
|
|
1401
|
+
installHutch,
|
|
1393
1402
|
installDownloadedArchive,
|
|
1394
1403
|
resolveHutchBinary,
|
|
1395
1404
|
runHutch,
|