@huaqiu/component-gen-server 0.4.3 → 0.4.4
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/lib/standalone.mjs +2 -1
- package/package.json +5 -5
- package/src/standalone.ts +4 -1
package/lib/standalone.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import { createServer } from "node:http";
|
|
3
3
|
import { existsSync, mkdirSync, readFileSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { dirname, extname, join, resolve } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { dshHomePath } from "@deepseek-ai/dsh-home-paths";
|
|
6
7
|
import { AUTH_ROUTE_PREFIX, InMemoryHuaqiuAuthService, createAuthHandler } from "@huaqiu/dsh-auth";
|
|
7
8
|
import { ARTIFACTS_ROUTE_PREFIX, HuaqiuArtifactService, createArtifactsHandler } from "@huaqiu/dsh-artifacts";
|
|
@@ -666,7 +667,7 @@ function resolveAppDist(override) {
|
|
|
666
667
|
const pkgPath = require.resolve("@huaqiu/component-gen-app/package.json");
|
|
667
668
|
return join(pkgPath.replace(/package\.json$/, ""), "dist");
|
|
668
669
|
} catch {
|
|
669
|
-
return resolve(new URL("../../component-gen-app/dist", import.meta.url)
|
|
670
|
+
return resolve(fileURLToPath(new URL("../../component-gen-app/dist", import.meta.url)));
|
|
670
671
|
}
|
|
671
672
|
}
|
|
672
673
|
/** Static file responder with traversal protection. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/component-gen-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.mts",
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@deepseek-ai/dsh-home-paths": "^0.1.0-rc.0",
|
|
26
|
-
"@huaqiu/dsh-artifacts": "0.4.
|
|
27
|
-
"@huaqiu/dsh-auth": "0.4.
|
|
26
|
+
"@huaqiu/dsh-artifacts": "0.4.4",
|
|
27
|
+
"@huaqiu/dsh-auth": "0.4.4"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@deepseek-ai/dsh-host-webserver": "^0.1.0-rc.0",
|
|
31
|
-
"@huaqiu/dsh-tool-symbol-footprint": "^0.4.
|
|
31
|
+
"@huaqiu/dsh-tool-symbol-footprint": "^0.4.4"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"tsdown": "^0.22.14",
|
|
35
35
|
"typescript": "^5.9.0",
|
|
36
36
|
"vitest": "^4.1.0",
|
|
37
|
-
"@huaqiu/dsh-tool-symbol-footprint": "0.4.
|
|
37
|
+
"@huaqiu/dsh-tool-symbol-footprint": "0.4.4"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
package/src/standalone.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { createServer, type IncomingMessage, type ServerResponse } from 'node:ht
|
|
|
19
19
|
import { createRequire } from 'node:module'
|
|
20
20
|
import { existsSync, readFileSync, statSync } from 'node:fs'
|
|
21
21
|
import { join, extname, resolve } from 'node:path'
|
|
22
|
+
import { fileURLToPath } from 'node:url'
|
|
22
23
|
import { dshHomePath } from '@deepseek-ai/dsh-home-paths'
|
|
23
24
|
import { InMemoryHuaqiuAuthService, createAuthHandler, AUTH_ROUTE_PREFIX, type HuaqiuAuthService } from '@huaqiu/dsh-auth'
|
|
24
25
|
import { HuaqiuArtifactService, createArtifactsHandler, ARTIFACTS_ROUTE_PREFIX } from '@huaqiu/dsh-artifacts'
|
|
@@ -72,7 +73,9 @@ function resolveAppDist(override?: string): string {
|
|
|
72
73
|
return join(pkgPath.replace(/package\.json$/, ''), 'dist')
|
|
73
74
|
} catch {
|
|
74
75
|
// Monorepo fallback (before publish): lib/standalone.mjs → packages/component-gen-app/dist
|
|
75
|
-
|
|
76
|
+
// fileURLToPath (not `new URL(...).pathname`) so Windows paths do not get a
|
|
77
|
+
// doubled drive prefix (`C:\C:\...`) once `resolve` roots the leading slash.
|
|
78
|
+
const local = resolve(fileURLToPath(new URL('../../component-gen-app/dist', import.meta.url)))
|
|
76
79
|
return local
|
|
77
80
|
}
|
|
78
81
|
}
|