@holochain/hc-spin 0.300.0 → 0.300.2
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 +8 -0
- package/dist/main/index.js +5 -5
- package/package.json +1 -1
- package/src/main/index.ts +1 -1
- package/src/main/windows.ts +4 -4
package/README.md
CHANGED
|
@@ -20,6 +20,14 @@ To install the latest version compatible with **holochain 0.2.x**:
|
|
|
20
20
|
npm install --save-dev @holochain/hc-spin@">=0.200.0 <0.300.0"
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
To install the latest version compatible with **holochain 0.3.x**:
|
|
24
|
+
|
|
25
|
+
⚠️ Requires `@holochain/client 0.17.0-dev.5` or newer ⚠️
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
npm install --save-dev @holochain/hc-spin@">=0.300.0 <0.400.0"
|
|
29
|
+
```
|
|
30
|
+
|
|
23
31
|
## Usage (holochain 0.2)
|
|
24
32
|
|
|
25
33
|
```
|
package/dist/main/index.js
CHANGED
|
@@ -95,7 +95,7 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
|
|
|
95
95
|
icon = electron.nativeImage.createFromPath(iconPath);
|
|
96
96
|
} else {
|
|
97
97
|
try {
|
|
98
|
-
const iconResponse = await electron.net.fetch(`http://
|
|
98
|
+
const iconResponse = await electron.net.fetch(`http://localhost:${uiSource.port}/icon.png`);
|
|
99
99
|
if (iconResponse.status === 404 && agentNum === 1) {
|
|
100
100
|
console.warn(
|
|
101
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"
|
|
@@ -131,9 +131,9 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
|
|
|
131
131
|
happWindow.webContents.openDevTools();
|
|
132
132
|
if (uiSource.type === "port") {
|
|
133
133
|
try {
|
|
134
|
-
await electron.net.fetch(`http://
|
|
134
|
+
await electron.net.fetch(`http://localhost:${uiSource.port}/index.html`);
|
|
135
135
|
} catch (e) {
|
|
136
|
-
console.error(`No index.html file found at http://
|
|
136
|
+
console.error(`No index.html file found at http://localhost:${uiSource.port}/index.html`, e);
|
|
137
137
|
if (utils.is.dev && process.env["ELECTRON_RENDERER_URL"]) {
|
|
138
138
|
happWindow.loadURL(process.env["ELECTRON_RENDERER_URL"]);
|
|
139
139
|
} else {
|
|
@@ -142,7 +142,7 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
|
|
|
142
142
|
happWindow.show();
|
|
143
143
|
return happWindow;
|
|
144
144
|
}
|
|
145
|
-
await happWindow.loadURL(`http://
|
|
145
|
+
await happWindow.loadURL(`http://localhost:${uiSource.port}`);
|
|
146
146
|
} else if (uiSource.type === "path") {
|
|
147
147
|
try {
|
|
148
148
|
await happWindow.loadURL(`webhapp://webhappwindow/index.html`);
|
|
@@ -11804,7 +11804,7 @@ const menu = electron.Menu.buildFromTemplate([
|
|
|
11804
11804
|
]);
|
|
11805
11805
|
const rustUtils = require("@holochain/hc-spin-rust-utils");
|
|
11806
11806
|
const cli = new commander.Command();
|
|
11807
|
-
cli.name("hc-spin").description("CLI to run Holochain aps during development.").version(`0.300.
|
|
11807
|
+
cli.name("hc-spin").description("CLI to run Holochain aps during development.").version(`0.300.2 (for holochain 0.3.x)`).argument(
|
|
11808
11808
|
"<path>",
|
|
11809
11809
|
"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"
|
|
11810
11810
|
).option(
|
package/package.json
CHANGED
package/src/main/index.ts
CHANGED
|
@@ -28,7 +28,7 @@ const cli = new Command();
|
|
|
28
28
|
cli
|
|
29
29
|
.name('hc-spin')
|
|
30
30
|
.description('CLI to run Holochain aps during development.')
|
|
31
|
-
.version(`0.300.
|
|
31
|
+
.version(`0.300.2 (for holochain 0.3.x)`)
|
|
32
32
|
.argument(
|
|
33
33
|
'<path>',
|
|
34
34
|
'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',
|
package/src/main/windows.ts
CHANGED
|
@@ -67,7 +67,7 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
|
|
|
67
67
|
icon = nativeImage.createFromPath(iconPath);
|
|
68
68
|
} else {
|
|
69
69
|
try {
|
|
70
|
-
const iconResponse = await net.fetch(`http://
|
|
70
|
+
const iconResponse = await net.fetch(`http://localhost:${uiSource.port}/icon.png`);
|
|
71
71
|
if (iconResponse.status === 404 && agentNum === 1) {
|
|
72
72
|
console.warn(
|
|
73
73
|
'\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',
|
|
@@ -110,9 +110,9 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
|
|
|
110
110
|
if (uiSource.type === 'port') {
|
|
111
111
|
try {
|
|
112
112
|
// Check whether dev server is responsive and index.html exists
|
|
113
|
-
await net.fetch(`http://
|
|
113
|
+
await net.fetch(`http://localhost:${uiSource.port}/index.html`);
|
|
114
114
|
} catch (e) {
|
|
115
|
-
console.error(`No index.html file found at http://
|
|
115
|
+
console.error(`No index.html file found at http://localhost:${uiSource.port}/index.html`, e);
|
|
116
116
|
if (is.dev && process.env['ELECTRON_RENDERER_URL']) {
|
|
117
117
|
happWindow.loadURL(process.env['ELECTRON_RENDERER_URL']);
|
|
118
118
|
} else {
|
|
@@ -121,7 +121,7 @@ electron.contextBridge.exposeInMainWorld("__HC_LAUNCHER_ENV__", {
|
|
|
121
121
|
happWindow.show();
|
|
122
122
|
return happWindow;
|
|
123
123
|
}
|
|
124
|
-
await happWindow.loadURL(`http://
|
|
124
|
+
await happWindow.loadURL(`http://localhost:${uiSource.port}`);
|
|
125
125
|
} else if (uiSource.type === 'path') {
|
|
126
126
|
try {
|
|
127
127
|
await happWindow.loadURL(`webhapp://webhappwindow/index.html`);
|