@vef-framework/dev 2.0.4 → 2.0.5
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/bin/vef.js +1 -1
- package/dist/cjs/index.cjs +1 -23
- package/dist/cjs/lint/commitlint.cjs +1 -14
- package/dist/cjs/lint/eslint.cjs +1 -981
- package/dist/cjs/lint/index.cjs +1 -14
- package/dist/cjs/lint/stylelint.cjs +1 -93
- package/dist/cjs/vite/chunks.cjs +1 -30
- package/dist/cjs/vite/config.cjs +1 -83
- package/dist/cjs/vite/constants.cjs +1 -30
- package/dist/cjs/vite/define.cjs +3 -18
- package/dist/cjs/vite/index.cjs +1 -11
- package/dist/cjs/vite/plugin-app-config.cjs +1 -38
- package/dist/cjs/vite/plugin-auto-enhance/core.cjs +1 -147
- package/dist/cjs/vite/plugin-auto-enhance/index.cjs +1 -40
- package/dist/cjs/vite/plugin-auto-enhance/plugins/index.cjs +1 -10
- package/dist/cjs/vite/plugin-auto-enhance/plugins/operation-column-width.cjs +1 -229
- package/dist/cjs/vite/plugin-conventional-config.cjs +1 -91
- package/dist/cjs/vite/plugin-eslint.cjs +1 -24
- package/dist/cjs/vite/plugin-html.cjs +2 -74
- package/dist/cjs/vite/plugin-icons.cjs +1 -22
- package/dist/cjs/vite/plugin-injection.cjs +1 -20
- package/dist/cjs/vite/plugin-inspect.cjs +1 -15
- package/dist/cjs/vite/plugin-react.cjs +1 -80
- package/dist/cjs/vite/plugin-router.cjs +4 -42
- package/dist/cjs/vite/plugin-stylelint.cjs +1 -24
- package/dist/cjs/vite/plugin-svgr.cjs +1 -59
- package/dist/cjs/vite/plugin-tsconfig-paths.cjs +1 -14
- package/dist/cjs/vite/postcss.cjs +1 -13
- package/dist/cli/index.js +5 -0
- package/dist/es/index.js +14 -8
- package/dist/es/lint/commitlint.js +5 -6
- package/dist/es/lint/eslint.js +135 -137
- package/dist/es/lint/index.js +8 -4
- package/dist/es/lint/stylelint.js +16 -19
- package/dist/es/vite/chunks.js +12 -18
- package/dist/es/vite/config.js +63 -68
- package/dist/es/vite/constants.js +15 -15
- package/dist/es/vite/define.js +10 -11
- package/dist/es/vite/index.js +5 -3
- package/dist/es/vite/plugin-app-config.js +19 -20
- package/dist/es/vite/plugin-auto-enhance/core.js +51 -90
- package/dist/es/vite/plugin-auto-enhance/index.js +19 -23
- package/dist/es/vite/plugin-auto-enhance/plugins/index.js +4 -2
- package/dist/es/vite/plugin-auto-enhance/plugins/operation-column-width.js +117 -181
- package/dist/es/vite/plugin-conventional-config.js +42 -44
- package/dist/es/vite/plugin-eslint.js +14 -15
- package/dist/es/vite/plugin-html.js +42 -53
- package/dist/es/vite/plugin-icons.js +10 -11
- package/dist/es/vite/plugin-injection.js +4 -4
- package/dist/es/vite/plugin-inspect.js +8 -9
- package/dist/es/vite/plugin-react.js +25 -35
- package/dist/es/vite/plugin-router.js +20 -21
- package/dist/es/vite/plugin-stylelint.js +14 -15
- package/dist/es/vite/plugin-svgr.js +19 -20
- package/dist/es/vite/plugin-tsconfig-paths.js +7 -8
- package/dist/es/vite/postcss.js +5 -5
- package/package.json +9 -8
|
@@ -1,225 +1,161 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const CJK_CHAR_REGEX = /[\u4E00-\u9FFF\u3400-\u4DBF\uFF00-\uFFEF]/;
|
|
5
|
-
const OPERATION_COLUMN_ATTR = "operationColumn";
|
|
6
|
-
const OPERATION_BUTTON_COMPONENT = "OperationButton";
|
|
7
|
-
const VALID_IMPORT_SOURCES = [
|
|
1
|
+
import { visit as l, types as n } from "recast";
|
|
2
|
+
const v = /[\u4E00-\u9FFF\u3400-\u4DBF\uFF00-\uFFEF]/, T = "operationColumn", I = "OperationButton", x = [
|
|
8
3
|
"@vef-framework/components",
|
|
9
4
|
"@vef-framework/starter"
|
|
10
5
|
];
|
|
11
|
-
function
|
|
12
|
-
return
|
|
6
|
+
function C(r) {
|
|
7
|
+
return x.some((e) => r === e || r.startsWith(`${e}/`));
|
|
13
8
|
}
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
visitImportDeclaration(
|
|
18
|
-
const
|
|
19
|
-
if (typeof
|
|
20
|
-
this.traverse(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const { imported } = specifier;
|
|
26
|
-
const { local } = specifier;
|
|
27
|
-
if (types.namedTypes.Identifier.check(imported) && types.namedTypes.Identifier.check(local) && imported.name === OPERATION_BUTTON_COMPONENT) {
|
|
28
|
-
aliasMap.set(local.name, imported.name);
|
|
29
|
-
}
|
|
9
|
+
function S(r) {
|
|
10
|
+
const e = /* @__PURE__ */ new Map();
|
|
11
|
+
return l(r, {
|
|
12
|
+
visitImportDeclaration(t) {
|
|
13
|
+
const i = t.node.source.value;
|
|
14
|
+
if (typeof i != "string" || !C(i))
|
|
15
|
+
return this.traverse(t), !1;
|
|
16
|
+
for (const s of t.node.specifiers || [])
|
|
17
|
+
if (n.namedTypes.ImportSpecifier.check(s)) {
|
|
18
|
+
const { imported: o } = s, { local: a } = s;
|
|
19
|
+
n.namedTypes.Identifier.check(o) && n.namedTypes.Identifier.check(a) && o.name === I && e.set(a.name, o.name);
|
|
30
20
|
}
|
|
31
|
-
|
|
32
|
-
this.traverse(path);
|
|
33
|
-
return false;
|
|
21
|
+
return this.traverse(t), !1;
|
|
34
22
|
}
|
|
35
|
-
});
|
|
36
|
-
return aliasMap;
|
|
23
|
+
}), e;
|
|
37
24
|
}
|
|
38
|
-
function
|
|
39
|
-
let
|
|
40
|
-
for (const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return width;
|
|
25
|
+
function O(r) {
|
|
26
|
+
let e = 0;
|
|
27
|
+
for (const t of r)
|
|
28
|
+
e += v.test(t) ? 14 : 8;
|
|
29
|
+
return e;
|
|
44
30
|
}
|
|
45
|
-
function
|
|
46
|
-
if (
|
|
31
|
+
function P(r) {
|
|
32
|
+
if (r.length === 0)
|
|
47
33
|
return {
|
|
48
34
|
calculatedWidth: 64,
|
|
49
35
|
buttonCount: 0,
|
|
50
36
|
analysis: "No buttons found, using minimum width"
|
|
51
37
|
};
|
|
38
|
+
let e = 0;
|
|
39
|
+
const t = r.length;
|
|
40
|
+
for (const [o, a] of r.entries()) {
|
|
41
|
+
let c = 16;
|
|
42
|
+
a.hasIcon && (c += 16, a.textContent && (c += 8)), a.textContent && (c += O(a.textContent)), c = Math.max(c, a.hasIcon && !a.textContent ? 32 : 64), e += c, o < t - 1 && (e += 8);
|
|
52
43
|
}
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
for (const [index, button] of buttons.entries()) {
|
|
56
|
-
let buttonWidth = 16;
|
|
57
|
-
if (button.hasIcon) {
|
|
58
|
-
buttonWidth += 16;
|
|
59
|
-
if (button.textContent) {
|
|
60
|
-
buttonWidth += 8;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
if (button.textContent) {
|
|
64
|
-
buttonWidth += calculateTextWidth(button.textContent);
|
|
65
|
-
}
|
|
66
|
-
buttonWidth = Math.max(buttonWidth, button.hasIcon && !button.textContent ? 32 : 64);
|
|
67
|
-
totalWidth += buttonWidth;
|
|
68
|
-
if (index < buttonCount - 1) {
|
|
69
|
-
totalWidth += 8;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
totalWidth += 16;
|
|
73
|
-
const finalWidth = Math.ceil(totalWidth / 8) * 8;
|
|
74
|
-
const analysis = `${buttonCount} buttons, calculated: ${totalWidth}px, final: ${finalWidth}px`;
|
|
44
|
+
e += 16;
|
|
45
|
+
const i = Math.ceil(e / 8) * 8, s = `${t} buttons, calculated: ${e}px, final: ${i}px`;
|
|
75
46
|
return {
|
|
76
|
-
calculatedWidth:
|
|
77
|
-
buttonCount,
|
|
78
|
-
analysis
|
|
47
|
+
calculatedWidth: i,
|
|
48
|
+
buttonCount: t,
|
|
49
|
+
analysis: s
|
|
79
50
|
};
|
|
80
51
|
}
|
|
81
|
-
function
|
|
82
|
-
const { openingElement } =
|
|
83
|
-
if (!
|
|
52
|
+
function g(r, e) {
|
|
53
|
+
const { openingElement: t } = r;
|
|
54
|
+
if (!n.namedTypes.JSXIdentifier.check(t.name))
|
|
84
55
|
return null;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
if (!aliasMap.has(componentName)) {
|
|
56
|
+
const i = t.name.name;
|
|
57
|
+
if (!e.has(i))
|
|
88
58
|
return null;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
hasIcon: false,
|
|
59
|
+
const s = {
|
|
60
|
+
hasIcon: !1,
|
|
92
61
|
textContent: ""
|
|
93
62
|
};
|
|
94
|
-
for (const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
for (const child of jsxElement.children || []) {
|
|
100
|
-
if (types.namedTypes.JSXText.check(child)) {
|
|
101
|
-
buttonInfo.textContent += child.value.trim();
|
|
102
|
-
} else if (types.namedTypes.JSXExpressionContainer.check(child) && types.namedTypes.StringLiteral.check(child.expression)) {
|
|
103
|
-
buttonInfo.textContent += child.expression.value;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return buttonInfo;
|
|
63
|
+
for (const o of t.attributes || [])
|
|
64
|
+
n.namedTypes.JSXAttribute.check(o) && n.namedTypes.JSXIdentifier.check(o.name) && o.name.name === "icon" && (s.hasIcon = !0);
|
|
65
|
+
for (const o of r.children || [])
|
|
66
|
+
n.namedTypes.JSXText.check(o) ? s.textContent += o.value.trim() : n.namedTypes.JSXExpressionContainer.check(o) && n.namedTypes.StringLiteral.check(o.expression) && (s.textContent += o.expression.value);
|
|
67
|
+
return s;
|
|
107
68
|
}
|
|
108
|
-
function
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
visitJSXElement(
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
buttons.push(buttonInfo);
|
|
115
|
-
}
|
|
116
|
-
this.traverse(path);
|
|
117
|
-
return false;
|
|
69
|
+
function k(r, e) {
|
|
70
|
+
const t = [];
|
|
71
|
+
return l(r, {
|
|
72
|
+
visitJSXElement(i) {
|
|
73
|
+
const s = g(i.node, e);
|
|
74
|
+
return s && t.push(s), this.traverse(i), !1;
|
|
118
75
|
}
|
|
119
|
-
});
|
|
120
|
-
return buttons;
|
|
76
|
+
}), t;
|
|
121
77
|
}
|
|
122
|
-
function
|
|
123
|
-
return
|
|
124
|
-
if (
|
|
125
|
-
const { key } =
|
|
126
|
-
return
|
|
78
|
+
function E(r) {
|
|
79
|
+
return r.properties.some((e) => {
|
|
80
|
+
if (n.namedTypes.ObjectProperty.check(e)) {
|
|
81
|
+
const { key: t } = e;
|
|
82
|
+
return n.namedTypes.Identifier.check(t) && t.name === "width" || n.namedTypes.StringLiteral.check(t) && t.value === "width";
|
|
127
83
|
}
|
|
128
|
-
return
|
|
84
|
+
return !1;
|
|
129
85
|
});
|
|
130
86
|
}
|
|
131
|
-
function
|
|
132
|
-
return
|
|
133
|
-
if (
|
|
134
|
-
const { key } =
|
|
135
|
-
return
|
|
87
|
+
function w(r) {
|
|
88
|
+
return r.properties.find((e) => {
|
|
89
|
+
if (n.namedTypes.ObjectProperty.check(e) || n.namedTypes.ObjectMethod.check(e)) {
|
|
90
|
+
const { key: t } = e;
|
|
91
|
+
return n.namedTypes.Identifier.check(t) && t.name === "render" || n.namedTypes.StringLiteral.check(t) && t.value === "render";
|
|
136
92
|
}
|
|
137
|
-
return
|
|
93
|
+
return !1;
|
|
138
94
|
});
|
|
139
95
|
}
|
|
140
|
-
function
|
|
141
|
-
const { openingElement } =
|
|
142
|
-
if (
|
|
143
|
-
return
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const objectName = types.namedTypes.JSXIdentifier.check(object) ? object.name : "?";
|
|
148
|
-
const propertyName = types.namedTypes.JSXIdentifier.check(property) ? property.name : "?";
|
|
149
|
-
return `${objectName}.${propertyName}`;
|
|
96
|
+
function J(r) {
|
|
97
|
+
const { openingElement: e } = r;
|
|
98
|
+
if (n.namedTypes.JSXIdentifier.check(e.name))
|
|
99
|
+
return e.name.name;
|
|
100
|
+
if (n.namedTypes.JSXMemberExpression.check(e.name)) {
|
|
101
|
+
const { object: t, property: i } = e.name, s = n.namedTypes.JSXIdentifier.check(t) ? t.name : "?", o = n.namedTypes.JSXIdentifier.check(i) ? i.name : "?";
|
|
102
|
+
return `${s}.${o}`;
|
|
150
103
|
}
|
|
151
104
|
return "Unknown";
|
|
152
105
|
}
|
|
153
|
-
const
|
|
106
|
+
const N = {
|
|
154
107
|
name: "operation-column-width",
|
|
155
108
|
description: "Automatically calculate optimal width for operation columns based on button analysis",
|
|
156
|
-
shouldProcess(
|
|
157
|
-
return
|
|
109
|
+
shouldProcess(r) {
|
|
110
|
+
return r.code.includes(T);
|
|
158
111
|
},
|
|
159
|
-
transform(
|
|
160
|
-
const
|
|
161
|
-
if (
|
|
162
|
-
return { hasChanges:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
return
|
|
172
|
-
|
|
173
|
-
if (
|
|
174
|
-
this.traverse(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
return
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
this.traverse(path);
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
const buttons = types.namedTypes.ObjectProperty.check(renderProperty) ? findOperationButtons(renderProperty.value, aliasMap) : findOperationButtons(renderProperty.body, aliasMap);
|
|
188
|
-
if (buttons.length === 0) {
|
|
189
|
-
this.traverse(path);
|
|
190
|
-
return false;
|
|
191
|
-
}
|
|
192
|
-
const { calculatedWidth, analysis } = calculateOperationColumnWidth(buttons);
|
|
193
|
-
const widthProperty = types.builders.objectProperty(
|
|
194
|
-
types.builders.identifier("width"),
|
|
195
|
-
types.builders.numericLiteral(calculatedWidth)
|
|
112
|
+
transform(r) {
|
|
113
|
+
const e = S(r.ast);
|
|
114
|
+
if (e.size === 0)
|
|
115
|
+
return { hasChanges: !1, logs: [] };
|
|
116
|
+
let t = !1;
|
|
117
|
+
const i = [];
|
|
118
|
+
return l(r.ast, {
|
|
119
|
+
visitJSXAttribute(s) {
|
|
120
|
+
const o = s.node;
|
|
121
|
+
if (!n.namedTypes.JSXIdentifier.check(o.name) || o.name.name !== T)
|
|
122
|
+
return this.traverse(s), !1;
|
|
123
|
+
if (!n.namedTypes.JSXExpressionContainer.check(o.value) || !n.namedTypes.ObjectExpression.check(o.value.expression))
|
|
124
|
+
return this.traverse(s), !1;
|
|
125
|
+
const a = o.value.expression;
|
|
126
|
+
if (E(a))
|
|
127
|
+
return this.traverse(s), !1;
|
|
128
|
+
const c = w(a);
|
|
129
|
+
if (!c)
|
|
130
|
+
return this.traverse(s), !1;
|
|
131
|
+
const f = n.namedTypes.ObjectProperty.check(c) ? k(c.value, e) : k(c.body, e);
|
|
132
|
+
if (f.length === 0)
|
|
133
|
+
return this.traverse(s), !1;
|
|
134
|
+
const { calculatedWidth: m, analysis: d } = P(f), p = n.builders.objectProperty(
|
|
135
|
+
n.builders.identifier("width"),
|
|
136
|
+
n.builders.numericLiteral(m)
|
|
196
137
|
);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
const { node, parentPath: nextParentPath } = parentPath;
|
|
204
|
-
if (types.namedTypes.JSXElement.check(node)) {
|
|
205
|
-
componentName = getComponentName(node);
|
|
138
|
+
p.comments = [n.builders.commentLine(` Auto-calculated: ${d} `, !0, !1)], a.properties.unshift(p), t = !0;
|
|
139
|
+
let h = "Unknown", { parentPath: u } = s;
|
|
140
|
+
for (; u; ) {
|
|
141
|
+
const { node: y, parentPath: b } = u;
|
|
142
|
+
if (n.namedTypes.JSXElement.check(y)) {
|
|
143
|
+
h = J(y);
|
|
206
144
|
break;
|
|
207
145
|
}
|
|
208
|
-
|
|
146
|
+
u = b;
|
|
209
147
|
}
|
|
210
|
-
|
|
211
|
-
`📊 ${
|
|
212
|
-
` └─ 🎯 Operation column auto-width: ${
|
|
213
|
-
);
|
|
214
|
-
this.traverse(path);
|
|
215
|
-
return false;
|
|
148
|
+
return i.push(
|
|
149
|
+
`📊 ${h}: ${r.fileName}`,
|
|
150
|
+
` └─ 🎯 Operation column auto-width: ${m}px (${d})`
|
|
151
|
+
), this.traverse(s), !1;
|
|
216
152
|
}
|
|
217
|
-
})
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
logs
|
|
153
|
+
}), {
|
|
154
|
+
hasChanges: t,
|
|
155
|
+
logs: i
|
|
221
156
|
};
|
|
222
157
|
}
|
|
223
158
|
};
|
|
224
|
-
|
|
225
|
-
|
|
159
|
+
export {
|
|
160
|
+
N as operationColumnWidthPlugin
|
|
161
|
+
};
|
|
@@ -1,39 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
serverPort,
|
|
14
|
-
proxies
|
|
1
|
+
import { createChunksConfig as u } from "./chunks.js";
|
|
2
|
+
import { DEFAULT_SERVER_PORT as p, ASSETS_DIR as e, VEF_FRAMEWORK_VERSION as m, DEFAULT_OUTPUT_DIR as c, ENV_BUILD_PREFIX as f, ENV_APP_PREFIX as v, ENV_DIR as h, PUBLIC_DIR as D } from "./constants.js";
|
|
3
|
+
import { defineConstants as d } from "./define.js";
|
|
4
|
+
import { createPostcssConfig as E } from "./postcss.js";
|
|
5
|
+
function g({
|
|
6
|
+
appName: t,
|
|
7
|
+
appVersion: s,
|
|
8
|
+
basePublicPath: r,
|
|
9
|
+
projectDir: o,
|
|
10
|
+
outputDir: i,
|
|
11
|
+
serverPort: n,
|
|
12
|
+
proxies: a
|
|
15
13
|
}) {
|
|
16
14
|
return {
|
|
17
15
|
name: "vef-framework:conventional-config",
|
|
18
|
-
config(_, { command }) {
|
|
19
|
-
const isDev = command === "serve";
|
|
16
|
+
config(_, { command: l }) {
|
|
20
17
|
return {
|
|
21
18
|
appType: "spa",
|
|
22
|
-
root:
|
|
23
|
-
base:
|
|
24
|
-
publicDir:
|
|
25
|
-
envDir:
|
|
26
|
-
envPrefix: [
|
|
27
|
-
define:
|
|
19
|
+
root: o,
|
|
20
|
+
base: r,
|
|
21
|
+
publicDir: D,
|
|
22
|
+
envDir: h,
|
|
23
|
+
envPrefix: [f, v],
|
|
24
|
+
define: d(t, s, l === "serve"),
|
|
28
25
|
css: {
|
|
29
26
|
transformer: "postcss",
|
|
30
27
|
modules: {
|
|
31
28
|
scopeBehaviour: "local",
|
|
32
29
|
localsConvention: "camelCaseOnly",
|
|
33
|
-
exportGlobals:
|
|
30
|
+
exportGlobals: !0,
|
|
34
31
|
hashPrefix: "vef"
|
|
35
32
|
},
|
|
36
|
-
postcss:
|
|
33
|
+
postcss: E(),
|
|
37
34
|
preprocessorOptions: {
|
|
38
35
|
scss: {}
|
|
39
36
|
}
|
|
@@ -48,40 +45,41 @@ function createConventionalConfigPlugin({
|
|
|
48
45
|
}
|
|
49
46
|
},
|
|
50
47
|
build: {
|
|
51
|
-
outDir:
|
|
48
|
+
outDir: i ?? c,
|
|
52
49
|
target: "es2024",
|
|
53
|
-
assetsDir:
|
|
50
|
+
assetsDir: e,
|
|
54
51
|
assetsInlineLimit: 10240,
|
|
55
|
-
reportCompressedSize:
|
|
52
|
+
reportCompressedSize: !1,
|
|
56
53
|
chunkSizeWarningLimit: 5120,
|
|
57
|
-
minify:
|
|
58
|
-
cssCodeSplit:
|
|
59
|
-
cssMinify:
|
|
60
|
-
sourcemap:
|
|
54
|
+
minify: !0,
|
|
55
|
+
cssCodeSplit: !0,
|
|
56
|
+
cssMinify: !0,
|
|
57
|
+
sourcemap: !1,
|
|
61
58
|
rollupOptions: {
|
|
62
59
|
input: {
|
|
63
60
|
main: "index.html"
|
|
64
61
|
},
|
|
65
62
|
output: {
|
|
66
|
-
banner: `/*! Powered by VEF Framework v${
|
|
67
|
-
chunkFileNames: `${
|
|
68
|
-
entryFileNames: `${
|
|
69
|
-
assetFileNames: `${
|
|
70
|
-
manualChunks:
|
|
63
|
+
banner: `/*! Powered by VEF Framework v${m}.${s ? ` App version v${s}.` : ""} Built at ${(/* @__PURE__ */ new Date()).toISOString()} */`,
|
|
64
|
+
chunkFileNames: `${e}/js/[name]-[hash].js`,
|
|
65
|
+
entryFileNames: `${e}/js/[name]-[hash].js`,
|
|
66
|
+
assetFileNames: `${e}/[ext]/[name]-[hash].[ext]`,
|
|
67
|
+
manualChunks: u()
|
|
71
68
|
}
|
|
72
69
|
}
|
|
73
70
|
},
|
|
74
71
|
server: {
|
|
75
|
-
port:
|
|
76
|
-
strictPort:
|
|
77
|
-
host:
|
|
78
|
-
allowedHosts:
|
|
79
|
-
open:
|
|
80
|
-
proxy:
|
|
72
|
+
port: n || p,
|
|
73
|
+
strictPort: !0,
|
|
74
|
+
host: !0,
|
|
75
|
+
allowedHosts: !0,
|
|
76
|
+
open: !0,
|
|
77
|
+
proxy: a
|
|
81
78
|
}
|
|
82
79
|
};
|
|
83
80
|
}
|
|
84
81
|
};
|
|
85
82
|
}
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
export {
|
|
84
|
+
g as createConventionalConfigPlugin
|
|
85
|
+
};
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
build: false,
|
|
10
|
-
cache: true,
|
|
1
|
+
import e from "vite-plugin-eslint2";
|
|
2
|
+
function r() {
|
|
3
|
+
return e({
|
|
4
|
+
fix: !1,
|
|
5
|
+
test: !1,
|
|
6
|
+
dev: !0,
|
|
7
|
+
build: !1,
|
|
8
|
+
cache: !0,
|
|
11
9
|
cacheLocation: "node_modules/.cache/.eslintcache",
|
|
12
10
|
include: ["*.{js,ts,json,yaml,md}", "src/**/*.{ts,tsx,json,yaml,md}"],
|
|
13
11
|
exclude: ["node_modules", "virtual:", "vef:"],
|
|
14
|
-
emitError:
|
|
15
|
-
emitWarning:
|
|
16
|
-
emitWarningAsError:
|
|
12
|
+
emitError: !0,
|
|
13
|
+
emitWarning: !0,
|
|
14
|
+
emitWarningAsError: !0
|
|
17
15
|
});
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
export {
|
|
18
|
+
r as createEslintPlugin
|
|
19
|
+
};
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const virtualModuleId = "index.html";
|
|
5
|
-
const htmlContent = `
|
|
1
|
+
import { minify as o } from "html-minifier-terser";
|
|
2
|
+
const i = "index.html", a = `
|
|
6
3
|
<!doctype html>
|
|
7
4
|
<html lang="en">
|
|
8
5
|
<head>
|
|
@@ -146,67 +143,59 @@ const htmlContent = `
|
|
|
146
143
|
</body>
|
|
147
144
|
</html>
|
|
148
145
|
`;
|
|
149
|
-
function
|
|
146
|
+
function l() {
|
|
150
147
|
return [
|
|
151
148
|
{
|
|
152
149
|
name: "vef-framework:html",
|
|
153
|
-
resolveId(
|
|
154
|
-
|
|
155
|
-
return virtualModuleId;
|
|
156
|
-
}
|
|
157
|
-
return null;
|
|
150
|
+
resolveId(t) {
|
|
151
|
+
return t === i ? i : null;
|
|
158
152
|
},
|
|
159
|
-
load(
|
|
160
|
-
|
|
161
|
-
return htmlContent;
|
|
162
|
-
}
|
|
163
|
-
return null;
|
|
153
|
+
load(t) {
|
|
154
|
+
return t === i ? a : null;
|
|
164
155
|
},
|
|
165
156
|
transformIndexHtml: {
|
|
166
157
|
order: "pre",
|
|
167
|
-
handler: () =>
|
|
158
|
+
handler: () => a
|
|
168
159
|
}
|
|
169
160
|
},
|
|
170
161
|
{
|
|
171
162
|
name: "vef-framework:html-minify",
|
|
172
163
|
enforce: "post",
|
|
173
|
-
async generateBundle(
|
|
174
|
-
for (const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
164
|
+
async generateBundle(t, n) {
|
|
165
|
+
for (const e of Object.values(n))
|
|
166
|
+
e.type === "asset" && typeof e.source == "string" && e.fileName === i && (e.source = await o(
|
|
167
|
+
e.source,
|
|
168
|
+
{
|
|
169
|
+
collapseBooleanAttributes: !0,
|
|
170
|
+
collapseInlineTagWhitespace: !0,
|
|
171
|
+
collapseWhitespace: !0,
|
|
172
|
+
conservativeCollapse: !1,
|
|
173
|
+
keepClosingSlash: !0,
|
|
174
|
+
minifyCSS: !0,
|
|
175
|
+
minifyJS: !0,
|
|
176
|
+
minifyURLs: !0,
|
|
177
|
+
noNewlinesBeforeTagClose: !0,
|
|
178
|
+
quoteCharacter: '"',
|
|
179
|
+
removeAttributeQuotes: !1,
|
|
180
|
+
removeComments: !0,
|
|
181
|
+
removeEmptyAttributes: !0,
|
|
182
|
+
removeOptionalTags: !1,
|
|
183
|
+
removeRedundantAttributes: !0,
|
|
184
|
+
removeScriptTypeAttributes: !1,
|
|
185
|
+
removeTagWhitespace: !1,
|
|
186
|
+
removeEmptyElements: !1,
|
|
187
|
+
removeStyleLinkTypeAttributes: !1,
|
|
188
|
+
sortAttributes: !0,
|
|
189
|
+
sortClassName: !0,
|
|
190
|
+
trimCustomFragments: !0,
|
|
191
|
+
useShortDoctype: !0,
|
|
192
|
+
html5: !0
|
|
193
|
+
}
|
|
194
|
+
));
|
|
207
195
|
}
|
|
208
196
|
}
|
|
209
197
|
];
|
|
210
198
|
}
|
|
211
|
-
|
|
212
|
-
|
|
199
|
+
export {
|
|
200
|
+
l as createHtmlPlugin
|
|
201
|
+
};
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return icons({
|
|
8
|
-
autoInstall: false,
|
|
1
|
+
import { resolve as e, dirname as l } from "node:path";
|
|
2
|
+
import { fileURLToPath as r } from "node:url";
|
|
3
|
+
import t from "unplugin-icons/vite";
|
|
4
|
+
function n(o) {
|
|
5
|
+
return t({
|
|
6
|
+
autoInstall: !1,
|
|
9
7
|
compiler: "jsx",
|
|
10
8
|
jsx: "react",
|
|
11
9
|
defaultClass: "inline-block",
|
|
12
10
|
scale: 1.2,
|
|
13
|
-
collectionsNodeResolvePath: [
|
|
11
|
+
collectionsNodeResolvePath: [o, e(l(r(import.meta.url)), "..")]
|
|
14
12
|
});
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
export {
|
|
15
|
+
n as createIconsPlugin
|
|
16
|
+
};
|