@modern-js/plugin-devtools 0.0.0-next-20240131181000 → 0.0.0-next-20240207065107
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 +4 -7
- package/package.json +13 -14
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_devtools_kit = require("@modern-js/devtools-kit");
|
|
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_devtools_kit.ROUTE_BASENAME]: {
|
|
141
141
|
target: `http://localhost:${httpServer.port}`,
|
|
142
142
|
pathRewrite: {
|
|
143
|
-
[`^${
|
|
143
|
+
[`^${import_devtools_kit.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';
|
|
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_devtools_kit = require("@modern-js/devtools-kit");
|
|
26
26
|
const getDefaultOptions = () => ({
|
|
27
|
-
def: new
|
|
27
|
+
def: new import_devtools_kit.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_devtools_kit.ROUTE_BASENAME}/rpc`,
|
|
33
|
+
endpoint: import_devtools_kit.ROUTE_BASENAME,
|
|
34
|
+
def: new import_devtools_kit.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';
|
|
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,9 +32,8 @@ __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_devtools_kit = require("@modern-js/devtools-kit");
|
|
36
36
|
var import_birpc = require("birpc");
|
|
37
|
-
var flatted = __toESM(require("flatted"));
|
|
38
37
|
var import_p_defer = __toESM(require("p-defer"));
|
|
39
38
|
var import_module = require("../utils/module");
|
|
40
39
|
const setupClientConnection = async (options) => {
|
|
@@ -149,7 +148,7 @@ const setupClientConnection = async (options) => {
|
|
|
149
148
|
return deferred.compileTimeCost.promise;
|
|
150
149
|
},
|
|
151
150
|
async getClientDefinition() {
|
|
152
|
-
const ret = new
|
|
151
|
+
const ret = new import_devtools_kit.ClientDefinition();
|
|
153
152
|
Object.assign(ret.name, def.name);
|
|
154
153
|
Object.assign(ret.packages, def.packages);
|
|
155
154
|
Object.assign(ret.assets, def.assets);
|
|
@@ -163,10 +162,8 @@ const setupClientConnection = async (options) => {
|
|
|
163
162
|
const clientRpcOptions = {
|
|
164
163
|
post: (data) => onceConnection.then(() => server.clients.forEach((ws) => ws.send(data))),
|
|
165
164
|
on: (cb) => handleMessage = cb,
|
|
166
|
-
serialize: (v) =>
|
|
167
|
-
|
|
168
|
-
]),
|
|
169
|
-
deserialize: (v) => flatted.parse(v.toString())[0]
|
|
165
|
+
serialize: (v) => JSON.stringify(v),
|
|
166
|
+
deserialize: (v) => JSON.parse(v.toString())
|
|
170
167
|
};
|
|
171
168
|
const clientConn = (0, import_birpc.createBirpc)(serverFunctions, clientRpcOptions);
|
|
172
169
|
const hooks = {
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-next-
|
|
18
|
+
"version": "0.0.0-next-20240207065107",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"main": "./dist/index.js",
|
|
@@ -41,14 +41,13 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"birpc": "0.2.13",
|
|
44
|
-
"flatted": "^3.2.9",
|
|
45
44
|
"serve-static": "^1.14.1",
|
|
46
45
|
"p-defer": "^3.0.0",
|
|
47
46
|
"ws": "^8.13.0",
|
|
48
47
|
"ufo": "^1.3.0",
|
|
49
|
-
"@modern-js/devtools-
|
|
50
|
-
"@modern-js/devtools-
|
|
51
|
-
"@modern-js/utils": "0.0.0-next-
|
|
48
|
+
"@modern-js/devtools-client": "0.0.0-next-20240207065107",
|
|
49
|
+
"@modern-js/devtools-kit": "0.0.0-next-20240207065107",
|
|
50
|
+
"@modern-js/utils": "0.0.0-next-20240207065107"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
53
|
"@types/serve-static": "^1.13.10",
|
|
@@ -57,17 +56,17 @@
|
|
|
57
56
|
"@types/ws": "^8.5.5",
|
|
58
57
|
"type-fest": "^4.1.0",
|
|
59
58
|
"typescript": "^5",
|
|
60
|
-
"@modern-js/app-tools": "0.0.0-next-
|
|
61
|
-
"@modern-js/core": "0.0.0-next-
|
|
62
|
-
"@modern-js/module-tools": "0.0.0-next-
|
|
63
|
-
"@modern-js/
|
|
64
|
-
"@modern-js/
|
|
65
|
-
"@modern-js/
|
|
66
|
-
"@modern-js/
|
|
67
|
-
"@scripts/build": "0.0.0-next-
|
|
59
|
+
"@modern-js/app-tools": "0.0.0-next-20240207065107",
|
|
60
|
+
"@modern-js/core": "0.0.0-next-20240207065107",
|
|
61
|
+
"@modern-js/module-tools": "0.0.0-next-20240207065107",
|
|
62
|
+
"@modern-js/server-core": "0.0.0-next-20240207065107",
|
|
63
|
+
"@modern-js/runtime": "0.0.0-next-20240207065107",
|
|
64
|
+
"@modern-js/types": "0.0.0-next-20240207065107",
|
|
65
|
+
"@modern-js/uni-builder": "0.0.0-next-20240207065107",
|
|
66
|
+
"@scripts/build": "0.0.0-next-20240207065107"
|
|
68
67
|
},
|
|
69
68
|
"peerDependencies": {
|
|
70
|
-
"@modern-js/runtime": "0.0.0-next-
|
|
69
|
+
"@modern-js/runtime": "0.0.0-next-20240207065107"
|
|
71
70
|
},
|
|
72
71
|
"peerDependenciesMeta": {
|
|
73
72
|
"@modern-js/runtime": {
|