@vef-framework/dev 1.0.100 → 1.0.101

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 (53) hide show
  1. package/es/cli.js +225 -2
  2. package/es/commitlint-config.js +11 -2
  3. package/es/config.js +77 -2
  4. package/es/constants.js +14 -2
  5. package/es/eslint-config.js +410 -2
  6. package/es/index.js +6 -2
  7. package/es/modules.d.js +2 -1
  8. package/es/plugin-app-config.js +34 -2
  9. package/es/plugin-conventional-config.js +95 -2
  10. package/es/plugin-eslint.js +20 -2
  11. package/es/plugin-html.js +82 -2
  12. package/es/plugin-icons.js +17 -2
  13. package/es/plugin-injection.js +17 -2
  14. package/es/plugin-inspect.js +11 -2
  15. package/es/plugin-react-swc.js +10 -2
  16. package/es/plugin-router.js +44 -2
  17. package/es/plugin-stylelint.js +20 -2
  18. package/es/plugin-svgr.js +55 -2
  19. package/es/plugin-tailwind.js +8 -2
  20. package/es/plugin-tailwindcss.js +21 -2
  21. package/es/plugin-tsconfig-paths.js +10 -2
  22. package/es/plugin-visualizer.js +12 -2
  23. package/es/plugin-webfont.js +11 -2
  24. package/es/stylelint-config.js +64 -2
  25. package/es/tailwind-config.js +392 -2
  26. package/lib/cli.cjs +227 -2
  27. package/lib/commitlint-config.cjs +15 -2
  28. package/lib/config.cjs +81 -2
  29. package/lib/constants.cjs +28 -2
  30. package/lib/eslint-config.cjs +414 -2
  31. package/lib/index.cjs +18 -2
  32. package/lib/modules.d.cjs +4 -2
  33. package/lib/plugin-app-config.cjs +38 -2
  34. package/lib/plugin-conventional-config.cjs +99 -2
  35. package/lib/plugin-eslint.cjs +24 -2
  36. package/lib/plugin-html.cjs +86 -2
  37. package/lib/plugin-icons.cjs +22 -2
  38. package/lib/plugin-injection.cjs +21 -2
  39. package/lib/plugin-inspect.cjs +15 -2
  40. package/lib/plugin-react-swc.cjs +14 -2
  41. package/lib/plugin-router.cjs +48 -2
  42. package/lib/plugin-stylelint.cjs +24 -2
  43. package/lib/plugin-svgr.cjs +59 -2
  44. package/lib/plugin-tailwind.cjs +12 -2
  45. package/lib/plugin-tailwindcss.cjs +25 -2
  46. package/lib/plugin-tsconfig-paths.cjs +14 -2
  47. package/lib/plugin-visualizer.cjs +16 -2
  48. package/lib/plugin-webfont.cjs +15 -2
  49. package/lib/stylelint-config.cjs +68 -2
  50. package/lib/tailwind-config.cjs +396 -2
  51. package/lib/types.cjs +4 -2
  52. package/package.json +1 -1
  53. package/template/_package.json +5 -5
@@ -1,3 +1,393 @@
1
- /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.492Z, made by Venus. */
2
- import e from"@tailwindcss/container-queries";import r from"tailwindcss/colors";function defineTailwindConfig(){return{content:["./src/**/*.{ts,tsx}"],plugins:[e],theme:{colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"var(--vef-color-white)",primary:"var(--vef-color-primary)","primary-hover":"var(--vef-color-primary-hover)","primary-active":"var(--vef-color-primary-active)",success:"var(--vef-color-success)","success-hover":"var(--vef-color-success-hover)","success-active":"var(--vef-color-success-active)",warning:"var(--vef-color-warning)","warning-hover":"var(--vef-color-warning-hover)","warning-active":"var(--vef-color-warning-active)",error:"var(--vef-color-error)","error-hover":"var(--vef-color-error-hover)","error-active":"var(--vef-color-error-active)",info:"var(--vef-color-info)","info-hover":"var(--vef-color-info-hover)","info-active":"var(--vef-color-info-active)",link:"var(--vef-color-link)","link-hover":"var(--vef-color-link-hover)","link-active":"var(--vef-color-link-active)",blue:{DEFAULT:"var(--vef-blue-6)",1:"var(--vef-blue-1)",2:"var(--vef-blue-2)",3:"var(--vef-blue-3)",4:"var(--vef-blue-4)",5:"var(--vef-blue-5)",6:"var(--vef-blue-6)",7:"var(--vef-blue-7)",8:"var(--vef-blue-8)",9:"var(--vef-blue-9)",10:"var(--vef-blue-10)"},purple:{DEFAULT:"var(--vef-purple-6)",1:"var(--vef-purple-1)",2:"var(--vef-purple-2)",3:"var(--vef-purple-3)",4:"var(--vef-purple-4)",5:"var(--vef-purple-5)",6:"var(--vef-purple-6)",7:"var(--vef-purple-7)",8:"var(--vef-purple-8)",9:"var(--vef-purple-9)",10:"var(--vef-purple-10)"},cyan:{DEFAULT:"var(--vef-cyan-6)",1:"var(--vef-cyan-1)",2:"var(--vef-cyan-2)",3:"var(--vef-cyan-3)",4:"var(--vef-cyan-4)",5:"var(--vef-cyan-5)",6:"var(--vef-cyan-6)",7:"var(--vef-cyan-7)",8:"var(--vef-cyan-8)",9:"var(--vef-cyan-9)",10:"var(--vef-cyan-10)"},green:{DEFAULT:"var(--vef-green-6)",1:"var(--vef-green-1)",2:"var(--vef-green-2)",3:"var(--vef-green-3)",4:"var(--vef-green-4)",5:"var(--vef-green-5)",6:"var(--vef-green-6)",7:"var(--vef-green-7)",8:"var(--vef-green-8)",9:"var(--vef-green-9)",10:"var(--vef-green-10)"},magenta:{DEFAULT:"var(--vef-magenta-6)",1:"var(--vef-magenta-1)",2:"var(--vef-magenta-2)",3:"var(--vef-magenta-3)",4:"var(--vef-magenta-4)",5:"var(--vef-magenta-5)",6:"var(--vef-magenta-6)",7:"var(--vef-magenta-7)",8:"var(--vef-magenta-8)",9:"var(--vef-magenta-9)",10:"var(--vef-magenta-10)"},pink:{DEFAULT:"var(--vef-pink-6)",1:"var(--vef-pink-1)",2:"var(--vef-pink-2)",3:"var(--vef-pink-3)",4:"var(--vef-pink-4)",5:"var(--vef-pink-5)",6:"var(--vef-pink-6)",7:"var(--vef-pink-7)",8:"var(--vef-pink-8)",9:"var(--vef-pink-9)",10:"var(--vef-pink-10)"},red:{DEFAULT:"var(--vef-red-6)",1:"var(--vef-red-1)",2:"var(--vef-red-2)",3:"var(--vef-red-3)",4:"var(--vef-red-4)",5:"var(--vef-red-5)",6:"var(--vef-red-6)",7:"var(--vef-red-7)",8:"var(--vef-red-8)",9:"var(--vef-red-9)",10:"var(--vef-red-10)"},orange:{DEFAULT:"var(--vef-orange-6)",1:"var(--vef-orange-1)",2:"var(--vef-orange-2)",3:"var(--vef-orange-3)",4:"var(--vef-orange-4)",5:"var(--vef-orange-5)",6:"var(--vef-orange-6)",7:"var(--vef-orange-7)",8:"var(--vef-orange-8)",9:"var(--vef-orange-9)",10:"var(--vef-orange-10)"},yellow:{DEFAULT:"var(--vef-yellow-6)",1:"var(--vef-yellow-1)",2:"var(--vef-yellow-2)",3:"var(--vef-yellow-3)",4:"var(--vef-yellow-4)",5:"var(--vef-yellow-5)",6:"var(--vef-yellow-6)",7:"var(--vef-yellow-7)",8:"var(--vef-yellow-8)",9:"var(--vef-yellow-9)",10:"var(--vef-yellow-10)"},volcano:{DEFAULT:"var(--vef-volcano-6)",1:"var(--vef-volcano-1)",2:"var(--vef-volcano-2)",3:"var(--vef-volcano-3)",4:"var(--vef-volcano-4)",5:"var(--vef-volcano-5)",6:"var(--vef-volcano-6)",7:"var(--vef-volcano-7)",8:"var(--vef-volcano-8)",9:"var(--vef-volcano-9)",10:"var(--vef-volcano-10)"},geekblue:{DEFAULT:"var(--vef-geekblue-6)",1:"var(--vef-geekblue-1)",2:"var(--vef-geekblue-2)",3:"var(--vef-geekblue-3)",4:"var(--vef-geekblue-4)",5:"var(--vef-geekblue-5)",6:"var(--vef-geekblue-6)",7:"var(--vef-geekblue-7)",8:"var(--vef-geekblue-8)",9:"var(--vef-geekblue-9)",10:"var(--vef-geekblue-10)"},gold:{DEFAULT:"var(--vef-gold-6)",1:"var(--vef-gold-1)",2:"var(--vef-gold-2)",3:"var(--vef-gold-3)",4:"var(--vef-gold-4)",5:"var(--vef-gold-5)",6:"var(--vef-gold-6)",7:"var(--vef-gold-7)",8:"var(--vef-gold-8)",9:"var(--vef-gold-9)",10:"var(--vef-gold-10)"},lime:{DEFAULT:"var(--vef-lime-6)",1:"var(--vef-lime-1)",2:"var(--vef-lime-2)",3:"var(--vef-lime-3)",4:"var(--vef-lime-4)",5:"var(--vef-lime-5)",6:"var(--vef-lime-6)",7:"var(--vef-lime-7)",8:"var(--vef-lime-8)",9:"var(--vef-lime-9)",10:"var(--vef-lime-10)"},slate:{DEFAULT:r.slate[500],1:r.slate[50],2:r.slate[100],3:r.slate[200],4:r.slate[300],5:r.slate[400],6:r.slate[500],7:r.slate[600],8:r.slate[700],9:r.slate[800],10:r.slate[900]}},extend:{textColor:{"primary-alt":"var(--vef-color-primary-text)","primary-alt-hover":"var(--vef-color-primary-text-hover)","primary-alt-active":"var(--vef-color-primary-text-active)","success-alt":"var(--vef-color-success-text)","success-alt-hover":"var(--vef-color-success-text-hover)","success-alt-active":"var(--vef-color-success-text-active)","warning-alt":"var(--vef-color-warning-text)","warning-alt-hover":"var(--vef-color-warning-text-hover)","warning-alt-active":"var(--vef-color-warning-text-active)","error-alt":"var(--vef-color-error-text)","error-alt-hover":"var(--vef-color-error-text-hover)","error-alt-active":"var(--vef-color-error-text-active)","info-alt":"var(--vef-color-info-text)","info-alt-hover":"var(--vef-color-info-text-hover)","info-alt-active":"var(--vef-color-info-text-active)",base:"var(--vef-color-text-base)",default:"var(--vef-color-text)",secondary:"var(--vef-color-text-secondary)",tertiary:"var(--vef-color-text-tertiary)",quaternary:"var(--vef-color-text-quaternary)",placeholder:"var(--vef-color-text-placeholder)",disabled:"var(--vef-color-text-disabled)",heading:"var(--vef-color-text-heading)",label:"var(--vef-color-text-label)",description:"var(--vef-color-text-description)","light-solid":"var(--vef-color-text-light-solid)",highlight:"var(--vef-color-highlight)",icon:"var(--vef-color-icon)","icon-hover":"var(--vef-color-icon-hover)"},outlineColor:{error:"var(--vef-color-error-outline)",warning:"var(--vef-color-warning-outline)"},backgroundColor:{"primary-alt":"var(--vef-color-primary-bg)","primary-alt-hover":"var(--vef-color-primary-bg-hover)","success-alt":"var(--vef-color-success-bg)","success-alt-hover":"var(--vef-color-success-bg-hover)","warning-alt":"var(--vef-color-warning-bg)","warning-alt-hover":"var(--vef-color-warning-bg-hover)","error-alt":"var(--vef-color-error-bg)","error-alt-hover":"var(--vef-color-error-bg-hover)","info-alt":"var(--vef-color-info-bg)","info-alt-hover":"var(--vef-color-info-bg-hover)",base:"var(--vef-color-bg-base)",layout:"var(--vef-color-bg-layout)",spotlight:"var(--vef-color-bg-spotlight)",solid:"var(--vef-color-bg-solid)","solid-hover":"var(--vef-color-bg-solid-hover)","solid-active":"var(--vef-color-bg-solid-active)",container:"var(--vef-color-bg-container)","container-disabled":"var(--vef-color-bg-container-disabled)",elevated:"var(--vef-color-bg-elevated)",blur:"var(--vef-color-bg-blur)",fill:"var(--vef-color-fill)","fill-secondary":"var(--vef-color-fill-secondary)","fill-tertiary":"var(--vef-color-fill-tertiary)","fill-quaternary":"var(--vef-color-fill-quaternary)","fill-content":"var(--vef-color-fill-content)","fill-content-hover":"var(--vef-color-fill-content-hover)","fill-alt":"var(--vef-color-fill-alter)",mask:"var(--vef-color-bg-mask)","text-hover":"var(--vef-color-bg-text-hover)","text-active":"var(--vef-color-bg-text-active)","control-item-hover":"var(--vef-control-item-bg-hover)","control-item-active":"var(--vef-control-item-bg-active)","control-item-active-hover":"var(--vef-control-item-bg-active-hover)","control-item-active-disabled":"var(--vef-control-item-bg-active-disabled)"},borderColor:{"primary-alt":"var(--vef-color-primary-border)","primary-alt-hover":"var(--vef-color-primary-border-hover)","success-alt":"var(--vef-color-success-border)","success-alt-hover":"var(--vef-color-success-border-hover)","warning-alt":"var(--vef-color-warning-border)","warning-alt-hover":"var(--vef-color-warning-border-hover)","error-alt":"var(--vef-color-error-border)","error-alt-hover":"var(--vef-color-error-border-hover)","info-alt":"var(--vef-color-info-border)","info-alt-hover":"var(--vef-color-info-border-hover)",base:"var(--vef-color-border)",secondary:"var(--vef-color-border-secondary)"},fontFamily:{base:"var(--vef-font-family)",code:"var(--vef-font-family-code)"},fontSize:{base:"var(--vef-font-size)",sm:"var(--vef-font-size-sm)",lg:"var(--vef-font-size-lg)",xl:"var(--vef-font-size-xl)",heading1:"var(--vef-font-size-heading-1)",heading2:"var(--vef-font-size-heading-2)",heading3:"var(--vef-font-size-heading-3)",heading4:"var(--vef-font-size-heading-4)",heading5:"var(--vef-font-size-heading-5)"},fontWeight:{strong:"var(--vef-font-weight-strong)"},borderWidth:{base:"var(--vef-line-width)",bold:"var(--vef-line-width-bold)"},borderRadius:{DEFAULT:"var(--vef-border-radius)",xs:"var(--vef-border-radius-xs)",sm:"var(--vef-border-radius-sm)",lg:"var(--vef-border-radius-lg)",outer:"var(--vef-border-radius-outer)"},height:{control:"var(--vef-control-height)","control-sm":"var(--vef-control-height-sm)","control-xs":"var(--vef-control-height-xs)","control-lg":"var(--vef-control-height-lg)",font:"var(--vef-font-height)","font-sm":"var(--vef-font-height-sm)","font-lg":"var(--vef-font-height-lg)"},lineHeight:{base:"var(--vef-line-height)",sm:"var(--vef-line-height-sm)",lg:"var(--vef-line-height-lg)","heading-1":"var(--vef-line-height-heading-1)","heading-2":"var(--vef-line-height-heading-2)","heading-3":"var(--vef-line-height-heading-3)","heading-4":"var(--vef-line-height-heading-4)","heading-5":"var(--vef-line-height-heading-5)"},spacing:{base:"var(--vef-margin)",xxs:"var(--vef-margin-xxs)",xs:"var(--vef-margin-xs)",sm:"var(--vef-margin-sm)",md:"var(--vef-margin-md)",lg:"var(--vef-margin-lg)",xl:"var(--vef-margin-xl)",xxl:"var(--vef-margin-xxl)"},boxShadow:{base:"var(--vef-box-shadow)",secondary:"var(--vef-box-shadow-secondary)",tertiary:"var(--vef-box-shadow-tertiary)",card:"var(--vef-box-shadow-card)",elevated:"0 0 1px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 10%)"},transitionDuration:{fast:"var(--vef-motion-duration-fast)",mid:"var(--vef-motion-duration-mid)",slow:"var(--vef-motion-duration-slow)"},transitionTimingFunction:{"ease-out-circ":"var(--vef-motion-ease-out-circ)","ease-in-out-circ":"var(--vef-motion-ease-in-out-circ)","ease-out":"var(--vef-motion-ease-out)","ease-in-out":"var(--vef-motion-ease-in-out)","ease-out-back":"var(--vef-motion-ease-out-back)","ease-in-back":"var(--vef-motion-ease-in-back)","ease-in-quint":"var(--vef-motion-ease-in-quint)","ease-out-quint":"var(--vef-motion-ease-out-quint)"},zIndex:{base:"var(--vef-z-index-base)",popup:"var(--vef-z-index-popup)"}}}}}export{defineTailwindConfig};
1
+ /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.261Z, made by Venus. */
2
+ import containerQueries from '@tailwindcss/container-queries';
3
+ import colors from 'tailwindcss/colors';
4
+
5
+ function defineTailwindConfig() {
6
+ return {
7
+ content: ["./src/**/*.{ts,tsx}"],
8
+ plugins: [containerQueries],
9
+ theme: {
10
+ colors: {
11
+ "inherit": "inherit",
12
+ "current": "currentColor",
13
+ "transparent": "transparent",
14
+ "black": "#000000",
15
+ "white": "var(--vef-color-white)",
16
+ "primary": "var(--vef-color-primary)",
17
+ "primary-hover": "var(--vef-color-primary-hover)",
18
+ "primary-active": "var(--vef-color-primary-active)",
19
+ "success": "var(--vef-color-success)",
20
+ "success-hover": "var(--vef-color-success-hover)",
21
+ "success-active": "var(--vef-color-success-active)",
22
+ "warning": "var(--vef-color-warning)",
23
+ "warning-hover": "var(--vef-color-warning-hover)",
24
+ "warning-active": "var(--vef-color-warning-active)",
25
+ "error": "var(--vef-color-error)",
26
+ "error-hover": "var(--vef-color-error-hover)",
27
+ "error-active": "var(--vef-color-error-active)",
28
+ "info": "var(--vef-color-info)",
29
+ "info-hover": "var(--vef-color-info-hover)",
30
+ "info-active": "var(--vef-color-info-active)",
31
+ "link": "var(--vef-color-link)",
32
+ "link-hover": "var(--vef-color-link-hover)",
33
+ "link-active": "var(--vef-color-link-active)",
34
+ "blue": {
35
+ DEFAULT: "var(--vef-blue-6)",
36
+ 1: "var(--vef-blue-1)",
37
+ 2: "var(--vef-blue-2)",
38
+ 3: "var(--vef-blue-3)",
39
+ 4: "var(--vef-blue-4)",
40
+ 5: "var(--vef-blue-5)",
41
+ 6: "var(--vef-blue-6)",
42
+ 7: "var(--vef-blue-7)",
43
+ 8: "var(--vef-blue-8)",
44
+ 9: "var(--vef-blue-9)",
45
+ 10: "var(--vef-blue-10)"
46
+ },
47
+ "purple": {
48
+ DEFAULT: "var(--vef-purple-6)",
49
+ 1: "var(--vef-purple-1)",
50
+ 2: "var(--vef-purple-2)",
51
+ 3: "var(--vef-purple-3)",
52
+ 4: "var(--vef-purple-4)",
53
+ 5: "var(--vef-purple-5)",
54
+ 6: "var(--vef-purple-6)",
55
+ 7: "var(--vef-purple-7)",
56
+ 8: "var(--vef-purple-8)",
57
+ 9: "var(--vef-purple-9)",
58
+ 10: "var(--vef-purple-10)"
59
+ },
60
+ "cyan": {
61
+ DEFAULT: "var(--vef-cyan-6)",
62
+ 1: "var(--vef-cyan-1)",
63
+ 2: "var(--vef-cyan-2)",
64
+ 3: "var(--vef-cyan-3)",
65
+ 4: "var(--vef-cyan-4)",
66
+ 5: "var(--vef-cyan-5)",
67
+ 6: "var(--vef-cyan-6)",
68
+ 7: "var(--vef-cyan-7)",
69
+ 8: "var(--vef-cyan-8)",
70
+ 9: "var(--vef-cyan-9)",
71
+ 10: "var(--vef-cyan-10)"
72
+ },
73
+ "green": {
74
+ DEFAULT: "var(--vef-green-6)",
75
+ 1: "var(--vef-green-1)",
76
+ 2: "var(--vef-green-2)",
77
+ 3: "var(--vef-green-3)",
78
+ 4: "var(--vef-green-4)",
79
+ 5: "var(--vef-green-5)",
80
+ 6: "var(--vef-green-6)",
81
+ 7: "var(--vef-green-7)",
82
+ 8: "var(--vef-green-8)",
83
+ 9: "var(--vef-green-9)",
84
+ 10: "var(--vef-green-10)"
85
+ },
86
+ "magenta": {
87
+ DEFAULT: "var(--vef-magenta-6)",
88
+ 1: "var(--vef-magenta-1)",
89
+ 2: "var(--vef-magenta-2)",
90
+ 3: "var(--vef-magenta-3)",
91
+ 4: "var(--vef-magenta-4)",
92
+ 5: "var(--vef-magenta-5)",
93
+ 6: "var(--vef-magenta-6)",
94
+ 7: "var(--vef-magenta-7)",
95
+ 8: "var(--vef-magenta-8)",
96
+ 9: "var(--vef-magenta-9)",
97
+ 10: "var(--vef-magenta-10)"
98
+ },
99
+ "pink": {
100
+ DEFAULT: "var(--vef-pink-6)",
101
+ 1: "var(--vef-pink-1)",
102
+ 2: "var(--vef-pink-2)",
103
+ 3: "var(--vef-pink-3)",
104
+ 4: "var(--vef-pink-4)",
105
+ 5: "var(--vef-pink-5)",
106
+ 6: "var(--vef-pink-6)",
107
+ 7: "var(--vef-pink-7)",
108
+ 8: "var(--vef-pink-8)",
109
+ 9: "var(--vef-pink-9)",
110
+ 10: "var(--vef-pink-10)"
111
+ },
112
+ "red": {
113
+ DEFAULT: "var(--vef-red-6)",
114
+ 1: "var(--vef-red-1)",
115
+ 2: "var(--vef-red-2)",
116
+ 3: "var(--vef-red-3)",
117
+ 4: "var(--vef-red-4)",
118
+ 5: "var(--vef-red-5)",
119
+ 6: "var(--vef-red-6)",
120
+ 7: "var(--vef-red-7)",
121
+ 8: "var(--vef-red-8)",
122
+ 9: "var(--vef-red-9)",
123
+ 10: "var(--vef-red-10)"
124
+ },
125
+ "orange": {
126
+ DEFAULT: "var(--vef-orange-6)",
127
+ 1: "var(--vef-orange-1)",
128
+ 2: "var(--vef-orange-2)",
129
+ 3: "var(--vef-orange-3)",
130
+ 4: "var(--vef-orange-4)",
131
+ 5: "var(--vef-orange-5)",
132
+ 6: "var(--vef-orange-6)",
133
+ 7: "var(--vef-orange-7)",
134
+ 8: "var(--vef-orange-8)",
135
+ 9: "var(--vef-orange-9)",
136
+ 10: "var(--vef-orange-10)"
137
+ },
138
+ "yellow": {
139
+ DEFAULT: "var(--vef-yellow-6)",
140
+ 1: "var(--vef-yellow-1)",
141
+ 2: "var(--vef-yellow-2)",
142
+ 3: "var(--vef-yellow-3)",
143
+ 4: "var(--vef-yellow-4)",
144
+ 5: "var(--vef-yellow-5)",
145
+ 6: "var(--vef-yellow-6)",
146
+ 7: "var(--vef-yellow-7)",
147
+ 8: "var(--vef-yellow-8)",
148
+ 9: "var(--vef-yellow-9)",
149
+ 10: "var(--vef-yellow-10)"
150
+ },
151
+ "volcano": {
152
+ DEFAULT: "var(--vef-volcano-6)",
153
+ 1: "var(--vef-volcano-1)",
154
+ 2: "var(--vef-volcano-2)",
155
+ 3: "var(--vef-volcano-3)",
156
+ 4: "var(--vef-volcano-4)",
157
+ 5: "var(--vef-volcano-5)",
158
+ 6: "var(--vef-volcano-6)",
159
+ 7: "var(--vef-volcano-7)",
160
+ 8: "var(--vef-volcano-8)",
161
+ 9: "var(--vef-volcano-9)",
162
+ 10: "var(--vef-volcano-10)"
163
+ },
164
+ "geekblue": {
165
+ DEFAULT: "var(--vef-geekblue-6)",
166
+ 1: "var(--vef-geekblue-1)",
167
+ 2: "var(--vef-geekblue-2)",
168
+ 3: "var(--vef-geekblue-3)",
169
+ 4: "var(--vef-geekblue-4)",
170
+ 5: "var(--vef-geekblue-5)",
171
+ 6: "var(--vef-geekblue-6)",
172
+ 7: "var(--vef-geekblue-7)",
173
+ 8: "var(--vef-geekblue-8)",
174
+ 9: "var(--vef-geekblue-9)",
175
+ 10: "var(--vef-geekblue-10)"
176
+ },
177
+ "gold": {
178
+ DEFAULT: "var(--vef-gold-6)",
179
+ 1: "var(--vef-gold-1)",
180
+ 2: "var(--vef-gold-2)",
181
+ 3: "var(--vef-gold-3)",
182
+ 4: "var(--vef-gold-4)",
183
+ 5: "var(--vef-gold-5)",
184
+ 6: "var(--vef-gold-6)",
185
+ 7: "var(--vef-gold-7)",
186
+ 8: "var(--vef-gold-8)",
187
+ 9: "var(--vef-gold-9)",
188
+ 10: "var(--vef-gold-10)"
189
+ },
190
+ "lime": {
191
+ DEFAULT: "var(--vef-lime-6)",
192
+ 1: "var(--vef-lime-1)",
193
+ 2: "var(--vef-lime-2)",
194
+ 3: "var(--vef-lime-3)",
195
+ 4: "var(--vef-lime-4)",
196
+ 5: "var(--vef-lime-5)",
197
+ 6: "var(--vef-lime-6)",
198
+ 7: "var(--vef-lime-7)",
199
+ 8: "var(--vef-lime-8)",
200
+ 9: "var(--vef-lime-9)",
201
+ 10: "var(--vef-lime-10)"
202
+ },
203
+ "slate": {
204
+ DEFAULT: colors.slate[500],
205
+ 1: colors.slate[50],
206
+ 2: colors.slate[100],
207
+ 3: colors.slate[200],
208
+ 4: colors.slate[300],
209
+ 5: colors.slate[400],
210
+ 6: colors.slate[500],
211
+ 7: colors.slate[600],
212
+ 8: colors.slate[700],
213
+ 9: colors.slate[800],
214
+ 10: colors.slate[900]
215
+ }
216
+ },
217
+ extend: {
218
+ textColor: {
219
+ "primary-alt": "var(--vef-color-primary-text)",
220
+ "primary-alt-hover": "var(--vef-color-primary-text-hover)",
221
+ "primary-alt-active": "var(--vef-color-primary-text-active)",
222
+ "success-alt": "var(--vef-color-success-text)",
223
+ "success-alt-hover": "var(--vef-color-success-text-hover)",
224
+ "success-alt-active": "var(--vef-color-success-text-active)",
225
+ "warning-alt": "var(--vef-color-warning-text)",
226
+ "warning-alt-hover": "var(--vef-color-warning-text-hover)",
227
+ "warning-alt-active": "var(--vef-color-warning-text-active)",
228
+ "error-alt": "var(--vef-color-error-text)",
229
+ "error-alt-hover": "var(--vef-color-error-text-hover)",
230
+ "error-alt-active": "var(--vef-color-error-text-active)",
231
+ "info-alt": "var(--vef-color-info-text)",
232
+ "info-alt-hover": "var(--vef-color-info-text-hover)",
233
+ "info-alt-active": "var(--vef-color-info-text-active)",
234
+ "base": "var(--vef-color-text-base)",
235
+ "default": "var(--vef-color-text)",
236
+ "secondary": "var(--vef-color-text-secondary)",
237
+ "tertiary": "var(--vef-color-text-tertiary)",
238
+ "quaternary": "var(--vef-color-text-quaternary)",
239
+ "placeholder": "var(--vef-color-text-placeholder)",
240
+ "disabled": "var(--vef-color-text-disabled)",
241
+ "heading": "var(--vef-color-text-heading)",
242
+ "label": "var(--vef-color-text-label)",
243
+ "description": "var(--vef-color-text-description)",
244
+ "light-solid": "var(--vef-color-text-light-solid)",
245
+ "highlight": "var(--vef-color-highlight)",
246
+ "icon": "var(--vef-color-icon)",
247
+ "icon-hover": "var(--vef-color-icon-hover)"
248
+ },
249
+ outlineColor: {
250
+ error: "var(--vef-color-error-outline)",
251
+ warning: "var(--vef-color-warning-outline)"
252
+ },
253
+ backgroundColor: {
254
+ "primary-alt": "var(--vef-color-primary-bg)",
255
+ "primary-alt-hover": "var(--vef-color-primary-bg-hover)",
256
+ "success-alt": "var(--vef-color-success-bg)",
257
+ "success-alt-hover": "var(--vef-color-success-bg-hover)",
258
+ "warning-alt": "var(--vef-color-warning-bg)",
259
+ "warning-alt-hover": "var(--vef-color-warning-bg-hover)",
260
+ "error-alt": "var(--vef-color-error-bg)",
261
+ "error-alt-hover": "var(--vef-color-error-bg-hover)",
262
+ "info-alt": "var(--vef-color-info-bg)",
263
+ "info-alt-hover": "var(--vef-color-info-bg-hover)",
264
+ "base": "var(--vef-color-bg-base)",
265
+ "layout": "var(--vef-color-bg-layout)",
266
+ "spotlight": "var(--vef-color-bg-spotlight)",
267
+ "solid": "var(--vef-color-bg-solid)",
268
+ "solid-hover": "var(--vef-color-bg-solid-hover)",
269
+ "solid-active": "var(--vef-color-bg-solid-active)",
270
+ "container": "var(--vef-color-bg-container)",
271
+ "container-disabled": "var(--vef-color-bg-container-disabled)",
272
+ "elevated": "var(--vef-color-bg-elevated)",
273
+ "blur": "var(--vef-color-bg-blur)",
274
+ "fill": "var(--vef-color-fill)",
275
+ "fill-secondary": "var(--vef-color-fill-secondary)",
276
+ "fill-tertiary": "var(--vef-color-fill-tertiary)",
277
+ "fill-quaternary": "var(--vef-color-fill-quaternary)",
278
+ "fill-content": "var(--vef-color-fill-content)",
279
+ "fill-content-hover": "var(--vef-color-fill-content-hover)",
280
+ "fill-alt": "var(--vef-color-fill-alter)",
281
+ "mask": "var(--vef-color-bg-mask)",
282
+ "text-hover": "var(--vef-color-bg-text-hover)",
283
+ "text-active": "var(--vef-color-bg-text-active)",
284
+ "control-item-hover": "var(--vef-control-item-bg-hover)",
285
+ "control-item-active": "var(--vef-control-item-bg-active)",
286
+ "control-item-active-hover": "var(--vef-control-item-bg-active-hover)",
287
+ "control-item-active-disabled": "var(--vef-control-item-bg-active-disabled)"
288
+ },
289
+ borderColor: {
290
+ "primary-alt": "var(--vef-color-primary-border)",
291
+ "primary-alt-hover": "var(--vef-color-primary-border-hover)",
292
+ "success-alt": "var(--vef-color-success-border)",
293
+ "success-alt-hover": "var(--vef-color-success-border-hover)",
294
+ "warning-alt": "var(--vef-color-warning-border)",
295
+ "warning-alt-hover": "var(--vef-color-warning-border-hover)",
296
+ "error-alt": "var(--vef-color-error-border)",
297
+ "error-alt-hover": "var(--vef-color-error-border-hover)",
298
+ "info-alt": "var(--vef-color-info-border)",
299
+ "info-alt-hover": "var(--vef-color-info-border-hover)",
300
+ "base": "var(--vef-color-border)",
301
+ "secondary": "var(--vef-color-border-secondary)"
302
+ },
303
+ fontFamily: {
304
+ base: "var(--vef-font-family)",
305
+ code: "var(--vef-font-family-code)"
306
+ },
307
+ fontSize: {
308
+ base: "var(--vef-font-size)",
309
+ sm: "var(--vef-font-size-sm)",
310
+ lg: "var(--vef-font-size-lg)",
311
+ xl: "var(--vef-font-size-xl)",
312
+ heading1: "var(--vef-font-size-heading-1)",
313
+ heading2: "var(--vef-font-size-heading-2)",
314
+ heading3: "var(--vef-font-size-heading-3)",
315
+ heading4: "var(--vef-font-size-heading-4)",
316
+ heading5: "var(--vef-font-size-heading-5)"
317
+ },
318
+ fontWeight: {
319
+ strong: "var(--vef-font-weight-strong)"
320
+ },
321
+ borderWidth: {
322
+ base: "var(--vef-line-width)",
323
+ bold: "var(--vef-line-width-bold)"
324
+ },
325
+ borderRadius: {
326
+ DEFAULT: "var(--vef-border-radius)",
327
+ xs: "var(--vef-border-radius-xs)",
328
+ sm: "var(--vef-border-radius-sm)",
329
+ lg: "var(--vef-border-radius-lg)",
330
+ outer: "var(--vef-border-radius-outer)"
331
+ },
332
+ height: {
333
+ "control": "var(--vef-control-height)",
334
+ "control-sm": "var(--vef-control-height-sm)",
335
+ "control-xs": "var(--vef-control-height-xs)",
336
+ "control-lg": "var(--vef-control-height-lg)",
337
+ "font": "var(--vef-font-height)",
338
+ "font-sm": "var(--vef-font-height-sm)",
339
+ "font-lg": "var(--vef-font-height-lg)"
340
+ },
341
+ lineHeight: {
342
+ "base": "var(--vef-line-height)",
343
+ "sm": "var(--vef-line-height-sm)",
344
+ "lg": "var(--vef-line-height-lg)",
345
+ "heading-1": "var(--vef-line-height-heading-1)",
346
+ "heading-2": "var(--vef-line-height-heading-2)",
347
+ "heading-3": "var(--vef-line-height-heading-3)",
348
+ "heading-4": "var(--vef-line-height-heading-4)",
349
+ "heading-5": "var(--vef-line-height-heading-5)"
350
+ },
351
+ spacing: {
352
+ base: "var(--vef-margin)",
353
+ xxs: "var(--vef-margin-xxs)",
354
+ xs: "var(--vef-margin-xs)",
355
+ sm: "var(--vef-margin-sm)",
356
+ md: "var(--vef-margin-md)",
357
+ lg: "var(--vef-margin-lg)",
358
+ xl: "var(--vef-margin-xl)",
359
+ xxl: "var(--vef-margin-xxl)"
360
+ },
361
+ boxShadow: {
362
+ base: "var(--vef-box-shadow)",
363
+ secondary: "var(--vef-box-shadow-secondary)",
364
+ tertiary: "var(--vef-box-shadow-tertiary)",
365
+ card: "var(--vef-box-shadow-card)",
366
+ elevated: "0 0 1px rgb(0 0 0 / 30%), 0 4px 14px rgb(0 0 0 / 10%)"
367
+ },
368
+ transitionDuration: {
369
+ fast: "var(--vef-motion-duration-fast)",
370
+ mid: "var(--vef-motion-duration-mid)",
371
+ slow: "var(--vef-motion-duration-slow)"
372
+ },
373
+ transitionTimingFunction: {
374
+ "ease-out-circ": "var(--vef-motion-ease-out-circ)",
375
+ "ease-in-out-circ": "var(--vef-motion-ease-in-out-circ)",
376
+ "ease-out": "var(--vef-motion-ease-out)",
377
+ "ease-in-out": "var(--vef-motion-ease-in-out)",
378
+ "ease-out-back": "var(--vef-motion-ease-out-back)",
379
+ "ease-in-back": "var(--vef-motion-ease-in-back)",
380
+ "ease-in-quint": "var(--vef-motion-ease-in-quint)",
381
+ "ease-out-quint": "var(--vef-motion-ease-out-quint)"
382
+ },
383
+ zIndex: {
384
+ base: "var(--vef-z-index-base)",
385
+ popup: "var(--vef-z-index-popup)"
386
+ }
387
+ }
388
+ }
389
+ };
390
+ }
391
+
392
+ export { defineTailwindConfig };
3
393
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
package/lib/cli.cjs CHANGED
@@ -1,3 +1,228 @@
1
- /*! VefFramework version: 1.0.100, build time: 2025-03-07T13:52:53.492Z, made by Venus. */
2
- "use strict";const e=require("chalk"),o=require("commander"),i=require("consola"),t=require("execa"),r=require("fs-extra"),a=require("node:path"),n=require("node:process"),s=require("ora"),c=require("prompts"),l=require("vite"),{exists:p,readJsonSync:d,writeFile:u,readJson:f,writeJson:m,copy:g,readFile:v,move:w}=r,y=n.cwd();const h=function readPackageVersion(){const e=a.resolve(void 0,"../package.json");return d(e,{encoding:"utf-8"}).version}();async function importHoistPatterns(){return(await import("../bin/hoist-patterns.js")).default}function resolveEnvMode(e,o){return o||("build"===e?"production":"development")}async function loadVefConfig(e,o,t){const r=a.resolve(y,e||"vef.config.ts");if(!await p(r))throw i.error(`Config file not found: ${r}, it is required for VEF Framework`),new Error(`Config file not found: ${r}`);const n=await l.loadConfigFromFile({command:o,mode:t},r);return n?.config??{}}function handleError(e,o){i.error(`Error during ${e}:`,o),n.exit(1)}o.program.name("vef").description(e.magenta("VEF Framework CLI")).addHelpText("before",e.blue("VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus.")).addHelpText("before",e.bgGreenBright(`Version: ${h}`)).version(h).option("--mode <mode>","Specify running mode (will override default NODE_ENV)"),o.program.command("dev").description("Start dev server").option("-c, --config <file>","Specify vef config file","vef.config.ts").action((async e=>{try{const i=resolveEnvMode("serve",o.program.opts().mode);n.env.NODE_ENV=i,n.env.VEF_FRAMEWORK_VERSION=h;const t=await loadVefConfig(e.config,"serve",i),r=await l.createServer({...t,mode:i,configFile:!1,logLevel:"info"});await r.listen(),r.printUrls(),r.bindCLIShortcuts({print:!0})}catch(e){handleError("dev server startup",e)}})),o.program.command("build").description("Build for production").option("-c, --config <file>","Specify vef config file","vef.config.ts").action((async e=>{try{const t=resolveEnvMode("build",o.program.opts().mode);n.env.NODE_ENV=t,n.env.VEF_FRAMEWORK_VERSION=h;const r=await loadVefConfig(e.config,"build",t);await l.build({...r,mode:t,configFile:!1,logLevel:"info"}),i.success("Build completed successfully!")}catch(e){handleError("build",e)}})),o.program.command("preview").description("Preview the build").option("-c, --config <file>","Specify vef config file","vef.config.ts").action((async e=>{try{const i=resolveEnvMode("build",o.program.opts().mode);n.env.NODE_ENV=i,n.env.VEF_FRAMEWORK_VERSION=h;const t=await loadVefConfig(e.config,"build",i),r=await l.preview({...t,mode:i,configFile:!1,logLevel:"info"});r.printUrls(),r.bindCLIShortcuts({print:!0})}catch(e){handleError("preview server startup",e)}})),o.program.command("prepare").description("Sets up the project for development mode").action((async()=>{await p(a.resolve(y,".husky"))||((await import("husky")).default(),i.success("Successfully set up husky")),await p(a.resolve(y,".husky/pre-commit"))||(await u(a.resolve(y,".husky/pre-commit"),"pnpm dlx lint-staged"),i.success("Successfully set up pre-commit hook")),await p(a.resolve(y,".husky/commit-msg"))||(await u(a.resolve(y,".husky/commit-msg"),"pnpm dlx commitlint --edit $1"),i.success("Successfully set up commit-msg hook"));const e=await f(a.resolve(y,"package.json"),{encoding:"utf-8"}),{scripts:o}=e;let t=!1;o.prepare||(o.prepare="vef prepare",t=!0),t&&(await m(a.resolve(y,"package.json"),e,{encoding:"utf-8",spaces:2}),i.success("Successfully set up prepare script and lint-staged"))})),o.program.command("install").description("Install the dependencies of the project").action((async()=>{const e=await importHoistPatterns();await t.execa({cwd:y,stdio:"inherit"})("pnpm",["install",...e.flatMap((e=>["--public-hoist-pattern",e]))])})),o.program.command("update").description("Update the dependencies of the vef framework to latest version").action((async()=>{await t.execa({cwd:y,stdio:"inherit"})("pnpm",["update","@vef-framework/*"])})),o.program.command("init").description("Initialize an empty VEF project").action((async()=>{console.log(e.blue("Welcome to use the cli tool of VEF Framework\n"));const o=await c([{type:"text",name:"appName",message:"What is the name of your app?",validate:e=>"string"==typeof e&&e.trim().length>0||"App name is required"},{type:"text",name:"appTitle",message:"What is the title of your app?",validate:e=>"string"==typeof e&&e.trim().length>0||"App title is required"}]),{appName:r,appTitle:n}=o;await g(a.resolve(void 0,"../template"),a.resolve(y,r)),i.success("Successfully copied template files"),await w(a.resolve(y,r,"_gitignore"),a.resolve(y,r,".gitignore")),await w(a.resolve(y,r,"_tsconfig.json"),a.resolve(y,r,"tsconfig.json")),await w(a.resolve(y,r,"_package.json"),a.resolve(y,r,"package.json"));const l=await f(a.resolve(y,r,"package.json"),{encoding:"utf-8"});l.name=r,await m(a.resolve(y,r,"package.json"),l,{encoding:"utf-8",spaces:2}),i.success("Successfully replaced name and title in package.json");const p=(await v(a.resolve(y,r,"env/.env"),{encoding:"utf-8"})).replace(/APP_NAME=.*$/m,`APP_NAME=${r}`).replace(/APP_TITLE=.*$/m,`APP_TITLE=${n}`);await u(a.resolve(y,r,"env/.env"),p),i.success("Successfully replaced name and title in .env file");const d=s("Initializing git repository...").start();try{await(t.execa`git --version`),await(t.execa({cwd:a.resolve(y,r)})`git init`),d.succeed("Successfully initialized git repository")}catch(e){d.fail("Failed to initialize git repository"),handleError("init",e)}d.start("Installing dependencies...");try{const e=await importHoistPatterns();await t.execa({cwd:a.resolve(y,r)})("pnpm",["install",...e.flatMap((e=>["--public-hoist-pattern",e]))]),d.succeed("Successfully installed dependencies")}catch(e){d.fail("Failed to install dependencies"),handleError("init",e)}i.success(e.green("\nšŸŽ‰šŸŽ‰šŸŽ‰ VEF project created successfully !")),console.log(e.blue("\n✨ Next steps:")),console.log(e.cyan(` cd ${r}`)),console.log(e.cyan(" pnpm dev"))})),o.program.parse();
1
+ /*! VefFramework version: 1.0.101, build time: 2025-03-07T14:07:15.261Z, made by Venus. */
2
+ 'use strict';
3
+
4
+ const chalk = require('chalk');
5
+ const commander = require('commander');
6
+ const consola = require('consola');
7
+ const execa = require('execa');
8
+ const fsExtra = require('fs-extra');
9
+ const node_path = require('node:path');
10
+ const process = require('node:process');
11
+ const ora = require('ora');
12
+ const prompts = require('prompts');
13
+ const vite = require('vite');
14
+
15
+ const {
16
+ exists,
17
+ readJsonSync,
18
+ writeFile,
19
+ readJson,
20
+ writeJson,
21
+ copy,
22
+ readFile,
23
+ move
24
+ } = fsExtra;
25
+ const currentDir = process.cwd();
26
+ function readPackageVersion() {
27
+ const packageJsonPath = node_path.resolve(undefined, "../package.json");
28
+ const packageJson = readJsonSync(packageJsonPath, { encoding: "utf-8" });
29
+ return packageJson.version;
30
+ }
31
+ const frameworkVersion = readPackageVersion();
32
+ async function importHoistPatterns() {
33
+ const hoistedPatterns = (await import('../bin/hoist-patterns.js')).default;
34
+ return hoistedPatterns;
35
+ }
36
+ function resolveEnvMode(command, userMode) {
37
+ if (userMode) {
38
+ return userMode;
39
+ }
40
+ return command === "build" ? "production" : "development";
41
+ }
42
+ async function loadVefConfig(configPath, command, mode) {
43
+ const vefConfigPath = node_path.resolve(currentDir, configPath || "vef.config.ts");
44
+ if (!await exists(vefConfigPath)) {
45
+ consola.error(`Config file not found: ${vefConfigPath}, it is required for VEF Framework`);
46
+ throw new Error(`Config file not found: ${vefConfigPath}`);
47
+ }
48
+ const vefConfig = await vite.loadConfigFromFile(
49
+ {
50
+ command,
51
+ mode
52
+ },
53
+ vefConfigPath
54
+ );
55
+ return vefConfig?.config ?? {};
56
+ }
57
+ function handleError(phase, error) {
58
+ consola.error(`Error during ${phase}:`, error);
59
+ process.exit(1);
60
+ }
61
+ commander.program.name("vef").description(chalk.magenta("VEF Framework CLI")).addHelpText("before", chalk.blue("VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus.")).addHelpText("before", chalk.bgGreenBright(`Version: ${frameworkVersion}`)).version(frameworkVersion).option("--mode <mode>", "Specify running mode (will override default NODE_ENV)");
62
+ commander.program.command("dev").description("Start dev server").option("-c, --config <file>", "Specify vef config file", "vef.config.ts").action(async (options) => {
63
+ try {
64
+ const mode = resolveEnvMode("serve", commander.program.opts().mode);
65
+ process.env.NODE_ENV = mode;
66
+ process.env.VEF_FRAMEWORK_VERSION = frameworkVersion;
67
+ const config = await loadVefConfig(options.config, "serve", mode);
68
+ const server = await vite.createServer({
69
+ ...config,
70
+ mode,
71
+ configFile: false,
72
+ logLevel: "info"
73
+ });
74
+ await server.listen();
75
+ server.printUrls();
76
+ server.bindCLIShortcuts({ print: true });
77
+ } catch (e) {
78
+ handleError("dev server startup", e);
79
+ }
80
+ });
81
+ commander.program.command("build").description("Build for production").option("-c, --config <file>", "Specify vef config file", "vef.config.ts").action(async (options) => {
82
+ try {
83
+ const mode = resolveEnvMode("build", commander.program.opts().mode);
84
+ process.env.NODE_ENV = mode;
85
+ process.env.VEF_FRAMEWORK_VERSION = frameworkVersion;
86
+ const config = await loadVefConfig(options.config, "build", mode);
87
+ await vite.build({
88
+ ...config,
89
+ mode,
90
+ configFile: false,
91
+ logLevel: "info"
92
+ });
93
+ consola.success("Build completed successfully!");
94
+ } catch (e) {
95
+ handleError("build", e);
96
+ }
97
+ });
98
+ commander.program.command("preview").description("Preview the build").option("-c, --config <file>", "Specify vef config file", "vef.config.ts").action(async (options) => {
99
+ try {
100
+ const mode = resolveEnvMode("build", commander.program.opts().mode);
101
+ process.env.NODE_ENV = mode;
102
+ process.env.VEF_FRAMEWORK_VERSION = frameworkVersion;
103
+ const config = await loadVefConfig(options.config, "build", mode);
104
+ const server = await vite.preview({
105
+ ...config,
106
+ mode,
107
+ configFile: false,
108
+ logLevel: "info"
109
+ });
110
+ server.printUrls();
111
+ server.bindCLIShortcuts({ print: true });
112
+ } catch (e) {
113
+ handleError("preview server startup", e);
114
+ }
115
+ });
116
+ commander.program.command("prepare").description("Sets up the project for development mode").action(async () => {
117
+ if (!await exists(node_path.resolve(currentDir, ".husky"))) {
118
+ (await import('husky')).default();
119
+ consola.success("Successfully set up husky");
120
+ }
121
+ if (!await exists(node_path.resolve(currentDir, ".husky/pre-commit"))) {
122
+ await writeFile(
123
+ node_path.resolve(currentDir, ".husky/pre-commit"),
124
+ "pnpm dlx lint-staged"
125
+ );
126
+ consola.success("Successfully set up pre-commit hook");
127
+ }
128
+ if (!await exists(node_path.resolve(currentDir, ".husky/commit-msg"))) {
129
+ await writeFile(
130
+ node_path.resolve(currentDir, ".husky/commit-msg"),
131
+ "pnpm dlx commitlint --edit $1"
132
+ );
133
+ consola.success("Successfully set up commit-msg hook");
134
+ }
135
+ const packageJson = await readJson(node_path.resolve(currentDir, "package.json"), { encoding: "utf-8" });
136
+ const { scripts } = packageJson;
137
+ let changed = false;
138
+ if (!scripts.prepare) {
139
+ scripts.prepare = "vef prepare";
140
+ changed = true;
141
+ }
142
+ if (changed) {
143
+ await writeJson(
144
+ node_path.resolve(currentDir, "package.json"),
145
+ packageJson,
146
+ {
147
+ encoding: "utf-8",
148
+ spaces: 2
149
+ }
150
+ );
151
+ consola.success("Successfully set up prepare script and lint-staged");
152
+ }
153
+ });
154
+ commander.program.command("install").description("Install the dependencies of the project").action(async () => {
155
+ const hoistedPatterns = await importHoistPatterns();
156
+ await execa.execa({
157
+ cwd: currentDir,
158
+ stdio: "inherit"
159
+ })("pnpm", ["install", ...hoistedPatterns.flatMap((pattern) => ["--public-hoist-pattern", pattern])]);
160
+ });
161
+ commander.program.command("update").description("Update the dependencies of the vef framework to latest version").action(async () => {
162
+ await execa.execa({
163
+ cwd: currentDir,
164
+ stdio: "inherit"
165
+ })("pnpm", ["update", "@vef-framework/*"]);
166
+ });
167
+ commander.program.command("init").description("Initialize an empty VEF project").action(async () => {
168
+ console.log(chalk.blue("Welcome to use the cli tool of VEF Framework\n"));
169
+ const result = await prompts([
170
+ {
171
+ type: "text",
172
+ name: "appName",
173
+ message: "What is the name of your app?",
174
+ validate: (value) => typeof value === "string" && value.trim().length > 0 ? true : "App name is required"
175
+ },
176
+ {
177
+ type: "text",
178
+ name: "appTitle",
179
+ message: "What is the title of your app?",
180
+ validate: (value) => typeof value === "string" && value.trim().length > 0 ? true : "App title is required"
181
+ }
182
+ ]);
183
+ const { appName, appTitle } = result;
184
+ await copy(node_path.resolve(undefined, "../template"), node_path.resolve(currentDir, appName));
185
+ consola.success("Successfully copied template files");
186
+ await move(node_path.resolve(currentDir, appName, "_gitignore"), node_path.resolve(currentDir, appName, ".gitignore"));
187
+ await move(node_path.resolve(currentDir, appName, "_tsconfig.json"), node_path.resolve(currentDir, appName, "tsconfig.json"));
188
+ await move(node_path.resolve(currentDir, appName, "_package.json"), node_path.resolve(currentDir, appName, "package.json"));
189
+ const packageJson = await readJson(node_path.resolve(currentDir, appName, "package.json"), { encoding: "utf-8" });
190
+ packageJson.name = appName;
191
+ await writeJson(node_path.resolve(currentDir, appName, "package.json"), packageJson, {
192
+ encoding: "utf-8",
193
+ spaces: 2
194
+ });
195
+ consola.success("Successfully replaced name and title in package.json");
196
+ const envContent = await readFile(node_path.resolve(currentDir, appName, "env/.env"), { encoding: "utf-8" });
197
+ const replacedEnvContent = envContent.replace(/APP_NAME=.*$/m, `APP_NAME=${appName}`).replace(/APP_TITLE=.*$/m, `APP_TITLE=${appTitle}`);
198
+ await writeFile(node_path.resolve(currentDir, appName, "env/.env"), replacedEnvContent);
199
+ consola.success("Successfully replaced name and title in .env file");
200
+ const spinner = ora("Initializing git repository...").start();
201
+ try {
202
+ await execa.execa`git --version`;
203
+ await execa.execa({
204
+ cwd: node_path.resolve(currentDir, appName)
205
+ })`git init`;
206
+ spinner.succeed("Successfully initialized git repository");
207
+ } catch (e) {
208
+ spinner.fail("Failed to initialize git repository");
209
+ handleError("init", e);
210
+ }
211
+ spinner.start("Installing dependencies...");
212
+ try {
213
+ const hoistedPatterns = await importHoistPatterns();
214
+ await execa.execa({
215
+ cwd: node_path.resolve(currentDir, appName)
216
+ })("pnpm", ["install", ...hoistedPatterns.flatMap((pattern) => ["--public-hoist-pattern", pattern])]);
217
+ spinner.succeed("Successfully installed dependencies");
218
+ } catch (e) {
219
+ spinner.fail("Failed to install dependencies");
220
+ handleError("init", e);
221
+ }
222
+ consola.success(chalk.green("\nšŸŽ‰šŸŽ‰šŸŽ‰ VEF project created successfully !"));
223
+ console.log(chalk.blue("\n✨ Next steps:"));
224
+ console.log(chalk.cyan(` cd ${appName}`));
225
+ console.log(chalk.cyan(` pnpm dev`));
226
+ });
227
+ commander.program.parse();
3
228
  /*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */