dlzn-ui 1.36.0 → 1.38.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.
@@ -1,7 +1,12 @@
1
1
  import { ConfigEnv, UserConfig } from 'vite';
2
+ import { default as AutoImport } from 'unplugin-auto-import/vite';
3
+ type Arrayable<T> = Array<T> | T;
2
4
  interface Options {
5
+ autoImportResolvers: Array<UnwrapArrayable<UnwrapArrayable<NonNullable<Parameters<typeof AutoImport>[0]['resolvers']>>>>;
6
+ autoImports: NonNullable<UnwrapArrayable<Parameters<typeof AutoImport>[0]['imports']>>;
3
7
  root: string;
4
8
  }
9
+ type UnwrapArrayable<T> = T extends Arrayable<infer U> ? U : never;
5
10
  export declare function commonConfig(_env: ConfigEnv): UserConfig;
6
11
  declare const _default: (_env: ConfigEnv, options: Options) => UserConfig;
7
12
  export default _default;
@@ -2,17 +2,22 @@ import { needPort } from "./utils/index.mjs";
2
2
  import { posix, resolve } from "node:path";
3
3
  import tailwindcss from "@tailwindcss/vite";
4
4
  import vue from "@vitejs/plugin-vue";
5
+ import vueJsx from "@vitejs/plugin-vue-jsx";
5
6
  import browserslist from "browserslist";
6
7
  import { browserslistToTargets } from "lightningcss";
8
+ import AutoImport from "unplugin-auto-import/vite";
9
+ import ElementPlus from "unplugin-element-plus/vite";
10
+ import Components from "unplugin-vue-components/vite";
7
11
  import { loadEnv, mergeConfig } from "vite";
8
12
  import { parseLoadedEnv } from "vite-plugin-env-parse";
9
13
  import { createHtmlPlugin } from "vite-plugin-html";
10
14
  import tailwindAutoReference from "vite-plugin-vue-tailwind-auto-reference";
15
+ import VueRouter from "vue-router/vite";
11
16
  //#region node/vite-config.ts
12
17
  function commonConfig(_env) {
13
18
  return {
14
19
  clearScreen: false,
15
- plugins: [vue({})]
20
+ plugins: [vue({}), vueJsx()]
16
21
  };
17
22
  }
18
23
  function bypass(req, res, options) {
@@ -24,8 +29,7 @@ function bypass(req, res, options) {
24
29
  }
25
30
  var vite_config_default = (_env, options) => {
26
31
  const { command, mode } = _env;
27
- const { root } = options;
28
- const resolvePath = (p) => resolve(root, p);
32
+ const resolvePath = (p) => resolve(options.root, p);
29
33
  const { VITE_API_PROXY_PORT_ARRAY, VITE_APP_ID, VITE_APP_NAME = "", VITE_BASE_URL = "/", VITE_FORCE_PWD_CHANGE = true, VITE_PROXY_TARGET: viteProxyTarget, VITE_USE_LOGIN_CAPTCHA = true } = parseLoadedEnv(loadEnv(mode, "build/env"));
30
34
  const VITE_PROXY_TARGET = Array.isArray(viteProxyTarget) ? viteProxyTarget : [viteProxyTarget];
31
35
  console.log({
@@ -113,7 +117,73 @@ var vite_config_default = (_env, options) => {
113
117
  template: "node_modules/dlzn-ui/build/index.html"
114
118
  }),
115
119
  tailwindAutoReference("node_modules/dlzn-ui/assets/css/tailwindcss-entry.css"),
116
- tailwindcss()
120
+ tailwindcss(),
121
+ VueRouter({ dts: "types/typed-router.d.ts" }),
122
+ vueJsx(),
123
+ ElementPlus({}),
124
+ AutoImport({
125
+ dirs: [
126
+ "src/plugins/autoImport",
127
+ "src/bus/autoImport",
128
+ "src/hooks"
129
+ ],
130
+ dirsScanOptions: { types: false },
131
+ dts: "types/auto-imports.d.ts",
132
+ imports: [
133
+ "vue",
134
+ "vue-router",
135
+ "pinia",
136
+ "@vueuse/core",
137
+ {
138
+ from: "alova/client",
139
+ imports: [
140
+ "useRequest",
141
+ "useWatcher",
142
+ "usePagination"
143
+ ]
144
+ },
145
+ {
146
+ from: "@/plugins/others/directive.ts",
147
+ imports: ["checkPermissions"]
148
+ },
149
+ {
150
+ from: "dlzn-ui/utils",
151
+ imports: [
152
+ "formatNumber",
153
+ "isFalsy",
154
+ "stringDisplay"
155
+ ]
156
+ },
157
+ { "@/plugins/alova/index.ts": [["default", "alovaInst"]] },
158
+ {
159
+ from: "@/components/tDesignReset/TForm/index.ts",
160
+ imports: [
161
+ "FormItem",
162
+ "FormInstance",
163
+ "FormExposed"
164
+ ],
165
+ type: true
166
+ },
167
+ {
168
+ from: "@/components/tDesignReset/TTable/index.ts",
169
+ imports: ["TableCol", "CellRenderContext"],
170
+ type: true
171
+ },
172
+ {
173
+ from: "@/components/autoImport/TPageList/index.ts",
174
+ imports: ["PageListProps"],
175
+ type: true
176
+ },
177
+ options.autoImports
178
+ ],
179
+ resolvers: [...options.autoImportResolvers],
180
+ vueTemplate: true
181
+ }),
182
+ Components({
183
+ deep: false,
184
+ dts: "types/components.d.ts",
185
+ resolvers: [...options.autoImportResolvers]
186
+ })
117
187
  ],
118
188
  resolve: {
119
189
  alias: [
package/package.json CHANGED
@@ -47,6 +47,7 @@
47
47
  "@tsconfig/node-lts": "^24.0.0",
48
48
  "@types/node": "^26.1.2",
49
49
  "@vitejs/plugin-vue": "^6.0.8",
50
+ "@vitejs/plugin-vue-jsx": "^5.1.6",
50
51
  "@vue/tsconfig": "^0.9.1",
51
52
  "browserslist": "^4.28.8",
52
53
  "eslint": "^10.8.1",
@@ -67,17 +68,21 @@
67
68
  "tailwindcss": "^4.3.3",
68
69
  "tdesign-vue-next": "^1.20.5",
69
70
  "typescript": "^6.0.3",
71
+ "unplugin-auto-import": "^21.1.0",
72
+ "unplugin-element-plus": "^0.11.2",
73
+ "unplugin-vue-components": "^32.1.0",
70
74
  "vite": "^8.2.0",
71
75
  "vite-plugin-env-parse": "^1.0.15",
72
76
  "vite-plugin-html": "^3.2.2",
73
77
  "vite-plugin-vue-tailwind-auto-reference": "^2.0.2",
74
78
  "vue": "^3.5.41",
79
+ "vue-router": "^5.2.0",
75
80
  "vue-tsc": "^3.3.9"
76
81
  },
77
82
  "sideEffects": [
78
83
  "**/*.css"
79
84
  ],
80
85
  "type": "module",
81
- "version": "1.36.0",
86
+ "version": "1.38.0",
82
87
  "scripts": {}
83
88
  }