@umijs/plugins 4.0.44 → 4.0.46

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.
@@ -29,6 +29,7 @@ __export(styled_components_exports, {
29
29
  });
30
30
  module.exports = __toCommonJS(styled_components_exports);
31
31
  var import_path = require("path");
32
+ var import_withTmpPath = require("./utils/withTmpPath");
32
33
  var styled_components_default = (api) => {
33
34
  api.describe({
34
35
  key: "styledComponents",
@@ -49,8 +50,15 @@ var styled_components_default = (api) => {
49
50
  }
50
51
  return memo;
51
52
  });
53
+ api.addRuntimePlugin(() => {
54
+ return [(0, import_withTmpPath.withTmpPath)({ api, path: "runtime.tsx" })];
55
+ });
56
+ api.addRuntimePluginKey(() => {
57
+ return ["styledComponents"];
58
+ });
52
59
  const libPath = (0, import_path.dirname)(require.resolve("styled-components/package"));
53
60
  api.onGenerateFiles(() => {
61
+ var _a;
54
62
  api.writeTmpFile({
55
63
  path: "index.tsx",
56
64
  content: `
@@ -58,6 +66,24 @@ import styled, { ThemeProvider, createGlobalStyle, css, keyframes, StyleSheetMan
58
66
  export { styled, ThemeProvider, createGlobalStyle, css, keyframes, StyleSheetManager, useTheme };
59
67
  `
60
68
  });
69
+ const styledComponentsRuntimeCode = ((_a = api.appData.appJS) == null ? void 0 : _a.exports.includes(
70
+ "styledComponents"
71
+ )) ? `import { styledComponents as styledComponentsConfig } from '@/app';` : `const styledComponentsConfig = {};`;
72
+ api.writeTmpFile({
73
+ path: "runtime.tsx",
74
+ content: `
75
+ ${styledComponentsRuntimeCode}
76
+ export function rootContainer(container) {
77
+ const globalStyle = styledComponentsConfig.GlobalStyle ? <styledComponentsConfig.GlobalStyle /> : null;
78
+ return (
79
+ <>
80
+ {globalStyle}
81
+ {container}
82
+ </>
83
+ );
84
+ }
85
+ `
86
+ });
61
87
  });
62
88
  };
63
89
  // Annotate the CommonJS export names for ESM import in node:
@@ -274,11 +274,18 @@ export const MicroApp = forwardRef(
274
274
  ? (loading) => <MicroAppLoader loading={loading} />
275
275
  : null);
276
276
 
277
- const microAppWrapperClassName = wrapperClassName ? `${wrapperClassName} qiankun-micro-app-wrapper` : 'qiankun-micro-app-wrapper';
278
- const microAppClassName = className ? `${className} qiankun-micro-app-container` : 'qiankun-micro-app-container';
277
+ const microAppWrapperClassName = wrapperClassName
278
+ ? `${wrapperClassName} qiankun-micro-app-wrapper`
279
+ : 'qiankun-micro-app-wrapper';
280
+ const microAppClassName = className
281
+ ? `${className} qiankun-micro-app-container`
282
+ : 'qiankun-micro-app-container';
279
283
 
280
284
  return Boolean(microAppLoader) || Boolean(microAppErrorBoundary) ? (
281
- <div style={{ position: 'relative' }} className={microAppWrapperClassName}>
285
+ <div
286
+ style={{ position: 'relative' }}
287
+ className={microAppWrapperClassName}
288
+ >
282
289
  {Boolean(microAppLoader) && microAppLoader(loading)}
283
290
  {Boolean(microAppErrorBoundary) &&
284
291
  Boolean(error) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umijs/plugins",
3
- "version": "4.0.44",
3
+ "version": "4.0.46",
4
4
  "description": "@umijs/plugins",
5
5
  "homepage": "https://github.com/umijs/umi/tree/master/packages/plugins#readme",
6
6
  "bugs": "https://github.com/umijs/umi/issues",
@@ -29,7 +29,7 @@
29
29
  "@ant-design/pro-components": "^2.0.1",
30
30
  "@tanstack/react-query": "^4.22.0",
31
31
  "@tanstack/react-query-devtools": "^4.22.0",
32
- "@umijs/bundler-utils": "4.0.44",
32
+ "@umijs/bundler-utils": "4.0.46",
33
33
  "@umijs/valtio": "^1.0.2",
34
34
  "antd-dayjs-webpack-plugin": "^1.0.6",
35
35
  "axios": "^0.27.2",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "antd": "^4.24.1",
56
- "umi": "4.0.44"
56
+ "umi": "4.0.46"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"