@holochain/hc-spin 0.200.0
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/.editorconfig +9 -0
- package/.eslintignore +4 -0
- package/.eslintrc +31 -0
- package/.prettierignore +6 -0
- package/.prettierrc.yaml +3 -0
- package/.vscode/extensions.json +3 -0
- package/.vscode/launch.json +39 -0
- package/.vscode/settings.json +12 -0
- package/.yarnrc.yml +1 -0
- package/README.md +48 -0
- package/build/entitlements.mac.plist +12 -0
- package/build/icon.icns +0 -0
- package/build/icon.ico +0 -0
- package/build/icon.png +0 -0
- package/cli/cli.js +18 -0
- package/dist/cli.js +18 -0
- package/dist/main/index.js +13513 -0
- package/dist/preload/index.js +5 -0
- package/dist/renderer/assets/renderer-2UdJ5Bnz.js +1 -0
- package/dist/renderer/index.html +44 -0
- package/dist/renderer/indexNotFound1.html +44 -0
- package/dist/renderer/indexNotFound2.html +44 -0
- package/docs/DEVSETUP.md +36 -0
- package/electron.vite.config.ts +22 -0
- package/package.json +51 -0
- package/resources/icon.png +0 -0
- package/rust-utils/.yarnrc.yml +1 -0
- package/rust-utils/Cargo.toml +44 -0
- package/rust-utils/build.rs +5 -0
- package/rust-utils/index.d.ts +33 -0
- package/rust-utils/index.js +258 -0
- package/rust-utils/package.json +31 -0
- package/rust-utils/src/decode_webhapp.rs +112 -0
- package/rust-utils/src/lib.rs +7 -0
- package/rust-utils/src/types.rs +52 -0
- package/rust-utils/src/utils.rs +4 -0
- package/rust-utils/src/zome_call_signer.rs +99 -0
- package/src/main/index.ts +305 -0
- package/src/main/validateArgs.ts +90 -0
- package/src/main/windows.ts +178 -0
- package/src/preload/index.ts +8 -0
- package/src/renderer/index.html +44 -0
- package/src/renderer/indexNotFound1.html +44 -0
- package/src/renderer/indexNotFound2.html +44 -0
- package/src/renderer/src/renderer.ts +1 -0
- package/tsconfig.json +4 -0
- package/tsconfig.node.json +8 -0
- package/tsconfig.web.json +7 -0
package/.editorconfig
ADDED
package/.eslintignore
ADDED
package/.eslintrc
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"parser": "@typescript-eslint/parser",
|
|
4
|
+
"parserOptions": {
|
|
5
|
+
"parser": "@typescript-eslint/parser",
|
|
6
|
+
"ecmaVersion": 2020,
|
|
7
|
+
"sourceType": "module"
|
|
8
|
+
},
|
|
9
|
+
"env": {
|
|
10
|
+
"browser": true,
|
|
11
|
+
"es2017": true,
|
|
12
|
+
"node": true
|
|
13
|
+
},
|
|
14
|
+
"extends": [
|
|
15
|
+
"eslint:recommended",
|
|
16
|
+
"prettier",
|
|
17
|
+
"@electron-toolkit/eslint-config-ts/recommended",
|
|
18
|
+
"@electron-toolkit/eslint-config-prettier"
|
|
19
|
+
],
|
|
20
|
+
"plugins": ["@typescript-eslint", "prettier", "simple-import-sort"],
|
|
21
|
+
"rules": {
|
|
22
|
+
"prettier/prettier": "error",
|
|
23
|
+
"vue/attribute-hyphenation": "off",
|
|
24
|
+
"vue/no-multiple-template-root": "off",
|
|
25
|
+
"vue/multi-word-component-names": "off",
|
|
26
|
+
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
|
|
27
|
+
"simple-import-sort/imports": "error",
|
|
28
|
+
"simple-import-sort/exports": "error",
|
|
29
|
+
"@typescript-eslint/explicit-function-return-type": "off"
|
|
30
|
+
}
|
|
31
|
+
}
|
package/.prettierignore
ADDED
package/.prettierrc.yaml
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"configurations": [
|
|
4
|
+
{
|
|
5
|
+
"name": "Debug Main Process",
|
|
6
|
+
"type": "node",
|
|
7
|
+
"request": "launch",
|
|
8
|
+
"cwd": "${workspaceRoot}",
|
|
9
|
+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite",
|
|
10
|
+
"windows": {
|
|
11
|
+
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/electron-vite.cmd"
|
|
12
|
+
},
|
|
13
|
+
"runtimeArgs": ["--sourcemap"],
|
|
14
|
+
"env": {
|
|
15
|
+
"REMOTE_DEBUGGING_PORT": "9222"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "Debug Renderer Process",
|
|
20
|
+
"port": 9222,
|
|
21
|
+
"request": "attach",
|
|
22
|
+
"type": "chrome",
|
|
23
|
+
"webRoot": "${workspaceFolder}/src/renderer",
|
|
24
|
+
"timeout": 60000,
|
|
25
|
+
"presentation": {
|
|
26
|
+
"hidden": true
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"compounds": [
|
|
31
|
+
{
|
|
32
|
+
"name": "Debug All",
|
|
33
|
+
"configurations": ["Debug Main Process", "Debug Renderer Process"],
|
|
34
|
+
"presentation": {
|
|
35
|
+
"order": 1
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"[typescript]": {
|
|
3
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
4
|
+
},
|
|
5
|
+
"[javascript]": {
|
|
6
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
7
|
+
},
|
|
8
|
+
"[json]": {
|
|
9
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
10
|
+
},
|
|
11
|
+
"editor.formatOnSave": true,
|
|
12
|
+
}
|
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# hc-spin
|
|
2
|
+
|
|
3
|
+
CLI to run Holochain apps in development mode.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
Usage: hc-spin [options] <path>
|
|
7
|
+
|
|
8
|
+
CLI to run Holochain aps during development.
|
|
9
|
+
|
|
10
|
+
Arguments:
|
|
11
|
+
path Path to .webhapp or .happ file to launch. If a .happ file is passed, either a UI path must be specified via
|
|
12
|
+
--ui-path or a port pointing to a localhost server via --ui-port
|
|
13
|
+
|
|
14
|
+
Options:
|
|
15
|
+
-V, --version output the version number
|
|
16
|
+
--app-id <string> Install the app with a specific app id. By default the app id is derived from the name of the .webhapp/.happ
|
|
17
|
+
file that you pass but this option allows you to set it explicitly
|
|
18
|
+
--bootstrap-url <url> Url of the bootstrap server to use. By default, hc spin spins up a local development bootstrap server for you
|
|
19
|
+
but this argument allows you to specify a custom one.
|
|
20
|
+
--holochain-path <path> Set the path to the holochain binary [default: holochain].
|
|
21
|
+
-n, --num-agents <number> How many agents to spawn the app for.
|
|
22
|
+
--network-seed <string> Install the app with a specific network seed.
|
|
23
|
+
--ui-path <path> Path to the folder containing the index.html of the webhapp's UI.
|
|
24
|
+
--ui-port <number> Port pointing to a localhost dev server that serves your UI assets.
|
|
25
|
+
--signaling-url <url> Url of the signaling server to use. By default, hc spin spins up a local development signaling server for you
|
|
26
|
+
but this argument allows you to specify a custom one.
|
|
27
|
+
-h, --help display help for command
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Example Commands
|
|
31
|
+
|
|
32
|
+
Run a .happ file with 2 agents connected to the UI of your dev server running on port 8888:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
hc-spin -n 2 --ui-port 8888 path/to/your/happ-file.happ
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Run a fully packaged .webhapp for 2 agents:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
hc-spin -n 2 path/to/your/webhapp-file.webhapp
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Run a .happ file with 2 agents connected to the UI assets residing at the provided path:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
hc-spin -n 2 --ui-path path/to/directory/containing/ui/assets path/to/your/happ-file.happ
|
|
48
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>com.apple.security.cs.allow-jit</key>
|
|
6
|
+
<true/>
|
|
7
|
+
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
|
8
|
+
<true/>
|
|
9
|
+
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
|
10
|
+
<true/>
|
|
11
|
+
</dict>
|
|
12
|
+
</plist>
|
package/build/icon.icns
ADDED
|
Binary file
|
package/build/icon.ico
ADDED
|
Binary file
|
package/build/icon.png
ADDED
|
Binary file
|
package/cli/cli.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require('child_process');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const electronBinary = path.resolve(__dirname, '../node_modules/.bin/electron');
|
|
6
|
+
|
|
7
|
+
const child = spawn(
|
|
8
|
+
electronBinary,
|
|
9
|
+
[path.resolve(__dirname, 'main/index.js'), ...process.argv.slice(2)],
|
|
10
|
+
{
|
|
11
|
+
stdio: 'inherit',
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
// Handle child process exit
|
|
16
|
+
child.on('exit', (code, _signal) => {
|
|
17
|
+
process.exit(code);
|
|
18
|
+
});
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const { spawn } = require('child_process');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
|
|
5
|
+
const electronBinary = path.resolve(__dirname, '../node_modules/.bin/electron');
|
|
6
|
+
|
|
7
|
+
const child = spawn(
|
|
8
|
+
electronBinary,
|
|
9
|
+
[path.resolve(__dirname, 'main/index.js'), ...process.argv.slice(2)],
|
|
10
|
+
{
|
|
11
|
+
stdio: 'inherit',
|
|
12
|
+
},
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
// Handle child process exit
|
|
16
|
+
child.on('exit', (code, _signal) => {
|
|
17
|
+
process.exit(code);
|
|
18
|
+
});
|