dsh-ris-ide 1.8.0 → 1.8.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 +5 -3
- package/bin/risd.mjs +14 -17
- package/lib/client.js +400 -93
- package/lib/debug/vendor/README.md +14 -0
- package/lib/debug/vendor/jdwp/client.js +9 -4
- package/lib/debug/vendor/src/jdwp/client.ts +12 -5
- package/lib/index.js +794 -48
- package/lib/proxybridge-bundle.js +1 -1
- package/lib/proxybridge-health.js +206 -0
- package/lib/redirector.js +1181 -90
- package/lib/risd/lifecycle.js +9 -3
- package/lib/risd/server.js +762 -26
- package/lib/risd/ui.js +419 -98
- package/lib/risd-client.js +4 -1
- package/lib/startup.js +27 -7
- package/package.json +2 -2
- package/test/client-viewer.test.mjs +299 -120
- package/test/clipboard.test.mjs +259 -0
- package/test/debug-engine.test.mjs +3 -1
- package/test/dsh-origin.test.mjs +4 -11
- package/test/dsh-window-refresh.test.mjs +166 -1
- package/test/harness.test.mjs +1 -1
- package/test/helpers/cmd.mjs +29 -0
- package/test/helpers/tgz.mjs +71 -0
- package/test/host-search.test.mjs +18 -11
- package/test/host-tail.test.mjs +119 -24
- package/test/proxy-route.test.mjs +61 -0
- package/test/proxy-window.test.mjs +5 -0
- package/test/proxy.test.mjs +13 -1
- package/test/proxybridge-bundle.test.mjs +1 -59
- package/test/proxybridge-health.test.mjs +116 -0
- package/test/redirector-bundle.test.mjs +21 -67
- package/test/redirector.test.mjs +395 -5
- package/test/risd-api.test.mjs +114 -17
- package/test/risd-bridge-degrade.test.mjs +3 -29
- package/test/risd-engine.test.mjs +13 -50
- package/test/risd-entry.test.mjs +0 -37
- package/test/risd-follow-start.test.mjs +101 -0
- package/test/risd-git.test.mjs +7 -5
- package/test/risd-handoff.test.mjs +6 -50
- package/test/risd-helpers.mjs +150 -3
- package/test/risd-host-p2.test.mjs +2 -30
- package/test/risd-lifecycle.test.mjs +25 -0
- package/test/risd-programs.test.mjs +4 -34
- package/test/risd-restart.test.mjs +104 -0
- package/test/risd-review-p2.test.mjs +0 -13
- package/test/risd-shutdown.test.mjs +5 -38
- package/test/risd-teardown.test.mjs +8 -27
- package/test/risd-ui.test.mjs +322 -4
- package/test/risd-write.test.mjs +2 -1
- package/test/startup-reconcile.test.mjs +44 -8
- package/test/proxy-restart.test.mjs +0 -37
package/lib/risd/lifecycle.js
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
// proxy follows dsh (its lease keeps the tunnel alive) and programs/debug keep
|
|
8
8
|
// running when the last dsh window closes, because the maintenance page can be the
|
|
9
9
|
// only UI on the machine.
|
|
10
|
+
//
|
|
11
|
+
// Following dsh is two-sided: with `proxy.followDsh` on, the engine starts when a
|
|
12
|
+
// dsh attaches and the tunnel is torn down when the last one leaves. The start half
|
|
13
|
+
// is never an elevation request — an automatic start must not pop a password dialog
|
|
14
|
+
// (m13910) — so a bridge that needs root is only reported on the page.
|
|
10
15
|
import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from 'node:fs'
|
|
11
16
|
import { join } from 'node:path'
|
|
12
17
|
|
|
@@ -16,7 +21,7 @@ export const LIFECYCLE_FILENAME = 'risd-lifecycle.json'
|
|
|
16
21
|
/** The four resources the page lets you tune, in page order. */
|
|
17
22
|
export const LIFECYCLE_RESOURCES = ['daemon', 'proxy', 'programs', 'debug']
|
|
18
23
|
|
|
19
|
-
/** Defaults:
|
|
24
|
+
/** Defaults: everything follows dsh except programs/debug, which outlive the window. */
|
|
20
25
|
export const LIFECYCLE_DEFAULTS = {
|
|
21
26
|
daemon: { followDsh: true },
|
|
22
27
|
proxy: { followDsh: true },
|
|
@@ -60,10 +65,11 @@ export function normalizeLifecycle(input) {
|
|
|
60
65
|
value[resource] = Object.assign({}, defaults)
|
|
61
66
|
continue
|
|
62
67
|
}
|
|
68
|
+
const allowed = Object.keys(defaults)
|
|
63
69
|
for (const key of Object.keys(given)) {
|
|
64
|
-
if (key
|
|
70
|
+
if (allowed.includes(key) || FORCED_KEYS.includes(key)) continue
|
|
65
71
|
// Silently ignoring an unknown key made a typo look saved (review A2-P2-5).
|
|
66
|
-
errors.push(`${resource}.${key} 不是可配置项(只能配置
|
|
72
|
+
errors.push(`${resource}.${key} 不是可配置项(只能配置 ${allowed.join('/')})`)
|
|
67
73
|
}
|
|
68
74
|
for (const key of FORCED_KEYS) {
|
|
69
75
|
if (given[key] !== undefined) {
|