@modern-js/plugin-devtools 0.0.0-nightly-20240129170639 → 0.0.0-nightly-20240131170643
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/cli.js +3 -3
- package/dist/config.d.ts +1 -1
- package/dist/config.js +5 -5
- package/dist/rpc/index.d.ts +1 -1
- package/dist/rpc/index.js +7 -4
- package/package.json +14 -13
package/dist/cli.js
CHANGED
@@ -37,7 +37,7 @@ var import_path = __toESM(require("path"));
|
|
37
37
|
var import_assert = __toESM(require("assert"));
|
38
38
|
var import_utils = require("@modern-js/utils");
|
39
39
|
var import_serve_static = __toESM(require("serve-static"));
|
40
|
-
var
|
40
|
+
var import_node = require("@modern-js/devtools-kit/node");
|
41
41
|
var import_config = require("./config");
|
42
42
|
var import_rpc = require("./rpc");
|
43
43
|
var import_socket = require("./utils/socket");
|
@@ -137,10 +137,10 @@ const devtoolsPlugin = (inlineOptions = {}) => ({
|
|
137
137
|
tools: {
|
138
138
|
devServer: {
|
139
139
|
proxy: {
|
140
|
-
[
|
140
|
+
[import_node.ROUTE_BASENAME]: {
|
141
141
|
target: `http://localhost:${httpServer.port}`,
|
142
142
|
pathRewrite: {
|
143
|
-
[`^${
|
143
|
+
[`^${import_node.ROUTE_BASENAME}`]: ""
|
144
144
|
},
|
145
145
|
ws: true
|
146
146
|
}
|
package/dist/config.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ClientDefinition, SetupClientParams } from '@modern-js/devtools-kit';
|
1
|
+
import { ClientDefinition, SetupClientParams } from '@modern-js/devtools-kit/node';
|
2
2
|
import type { RequiredDeep } from 'type-fest';
|
3
3
|
export type DevtoolsPluginOptions = Partial<SetupClientParams>;
|
4
4
|
export interface DevtoolsPluginInlineOptions extends DevtoolsPluginOptions {
|
package/dist/config.js
CHANGED
@@ -22,16 +22,16 @@ __export(config_exports, {
|
|
22
22
|
resolveContext: () => resolveContext
|
23
23
|
});
|
24
24
|
module.exports = __toCommonJS(config_exports);
|
25
|
-
var
|
25
|
+
var import_node = require("@modern-js/devtools-kit/node");
|
26
26
|
const getDefaultOptions = () => ({
|
27
|
-
def: new
|
27
|
+
def: new import_node.ClientDefinition()
|
28
28
|
});
|
29
29
|
const resolveContext = (...sources) => {
|
30
30
|
const ret = {
|
31
31
|
enable: process.env.NODE_ENV === "development",
|
32
|
-
dataSource: `${
|
33
|
-
endpoint:
|
34
|
-
def: new
|
32
|
+
dataSource: `${import_node.ROUTE_BASENAME}/rpc`,
|
33
|
+
endpoint: import_node.ROUTE_BASENAME,
|
34
|
+
def: new import_node.ClientDefinition()
|
35
35
|
};
|
36
36
|
for (const opts of sources) {
|
37
37
|
var _opts_enable;
|
package/dist/rpc/index.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ClientDefinition, type ClientFunctions, type ServerFunctions } from '@modern-js/devtools-kit';
|
1
|
+
import { ClientDefinition, type ClientFunctions, type ServerFunctions } from '@modern-js/devtools-kit/node';
|
2
2
|
import type { PartialDeep } from 'type-fest';
|
3
3
|
import type { RsbuildPlugin } from '@modern-js/uni-builder';
|
4
4
|
import { CliPluginAPI, InjectedHooks } from '../types';
|
package/dist/rpc/index.js
CHANGED
@@ -32,8 +32,9 @@ __export(rpc_exports, {
|
|
32
32
|
});
|
33
33
|
module.exports = __toCommonJS(rpc_exports);
|
34
34
|
var import_lodash = __toESM(require("@modern-js/utils/lodash"));
|
35
|
-
var
|
35
|
+
var import_node = require("@modern-js/devtools-kit/node");
|
36
36
|
var import_birpc = require("birpc");
|
37
|
+
var flatted = __toESM(require("flatted"));
|
37
38
|
var import_p_defer = __toESM(require("p-defer"));
|
38
39
|
var import_module = require("../utils/module");
|
39
40
|
const setupClientConnection = async (options) => {
|
@@ -148,7 +149,7 @@ const setupClientConnection = async (options) => {
|
|
148
149
|
return deferred.compileTimeCost.promise;
|
149
150
|
},
|
150
151
|
async getClientDefinition() {
|
151
|
-
const ret = new
|
152
|
+
const ret = new import_node.ClientDefinition();
|
152
153
|
Object.assign(ret.name, def.name);
|
153
154
|
Object.assign(ret.packages, def.packages);
|
154
155
|
Object.assign(ret.assets, def.assets);
|
@@ -162,8 +163,10 @@ const setupClientConnection = async (options) => {
|
|
162
163
|
const clientRpcOptions = {
|
163
164
|
post: (data) => onceConnection.then(() => server.clients.forEach((ws) => ws.send(data))),
|
164
165
|
on: (cb) => handleMessage = cb,
|
165
|
-
serialize: (v) =>
|
166
|
-
|
166
|
+
serialize: (v) => flatted.stringify([
|
167
|
+
v
|
168
|
+
]),
|
169
|
+
deserialize: (v) => flatted.parse(v.toString())[0]
|
167
170
|
};
|
168
171
|
const clientConn = (0, import_birpc.createBirpc)(serverFunctions, clientRpcOptions);
|
169
172
|
const hooks = {
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "0.0.0-nightly-
|
18
|
+
"version": "0.0.0-nightly-20240131170643",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/index.d.ts",
|
21
21
|
"main": "./dist/index.js",
|
@@ -41,13 +41,14 @@
|
|
41
41
|
},
|
42
42
|
"dependencies": {
|
43
43
|
"birpc": "0.2.13",
|
44
|
+
"flatted": "^3.2.9",
|
44
45
|
"serve-static": "^1.14.1",
|
45
46
|
"p-defer": "^3.0.0",
|
46
47
|
"ws": "^8.13.0",
|
47
48
|
"ufo": "^1.3.0",
|
48
|
-
"@modern-js/devtools-client": "0.0.0-nightly-
|
49
|
-
"@modern-js/
|
50
|
-
"@modern-js/
|
49
|
+
"@modern-js/devtools-client": "0.0.0-nightly-20240131170643",
|
50
|
+
"@modern-js/utils": "0.0.0-nightly-20240131170643",
|
51
|
+
"@modern-js/devtools-kit": "0.0.0-nightly-20240131170643"
|
51
52
|
},
|
52
53
|
"devDependencies": {
|
53
54
|
"@types/serve-static": "^1.13.10",
|
@@ -56,17 +57,17 @@
|
|
56
57
|
"@types/ws": "^8.5.5",
|
57
58
|
"type-fest": "^4.1.0",
|
58
59
|
"typescript": "^5",
|
59
|
-
"@modern-js/app-tools": "0.0.0-nightly-
|
60
|
-
"@modern-js/core": "0.0.0-nightly-
|
61
|
-
"@modern-js/module-tools": "0.0.0-nightly-
|
62
|
-
"@modern-js/runtime": "0.0.0-nightly-
|
63
|
-
"@modern-js/
|
64
|
-
"@modern-js/
|
65
|
-
"@modern-js/
|
66
|
-
"@scripts/build": "0.0.0-nightly-
|
60
|
+
"@modern-js/app-tools": "0.0.0-nightly-20240131170643",
|
61
|
+
"@modern-js/core": "0.0.0-nightly-20240131170643",
|
62
|
+
"@modern-js/module-tools": "0.0.0-nightly-20240131170643",
|
63
|
+
"@modern-js/runtime": "0.0.0-nightly-20240131170643",
|
64
|
+
"@modern-js/server-core": "0.0.0-nightly-20240131170643",
|
65
|
+
"@modern-js/types": "0.0.0-nightly-20240131170643",
|
66
|
+
"@modern-js/uni-builder": "0.0.0-nightly-20240131170643",
|
67
|
+
"@scripts/build": "0.0.0-nightly-20240131170643"
|
67
68
|
},
|
68
69
|
"peerDependencies": {
|
69
|
-
"@modern-js/runtime": "0.0.0-nightly-
|
70
|
+
"@modern-js/runtime": "0.0.0-nightly-20240131170643"
|
70
71
|
},
|
71
72
|
"peerDependenciesMeta": {
|
72
73
|
"@modern-js/runtime": {
|