@modern-js/plugin-devtools 2.37.1 → 2.38.0
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.d.ts +3 -3
- package/dist/cli.js +6 -0
- package/dist/config.d.ts +5 -2
- package/dist/index.d.ts +1 -1
- package/package.json +16 -16
package/dist/cli.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { AppTools, CliPlugin } from '@modern-js/app-tools';
|
2
|
-
import {
|
3
|
-
export type {
|
4
|
-
export declare const devtoolsPlugin: (options?:
|
2
|
+
import { DevtoolsPluginOptions, DevtoolsPluginInlineOptions } from './config';
|
3
|
+
export type { DevtoolsPluginOptions, DevtoolsPluginInlineOptions };
|
4
|
+
export declare const devtoolsPlugin: (options?: DevtoolsPluginInlineOptions) => CliPlugin<AppTools>;
|
5
5
|
export default devtoolsPlugin;
|
package/dist/cli.js
CHANGED
@@ -45,6 +45,11 @@ const devtoolsPlugin = (options) => ({
|
|
45
45
|
name: "@modern-js/plugin-devtools",
|
46
46
|
usePlugins: [],
|
47
47
|
setup: async (api) => {
|
48
|
+
var _options_enable;
|
49
|
+
const enablePlugin = (_options_enable = options === null || options === void 0 ? void 0 : options.enable) !== null && _options_enable !== void 0 ? _options_enable : process.env.NODE_ENV === "development";
|
50
|
+
if (!enablePlugin) {
|
51
|
+
return {};
|
52
|
+
}
|
48
53
|
const port = await (0, import_utils.getPort)(8782, {
|
49
54
|
slient: true
|
50
55
|
});
|
@@ -92,6 +97,7 @@ const devtoolsPlugin = (options) => ({
|
|
92
97
|
},
|
93
98
|
config() {
|
94
99
|
const opts = (0, import_config.resolveOptions)(api, options);
|
100
|
+
import_utils.logger.info(`${opts.def.name.formalName} Devtools is enabled`);
|
95
101
|
opts.def && rpc.setDefinition(opts.def);
|
96
102
|
const mountOpts = {
|
97
103
|
dataSource: `${import_devtools_kit.ROUTE_BASENAME}/rpc`,
|
package/dist/config.d.ts
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
import { ClientDefinition } from '@modern-js/devtools-kit';
|
2
2
|
import { PartialDeep } from 'type-fest';
|
3
3
|
import { CliPluginAPI } from './types';
|
4
|
-
export interface
|
4
|
+
export interface DevtoolsPluginOptions {
|
5
5
|
def?: PartialDeep<ClientDefinition>;
|
6
6
|
}
|
7
|
+
export interface DevtoolsPluginInlineOptions extends DevtoolsPluginOptions {
|
8
|
+
enable?: boolean;
|
9
|
+
}
|
7
10
|
export declare const getDefaultOptions: () => {
|
8
11
|
def: ClientDefinition;
|
9
12
|
};
|
10
|
-
export declare const resolveOptions: (api: CliPluginAPI, options?:
|
13
|
+
export declare const resolveOptions: (api: CliPluginAPI, options?: DevtoolsPluginOptions) => DevtoolsPluginOptions & {
|
11
14
|
def: ClientDefinition;
|
12
15
|
};
|
package/dist/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
export { devtoolsPlugin, default } from './cli';
|
2
|
-
export type {
|
2
|
+
export type { DevtoolsPluginOptions } from './cli';
|
package/package.json
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
"modern",
|
16
16
|
"modern.js"
|
17
17
|
],
|
18
|
-
"version": "2.
|
18
|
+
"version": "2.38.0",
|
19
19
|
"jsnext:source": "./src/index.ts",
|
20
20
|
"types": "./dist/index.d.ts",
|
21
21
|
"main": "./dist/index.js",
|
@@ -45,10 +45,10 @@
|
|
45
45
|
"p-defer": "^3.0.0",
|
46
46
|
"ws": "8.13.0",
|
47
47
|
"ufo": "^1.3.0",
|
48
|
-
"@modern-js/devtools-kit": "2.
|
49
|
-
"@modern-js/devtools-mount": "2.
|
50
|
-
"@modern-js/devtools-client": "2.
|
51
|
-
"@modern-js/utils": "2.
|
48
|
+
"@modern-js/devtools-kit": "2.38.0",
|
49
|
+
"@modern-js/devtools-mount": "2.38.0",
|
50
|
+
"@modern-js/devtools-client": "2.38.0",
|
51
|
+
"@modern-js/utils": "2.38.0"
|
52
52
|
},
|
53
53
|
"devDependencies": {
|
54
54
|
"@types/serve-static": "^1.13.10",
|
@@ -57,19 +57,19 @@
|
|
57
57
|
"@types/ws": "^8.5.5",
|
58
58
|
"type-fest": "^4.1.0",
|
59
59
|
"typescript": "^5",
|
60
|
-
"@modern-js/app-tools": "2.
|
61
|
-
"@modern-js/core": "2.
|
62
|
-
"@modern-js/module-tools": "2.
|
63
|
-
"@modern-js/runtime": "2.
|
64
|
-
"@modern-js/server-core": "2.
|
65
|
-
"@modern-js/types": "2.
|
66
|
-
"@modern-js/builder-webpack-provider": "2.
|
67
|
-
"@modern-js/builder-rspack-provider": "2.
|
68
|
-
"@modern-js/builder-shared": "2.
|
69
|
-
"@scripts/build": "2.
|
60
|
+
"@modern-js/app-tools": "2.38.0",
|
61
|
+
"@modern-js/core": "2.38.0",
|
62
|
+
"@modern-js/module-tools": "2.38.0",
|
63
|
+
"@modern-js/runtime": "2.38.0",
|
64
|
+
"@modern-js/server-core": "2.38.0",
|
65
|
+
"@modern-js/types": "2.38.0",
|
66
|
+
"@modern-js/builder-webpack-provider": "2.38.0",
|
67
|
+
"@modern-js/builder-rspack-provider": "2.38.0",
|
68
|
+
"@modern-js/builder-shared": "2.38.0",
|
69
|
+
"@scripts/build": "2.38.0"
|
70
70
|
},
|
71
71
|
"peerDependencies": {
|
72
|
-
"@modern-js/runtime": "^2.
|
72
|
+
"@modern-js/runtime": "^2.38.0"
|
73
73
|
},
|
74
74
|
"peerDependenciesMeta": {
|
75
75
|
"@modern-js/runtime": {
|