electrobun 1.18.4-beta.21 → 1.18.4-beta.25

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.
@@ -17,12 +17,22 @@ function normalizeChannel(value) {
17
17
  return null;
18
18
  }
19
19
 
20
- function channelForVersion(version, environment) {
20
+ // Electrobun (beta or stable) always runs on STABLE Hutch. Only an explicit
21
+ // ELECTROBUN_HUTCH_CHANNEL / HUTCH_ACTIVE_CHANNEL override changes that (e.g. to
22
+ // test against a hutch-canary build) — the electrobun version never does.
23
+ function hutchChannel(environment) {
21
24
  for (const key of ["ELECTROBUN_HUTCH_CHANNEL", "HUTCH_ACTIVE_CHANNEL"]) {
22
25
  const selected = normalizeChannel(environment[key]);
23
26
  if (selected) return selected;
24
27
  }
25
- return version.includes("-") ? "canary" : "production";
28
+ return "production";
29
+ }
30
+
31
+ // The Electrobun template channel: "beta" for prerelease builds or an explicit
32
+ // --beta, else "stable". Forwarded to `hutch electrobun` as the --beta flag.
33
+ function electrobunChannel(version, args) {
34
+ if (Array.isArray(args) && args.includes("--beta")) return "beta";
35
+ return version.includes("-") ? "beta" : "stable";
26
36
  }
27
37
 
28
38
  function hutchBinaryPath(channel, environment, platform, userHome) {
@@ -133,9 +143,14 @@ async function main(options = {}) {
133
143
  const fileExists = options.existsSync || existsSync;
134
144
  const install = options.installHutch || installHutch;
135
145
  const run = options.runHutch || runHutch;
136
- const channel = channelForVersion(version, environment);
146
+ const channel = hutchChannel(environment);
137
147
  const binary = hutchBinaryPath(channel, environment, platform, userHome);
138
148
 
149
+ // Forward the electrobun template channel as --beta to `hutch electrobun`.
150
+ const templateChannel = electrobunChannel(version, args);
151
+ const hutchArgs =
152
+ templateChannel === "beta" && !args.includes("--beta") ? [...args, "--beta"] : args;
153
+
139
154
  if (!fileExists(binary)) {
140
155
  if (environment.ELECTROBUN_HUTCH_BINARY) {
141
156
  throw new Error(`ELECTROBUN_HUTCH_BINARY does not exist: ${binary}`);
@@ -144,7 +159,7 @@ async function main(options = {}) {
144
159
  await install({ channel, environment, platform });
145
160
  }
146
161
  if (!fileExists(binary)) throw new Error(`Hutch was not installed at ${binary}`);
147
- return run({ binary, args, environment });
162
+ return run({ binary, args: hutchArgs, environment });
148
163
  }
149
164
 
150
165
  if (require.main === module) {
@@ -159,7 +174,8 @@ if (require.main === module) {
159
174
  }
160
175
 
161
176
  module.exports = {
162
- channelForVersion,
177
+ hutchChannel,
178
+ electrobunChannel,
163
179
  hutchBinaryPath,
164
180
  main,
165
181
  };
package/hutch.config.ts CHANGED
@@ -1,4 +1,4 @@
1
- // @hutch cli=0.5.0 cottontail=0.3.0
1
+ // @hutch cli=0.5.1 cottontail=0.3.0
2
2
  export default {
3
3
  scripts: {
4
4
  start: "hutch src/sdks/main/index.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "1.18.4-beta.21",
3
+ "version": "1.18.4-beta.25",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",