@module-federation/devtools 2.0.1 → 2.2.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.
@@ -123,6 +123,11 @@ const Layout = (props) => {
123
123
  const ensureFederationContext = () => {
124
124
  if (!window.__FEDERATION__) {
125
125
  window.__FEDERATION__ = {
126
+ __GLOBAL_PLUGIN__: [],
127
+ __INSTANCES__: [],
128
+ __SHARE__: {},
129
+ __MANIFEST_LOADING__: {},
130
+ __PRELOADED_MAP__: /* @__PURE__ */ new Map(),
126
131
  originModuleInfo: moduleInfo || {},
127
132
  moduleInfo: moduleInfo || {}
128
133
  };
@@ -33,7 +33,15 @@ const getModuleInfo = () => {
33
33
  return {
34
34
  name: "mf-devtool-getModuleInfo-plugin",
35
35
  loadRemoteSnapshot(_a2) {
36
- var _b = _a2, { options, moduleInfo, remoteSnapshot } = _b, res = __objRest(_b, ["options", "moduleInfo", "remoteSnapshot"]);
36
+ var _b = _a2, {
37
+ options,
38
+ moduleInfo,
39
+ remoteSnapshot
40
+ } = _b, res = __objRest(_b, [
41
+ "options",
42
+ "moduleInfo",
43
+ "remoteSnapshot"
44
+ ]);
37
45
  const globalSnapshot = helpers.global.getGlobalSnapshot();
38
46
  if (!options || options.inBrowser) {
39
47
  window.postMessage(
@@ -128,6 +128,11 @@ const Layout = (props) => {
128
128
  const ensureFederationContext = () => {
129
129
  if (!window.__FEDERATION__) {
130
130
  window.__FEDERATION__ = {
131
+ __GLOBAL_PLUGIN__: [],
132
+ __INSTANCES__: [],
133
+ __SHARE__: {},
134
+ __MANIFEST_LOADING__: {},
135
+ __PRELOADED_MAP__: /* @__PURE__ */ new Map(),
131
136
  originModuleInfo: moduleInfo || {},
132
137
  moduleInfo: moduleInfo || {}
133
138
  };
@@ -54,7 +54,15 @@ const getModuleInfo = () => {
54
54
  return {
55
55
  name: "mf-devtool-getModuleInfo-plugin",
56
56
  loadRemoteSnapshot(_a2) {
57
- var _b = _a2, { options, moduleInfo, remoteSnapshot } = _b, res = __objRest(_b, ["options", "moduleInfo", "remoteSnapshot"]);
57
+ var _b = _a2, {
58
+ options,
59
+ moduleInfo,
60
+ remoteSnapshot
61
+ } = _b, res = __objRest(_b, [
62
+ "options",
63
+ "moduleInfo",
64
+ "remoteSnapshot"
65
+ ]);
58
66
  const globalSnapshot = import_helpers.default.global.getGlobalSnapshot();
59
67
  if (!options || options.inBrowser) {
60
68
  window.postMessage(
package/install-deps.bash CHANGED
@@ -3,14 +3,18 @@ if [ "$SKIP_DEVTOOLS_POSTINSTALL" = "true" ]; then
3
3
  exit 0
4
4
  fi
5
5
 
6
+ if [ "$GITHUB_ACTIONS" = "true" ] && [ "$RUN_DEVTOOLS_POSTINSTALL" != "true" ]; then
7
+ echo "Skipping devtools postinstall outside the devtools workflow."
8
+ exit 0
9
+ fi
10
+
6
11
  if [ "$GITHUB_ACTIONS" = "true" ]; then
7
12
  echo "Running in GitHub Actions environment."
8
13
  # Only install if cache miss was reported by the cache action
9
14
  if [ "$PLAYWRIGHT_CACHE_HIT" != "true" ]; then
10
- echo "Playwright cache miss, installing dependencies and browsers..."
11
- npx playwright install-deps && npx playwright install
15
+ echo "Playwright cache miss, installing Chromium dependencies and browser..."
16
+ npx playwright install-deps && npx playwright install chromium
12
17
  else
13
- npx playwright install
14
18
  echo "Using cached Playwright browsers."
15
19
  fi
16
20
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/devtools",
3
- "version": "2.0.1",
3
+ "version": "2.2.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,12 +14,12 @@
14
14
  ],
15
15
  "exports": {
16
16
  ".": {
17
- "types": "./dist/types/App.d.ts",
17
+ "types": "./dist/types/src/App.d.ts",
18
18
  "require": "./dist/lib/App.js",
19
19
  "import": "./dist/es/App.js"
20
20
  },
21
21
  "./App": {
22
- "types": "./dist/types/App.d.ts",
22
+ "types": "./dist/types/src/App.d.ts",
23
23
  "require": "./dist/lib/App.js",
24
24
  "import": "./dist/es/App.js"
25
25
  }
@@ -37,7 +37,7 @@
37
37
  "access": "public"
38
38
  },
39
39
  "dependencies": {
40
- "@modern-js/runtime": "2.70.2",
40
+ "@modern-js/runtime": "2.70.8",
41
41
  "@arco-design/web-react": "2.66.7",
42
42
  "ahooks": "^3.7.10",
43
43
  "dagre": "^0.8.5",
@@ -47,7 +47,7 @@
47
47
  "echarts-for-react": "^3.0.5",
48
48
  "i18next": "^23.0.0",
49
49
  "react-i18next": "^15.0.0",
50
- "@module-federation/sdk": "2.0.1"
50
+ "@module-federation/sdk": "2.2.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "react": "^18 || ^19",
@@ -65,11 +65,11 @@
65
65
  "react": "^19.2.0",
66
66
  "react-dom": "^19.2.0",
67
67
  "@modern-js-app/eslint-config": "2.59.0",
68
- "@modern-js/app-tools": "2.70.2",
68
+ "@modern-js/app-tools": "2.70.8",
69
69
  "@modern-js/eslint-config": "2.59.0",
70
- "@modern-js/module-tools": "2.70.2",
71
- "@modern-js/storybook": "2.70.2",
72
- "@modern-js/tsconfig": "2.70.2",
70
+ "@modern-js/module-tools": "2.70.8",
71
+ "@modern-js/storybook": "2.70.8",
72
+ "@modern-js/tsconfig": "2.70.8",
73
73
  "@playwright/test": "1.57.0",
74
74
  "@types/chrome": "^0.0.272",
75
75
  "@types/dagre": "^0.7.52",
@@ -79,25 +79,30 @@
79
79
  "@types/react-dom": "^19.2.2",
80
80
  "lint-staged": "~13.1.0",
81
81
  "prettier": "~3.3.3",
82
+ "typescript": "5.9.3",
82
83
  "rimraf": "~6.0.1",
83
84
  "vitest": "1.2.2",
84
- "@module-federation/runtime": "2.0.1"
85
+ "@module-federation/runtime": "2.2.0"
85
86
  },
86
87
  "scripts": {
87
88
  "build:storybook": "storybook build",
88
89
  "storybook": "storybook dev -p 6006",
89
90
  "reset": "npx rimraf ./**/node_modules",
90
91
  "dev": "modern-app dev",
91
- "build": "modern-app build && node postpack.js",
92
+ "build:devtool": "modern-app build && node postpack.js",
93
+ "build": "npm run build:lib",
92
94
  "build:debug": "DEBUG=true modern-app build && node postpack.js",
93
95
  "build:lib": "rm -rf dist && modern-module build -c modern.lib.config.ts",
94
96
  "release": "npm publish --tag canary",
95
97
  "test": "vitest run",
96
- "test:e2e": "E2ETEST=true pnpm build && playwright test",
97
- "test:e2e:ui": "E2ETEST=true pnpm build && playwright test --ui",
98
+ "test:e2e": "node ../../scripts/ensure-playwright.js && E2ETEST=true pnpm build:devtool && playwright test",
99
+ "test:e2e:ui": "node ../../scripts/ensure-playwright.js && E2ETEST=true pnpm build:devtool && playwright test --ui",
98
100
  "start": "modern-app start",
99
101
  "serve": "modern-app serve",
100
- "postinstall": "bash install-deps.bash"
102
+ "postinstall": "bash install-deps.bash",
103
+ "build:chrome-plugins": "pnpm -C . build",
104
+ "e2e:devtools": "pnpm -C . test:e2e",
105
+ "e2e:devtools:ui": "pnpm -C . test:e2e:ui"
101
106
  },
102
- "types": "./dist/index.d.ts"
107
+ "types": "./dist/types/src/App.d.ts"
103
108
  }