@rsdoctor/sdk 0.1.6 → 0.1.8
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/dist/cjs/sdk/sdk/webpack.js +1 -1
- package/dist/cjs/sdk/server/apis/bundle-diff.js +6 -2
- package/dist/cjs/sdk/server/apis/renderer.js +1 -1
- package/dist/cjs/sdk/server/index.js +5 -1
- package/dist/esm/sdk/sdk/webpack.js +1 -1
- package/dist/esm/sdk/server/apis/bundle-diff.js +6 -2
- package/dist/esm/sdk/server/apis/renderer.js +1 -1
- package/dist/esm/sdk/server/index.js +5 -1
- package/dist/type/sdk/sdk/types.d.ts +1 -0
- package/dist/type/sdk/server/index.d.ts +3 -1
- package/package.json +5 -5
|
@@ -44,7 +44,7 @@ class RsdoctorWebpackSDK extends import_core.SDKCore {
|
|
|
44
44
|
this._chunkGraph = new import_graph.ChunkGraph();
|
|
45
45
|
this._rawSourceMapCache = /* @__PURE__ */ new Map();
|
|
46
46
|
this._sourceMap = /* @__PURE__ */ new Map();
|
|
47
|
-
this.server = options.noServer ? new import_fakeServer.RsdoctorFakeServer(this, void 0) : new import_server.RsdoctorServer(this, options.port);
|
|
47
|
+
this.server = options.noServer ? new import_fakeServer.RsdoctorFakeServer(this, void 0) : new import_server.RsdoctorServer(this, options.port, options.innerClientPath);
|
|
48
48
|
this.type = options.type || import_types.SDK.ToDataType.Normal;
|
|
49
49
|
this.extraConfig = options.config;
|
|
50
50
|
}
|
|
@@ -44,7 +44,9 @@ class BundleDiffAPI extends import_base.BaseAPI {
|
|
|
44
44
|
moduleGraph,
|
|
45
45
|
packageGraph,
|
|
46
46
|
configs,
|
|
47
|
-
moduleCodeMap
|
|
47
|
+
moduleCodeMap,
|
|
48
|
+
// Just usedby bytedance's inner Rsdoctor
|
|
49
|
+
cloudManifestUrl
|
|
48
50
|
} = sdk.getStoreData();
|
|
49
51
|
let outputFilename = "";
|
|
50
52
|
if (typeof configs?.[0]?.config?.output?.filename === "string") {
|
|
@@ -58,7 +60,9 @@ class BundleDiffAPI extends import_base.BaseAPI {
|
|
|
58
60
|
moduleGraph,
|
|
59
61
|
packageGraph,
|
|
60
62
|
outputFilename,
|
|
61
|
-
moduleCodeMap
|
|
63
|
+
moduleCodeMap,
|
|
64
|
+
// Just usedby bytedance's inner Rsdoctor
|
|
65
|
+
cloudManifestUrl
|
|
62
66
|
};
|
|
63
67
|
}
|
|
64
68
|
async bundleDiffManifest() {
|
|
@@ -53,7 +53,7 @@ class RendererAPI extends import_base.BaseAPI {
|
|
|
53
53
|
}
|
|
54
54
|
async entryHtml() {
|
|
55
55
|
const { server, res } = this.ctx;
|
|
56
|
-
const clientHtmlPath = require.resolve("@rsdoctor/client");
|
|
56
|
+
const clientHtmlPath = server.innerClientPath ? server.innerClientPath : require.resolve("@rsdoctor/client");
|
|
57
57
|
if (!this.isClientServed) {
|
|
58
58
|
this.isClientServed = true;
|
|
59
59
|
const clientDistPath = import_path.default.resolve(clientHtmlPath, "..");
|
|
@@ -47,7 +47,7 @@ var import_logger = require("@rsdoctor/utils/logger");
|
|
|
47
47
|
var import_openBrowser = require("../utils/openBrowser");
|
|
48
48
|
__reExport(server_exports, require("./utils"), module.exports);
|
|
49
49
|
class RsdoctorServer {
|
|
50
|
-
constructor(sdk, port = import_build.Server.defaultPort) {
|
|
50
|
+
constructor(sdk, port = import_build.Server.defaultPort, innerClientPath = "") {
|
|
51
51
|
this.sdk = sdk;
|
|
52
52
|
this.disposed = true;
|
|
53
53
|
this.get = (route, cb) => {
|
|
@@ -74,6 +74,7 @@ class RsdoctorServer {
|
|
|
74
74
|
(0, import_assert.default)(typeof port === "number");
|
|
75
75
|
this.port = port;
|
|
76
76
|
this._router = new import_router.Router({ sdk, server: this, apis: Object.values(APIs) });
|
|
77
|
+
this._innerClientPath = innerClientPath;
|
|
77
78
|
}
|
|
78
79
|
get app() {
|
|
79
80
|
return this._server.app;
|
|
@@ -88,6 +89,9 @@ class RsdoctorServer {
|
|
|
88
89
|
get socketUrl() {
|
|
89
90
|
return `ws://localhost:${this.port}`;
|
|
90
91
|
}
|
|
92
|
+
get innerClientPath() {
|
|
93
|
+
return this._innerClientPath;
|
|
94
|
+
}
|
|
91
95
|
async bootstrap() {
|
|
92
96
|
if (!this.disposed) {
|
|
93
97
|
return;
|
|
@@ -21,7 +21,7 @@ class RsdoctorWebpackSDK extends SDKCore {
|
|
|
21
21
|
this._chunkGraph = new ChunkGraph();
|
|
22
22
|
this._rawSourceMapCache = /* @__PURE__ */ new Map();
|
|
23
23
|
this._sourceMap = /* @__PURE__ */ new Map();
|
|
24
|
-
this.server = options.noServer ? new RsdoctorFakeServer(this, void 0) : new RsdoctorServer(this, options.port);
|
|
24
|
+
this.server = options.noServer ? new RsdoctorFakeServer(this, void 0) : new RsdoctorServer(this, options.port, options.innerClientPath);
|
|
25
25
|
this.type = options.type || SDK.ToDataType.Normal;
|
|
26
26
|
this.extraConfig = options.config;
|
|
27
27
|
}
|
|
@@ -23,7 +23,9 @@ class BundleDiffAPI extends BaseAPI {
|
|
|
23
23
|
moduleGraph,
|
|
24
24
|
packageGraph,
|
|
25
25
|
configs,
|
|
26
|
-
moduleCodeMap
|
|
26
|
+
moduleCodeMap,
|
|
27
|
+
// Just usedby bytedance's inner Rsdoctor
|
|
28
|
+
cloudManifestUrl
|
|
27
29
|
} = sdk.getStoreData();
|
|
28
30
|
let outputFilename = "";
|
|
29
31
|
if (typeof configs?.[0]?.config?.output?.filename === "string") {
|
|
@@ -37,7 +39,9 @@ class BundleDiffAPI extends BaseAPI {
|
|
|
37
39
|
moduleGraph,
|
|
38
40
|
packageGraph,
|
|
39
41
|
outputFilename,
|
|
40
|
-
moduleCodeMap
|
|
42
|
+
moduleCodeMap,
|
|
43
|
+
// Just usedby bytedance's inner Rsdoctor
|
|
44
|
+
cloudManifestUrl
|
|
41
45
|
};
|
|
42
46
|
}
|
|
43
47
|
async bundleDiffManifest() {
|
|
@@ -22,7 +22,7 @@ class RendererAPI extends BaseAPI {
|
|
|
22
22
|
}
|
|
23
23
|
async entryHtml() {
|
|
24
24
|
const { server, res } = this.ctx;
|
|
25
|
-
const clientHtmlPath = require.resolve("@rsdoctor/client");
|
|
25
|
+
const clientHtmlPath = server.innerClientPath ? server.innerClientPath : require.resolve("@rsdoctor/client");
|
|
26
26
|
if (!this.isClientServed) {
|
|
27
27
|
this.isClientServed = true;
|
|
28
28
|
const clientDistPath = path.resolve(clientHtmlPath, "..");
|
|
@@ -13,7 +13,7 @@ import { chalk, logger } from "@rsdoctor/utils/logger";
|
|
|
13
13
|
import { openBrowser } from "../utils/openBrowser";
|
|
14
14
|
export * from "./utils";
|
|
15
15
|
class RsdoctorServer {
|
|
16
|
-
constructor(sdk, port = Server.defaultPort) {
|
|
16
|
+
constructor(sdk, port = Server.defaultPort, innerClientPath = "") {
|
|
17
17
|
this.sdk = sdk;
|
|
18
18
|
this.disposed = true;
|
|
19
19
|
this.get = (route, cb) => {
|
|
@@ -40,6 +40,7 @@ class RsdoctorServer {
|
|
|
40
40
|
assert(typeof port === "number");
|
|
41
41
|
this.port = port;
|
|
42
42
|
this._router = new Router({ sdk, server: this, apis: Object.values(APIs) });
|
|
43
|
+
this._innerClientPath = innerClientPath;
|
|
43
44
|
}
|
|
44
45
|
get app() {
|
|
45
46
|
return this._server.app;
|
|
@@ -54,6 +55,9 @@ class RsdoctorServer {
|
|
|
54
55
|
get socketUrl() {
|
|
55
56
|
return `ws://localhost:${this.port}`;
|
|
56
57
|
}
|
|
58
|
+
get innerClientPath() {
|
|
59
|
+
return this._innerClientPath;
|
|
60
|
+
}
|
|
57
61
|
async bootstrap() {
|
|
58
62
|
if (!this.disposed) {
|
|
59
63
|
return;
|
|
@@ -8,11 +8,13 @@ export declare class RsdoctorServer implements SDK.RsdoctorServerInstance {
|
|
|
8
8
|
private _socket?;
|
|
9
9
|
private disposed;
|
|
10
10
|
private _router;
|
|
11
|
-
|
|
11
|
+
private _innerClientPath;
|
|
12
|
+
constructor(sdk: SDK.RsdoctorBuilderSDKInstance, port?: number, innerClientPath?: string);
|
|
12
13
|
get app(): SDK.RsdoctorServerInstance['app'];
|
|
13
14
|
get host(): string;
|
|
14
15
|
get origin(): string;
|
|
15
16
|
get socketUrl(): string;
|
|
17
|
+
get innerClientPath(): string;
|
|
16
18
|
bootstrap(): Promise<void>;
|
|
17
19
|
protected wrapNextHandleFunction(method: 'GET' | 'POST', cb: (...args: Parameters<Thirdparty.connect.NextHandleFunction>) => Common.PlainObject | string): Thirdparty.connect.NextHandleFunction;
|
|
18
20
|
proxy(api: SDK.ServerAPI.API, method: 'GET' | 'POST', cb: (...args: Parameters<Thirdparty.connect.NextHandleFunction>) => Common.PlainObject | string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rsdoctor/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/rsdoctor",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"socket.io": "4.7.2",
|
|
26
26
|
"source-map": "^0.7.4",
|
|
27
27
|
"tapable": "2.2.1",
|
|
28
|
-
"@rsdoctor/
|
|
29
|
-
"@rsdoctor/
|
|
30
|
-
"@rsdoctor/
|
|
31
|
-
"@rsdoctor/
|
|
28
|
+
"@rsdoctor/client": "0.1.8",
|
|
29
|
+
"@rsdoctor/graph": "0.1.8",
|
|
30
|
+
"@rsdoctor/types": "0.1.8",
|
|
31
|
+
"@rsdoctor/utils": "0.1.8"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/body-parser": "1.19.2",
|