@quiteer/vite 0.1.10 → 0.1.11
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.
- package/dist/bin/qvite.mjs +45 -16
- package/dist/index.d.mts +11 -9
- package/dist/index.mjs +2 -2
- package/package.json +3 -2
package/dist/bin/qvite.mjs
CHANGED
|
@@ -2,11 +2,13 @@
|
|
|
2
2
|
import { cac } from "cac";
|
|
3
3
|
import { build, createServer, loadEnv, mergeConfig } from "vite";
|
|
4
4
|
import UnoCSS from "@quiteer/unocss";
|
|
5
|
-
import { PersistentStore, deepMerge } from "@quiteer/utils";
|
|
5
|
+
import { PersistentStore, deepMerge, isPlainObject } from "@quiteer/utils";
|
|
6
6
|
import { bootstrapEnv, envConfigPlugin, fileChangeLoggerPlugin, mockRouterPlugin, removeConsolePlugin, virtualHtmlPlugin } from "@quiteer/vite-plugins";
|
|
7
7
|
import path, { join, resolve } from "node:path";
|
|
8
8
|
import { AutoImport, Components, FileSystemIconLoader, Icons, IconsResolver, NaiveUiResolver, Progress, Vue, VueDevTools, VueJsx, createSvgIconsPlugin } from "@quiteer/vite-plugins/plugins";
|
|
9
|
+
import { VueRouterAutoImports } from "unplugin-vue-router";
|
|
9
10
|
import { cwd } from "node:process";
|
|
11
|
+
import VueRouter from "unplugin-vue-router/vite";
|
|
10
12
|
import { isFunction } from "@quiteer/is";
|
|
11
13
|
import { parserConfig } from "@quiteer/parser-config";
|
|
12
14
|
import { pathExists } from "fs-extra";
|
|
@@ -14,7 +16,7 @@ import { setTimeout } from "node:timers/promises";
|
|
|
14
16
|
import { getPortPromise } from "portfinder";
|
|
15
17
|
|
|
16
18
|
//#region package.json
|
|
17
|
-
var version = "0.1.
|
|
19
|
+
var version = "0.1.11";
|
|
18
20
|
|
|
19
21
|
//#endregion
|
|
20
22
|
//#region src/store.ts
|
|
@@ -36,9 +38,21 @@ function getDefaultOptions(config) {
|
|
|
36
38
|
return {
|
|
37
39
|
minify,
|
|
38
40
|
localIconDir,
|
|
39
|
-
UnoCSS:
|
|
41
|
+
UnoCSS: true,
|
|
40
42
|
plugins: {
|
|
41
|
-
|
|
43
|
+
VueRouter: [{
|
|
44
|
+
logs: true,
|
|
45
|
+
dts: "src/typings/pages.d.ts",
|
|
46
|
+
extensions: [
|
|
47
|
+
".page.vue",
|
|
48
|
+
".meta.vue",
|
|
49
|
+
".link.vue"
|
|
50
|
+
]
|
|
51
|
+
}],
|
|
52
|
+
Vue: [{
|
|
53
|
+
customElement: true,
|
|
54
|
+
include: [/\.vue$/, /\.md$/]
|
|
55
|
+
}],
|
|
42
56
|
VueDevTools: [{}],
|
|
43
57
|
VueJsx: [{}],
|
|
44
58
|
Progress: [{}],
|
|
@@ -52,17 +66,22 @@ function getDefaultOptions(config) {
|
|
|
52
66
|
defaultClass: "inline-block"
|
|
53
67
|
}],
|
|
54
68
|
SvgIcons: false,
|
|
55
|
-
AutoImport: [{
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
AutoImport: [{
|
|
70
|
+
dts: "src/typings/auto-imports.d.ts",
|
|
71
|
+
imports: [
|
|
72
|
+
"vue",
|
|
73
|
+
"vue-router",
|
|
74
|
+
VueRouterAutoImports,
|
|
75
|
+
{ "naive-ui": [
|
|
76
|
+
"useDialog",
|
|
77
|
+
"useMessage",
|
|
78
|
+
"useNotification",
|
|
79
|
+
"useLoadingBar"
|
|
80
|
+
] }
|
|
81
|
+
]
|
|
82
|
+
}],
|
|
65
83
|
Components: [{
|
|
84
|
+
dts: "src/typings/components.d.ts",
|
|
66
85
|
types: [{
|
|
67
86
|
from: "vue-router",
|
|
68
87
|
names: ["RouterLink", "RouterView"]
|
|
@@ -94,6 +113,7 @@ function getDefaultOptions(config) {
|
|
|
94
113
|
//#endregion
|
|
95
114
|
//#region src/plugins.ts
|
|
96
115
|
var plugins_default = {
|
|
116
|
+
VueRouter,
|
|
97
117
|
FileChangeLogger: fileChangeLoggerPlugin,
|
|
98
118
|
MockRouter: mockRouterPlugin,
|
|
99
119
|
RemoveConsole: removeConsolePlugin,
|
|
@@ -141,10 +161,19 @@ function geVitePlugins(config) {
|
|
|
141
161
|
const { env, plugins } = config;
|
|
142
162
|
const html = withUnoInjection(config);
|
|
143
163
|
return [
|
|
144
|
-
...Object.keys(plugins).
|
|
164
|
+
...[...Object.keys(plugins)].sort((a, b) => {
|
|
165
|
+
const order = {
|
|
166
|
+
VueRouter: 1,
|
|
167
|
+
Vue: 2
|
|
168
|
+
};
|
|
169
|
+
return (order[a] || 99) - (order[b] || 99);
|
|
170
|
+
}).map((key) => {
|
|
145
171
|
const pluginOptions = plugins[key];
|
|
146
172
|
const pluginFn = plugins_default[key];
|
|
147
|
-
if (Array.isArray(pluginOptions))
|
|
173
|
+
if (Array.isArray(pluginOptions)) {
|
|
174
|
+
if (pluginOptions.every(isPlainObject)) return pluginFn(deepMerge({}, ...pluginOptions));
|
|
175
|
+
return pluginFn(...pluginOptions);
|
|
176
|
+
}
|
|
148
177
|
return null;
|
|
149
178
|
}).filter(Boolean),
|
|
150
179
|
virtualHtmlPlugin(html),
|
package/dist/index.d.mts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { UserConfig, defineConfig as defineConfig$1 } from "tsdown";
|
|
2
2
|
import { UserConfig as UserConfig$1, defineConfig as defineConfig$2 } from "vite";
|
|
3
|
-
import { AutoImport, Components, FileSystemIconLoader, Icons, IconsResolver, NaiveUiResolver, Progress, Vue, VueDevTools, VueJsx, createSvgIconsPlugin } from "@quiteer/vite-plugins/plugins";
|
|
3
|
+
import { AutoImport, AutoImport as AutoImport$1, Components, Components as Components$1, FileSystemIconLoader, Icons, Icons as Icons$1, IconsResolver, NaiveUiResolver, Progress, Progress as Progress$1, Vue, Vue as Vue$1, VueDevTools, VueDevTools as VueDevTools$1, VueJsx, VueJsx as VueJsx$1, createSvgIconsPlugin } from "@quiteer/vite-plugins/plugins";
|
|
4
4
|
import { EnvConfig, EnvConfigPluginOptions, VirtualHtmlOptions, fileChangeLoggerPlugin, mockRouterPlugin, removeConsolePlugin } from "@quiteer/vite-plugins";
|
|
5
|
+
import VueRouter from "unplugin-vue-router/vite";
|
|
5
6
|
|
|
6
7
|
//#region src/typings.d.ts
|
|
7
8
|
type PluginOptions<T extends (...args: any) => any> = boolean | Parameters<T>;
|
|
8
9
|
interface QvitePlugins {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
VueRouter?: PluginOptions<typeof VueRouter>;
|
|
11
|
+
Vue?: PluginOptions<typeof Vue$1>;
|
|
12
|
+
VueJsx?: PluginOptions<typeof VueJsx$1>;
|
|
13
|
+
Progress?: PluginOptions<typeof Progress$1>;
|
|
14
|
+
VueDevTools?: PluginOptions<typeof VueDevTools$1>;
|
|
13
15
|
RemoveConsole?: PluginOptions<typeof removeConsolePlugin>;
|
|
14
16
|
MockRouter?: PluginOptions<typeof mockRouterPlugin>;
|
|
15
17
|
FileChangeLogger?: PluginOptions<typeof fileChangeLoggerPlugin>;
|
|
16
|
-
Components?: PluginOptions<typeof Components>;
|
|
18
|
+
Components?: PluginOptions<typeof Components$1>;
|
|
17
19
|
SvgIcons?: PluginOptions<typeof createSvgIconsPlugin>;
|
|
18
|
-
Icons?: PluginOptions<typeof Icons>;
|
|
19
|
-
AutoImport?: PluginOptions<typeof AutoImport>;
|
|
20
|
+
Icons?: PluginOptions<typeof Icons$1>;
|
|
21
|
+
AutoImport?: PluginOptions<typeof AutoImport$1>;
|
|
20
22
|
}
|
|
21
23
|
interface QviteConfig {
|
|
22
24
|
minify?: boolean;
|
|
@@ -122,4 +124,4 @@ declare function defineViteConfig(config: Parameters<typeof defineConfig$2>[0]):
|
|
|
122
124
|
*/
|
|
123
125
|
declare function defineTsdownConfig(config: Parameters<typeof defineConfig$1>[0]): ReturnType<typeof defineConfig$1>;
|
|
124
126
|
//#endregion
|
|
125
|
-
export { Command, ConfigEnv, type EnvConfig, FileSystemIconLoader, IconsResolver, Mode, NaiveUiResolver, PluginOptions, QviteConfig, QviteConfigExport, QviteConfigFn, QviteConfigFnObject, QviteConfigFnPromise, QvitePlugins, defineConfig, defineTsdownConfig, defineViteConfig };
|
|
127
|
+
export { AutoImport, Command, Components, ConfigEnv, type EnvConfig, FileSystemIconLoader, Icons, IconsResolver, Mode, NaiveUiResolver, PluginOptions, Progress, QviteConfig, QviteConfigExport, QviteConfigFn, QviteConfigFnObject, QviteConfigFnPromise, QvitePlugins, Vue, VueDevTools, VueJsx, defineConfig, defineTsdownConfig, defineViteConfig };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineConfig as defineConfig$1 } from "tsdown";
|
|
2
2
|
import { defineConfig as defineConfig$2 } from "vite";
|
|
3
|
-
import { FileSystemIconLoader, IconsResolver, NaiveUiResolver } from "@quiteer/vite-plugins/plugins";
|
|
3
|
+
import { AutoImport, Components, FileSystemIconLoader, Icons, IconsResolver, NaiveUiResolver, Progress, Vue, VueDevTools, VueJsx } from "@quiteer/vite-plugins/plugins";
|
|
4
4
|
|
|
5
5
|
//#region index.ts
|
|
6
6
|
function defineConfig(config) {
|
|
@@ -62,4 +62,4 @@ function defineTsdownConfig(config) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
//#endregion
|
|
65
|
-
export { FileSystemIconLoader, IconsResolver, NaiveUiResolver, defineConfig, defineTsdownConfig, defineViteConfig };
|
|
65
|
+
export { AutoImport, Components, FileSystemIconLoader, Icons, IconsResolver, NaiveUiResolver, Progress, Vue, VueDevTools, VueJsx, defineConfig, defineTsdownConfig, defineViteConfig };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiteer/vite",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.11",
|
|
5
5
|
"description": "在 vite 的基础上增强的前端架构 cli",
|
|
6
6
|
"author": "quiteer",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,11 +57,12 @@
|
|
|
57
57
|
"portfinder": "^1.0.38",
|
|
58
58
|
"semver": "^7.6.3",
|
|
59
59
|
"tsdown": "^0.16.1",
|
|
60
|
+
"unplugin-vue-router": "^0.19.2",
|
|
60
61
|
"vite": "npm:rolldown-vite@7.2.2",
|
|
61
62
|
"zx": "^8.8.5",
|
|
62
63
|
"@quiteer/is": "0.0.2",
|
|
63
|
-
"@quiteer/unocss": "0.0.6",
|
|
64
64
|
"@quiteer/utils": "0.0.4",
|
|
65
|
+
"@quiteer/unocss": "0.0.6",
|
|
65
66
|
"@quiteer/vite-plugins": "^0.1.5"
|
|
66
67
|
},
|
|
67
68
|
"scripts": {
|