@holochain/hc-spin 0.601.0 → 0.700.0-dev.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.
package/.envrc ADDED
@@ -0,0 +1 @@
1
+ use flake
package/CHANGELOG.md CHANGED
@@ -4,29 +4,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
5
  ## \[Unreleased\]
6
6
 
7
- ## 2026-05-14: v0.601.0
8
-
9
- ### Changed
10
-
11
- - Bumped to holochain 0.6.1
12
-
13
- ## 2026-02-13: v0.600.3-rc.0
7
+ ## 2026-02-13: v0.700.0-dev.1
14
8
 
15
9
  ### Changed
16
10
  - Holochain is now run with the iroh transport. The argument `--signaling-url` has been replaced with `--relay-url`.
17
- ### Removed
18
- - Removed CLI option `--transport` as holochain is run with `quic` iroh transport.
19
-
20
- ## 2026-01-22: v0.600.2-rc.0
21
11
 
12
+ ## 2026-01-13: v0.700.0-dev.0
22
13
  ### Changed
23
- - Added a CLI option `--transport` to choose between `quic` and `webrtc`. `quic` is used in combination with the iroh transport in Holochain, `webrtc` with tx5. The default transport in Holochain is iroh, so the default for hc-spin is `quic`. If no transport option is passed in on the command line, `quic` is used.
14
+ - Updated to holochain 0.7.0-dev.7
24
15
 
25
- ## 2026-01-22: v0.600.1-rc.0
26
-
27
- ### Changed
28
-
29
- - Bumped to holochain 0.6.1-rc.0
16
+ ## 2025-11-20: v0.600.0
17
+ ### Added
18
+ - A new argument `--force-admin-ports` takes a comma-separated list of port numbers, to force generated conductors to use specific admin ports. [#50](https://github.com/holochain/hc-spin/pull/50)
30
19
 
31
20
  ## 2025-11-06: v0.600.0-rc.0
32
21
 
package/README.md CHANGED
@@ -4,12 +4,12 @@ CLI to run Holochain apps in development mode.
4
4
 
5
5
  ## Installation
6
6
 
7
- To install the latest version compatible with **holochain 0.4.x**:
7
+ To install the latest version compatible with **holochain 0.6.x**:
8
8
 
9
- ⚠️ Requires `@holochain/client 0.18.0` or newer ⚠️
9
+ ⚠️ Requires `@holochain/client 0.20.0` or newer ⚠️
10
10
 
11
11
  ```sh
12
- npm install --save-dev @holochain/hc-spin@">=0.400.0 <0.500.0"
12
+ npm install --save-dev @holochain/hc-spin@">=0.600.0 <0.700.0"
13
13
  ```
14
14
 
15
15
  To install the latest version compatible with **holochain 0.5.x**:
@@ -20,12 +20,12 @@ To install the latest version compatible with **holochain 0.5.x**:
20
20
  npm install --save-dev @holochain/hc-spin@">=0.500.0 <0.600.0"
21
21
  ```
22
22
 
23
- To install the latest version compatible with **holochain 0.6.x**:
23
+ To install the latest version compatible with **holochain 0.4.x**:
24
24
 
25
- ⚠️ Requires `@holochain/client 0.20.0` or newer ⚠️
25
+ ⚠️ Requires `@holochain/client 0.18.0` or newer ⚠️
26
26
 
27
27
  ```sh
28
- npm install --save-dev @holochain/hc-spin@">=0.600.0 <0.700.0"
28
+ npm install --save-dev @holochain/hc-spin@">=0.400.0 <0.500.0"
29
29
  ```
30
30
 
31
31
  ## Usage (holochain 0.6)
@@ -12439,7 +12439,7 @@ function validateCliArgs(cliArgs, cliOpts, appDataRootDir) {
12439
12439
  networkSeed: cliOpts.networkSeed,
12440
12440
  targetArcFactor: cliOpts.targetArcFactor,
12441
12441
  uiSource: cliOpts.uiPath ? { type: "path", path: cliOpts.uiPath } : cliOpts.uiPort ? { type: "port", port: cliOpts.uiPort } : { type: "path", path: path.join(appDataRootDir, "apps", appId, "ui") },
12442
- singalingUrl: cliOpts.signalingUrl,
12442
+ relayUrl: cliOpts.relayUrl,
12443
12443
  bootstrapUrl: cliOpts.bootstrapUrl,
12444
12444
  happOrWebhappPath: isHapp ? { type: "happ", path: happOrWebhappPath } : { type: "webhapp", path: happOrWebhappPath },
12445
12445
  openDevtools: cliOpts.openDevtools ? true : false
@@ -12563,7 +12563,7 @@ function setLinkOpenHandlers(browserWindow) {
12563
12563
  }
12564
12564
  const rustUtils = require("@holochain/hc-spin-rust-utils");
12565
12565
  const cli = new commander.Command();
12566
- cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`${"0.600.0"} (built for holochain ${"0.6.0"})`).argument(
12566
+ cli.name("hc-spin").description("CLI to run Holochain apps during development.").version(`${"0.600.2-rc.0"} (built for holochain ${"0.6.1-rc.0"})`).argument(
12567
12567
  "<path>",
12568
12568
  "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"
12569
12569
  ).option(
@@ -12585,8 +12585,8 @@ cli.name("hc-spin").description("CLI to run Holochain apps during development.")
12585
12585
  "--ui-port <number>",
12586
12586
  "Port pointing to a localhost dev server that serves your UI assets."
12587
12587
  ).option(
12588
- "--signaling-url <url>",
12589
- "Url of the signaling server to use. By default, hc spin spins up a local development signaling server for you but this argument allows you to specify a custom one."
12588
+ "--relay-url <url>",
12589
+ "Url of the relay server to use. By default, hc spin spins up a local development relay server for you but this argument allows you to specify a custom one."
12590
12590
  ).option("--open-devtools", "Automatically open the devtools on startup.");
12591
12591
  cli.parse();
12592
12592
  const rl = require("readline").createInterface({
@@ -12664,29 +12664,29 @@ async function startLocalServices() {
12664
12664
  const localServicesHandle = childProcess__namespace.spawn("kitsune2-bootstrap-srv");
12665
12665
  return new Promise((resolve) => {
12666
12666
  let bootStrapUrl;
12667
- let signalUrl;
12667
+ let relayUrl;
12668
12668
  let bootstrapRunning = false;
12669
- let signalRunnig = false;
12669
+ let relayRunning = false;
12670
12670
  localServicesHandle.stdout.pipe(split()).on("data", async (line) => {
12671
12671
  console.log(`[hc-spin] | [kitsune2-bootstrap-srv]: ${line}`);
12672
12672
  if (line.includes("#kitsune2_bootstrap_srv#listening#")) {
12673
12673
  const hostAndPort = line.split("#kitsune2_bootstrap_srv#listening#")[1].split("#")[0];
12674
12674
  bootStrapUrl = `http://${hostAndPort}`;
12675
- signalUrl = `ws://${hostAndPort}`;
12675
+ relayUrl = `http://${hostAndPort}`;
12676
12676
  }
12677
12677
  if (line.includes("#kitsune2_bootstrap_srv#running#")) {
12678
12678
  bootstrapRunning = true;
12679
- signalRunnig = true;
12679
+ relayRunning = true;
12680
12680
  }
12681
- if (bootstrapRunning && signalRunnig && bootStrapUrl && signalUrl)
12682
- resolve([bootStrapUrl, signalUrl]);
12681
+ if (bootstrapRunning && relayRunning && bootStrapUrl && relayUrl)
12682
+ resolve([bootStrapUrl, relayUrl]);
12683
12683
  });
12684
12684
  localServicesHandle.stderr.pipe(split()).on("data", async (line) => {
12685
12685
  console.log(`[hc-spin] | [hc run-local-services] ERROR: ${line}`);
12686
12686
  });
12687
12687
  });
12688
12688
  }
12689
- async function spawnSandboxes(nAgents, happPath, bootStrapUrl, signalUrl, appId, networkSeed, targetArcFactor) {
12689
+ async function spawnSandboxes(nAgents, happPath, bootStrapUrl, relayUrl, appId, networkSeed, targetArcFactor) {
12690
12690
  const generateArgs = [
12691
12691
  "sandbox",
12692
12692
  "--piped",
@@ -12711,7 +12711,7 @@ async function spawnSandboxes(nAgents, happPath, bootStrapUrl, signalUrl, appId,
12711
12711
  if (targetArcFactor !== void 0) {
12712
12712
  generateArgs.push("--target-arc-factor", targetArcFactor.toString());
12713
12713
  }
12714
- generateArgs.push("--bootstrap", bootStrapUrl, "webrtc", signalUrl);
12714
+ generateArgs.push("--bootstrap", bootStrapUrl, "quic", relayUrl);
12715
12715
  let readyConductors = 0;
12716
12716
  const portsInfo = {};
12717
12717
  const sandboxPaths = [];
@@ -12755,12 +12755,12 @@ electron.app.whenReady().then(async () => {
12755
12755
  happTargetDir
12756
12756
  );
12757
12757
  }
12758
- const [bootstrapUrl, signalingUrl] = await startLocalServices();
12758
+ const [bootstrapUrl, relayUrl] = await startLocalServices();
12759
12759
  const [sandboxHandle, sandboxPaths, portsInfo] = await spawnSandboxes(
12760
12760
  CLI_OPTS.numAgents,
12761
12761
  happTargetDir ? happTargetDir : CLI_OPTS.happOrWebhappPath.path,
12762
12762
  CLI_OPTS.bootstrapUrl ? CLI_OPTS.bootstrapUrl : bootstrapUrl,
12763
- CLI_OPTS.singalingUrl ? CLI_OPTS.singalingUrl : signalingUrl,
12763
+ CLI_OPTS.relayUrl ? CLI_OPTS.relayUrl : relayUrl,
12764
12764
  CLI_OPTS.appId,
12765
12765
  CLI_OPTS.networkSeed,
12766
12766
  CLI_OPTS.targetArcFactor
package/docs/DEVSETUP.md CHANGED
@@ -25,3 +25,15 @@ yarn build
25
25
  ```bash
26
26
  yarn start <path to .webhapp file>
27
27
  ```
28
+
29
+ ## Upgrade hc-spin to a new holochain version
30
+
31
+ 0. Update the flake.nix file if necessary and run `nix flake update`.
32
+ 1. Upgrade the upstream `@holochain/hc-spin-rust-utils` package [in this repo](https://github.com/holochain/hc-spin-rust-utils), following the instructions in its README. This may involve manual testing of a locally built `@holochain/hc-spin-rust-utils` here in the hc-spin repo. In that case, make sure to have entered nix shell with `nix develop` before testing, such that the correct holochain binary is being used by hc-spin.
33
+ 2. Once the new `@holochain/hc-spin-rust-utils` package has been upgraded and released, update it accordingly in the `package.json` file.
34
+ 3. Update `@holochain/client` in the `package.json` file to the appropriate version.
35
+ 4. Check whether any code changes are necessary after updating the packages. Once the code has been adapted, test it with `yarn start <path to .webhapp file>`.
36
+ 5. If testing succeeds, update the `version` field in `package.json`.
37
+ 6. Make any changes as necessary to the README. The README is what is shown on npmjs.org as the package description so it should be up to date.
38
+ 7. Build the hc-spin binary with `yarn build`.
39
+ 8. And finally publish it with `npm publish`.
package/flake.lock CHANGED
@@ -2,11 +2,11 @@
2
2
  "nodes": {
3
3
  "crane": {
4
4
  "locked": {
5
- "lastModified": 1778106249,
6
- "narHash": "sha256-cM/AuKy5tMhwOOQIbha8ZRRMHVfNf7cv2aljIw+qoCg=",
5
+ "lastModified": 1766194365,
6
+ "narHash": "sha256-4AFsUZ0kl6MXSm4BaQgItD0VGlEKR3iq7gIaL7TjBvc=",
7
7
  "owner": "ipetkov",
8
8
  "repo": "crane",
9
- "rev": "6d015ea29630b7ad2402841386da2cb617a470a7",
9
+ "rev": "7d8ec2c71771937ab99790b45e6d9b93d15d9379",
10
10
  "type": "github"
11
11
  },
12
12
  "original": {
@@ -20,11 +20,11 @@
20
20
  "nixpkgs-lib": "nixpkgs-lib"
21
21
  },
22
22
  "locked": {
23
- "lastModified": 1777988971,
24
- "narHash": "sha256-qIoWPDs+0/8JecyYgE3gpKQxW/4bLW/gp45vow9ioCQ=",
23
+ "lastModified": 1765835352,
24
+ "narHash": "sha256-XswHlK/Qtjasvhd1nOa1e8MgZ8GS//jBoTqWtrS1Giw=",
25
25
  "owner": "hercules-ci",
26
26
  "repo": "flake-parts",
27
- "rev": "0678d8986be1661af6bb555f3489f2fdfc31f6ff",
27
+ "rev": "a34fae9c08a15ad73f295041fec82323541400a9",
28
28
  "type": "github"
29
29
  },
30
30
  "original": {
@@ -36,16 +36,16 @@
36
36
  "hc-scaffold": {
37
37
  "flake": false,
38
38
  "locked": {
39
- "lastModified": 1774456561,
40
- "narHash": "sha256-CQ3HUE++iyLWJFK9wt2TeusmbuLavGxF8kxnv8mMsVw=",
39
+ "lastModified": 1764163563,
40
+ "narHash": "sha256-KigJ3h25yNJfeQunPm5QYFPtLSk6nU3IEEvZY8w01Vo=",
41
41
  "owner": "holochain",
42
42
  "repo": "scaffolding",
43
- "rev": "3329e3c01572dc525ee95caa3d179dc659134572",
43
+ "rev": "87e997a7361d4aa7c1bb96261483ebba50223bd0",
44
44
  "type": "github"
45
45
  },
46
46
  "original": {
47
47
  "owner": "holochain",
48
- "ref": "v0.600.3-rc.0",
48
+ "ref": "v0.600.1",
49
49
  "repo": "scaffolding",
50
50
  "type": "github"
51
51
  }
@@ -53,16 +53,16 @@
53
53
  "holochain": {
54
54
  "flake": false,
55
55
  "locked": {
56
- "lastModified": 1778596880,
57
- "narHash": "sha256-uUJZkeqBAZgXtDf0juCRpKOUO3yY1gWEKWGqatWcVjY=",
56
+ "lastModified": 1769992510,
57
+ "narHash": "sha256-hYq8p1BiPR+AdiOgeOPV+Gz+aTs2t5yu3V8lBGctBkE=",
58
58
  "owner": "holochain",
59
59
  "repo": "holochain",
60
- "rev": "3bdeaccd1c54fa351e76f7347601dfbc061d5bd4",
60
+ "rev": "5194f7af4f71db22dd22dc37cf8c1e68d0b6d628",
61
61
  "type": "github"
62
62
  },
63
63
  "original": {
64
64
  "owner": "holochain",
65
- "ref": "holochain-0.6.1",
65
+ "ref": "holochain-0.7.0-dev.10",
66
66
  "repo": "holochain",
67
67
  "type": "github"
68
68
  }
@@ -76,19 +76,20 @@
76
76
  "kitsune2": "kitsune2",
77
77
  "lair-keystore": "lair-keystore",
78
78
  "nixpkgs": "nixpkgs",
79
+ "playground": "playground",
79
80
  "rust-overlay": "rust-overlay"
80
81
  },
81
82
  "locked": {
82
- "lastModified": 1778614884,
83
- "narHash": "sha256-Kxgtrs15iA9D0f4Sj/rt/yVRYk+Ew8TxeQrmMdYO0Qg=",
83
+ "lastModified": 1770384077,
84
+ "narHash": "sha256-9llOslhUNN0VN1EM57NDB5AByRgztxChw3DaytgcGjU=",
84
85
  "owner": "holochain",
85
86
  "repo": "holonix",
86
- "rev": "9931f18ccf9721fc5469fd3ae9d5bb118a6bac5a",
87
+ "rev": "b6587f0dbbb68de2d69d526e35a3efe7d311f2c4",
87
88
  "type": "github"
88
89
  },
89
90
  "original": {
90
91
  "owner": "holochain",
91
- "ref": "main-0.6",
92
+ "ref": "main",
92
93
  "repo": "holonix",
93
94
  "type": "github"
94
95
  }
@@ -96,16 +97,16 @@
96
97
  "kitsune2": {
97
98
  "flake": false,
98
99
  "locked": {
99
- "lastModified": 1778073766,
100
- "narHash": "sha256-/hG+/9VlZiC1u/UASbIOH0oeiUmKlzqvur++CWSVAbQ=",
100
+ "lastModified": 1770115587,
101
+ "narHash": "sha256-bF/7ERAfd41zEfzoUBKKyxuQU3c0QUi2Fc8MpM+hnEs=",
101
102
  "owner": "holochain",
102
103
  "repo": "kitsune2",
103
- "rev": "b33fa55606f8bd5020cffacf1ffae41f92d4d296",
104
+ "rev": "31b84100151a1eccaf7ed3e0037d27f77b5d7cdb",
104
105
  "type": "github"
105
106
  },
106
107
  "original": {
107
108
  "owner": "holochain",
108
- "ref": "v0.4.1",
109
+ "ref": "main",
109
110
  "repo": "kitsune2",
110
111
  "type": "github"
111
112
  }
@@ -129,11 +130,11 @@
129
130
  },
130
131
  "nixpkgs": {
131
132
  "locked": {
132
- "lastModified": 1778430510,
133
- "narHash": "sha256-Ti+ZBvW6yrWWAg2szExVTwCd4qOJ3KlVr1tFHfyfi8Q=",
133
+ "lastModified": 1766201043,
134
+ "narHash": "sha256-eplAP+rorKKd0gNjV3rA6+0WMzb1X1i16F5m5pASnjA=",
134
135
  "owner": "nixos",
135
136
  "repo": "nixpkgs",
136
- "rev": "8fd9daa3db09ced9700431c5b7ad0e8ba199b575",
137
+ "rev": "b3aad468604d3e488d627c0b43984eb60e75e782",
137
138
  "type": "github"
138
139
  },
139
140
  "original": {
@@ -145,11 +146,11 @@
145
146
  },
146
147
  "nixpkgs-lib": {
147
148
  "locked": {
148
- "lastModified": 1777168982,
149
- "narHash": "sha256-GOkGPcboWE9BmGCRMLX3worL4EMnsnG8MyKmXNeYuhQ=",
149
+ "lastModified": 1765674936,
150
+ "narHash": "sha256-k00uTP4JNfmejrCLJOwdObYC9jHRrr/5M/a/8L2EIdo=",
150
151
  "owner": "nix-community",
151
152
  "repo": "nixpkgs.lib",
152
- "rev": "f5901329dade4a6ea039af1433fb087bd9c1fe14",
153
+ "rev": "2075416fcb47225d9b68ac469a5c4801a9c4dd85",
153
154
  "type": "github"
154
155
  },
155
156
  "original": {
@@ -158,6 +159,23 @@
158
159
  "type": "github"
159
160
  }
160
161
  },
162
+ "playground": {
163
+ "flake": false,
164
+ "locked": {
165
+ "lastModified": 1756729856,
166
+ "narHash": "sha256-xJnIfcIyLRTXsf+N8OOMnqzRkx2gT/DSta7qCm8yU7Y=",
167
+ "owner": "darksoil-studio",
168
+ "repo": "holochain-playground",
169
+ "rev": "5e858641de8ac6113cfa6b47ea1350762a629a61",
170
+ "type": "github"
171
+ },
172
+ "original": {
173
+ "owner": "darksoil-studio",
174
+ "ref": "main",
175
+ "repo": "holochain-playground",
176
+ "type": "github"
177
+ }
178
+ },
161
179
  "root": {
162
180
  "inputs": {
163
181
  "flake-parts": [
@@ -179,11 +197,11 @@
179
197
  ]
180
198
  },
181
199
  "locked": {
182
- "lastModified": 1778555852,
183
- "narHash": "sha256-55EmwooVAS4UpA0oWd5wilKPRqCiHD5BAej9QiNwheY=",
200
+ "lastModified": 1766371695,
201
+ "narHash": "sha256-W7CX9vy7H2Jj3E8NI4djHyF8iHSxKpb2c/7uNQ/vGFU=",
184
202
  "owner": "oxalica",
185
203
  "repo": "rust-overlay",
186
- "rev": "f29b0f7a9f367e0056b716f8aa137cb41e784444",
204
+ "rev": "d81285ba8199b00dc31847258cae3c655b605e8c",
187
205
  "type": "github"
188
206
  },
189
207
  "original": {
package/flake.nix CHANGED
@@ -2,7 +2,7 @@
2
2
  description = "Flake for Holochain app development";
3
3
 
4
4
  inputs = {
5
- holonix.url = "github:holochain/holonix?ref=main-0.6";
5
+ holonix.url = "github:holochain/holonix?ref=main";
6
6
 
7
7
  nixpkgs.follows = "holonix/nixpkgs";
8
8
  flake-parts.follows = "holonix/flake-parts";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@holochain/hc-spin",
3
- "version": "0.601.0",
4
- "holochainVersion": "0.6.1",
3
+ "version": "0.700.0-dev.1",
4
+ "holochainVersion": "0.7.0-dev.7",
5
5
  "description": "CLI to run Holochain apps during development.",
6
6
  "author": "matthme",
7
7
  "homepage": "https://developer.holochain.org",
@@ -36,7 +36,7 @@
36
36
  "@electron-toolkit/preload": "^3.0.0",
37
37
  "@electron-toolkit/utils": "^3.0.0",
38
38
  "@holochain/client": "^0.20.0",
39
- "@holochain/hc-spin-rust-utils": "0.601.1",
39
+ "@holochain/hc-spin-rust-utils": "0.700.0-dev.0",
40
40
  "@msgpack/msgpack": "^2.8.0",
41
41
  "bufferutil": "4.0.8",
42
42
  "commander": "11.1.0",
package/src/main/index.ts CHANGED
@@ -66,6 +66,10 @@ cli
66
66
  '--relay-url <url>',
67
67
  'Url of the relay server to use. By default, hc spin spins up a local development relay server for you but this argument allows you to specify a custom one.',
68
68
  )
69
+ .option(
70
+ '--force-admin-ports <ports>',
71
+ 'A comma-separated list of port numbers for the holochain conductors to bind to their admin interfaces. By default, hc spin picks any available ports.',
72
+ )
69
73
  .option('--open-devtools', 'Automatically open the devtools on startup.');
70
74
 
71
75
  cli.parse();
@@ -211,11 +215,17 @@ async function spawnSandboxes(
211
215
  appId: string,
212
216
  networkSeed?: string,
213
217
  targetArcFactor?: number,
218
+ forceAdminPorts?: number[],
214
219
  ): Promise<
215
220
  [childProcess.ChildProcessWithoutNullStreams, Array<string>, Record<number, PortsInfo>]
216
221
  > {
217
- const generateArgs = [
218
- 'sandbox',
222
+ const generateArgs = ['sandbox'];
223
+
224
+ if (forceAdminPorts !== undefined && forceAdminPorts.length > 0) {
225
+ generateArgs.push('--force-admin-ports', forceAdminPorts.join(','));
226
+ }
227
+
228
+ generateArgs.push(
219
229
  '--piped',
220
230
  'generate',
221
231
  '--num-sandboxes',
@@ -223,7 +233,8 @@ async function spawnSandboxes(
223
233
  '--app-id',
224
234
  appId,
225
235
  '--run',
226
- ];
236
+ );
237
+
227
238
  let appPorts = '';
228
239
  for (let i = 1; i <= nAgents; i++) {
229
240
  const appPort = await getPort();
@@ -240,6 +251,7 @@ async function spawnSandboxes(
240
251
  generateArgs.push('--target-arc-factor', targetArcFactor.toString());
241
252
  }
242
253
  generateArgs.push('--bootstrap', bootStrapUrl, 'quic', relayUrl);
254
+ // console.log('GENERATE ARGS: ', generateArgs);
243
255
 
244
256
  let readyConductors = 0;
245
257
  const portsInfo: Record<number, PortsInfo> = {};
@@ -293,7 +305,7 @@ app.whenReady().then(async () => {
293
305
  if (CLI_OPTS.happOrWebhappPath.type === 'webhapp') {
294
306
  happTargetDir = path.join(DATA_ROOT_DIR, 'apps', CLI_OPTS.appId);
295
307
  const uiTargetDir = path.join(happTargetDir, 'ui');
296
- await rustUtils.saveHappOrWebhapp(
308
+ await rustUtils.unpackAndSaveWebhapp(
297
309
  CLI_OPTS.happOrWebhappPath.path,
298
310
  CLI_OPTS.appId,
299
311
  uiTargetDir,
@@ -311,6 +323,7 @@ app.whenReady().then(async () => {
311
323
  CLI_OPTS.appId,
312
324
  CLI_OPTS.networkSeed,
313
325
  CLI_OPTS.targetArcFactor,
326
+ CLI_OPTS.forceAdminPorts,
314
327
  );
315
328
 
316
329
  const lairUrls: string[] = [];
@@ -14,6 +14,7 @@ export type CliOpts = {
14
14
  relayUrl?: string;
15
15
  bootstrapUrl?: string;
16
16
  openDevtools?: boolean;
17
+ forceAdminPorts?: string;
17
18
  };
18
19
 
19
20
  export type CliOptsValidated = {
@@ -27,6 +28,7 @@ export type CliOptsValidated = {
27
28
  bootstrapUrl: string | undefined;
28
29
  happOrWebhappPath: HappOrWebhappPath;
29
30
  openDevtools: boolean;
31
+ forceAdminPorts: number[] | undefined;
30
32
  };
31
33
 
32
34
  export type HappOrWebhappPath = {
@@ -87,6 +89,20 @@ export function validateCliArgs(
87
89
  const holochainPath = cliOpts.holochainPath;
88
90
  const numAgents = cliOpts.numAgents ? cliOpts.numAgents : 2;
89
91
 
92
+ let forceAdminPorts: number[] | undefined;
93
+ if (cliOpts.forceAdminPorts !== undefined) {
94
+ forceAdminPorts = cliOpts.forceAdminPorts.split(',').map((portStr) => {
95
+ const portInt = parseInt(portStr);
96
+
97
+ if (Number.isNaN(portInt)) {
98
+ throw new Error(
99
+ `The --force-admin-ports must be a comma-separated list of valid port numbers, but got: ${cliOpts.forceAdminPorts}`,
100
+ );
101
+ }
102
+ return portInt;
103
+ });
104
+ }
105
+
90
106
  return {
91
107
  appId,
92
108
  holochainPath,
@@ -104,5 +120,6 @@ export function validateCliArgs(
104
120
  ? { type: 'happ', path: happOrWebhappPath }
105
121
  : { type: 'webhapp', path: happOrWebhappPath },
106
122
  openDevtools: cliOpts.openDevtools ? true : false,
123
+ forceAdminPorts,
107
124
  };
108
125
  }