@sparkelf/dsh-patch-web-base-path 0.1.0-rc.9 → 0.2.0-rc.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.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/package.json +21 -21
- package/patches/web-base-path.patch +18 -14
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write patches/npm/web-base-path/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: b6892beb1608c00d0482537dbfb84c55646defdc
|
|
6
|
+
README.zh.md: cf2b02598060a868bdeea3fda75966a5b7c78b97
|
package/README.md
CHANGED
|
@@ -6,4 +6,4 @@ This data-only package adds complete reverse-proxy mount-prefix support to the e
|
|
|
6
6
|
|
|
7
7
|
The payload intentionally spans the WebServer, frontend static owner, Web app startup and shell, Connection browser transport, Session export, and Web source assets. Splitting those files would permit partially mounted deployments, so they share one patch lifecycle. Default empty-prefix behavior remains byte-for-byte root-relative from the user's perspective.
|
|
8
8
|
|
|
9
|
-
The target is official source base `
|
|
9
|
+
The target is official source base `fb2c4b9e698e30edb738bca4cf0618587db7d203`; the package has no JavaScript entry, lifecycle script, compatibility fallback, or credential data. Retire it when official DSH ships equivalent end-to-end base-path behavior.
|
package/README.zh.md
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
|
|
7
7
|
payload有意跨越WebServer、frontend static owner、Web app startup/shell、Connection browser transport、Session export与Web source assets。拆分这些files会允许partial mounted deployments,因此它们共享一个patch lifecycle。empty-prefix default behavior从用户视角保持root-relative不变。
|
|
8
8
|
|
|
9
|
-
target是official source base `
|
|
9
|
+
target是official source base `fb2c4b9e698e30edb738bca4cf0618587db7d203`;package没有JavaScript entry、lifecycle script、compatibility fallback或credential data。official DSH发布等价end-to-end base-path behavior后retire。
|
package/package.json
CHANGED
|
@@ -1,29 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@sparkelf/dsh-patch-web-base-path",
|
|
3
|
-
"version": "0.1.0-rc.9",
|
|
4
2
|
"description": "Data-only exact official-source patch for complete reverse-proxy Web base-path support",
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"access": "public"
|
|
7
|
-
},
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "git",
|
|
10
|
-
"url": "git+https://github.com/SparkElf/deepseek-harness-plus.git",
|
|
11
|
-
"directory": "patches/npm/web-base-path"
|
|
12
|
-
},
|
|
13
|
-
"type": "module",
|
|
14
|
-
"files": [
|
|
15
|
-
"patches/*.patch"
|
|
16
|
-
],
|
|
17
|
-
"license": "MIT",
|
|
18
3
|
"dshPatch": {
|
|
19
4
|
"formatVersion": 1,
|
|
20
5
|
"variants": [
|
|
21
6
|
{
|
|
7
|
+
"dsh": ">=0.1.6-alpha.1",
|
|
8
|
+
"file": "./patches/web-base-path.patch",
|
|
22
9
|
"id": "web-reverse-proxy-base-path",
|
|
23
|
-
"dsh": ">=0.1.2-alpha.1",
|
|
24
10
|
"target": {
|
|
11
|
+
"baseRevision": "0a15e36e7f82b6ed45af6fa9759f29b40dcd965d",
|
|
25
12
|
"kind": "dsh-source",
|
|
26
|
-
"baseRevision": "cd5ef8148158c3a752a658978873241fdf8e2bbc",
|
|
27
13
|
"paths": [
|
|
28
14
|
"apps/web/",
|
|
29
15
|
"packages/bundle/web-app/",
|
|
@@ -32,9 +18,23 @@
|
|
|
32
18
|
"packages/host/webserver/",
|
|
33
19
|
"packages/session-query/session-log-export/"
|
|
34
20
|
]
|
|
35
|
-
}
|
|
36
|
-
"file": "./patches/web-base-path.patch"
|
|
21
|
+
}
|
|
37
22
|
}
|
|
38
23
|
]
|
|
39
|
-
}
|
|
40
|
-
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"patches/*.patch"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"name": "@sparkelf/dsh-patch-web-base-path",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"directory": "patches/npm/web-base-path",
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/SparkElf/deepseek-harness-plus.git"
|
|
37
|
+
},
|
|
38
|
+
"type": "module",
|
|
39
|
+
"version": "0.2.0-rc.2"
|
|
40
|
+
}
|
|
@@ -41,10 +41,10 @@ index 20a428fee6..a7cc973d9e 100644
|
|
|
41
41
|
"type": "image/svg+xml",
|
|
42
42
|
"purpose": "any"
|
|
43
43
|
diff --git a/packages/bundle/web-app/cordis.patch.yml b/packages/bundle/web-app/cordis.patch.yml
|
|
44
|
-
index
|
|
44
|
+
index 346abe5347..62b69153d1 100644
|
|
45
45
|
--- a/packages/bundle/web-app/cordis.patch.yml
|
|
46
46
|
+++ b/packages/bundle/web-app/cordis.patch.yml
|
|
47
|
-
@@ -
|
|
47
|
+
@@ -138,6 +138,7 @@
|
|
48
48
|
config:
|
|
49
49
|
host: !!js ctx.webStartup.host ?? '127.0.0.1'
|
|
50
50
|
port: !!js ctx.webStartup.port ?? 3080
|
|
@@ -53,10 +53,10 @@ index 9ee698044e..57757915ba 100644
|
|
|
53
53
|
compressionLevel: 1
|
|
54
54
|
compressionThresholdBytes: 1024
|
|
55
55
|
diff --git a/packages/bundle/web-app/src/index.ts b/packages/bundle/web-app/src/index.ts
|
|
56
|
-
index
|
|
56
|
+
index 63edf46529..dab7e416b5 100644
|
|
57
57
|
--- a/packages/bundle/web-app/src/index.ts
|
|
58
58
|
+++ b/packages/bundle/web-app/src/index.ts
|
|
59
|
-
@@ -
|
|
59
|
+
@@ -147,9 +147,9 @@ function webSurfacePrompt(webUrl: string): string {
|
|
60
60
|
|
|
61
61
|
/** Resolve the canonical loopback URL from the active Web server. */
|
|
62
62
|
function localWebUrl(ctx: Context): string {
|
|
@@ -69,7 +69,7 @@ index d0b2635f8e..669dc756ea 100644
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
@@ -
|
|
72
|
+
@@ -265,7 +265,7 @@ export function apply(ctx: Context, config: Config): void {
|
|
73
73
|
const port = connectionCtx.webServer.port
|
|
74
74
|
const lanUrl = lanCandidate === undefined
|
|
75
75
|
? undefined
|
|
@@ -197,7 +197,7 @@ index 3d218f31e6..4f717338a7 100644
|
|
|
197
197
|
ctx.effect(() => ctx.webServer.registerFallback(async (req, res) => {
|
|
198
198
|
// Non-GET/HEAD without a matching named route is 405 (fallback-only
|
|
199
199
|
diff --git a/packages/host/webserver/src/index.ts b/packages/host/webserver/src/index.ts
|
|
200
|
-
index bc41100de9..
|
|
200
|
+
index bc41100de9..cfcb667bb4 100644
|
|
201
201
|
--- a/packages/host/webserver/src/index.ts
|
|
202
202
|
+++ b/packages/host/webserver/src/index.ts
|
|
203
203
|
@@ -61,6 +61,8 @@ export interface Config {
|
|
@@ -209,11 +209,15 @@ index bc41100de9..205f170baa 100644
|
|
|
209
209
|
/** Response compression for socket-backed HTTP requests. @default 'none' */
|
|
210
210
|
compression?: 'none' | 'gzip'
|
|
211
211
|
/** Gzip DEFLATE level from 0 through 9. @default 1 */
|
|
212
|
-
@@ -69,6 +71,
|
|
212
|
+
@@ -69,6 +71,24 @@ export interface Config {
|
|
213
213
|
compressionThresholdBytes?: number
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
+/**
|
|
216
|
+
+/**
|
|
217
|
+
+ * Validate and canonicalize the external reverse-proxy mount prefix.
|
|
218
|
+
+ * @param value - configured external URL prefix.
|
|
219
|
+
+ * @returns the empty root prefix or one absolute path without a trailing slash.
|
|
220
|
+
+ */
|
|
217
221
|
+export function normalizeWebBasePath(value: string | undefined): string {
|
|
218
222
|
+ const candidate = value?.trim() ?? ''
|
|
219
223
|
+ if (candidate === '' || candidate === '/') return ''
|
|
@@ -230,7 +234,7 @@ index bc41100de9..205f170baa 100644
|
|
|
230
234
|
const DEFAULT_COMPRESSION = 'none' as const
|
|
231
235
|
const DEFAULT_COMPRESSION_LEVEL = 1
|
|
232
236
|
const DEFAULT_COMPRESSION_THRESHOLD_BYTES = 1024
|
|
233
|
-
@@ -125,6 +
|
|
237
|
+
@@ -125,6 +145,7 @@ export class WebServer extends Service {
|
|
234
238
|
static Config: z<Config> = z.object({
|
|
235
239
|
host: z.union([z.const('127.0.0.1'), z.const('0.0.0.0')]).required(),
|
|
236
240
|
port: z.natural().max(65535).required(),
|
|
@@ -238,7 +242,7 @@ index bc41100de9..205f170baa 100644
|
|
|
238
242
|
compression: z.union([z.const('none'), z.const('gzip')]).default(DEFAULT_COMPRESSION),
|
|
239
243
|
compressionLevel: z.number().step(1).min(0).max(9).default(DEFAULT_COMPRESSION_LEVEL),
|
|
240
244
|
compressionThresholdBytes: z.natural().default(DEFAULT_COMPRESSION_THRESHOLD_BYTES),
|
|
241
|
-
@@ -138,11 +
|
|
245
|
+
@@ -138,11 +159,13 @@ export class WebServer extends Service {
|
|
242
246
|
private fallback: WebRoute['handler'] | undefined
|
|
243
247
|
private server!: Server
|
|
244
248
|
private listenedPort!: number
|
|
@@ -252,7 +256,7 @@ index bc41100de9..205f170baa 100644
|
|
|
252
256
|
this.gzip = resolved.compression === 'gzip' ? createGzipMiddleware(resolved) : undefined
|
|
253
257
|
}
|
|
254
258
|
|
|
255
|
-
@@ -156,6 +
|
|
259
|
+
@@ -156,6 +179,11 @@ export class WebServer extends Service {
|
|
256
260
|
return this.config.host
|
|
257
261
|
}
|
|
258
262
|
|
|
@@ -264,7 +268,7 @@ index bc41100de9..205f170baa 100644
|
|
|
264
268
|
/**
|
|
265
269
|
* Register a named route. Duplicate (kind, path) throws — route patterns are
|
|
266
270
|
* a composition-level contract, so a collision is a misconfiguration.
|
|
267
|
-
@@ -240,6 +
|
|
271
|
+
@@ -240,6 +268,13 @@ export class WebServer extends Service {
|
|
268
272
|
// client dropping mid-body). Per-request failures log and answer 400 —
|
|
269
273
|
// never a process exit.
|
|
270
274
|
this.server = createServer((req, res) => {
|
|
@@ -278,7 +282,7 @@ index bc41100de9..205f170baa 100644
|
|
|
278
282
|
const next = (): void => {
|
|
279
283
|
void handle(req, res).catch((err: unknown) => {
|
|
280
284
|
this.ctx.logger.warn(err instanceof Error ? err : new Error(String(err)))
|
|
281
|
-
@@ -266,8 +
|
|
285
|
+
@@ -266,8 +301,13 @@ export class WebServer extends Service {
|
|
282
286
|
})
|
|
283
287
|
let route: WebUpgradeRoute | undefined
|
|
284
288
|
try {
|
|
@@ -294,7 +298,7 @@ index bc41100de9..205f170baa 100644
|
|
|
294
298
|
} catch (error) {
|
|
295
299
|
this.ctx.logger.warn(error instanceof Error ? error : new Error(String(error)))
|
|
296
300
|
socket.destroy()
|
|
297
|
-
@@ -314,6 +
|
|
301
|
+
@@ -314,6 +354,16 @@ export class WebServer extends Service {
|
|
298
302
|
}, 'webServer.listen')
|
|
299
303
|
}
|
|
300
304
|
|