bare-stow 0.3.5 → 0.3.6
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 +1 -1
- package/lib/rpc/bare-rpc.js +12 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ ipc.write(Buffer.from('hello from the host'))
|
|
|
65
65
|
const code = await ipc.terminate()
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
The bundle imports `bare-stow-runtime`, and the RPC library if a `server` is requested, so the package containing the entry must depend on them.
|
|
68
|
+
The bundle imports `bare-stow-runtime`, and the RPC library if a `server` is requested, so the package containing the entry must depend on them. For `bare-rpc`, that is `bare-rpc` and `bare-abort-controller`, which gives handlers the `signal` that aborts when the peer cancels a request.
|
|
69
69
|
|
|
70
70
|
`start()` accepts `timeout`, how long to wait in milliseconds for the bundle to signal ready, and `grace`, how long a terminating bundle gets to run `stop()` and exit before it's killed. `timeout` defaults to waiting indefinitely and `grace` to 5 seconds. On Windows, a sidecar is killed along with its host, so `stop()` only runs when the host terminates it.
|
|
71
71
|
|
package/lib/rpc/bare-rpc.js
CHANGED
|
@@ -34,7 +34,7 @@ internal fun attach(ipc: Ipc, handlers: Handlers): Rpc {
|
|
|
34
34
|
return {
|
|
35
35
|
source,
|
|
36
36
|
dependencies: {
|
|
37
|
-
'com.github.holepunchto.bare-rpc-kotlin:bare-rpc-kotlin': 'v0.
|
|
37
|
+
'com.github.holepunchto.bare-rpc-kotlin:bare-rpc-kotlin': 'v0.6.0',
|
|
38
38
|
'com.github.holepunchto.bare-stow-host-kotlin:bare-stow-host-kotlin': 'v0.2.2'
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -64,7 +64,7 @@ func attach(_ ipc: IPC, _ handlers: Handlers?) -> RPC {
|
|
|
64
64
|
dependencies: {
|
|
65
65
|
'bare-rpc-swift': {
|
|
66
66
|
url: 'https://github.com/holepunchto/bare-rpc-swift',
|
|
67
|
-
from: '
|
|
67
|
+
from: '3.0.0',
|
|
68
68
|
products: ['BareRPC']
|
|
69
69
|
},
|
|
70
70
|
'bare-stow-host-swift': {
|
|
@@ -97,7 +97,7 @@ def attach(ipc: IPC, handlers: Handlers) -> RPC:
|
|
|
97
97
|
return {
|
|
98
98
|
source,
|
|
99
99
|
dependencies: {
|
|
100
|
-
'bare-rpc': '~=0.
|
|
100
|
+
'bare-rpc': '~=0.3.0',
|
|
101
101
|
'bare-stow-host': '~=0.2.1'
|
|
102
102
|
}
|
|
103
103
|
}
|
|
@@ -114,7 +114,7 @@ function javascript({ role, options }) {
|
|
|
114
114
|
const body = server
|
|
115
115
|
? `\
|
|
116
116
|
const router = new RPC.CommandRouter()
|
|
117
|
-
const rpc = new RPC(ipc, router)
|
|
117
|
+
const rpc = new RPC(ipc, router, { AbortController })
|
|
118
118
|
|
|
119
119
|
rpc.respond = router.respond.bind(router)
|
|
120
120
|
|
|
@@ -126,17 +126,19 @@ function javascript({ role, options }) {
|
|
|
126
126
|
|
|
127
127
|
handlers(router)
|
|
128
128
|
|
|
129
|
-
return new RPC(ipc, router)
|
|
129
|
+
return new RPC(ipc, router, { AbortController })
|
|
130
130
|
}
|
|
131
131
|
`
|
|
132
132
|
|
|
133
133
|
const source = esm
|
|
134
134
|
? `\
|
|
135
|
+
import AbortController from 'bare-abort-controller'
|
|
135
136
|
import RPC from 'bare-rpc'
|
|
136
137
|
|
|
137
138
|
export function attach(${params}) {
|
|
138
139
|
${body}`
|
|
139
140
|
: `\
|
|
141
|
+
const AbortController = require('bare-abort-controller')
|
|
140
142
|
const RPC = require('bare-rpc')
|
|
141
143
|
|
|
142
144
|
exports.attach = function attach(${params}) {
|
|
@@ -152,5 +154,9 @@ export type Handlers = (router: import('bare-rpc').CommandRouter) => void
|
|
|
152
154
|
export function attach(ipc: import('bare-stow-host').IPC, handlers: Handlers): import('bare-rpc')
|
|
153
155
|
`
|
|
154
156
|
|
|
155
|
-
return {
|
|
157
|
+
return {
|
|
158
|
+
source,
|
|
159
|
+
types,
|
|
160
|
+
dependencies: { 'bare-abort-controller': '^1.1.2', 'bare-rpc': '^2.0.0' }
|
|
161
|
+
}
|
|
156
162
|
}
|