@vef-framework/dev 2.0.3 → 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 +13 -0
- 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 -92
- package/dist/cjs/vite/chunks.cjs +1 -42
- 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 +18 -20
- package/dist/es/vite/chunks.js +13 -31
- 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 +43 -45
- 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/dist/types/cli/index.d.ts +1 -0
- package/package.json +20 -8
package/dist/cjs/lint/index.cjs
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./commitlint.cjs"),e=require("./eslint.cjs"),n=require("./stylelint.cjs");exports.defineCommitlintConfig=i.defineCommitlintConfig;exports.defineEslintConfig=e.defineEslintConfig;exports.defineStylelintConfig=n.defineStylelintConfig;
|
|
@@ -1,92 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("stylelint-config-recess-order/groups");function r(){return{extends:["stylelint-config-standard-scss","stylelint-config-recommended","@stylistic/stylelint-config"],plugins:["stylelint-order"],rules:{"order/order":["dollar-variables","at-variables","custom-properties","less-mixins","declarations","at-rules","rules"],"order/properties-order":n.map(e=>({...e,emptyLineBefore:"never",noEmptyLineBetween:!0})),"declaration-empty-line-before":"never","declaration-property-value-no-unknown":[!0,{ignoreProperties:{}}],"at-rule-no-unknown":[!0,{ignoreAtRules:["extend","include"]}],"function-no-unknown":[!0,{ignoreFunctions:[]}],"number-max-precision":null,"color-hex-length":"long","color-hex-alpha":"never","color-named":"never","unit-allowed-list":["px","em","rem","%","vw","vh","fr","deg","rad","grad","turn","ms","s"],"selector-pseudo-class-no-unknown":[!0,{ignorePseudoClasses:["global"]}],"scss/function-no-unknown":[!0,{ignoreFunctions:[]}],"scss/at-rule-no-unknown":[!0,{ignoreAtRules:[]}]}}}exports.defineStylelintConfig=r;
|
package/dist/cjs/vite/chunks.cjs
CHANGED
|
@@ -1,42 +1 @@
|
|
|
1
|
-
|
|
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/shared/")) {
|
|
8
|
-
return "vef-framework-shared";
|
|
9
|
-
}
|
|
10
|
-
if (id.includes("node_modules/@vef-framework/core/")) {
|
|
11
|
-
return "vef-framework-core";
|
|
12
|
-
}
|
|
13
|
-
if (id.includes("node_modules/@vef-framework/hooks/")) {
|
|
14
|
-
return "vef-framework-hooks";
|
|
15
|
-
}
|
|
16
|
-
if (id.includes("node_modules/@vef-framework/components/")) {
|
|
17
|
-
return "vef-framework-components";
|
|
18
|
-
}
|
|
19
|
-
if (id.includes("node_modules/@vef-framework/starter/")) {
|
|
20
|
-
return "vef-framework-starter";
|
|
21
|
-
}
|
|
22
|
-
if (id.includes("node_modules/lucide-react/")) {
|
|
23
|
-
return "lucide-icons";
|
|
24
|
-
}
|
|
25
|
-
if (id.includes("node_modules/react/") || id.includes("node_modules/react-dom/") || id.includes("node_modules/scheduler/")) {
|
|
26
|
-
return "react";
|
|
27
|
-
}
|
|
28
|
-
if (id.includes("node_modules/@tanstack/")) {
|
|
29
|
-
return "tanstack";
|
|
30
|
-
}
|
|
31
|
-
if (id.includes("node_modules/pinyin-pro/") || id.includes("node_modules/@pinyin-pro/")) {
|
|
32
|
-
return "pinyin-vendor";
|
|
33
|
-
}
|
|
34
|
-
if (id.includes("node_modules/echarts/")) {
|
|
35
|
-
return "echarts";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
function createChunksConfig() {
|
|
39
|
-
return getChunk;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
exports.createChunksConfig = createChunksConfig;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(e){if(e.includes("node_modules/@vef-framework/"))return"vef-framework";if(e.includes("node_modules/lucide-react/"))return"lucide-icons";if(e.includes("node_modules/react/")||e.includes("node_modules/react-dom/")||e.includes("node_modules/scheduler/"))return"react";if(e.includes("node_modules/@tanstack/"))return"tanstack";if(e.includes("node_modules/pinyin-pro/")||e.includes("node_modules/@pinyin-pro/"))return"pinyin-vendor";if(e.includes("node_modules/echarts/"))return"echarts"}function u(){return n}exports.createChunksConfig=u;
|
package/dist/cjs/vite/config.cjs
CHANGED
|
@@ -1,83 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("node:path"),P=require("node:process"),_=require("consola"),f=require("fs-extra"),r=require("vite"),o=require("./constants.cjs"),q=require("./plugin-app-config.cjs"),E=require("./plugin-auto-enhance/index.cjs"),I=require("./plugin-conventional-config.cjs"),d=require("./plugin-eslint.cjs"),v=require("./plugin-html.cjs"),V=require("./plugin-icons.cjs"),C=require("./plugin-injection.cjs"),A=require("./plugin-inspect.cjs"),D=require("./plugin-react.cjs"),U=require("./plugin-router.cjs"),b=require("./plugin-stylelint.cjs"),B=require("./plugin-svgr.cjs"),R=require("./plugin-tsconfig-paths.cjs"),T=require("./plugin-auto-enhance/plugins/operation-column-width.cjs");function h({resolve:i,plugins:t=[],autoEnhancePlugins:u=[],routerHistory:c="browser",react:s,proxies:l}={}){const n=P.cwd();return r.defineConfig(async({mode:a})=>{const e=r.loadEnv(a,o.ENV_DIR,o.ENV_BUILD_PREFIX);Object.keys(e).length>0&&(_.info("Loaded environment variables:"),console.table(e));const g=await m(n);return{resolve:i,plugins:[...t,A.createInspectPlugin(),I.createConventionalConfigPlugin({appName:e.VEF_APP_NAME,appVersion:g,projectDir:n,basePublicPath:e.VEF_BUILD_BASE_PUBLIC_PATH,outputDir:e.VEF_BUILD_OUTPUT_DIR,serverPort:Number(e.VEF_BUILD_SERVER_PORT),proxies:l}),E.createAutoEnhancePlugin({plugins:[T.operationColumnWidthPlugin,...u]}),U.createRouterPlugin(n,c),D.createReactPlugin(s),R.createTsconfigPathsPlugin(n),v.createHtmlPlugin(),C.createInjectionPlugin(),q.createAppConfigPlugin({basePublicPath:e.VEF_BUILD_BASE_PUBLIC_PATH,outputDir:e.VEF_BUILD_OUTPUT_DIR,appName:e.VEF_APP_NAME}),V.createIconsPlugin(n),B.createSvgrPlugin(),d.createEslintPlugin(),b.createStylelintPlugin()].filter(Boolean)}})}async function m(i){return(await f.readJson(p.resolve(i,"package.json"),{encoding:"utf-8"})).version}exports.defineViteConfig=h;
|
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _="1.0.0",E="public",R="env",I="assets",P="VEF_APP_",D="VEF_BUILD_",t="src",s="dist",A=3833,o="APP",T="pages",U="router";exports.ASSETS_DIR=I;exports.DEFAULT_APP_NAME=o;exports.DEFAULT_OUTPUT_DIR=s;exports.DEFAULT_SERVER_PORT=A;exports.ENV_APP_PREFIX=P;exports.ENV_BUILD_PREFIX=D;exports.ENV_DIR=R;exports.PAGES_DIR=T;exports.PUBLIC_DIR=E;exports.ROUTER_DIR=U;exports.SRC_DIR=t;exports.VEF_FRAMEWORK_VERSION=_;
|
package/dist/cjs/vite/define.cjs
CHANGED
|
@@ -1,26 +1,11 @@
|
|
|
1
|
-
|
|
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 ? `
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./constants.cjs");function c(_,t,n){return{__VEF_FRAMEWORK_VERSION__:`"${e.VEF_FRAMEWORK_VERSION}"`,__VEF_APP_VERSION__:`"${t}"`,__VEF_APP_CONFIG__:n?`
|
|
13
2
|
(function () {
|
|
14
3
|
const env = import.meta.env;
|
|
15
|
-
const config = Object.keys(env).filter(key => key.startsWith(${JSON.stringify(
|
|
4
|
+
const config = Object.keys(env).filter(key => key.startsWith(${JSON.stringify(e.ENV_APP_PREFIX)}))
|
|
16
5
|
.reduce((acc, key) => {
|
|
17
6
|
acc[key] = env[key];
|
|
18
7
|
return acc;
|
|
19
8
|
}, {});
|
|
20
9
|
return Object.freeze(config);
|
|
21
10
|
})()
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
exports.defineConstants = defineConstants;
|
|
11
|
+
`:`window.__PRODUCTION__VEF_${_??e.DEFAULT_APP_NAME}__CONF__`}}exports.defineConstants=c;
|
package/dist/cjs/vite/index.cjs
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./config.cjs");require("./plugin-auto-enhance/index.cjs");exports.defineViteConfig=e.defineViteConfig;
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("radashi"),o=require("unplugin-config/vite"),n=require("./constants.cjs");function a({basePublicPath:e,outputDir:t,appName:i=n.DEFAULT_APP_NAME}){return o({appName:`VEF_${p(i)}`,baseDir:e,configFile:{generate:!0,fileName:"app.config.js",outputDir:t??n.DEFAULT_OUTPUT_DIR},htmlInjection:{enable:!0,position:"head-prepend",templates:["index.html"]},envVariables:{prefix:n.ENV_APP_PREFIX,files:["env/.env","env/.env.production"]}})}function p(e){return r.snake(e).toUpperCase()}exports.createAppConfigPlugin=a;
|
|
@@ -1,147 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("node:path"),f=require("@babel/parser"),a=require("recast");function c(o,e){return(Array.isArray(o)?o:[o]).some(r=>typeof r=="string"?e.includes(r):r.test(e))}class h{plugins=[];options;constructor(e={}){this.options={include:[/\.tsx?(?:\?.*)?$/],exclude:[/node_modules/,/\.d\.ts?(?:\?.*)?$/],logPrefix:"🚀 VEF Auto-Enhance",...e}}registerPlugin(e){this.plugins.push(e)}registerPlugins(e){for(const s of e)this.registerPlugin(s)}shouldProcessFile(e){const{include:s,exclude:r}=this.options;return!(r&&c(r,e)||s&&!c(s,e))}createTransformationContext(e,s){const r=e.split("/").slice(-3).join("/"),i=a.parse(s,{sourceFileName:g.basename(e),parser:{parse:l=>f.parse(l,{plugins:["jsx","typescript","explicitResourceManagement"],sourceType:"module",tokens:!0})}});return{id:e,fileName:r,code:s,ast:i}}transform(e,s){if(!this.shouldProcessFile(s)||this.plugins.length===0)return null;try{const r=this.createTransformationContext(s,e),i=this.plugins.filter(t=>t.shouldProcess?t.shouldProcess(r):!0);if(i.length===0)return null;let l=!1;const u=[];for(const t of i)try{const n=t.transform(r);n.hasChanges&&(l=!0),n.logs&&u.push(...n.logs),n.hasChanges&&console.log(`${this.options.logPrefix}: Plugin "${t.name}" made changes to ${r.fileName}`)}catch(n){console.warn(`${this.options.logPrefix}: Plugin "${t.name}" failed:`,n)}for(const t of u)console.log(t);if(l){const t=a.print(r.ast);return{code:t.code,map:t.map||null}}return null}catch(r){return console.warn(`${this.options.logPrefix}: Error processing ${s}:`,r),null}}getRegisteredPlugins(){return this.plugins.map(e=>({name:e.name,description:e.description}))}}exports.AutoEnhanceCore=h;
|
|
@@ -1,40 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./core.cjs");require("./plugins/index.cjs");const i=require("recast");function u({plugins:t,...o}={}){const r=new c.AutoEnhanceCore(o);return t&&r.registerPlugins(t),{name:"vef-framework:auto-enhance",enforce:"pre",buildStart(){const e=r.getRegisteredPlugins();if(e.length>0){console.log(`🚀 Auto-Enhance: Loaded ${e.length} plugins:`);for(const n of e)console.log(` • ${n.name}${n.description?` - ${n.description}`:""}`)}},transform(e,n){return r.transform(e,n)}}}Object.defineProperty(exports,"types",{enumerable:!0,get:()=>i.types});exports.createAutoEnhancePlugin=u;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./operation-column-width.cjs");exports.operationColumnWidthPlugin=o.operationColumnWidthPlugin;
|