@holochain/hc-spin 0.200.3 → 0.200.5
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 +20 -0
- package/dist/main/index.js +11 -1
- package/package.json +15 -3
- package/src/main/index.ts +16 -1
package/README.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
CLI to run Holochain apps in development mode.
|
|
4
4
|
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
To install the latest version compatible with **holochain 0.1.x**:
|
|
8
|
+
|
|
9
|
+
⚠️ Requires `@holochain/client 0.12.6` or newer ⚠️
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm install --save-dev @holochain/hc-spin@">=0.100.0 <0.200.0"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
To install the latest version compatible with **holochain 0.2.x**:
|
|
16
|
+
|
|
17
|
+
⚠️ Requires `@holochain/client 0.16.2` or newer ⚠️
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
npm install --save-dev @holochain/hc-spin@">=0.200.0 <0.300.0"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage (holochain 0.2)
|
|
24
|
+
|
|
5
25
|
```
|
|
6
26
|
Usage: hc-spin [options] <path>
|
|
7
27
|
|
package/dist/main/index.js
CHANGED
|
@@ -11744,7 +11744,7 @@ function validateCliArgs(cliArgs, cliOpts, appDataRootDir) {
|
|
|
11744
11744
|
}
|
|
11745
11745
|
const rustUtils = require("@holochain/hc-spin-rust-utils");
|
|
11746
11746
|
const cli = new commander.Command();
|
|
11747
|
-
cli.name("hc-spin").description("CLI to run Holochain aps during development.").version(`0.200.
|
|
11747
|
+
cli.name("hc-spin").description("CLI to run Holochain aps during development.").version(`0.200.4 (for holochain 0.2.x)`).argument(
|
|
11748
11748
|
"<path>",
|
|
11749
11749
|
"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"
|
|
11750
11750
|
).option(
|
|
@@ -11765,6 +11765,16 @@ cli.name("hc-spin").description("CLI to run Holochain aps during development.").
|
|
|
11765
11765
|
"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."
|
|
11766
11766
|
);
|
|
11767
11767
|
cli.parse();
|
|
11768
|
+
const rl = require("readline").createInterface({
|
|
11769
|
+
input: process.stdin,
|
|
11770
|
+
output: process.stdout
|
|
11771
|
+
});
|
|
11772
|
+
rl.on("SIGINT", function() {
|
|
11773
|
+
process.emit("SIGINT");
|
|
11774
|
+
});
|
|
11775
|
+
process.on("SIGINT", () => {
|
|
11776
|
+
electron.app.quit();
|
|
11777
|
+
});
|
|
11768
11778
|
const files = fs.readdirSync(electron.app.getPath("temp"));
|
|
11769
11779
|
const hcSpinFolders = files.filter((file) => file.startsWith(`hc-spin-`));
|
|
11770
11780
|
for (const folder of hcSpinFolders) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holochain/hc-spin",
|
|
3
|
-
"version": "0.200.
|
|
3
|
+
"version": "0.200.5",
|
|
4
4
|
"description": "CLI to run Holochain aps during development.",
|
|
5
5
|
"author": "matthme",
|
|
6
6
|
"homepage": "https://developer.holochain.org",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/holochain/hc-spin.git"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"holochain",
|
|
13
|
+
"developer",
|
|
14
|
+
"tools",
|
|
15
|
+
"tooling",
|
|
16
|
+
"developer-tools",
|
|
17
|
+
"cli"
|
|
18
|
+
],
|
|
7
19
|
"license": "MIT",
|
|
8
20
|
"main": "out/main/index.js",
|
|
9
21
|
"bin": {
|
|
@@ -23,12 +35,12 @@
|
|
|
23
35
|
"@electron-toolkit/preload": "^3.0.0",
|
|
24
36
|
"@electron-toolkit/utils": "^3.0.0",
|
|
25
37
|
"@holochain/client": "^0.16.3",
|
|
38
|
+
"@holochain/hc-spin-rust-utils": "0.200.2",
|
|
39
|
+
"@msgpack/msgpack": "^2.8.0",
|
|
26
40
|
"commander": "11.1.0",
|
|
27
41
|
"electron": "^28.1.1",
|
|
28
42
|
"electron-context-menu": "3.6.1",
|
|
29
43
|
"get-port": "7.0.0",
|
|
30
|
-
"@holochain/hc-spin-rust-utils": "0.200.2",
|
|
31
|
-
"@msgpack/msgpack": "^2.8.0",
|
|
32
44
|
"nanoid": "5.0.4",
|
|
33
45
|
"split": "1.0.1"
|
|
34
46
|
},
|
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 aps during development.')
|
|
30
|
-
.version(`0.200.
|
|
30
|
+
.version(`0.200.4 (for holochain 0.2.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',
|
|
@@ -61,6 +61,21 @@ cli.parse();
|
|
|
61
61
|
// console.log('Got CLI opts: ', cli.opts());
|
|
62
62
|
// console.log('Got CLI args: ', cli.args);
|
|
63
63
|
|
|
64
|
+
// In nix shell and on Windows SIGINT does not seem to be emitted so it is read from the command line instead.
|
|
65
|
+
// https://stackoverflow.com/questions/10021373/what-is-the-windows-equivalent-of-process-onsigint-in-node-js
|
|
66
|
+
const rl = require('readline').createInterface({
|
|
67
|
+
input: process.stdin,
|
|
68
|
+
output: process.stdout,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
rl.on('SIGINT', function () {
|
|
72
|
+
process.emit('SIGINT');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
process.on('SIGINT', () => {
|
|
76
|
+
app.quit();
|
|
77
|
+
});
|
|
78
|
+
|
|
64
79
|
// Garbage collect unused directories of previous runs
|
|
65
80
|
const files = fs.readdirSync(app.getPath('temp'));
|
|
66
81
|
const hcSpinFolders = files.filter((file) => file.startsWith(`hc-spin-`));
|