@modern-js/devtools-kit 2.47.1 → 2.48.1
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/client.d.ts +13 -4
- package/dist/client.js +1 -0
- package/dist/node.d.ts +1 -0
- package/dist/node.js +3 -1
- package/dist/runtime-globals.d.ts +13 -0
- package/dist/runtime-globals.js +37 -0
- package/dist/runtime.d.ts +1 -0
- package/dist/runtime.js +3 -1
- package/package.json +10 -10
package/dist/client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ComponentType, ReactElement } from 'react';
|
|
1
2
|
import type { Entrypoint } from '@modern-js/types';
|
|
2
3
|
import { FileSystemRoutes } from './server';
|
|
3
4
|
export interface ClientFunctions {
|
|
@@ -36,15 +37,23 @@ export declare class ClientDefinition {
|
|
|
36
37
|
assets: AssetDefinition;
|
|
37
38
|
doctor: DoctorDefinition;
|
|
38
39
|
announcement: AnnouncementDefinition;
|
|
40
|
+
plugins: string[];
|
|
39
41
|
}
|
|
40
42
|
export interface IframeTabView {
|
|
41
43
|
type: 'iframe';
|
|
42
44
|
src: string;
|
|
43
45
|
}
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
+
export interface BuiltinTabView {
|
|
47
|
+
type: 'builtin';
|
|
48
|
+
src: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ExternalTabView {
|
|
51
|
+
type: 'external';
|
|
52
|
+
component: ComponentType;
|
|
53
|
+
}
|
|
54
|
+
export interface Tab {
|
|
46
55
|
name: string;
|
|
47
56
|
title: string;
|
|
48
|
-
view:
|
|
49
|
-
icon?: string;
|
|
57
|
+
view: BuiltinTabView | ExternalTabView | IframeTabView;
|
|
58
|
+
icon?: string | ReactElement;
|
|
50
59
|
}
|
package/dist/client.js
CHANGED
package/dist/node.d.ts
CHANGED
package/dist/node.js
CHANGED
|
@@ -22,6 +22,7 @@ __reExport(node_exports, require("./utils"), module.exports);
|
|
|
22
22
|
__reExport(node_exports, require("./constants"), module.exports);
|
|
23
23
|
__reExport(node_exports, require("./channel"), module.exports);
|
|
24
24
|
__reExport(node_exports, require("./rsdoctor"), module.exports);
|
|
25
|
+
__reExport(node_exports, require("./runtime-globals"), module.exports);
|
|
25
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26
27
|
0 && (module.exports = {
|
|
27
28
|
...require("./server"),
|
|
@@ -30,5 +31,6 @@ __reExport(node_exports, require("./rsdoctor"), module.exports);
|
|
|
30
31
|
...require("./utils"),
|
|
31
32
|
...require("./constants"),
|
|
32
33
|
...require("./channel"),
|
|
33
|
-
...require("./rsdoctor")
|
|
34
|
+
...require("./rsdoctor"),
|
|
35
|
+
...require("./runtime-globals")
|
|
34
36
|
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Hookable } from 'hookable';
|
|
2
|
+
import { Tab } from './node';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
[RUNTIME_GLOBALS]?: RuntimeGlobals;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
export declare const RUNTIME_GLOBALS = "__modern_js_global";
|
|
9
|
+
export interface GlobalHooks {
|
|
10
|
+
'tab:list': (tabs: Tab[]) => void;
|
|
11
|
+
}
|
|
12
|
+
export type RuntimeGlobals = Hookable<GlobalHooks>;
|
|
13
|
+
export declare const getRuntimeGlobals: () => RuntimeGlobals;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var runtime_globals_exports = {};
|
|
20
|
+
__export(runtime_globals_exports, {
|
|
21
|
+
RUNTIME_GLOBALS: () => RUNTIME_GLOBALS,
|
|
22
|
+
getRuntimeGlobals: () => getRuntimeGlobals
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(runtime_globals_exports);
|
|
25
|
+
const RUNTIME_GLOBALS = "__modern_js_global";
|
|
26
|
+
const getRuntimeGlobals = () => {
|
|
27
|
+
const globals = window[RUNTIME_GLOBALS];
|
|
28
|
+
if (!globals || typeof globals !== "object") {
|
|
29
|
+
throw TypeError("RuntimeGlobals is not initialized");
|
|
30
|
+
}
|
|
31
|
+
return globals;
|
|
32
|
+
};
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
RUNTIME_GLOBALS,
|
|
36
|
+
getRuntimeGlobals
|
|
37
|
+
});
|
package/dist/runtime.d.ts
CHANGED
package/dist/runtime.js
CHANGED
|
@@ -20,11 +20,13 @@ __reExport(runtime_exports, require("./mount-point"), module.exports);
|
|
|
20
20
|
__reExport(runtime_exports, require("./utils"), module.exports);
|
|
21
21
|
__reExport(runtime_exports, require("./constants"), module.exports);
|
|
22
22
|
__reExport(runtime_exports, require("./channel"), module.exports);
|
|
23
|
+
__reExport(runtime_exports, require("./runtime-globals"), module.exports);
|
|
23
24
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24
25
|
0 && (module.exports = {
|
|
25
26
|
...require("./client"),
|
|
26
27
|
...require("./mount-point"),
|
|
27
28
|
...require("./utils"),
|
|
28
29
|
...require("./constants"),
|
|
29
|
-
...require("./channel")
|
|
30
|
+
...require("./channel"),
|
|
31
|
+
...require("./runtime-globals")
|
|
30
32
|
});
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"modern",
|
|
22
22
|
"modern.js"
|
|
23
23
|
],
|
|
24
|
-
"version": "2.
|
|
24
|
+
"version": "2.48.1",
|
|
25
25
|
"jsnext:source": "./src/index.ts",
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"main": "./dist/index.js",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"ws": "^8.13.0",
|
|
64
64
|
"@rsdoctor/types": "^0.1.3",
|
|
65
65
|
"@rsdoctor/utils": "^0.1.3",
|
|
66
|
-
"@modern-js/
|
|
67
|
-
"@modern-js/
|
|
66
|
+
"@modern-js/utils": "2.48.1",
|
|
67
|
+
"@modern-js/types": "2.48.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@babel/core": "^7.23.2",
|
|
@@ -79,13 +79,13 @@
|
|
|
79
79
|
"react": "~18.2.0",
|
|
80
80
|
"type-fest": "^4.1.0",
|
|
81
81
|
"typescript": "^5",
|
|
82
|
-
"@modern-js/
|
|
83
|
-
"@modern-js/
|
|
84
|
-
"@modern-js/module-tools": "2.
|
|
85
|
-
"@modern-js/
|
|
86
|
-
"@modern-js/
|
|
87
|
-
"@scripts/build": "2.
|
|
88
|
-
"@scripts/jest-config": "2.
|
|
82
|
+
"@modern-js/core": "2.48.1",
|
|
83
|
+
"@modern-js/app-tools": "2.48.1",
|
|
84
|
+
"@modern-js/module-tools": "2.48.1",
|
|
85
|
+
"@modern-js/uni-builder": "2.48.1",
|
|
86
|
+
"@modern-js/types": "2.48.1",
|
|
87
|
+
"@scripts/build": "2.48.1",
|
|
88
|
+
"@scripts/jest-config": "2.48.1"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "~18.2.0"
|