@holochain/hc-spin 0.100.0 → 0.100.1

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.
@@ -96,12 +96,12 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
96
96
  } else {
97
97
  try {
98
98
  const iconResponse = await electron.net.fetch(`http://127.0.0.1:${uiSource.port}/icon.png`);
99
- const buffer = await iconResponse.arrayBuffer();
100
- if (buffer.byteLength === 0 && agentNum === 1) {
99
+ if (iconResponse.status === 404 && agentNum === 1) {
101
100
  console.warn(
102
101
  "\n\n+++++ WARNING +++++\n[hc-spin] No icon.png found. It is recommended to put an icon.png file (1024x1024 pixel) in the root of your UI assets directory which can be used by the Holochain Launcher.\n+++++++++++++++++++\n\n"
103
102
  );
104
103
  }
104
+ const buffer = await iconResponse.arrayBuffer();
105
105
  icon = electron.nativeImage.createFromBuffer(Buffer.from(buffer));
106
106
  } catch (e) {
107
107
  console.error("Failed to get icon.png: ", e);
@@ -11741,7 +11741,7 @@ function validateCliArgs(cliArgs, cliOpts, appDataRootDir) {
11741
11741
  }
11742
11742
  const rustUtils = require("@holochain/hc-spin-rust-utils");
11743
11743
  const cli = new commander.Command();
11744
- cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`0.100.0 (for holochain 0.1.x)`).argument(
11744
+ cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`0.100.1 (for holochain 0.1.x)`).argument(
11745
11745
  "<path>",
11746
11746
  "Path to .webhapp or .happ file to launch. If a .happ file is passed, either a UI path must be specified via --ui-path or a port pointing to a localhost server via --ui-port"
11747
11747
  ).option(
@@ -11844,7 +11844,11 @@ async function spawnSandboxes(nAgents, happPath, appId) {
11844
11844
  appPortsString += `${appPort},`;
11845
11845
  appPorts.push(appPort);
11846
11846
  }
11847
- generateArgs.push("--run", appPortsString.slice(0, appPortsString.length - 1));
11847
+ if (nAgents === 1) {
11848
+ generateArgs.push(`--run=${appPortsString.slice(0, appPortsString.length - 1)}`);
11849
+ } else {
11850
+ generateArgs.push("--run", appPortsString.slice(0, appPortsString.length - 1));
11851
+ }
11848
11852
  generateArgs.push(happPath, "network", "mdns");
11849
11853
  let readyConductors = 0;
11850
11854
  const sandboxPaths = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holochain/hc-spin",
3
- "version": "0.100.0",
3
+ "version": "0.100.1",
4
4
  "description": "CLI to run Holochain aps during development.",
5
5
  "author": "matthme",
6
6
  "homepage": "https://developer.holochain.org",
@@ -23,12 +23,12 @@
23
23
  "@electron-toolkit/preload": "^3.0.0",
24
24
  "@electron-toolkit/utils": "^3.0.0",
25
25
  "@holochain/client": "^0.16.3",
26
+ "@holochain/hc-spin-rust-utils": "0.100.1",
27
+ "@msgpack/msgpack": "^2.8.0",
26
28
  "commander": "11.1.0",
27
29
  "electron": "^28.1.1",
28
30
  "electron-context-menu": "3.6.1",
29
31
  "get-port": "7.0.0",
30
- "@holochain/hc-spin-rust-utils": "0.100.1",
31
- "@msgpack/msgpack": "^2.8.0",
32
32
  "nanoid": "5.0.4",
33
33
  "split": "1.0.1"
34
34
  },
package/src/main/index.ts CHANGED
@@ -27,7 +27,7 @@ const cli = new Command();
27
27
  cli
28
28
  .name('hc-spin')
29
29
  .description('CLI to run Holochain apps during development.')
30
- .version(`0.100.0 (for holochain 0.1.x)`)
30
+ .version(`0.100.1 (for holochain 0.1.x)`)
31
31
  .argument(
32
32
  '<path>',
33
33
  'Path to .webhapp or .happ file to launch. If a .happ file is passed, either a UI path must be specified via --ui-path or a port pointing to a localhost server via --ui-port',
@@ -173,7 +173,11 @@ async function spawnSandboxes(
173
173
  appPortsString += `${appPort},`;
174
174
  appPorts.push(appPort);
175
175
  }
176
- generateArgs.push('--run', appPortsString.slice(0, appPortsString.length - 1));
176
+ if (nAgents === 1) {
177
+ generateArgs.push(`--run=${appPortsString.slice(0, appPortsString.length - 1)}`);
178
+ } else {
179
+ generateArgs.push('--run', appPortsString.slice(0, appPortsString.length - 1));
180
+ }
177
181
 
178
182
  // const adminPorts: number[] = [];
179
183
  // let adminPortsString = '';
@@ -67,12 +67,12 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
67
67
  } else {
68
68
  try {
69
69
  const iconResponse = await net.fetch(`http://127.0.0.1:${uiSource.port}/icon.png`);
70
- const buffer = await iconResponse.arrayBuffer();
71
- if (buffer.byteLength === 0 && agentNum === 1) {
70
+ if (iconResponse.status === 404 && agentNum === 1) {
72
71
  console.warn(
73
72
  '\n\n+++++ WARNING +++++\n[hc-spin] No icon.png found. It is recommended to put an icon.png file (1024x1024 pixel) in the root of your UI assets directory which can be used by the Holochain Launcher.\n+++++++++++++++++++\n\n',
74
73
  );
75
74
  }
75
+ const buffer = await iconResponse.arrayBuffer();
76
76
  icon = nativeImage.createFromBuffer(Buffer.from(buffer));
77
77
  } catch (e) {
78
78
  console.error('Failed to get icon.png: ', e);