@vef-framework-react/dev 2.1.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.
- package/README +15 -0
- package/bin/vef.js +13 -0
- package/dist/cjs/_internal/_rolldown/runtime.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/lint/commitlint.cjs +1 -0
- package/dist/cjs/lint/eslint.cjs +1 -0
- package/dist/cjs/lint/index.cjs +1 -0
- package/dist/cjs/lint/local-react-plugin.cjs +1 -0
- package/dist/cjs/lint/stylelint.cjs +1 -0
- package/dist/cjs/vite/chunks.cjs +1 -0
- package/dist/cjs/vite/config.cjs +1 -0
- package/dist/cjs/vite/constants.cjs +1 -0
- package/dist/cjs/vite/define.cjs +10 -0
- package/dist/cjs/vite/index.cjs +1 -0
- package/dist/cjs/vite/plugin-app-config.cjs +1 -0
- package/dist/cjs/vite/plugin-auto-enhance/core.cjs +1 -0
- package/dist/cjs/vite/plugin-auto-enhance/index.cjs +1 -0
- package/dist/cjs/vite/plugin-auto-enhance/plugins/index.cjs +1 -0
- package/dist/cjs/vite/plugin-auto-enhance/plugins/operation-column-width.cjs +1 -0
- package/dist/cjs/vite/plugin-conventional-config.cjs +1 -0
- package/dist/cjs/vite/plugin-eslint.cjs +1 -0
- package/dist/cjs/vite/plugin-html.cjs +144 -0
- package/dist/cjs/vite/plugin-icons.cjs +1 -0
- package/dist/cjs/vite/plugin-injection.cjs +1 -0
- package/dist/cjs/vite/plugin-inspect.cjs +1 -0
- package/dist/cjs/vite/plugin-react.cjs +1 -0
- package/dist/cjs/vite/plugin-router.cjs +11 -0
- package/dist/cjs/vite/plugin-stylelint.cjs +1 -0
- package/dist/cjs/vite/plugin-svgr.cjs +1 -0
- package/dist/cjs/vite/plugin-tsconfig-paths.cjs +1 -0
- package/dist/cjs/vite/postcss.cjs +1 -0
- package/dist/cli/index.js +5 -0
- package/dist/es/index.js +12 -0
- package/dist/es/lint/commitlint.js +10 -0
- package/dist/es/lint/eslint.js +675 -0
- package/dist/es/lint/index.js +3 -0
- package/dist/es/lint/local-react-plugin.js +42 -0
- package/dist/es/lint/stylelint.js +67 -0
- package/dist/es/vite/chunks.js +23 -0
- package/dist/es/vite/config.js +67 -0
- package/dist/es/vite/constants.js +15 -0
- package/dist/es/vite/define.js +21 -0
- package/dist/es/vite/index.js +2 -0
- package/dist/es/vite/plugin-app-config.js +29 -0
- package/dist/es/vite/plugin-auto-enhance/core.js +104 -0
- package/dist/es/vite/plugin-auto-enhance/index.js +27 -0
- package/dist/es/vite/plugin-auto-enhance/plugins/index.js +1 -0
- package/dist/es/vite/plugin-auto-enhance/plugins/operation-column-width.js +227 -0
- package/dist/es/vite/plugin-conventional-config.js +71 -0
- package/dist/es/vite/plugin-eslint.js +24 -0
- package/dist/es/vite/plugin-html.js +198 -0
- package/dist/es/vite/plugin-icons.js +17 -0
- package/dist/es/vite/plugin-injection.js +6 -0
- package/dist/es/vite/plugin-inspect.js +10 -0
- package/dist/es/vite/plugin-react.js +24 -0
- package/dist/es/vite/plugin-router.js +51 -0
- package/dist/es/vite/plugin-stylelint.js +24 -0
- package/dist/es/vite/plugin-svgr.js +49 -0
- package/dist/es/vite/plugin-tsconfig-paths.js +6 -0
- package/dist/es/vite/postcss.js +9 -0
- package/dist/types/src/cli/index.d.ts +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/lint/commitlint.d.ts +2 -0
- package/dist/types/src/lint/eslint.d.ts +2 -0
- package/dist/types/src/lint/index.d.ts +3 -0
- package/dist/types/src/lint/local-react-plugin.d.ts +29 -0
- package/dist/types/src/lint/stylelint.d.ts +2 -0
- package/dist/types/src/vite/chunks.d.ts +5 -0
- package/dist/types/src/vite/config.d.ts +12 -0
- package/dist/types/src/vite/constants.d.ts +12 -0
- package/dist/types/src/vite/define.d.ts +4 -0
- package/dist/types/src/vite/index.d.ts +3 -0
- package/dist/types/src/vite/plugin-app-config.d.ts +19 -0
- package/dist/types/src/vite/plugin-auto-enhance/core.d.ts +20 -0
- package/dist/types/src/vite/plugin-auto-enhance/index.d.ts +10 -0
- package/dist/types/src/vite/plugin-auto-enhance/plugins/index.d.ts +1 -0
- package/dist/types/src/vite/plugin-auto-enhance/plugins/operation-column-width.d.ts +5 -0
- package/dist/types/src/vite/plugin-auto-enhance/types.d.ts +81 -0
- package/dist/types/src/vite/plugin-conventional-config.d.ts +35 -0
- package/dist/types/src/vite/plugin-eslint.d.ts +7 -0
- package/dist/types/src/vite/plugin-html.d.ts +7 -0
- package/dist/types/src/vite/plugin-icons.d.ts +8 -0
- package/dist/types/src/vite/plugin-injection.d.ts +5 -0
- package/dist/types/src/vite/plugin-inspect.d.ts +5 -0
- package/dist/types/src/vite/plugin-react.d.ts +30 -0
- package/dist/types/src/vite/plugin-router.d.ts +14 -0
- package/dist/types/src/vite/plugin-stylelint.d.ts +7 -0
- package/dist/types/src/vite/plugin-svgr.d.ts +7 -0
- package/dist/types/src/vite/plugin-tsconfig-paths.d.ts +8 -0
- package/dist/types/src/vite/postcss.d.ts +4 -0
- package/package.json +139 -0
- package/tsconfig.base.json +32 -0
- package/types.d.ts +16 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { ASSETS_DIR as t, ENV_APP_PREFIX as m, ENV_BUILD_PREFIX as p, PUBLIC_DIR as f, VEF_FRAMEWORK_VERSION as v } from "./constants.js";
|
|
2
|
+
import { createChunksConfig as d } from "./chunks.js";
|
|
3
|
+
import { defineConstants as h } from "./define.js";
|
|
4
|
+
import { createPostcssConfig as D } from "./postcss.js";
|
|
5
|
+
function E(e) {
|
|
6
|
+
const s = `VEF Framework v${v}`, r = e ? ` App version v${e}.` : "", o = (/* @__PURE__ */ new Date()).toISOString();
|
|
7
|
+
return `/*! Powered by ${s}.${r} Built at ${o} */`;
|
|
8
|
+
}
|
|
9
|
+
function g({ appName: e, appVersion: s, basePublicPath: r, projectDir: o, outputDir: n, serverPort: i, proxies: a }) {
|
|
10
|
+
return {
|
|
11
|
+
name: "vef-framework:conventional-config",
|
|
12
|
+
config(P, { command: u }) {
|
|
13
|
+
const c = u === "serve", l = n ?? "dist";
|
|
14
|
+
return {
|
|
15
|
+
appType: "spa",
|
|
16
|
+
root: o,
|
|
17
|
+
base: r,
|
|
18
|
+
publicDir: f,
|
|
19
|
+
envDir: "env",
|
|
20
|
+
envPrefix: [p, m],
|
|
21
|
+
define: h(e, s, c),
|
|
22
|
+
css: {
|
|
23
|
+
transformer: "postcss",
|
|
24
|
+
modules: {
|
|
25
|
+
scopeBehaviour: "local",
|
|
26
|
+
localsConvention: "camelCaseOnly",
|
|
27
|
+
exportGlobals: !0,
|
|
28
|
+
hashPrefix: "vef"
|
|
29
|
+
},
|
|
30
|
+
postcss: D(),
|
|
31
|
+
preprocessorOptions: { scss: {} }
|
|
32
|
+
},
|
|
33
|
+
resolve: { dedupe: ["react", "react-dom"] },
|
|
34
|
+
optimizeDeps: {},
|
|
35
|
+
build: {
|
|
36
|
+
outDir: l,
|
|
37
|
+
target: "es2024",
|
|
38
|
+
assetsDir: t,
|
|
39
|
+
assetsInlineLimit: 10240,
|
|
40
|
+
reportCompressedSize: !1,
|
|
41
|
+
chunkSizeWarningLimit: 5120,
|
|
42
|
+
minify: !0,
|
|
43
|
+
cssCodeSplit: !0,
|
|
44
|
+
cssMinify: !0,
|
|
45
|
+
sourcemap: !1,
|
|
46
|
+
rollupOptions: {
|
|
47
|
+
input: { main: "index.html" },
|
|
48
|
+
output: {
|
|
49
|
+
banner: E(s),
|
|
50
|
+
chunkFileNames: `${t}/js/[name]-[hash].js`,
|
|
51
|
+
entryFileNames: `${t}/js/[name]-[hash].js`,
|
|
52
|
+
assetFileNames: `${t}/[ext]/[name]-[hash].[ext]`,
|
|
53
|
+
manualChunks: d()
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
server: {
|
|
58
|
+
port: i || 3833,
|
|
59
|
+
strictPort: !0,
|
|
60
|
+
host: !0,
|
|
61
|
+
allowedHosts: !0,
|
|
62
|
+
open: !0,
|
|
63
|
+
proxy: a
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
g as createConventionalConfigPlugin
|
|
71
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "vite-plugin-eslint2";
|
|
2
|
+
var r = ["*.{js,ts,json,yaml,md}", "src/**/*.{ts,tsx,json,yaml,md}"], t = [
|
|
3
|
+
"node_modules",
|
|
4
|
+
"virtual:",
|
|
5
|
+
"vef:"
|
|
6
|
+
];
|
|
7
|
+
function s() {
|
|
8
|
+
return e({
|
|
9
|
+
fix: !1,
|
|
10
|
+
test: !1,
|
|
11
|
+
dev: !0,
|
|
12
|
+
build: !1,
|
|
13
|
+
cache: !0,
|
|
14
|
+
cacheLocation: "node_modules/.cache/.eslintcache",
|
|
15
|
+
include: r,
|
|
16
|
+
exclude: t,
|
|
17
|
+
emitError: !0,
|
|
18
|
+
emitWarning: !0,
|
|
19
|
+
emitWarningAsError: !0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
s as createEslintPlugin
|
|
24
|
+
};
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { minify as o } from "html-minifier-terser";
|
|
2
|
+
var t = "index.html", a = `
|
|
3
|
+
<!doctype html>
|
|
4
|
+
<html lang="en">
|
|
5
|
+
<head>
|
|
6
|
+
<meta charset="UTF-8" />
|
|
7
|
+
<link rel="icon" type="image/svg+xml" href="%VEF_APP_FAVICON%" />
|
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
9
|
+
<meta name="description" content="Powered by VEF framework" />
|
|
10
|
+
<meta name="app-version" content="%VEF_APP_VERSION%" />
|
|
11
|
+
<meta name="app-changelog" content="%VEF_APP_CHANGELOG%" />
|
|
12
|
+
<title>%VEF_APP_TITLE%</title>
|
|
13
|
+
</head>
|
|
14
|
+
<body>
|
|
15
|
+
<noscript>
|
|
16
|
+
<h2>很抱歉,如果没有启用 JavaScript,%VEF_APP_NAME% 无法正常工作。请启用 JavaScript 再继续。</h2>
|
|
17
|
+
</noscript>
|
|
18
|
+
<div id="__vef-initialization-loader">
|
|
19
|
+
<style>
|
|
20
|
+
#__vef-initialization-loader {
|
|
21
|
+
position: fixed;
|
|
22
|
+
inset: 0;
|
|
23
|
+
z-index: 9999;
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
justify-content: center;
|
|
27
|
+
row-gap: 16px;
|
|
28
|
+
align-items: center;
|
|
29
|
+
height: 100%;
|
|
30
|
+
background-color: #ffffff;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
#__vef-initialization-loader .loader-box {
|
|
34
|
+
color: #000000;
|
|
35
|
+
font-size: 0;
|
|
36
|
+
width: 360px;
|
|
37
|
+
height: 160px;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
column-gap: 12px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#__vef-initialization-loader .loader-box > span {
|
|
45
|
+
display: inline-block;
|
|
46
|
+
font-size: 48px;
|
|
47
|
+
font-weight: bold;
|
|
48
|
+
animation: text-wave 1.2s 0.4s linear infinite;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#__vef-initialization-loader .loader-box > span:nth-child(1) {
|
|
52
|
+
animation-delay: 0.1s;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
#__vef-initialization-loader .loader-box > span:nth-child(2) {
|
|
56
|
+
animation-delay: 0.2s;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
#__vef-initialization-loader .loader-box > span:nth-child(3) {
|
|
60
|
+
animation-delay: 0.3s;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
#__vef-initialization-loader .loader-box > span:nth-child(4) {
|
|
64
|
+
animation-delay: 0.4s;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
#__vef-initialization-loader .loader-box > span:nth-child(5) {
|
|
68
|
+
animation-delay: 0.5s;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
#__vef-initialization-loader .loader-box > span:nth-child(6) {
|
|
72
|
+
animation-delay: 0.6s;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
#__vef-initialization-loader .loader-title {
|
|
76
|
+
max-width: 80%;
|
|
77
|
+
font-size: 18px;
|
|
78
|
+
font-weight: normal;
|
|
79
|
+
line-height: 1.5;
|
|
80
|
+
color: #999999;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@keyframes text-wave {
|
|
84
|
+
0% {
|
|
85
|
+
transform: translateY(0);
|
|
86
|
+
opacity: 0.8;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
25% {
|
|
90
|
+
transform: translateY(-16px);
|
|
91
|
+
opacity: 0.7;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
50% {
|
|
95
|
+
transform: translateY(0);
|
|
96
|
+
opacity: 0.6;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
75% {
|
|
100
|
+
transform: translateY(16px);
|
|
101
|
+
opacity: 0.7;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
100% {
|
|
105
|
+
transform: translateY(0);
|
|
106
|
+
opacity: 0.8;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
110
|
+
<div class="loader-box">
|
|
111
|
+
<span>资</span>
|
|
112
|
+
<span>源</span>
|
|
113
|
+
<span>加</span>
|
|
114
|
+
<span>载</span>
|
|
115
|
+
<span>中</span>
|
|
116
|
+
<span>...</span>
|
|
117
|
+
</div>
|
|
118
|
+
<div class="loader-title"></div>
|
|
119
|
+
<script>
|
|
120
|
+
(function() {
|
|
121
|
+
const text = "等待是一种修行,修行能让屏幕前的你参悟人生真谛,且珍惜这一段来之不易的等待吧!";
|
|
122
|
+
const element = document.querySelector(".loader-title");
|
|
123
|
+
let index = 0;
|
|
124
|
+
let currentText = "";
|
|
125
|
+
|
|
126
|
+
function typeWriter() {
|
|
127
|
+
if (index < text.length) {
|
|
128
|
+
currentText += text.charAt(index);
|
|
129
|
+
element.textContent = currentText;
|
|
130
|
+
index++;
|
|
131
|
+
|
|
132
|
+
const speed = Math.random() * 100 + 50;
|
|
133
|
+
setTimeout(typeWriter, speed);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
setTimeout(typeWriter, 400);
|
|
138
|
+
})();
|
|
139
|
+
<\/script>
|
|
140
|
+
</div>
|
|
141
|
+
<div id="root"></div>
|
|
142
|
+
<script type="module" src="src/main.ts"><\/script>
|
|
143
|
+
</body>
|
|
144
|
+
</html>
|
|
145
|
+
`, r = {
|
|
146
|
+
collapseBooleanAttributes: !0,
|
|
147
|
+
collapseInlineTagWhitespace: !0,
|
|
148
|
+
collapseWhitespace: !0,
|
|
149
|
+
conservativeCollapse: !1,
|
|
150
|
+
html5: !0,
|
|
151
|
+
keepClosingSlash: !0,
|
|
152
|
+
minifyCSS: !0,
|
|
153
|
+
minifyJS: !0,
|
|
154
|
+
minifyURLs: !0,
|
|
155
|
+
noNewlinesBeforeTagClose: !0,
|
|
156
|
+
quoteCharacter: '"',
|
|
157
|
+
removeAttributeQuotes: !1,
|
|
158
|
+
removeComments: !0,
|
|
159
|
+
removeEmptyAttributes: !0,
|
|
160
|
+
removeEmptyElements: !1,
|
|
161
|
+
removeOptionalTags: !1,
|
|
162
|
+
removeRedundantAttributes: !0,
|
|
163
|
+
removeScriptTypeAttributes: !1,
|
|
164
|
+
removeStyleLinkTypeAttributes: !1,
|
|
165
|
+
removeTagWhitespace: !1,
|
|
166
|
+
sortAttributes: !0,
|
|
167
|
+
sortClassName: !0,
|
|
168
|
+
trimCustomFragments: !0,
|
|
169
|
+
useShortDoctype: !0
|
|
170
|
+
};
|
|
171
|
+
function l(e) {
|
|
172
|
+
return e.type === "asset" && typeof e.source == "string" && e.fileName === t;
|
|
173
|
+
}
|
|
174
|
+
function d() {
|
|
175
|
+
return [{
|
|
176
|
+
name: "vef-framework:html",
|
|
177
|
+
resolveId(e) {
|
|
178
|
+
return e === t ? t : null;
|
|
179
|
+
},
|
|
180
|
+
load(e) {
|
|
181
|
+
return e === t ? a : null;
|
|
182
|
+
},
|
|
183
|
+
transformIndexHtml: {
|
|
184
|
+
order: "pre",
|
|
185
|
+
handler: () => a
|
|
186
|
+
}
|
|
187
|
+
}, {
|
|
188
|
+
name: "vef-framework:html-minify",
|
|
189
|
+
enforce: "post",
|
|
190
|
+
async generateBundle(e, n) {
|
|
191
|
+
for (const i of Object.values(n))
|
|
192
|
+
l(i) && (i.source = await o(i.source, r));
|
|
193
|
+
}
|
|
194
|
+
}];
|
|
195
|
+
}
|
|
196
|
+
export {
|
|
197
|
+
d as createHtmlPlugin
|
|
198
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { dirname as e, resolve as r } from "node:path";
|
|
2
|
+
import { fileURLToPath as l } from "node:url";
|
|
3
|
+
import t from "unplugin-icons/vite";
|
|
4
|
+
var a = e(l(import.meta.url));
|
|
5
|
+
function c(o) {
|
|
6
|
+
return t({
|
|
7
|
+
autoInstall: !1,
|
|
8
|
+
compiler: "jsx",
|
|
9
|
+
jsx: "react",
|
|
10
|
+
defaultClass: "inline-block",
|
|
11
|
+
scale: 1.2,
|
|
12
|
+
collectionsNodeResolvePath: [o, r(a, "..")]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
c as createIconsPlugin
|
|
17
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import i from "@rolldown/plugin-babel";
|
|
2
|
+
import n, { reactCompilerPreset as u } from "@vitejs/plugin-react";
|
|
3
|
+
import o from "jotai-babel/preset";
|
|
4
|
+
var a = ["@emotion", {
|
|
5
|
+
sourceMap: !0,
|
|
6
|
+
autoLabel: "never",
|
|
7
|
+
cssPropOptimization: !0
|
|
8
|
+
}];
|
|
9
|
+
function s(e, t) {
|
|
10
|
+
const r = [];
|
|
11
|
+
return e && r.push(a), t && r.push(...t), r;
|
|
12
|
+
}
|
|
13
|
+
function l(e) {
|
|
14
|
+
return e ? [o, u()] : [o];
|
|
15
|
+
}
|
|
16
|
+
function f({ useEmotion: e = !1, useCompiler: t = !0, babelPlugins: r } = {}) {
|
|
17
|
+
return [n({ jsxImportSource: e ? "@emotion/react" : void 0 }), i({
|
|
18
|
+
plugins: s(e, r),
|
|
19
|
+
presets: l(t)
|
|
20
|
+
})];
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
f as createReactPlugin
|
|
24
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { PAGES_DIR as o, ROUTER_DIR as n } from "./constants.js";
|
|
2
|
+
import { resolve as r } from "node:path";
|
|
3
|
+
import { tanstackRouter as u } from "@tanstack/router-plugin/vite";
|
|
4
|
+
var s = "components|hooks|helpers|store|states|types|styles";
|
|
5
|
+
function a() {
|
|
6
|
+
return [
|
|
7
|
+
"/* eslint-disable */",
|
|
8
|
+
"// @ts-nocheck",
|
|
9
|
+
"// noinspection JSUnusedGlobalSymbols",
|
|
10
|
+
'import { createRouter } from "@vef-framework-react/starter";',
|
|
11
|
+
'import { routerContext as context } from "./context";'
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
function i(e) {
|
|
15
|
+
return [
|
|
16
|
+
`const router = createRouter({
|
|
17
|
+
history: "${e}",
|
|
18
|
+
routeTree,
|
|
19
|
+
context
|
|
20
|
+
});
|
|
21
|
+
`,
|
|
22
|
+
`declare module "@tanstack/react-router" {
|
|
23
|
+
interface Register {
|
|
24
|
+
router: typeof router;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
"export default router;"
|
|
29
|
+
];
|
|
30
|
+
}
|
|
31
|
+
function R(e, t = "browser") {
|
|
32
|
+
return u({
|
|
33
|
+
routesDirectory: r(e, "src", o),
|
|
34
|
+
generatedRouteTree: r(e, "src", n, "router.gen.ts"),
|
|
35
|
+
quoteStyle: "double",
|
|
36
|
+
semicolons: !0,
|
|
37
|
+
disableTypes: !1,
|
|
38
|
+
addExtensions: !1,
|
|
39
|
+
disableLogging: !1,
|
|
40
|
+
routeFileIgnorePattern: s,
|
|
41
|
+
indexToken: "index",
|
|
42
|
+
routeToken: "route",
|
|
43
|
+
enableRouteGeneration: !0,
|
|
44
|
+
autoCodeSplitting: !0,
|
|
45
|
+
routeTreeFileHeader: a(),
|
|
46
|
+
routeTreeFileFooter: i(t)
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
R as createRouterPlugin
|
|
51
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import e from "vite-plugin-stylelint";
|
|
2
|
+
var r = ["src/**/*.{css,scss}"], t = [
|
|
3
|
+
"node_modules",
|
|
4
|
+
"virtual:",
|
|
5
|
+
"vef:"
|
|
6
|
+
];
|
|
7
|
+
function i() {
|
|
8
|
+
return e({
|
|
9
|
+
fix: !1,
|
|
10
|
+
test: !1,
|
|
11
|
+
dev: !0,
|
|
12
|
+
build: !1,
|
|
13
|
+
cache: !0,
|
|
14
|
+
cacheLocation: "node_modules/.cache/.stylelintcache",
|
|
15
|
+
include: r,
|
|
16
|
+
exclude: t,
|
|
17
|
+
emitError: !0,
|
|
18
|
+
emitWarning: !0,
|
|
19
|
+
emitWarningAsError: !0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
i as createStylelintPlugin
|
|
24
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import e from "vite-plugin-svgr";
|
|
2
|
+
function s() {
|
|
3
|
+
return e({
|
|
4
|
+
include: "**/*.svg?react",
|
|
5
|
+
esbuildOptions: {
|
|
6
|
+
platform: "browser",
|
|
7
|
+
minify: !0,
|
|
8
|
+
jsx: "automatic"
|
|
9
|
+
},
|
|
10
|
+
svgrOptions: {
|
|
11
|
+
plugins: ["@svgr/plugin-svgo", "@svgr/plugin-jsx"],
|
|
12
|
+
icon: !1,
|
|
13
|
+
dimensions: !1,
|
|
14
|
+
prettier: !0,
|
|
15
|
+
memo: !0,
|
|
16
|
+
svgo: !0,
|
|
17
|
+
ref: !1,
|
|
18
|
+
typescript: !0,
|
|
19
|
+
jsxRuntime: "automatic",
|
|
20
|
+
svgoConfig: {
|
|
21
|
+
multipass: !0,
|
|
22
|
+
datauri: "base64",
|
|
23
|
+
js2svg: {
|
|
24
|
+
indent: 2,
|
|
25
|
+
pretty: !0
|
|
26
|
+
},
|
|
27
|
+
plugins: [
|
|
28
|
+
"preset-default",
|
|
29
|
+
{
|
|
30
|
+
name: "prefixIds",
|
|
31
|
+
params: { prefix: "vef" }
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "cleanupIds",
|
|
35
|
+
params: {
|
|
36
|
+
force: !0,
|
|
37
|
+
remove: !0,
|
|
38
|
+
minify: !0
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
svgProps: {}
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
s as createSvgrPlugin
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Linter, Rule } from 'eslint';
|
|
2
|
+
export declare const localReactPlugin: {
|
|
3
|
+
rules: {
|
|
4
|
+
"jsx-no-duplicate-props": {
|
|
5
|
+
create(context: Rule.RuleContext): {
|
|
6
|
+
JSXOpeningElement(node: unknown): void;
|
|
7
|
+
};
|
|
8
|
+
meta: {
|
|
9
|
+
docs: {
|
|
10
|
+
description: string;
|
|
11
|
+
};
|
|
12
|
+
messages: {
|
|
13
|
+
noDuplicateProps: string;
|
|
14
|
+
};
|
|
15
|
+
schema: {
|
|
16
|
+
additionalProperties: false;
|
|
17
|
+
properties: {
|
|
18
|
+
ignoreCase: {
|
|
19
|
+
type: "boolean";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
type: "object";
|
|
23
|
+
}[];
|
|
24
|
+
type: "problem";
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const localReactRules: Linter.RulesRecord;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { UnionToTuple } from 'type-fest';
|
|
2
|
+
import { BuildEnvironmentOptions } from 'vite';
|
|
3
|
+
type ManualChunksOption = NonNullable<UnionToTuple<NonNullable<NonNullable<BuildEnvironmentOptions["rollupOptions"]>["output"]>>[0]["manualChunks"]>;
|
|
4
|
+
export declare function createChunksConfig(): ManualChunksOption;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PluginOption, ProxyOptions, UserConfig, UserConfigExport } from 'vite';
|
|
2
|
+
import { AutoEnhancePlugin } from './plugin-auto-enhance';
|
|
3
|
+
import { ReactPluginOptions } from './plugin-react';
|
|
4
|
+
export interface DefineConfigOptions {
|
|
5
|
+
resolve?: Pick<NonNullable<UserConfig["resolve"]>, "alias" | "conditions">;
|
|
6
|
+
plugins?: PluginOption[];
|
|
7
|
+
autoEnhancePlugins?: AutoEnhancePlugin[];
|
|
8
|
+
routerHistory?: "hash" | "browser";
|
|
9
|
+
react?: ReactPluginOptions;
|
|
10
|
+
proxies?: Record<string, string | ProxyOptions>;
|
|
11
|
+
}
|
|
12
|
+
export declare function defineViteConfig(options?: DefineConfigOptions): UserConfigExport;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const VEF_FRAMEWORK_VERSION = "1.0.0";
|
|
2
|
+
export declare const PUBLIC_DIR = "public";
|
|
3
|
+
export declare const ENV_DIR = "env";
|
|
4
|
+
export declare const ASSETS_DIR = "assets";
|
|
5
|
+
export declare const ENV_APP_PREFIX = "VEF_APP_";
|
|
6
|
+
export declare const ENV_BUILD_PREFIX = "VEF_BUILD_";
|
|
7
|
+
export declare const SRC_DIR = "src";
|
|
8
|
+
export declare const DEFAULT_OUTPUT_DIR = "dist";
|
|
9
|
+
export declare const DEFAULT_SERVER_PORT = 3833;
|
|
10
|
+
export declare const DEFAULT_APP_NAME = "APP";
|
|
11
|
+
export declare const PAGES_DIR = "pages";
|
|
12
|
+
export declare const ROUTER_DIR = "router";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PluginOption } from 'vite';
|
|
2
|
+
export interface PluginAppConfigOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The base public path
|
|
5
|
+
*/
|
|
6
|
+
basePublicPath?: string;
|
|
7
|
+
/**
|
|
8
|
+
* The output directory of the build
|
|
9
|
+
*/
|
|
10
|
+
outputDir?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The name of the app
|
|
13
|
+
*/
|
|
14
|
+
appName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create the app config plugin for runtime configuration injection
|
|
18
|
+
*/
|
|
19
|
+
export declare function createAppConfigPlugin({ basePublicPath, outputDir, appName }: PluginAppConfigOptions): PluginOption;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Except } from 'type-fest';
|
|
2
|
+
import { TransformResult } from 'vite';
|
|
3
|
+
import { AutoEnhanceOptions, AutoEnhancePlugin } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Auto-enhance core engine
|
|
6
|
+
*/
|
|
7
|
+
export declare class AutoEnhanceCore {
|
|
8
|
+
private plugins;
|
|
9
|
+
private options;
|
|
10
|
+
constructor(options?: Except<AutoEnhanceOptions, "plugins">);
|
|
11
|
+
registerPlugin(plugin: AutoEnhancePlugin): void;
|
|
12
|
+
registerPlugins(plugins: AutoEnhancePlugin[]): void;
|
|
13
|
+
getRegisteredPlugins(): Array<Pick<AutoEnhancePlugin, "name" | "description">>;
|
|
14
|
+
transform(code: string, id: string): TransformResult | null;
|
|
15
|
+
private shouldProcessFile;
|
|
16
|
+
private buildTransformInfo;
|
|
17
|
+
private executeTransform;
|
|
18
|
+
private getActivePlugins;
|
|
19
|
+
private runPlugins;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import { AutoEnhanceOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Create auto-enhance plugin for AST transformations.
|
|
5
|
+
* Supports registering multiple sub-plugins to handle different code enhancement needs.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createAutoEnhancePlugin({ plugins, ...options }?: AutoEnhanceOptions): Plugin;
|
|
8
|
+
export * from './plugins';
|
|
9
|
+
export type * from './types';
|
|
10
|
+
export { types } from 'recast';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { operationColumnWidthPlugin } from './operation-column-width';
|