@modern-js/plugin-devtools 0.0.0-next-20240522095407 → 0.0.0-next-20240523071819
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 +1 -0
- package/dist/rpc/index.js +21 -1
- package/dist/types/common.d.ts +1 -1
- package/package.json +13 -13
package/dist/cli.js
CHANGED
|
@@ -99,6 +99,7 @@ const devtoolsPlugin = (inlineOptions = {}) => {
|
|
|
99
99
|
watcher2.on("unlink", refreshStoragePreset);
|
|
100
100
|
},
|
|
101
101
|
modifyFileSystemRoutes: rpc.hooks.modifyFileSystemRoutes,
|
|
102
|
+
afterCreateCompiler: rpc.hooks.afterCreateCompiler,
|
|
102
103
|
beforeRestart() {
|
|
103
104
|
closeWatcher();
|
|
104
105
|
return new Promise((resolve, reject) => httpServer.instance.close((err) => err ? reject(err) : resolve()));
|
package/dist/rpc/index.js
CHANGED
|
@@ -242,6 +242,18 @@ const setupClientConnection = async (options) => {
|
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
244
|
const clientConn = (0, import_birpc.createBirpc)(serverFunctions, clientRpcOptions);
|
|
245
|
+
let _pendingCompiler = 0;
|
|
246
|
+
const resolveRsdoctorManifest = async () => {
|
|
247
|
+
_pendingCompiler -= 1;
|
|
248
|
+
if (_pendingCompiler === 0) {
|
|
249
|
+
try {
|
|
250
|
+
const doctor = await getDoctorOverview(await import_state.$state.framework.context);
|
|
251
|
+
import_state.$resolvers.doctor.resolve(doctor);
|
|
252
|
+
} catch (err) {
|
|
253
|
+
import_state.$resolvers.doctor.resolve(void 0);
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
245
257
|
const hooks = {
|
|
246
258
|
prepare() {
|
|
247
259
|
const frameworkContext = {
|
|
@@ -252,7 +264,6 @@ const setupClientConnection = async (options) => {
|
|
|
252
264
|
import_state.$resolvers.framework.context.resolve(frameworkContext);
|
|
253
265
|
import_state.$resolvers.framework.config.resolved.resolve(api.useConfigContext());
|
|
254
266
|
import_state.$resolvers.framework.config.transformed.resolve(api.useResolvedConfigContext());
|
|
255
|
-
getDoctorOverview(frameworkContext).then((doctor) => import_state.$resolvers.doctor.resolve(doctor)).catch(() => import_state.$resolvers.doctor.resolve(void 0));
|
|
256
267
|
},
|
|
257
268
|
modifyFileSystemRoutes({ entrypoint, routes }) {
|
|
258
269
|
import_state.$state.fileSystemRoutes[entrypoint.entryName] = import_lodash.default.cloneDeep(routes);
|
|
@@ -260,6 +271,15 @@ const setupClientConnection = async (options) => {
|
|
|
260
271
|
entrypoint,
|
|
261
272
|
routes
|
|
262
273
|
};
|
|
274
|
+
},
|
|
275
|
+
afterCreateCompiler({ compiler }) {
|
|
276
|
+
if (!compiler)
|
|
277
|
+
return;
|
|
278
|
+
_pendingCompiler += 1;
|
|
279
|
+
compiler.hooks.done.tap({
|
|
280
|
+
name: "@modern-js/plugin-devtools",
|
|
281
|
+
stage: 4e3
|
|
282
|
+
}, () => resolveRsdoctorManifest());
|
|
263
283
|
}
|
|
264
284
|
};
|
|
265
285
|
const builderPlugin = {
|
package/dist/types/common.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export type BufferLike = string | Buffer | DataView | number | ArrayBufferView |
|
|
|
18
18
|
[Symbol.toPrimitive]: (hint: string) => string;
|
|
19
19
|
};
|
|
20
20
|
export type Hooks = BaseHooks<any> & AppToolsHooks<any>;
|
|
21
|
-
export type InjectedHooks = Pick<ToThreads<Hooks>, 'prepare' | 'modifyFileSystemRoutes'>;
|
|
21
|
+
export type InjectedHooks = Pick<ToThreads<Hooks>, 'prepare' | 'modifyFileSystemRoutes' | 'afterCreateCompiler'>;
|
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-20240523071819",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
21
|
"main": "./dist/index.js",
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
"ufo": "^1.3.0",
|
|
55
55
|
"valtio": "^1.11.1",
|
|
56
56
|
"ws": "^8.13.0",
|
|
57
|
-
"@modern-js/devtools-client": "0.0.0-next-
|
|
58
|
-
"@modern-js/devtools-kit": "0.0.0-next-
|
|
59
|
-
"@modern-js/utils": "0.0.0-next-
|
|
57
|
+
"@modern-js/devtools-client": "0.0.0-next-20240523071819",
|
|
58
|
+
"@modern-js/devtools-kit": "0.0.0-next-20240523071819",
|
|
59
|
+
"@modern-js/utils": "0.0.0-next-20240523071819"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@swc/helpers": "0.5.3",
|
|
@@ -64,17 +64,17 @@
|
|
|
64
64
|
"@types/ws": "^8.5.5",
|
|
65
65
|
"type-fest": "^4.1.0",
|
|
66
66
|
"typescript": "^5",
|
|
67
|
-
"@modern-js/app-tools": "0.0.0-next-
|
|
68
|
-
"@modern-js/core": "0.0.0-next-
|
|
69
|
-
"@modern-js/module-tools": "0.0.0-next-
|
|
70
|
-
"@modern-js/runtime": "0.0.0-next-
|
|
71
|
-
"@modern-js/server-core": "0.0.0-next-
|
|
72
|
-
"@modern-js/types": "0.0.0-next-
|
|
73
|
-
"@modern-js/uni-builder": "0.0.0-next-
|
|
74
|
-
"@scripts/build": "0.0.0-next-
|
|
67
|
+
"@modern-js/app-tools": "0.0.0-next-20240523071819",
|
|
68
|
+
"@modern-js/core": "0.0.0-next-20240523071819",
|
|
69
|
+
"@modern-js/module-tools": "0.0.0-next-20240523071819",
|
|
70
|
+
"@modern-js/runtime": "0.0.0-next-20240523071819",
|
|
71
|
+
"@modern-js/server-core": "0.0.0-next-20240523071819",
|
|
72
|
+
"@modern-js/types": "0.0.0-next-20240523071819",
|
|
73
|
+
"@modern-js/uni-builder": "0.0.0-next-20240523071819",
|
|
74
|
+
"@scripts/build": "0.0.0-next-20240523071819"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"@modern-js/runtime": "0.0.0-next-
|
|
77
|
+
"@modern-js/runtime": "0.0.0-next-20240523071819"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"@modern-js/runtime": {
|