@creekjs/umi-plugins 1.0.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.
@@ -0,0 +1,36 @@
1
+ {{{PKG_TYPE_REFERENCE}}}
2
+ {{#pkgPath}}
3
+ import type { ProLayoutProps, HeaderProps } from '{{{pkgPath}}}';
4
+ {{/pkgPath}}
5
+ {{^pkgPath}}
6
+ import type { ProLayoutProps, HeaderProps } from '@ant-design/pro-components';
7
+ {{/pkgPath}}
8
+ {{#hasInitialStatePlugin}}
9
+ import type InitialStateType from '@@/plugin-initialState/@@initialState';
10
+ type InitDataType = ReturnType<typeof InitialStateType>;
11
+ {{/hasInitialStatePlugin}}
12
+ {{^hasInitialStatePlugin}}
13
+ type InitDataType = any;
14
+ {{/hasInitialStatePlugin}}
15
+ import type { IConfigFromPlugins } from '@@/core/pluginConfig';
16
+
17
+ export type RunTimeLayoutConfig = (initData: InitDataType) => ProLayoutProps & {
18
+ dropdownProps?: DropDownProps;
19
+ showDarkButton?: boolean;
20
+ showFooter?: boolean;
21
+ provider?: React.ReactNode;
22
+ userName?: string;
23
+ hideKeepalive?: boolean;
24
+ rightContentExtra?: React.ReactNode;
25
+ childrenRender?: (dom: JSX.Element, props: ProLayoutProps) => React.ReactNode;
26
+ unAccessible?: JSX.Element;
27
+ logout?: (initialState: InitDataType['initialState']) => Promise<void> | void;
28
+ iconFontCNs?: string[];
29
+ rightRender?: (
30
+ initialState: InitDataType['initialState'],
31
+ setInitialState: InitDataType['setInitialState'],
32
+ runtimeConfig: RunTimeLayoutConfig,
33
+ ) => JSX.Element;
34
+
35
+ };
36
+
@@ -0,0 +1,3 @@
1
+ import { IApi } from "@umijs/max";
2
+ declare const _default: (api: IApi) => void;
3
+ export default _default;
@@ -0,0 +1,76 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/open-api/index.tsx
20
+ var open_api_exports = {};
21
+ __export(open_api_exports, {
22
+ default: () => open_api_default
23
+ });
24
+ module.exports = __toCommonJS(open_api_exports);
25
+ var openApi = require("@creekjs/openapi");
26
+ var open_api_default = (api) => {
27
+ api.describe({
28
+ key: "openApi",
29
+ config: {
30
+ schema: ({ zod }) => {
31
+ const ApiPrefixParamsSchema = zod.object({
32
+ path: zod.string(),
33
+ method: zod.string(),
34
+ namespace: zod.string(),
35
+ functionName: zod.string(),
36
+ autoExclude: zod.boolean().optional()
37
+ });
38
+ const SingleConfigSchema = zod.object({
39
+ requestLibPath: zod.string().optional(),
40
+ requestOptionsType: zod.string().optional(),
41
+ requestImportStatement: zod.string().optional(),
42
+ apiPrefix: zod.union([
43
+ zod.string(),
44
+ zod.function().args(ApiPrefixParamsSchema).returns(zod.string())
45
+ ]).optional(),
46
+ serversPath: zod.string().optional(),
47
+ schemaPath: zod.string().optional(),
48
+ projectName: zod.string().optional(),
49
+ namespace: zod.string().optional(),
50
+ enumStyle: zod.enum(["string-literal", "enum"]).optional(),
51
+ nullable: zod.boolean().optional(),
52
+ templatesFolder: zod.string().optional(),
53
+ dataFields: zod.array(zod.string()).optional(),
54
+ isCamelCase: zod.boolean().optional()
55
+ });
56
+ return zod.union([
57
+ SingleConfigSchema,
58
+ zod.array(SingleConfigSchema)
59
+ ]);
60
+ }
61
+ },
62
+ enableBy: api.EnableBy.config
63
+ });
64
+ api.registerCommand({
65
+ name: "openApi",
66
+ fn() {
67
+ const openApiOptions = api.userConfig.openApi;
68
+ try {
69
+ openApi.generateService(openApiOptions);
70
+ } catch (error) {
71
+ api.logger.error(error);
72
+ process.exit(1);
73
+ }
74
+ }
75
+ });
76
+ };
@@ -0,0 +1,16 @@
1
+ import KiwiIntl from "{{{kiwiIntlPath}}}";
2
+
3
+ import { languageStorage, LANGUAGE_LIST, CURRENT_LANGUAGE_KEY, IS_EN_US,
4
+ IS_ZH_CN, LanguageEnum } from "{{{constantsPath}}}";
5
+
6
+ import en_US from "{{{en_US}}}";
7
+ import zh_CN from "{{{zh_CN}}}";
8
+
9
+ let I18N = KiwiIntl.init(languageStorage.get() || "zh-CN", {
10
+ "en-US": en_US,
11
+ "zh-CN": zh_CN,
12
+ });
13
+
14
+ window.{{{packageName}}} = I18N;
15
+ export { I18N, languageStorage, LANGUAGE_LIST, CURRENT_LANGUAGE_KEY, IS_EN_US,
16
+ IS_ZH_CN, LanguageEnum };
@@ -0,0 +1,15 @@
1
+ import KiwiIntl from "{{{kiwiIntlPath}}}";
2
+
3
+ import { languageStorage, LANGUAGE_LIST, CURRENT_LANGUAGE_KEY, IS_EN_US,
4
+ IS_ZH_CN, LanguageEnum } from "{{{constantsPath}}}";
5
+
6
+ import en_US from "{{{en_US}}}";
7
+ import zh_CN from "{{{zh_CN}}}";
8
+
9
+ let I18N = KiwiIntl.init(languageStorage.get() || "zh-CN", {
10
+ "en-US": en_US,
11
+ "zh-CN": zh_CN,
12
+ });
13
+
14
+ export { I18N, languageStorage, LANGUAGE_LIST, CURRENT_LANGUAGE_KEY, IS_EN_US,
15
+ IS_ZH_CN, LanguageEnum };
@@ -0,0 +1,2 @@
1
+ export { I18N, languageStorage, LANGUAGE_LIST, CURRENT_LANGUAGE_KEY,IS_EN_US,
2
+ IS_ZH_CN, LanguageEnum } from './i18N';
@@ -0,0 +1,8 @@
1
+ export {
2
+ useRequest,
3
+ request,
4
+ getRequestInstance,
5
+ sortFilterProTable,
6
+ HttpStatusEnum,
7
+ HttpMessageEnum
8
+ } from './request';