@creekjs/umi-plugins 1.0.1 → 1.0.3

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/creek-layout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkC,MAAM,YAAY,CAAC;8BA8E7C,IAAI;AAAzB,wBA+HE"}
@@ -84,16 +84,22 @@ const Layout = (props: CreekLayoutProps) => {
84
84
  },
85
85
  });
86
86
 
87
+ const layoutRestProps = {
88
+ ...runtimeConfig,
89
+ ...userConfig,
90
+ };
91
+
87
92
  // 现在的 layout 及 wrapper 实现是通过父路由的形式实现的, 会导致路由数据多了冗余层级
88
93
  const newRoutes = filterRoutes(
89
- clientRoutes.filter((route) => route.id === 'ant-design-pro-layout'),
94
+ clientRoutes,
90
95
  (route) => {
91
96
  return (
92
97
  (!!route.isLayout && route.id !== 'ant-design-pro-layout') || !!route.isWrapper
93
98
  );
94
99
  }
95
100
  );
96
- const [route] = useAccessMarkedRoutes(mapRoutes(newRoutes));
101
+ const layoutRoute = newRoutes.find((item) => item.id === 'ant-design-pro-layout');
102
+ const [route] = useAccessMarkedRoutes(mapRoutes(layoutRoute ? [layoutRoute] : []));
97
103
 
98
104
  const matchedRoute = useMemo(
99
105
  () => matchRoutes(route.children, location.pathname)?.pop?.()?.route,
@@ -109,6 +115,7 @@ const Layout = (props: CreekLayoutProps) => {
109
115
  userConfig={userConfig}
110
116
  route={route}
111
117
  initialInfo={initialInfo}
118
+ {...layoutRestProps}
112
119
  children={
113
120
  runtimeConfig.childrenRender ? (
114
121
  runtimeConfig.childrenRender(<Outlet />, props)
@@ -0,0 +1,5 @@
1
+ import { IApi } from 'umi';
2
+ declare const _default: (api: IApi) => {
3
+ plugins: string[];
4
+ };
5
+ export default _default;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;8BAEN,IAAI;;;AAAzB,wBAOE"}
package/dist/index.js ADDED
@@ -0,0 +1,43 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/index.ts
30
+ var src_exports = {};
31
+ __export(src_exports, {
32
+ default: () => src_default
33
+ });
34
+ module.exports = __toCommonJS(src_exports);
35
+ var src_default = (api) => {
36
+ return {
37
+ plugins: [
38
+ require.resolve("./creek-layout"),
39
+ require.resolve("./open-api")
40
+ ]
41
+ };
42
+ };
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["import { IApi } from 'umi';\n\nexport default (api: IApi) => {\n return {\n plugins: [\n require.resolve('./creek-layout'),\n require.resolve('./open-api'),\n ],\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAO,cAAQ,CAAC,QAAc;AAC5B,SAAO;AAAA,IACL,SAAS;AAAA,MACP,gBAAgB,gBAAgB;AAAA,MAChC,gBAAgB,YAAY;AAAA,IAC9B;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/open-api/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;8BAIb,IAAI;AAAzB,wBA0DE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/utils/file.ts"],"names":[],"mappings":"AAIA,iBAAS,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAU3D;AAED,iBAAS,eAAe,CAAC,IAAI,EAAE,MAAM,QAMpC;AAED,iBAAS,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,GAAE,MAAW,QAazD;AAED,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,UAAU,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/utils/spawn.ts"],"names":[],"mappings":"AAaA,iBAAS,YAAY,CACnB,OAAO,EAAE,MAAM,EACf,aAAa,GAAE,MAAM,EAAO,EAC5B,WAAW;;CAAuB,GACjC,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAID,iBAAS,qBAAqB,CAAC,UAAU,EAAE,MAAM,oBAiBhD;AACD,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withTmpPath.d.ts","sourceRoot":"","sources":["../../src/utils/withTmpPath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAIlC,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAChC,GAAG,EAAE,IAAI,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,UAUA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creekjs/umi-plugins",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "ISC",
@@ -17,6 +17,7 @@
17
17
  "devDependencies": {
18
18
  "@creekjs/openapi": "workspace:^",
19
19
  "@creekjs/request": "workspace:^",
20
- "@creekjs/web-components": "workspace:^"
20
+ "@creekjs/web-components": "workspace:^",
21
+ "umi": "^4.6.25"
21
22
  }
22
23
  }