@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.
Files changed (57) hide show
  1. package/bin/vef.js +1 -1
  2. package/dist/cjs/index.cjs +1 -23
  3. package/dist/cjs/lint/commitlint.cjs +1 -14
  4. package/dist/cjs/lint/eslint.cjs +1 -981
  5. package/dist/cjs/lint/index.cjs +1 -14
  6. package/dist/cjs/lint/stylelint.cjs +1 -93
  7. package/dist/cjs/vite/chunks.cjs +1 -30
  8. package/dist/cjs/vite/config.cjs +1 -83
  9. package/dist/cjs/vite/constants.cjs +1 -30
  10. package/dist/cjs/vite/define.cjs +3 -18
  11. package/dist/cjs/vite/index.cjs +1 -11
  12. package/dist/cjs/vite/plugin-app-config.cjs +1 -38
  13. package/dist/cjs/vite/plugin-auto-enhance/core.cjs +1 -147
  14. package/dist/cjs/vite/plugin-auto-enhance/index.cjs +1 -40
  15. package/dist/cjs/vite/plugin-auto-enhance/plugins/index.cjs +1 -10
  16. package/dist/cjs/vite/plugin-auto-enhance/plugins/operation-column-width.cjs +1 -229
  17. package/dist/cjs/vite/plugin-conventional-config.cjs +1 -91
  18. package/dist/cjs/vite/plugin-eslint.cjs +1 -24
  19. package/dist/cjs/vite/plugin-html.cjs +2 -74
  20. package/dist/cjs/vite/plugin-icons.cjs +1 -22
  21. package/dist/cjs/vite/plugin-injection.cjs +1 -20
  22. package/dist/cjs/vite/plugin-inspect.cjs +1 -15
  23. package/dist/cjs/vite/plugin-react.cjs +1 -80
  24. package/dist/cjs/vite/plugin-router.cjs +4 -42
  25. package/dist/cjs/vite/plugin-stylelint.cjs +1 -24
  26. package/dist/cjs/vite/plugin-svgr.cjs +1 -59
  27. package/dist/cjs/vite/plugin-tsconfig-paths.cjs +1 -14
  28. package/dist/cjs/vite/postcss.cjs +1 -13
  29. package/dist/cli/index.js +5 -0
  30. package/dist/es/index.js +14 -8
  31. package/dist/es/lint/commitlint.js +5 -6
  32. package/dist/es/lint/eslint.js +135 -137
  33. package/dist/es/lint/index.js +8 -4
  34. package/dist/es/lint/stylelint.js +16 -19
  35. package/dist/es/vite/chunks.js +12 -18
  36. package/dist/es/vite/config.js +63 -68
  37. package/dist/es/vite/constants.js +15 -15
  38. package/dist/es/vite/define.js +10 -11
  39. package/dist/es/vite/index.js +5 -3
  40. package/dist/es/vite/plugin-app-config.js +19 -20
  41. package/dist/es/vite/plugin-auto-enhance/core.js +51 -90
  42. package/dist/es/vite/plugin-auto-enhance/index.js +19 -23
  43. package/dist/es/vite/plugin-auto-enhance/plugins/index.js +4 -2
  44. package/dist/es/vite/plugin-auto-enhance/plugins/operation-column-width.js +117 -181
  45. package/dist/es/vite/plugin-conventional-config.js +42 -44
  46. package/dist/es/vite/plugin-eslint.js +14 -15
  47. package/dist/es/vite/plugin-html.js +42 -53
  48. package/dist/es/vite/plugin-icons.js +10 -11
  49. package/dist/es/vite/plugin-injection.js +4 -4
  50. package/dist/es/vite/plugin-inspect.js +8 -9
  51. package/dist/es/vite/plugin-react.js +25 -35
  52. package/dist/es/vite/plugin-router.js +20 -21
  53. package/dist/es/vite/plugin-stylelint.js +14 -15
  54. package/dist/es/vite/plugin-svgr.js +19 -20
  55. package/dist/es/vite/plugin-tsconfig-paths.js +7 -8
  56. package/dist/es/vite/postcss.js +5 -5
  57. package/package.json +9 -8
@@ -1,229 +1 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const recast = require('recast');
7
-
8
- const CJK_CHAR_REGEX = /[\u4E00-\u9FFF\u3400-\u4DBF\uFF00-\uFFEF]/;
9
- const OPERATION_COLUMN_ATTR = "operationColumn";
10
- const OPERATION_BUTTON_COMPONENT = "OperationButton";
11
- const VALID_IMPORT_SOURCES = [
12
- "@vef-framework/components",
13
- "@vef-framework/starter"
14
- ];
15
- function isValidImportSource(source) {
16
- return VALID_IMPORT_SOURCES.some((pkg) => source === pkg || source.startsWith(`${pkg}/`));
17
- }
18
- function collectOperationButtonAliases(ast) {
19
- const aliasMap = /* @__PURE__ */ new Map();
20
- recast.visit(ast, {
21
- visitImportDeclaration(path) {
22
- const source = path.node.source.value;
23
- if (typeof source !== "string" || !isValidImportSource(source)) {
24
- this.traverse(path);
25
- return false;
26
- }
27
- for (const specifier of path.node.specifiers || []) {
28
- if (recast.types.namedTypes.ImportSpecifier.check(specifier)) {
29
- const { imported } = specifier;
30
- const { local } = specifier;
31
- if (recast.types.namedTypes.Identifier.check(imported) && recast.types.namedTypes.Identifier.check(local) && imported.name === OPERATION_BUTTON_COMPONENT) {
32
- aliasMap.set(local.name, imported.name);
33
- }
34
- }
35
- }
36
- this.traverse(path);
37
- return false;
38
- }
39
- });
40
- return aliasMap;
41
- }
42
- function calculateTextWidth(text) {
43
- let width = 0;
44
- for (const char of text) {
45
- width += CJK_CHAR_REGEX.test(char) ? 14 : 8;
46
- }
47
- return width;
48
- }
49
- function calculateOperationColumnWidth(buttons) {
50
- if (buttons.length === 0) {
51
- return {
52
- calculatedWidth: 64,
53
- buttonCount: 0,
54
- analysis: "No buttons found, using minimum width"
55
- };
56
- }
57
- let totalWidth = 0;
58
- const buttonCount = buttons.length;
59
- for (const [index, button] of buttons.entries()) {
60
- let buttonWidth = 16;
61
- if (button.hasIcon) {
62
- buttonWidth += 16;
63
- if (button.textContent) {
64
- buttonWidth += 8;
65
- }
66
- }
67
- if (button.textContent) {
68
- buttonWidth += calculateTextWidth(button.textContent);
69
- }
70
- buttonWidth = Math.max(buttonWidth, button.hasIcon && !button.textContent ? 32 : 64);
71
- totalWidth += buttonWidth;
72
- if (index < buttonCount - 1) {
73
- totalWidth += 8;
74
- }
75
- }
76
- totalWidth += 16;
77
- const finalWidth = Math.ceil(totalWidth / 8) * 8;
78
- const analysis = `${buttonCount} buttons, calculated: ${totalWidth}px, final: ${finalWidth}px`;
79
- return {
80
- calculatedWidth: finalWidth,
81
- buttonCount,
82
- analysis
83
- };
84
- }
85
- function extractButtonInfo(jsxElement, aliasMap) {
86
- const { openingElement } = jsxElement;
87
- if (!recast.types.namedTypes.JSXIdentifier.check(openingElement.name)) {
88
- return null;
89
- }
90
- const componentName = openingElement.name.name;
91
- if (!aliasMap.has(componentName)) {
92
- return null;
93
- }
94
- const buttonInfo = {
95
- hasIcon: false,
96
- textContent: ""
97
- };
98
- for (const attr of openingElement.attributes || []) {
99
- if (recast.types.namedTypes.JSXAttribute.check(attr) && recast.types.namedTypes.JSXIdentifier.check(attr.name) && attr.name.name === "icon") {
100
- buttonInfo.hasIcon = true;
101
- }
102
- }
103
- for (const child of jsxElement.children || []) {
104
- if (recast.types.namedTypes.JSXText.check(child)) {
105
- buttonInfo.textContent += child.value.trim();
106
- } else if (recast.types.namedTypes.JSXExpressionContainer.check(child) && recast.types.namedTypes.StringLiteral.check(child.expression)) {
107
- buttonInfo.textContent += child.expression.value;
108
- }
109
- }
110
- return buttonInfo;
111
- }
112
- function findOperationButtons(node, aliasMap) {
113
- const buttons = [];
114
- recast.visit(node, {
115
- visitJSXElement(path) {
116
- const buttonInfo = extractButtonInfo(path.node, aliasMap);
117
- if (buttonInfo) {
118
- buttons.push(buttonInfo);
119
- }
120
- this.traverse(path);
121
- return false;
122
- }
123
- });
124
- return buttons;
125
- }
126
- function hasWidthProperty(objectExpression) {
127
- return objectExpression.properties.some((prop) => {
128
- if (recast.types.namedTypes.ObjectProperty.check(prop)) {
129
- const { key } = prop;
130
- return recast.types.namedTypes.Identifier.check(key) && key.name === "width" || recast.types.namedTypes.StringLiteral.check(key) && key.value === "width";
131
- }
132
- return false;
133
- });
134
- }
135
- function getRenderProperty(objectExpression) {
136
- return objectExpression.properties.find((prop) => {
137
- if (recast.types.namedTypes.ObjectProperty.check(prop) || recast.types.namedTypes.ObjectMethod.check(prop)) {
138
- const { key } = prop;
139
- return recast.types.namedTypes.Identifier.check(key) && key.name === "render" || recast.types.namedTypes.StringLiteral.check(key) && key.value === "render";
140
- }
141
- return false;
142
- });
143
- }
144
- function getComponentName(jsxElement) {
145
- const { openingElement } = jsxElement;
146
- if (recast.types.namedTypes.JSXIdentifier.check(openingElement.name)) {
147
- return openingElement.name.name;
148
- }
149
- if (recast.types.namedTypes.JSXMemberExpression.check(openingElement.name)) {
150
- const { object, property } = openingElement.name;
151
- const objectName = recast.types.namedTypes.JSXIdentifier.check(object) ? object.name : "?";
152
- const propertyName = recast.types.namedTypes.JSXIdentifier.check(property) ? property.name : "?";
153
- return `${objectName}.${propertyName}`;
154
- }
155
- return "Unknown";
156
- }
157
- const operationColumnWidthPlugin = {
158
- name: "operation-column-width",
159
- description: "Automatically calculate optimal width for operation columns based on button analysis",
160
- shouldProcess(context) {
161
- return context.code.includes(OPERATION_COLUMN_ATTR);
162
- },
163
- transform(context) {
164
- const aliasMap = collectOperationButtonAliases(context.ast);
165
- if (aliasMap.size === 0) {
166
- return { hasChanges: false, logs: [] };
167
- }
168
- let hasChanges = false;
169
- const logs = [];
170
- recast.visit(context.ast, {
171
- visitJSXAttribute(path) {
172
- const attr = path.node;
173
- if (!recast.types.namedTypes.JSXIdentifier.check(attr.name) || attr.name.name !== OPERATION_COLUMN_ATTR) {
174
- this.traverse(path);
175
- return false;
176
- }
177
- if (!recast.types.namedTypes.JSXExpressionContainer.check(attr.value) || !recast.types.namedTypes.ObjectExpression.check(attr.value.expression)) {
178
- this.traverse(path);
179
- return false;
180
- }
181
- const objectExpression = attr.value.expression;
182
- if (hasWidthProperty(objectExpression)) {
183
- this.traverse(path);
184
- return false;
185
- }
186
- const renderProperty = getRenderProperty(objectExpression);
187
- if (!renderProperty) {
188
- this.traverse(path);
189
- return false;
190
- }
191
- const buttons = recast.types.namedTypes.ObjectProperty.check(renderProperty) ? findOperationButtons(renderProperty.value, aliasMap) : findOperationButtons(renderProperty.body, aliasMap);
192
- if (buttons.length === 0) {
193
- this.traverse(path);
194
- return false;
195
- }
196
- const { calculatedWidth, analysis } = calculateOperationColumnWidth(buttons);
197
- const widthProperty = recast.types.builders.objectProperty(
198
- recast.types.builders.identifier("width"),
199
- recast.types.builders.numericLiteral(calculatedWidth)
200
- );
201
- widthProperty.comments = [recast.types.builders.commentLine(` Auto-calculated: ${analysis} `, true, false)];
202
- objectExpression.properties.unshift(widthProperty);
203
- hasChanges = true;
204
- let componentName = "Unknown";
205
- let { parentPath } = path;
206
- while (parentPath) {
207
- const { node, parentPath: nextParentPath } = parentPath;
208
- if (recast.types.namedTypes.JSXElement.check(node)) {
209
- componentName = getComponentName(node);
210
- break;
211
- }
212
- parentPath = nextParentPath;
213
- }
214
- logs.push(
215
- `📊 ${componentName}: ${context.fileName}`,
216
- ` └─ 🎯 Operation column auto-width: ${calculatedWidth}px (${analysis})`
217
- );
218
- this.traverse(path);
219
- return false;
220
- }
221
- });
222
- return {
223
- hasChanges,
224
- logs
225
- };
226
- }
227
- };
228
-
229
- exports.operationColumnWidthPlugin = operationColumnWidthPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("recast"),k=/[\u4E00-\u9FFF\u3400-\u4DBF\uFF00-\uFFEF]/,h="operationColumn",v="OperationButton",I=["@vef-framework/components","@vef-framework/starter"];function C(s){return I.some(e=>s===e||s.startsWith(`${e}/`))}function S(s){const e=new Map;return n.visit(s,{visitImportDeclaration(t){const o=t.node.source.value;if(typeof o!="string"||!C(o))return this.traverse(t),!1;for(const r of t.node.specifiers||[])if(n.types.namedTypes.ImportSpecifier.check(r)){const{imported:i}=r,{local:a}=r;n.types.namedTypes.Identifier.check(i)&&n.types.namedTypes.Identifier.check(a)&&i.name===v&&e.set(a.name,i.name)}return this.traverse(t),!1}}),e}function x(s){let e=0;for(const t of s)e+=k.test(t)?14:8;return e}function O(s){if(s.length===0)return{calculatedWidth:64,buttonCount:0,analysis:"No buttons found, using minimum width"};let e=0;const t=s.length;for(const[i,a]of s.entries()){let c=16;a.hasIcon&&(c+=16,a.textContent&&(c+=8)),a.textContent&&(c+=x(a.textContent)),c=Math.max(c,a.hasIcon&&!a.textContent?32:64),e+=c,i<t-1&&(e+=8)}e+=16;const o=Math.ceil(e/8)*8,r=`${t} buttons, calculated: ${e}px, final: ${o}px`;return{calculatedWidth:o,buttonCount:t,analysis:r}}function P(s,e){const{openingElement:t}=s;if(!n.types.namedTypes.JSXIdentifier.check(t.name))return null;const o=t.name.name;if(!e.has(o))return null;const r={hasIcon:!1,textContent:""};for(const i of t.attributes||[])n.types.namedTypes.JSXAttribute.check(i)&&n.types.namedTypes.JSXIdentifier.check(i.name)&&i.name.name==="icon"&&(r.hasIcon=!0);for(const i of s.children||[])n.types.namedTypes.JSXText.check(i)?r.textContent+=i.value.trim():n.types.namedTypes.JSXExpressionContainer.check(i)&&n.types.namedTypes.StringLiteral.check(i.expression)&&(r.textContent+=i.expression.value);return r}function T(s,e){const t=[];return n.visit(s,{visitJSXElement(o){const r=P(o.node,e);return r&&t.push(r),this.traverse(o),!1}}),t}function g(s){return s.properties.some(e=>{if(n.types.namedTypes.ObjectProperty.check(e)){const{key:t}=e;return n.types.namedTypes.Identifier.check(t)&&t.name==="width"||n.types.namedTypes.StringLiteral.check(t)&&t.value==="width"}return!1})}function E(s){return s.properties.find(e=>{if(n.types.namedTypes.ObjectProperty.check(e)||n.types.namedTypes.ObjectMethod.check(e)){const{key:t}=e;return n.types.namedTypes.Identifier.check(t)&&t.name==="render"||n.types.namedTypes.StringLiteral.check(t)&&t.value==="render"}return!1})}function w(s){const{openingElement:e}=s;if(n.types.namedTypes.JSXIdentifier.check(e.name))return e.name.name;if(n.types.namedTypes.JSXMemberExpression.check(e.name)){const{object:t,property:o}=e.name,r=n.types.namedTypes.JSXIdentifier.check(t)?t.name:"?",i=n.types.namedTypes.JSXIdentifier.check(o)?o.name:"?";return`${r}.${i}`}return"Unknown"}const J={name:"operation-column-width",description:"Automatically calculate optimal width for operation columns based on button analysis",shouldProcess(s){return s.code.includes(h)},transform(s){const e=S(s.ast);if(e.size===0)return{hasChanges:!1,logs:[]};let t=!1;const o=[];return n.visit(s.ast,{visitJSXAttribute(r){const i=r.node;if(!n.types.namedTypes.JSXIdentifier.check(i.name)||i.name.name!==h)return this.traverse(r),!1;if(!n.types.namedTypes.JSXExpressionContainer.check(i.value)||!n.types.namedTypes.ObjectExpression.check(i.value.expression))return this.traverse(r),!1;const a=i.value.expression;if(g(a))return this.traverse(r),!1;const c=E(a);if(!c)return this.traverse(r),!1;const l=n.types.namedTypes.ObjectProperty.check(c)?T(c.value,e):T(c.body,e);if(l.length===0)return this.traverse(r),!1;const{calculatedWidth:p,analysis:d}=O(l),f=n.types.builders.objectProperty(n.types.builders.identifier("width"),n.types.builders.numericLiteral(p));f.comments=[n.types.builders.commentLine(` Auto-calculated: ${d} `,!0,!1)],a.properties.unshift(f),t=!0;let m="Unknown",{parentPath:u}=r;for(;u;){const{node:y,parentPath:b}=u;if(n.types.namedTypes.JSXElement.check(y)){m=w(y);break}u=b}return o.push(`📊 ${m}: ${s.fileName}`,` └─ 🎯 Operation column auto-width: ${p}px (${d})`),this.traverse(r),!1}}),{hasChanges:t,logs:o}}};exports.operationColumnWidthPlugin=J;
@@ -1,91 +1 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const chunks = require('./chunks.cjs');
7
- const constants = require('./constants.cjs');
8
- const define = require('./define.cjs');
9
- const postcss = require('./postcss.cjs');
10
-
11
- function createConventionalConfigPlugin({
12
- appName,
13
- appVersion,
14
- basePublicPath,
15
- projectDir,
16
- outputDir,
17
- serverPort,
18
- proxies
19
- }) {
20
- return {
21
- name: "vef-framework:conventional-config",
22
- config(_, { command }) {
23
- const isDev = command === "serve";
24
- return {
25
- appType: "spa",
26
- root: projectDir,
27
- base: basePublicPath,
28
- publicDir: constants.PUBLIC_DIR,
29
- envDir: constants.ENV_DIR,
30
- envPrefix: [constants.ENV_BUILD_PREFIX, constants.ENV_APP_PREFIX],
31
- define: define.defineConstants(appName, appVersion, isDev),
32
- css: {
33
- transformer: "postcss",
34
- modules: {
35
- scopeBehaviour: "local",
36
- localsConvention: "camelCaseOnly",
37
- exportGlobals: true,
38
- hashPrefix: "vef"
39
- },
40
- postcss: postcss.createPostcssConfig(),
41
- preprocessorOptions: {
42
- scss: {}
43
- }
44
- },
45
- resolve: {
46
- dedupe: ["react", "react-dom"]
47
- },
48
- optimizeDeps: {
49
- exclude: [],
50
- esbuildOptions: {
51
- plugins: []
52
- }
53
- },
54
- build: {
55
- outDir: outputDir ?? constants.DEFAULT_OUTPUT_DIR,
56
- target: "es2024",
57
- assetsDir: constants.ASSETS_DIR,
58
- assetsInlineLimit: 10240,
59
- reportCompressedSize: false,
60
- chunkSizeWarningLimit: 5120,
61
- minify: true,
62
- cssCodeSplit: true,
63
- cssMinify: true,
64
- sourcemap: false,
65
- rollupOptions: {
66
- input: {
67
- main: "index.html"
68
- },
69
- output: {
70
- banner: `/*! Powered by VEF Framework v${constants.VEF_FRAMEWORK_VERSION}.${appVersion ? ` App version v${appVersion}.` : ""} Built at ${(/* @__PURE__ */ new Date()).toISOString()} */`,
71
- chunkFileNames: `${constants.ASSETS_DIR}/js/[name]-[hash].js`,
72
- entryFileNames: `${constants.ASSETS_DIR}/js/[name]-[hash].js`,
73
- assetFileNames: `${constants.ASSETS_DIR}/[ext]/[name]-[hash].[ext]`,
74
- manualChunks: chunks.createChunksConfig()
75
- }
76
- }
77
- },
78
- server: {
79
- port: serverPort || constants.DEFAULT_SERVER_PORT,
80
- strictPort: true,
81
- host: true,
82
- allowedHosts: true,
83
- open: true,
84
- proxy: proxies
85
- }
86
- };
87
- }
88
- };
89
- }
90
-
91
- exports.createConventionalConfigPlugin = createConventionalConfigPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./chunks.cjs"),e=require("./constants.cjs"),p=require("./define.cjs"),m=require("./postcss.cjs");function f({appName:t,appVersion:s,basePublicPath:n,projectDir:r,outputDir:o,serverPort:i,proxies:a}){return{name:"vef-framework:conventional-config",config(S,{command:u}){const c=u==="serve";return{appType:"spa",root:r,base:n,publicDir:e.PUBLIC_DIR,envDir:e.ENV_DIR,envPrefix:[e.ENV_BUILD_PREFIX,e.ENV_APP_PREFIX],define:p.defineConstants(t,s,c),css:{transformer:"postcss",modules:{scopeBehaviour:"local",localsConvention:"camelCaseOnly",exportGlobals:!0,hashPrefix:"vef"},postcss:m.createPostcssConfig(),preprocessorOptions:{scss:{}}},resolve:{dedupe:["react","react-dom"]},optimizeDeps:{exclude:[],esbuildOptions:{plugins:[]}},build:{outDir:o??e.DEFAULT_OUTPUT_DIR,target:"es2024",assetsDir:e.ASSETS_DIR,assetsInlineLimit:10240,reportCompressedSize:!1,chunkSizeWarningLimit:5120,minify:!0,cssCodeSplit:!0,cssMinify:!0,sourcemap:!1,rollupOptions:{input:{main:"index.html"},output:{banner:`/*! Powered by VEF Framework v${e.VEF_FRAMEWORK_VERSION}.${s?` App version v${s}.`:""} Built at ${new Date().toISOString()} */`,chunkFileNames:`${e.ASSETS_DIR}/js/[name]-[hash].js`,entryFileNames:`${e.ASSETS_DIR}/js/[name]-[hash].js`,assetFileNames:`${e.ASSETS_DIR}/[ext]/[name]-[hash].[ext]`,manualChunks:l.createChunksConfig()}}},server:{port:i||e.DEFAULT_SERVER_PORT,strictPort:!0,host:!0,allowedHosts:!0,open:!0,proxy:a}}}}}exports.createConventionalConfigPlugin=f;
@@ -1,24 +1 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const eslint = require('vite-plugin-eslint2');
7
-
8
- function createEslintPlugin() {
9
- return eslint({
10
- fix: false,
11
- test: false,
12
- dev: true,
13
- build: false,
14
- cache: true,
15
- cacheLocation: "node_modules/.cache/.eslintcache",
16
- include: ["*.{js,ts,json,yaml,md}", "src/**/*.{ts,tsx,json,yaml,md}"],
17
- exclude: ["node_modules", "virtual:", "vef:"],
18
- emitError: true,
19
- emitWarning: true,
20
- emitWarningAsError: true
21
- });
22
- }
23
-
24
- exports.createEslintPlugin = createEslintPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vite-plugin-eslint2");function t(){return e({fix:!1,test:!1,dev:!0,build:!1,cache:!0,cacheLocation:"node_modules/.cache/.eslintcache",include:["*.{js,ts,json,yaml,md}","src/**/*.{ts,tsx,json,yaml,md}"],exclude:["node_modules","virtual:","vef:"],emitError:!0,emitWarning:!0,emitWarningAsError:!0})}exports.createEslintPlugin=t;
@@ -1,12 +1,4 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const htmlMinifierTerser = require('html-minifier-terser');
7
-
8
- const virtualModuleId = "index.html";
9
- const htmlContent = `
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("html-minifier-terser"),i="index.html",a=`
10
2
  <!doctype html>
11
3
  <html lang="en">
12
4
  <head>
@@ -149,68 +141,4 @@ const htmlContent = `
149
141
  <script type="module" src="src/main.ts"><\/script>
150
142
  </body>
151
143
  </html>
152
- `;
153
- function createHtmlPlugin() {
154
- return [
155
- {
156
- name: "vef-framework:html",
157
- resolveId(source) {
158
- if (source === virtualModuleId) {
159
- return virtualModuleId;
160
- }
161
- return null;
162
- },
163
- load(id) {
164
- if (id === virtualModuleId) {
165
- return htmlContent;
166
- }
167
- return null;
168
- },
169
- transformIndexHtml: {
170
- order: "pre",
171
- handler: () => htmlContent
172
- }
173
- },
174
- {
175
- name: "vef-framework:html-minify",
176
- enforce: "post",
177
- async generateBundle(_, bundles) {
178
- for (const bundle of Object.values(bundles)) {
179
- if (bundle.type === "asset" && typeof bundle.source === "string" && bundle.fileName === virtualModuleId) {
180
- bundle.source = await htmlMinifierTerser.minify(
181
- bundle.source,
182
- {
183
- collapseBooleanAttributes: true,
184
- collapseInlineTagWhitespace: true,
185
- collapseWhitespace: true,
186
- conservativeCollapse: false,
187
- keepClosingSlash: true,
188
- minifyCSS: true,
189
- minifyJS: true,
190
- minifyURLs: true,
191
- noNewlinesBeforeTagClose: true,
192
- quoteCharacter: `"`,
193
- removeAttributeQuotes: false,
194
- removeComments: true,
195
- removeEmptyAttributes: true,
196
- removeOptionalTags: false,
197
- removeRedundantAttributes: true,
198
- removeScriptTypeAttributes: false,
199
- removeTagWhitespace: false,
200
- removeEmptyElements: false,
201
- removeStyleLinkTypeAttributes: false,
202
- sortAttributes: true,
203
- sortClassName: true,
204
- trimCustomFragments: true,
205
- useShortDoctype: true,
206
- html5: true
207
- }
208
- );
209
- }
210
- }
211
- }
212
- }
213
- ];
214
- }
215
-
216
- exports.createHtmlPlugin = createHtmlPlugin;
144
+ `;function o(){return[{name:"vef-framework:html",resolveId(t){return t===i?i:null},load(t){return t===i?a:null},transformIndexHtml:{order:"pre",handler:()=>a}},{name:"vef-framework:html-minify",enforce:"post",async generateBundle(t,n){for(const e of Object.values(n))e.type==="asset"&&typeof e.source=="string"&&e.fileName===i&&(e.source=await r.minify(e.source,{collapseBooleanAttributes:!0,collapseInlineTagWhitespace:!0,collapseWhitespace:!0,conservativeCollapse:!1,keepClosingSlash:!0,minifyCSS:!0,minifyJS:!0,minifyURLs:!0,noNewlinesBeforeTagClose:!0,quoteCharacter:'"',removeAttributeQuotes:!1,removeComments:!0,removeEmptyAttributes:!0,removeOptionalTags:!1,removeRedundantAttributes:!0,removeScriptTypeAttributes:!1,removeTagWhitespace:!1,removeEmptyElements:!1,removeStyleLinkTypeAttributes:!1,sortAttributes:!0,sortClassName:!0,trimCustomFragments:!0,useShortDoctype:!0,html5:!0}))}}]}exports.createHtmlPlugin=o;
@@ -1,22 +1 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const node_path = require('node:path');
7
- const node_url = require('node:url');
8
- const icons = require('unplugin-icons/vite');
9
-
10
- var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
11
- function createIconsPlugin(projectDir) {
12
- return icons({
13
- autoInstall: false,
14
- compiler: "jsx",
15
- jsx: "react",
16
- defaultClass: "inline-block",
17
- scale: 1.2,
18
- collectionsNodeResolvePath: [projectDir, node_path.resolve(node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('vite/plugin-icons.cjs', document.baseURI).href)))), "..")]
19
- });
20
- }
21
-
22
- exports.createIconsPlugin = createIconsPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("node:path"),o=require("node:url"),r=require("unplugin-icons/vite");var e=typeof document<"u"?document.currentScript:null;function c(t){return r({autoInstall:!1,compiler:"jsx",jsx:"react",defaultClass:"inline-block",scale:1.2,collectionsNodeResolvePath:[t,n.resolve(n.dirname(o.fileURLToPath(typeof document>"u"?require("url").pathToFileURL(__filename).href:e&&e.tagName.toUpperCase()==="SCRIPT"&&e.src||new URL("vite/plugin-icons.cjs",document.baseURI).href)),"..")]})}exports.createIconsPlugin=c;
@@ -1,20 +1 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- function createInjectionPlugin() {
7
- return {
8
- name: "vef-framework:injection"
9
- // transform(code, id) {
10
- // if (basename(dirname(id)) === "src" && basename(id).startsWith("main.ts")) {
11
- // return `import "@vef-react/components/styles.layer.css";
12
- // import "@vef-react/starter/styles.layer.css";
13
- // ${code}`;
14
- // }
15
- // return null;
16
- // }
17
- };
18
- }
19
-
20
- exports.createInjectionPlugin = createInjectionPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(){return{name:"vef-framework:injection"}}exports.createInjectionPlugin=e;
@@ -1,15 +1 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const inspect = require('vite-plugin-inspect');
7
-
8
- function createInspectPlugin() {
9
- return inspect({
10
- dev: true,
11
- build: false
12
- });
13
- }
14
-
15
- exports.createInspectPlugin = createInspectPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vite-plugin-inspect");function t(){return e({dev:!0,build:!1})}exports.createInspectPlugin=t;
@@ -1,80 +1 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const react = require('@vitejs/plugin-react');
7
- const chalk = require('chalk');
8
-
9
- function createReactPlugin({
10
- useEmotion = false,
11
- useCompiler = true,
12
- babelPlugins
13
- } = {}) {
14
- return react({
15
- babel: {
16
- plugins: [
17
- ...useEmotion ? [
18
- [
19
- "@emotion",
20
- {
21
- sourceMap: true,
22
- autoLabel: "never",
23
- cssPropOptimization: true
24
- }
25
- ]
26
- ] : [],
27
- ...useCompiler ? [
28
- [
29
- "react-compiler",
30
- {
31
- /**
32
- * `annotation`: Only compile functions that are explicitly marked with "use memo"
33
- * `infer`: Use smart heuristics to identify React components and hooks
34
- * Compilation conditions:
35
- * Functions explicitly marked with "use memo"
36
- * Functions named according to component or hook conventions (PascalCase or use prefix) that create JSX or call other hooks
37
- */
38
- compilationMode: "infer",
39
- panicThreshold: "none",
40
- target: "19",
41
- logger: {
42
- logEvent(filename, event) {
43
- switch (event.kind) {
44
- case "CompileSuccess": {
45
- break;
46
- }
47
- case "CompileError": {
48
- console.error(`${chalk.blueBright("[Compiler]")} ❌ ${chalk.redBright(`Skipped: ${filename}`)}`);
49
- console.error(chalk.red(`Reason: ${event.detail.reason}`));
50
- if (event.detail.description) {
51
- console.error(chalk.red(`Details: ${event.detail.description}`));
52
- }
53
- if (event.detail.loc) {
54
- const { line, column } = event.detail.loc.start;
55
- console.error(chalk.red(`Location: Line ${line}, Column ${column}`));
56
- }
57
- if (event.detail.suggestions) {
58
- console.error(chalk.yellow(`Suggestions: ${event.detail.suggestions.map((suggestion) => suggestion.description).join(" | ")}`));
59
- }
60
- break;
61
- }
62
- case "CompileSkip": {
63
- console.info(`${chalk.blueBright("[Compiler]")} ℹ️ ${chalk.gray(`Skipped: ${filename}`)}`, event);
64
- }
65
- }
66
- }
67
- }
68
- }
69
- ]
70
- ] : [],
71
- "jotai/babel/plugin-debug-label",
72
- "jotai/babel/plugin-react-refresh",
73
- ...babelPlugins ?? []
74
- ]
75
- },
76
- jsxImportSource: useEmotion ? "@emotion/react" : void 0
77
- });
78
- }
79
-
80
- exports.createReactPlugin = createReactPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@vitejs/plugin-react"),o=require("chalk");function n({useEmotion:i=!1,useCompiler:t=!0,babelPlugins:a}={}){return s({babel:{plugins:[...i?[["@emotion",{sourceMap:!0,autoLabel:"never",cssPropOptimization:!0}]]:[],...t?[["react-compiler",{compilationMode:"infer",panicThreshold:"none",target:"19",logger:{logEvent(l,e){switch(e.kind){case"CompileSuccess":break;case"CompileError":{if(console.error(`${o.blueBright("[Compiler]")} ${o.redBright(`Skipped: ${l}`)}`),console.error(o.red(`Reason: ${e.detail.reason}`)),e.detail.description&&console.error(o.red(`Details: ${e.detail.description}`)),e.detail.loc){const{line:r,column:c}=e.detail.loc.start;console.error(o.red(`Location: Line ${r}, Column ${c}`))}e.detail.suggestions&&console.error(o.yellow(`Suggestions: ${e.detail.suggestions.map(r=>r.description).join(" | ")}`));break}case"CompileSkip":console.info(`${o.blueBright("[Compiler]")} ℹ️ ${o.gray(`Skipped: ${l}`)}`,e)}}}}]]:[],"jotai/babel/plugin-debug-label","jotai/babel/plugin-react-refresh",...a??[]]},jsxImportSource:i?"@emotion/react":void 0})}exports.createReactPlugin=n;
@@ -1,49 +1,11 @@
1
- /*! @vef-framework/dev v2.0.3 made with ❤️ by Venus | 2025-11-26T02:32:33.686Z */
2
- 'use strict';
3
-
4
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
5
-
6
- const node_path = require('node:path');
7
- const vite = require('@tanstack/router-plugin/vite');
8
- const constants = require('./constants.cjs');
9
-
10
- function createRouterPlugin(projectDir, history = "browser") {
11
- return vite.tanstackRouter({
12
- routesDirectory: node_path.resolve(projectDir, constants.SRC_DIR, constants.PAGES_DIR),
13
- generatedRouteTree: node_path.resolve(projectDir, constants.SRC_DIR, constants.ROUTER_DIR, "router.gen.ts"),
14
- quoteStyle: "double",
15
- semicolons: true,
16
- disableTypes: false,
17
- addExtensions: false,
18
- disableLogging: false,
19
- routeFileIgnorePattern: "components|hooks|helpers|store|states|types|styles",
20
- indexToken: "index",
21
- routeToken: "route",
22
- enableRouteGeneration: true,
23
- autoCodeSplitting: true,
24
- routeTreeFileHeader: [
25
- "/* eslint-disable */",
26
- "// @ts-nocheck",
27
- "// noinspection JSUnusedGlobalSymbols",
28
- `import { createRouter } from "@vef-framework/starter";`,
29
- `import { routerContext as context } from "./context";`
30
- ],
31
- routeTreeFileFooter: [
32
- `const router = createRouter({
33
- history: "${history}",
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("node:path"),n=require("@tanstack/router-plugin/vite"),e=require("./constants.cjs");function s(t,o="browser"){return n.tanstackRouter({routesDirectory:r.resolve(t,e.SRC_DIR,e.PAGES_DIR),generatedRouteTree:r.resolve(t,e.SRC_DIR,e.ROUTER_DIR,"router.gen.ts"),quoteStyle:"double",semicolons:!0,disableTypes:!1,addExtensions:!1,disableLogging:!1,routeFileIgnorePattern:"components|hooks|helpers|store|states|types|styles",indexToken:"index",routeToken:"route",enableRouteGeneration:!0,autoCodeSplitting:!0,routeTreeFileHeader:["/* eslint-disable */","// @ts-nocheck","// noinspection JSUnusedGlobalSymbols",'import { createRouter } from "@vef-framework/starter";','import { routerContext as context } from "./context";'],routeTreeFileFooter:[`const router = createRouter({
2
+ history: "${o}",
34
3
  routeTree,
35
4
  context
36
5
  });
37
- `,
38
- `declare module "@tanstack/react-router" {
6
+ `,`declare module "@tanstack/react-router" {
39
7
  interface Register {
40
8
  router: typeof router;
41
9
  }
42
10
  }
43
- `,
44
- `export default router;`
45
- ]
46
- });
47
- }
48
-
49
- exports.createRouterPlugin = createRouterPlugin;
11
+ `,"export default router;"]})}exports.createRouterPlugin=s;