@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.
Files changed (58) hide show
  1. package/bin/vef.js +13 -0
  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 -92
  7. package/dist/cjs/vite/chunks.cjs +1 -42
  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 +18 -20
  35. package/dist/es/vite/chunks.js +13 -31
  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 +43 -45
  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/dist/types/cli/index.d.ts +1 -0
  58. package/package.json +20 -8
@@ -1,11 +1,10 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- import propertyGroups from 'stylelint-config-recess-order/groups';
3
-
4
- function defineStylelintConfig() {
1
+ import n from "stylelint-config-recess-order/groups";
2
+ function o() {
5
3
  return {
6
4
  extends: [
7
5
  "stylelint-config-standard-scss",
8
- "stylelint-config-recommended"
6
+ "stylelint-config-recommended",
7
+ "@stylistic/stylelint-config"
9
8
  ],
10
9
  plugins: ["stylelint-order"],
11
10
  rules: {
@@ -18,28 +17,26 @@ function defineStylelintConfig() {
18
17
  "at-rules",
19
18
  "rules"
20
19
  ],
21
- "order/properties-order": propertyGroups.map((group) => {
22
- return {
23
- ...group,
24
- emptyLineBefore: "never",
25
- noEmptyLineBetween: true
26
- };
27
- }),
20
+ "order/properties-order": n.map((e) => ({
21
+ ...e,
22
+ emptyLineBefore: "never",
23
+ noEmptyLineBetween: !0
24
+ })),
28
25
  "declaration-empty-line-before": "never",
29
26
  "declaration-property-value-no-unknown": [
30
- true,
27
+ !0,
31
28
  {
32
29
  ignoreProperties: {}
33
30
  }
34
31
  ],
35
32
  "at-rule-no-unknown": [
36
- true,
33
+ !0,
37
34
  {
38
35
  ignoreAtRules: ["extend", "include"]
39
36
  }
40
37
  ],
41
38
  "function-no-unknown": [
42
- true,
39
+ !0,
43
40
  {
44
41
  ignoreFunctions: []
45
42
  }
@@ -64,19 +61,19 @@ function defineStylelintConfig() {
64
61
  "s"
65
62
  ],
66
63
  "selector-pseudo-class-no-unknown": [
67
- true,
64
+ !0,
68
65
  {
69
66
  ignorePseudoClasses: ["global"]
70
67
  }
71
68
  ],
72
69
  "scss/function-no-unknown": [
73
- true,
70
+ !0,
74
71
  {
75
72
  ignoreFunctions: []
76
73
  }
77
74
  ],
78
75
  "scss/at-rule-no-unknown": [
79
- true,
76
+ !0,
80
77
  {
81
78
  ignoreAtRules: []
82
79
  }
@@ -84,5 +81,6 @@ function defineStylelintConfig() {
84
81
  }
85
82
  };
86
83
  }
87
-
88
- export { defineStylelintConfig };
84
+ export {
85
+ o as defineStylelintConfig
86
+ };
@@ -1,38 +1,20 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- function getChunk(id) {
3
- if (id.includes("node_modules/@vef-framework/shared/")) {
4
- return "vef-framework-shared";
5
- }
6
- if (id.includes("node_modules/@vef-framework/core/")) {
7
- return "vef-framework-core";
8
- }
9
- if (id.includes("node_modules/@vef-framework/hooks/")) {
10
- return "vef-framework-hooks";
11
- }
12
- if (id.includes("node_modules/@vef-framework/components/")) {
13
- return "vef-framework-components";
14
- }
15
- if (id.includes("node_modules/@vef-framework/starter/")) {
16
- return "vef-framework-starter";
17
- }
18
- if (id.includes("node_modules/lucide-react/")) {
1
+ function n(e) {
2
+ if (e.includes("node_modules/@vef-framework/"))
3
+ return "vef-framework";
4
+ if (e.includes("node_modules/lucide-react/"))
19
5
  return "lucide-icons";
20
- }
21
- if (id.includes("node_modules/react/") || id.includes("node_modules/react-dom/") || id.includes("node_modules/scheduler/")) {
6
+ if (e.includes("node_modules/react/") || e.includes("node_modules/react-dom/") || e.includes("node_modules/scheduler/"))
22
7
  return "react";
23
- }
24
- if (id.includes("node_modules/@tanstack/")) {
8
+ if (e.includes("node_modules/@tanstack/"))
25
9
  return "tanstack";
26
- }
27
- if (id.includes("node_modules/pinyin-pro/") || id.includes("node_modules/@pinyin-pro/")) {
10
+ if (e.includes("node_modules/pinyin-pro/") || e.includes("node_modules/@pinyin-pro/"))
28
11
  return "pinyin-vendor";
29
- }
30
- if (id.includes("node_modules/echarts/")) {
12
+ if (e.includes("node_modules/echarts/"))
31
13
  return "echarts";
32
- }
33
14
  }
34
- function createChunksConfig() {
35
- return getChunk;
15
+ function u() {
16
+ return n;
36
17
  }
37
-
38
- export { createChunksConfig };
18
+ export {
19
+ u as createChunksConfig
20
+ };
@@ -1,79 +1,74 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- import { resolve } from 'node:path';
3
- import process from 'node:process';
4
- import consola from 'consola';
5
- import fs from 'fs-extra';
6
- import { defineConfig, loadEnv } from 'vite';
7
- import { ENV_DIR, ENV_BUILD_PREFIX } from './constants.js';
8
- import { createAppConfigPlugin } from './plugin-app-config.js';
9
- import { createAutoEnhancePlugin } from './plugin-auto-enhance/index.js';
10
- import { createConventionalConfigPlugin } from './plugin-conventional-config.js';
11
- import { createEslintPlugin } from './plugin-eslint.js';
12
- import { createHtmlPlugin } from './plugin-html.js';
13
- import { createIconsPlugin } from './plugin-icons.js';
14
- import { createInjectionPlugin } from './plugin-injection.js';
15
- import { createInspectPlugin } from './plugin-inspect.js';
16
- import { createReactPlugin } from './plugin-react.js';
17
- import { createRouterPlugin } from './plugin-router.js';
18
- import { createStylelintPlugin } from './plugin-stylelint.js';
19
- import { createSvgrPlugin } from './plugin-svgr.js';
20
- import { createTsconfigPathsPlugin } from './plugin-tsconfig-paths.js';
21
- import { operationColumnWidthPlugin } from './plugin-auto-enhance/plugins/operation-column-width.js';
22
-
23
- function defineViteConfig({
24
- resolve: resolve2,
25
- plugins = [],
26
- autoEnhancePlugins = [],
27
- routerHistory = "browser",
28
- react,
29
- proxies
1
+ import { resolve as l } from "node:path";
2
+ import f from "node:process";
3
+ import s from "consola";
4
+ import u from "fs-extra";
5
+ import { defineConfig as P, loadEnv as g } from "vite";
6
+ import { ENV_DIR as _, ENV_BUILD_PREFIX as E } from "./constants.js";
7
+ import { createAppConfigPlugin as I } from "./plugin-app-config.js";
8
+ import { createAutoEnhancePlugin as V } from "./plugin-auto-enhance/index.js";
9
+ import { createConventionalConfigPlugin as D } from "./plugin-conventional-config.js";
10
+ import { createEslintPlugin as U } from "./plugin-eslint.js";
11
+ import { createHtmlPlugin as v } from "./plugin-html.js";
12
+ import { createIconsPlugin as A } from "./plugin-icons.js";
13
+ import { createInjectionPlugin as B } from "./plugin-injection.js";
14
+ import { createInspectPlugin as b } from "./plugin-inspect.js";
15
+ import { createReactPlugin as d } from "./plugin-react.js";
16
+ import { createRouterPlugin as L } from "./plugin-router.js";
17
+ import { createStylelintPlugin as R } from "./plugin-stylelint.js";
18
+ import { createSvgrPlugin as C } from "./plugin-svgr.js";
19
+ import { createTsconfigPathsPlugin as F } from "./plugin-tsconfig-paths.js";
20
+ import { operationColumnWidthPlugin as T } from "./plugin-auto-enhance/plugins/operation-column-width.js";
21
+ function $({
22
+ resolve: e,
23
+ plugins: t = [],
24
+ autoEnhancePlugins: i = [],
25
+ routerHistory: n = "browser",
26
+ react: a,
27
+ proxies: m
30
28
  } = {}) {
31
- const projectDir = process.cwd();
32
- return defineConfig(async ({ mode }) => {
33
- const env = loadEnv(mode, ENV_DIR, ENV_BUILD_PREFIX);
34
- if (Object.keys(env).length > 0) {
35
- consola.info("Loaded environment variables:");
36
- console.table(env);
37
- }
38
- const appVersion = await getAppVersion(projectDir);
29
+ const r = f.cwd();
30
+ return P(async ({ mode: p }) => {
31
+ const o = g(p, _, E);
32
+ Object.keys(o).length > 0 && (s.info("Loaded environment variables:"), console.table(o));
33
+ const c = await N(r);
39
34
  return {
40
- resolve: resolve2,
35
+ resolve: e,
41
36
  plugins: [
42
- ...plugins,
43
- createInspectPlugin(),
44
- createConventionalConfigPlugin({
45
- appName: env.VEF_APP_NAME,
46
- appVersion,
47
- projectDir,
48
- basePublicPath: env.VEF_BUILD_BASE_PUBLIC_PATH,
49
- outputDir: env.VEF_BUILD_OUTPUT_DIR,
50
- serverPort: Number(env.VEF_BUILD_SERVER_PORT),
51
- proxies
37
+ ...t,
38
+ b(),
39
+ D({
40
+ appName: o.VEF_APP_NAME,
41
+ appVersion: c,
42
+ projectDir: r,
43
+ basePublicPath: o.VEF_BUILD_BASE_PUBLIC_PATH,
44
+ outputDir: o.VEF_BUILD_OUTPUT_DIR,
45
+ serverPort: Number(o.VEF_BUILD_SERVER_PORT),
46
+ proxies: m
52
47
  }),
53
- createAutoEnhancePlugin({
54
- plugins: [operationColumnWidthPlugin, ...autoEnhancePlugins]
48
+ V({
49
+ plugins: [T, ...i]
55
50
  }),
56
- createRouterPlugin(projectDir, routerHistory),
57
- createReactPlugin(react),
58
- createTsconfigPathsPlugin(projectDir),
59
- createHtmlPlugin(),
60
- createInjectionPlugin(),
61
- createAppConfigPlugin({
62
- basePublicPath: env.VEF_BUILD_BASE_PUBLIC_PATH,
63
- outputDir: env.VEF_BUILD_OUTPUT_DIR,
64
- appName: env.VEF_APP_NAME
51
+ L(r, n),
52
+ d(a),
53
+ F(r),
54
+ v(),
55
+ B(),
56
+ I({
57
+ basePublicPath: o.VEF_BUILD_BASE_PUBLIC_PATH,
58
+ outputDir: o.VEF_BUILD_OUTPUT_DIR,
59
+ appName: o.VEF_APP_NAME
65
60
  }),
66
- createIconsPlugin(projectDir),
67
- createSvgrPlugin(),
68
- createEslintPlugin(),
69
- createStylelintPlugin()
61
+ A(r),
62
+ C(),
63
+ U(),
64
+ R()
70
65
  ].filter(Boolean)
71
66
  };
72
67
  });
73
68
  }
74
- async function getAppVersion(projectDir) {
75
- const packageJson = await fs.readJson(resolve(projectDir, "package.json"), { encoding: "utf-8" });
76
- return packageJson.version;
69
+ async function N(e) {
70
+ return (await u.readJson(l(e, "package.json"), { encoding: "utf-8" })).version;
77
71
  }
78
-
79
- export { defineViteConfig };
72
+ export {
73
+ $ as defineViteConfig
74
+ };
@@ -1,15 +1,15 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- const VEF_FRAMEWORK_VERSION = "1.0.0";
3
- const PUBLIC_DIR = "public";
4
- const ENV_DIR = "env";
5
- const ASSETS_DIR = "assets";
6
- const ENV_APP_PREFIX = "VEF_APP_";
7
- const ENV_BUILD_PREFIX = "VEF_BUILD_";
8
- const SRC_DIR = "src";
9
- const DEFAULT_OUTPUT_DIR = "dist";
10
- const DEFAULT_SERVER_PORT = 3833;
11
- const DEFAULT_APP_NAME = "APP";
12
- const PAGES_DIR = "pages";
13
- const ROUTER_DIR = "router";
14
-
15
- export { ASSETS_DIR, DEFAULT_APP_NAME, DEFAULT_OUTPUT_DIR, DEFAULT_SERVER_PORT, ENV_APP_PREFIX, ENV_BUILD_PREFIX, ENV_DIR, PAGES_DIR, PUBLIC_DIR, ROUTER_DIR, SRC_DIR, VEF_FRAMEWORK_VERSION };
1
+ const _ = "1.0.0", E = "public", s = "env", R = "assets", t = "VEF_APP_", c = "VEF_BUILD_", o = "src", P = "dist", n = 3833, I = "APP", D = "pages", A = "router";
2
+ export {
3
+ R as ASSETS_DIR,
4
+ I as DEFAULT_APP_NAME,
5
+ P as DEFAULT_OUTPUT_DIR,
6
+ n as DEFAULT_SERVER_PORT,
7
+ t as ENV_APP_PREFIX,
8
+ c as ENV_BUILD_PREFIX,
9
+ s as ENV_DIR,
10
+ D as PAGES_DIR,
11
+ E as PUBLIC_DIR,
12
+ A as ROUTER_DIR,
13
+ o as SRC_DIR,
14
+ _ as VEF_FRAMEWORK_VERSION
15
+ };
@@ -1,22 +1,21 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- import { DEFAULT_APP_NAME, VEF_FRAMEWORK_VERSION, ENV_APP_PREFIX } from './constants.js';
3
-
4
- function defineConstants(appName, appVersion, isDev) {
1
+ import { DEFAULT_APP_NAME as t, VEF_FRAMEWORK_VERSION as c, ENV_APP_PREFIX as r } from "./constants.js";
2
+ function i(_, e, n) {
5
3
  return {
6
- __VEF_FRAMEWORK_VERSION__: `"${VEF_FRAMEWORK_VERSION}"`,
7
- __VEF_APP_VERSION__: `"${appVersion}"`,
8
- __VEF_APP_CONFIG__: isDev ? `
4
+ __VEF_FRAMEWORK_VERSION__: `"${c}"`,
5
+ __VEF_APP_VERSION__: `"${e}"`,
6
+ __VEF_APP_CONFIG__: n ? `
9
7
  (function () {
10
8
  const env = import.meta.env;
11
- const config = Object.keys(env).filter(key => key.startsWith(${JSON.stringify(ENV_APP_PREFIX)}))
9
+ const config = Object.keys(env).filter(key => key.startsWith(${JSON.stringify(r)}))
12
10
  .reduce((acc, key) => {
13
11
  acc[key] = env[key];
14
12
  return acc;
15
13
  }, {});
16
14
  return Object.freeze(config);
17
15
  })()
18
- ` : `window.__PRODUCTION__VEF_${appName ?? DEFAULT_APP_NAME}__CONF__`
16
+ ` : `window.__PRODUCTION__VEF_${_ ?? t}__CONF__`
19
17
  };
20
18
  }
21
-
22
- export { defineConstants };
19
+ export {
20
+ i as defineConstants
21
+ };
@@ -1,3 +1,5 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- export { defineViteConfig } from './config.js';
3
- import './plugin-auto-enhance/index.js';
1
+ import { defineViteConfig as f } from "./config.js";
2
+ import "./plugin-auto-enhance/index.js";
3
+ export {
4
+ f as defineViteConfig
5
+ };
@@ -1,34 +1,33 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- import { snake } from 'radashi';
3
- import config from 'unplugin-config/vite';
4
- import { ENV_APP_PREFIX, DEFAULT_OUTPUT_DIR, DEFAULT_APP_NAME } from './constants.js';
5
-
6
- function createAppConfigPlugin({
7
- basePublicPath,
8
- outputDir,
9
- appName = DEFAULT_APP_NAME
1
+ import { snake as i } from "radashi";
2
+ import r from "unplugin-config/vite";
3
+ import { ENV_APP_PREFIX as o, DEFAULT_OUTPUT_DIR as p, DEFAULT_APP_NAME as a } from "./constants.js";
4
+ function c({
5
+ basePublicPath: e,
6
+ outputDir: n,
7
+ appName: t = a
10
8
  }) {
11
- return config({
12
- appName: `VEF_${constantCase(appName)}`,
13
- baseDir: basePublicPath,
9
+ return r({
10
+ appName: `VEF_${f(t)}`,
11
+ baseDir: e,
14
12
  configFile: {
15
- generate: true,
13
+ generate: !0,
16
14
  fileName: "app.config.js",
17
- outputDir: outputDir ?? DEFAULT_OUTPUT_DIR
15
+ outputDir: n ?? p
18
16
  },
19
17
  htmlInjection: {
20
- enable: true,
18
+ enable: !0,
21
19
  position: "head-prepend",
22
20
  templates: ["index.html"]
23
21
  },
24
22
  envVariables: {
25
- prefix: ENV_APP_PREFIX,
23
+ prefix: o,
26
24
  files: ["env/.env", "env/.env.production"]
27
25
  }
28
26
  });
29
27
  }
30
- function constantCase(value) {
31
- return snake(value).toUpperCase();
28
+ function f(e) {
29
+ return i(e).toUpperCase();
32
30
  }
33
-
34
- export { createAppConfigPlugin };
31
+ export {
32
+ c as createAppConfigPlugin
33
+ };
@@ -1,143 +1,104 @@
1
- /*! @vef-framework/dev v2.0.2 made with ❤️ by Venus | 2025-11-25T15:03:13.100Z */
2
- import { basename } from 'node:path';
3
- import { parse as parse$1 } from '@babel/parser';
4
- import { parse, print } from 'recast';
5
-
6
- function matchesPattern(patterns, target) {
7
- const patternArray = Array.isArray(patterns) ? patterns : [patterns];
8
- return patternArray.some((pattern) => {
9
- if (typeof pattern === "string") {
10
- return target.includes(pattern);
11
- }
12
- return pattern.test(target);
13
- });
1
+ import { basename as c } from "node:path";
2
+ import { parse as f } from "@babel/parser";
3
+ import { parse as g, print as p } from "recast";
4
+ function a(o, e) {
5
+ return (Array.isArray(o) ? o : [o]).some((r) => typeof r == "string" ? e.includes(r) : r.test(e));
14
6
  }
15
- class AutoEnhanceCore {
7
+ class d {
16
8
  plugins = [];
17
9
  options;
18
- constructor(options = {}) {
10
+ constructor(e = {}) {
19
11
  this.options = {
20
12
  include: [/\.tsx?(?:\?.*)?$/],
21
13
  exclude: [/node_modules/, /\.d\.ts?(?:\?.*)?$/],
22
14
  logPrefix: "🚀 VEF Auto-Enhance",
23
- ...options
15
+ ...e
24
16
  };
25
17
  }
26
18
  /**
27
19
  * Register a sub-plugin
28
20
  */
29
- registerPlugin(plugin) {
30
- this.plugins.push(plugin);
21
+ registerPlugin(e) {
22
+ this.plugins.push(e);
31
23
  }
32
24
  /**
33
25
  * Register multiple sub-plugins
34
26
  */
35
- registerPlugins(plugins) {
36
- for (const plugin of plugins) {
37
- this.registerPlugin(plugin);
38
- }
27
+ registerPlugins(e) {
28
+ for (const s of e)
29
+ this.registerPlugin(s);
39
30
  }
40
31
  /**
41
32
  * Check if file should be processed
42
33
  */
43
- shouldProcessFile(id) {
44
- const { include, exclude } = this.options;
45
- if (exclude && matchesPattern(exclude, id)) {
46
- return false;
47
- }
48
- if (include && !matchesPattern(include, id)) {
49
- return false;
50
- }
51
- return true;
34
+ shouldProcessFile(e) {
35
+ const { include: s, exclude: r } = this.options;
36
+ return !(r && a(r, e) || s && !a(s, e));
52
37
  }
53
38
  /**
54
39
  * Create processing context
55
40
  */
56
- createTransformationContext(id, code) {
57
- const fileName = id.split("/").slice(-3).join("/");
58
- const ast = parse(code, {
59
- sourceFileName: basename(id),
41
+ createTransformationContext(e, s) {
42
+ const r = e.split("/").slice(-3).join("/"), i = g(s, {
43
+ sourceFileName: c(e),
60
44
  parser: {
61
- parse: (code2) => parse$1(code2, {
45
+ parse: (l) => f(l, {
62
46
  plugins: ["jsx", "typescript", "explicitResourceManagement"],
63
47
  sourceType: "module",
64
- tokens: true
48
+ tokens: !0
65
49
  })
66
50
  }
67
51
  });
68
52
  return {
69
- id,
70
- fileName,
71
- code,
72
- ast
53
+ id: e,
54
+ fileName: r,
55
+ code: s,
56
+ ast: i
73
57
  };
74
58
  }
75
59
  /**
76
60
  * Execute transformation
77
61
  */
78
- transform(code, id) {
79
- if (!this.shouldProcessFile(id)) {
62
+ transform(e, s) {
63
+ if (!this.shouldProcessFile(s) || this.plugins.length === 0)
80
64
  return null;
81
- }
82
- if (this.plugins.length === 0) {
83
- return null;
84
- }
85
65
  try {
86
- const context = this.createTransformationContext(id, code);
87
- const activePlugins = this.plugins.filter((plugin) => {
88
- if (plugin.shouldProcess) {
89
- return plugin.shouldProcess(context);
90
- }
91
- return true;
92
- });
93
- if (activePlugins.length === 0) {
66
+ const r = this.createTransformationContext(s, e), i = this.plugins.filter((t) => t.shouldProcess ? t.shouldProcess(r) : !0);
67
+ if (i.length === 0)
94
68
  return null;
95
- }
96
- let hasAnyChanges = false;
97
- const allLogs = [];
98
- for (const plugin of activePlugins) {
69
+ let l = !1;
70
+ const u = [];
71
+ for (const t of i)
99
72
  try {
100
- const result = plugin.transform(context);
101
- if (result.hasChanges) {
102
- hasAnyChanges = true;
103
- }
104
- if (result.logs) {
105
- allLogs.push(...result.logs);
106
- }
107
- if (result.hasChanges) {
108
- console.log(`${this.options.logPrefix}: Plugin "${plugin.name}" made changes to ${context.fileName}`);
109
- }
110
- } catch (error) {
111
- console.warn(`${this.options.logPrefix}: Plugin "${plugin.name}" failed:`, error);
73
+ const n = t.transform(r);
74
+ 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}`);
75
+ } catch (n) {
76
+ console.warn(`${this.options.logPrefix}: Plugin "${t.name}" failed:`, n);
112
77
  }
113
- }
114
- for (const log of allLogs) {
115
- console.log(log);
116
- }
117
- if (hasAnyChanges) {
118
- const result = print(context.ast);
78
+ for (const t of u)
79
+ console.log(t);
80
+ if (l) {
81
+ const t = p(r.ast);
119
82
  return {
120
- code: result.code,
121
- map: result.map || null
83
+ code: t.code,
84
+ map: t.map || null
122
85
  };
123
86
  }
124
87
  return null;
125
- } catch (error) {
126
- console.warn(`${this.options.logPrefix}: Error processing ${id}:`, error);
127
- return null;
88
+ } catch (r) {
89
+ return console.warn(`${this.options.logPrefix}: Error processing ${s}:`, r), null;
128
90
  }
129
91
  }
130
92
  /**
131
93
  * Get registered plugin information
132
94
  */
133
95
  getRegisteredPlugins() {
134
- return this.plugins.map((plugin) => {
135
- return {
136
- name: plugin.name,
137
- description: plugin.description
138
- };
139
- });
96
+ return this.plugins.map((e) => ({
97
+ name: e.name,
98
+ description: e.description
99
+ }));
140
100
  }
141
101
  }
142
-
143
- export { AutoEnhanceCore };
102
+ export {
103
+ d as AutoEnhanceCore
104
+ };