@vef-framework/dev 1.0.134 → 2.0.1
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/dist/cjs/index.cjs +23 -0
- package/dist/cjs/lint/commitlint.cjs +14 -0
- package/dist/cjs/lint/eslint.cjs +981 -0
- package/dist/cjs/lint/index.cjs +14 -0
- package/dist/cjs/lint/stylelint.cjs +92 -0
- package/dist/cjs/vite/chunks.cjs +30 -0
- package/dist/cjs/vite/config.cjs +83 -0
- package/dist/cjs/vite/constants.cjs +30 -0
- package/dist/cjs/vite/define.cjs +26 -0
- package/dist/cjs/vite/index.cjs +11 -0
- package/dist/cjs/vite/plugin-app-config.cjs +38 -0
- package/dist/cjs/vite/plugin-auto-enhance/core.cjs +147 -0
- package/dist/cjs/vite/plugin-auto-enhance/index.cjs +40 -0
- package/dist/cjs/vite/plugin-auto-enhance/plugins/index.cjs +10 -0
- package/dist/cjs/vite/plugin-auto-enhance/plugins/operation-column-width.cjs +229 -0
- package/dist/cjs/vite/plugin-conventional-config.cjs +91 -0
- package/dist/cjs/vite/plugin-eslint.cjs +24 -0
- package/dist/cjs/vite/plugin-html.cjs +216 -0
- package/dist/cjs/vite/plugin-icons.cjs +22 -0
- package/dist/cjs/vite/plugin-injection.cjs +20 -0
- package/dist/cjs/vite/plugin-inspect.cjs +15 -0
- package/dist/cjs/vite/plugin-react.cjs +80 -0
- package/dist/cjs/vite/plugin-router.cjs +49 -0
- package/dist/cjs/vite/plugin-stylelint.cjs +24 -0
- package/dist/cjs/vite/plugin-svgr.cjs +59 -0
- package/dist/cjs/vite/plugin-tsconfig-paths.cjs +14 -0
- package/dist/cjs/vite/postcss.cjs +13 -0
- package/dist/es/index.js +8 -0
- package/dist/es/lint/commitlint.js +10 -0
- package/dist/es/lint/eslint.js +958 -0
- package/dist/es/lint/index.js +4 -0
- package/dist/es/lint/stylelint.js +88 -0
- package/dist/es/vite/chunks.js +26 -0
- package/dist/es/vite/config.js +79 -0
- package/dist/es/vite/constants.js +15 -0
- package/dist/es/vite/define.js +22 -0
- package/dist/es/vite/index.js +3 -0
- package/dist/es/vite/plugin-app-config.js +34 -0
- package/dist/es/vite/plugin-auto-enhance/core.js +143 -0
- package/dist/es/vite/plugin-auto-enhance/index.js +32 -0
- package/dist/es/vite/plugin-auto-enhance/plugins/index.js +2 -0
- package/dist/es/vite/plugin-auto-enhance/plugins/operation-column-width.js +225 -0
- package/dist/es/vite/plugin-conventional-config.js +87 -0
- package/dist/es/vite/plugin-eslint.js +20 -0
- package/dist/es/vite/plugin-html.js +212 -0
- package/dist/es/vite/plugin-icons.js +17 -0
- package/dist/es/vite/plugin-injection.js +16 -0
- package/dist/es/vite/plugin-inspect.js +11 -0
- package/dist/es/vite/plugin-react.js +76 -0
- package/dist/es/vite/plugin-router.js +45 -0
- package/dist/es/vite/plugin-stylelint.js +20 -0
- package/dist/es/vite/plugin-svgr.js +55 -0
- package/dist/es/vite/plugin-tsconfig-paths.js +10 -0
- package/dist/es/vite/postcss.js +9 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lint/commitlint.d.ts +8 -0
- package/dist/types/lint/eslint.d.ts +2 -0
- package/dist/types/lint/index.d.ts +3 -0
- package/dist/types/lint/stylelint.d.ts +7 -0
- package/dist/types/vite/chunks.d.ts +10 -0
- package/dist/types/vite/config.d.ts +39 -0
- package/{types → dist/types/vite}/constants.d.ts +4 -0
- package/dist/types/vite/define.d.ts +12 -0
- package/dist/types/vite/index.d.ts +3 -0
- package/{types → dist/types/vite}/plugin-app-config.d.ts +2 -1
- package/dist/types/vite/plugin-auto-enhance/core.d.ts +35 -0
- package/dist/types/vite/plugin-auto-enhance/index.d.ts +30 -0
- package/dist/types/vite/plugin-auto-enhance/plugins/index.d.ts +1 -0
- package/dist/types/vite/plugin-auto-enhance/plugins/operation-column-width.d.ts +14 -0
- package/dist/types/vite/plugin-auto-enhance/types.d.ts +83 -0
- package/{types → dist/types/vite}/plugin-conventional-config.d.ts +2 -2
- package/dist/types/vite/plugin-eslint.d.ts +7 -0
- package/{types → dist/types/vite}/plugin-html.d.ts +1 -1
- package/dist/types/vite/plugin-icons.d.ts +8 -0
- package/{types → dist/types/vite}/plugin-injection.d.ts +1 -1
- package/{types → dist/types/vite}/plugin-inspect.d.ts +2 -1
- package/dist/types/vite/plugin-react.d.ts +25 -0
- package/{types → dist/types/vite}/plugin-router.d.ts +2 -2
- package/dist/types/vite/plugin-stylelint.d.ts +7 -0
- package/dist/types/vite/plugin-svgr.d.ts +7 -0
- package/{types → dist/types/vite}/plugin-tsconfig-paths.d.ts +2 -1
- package/dist/types/vite/postcss.d.ts +9 -0
- package/package.json +94 -74
- package/{tsconfig.app.json → tsconfig.base.json} +13 -9
- package/{client.d.ts → types.d.ts} +0 -6
- package/README.md +0 -25
- package/bin/hoist-patterns.js +0 -1
- package/bin/vef.js +0 -18
- package/cjs/cli.cjs +0 -5
- package/cjs/commitlint-config.cjs +0 -2
- package/cjs/config.cjs +0 -2
- package/cjs/constants.cjs +0 -2
- package/cjs/eslint-config.cjs +0 -2
- package/cjs/index.cjs +0 -2
- package/cjs/json/monaco.nls.json.cjs +0 -15920
- package/cjs/json/monaco.theme.github-light.json.cjs +0 -349
- package/cjs/modules.d.cjs +0 -2
- package/cjs/plugin-app-config.cjs +0 -2
- package/cjs/plugin-conventional-config.cjs +0 -12
- package/cjs/plugin-eslint.cjs +0 -2
- package/cjs/plugin-html.cjs +0 -17
- package/cjs/plugin-icons.cjs +0 -2
- package/cjs/plugin-initialization.cjs +0 -135
- package/cjs/plugin-injection.cjs +0 -3
- package/cjs/plugin-inspect.cjs +0 -2
- package/cjs/plugin-monaco-nls.cjs +0 -80
- package/cjs/plugin-react-swc.cjs +0 -2
- package/cjs/plugin-router.cjs +0 -11
- package/cjs/plugin-stylelint.cjs +0 -2
- package/cjs/plugin-svgr.cjs +0 -2
- package/cjs/plugin-tailwind.cjs +0 -2
- package/cjs/plugin-tailwindcss.cjs +0 -3
- package/cjs/plugin-tsconfig-paths.cjs +0 -2
- package/cjs/plugin-visualizer.cjs +0 -2
- package/cjs/plugin-webfont.cjs +0 -2
- package/cjs/stylelint-config.cjs +0 -2
- package/cjs/tailwind-config.cjs +0 -2
- package/cjs/types.cjs +0 -2
- package/esm/cli.js +0 -5
- package/esm/commitlint-config.js +0 -2
- package/esm/config.js +0 -2
- package/esm/constants.js +0 -2
- package/esm/eslint-config.js +0 -2
- package/esm/index.js +0 -2
- package/esm/json/monaco.nls.json.js +0 -15920
- package/esm/json/monaco.theme.github-light.json.js +0 -349
- package/esm/modules.d.js +0 -2
- package/esm/plugin-app-config.js +0 -2
- package/esm/plugin-conventional-config.js +0 -12
- package/esm/plugin-eslint.js +0 -2
- package/esm/plugin-html.js +0 -17
- package/esm/plugin-icons.js +0 -2
- package/esm/plugin-initialization.js +0 -135
- package/esm/plugin-injection.js +0 -3
- package/esm/plugin-inspect.js +0 -2
- package/esm/plugin-monaco-nls.js +0 -80
- package/esm/plugin-react-swc.js +0 -2
- package/esm/plugin-router.js +0 -11
- package/esm/plugin-stylelint.js +0 -2
- package/esm/plugin-svgr.js +0 -2
- package/esm/plugin-tailwind.js +0 -2
- package/esm/plugin-tailwindcss.js +0 -3
- package/esm/plugin-tsconfig-paths.js +0 -2
- package/esm/plugin-visualizer.js +0 -2
- package/esm/plugin-webfont.js +0 -2
- package/esm/stylelint-config.js +0 -2
- package/esm/tailwind-config.js +0 -2
- package/esm/types.js +0 -2
- package/template/.vscode/settings.json +0 -6
- package/template/_gitignore +0 -35
- package/template/_package.json +0 -43
- package/template/_tsconfig.json +0 -7
- package/template/commitlint.config.js +0 -3
- package/template/env/.env +0 -7
- package/template/env/.env.development +0 -0
- package/template/env/.env.production +0 -0
- package/template/env.d.ts +0 -1
- package/template/eslint.config.js +0 -3
- package/template/index.html +0 -0
- package/template/public/favicon.svg +0 -1
- package/template/src/main.ts +0 -145
- package/template/src/pages/__root.ts +0 -3
- package/template/src/pages/_common/access-denied.ts +0 -6
- package/template/src/pages/_common/login.ts +0 -8
- package/template/src/pages/_layout/index.tsx +0 -35
- package/template/src/pages/_layout/route.ts +0 -9
- package/template/src/pages/_layout/system/data-dictionary.tsx +0 -14
- package/template/src/pages/_layout/system/index.ts +0 -7
- package/template/src/pages/_layout/system/tenant.tsx +0 -14
- package/template/src/router/index.ts +0 -1
- package/template/style.css +0 -2
- package/template/stylelint.config.js +0 -3
- package/template/tailwind.config.js +0 -3
- package/template/tsconfig.app.json +0 -4
- package/template/tsconfig.build.json +0 -4
- package/template/vef.config.ts +0 -7
- package/tsconfig.build.json +0 -26
- package/types/cli.d.ts +0 -1
- package/types/commitlint-config.d.ts +0 -7
- package/types/config.d.ts +0 -38
- package/types/eslint-config.d.ts +0 -7
- package/types/index.d.ts +0 -5
- package/types/plugin-eslint.d.ts +0 -6
- package/types/plugin-icons.d.ts +0 -7
- package/types/plugin-initialization.d.ts +0 -7
- package/types/plugin-monaco-nls.d.ts +0 -15
- package/types/plugin-react-swc.d.ts +0 -6
- package/types/plugin-stylelint.d.ts +0 -6
- package/types/plugin-svgr.d.ts +0 -6
- package/types/plugin-tailwind.d.ts +0 -7
- package/types/plugin-tailwindcss.d.ts +0 -7
- package/types/plugin-visualizer.d.ts +0 -7
- package/types/plugin-webfont.d.ts +0 -6
- package/types/stylelint-config.d.ts +0 -7
- package/types/tailwind-config.d.ts +0 -7
- package/types/types.d.ts +0 -15
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const commitlint = require('./commitlint.cjs');
|
|
7
|
+
const eslint = require('./eslint.cjs');
|
|
8
|
+
const stylelint = require('./stylelint.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.defineCommitlintConfig = commitlint.defineCommitlintConfig;
|
|
13
|
+
exports.defineEslintConfig = eslint.defineEslintConfig;
|
|
14
|
+
exports.defineStylelintConfig = stylelint.defineStylelintConfig;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const propertyGroups = require('stylelint-config-recess-order/groups');
|
|
7
|
+
|
|
8
|
+
function defineStylelintConfig() {
|
|
9
|
+
return {
|
|
10
|
+
extends: [
|
|
11
|
+
"stylelint-config-standard-scss",
|
|
12
|
+
"stylelint-config-recommended"
|
|
13
|
+
],
|
|
14
|
+
plugins: ["stylelint-order"],
|
|
15
|
+
rules: {
|
|
16
|
+
"order/order": [
|
|
17
|
+
"dollar-variables",
|
|
18
|
+
"at-variables",
|
|
19
|
+
"custom-properties",
|
|
20
|
+
"less-mixins",
|
|
21
|
+
"declarations",
|
|
22
|
+
"at-rules",
|
|
23
|
+
"rules"
|
|
24
|
+
],
|
|
25
|
+
"order/properties-order": propertyGroups.map((group) => {
|
|
26
|
+
return {
|
|
27
|
+
...group,
|
|
28
|
+
emptyLineBefore: "never",
|
|
29
|
+
noEmptyLineBetween: true
|
|
30
|
+
};
|
|
31
|
+
}),
|
|
32
|
+
"declaration-empty-line-before": "never",
|
|
33
|
+
"declaration-property-value-no-unknown": [
|
|
34
|
+
true,
|
|
35
|
+
{
|
|
36
|
+
ignoreProperties: {}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"at-rule-no-unknown": [
|
|
40
|
+
true,
|
|
41
|
+
{
|
|
42
|
+
ignoreAtRules: ["extend", "include"]
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"function-no-unknown": [
|
|
46
|
+
true,
|
|
47
|
+
{
|
|
48
|
+
ignoreFunctions: []
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"number-max-precision": null,
|
|
52
|
+
"color-hex-length": "long",
|
|
53
|
+
"color-hex-alpha": "never",
|
|
54
|
+
"color-named": "never",
|
|
55
|
+
"unit-allowed-list": [
|
|
56
|
+
"px",
|
|
57
|
+
"em",
|
|
58
|
+
"rem",
|
|
59
|
+
"%",
|
|
60
|
+
"vw",
|
|
61
|
+
"vh",
|
|
62
|
+
"fr",
|
|
63
|
+
"deg",
|
|
64
|
+
"rad",
|
|
65
|
+
"grad",
|
|
66
|
+
"turn",
|
|
67
|
+
"ms",
|
|
68
|
+
"s"
|
|
69
|
+
],
|
|
70
|
+
"selector-pseudo-class-no-unknown": [
|
|
71
|
+
true,
|
|
72
|
+
{
|
|
73
|
+
ignorePseudoClasses: ["global"]
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"scss/function-no-unknown": [
|
|
77
|
+
true,
|
|
78
|
+
{
|
|
79
|
+
ignoreFunctions: []
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"scss/at-rule-no-unknown": [
|
|
83
|
+
true,
|
|
84
|
+
{
|
|
85
|
+
ignoreAtRules: []
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
exports.defineStylelintConfig = defineStylelintConfig;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
function getChunk(id) {
|
|
7
|
+
if (id.includes("node_modules/@vef-framework/")) {
|
|
8
|
+
return "vef-framework";
|
|
9
|
+
}
|
|
10
|
+
if (id.includes("node_modules/lucide-react")) {
|
|
11
|
+
return "lucide-icons";
|
|
12
|
+
}
|
|
13
|
+
if (id.includes("node_modules/react/") || id.includes("node_modules/react-dom/") || id.includes("node_modules/scheduler/")) {
|
|
14
|
+
return "react";
|
|
15
|
+
}
|
|
16
|
+
if (id.includes("node_modules/@tanstack/")) {
|
|
17
|
+
return "tanstack";
|
|
18
|
+
}
|
|
19
|
+
if (id.includes("node_modules/pinyin-pro/") || id.includes("node_modules/@pinyin-pro/")) {
|
|
20
|
+
return "pinyin-vendor";
|
|
21
|
+
}
|
|
22
|
+
if (id.includes("node_modules/echarts/")) {
|
|
23
|
+
return "echarts";
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
function createChunksConfig() {
|
|
27
|
+
return getChunk;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.createChunksConfig = createChunksConfig;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const node_path = require('node:path');
|
|
7
|
+
const process = require('node:process');
|
|
8
|
+
const consola = require('consola');
|
|
9
|
+
const fs = require('fs-extra');
|
|
10
|
+
const vite = require('vite');
|
|
11
|
+
const constants = require('./constants.cjs');
|
|
12
|
+
const pluginAppConfig = require('./plugin-app-config.cjs');
|
|
13
|
+
const index = require('./plugin-auto-enhance/index.cjs');
|
|
14
|
+
const pluginConventionalConfig = require('./plugin-conventional-config.cjs');
|
|
15
|
+
const pluginEslint = require('./plugin-eslint.cjs');
|
|
16
|
+
const pluginHtml = require('./plugin-html.cjs');
|
|
17
|
+
const pluginIcons = require('./plugin-icons.cjs');
|
|
18
|
+
const pluginInjection = require('./plugin-injection.cjs');
|
|
19
|
+
const pluginInspect = require('./plugin-inspect.cjs');
|
|
20
|
+
const pluginReact = require('./plugin-react.cjs');
|
|
21
|
+
const pluginRouter = require('./plugin-router.cjs');
|
|
22
|
+
const pluginStylelint = require('./plugin-stylelint.cjs');
|
|
23
|
+
const pluginSvgr = require('./plugin-svgr.cjs');
|
|
24
|
+
const pluginTsconfigPaths = require('./plugin-tsconfig-paths.cjs');
|
|
25
|
+
const operationColumnWidth = require('./plugin-auto-enhance/plugins/operation-column-width.cjs');
|
|
26
|
+
|
|
27
|
+
function defineViteConfig({
|
|
28
|
+
resolve: resolve2,
|
|
29
|
+
plugins = [],
|
|
30
|
+
autoEnhancePlugins = [],
|
|
31
|
+
routerHistory = "browser",
|
|
32
|
+
react,
|
|
33
|
+
proxies
|
|
34
|
+
} = {}) {
|
|
35
|
+
const projectDir = process.cwd();
|
|
36
|
+
return vite.defineConfig(async ({ mode }) => {
|
|
37
|
+
const env = vite.loadEnv(mode, constants.ENV_DIR, constants.ENV_BUILD_PREFIX);
|
|
38
|
+
if (Object.keys(env).length > 0) {
|
|
39
|
+
consola.info("Loaded environment variables:");
|
|
40
|
+
console.table(env);
|
|
41
|
+
}
|
|
42
|
+
const appVersion = await getAppVersion(projectDir);
|
|
43
|
+
return {
|
|
44
|
+
resolve: resolve2,
|
|
45
|
+
plugins: [
|
|
46
|
+
...plugins,
|
|
47
|
+
pluginInspect.createInspectPlugin(),
|
|
48
|
+
pluginConventionalConfig.createConventionalConfigPlugin({
|
|
49
|
+
appName: env.VEF_APP_NAME,
|
|
50
|
+
appVersion,
|
|
51
|
+
projectDir,
|
|
52
|
+
basePublicPath: env.VEF_BUILD_BASE_PUBLIC_PATH,
|
|
53
|
+
outputDir: env.VEF_BUILD_OUTPUT_DIR,
|
|
54
|
+
serverPort: Number(env.VEF_BUILD_SERVER_PORT),
|
|
55
|
+
proxies
|
|
56
|
+
}),
|
|
57
|
+
index.createAutoEnhancePlugin({
|
|
58
|
+
plugins: [operationColumnWidth.operationColumnWidthPlugin, ...autoEnhancePlugins]
|
|
59
|
+
}),
|
|
60
|
+
pluginRouter.createRouterPlugin(projectDir, routerHistory),
|
|
61
|
+
pluginReact.createReactPlugin(react),
|
|
62
|
+
pluginTsconfigPaths.createTsconfigPathsPlugin(projectDir),
|
|
63
|
+
pluginHtml.createHtmlPlugin(),
|
|
64
|
+
pluginInjection.createInjectionPlugin(),
|
|
65
|
+
pluginAppConfig.createAppConfigPlugin({
|
|
66
|
+
basePublicPath: env.VEF_BUILD_BASE_PUBLIC_PATH,
|
|
67
|
+
outputDir: env.VEF_BUILD_OUTPUT_DIR,
|
|
68
|
+
appName: env.VEF_APP_NAME
|
|
69
|
+
}),
|
|
70
|
+
pluginIcons.createIconsPlugin(projectDir),
|
|
71
|
+
pluginSvgr.createSvgrPlugin(),
|
|
72
|
+
pluginEslint.createEslintPlugin(),
|
|
73
|
+
pluginStylelint.createStylelintPlugin()
|
|
74
|
+
].filter(Boolean)
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async function getAppVersion(projectDir) {
|
|
79
|
+
const packageJson = await fs.readJson(node_path.resolve(projectDir, "package.json"), { encoding: "utf-8" });
|
|
80
|
+
return packageJson.version;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
exports.defineViteConfig = defineViteConfig;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const VEF_FRAMEWORK_VERSION = "1.0.0";
|
|
7
|
+
const PUBLIC_DIR = "public";
|
|
8
|
+
const ENV_DIR = "env";
|
|
9
|
+
const ASSETS_DIR = "assets";
|
|
10
|
+
const ENV_APP_PREFIX = "VEF_APP_";
|
|
11
|
+
const ENV_BUILD_PREFIX = "VEF_BUILD_";
|
|
12
|
+
const SRC_DIR = "src";
|
|
13
|
+
const DEFAULT_OUTPUT_DIR = "dist";
|
|
14
|
+
const DEFAULT_SERVER_PORT = 3833;
|
|
15
|
+
const DEFAULT_APP_NAME = "APP";
|
|
16
|
+
const PAGES_DIR = "pages";
|
|
17
|
+
const ROUTER_DIR = "router";
|
|
18
|
+
|
|
19
|
+
exports.ASSETS_DIR = ASSETS_DIR;
|
|
20
|
+
exports.DEFAULT_APP_NAME = DEFAULT_APP_NAME;
|
|
21
|
+
exports.DEFAULT_OUTPUT_DIR = DEFAULT_OUTPUT_DIR;
|
|
22
|
+
exports.DEFAULT_SERVER_PORT = DEFAULT_SERVER_PORT;
|
|
23
|
+
exports.ENV_APP_PREFIX = ENV_APP_PREFIX;
|
|
24
|
+
exports.ENV_BUILD_PREFIX = ENV_BUILD_PREFIX;
|
|
25
|
+
exports.ENV_DIR = ENV_DIR;
|
|
26
|
+
exports.PAGES_DIR = PAGES_DIR;
|
|
27
|
+
exports.PUBLIC_DIR = PUBLIC_DIR;
|
|
28
|
+
exports.ROUTER_DIR = ROUTER_DIR;
|
|
29
|
+
exports.SRC_DIR = SRC_DIR;
|
|
30
|
+
exports.VEF_FRAMEWORK_VERSION = VEF_FRAMEWORK_VERSION;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const constants = require('./constants.cjs');
|
|
7
|
+
|
|
8
|
+
function defineConstants(appName, appVersion, isDev) {
|
|
9
|
+
return {
|
|
10
|
+
__VEF_FRAMEWORK_VERSION__: `"${constants.VEF_FRAMEWORK_VERSION}"`,
|
|
11
|
+
__VEF_APP_VERSION__: `"${appVersion}"`,
|
|
12
|
+
__VEF_APP_CONFIG__: isDev ? `
|
|
13
|
+
(function () {
|
|
14
|
+
const env = import.meta.env;
|
|
15
|
+
const config = Object.keys(env).filter(key => key.startsWith(${JSON.stringify(constants.ENV_APP_PREFIX)}))
|
|
16
|
+
.reduce((acc, key) => {
|
|
17
|
+
acc[key] = env[key];
|
|
18
|
+
return acc;
|
|
19
|
+
}, {});
|
|
20
|
+
return Object.freeze(config);
|
|
21
|
+
})()
|
|
22
|
+
` : `window.__PRODUCTION__VEF_${appName ?? constants.DEFAULT_APP_NAME}__CONF__`
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
exports.defineConstants = defineConstants;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const config = require('./config.cjs');
|
|
7
|
+
require('./plugin-auto-enhance/index.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.defineViteConfig = config.defineViteConfig;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const radashi = require('radashi');
|
|
7
|
+
const config = require('unplugin-config/vite');
|
|
8
|
+
const constants = require('./constants.cjs');
|
|
9
|
+
|
|
10
|
+
function createAppConfigPlugin({
|
|
11
|
+
basePublicPath,
|
|
12
|
+
outputDir,
|
|
13
|
+
appName = constants.DEFAULT_APP_NAME
|
|
14
|
+
}) {
|
|
15
|
+
return config({
|
|
16
|
+
appName: `VEF_${constantCase(appName)}`,
|
|
17
|
+
baseDir: basePublicPath,
|
|
18
|
+
configFile: {
|
|
19
|
+
generate: true,
|
|
20
|
+
fileName: "app.config.js",
|
|
21
|
+
outputDir: outputDir ?? constants.DEFAULT_OUTPUT_DIR
|
|
22
|
+
},
|
|
23
|
+
htmlInjection: {
|
|
24
|
+
enable: true,
|
|
25
|
+
position: "head-prepend",
|
|
26
|
+
templates: ["index.html"]
|
|
27
|
+
},
|
|
28
|
+
envVariables: {
|
|
29
|
+
prefix: constants.ENV_APP_PREFIX,
|
|
30
|
+
files: ["env/.env", "env/.env.production"]
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function constantCase(value) {
|
|
35
|
+
return radashi.snake(value).toUpperCase();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
exports.createAppConfigPlugin = createAppConfigPlugin;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const node_path = require('node:path');
|
|
7
|
+
const parser = require('@babel/parser');
|
|
8
|
+
const recast = require('recast');
|
|
9
|
+
|
|
10
|
+
function matchesPattern(patterns, target) {
|
|
11
|
+
const patternArray = Array.isArray(patterns) ? patterns : [patterns];
|
|
12
|
+
return patternArray.some((pattern) => {
|
|
13
|
+
if (typeof pattern === "string") {
|
|
14
|
+
return target.includes(pattern);
|
|
15
|
+
}
|
|
16
|
+
return pattern.test(target);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
class AutoEnhanceCore {
|
|
20
|
+
plugins = [];
|
|
21
|
+
options;
|
|
22
|
+
constructor(options = {}) {
|
|
23
|
+
this.options = {
|
|
24
|
+
include: [/\.tsx?(?:\?.*)?$/],
|
|
25
|
+
exclude: [/node_modules/, /\.d\.ts?(?:\?.*)?$/],
|
|
26
|
+
logPrefix: "🚀 VEF Auto-Enhance",
|
|
27
|
+
...options
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Register a sub-plugin
|
|
32
|
+
*/
|
|
33
|
+
registerPlugin(plugin) {
|
|
34
|
+
this.plugins.push(plugin);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Register multiple sub-plugins
|
|
38
|
+
*/
|
|
39
|
+
registerPlugins(plugins) {
|
|
40
|
+
for (const plugin of plugins) {
|
|
41
|
+
this.registerPlugin(plugin);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check if file should be processed
|
|
46
|
+
*/
|
|
47
|
+
shouldProcessFile(id) {
|
|
48
|
+
const { include, exclude } = this.options;
|
|
49
|
+
if (exclude && matchesPattern(exclude, id)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
if (include && !matchesPattern(include, id)) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create processing context
|
|
59
|
+
*/
|
|
60
|
+
createTransformationContext(id, code) {
|
|
61
|
+
const fileName = id.split("/").slice(-3).join("/");
|
|
62
|
+
const ast = recast.parse(code, {
|
|
63
|
+
sourceFileName: node_path.basename(id),
|
|
64
|
+
parser: {
|
|
65
|
+
parse: (code2) => parser.parse(code2, {
|
|
66
|
+
plugins: ["jsx", "typescript", "explicitResourceManagement"],
|
|
67
|
+
sourceType: "module",
|
|
68
|
+
tokens: true
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return {
|
|
73
|
+
id,
|
|
74
|
+
fileName,
|
|
75
|
+
code,
|
|
76
|
+
ast
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Execute transformation
|
|
81
|
+
*/
|
|
82
|
+
transform(code, id) {
|
|
83
|
+
if (!this.shouldProcessFile(id)) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
if (this.plugins.length === 0) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
const context = this.createTransformationContext(id, code);
|
|
91
|
+
const activePlugins = this.plugins.filter((plugin) => {
|
|
92
|
+
if (plugin.shouldProcess) {
|
|
93
|
+
return plugin.shouldProcess(context);
|
|
94
|
+
}
|
|
95
|
+
return true;
|
|
96
|
+
});
|
|
97
|
+
if (activePlugins.length === 0) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
let hasAnyChanges = false;
|
|
101
|
+
const allLogs = [];
|
|
102
|
+
for (const plugin of activePlugins) {
|
|
103
|
+
try {
|
|
104
|
+
const result = plugin.transform(context);
|
|
105
|
+
if (result.hasChanges) {
|
|
106
|
+
hasAnyChanges = true;
|
|
107
|
+
}
|
|
108
|
+
if (result.logs) {
|
|
109
|
+
allLogs.push(...result.logs);
|
|
110
|
+
}
|
|
111
|
+
if (result.hasChanges) {
|
|
112
|
+
console.log(`${this.options.logPrefix}: Plugin "${plugin.name}" made changes to ${context.fileName}`);
|
|
113
|
+
}
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.warn(`${this.options.logPrefix}: Plugin "${plugin.name}" failed:`, error);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (const log of allLogs) {
|
|
119
|
+
console.log(log);
|
|
120
|
+
}
|
|
121
|
+
if (hasAnyChanges) {
|
|
122
|
+
const result = recast.print(context.ast);
|
|
123
|
+
return {
|
|
124
|
+
code: result.code,
|
|
125
|
+
map: result.map || null
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
return null;
|
|
129
|
+
} catch (error) {
|
|
130
|
+
console.warn(`${this.options.logPrefix}: Error processing ${id}:`, error);
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Get registered plugin information
|
|
136
|
+
*/
|
|
137
|
+
getRegisteredPlugins() {
|
|
138
|
+
return this.plugins.map((plugin) => {
|
|
139
|
+
return {
|
|
140
|
+
name: plugin.name,
|
|
141
|
+
description: plugin.description
|
|
142
|
+
};
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
exports.AutoEnhanceCore = AutoEnhanceCore;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const core = require('./core.cjs');
|
|
7
|
+
require('./plugins/index.cjs');
|
|
8
|
+
const recast = require('recast');
|
|
9
|
+
|
|
10
|
+
function createAutoEnhancePlugin({
|
|
11
|
+
plugins,
|
|
12
|
+
...options
|
|
13
|
+
} = {}) {
|
|
14
|
+
const core$1 = new core.AutoEnhanceCore(options);
|
|
15
|
+
if (plugins) {
|
|
16
|
+
core$1.registerPlugins(plugins);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
name: "vef-framework:auto-enhance",
|
|
20
|
+
enforce: "pre",
|
|
21
|
+
buildStart() {
|
|
22
|
+
const plugins2 = core$1.getRegisteredPlugins();
|
|
23
|
+
if (plugins2.length > 0) {
|
|
24
|
+
console.log(`🚀 Auto-Enhance: Loaded ${plugins2.length} plugins:`);
|
|
25
|
+
for (const plugin of plugins2) {
|
|
26
|
+
console.log(` • ${plugin.name}${plugin.description ? ` - ${plugin.description}` : ""}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
transform(code, id) {
|
|
31
|
+
return core$1.transform(code, id);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
Object.defineProperty(exports, "types", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: () => recast.types
|
|
39
|
+
});
|
|
40
|
+
exports.createAutoEnhancePlugin = createAutoEnhancePlugin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/*! @vef-framework/dev v2.0.0 made with ❤️ by Venus | 2025-11-25T10:06:28.561Z */
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
+
|
|
6
|
+
const operationColumnWidth = require('./operation-column-width.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.operationColumnWidthPlugin = operationColumnWidth.operationColumnWidthPlugin;
|