@moluoxixi/create-app 2.0.1 → 2.0.402

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 (259) hide show
  1. package/LICENSE.txt +21 -21
  2. package/README.md +129 -129
  3. package/dist/commands/create.d.ts +2 -1
  4. package/dist/commands/create.js +12 -8
  5. package/dist/commands/index.d.ts +1 -2
  6. package/dist/commands/index.js +1 -2
  7. package/dist/constants/index.d.ts +17 -0
  8. package/dist/constants/index.js +17 -0
  9. package/dist/generators/index.d.ts +3 -4
  10. package/dist/generators/index.js +3 -4
  11. package/dist/generators/project.d.ts +3 -2
  12. package/dist/generators/project.js +5 -4
  13. package/dist/generators/react.d.ts +4 -2
  14. package/dist/generators/react.js +10 -30
  15. package/dist/generators/vue.d.ts +4 -2
  16. package/dist/generators/vue.js +10 -31
  17. package/dist/index.d.ts +0 -1
  18. package/dist/index.js +21 -3
  19. package/dist/test.d.ts +5 -2
  20. package/dist/test.js +252 -206
  21. package/dist/types/ejs.d.ts +0 -1
  22. package/dist/types/ejs.js +0 -1
  23. package/dist/types/features.d.ts +0 -1
  24. package/dist/types/features.js +0 -1
  25. package/dist/types/index.d.ts +2 -4
  26. package/dist/types/index.js +2 -4
  27. package/dist/types/packageJson.d.ts +24 -0
  28. package/dist/types/packageJson.js +4 -0
  29. package/dist/types/viteConfig.d.ts +11 -9
  30. package/dist/types/viteConfig.js +0 -1
  31. package/dist/utils/deepMerge.d.ts +3 -1
  32. package/dist/utils/deepMerge.js +8 -1
  33. package/dist/utils/ejs.d.ts +3 -2
  34. package/dist/utils/ejs.js +2 -1
  35. package/dist/utils/featureMapping.d.ts +44 -0
  36. package/dist/utils/featureMapping.js +119 -0
  37. package/dist/utils/file.d.ts +22 -2
  38. package/dist/utils/file.js +35 -2
  39. package/dist/utils/generateFrameworkProject.d.ts +27 -0
  40. package/dist/utils/generateFrameworkProject.js +47 -0
  41. package/dist/utils/index.d.ts +11 -9
  42. package/dist/utils/index.js +11 -9
  43. package/dist/utils/install.d.ts +7 -4
  44. package/dist/utils/install.js +55 -12
  45. package/dist/utils/npmConfig.d.ts +15 -0
  46. package/dist/utils/npmConfig.js +79 -0
  47. package/dist/utils/prompts.d.ts +3 -2
  48. package/dist/utils/prompts.js +51 -5
  49. package/dist/utils/renderFeatures.d.ts +3 -2
  50. package/dist/utils/renderFeatures.js +41 -37
  51. package/dist/utils/renderTemplate.d.ts +13 -1
  52. package/dist/utils/renderTemplate.js +128 -61
  53. package/dist/utils/sortDependencies.d.ts +3 -2
  54. package/dist/utils/sortDependencies.js +3 -2
  55. package/dist/utils/viteConfigRender.d.ts +11 -14
  56. package/dist/utils/viteConfigRender.js +10 -173
  57. package/package.json +6 -3
  58. package/templates/common/base/.env +7 -7
  59. package/templates/common/base/.env.development +5 -5
  60. package/templates/common/base/.env.production +5 -5
  61. package/templates/common/base/package.json +23 -27
  62. package/templates/common/base/scripts/build.mts +37 -31
  63. package/templates/common/base/src/apis/index.ts +8 -8
  64. package/templates/common/base/src/apis/request.ts +43 -43
  65. package/templates/common/base/src/apis/services/example.ts +61 -40
  66. package/templates/common/base/src/apis/services/user.ts +33 -23
  67. package/templates/common/base/src/apis/types/common.ts +43 -28
  68. package/templates/common/base/src/apis/types/example.ts +15 -3
  69. package/templates/common/base/src/apis/types/index.ts +7 -7
  70. package/templates/common/base/src/apis/types/user.ts +39 -24
  71. package/templates/common/base/src/assets/fonts/index.css +7 -7
  72. package/templates/common/base/src/assets/styles/base.scss +72 -72
  73. package/templates/common/base/src/assets/styles/custom.scss +7 -7
  74. package/templates/common/base/src/assets/styles/tailwind.scss +6 -6
  75. package/templates/common/base/src/constants/index.ts +29 -29
  76. package/templates/common/base/src/utils/index.ts +88 -83
  77. package/templates/{vue/base/vite.config.ts → common/base/vite.config.ts.ejs} +28 -11
  78. package/templates/common/features/husky/.cz-config.cjs +35 -35
  79. package/templates/common/features/husky/commitlint.config.ts +32 -32
  80. package/templates/common/features/husky/node_modules/.bin/commitizen +17 -0
  81. package/templates/common/features/husky/node_modules/.bin/commitizen.CMD +12 -0
  82. package/templates/common/features/husky/node_modules/.bin/commitizen.ps1 +41 -0
  83. package/templates/common/features/husky/node_modules/.bin/commitlint +17 -0
  84. package/templates/common/features/husky/node_modules/.bin/commitlint.CMD +12 -0
  85. package/templates/common/features/husky/node_modules/.bin/commitlint.ps1 +41 -0
  86. package/templates/common/features/husky/node_modules/.bin/cz +17 -0
  87. package/templates/common/features/husky/node_modules/.bin/cz-cust +17 -0
  88. package/templates/common/features/husky/node_modules/.bin/cz-cust.CMD +12 -0
  89. package/templates/common/features/husky/node_modules/.bin/cz-cust.ps1 +41 -0
  90. package/templates/common/features/husky/node_modules/.bin/cz-customizable +17 -0
  91. package/templates/common/features/husky/node_modules/.bin/cz-customizable.CMD +12 -0
  92. package/templates/common/features/husky/node_modules/.bin/cz-customizable.ps1 +41 -0
  93. package/templates/common/features/husky/node_modules/.bin/cz.CMD +12 -0
  94. package/templates/common/features/husky/node_modules/.bin/cz.ps1 +41 -0
  95. package/templates/common/features/husky/node_modules/.bin/git-cz +17 -0
  96. package/templates/common/features/husky/node_modules/.bin/git-cz.CMD +12 -0
  97. package/templates/common/features/husky/node_modules/.bin/git-cz.ps1 +41 -0
  98. package/templates/common/features/husky/node_modules/.bin/husky +17 -0
  99. package/templates/common/features/husky/node_modules/.bin/husky.CMD +12 -0
  100. package/templates/common/features/husky/node_modules/.bin/husky.ps1 +41 -0
  101. package/templates/common/features/husky/node_modules/.bin/lint-staged +17 -0
  102. package/templates/common/features/husky/node_modules/.bin/lint-staged.CMD +12 -0
  103. package/templates/common/features/husky/node_modules/.bin/lint-staged.ps1 +41 -0
  104. package/templates/common/features/husky/package.json +6 -6
  105. package/templates/react/base/env.d.ts +19 -19
  106. package/templates/react/base/index.html +14 -14
  107. package/templates/react/base/node_modules/.bin/vite +17 -0
  108. package/templates/react/base/node_modules/.bin/vite.CMD +12 -0
  109. package/templates/react/base/node_modules/.bin/vite.ps1 +41 -0
  110. package/templates/react/base/package.json +18 -15
  111. package/templates/react/base/src/App.tsx +18 -18
  112. package/templates/react/base/src/assets/styles/main.scss +8 -8
  113. package/templates/react/base/src/pages/about/index.tsx +14 -14
  114. package/templates/react/base/src/pages/home/index.tsx +14 -14
  115. package/templates/react/base/tsconfig.app.json +17 -17
  116. package/templates/react/base/tsconfig.base.json +23 -23
  117. package/templates/react/base/tsconfig.json +12 -12
  118. package/templates/react/base/tsconfig.node.json +15 -15
  119. package/templates/react/features/ant-design/package.json +6 -7
  120. package/templates/react/features/eslint/node_modules/.bin/eslint +17 -0
  121. package/templates/react/features/eslint/node_modules/.bin/eslint.CMD +12 -0
  122. package/templates/react/features/eslint/node_modules/.bin/eslint.ps1 +41 -0
  123. package/templates/react/features/eslint/package.json +3 -3
  124. package/templates/react/features/i18n/package.json +6 -7
  125. package/templates/react/features/i18n/src/locales/index.ts +7 -0
  126. package/templates/{common/base → react/features/i18n}/src/locales/lang/en.ts +30 -30
  127. package/templates/{common/base → react/features/i18n}/src/locales/lang/es.ts +30 -30
  128. package/templates/{common/base → react/features/i18n}/src/locales/lang/zh.ts +30 -30
  129. package/templates/react/features/manualRoutes/src/router/routes.tsx +13 -0
  130. package/templates/react/features/pageRoutes/package.json +1 -2
  131. package/templates/react/features/router/package.json +1 -1
  132. package/templates/react/features/sentry/package.json +6 -7
  133. package/templates/react/features/sentry/src/utils/sentry.ts +10 -0
  134. package/templates/react/features/zustand/package.json +1 -1
  135. package/templates/react/features/zustand/src/stores/user.ts +42 -6
  136. package/templates/react/features/zustand/src/types/stores.ts +8 -1
  137. package/templates/vue/base/env.d.ts +27 -27
  138. package/templates/vue/base/index.html +14 -14
  139. package/templates/vue/base/node_modules/.bin/vite +17 -0
  140. package/templates/vue/base/node_modules/.bin/vite.CMD +12 -0
  141. package/templates/vue/base/node_modules/.bin/vite.ps1 +41 -0
  142. package/templates/vue/base/node_modules/.bin/vue-tsc +17 -0
  143. package/templates/vue/base/node_modules/.bin/vue-tsc.CMD +12 -0
  144. package/templates/vue/base/node_modules/.bin/vue-tsc.ps1 +41 -0
  145. package/templates/vue/base/package.json +16 -13
  146. package/templates/vue/base/src/App.vue +13 -13
  147. package/templates/vue/base/src/assets/styles/main.scss +9 -9
  148. package/templates/vue/base/src/directives/index.ts +36 -36
  149. package/templates/vue/base/src/layouts/index.ts +5 -7
  150. package/templates/vue/base/src/pages/about/index.vue +31 -31
  151. package/templates/vue/base/src/pages/home/index.vue +31 -31
  152. package/templates/vue/base/tsconfig.app.json +17 -17
  153. package/templates/vue/base/tsconfig.base.json +23 -23
  154. package/templates/vue/base/tsconfig.json +12 -12
  155. package/templates/vue/base/tsconfig.node.json +15 -15
  156. package/templates/vue/features/ant-design-vue/package.json +6 -7
  157. package/templates/vue/{base → features/ant-design-vue}/src/layouts/AntDesign.vue +86 -86
  158. package/templates/vue/features/element-plus/package.json +6 -7
  159. package/templates/vue/{base → features/element-plus}/src/assets/styles/element/index.scss +27 -27
  160. package/templates/vue/features/element-plus/src/components/SubMenu/index.ts +9 -0
  161. package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/index.ts +6 -6
  162. package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/_types/props.ts +11 -11
  163. package/templates/vue/{base → features/element-plus}/src/components/SubMenu/src/index.vue +24 -24
  164. package/templates/vue/{base → features/element-plus}/src/layouts/element.vue +81 -81
  165. package/templates/vue/features/eslint/node_modules/.bin/eslint +17 -0
  166. package/templates/vue/features/eslint/node_modules/.bin/eslint.CMD +12 -0
  167. package/templates/vue/features/eslint/node_modules/.bin/eslint.ps1 +41 -0
  168. package/templates/vue/features/eslint/package.json +3 -3
  169. package/templates/vue/features/i18n/package.json +5 -5
  170. package/templates/vue/features/i18n/src/locales/index.ts +23 -16
  171. package/templates/vue/features/i18n/src/locales/lang/en.ts +30 -0
  172. package/templates/vue/features/i18n/src/locales/lang/es.ts +30 -0
  173. package/templates/vue/features/i18n/src/locales/lang/zh.ts +30 -0
  174. package/templates/vue/features/manualRoutes/src/router/routes.ts +35 -27
  175. package/templates/vue/features/pageRoutes/package.json +5 -5
  176. package/templates/vue/features/pinia/package.json +3 -2
  177. package/templates/vue/features/pinia/src/stores/index.ts +8 -0
  178. package/templates/vue/features/pinia/src/stores/system.ts +60 -0
  179. package/templates/vue/features/pinia/src/stores/user.ts +33 -13
  180. package/templates/vue/features/qiankun/package.json +5 -5
  181. package/templates/vue/features/qiankun/src/qiankun/index.ts +19 -0
  182. package/templates/vue/features/router/package.json +1 -1
  183. package/templates/vue/features/sentry/package.json +6 -6
  184. package/templates/vue/features/sentry/src/utils/sentry.ts +12 -0
  185. package/dist/commands/create.d.ts.map +0 -1
  186. package/dist/commands/create.js.map +0 -1
  187. package/dist/commands/index.d.ts.map +0 -1
  188. package/dist/commands/index.js.map +0 -1
  189. package/dist/generators/index.d.ts.map +0 -1
  190. package/dist/generators/index.js.map +0 -1
  191. package/dist/generators/project.d.ts.map +0 -1
  192. package/dist/generators/project.js.map +0 -1
  193. package/dist/generators/react.d.ts.map +0 -1
  194. package/dist/generators/react.js.map +0 -1
  195. package/dist/generators/vue.d.ts.map +0 -1
  196. package/dist/generators/vue.js.map +0 -1
  197. package/dist/index.d.ts.map +0 -1
  198. package/dist/index.js.map +0 -1
  199. package/dist/test.d.ts.map +0 -1
  200. package/dist/test.js.map +0 -1
  201. package/dist/types/ejs.d.ts.map +0 -1
  202. package/dist/types/ejs.js.map +0 -1
  203. package/dist/types/features.d.ts.map +0 -1
  204. package/dist/types/features.js.map +0 -1
  205. package/dist/types/index.d.ts.map +0 -1
  206. package/dist/types/index.js.map +0 -1
  207. package/dist/types/viteConfig.d.ts.map +0 -1
  208. package/dist/types/viteConfig.js.map +0 -1
  209. package/dist/utils/deepMerge.d.ts.map +0 -1
  210. package/dist/utils/deepMerge.js.map +0 -1
  211. package/dist/utils/ejs.d.ts.map +0 -1
  212. package/dist/utils/ejs.js.map +0 -1
  213. package/dist/utils/file.d.ts.map +0 -1
  214. package/dist/utils/file.js.map +0 -1
  215. package/dist/utils/index.d.ts.map +0 -1
  216. package/dist/utils/index.js.map +0 -1
  217. package/dist/utils/install.d.ts.map +0 -1
  218. package/dist/utils/install.js.map +0 -1
  219. package/dist/utils/prompts.d.ts.map +0 -1
  220. package/dist/utils/prompts.js.map +0 -1
  221. package/dist/utils/renderFeatures.d.ts.map +0 -1
  222. package/dist/utils/renderFeatures.js.map +0 -1
  223. package/dist/utils/renderTemplate.d.ts.map +0 -1
  224. package/dist/utils/renderTemplate.js.map +0 -1
  225. package/dist/utils/sortDependencies.d.ts.map +0 -1
  226. package/dist/utils/sortDependencies.js.map +0 -1
  227. package/dist/utils/viteConfigRender.d.ts.map +0 -1
  228. package/dist/utils/viteConfigRender.js.map +0 -1
  229. package/templates/common/base/pnpm-workspace.yaml +0 -37
  230. package/templates/common/features/husky/pnpm-workspace.yaml +0 -9
  231. package/templates/react/base/pnpm-workspace.yaml +0 -9
  232. package/templates/react/base/src/stores/user.ts +0 -39
  233. package/templates/react/base/vite.config.ts +0 -52
  234. package/templates/react/features/ant-design/pnpm-workspace.yaml +0 -5
  235. package/templates/react/features/eslint/pnpm-workspace.yaml +0 -6
  236. package/templates/react/features/i18n/pnpm-workspace.yaml +0 -5
  237. package/templates/react/features/pageRoutes/pnpm-workspace.yaml +0 -4
  238. package/templates/react/features/pageRoutes/vite.config.data.ts +0 -10
  239. package/templates/react/features/router/pnpm-workspace.yaml +0 -3
  240. package/templates/react/features/sentry/pnpm-workspace.yaml +0 -5
  241. package/templates/react/features/sentry/vite.config.data.ts +0 -23
  242. package/templates/react/features/zustand/pnpm-workspace.yaml +0 -3
  243. package/templates/vue/base/pnpm-workspace.yaml +0 -6
  244. package/templates/vue/base/src/components/SubMenu/index.ts +0 -9
  245. package/templates/vue/base/src/stores/index.ts +0 -16
  246. package/templates/vue/base/src/stores/modules/system.ts +0 -52
  247. package/templates/vue/base/src/stores/modules/user.ts +0 -48
  248. package/templates/vue/features/ant-design-vue/pnpm-workspace.yaml +0 -5
  249. package/templates/vue/features/element-plus/pnpm-workspace.yaml +0 -5
  250. package/templates/vue/features/element-plus/vite.config.data.ts +0 -15
  251. package/templates/vue/features/eslint/pnpm-workspace.yaml +0 -6
  252. package/templates/vue/features/i18n/pnpm-workspace.yaml +0 -3
  253. package/templates/vue/features/pageRoutes/pnpm-workspace.yaml +0 -4
  254. package/templates/vue/features/pageRoutes/vite.config.data.ts +0 -9
  255. package/templates/vue/features/pinia/pnpm-workspace.yaml +0 -4
  256. package/templates/vue/features/qiankun/pnpm-workspace.yaml +0 -3
  257. package/templates/vue/features/router/pnpm-workspace.yaml +0 -3
  258. package/templates/vue/features/sentry/pnpm-workspace.yaml +0 -4
  259. package/templates/vue/features/sentry/vite.config.data.ts +0 -23
@@ -1,7 +1,7 @@
1
- /**
2
- * 自定义样式
3
- * 项目特定的全局样式
4
- */
5
-
6
- // 可在此添加项目特定的全局样式
7
-
1
+ /**
2
+ * 自定义样式
3
+ * 项目特定的全局样式
4
+ */
5
+
6
+ // 可在此添加项目特定的全局样式
7
+
@@ -1,6 +1,6 @@
1
- /**
2
- * Tailwind CSS 配置
3
- */
4
-
5
- @import 'tailwindcss';
6
-
1
+ /**
2
+ * Tailwind CSS 配置
3
+ */
4
+
5
+ @import 'tailwindcss';
6
+
@@ -1,29 +1,29 @@
1
- /**
2
- * 常量定义
3
- * 项目通用常量
4
- */
5
-
6
- /** 本地存储键名 */
7
- export const STORAGE_KEYS = {
8
- TOKEN: 'token',
9
- USER_INFO: 'userInfo',
10
- LANGUAGE: 'language',
11
- THEME: 'theme',
12
- } as const;
13
-
14
- /** 响应码 */
15
- export const RESPONSE_CODE = {
16
- SUCCESS: 200,
17
- UNAUTHORIZED: 401,
18
- FORBIDDEN: 403,
19
- NOT_FOUND: 404,
20
- SERVER_ERROR: 500,
21
- } as const;
22
-
23
- /** 分页默认配置 */
24
- export const PAGINATION = {
25
- DEFAULT_PAGE: 1,
26
- DEFAULT_PAGE_SIZE: 10,
27
- PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
28
- } as const;
29
-
1
+ /**
2
+ * 常量定义
3
+ * 项目通用常量
4
+ */
5
+
6
+ /** 本地存储键名 */
7
+ export const STORAGE_KEYS = {
8
+ TOKEN: 'token',
9
+ USER_INFO: 'userInfo',
10
+ LANGUAGE: 'language',
11
+ THEME: 'theme',
12
+ } as const;
13
+
14
+ /** 响应码 */
15
+ export const RESPONSE_CODE = {
16
+ SUCCESS: 200,
17
+ UNAUTHORIZED: 401,
18
+ FORBIDDEN: 403,
19
+ NOT_FOUND: 404,
20
+ SERVER_ERROR: 500,
21
+ } as const;
22
+
23
+ /** 分页默认配置 */
24
+ export const PAGINATION = {
25
+ DEFAULT_PAGE: 1,
26
+ DEFAULT_PAGE_SIZE: 10,
27
+ PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
28
+ } as const;
29
+
@@ -1,83 +1,88 @@
1
- /**
2
- * 工具函数
3
- * 通用工具方法
4
- */
5
-
6
- /**
7
- * 延迟执行
8
- * @param ms 延迟毫秒数
9
- */
10
- export function sleep(ms: number): Promise<void> {
11
- return new Promise((resolve) => setTimeout(resolve, ms));
12
- }
13
-
14
- /**
15
- * 深拷贝
16
- * @param obj 要拷贝的对象
17
- */
18
- export function deepClone<T>(obj: T): T {
19
- return JSON.parse(JSON.stringify(obj));
20
- }
21
-
22
- /**
23
- * 防抖函数
24
- * @param fn 要防抖的函数
25
- * @param delay 延迟时间
26
- */
27
- export function debounce<T extends (...args: unknown[]) => unknown>(
28
- fn: T,
29
- delay: number
30
- ): (...args: Parameters<T>) => void {
31
- let timer: ReturnType<typeof setTimeout> | null = null;
32
- return function (this: unknown, ...args: Parameters<T>) {
33
- if (timer) {
34
- clearTimeout(timer);
35
- }
36
- timer = setTimeout(() => {
37
- fn.apply(this, args);
38
- }, delay);
39
- };
40
- }
41
-
42
- /**
43
- * 节流函数
44
- * @param fn 要节流的函数
45
- * @param delay 间隔时间
46
- */
47
- export function throttle<T extends (...args: unknown[]) => unknown>(
48
- fn: T,
49
- delay: number
50
- ): (...args: Parameters<T>) => void {
51
- let lastTime = 0;
52
- return function (this: unknown, ...args: Parameters<T>) {
53
- const now = Date.now();
54
- if (now - lastTime >= delay) {
55
- lastTime = now;
56
- fn.apply(this, args);
57
- }
58
- };
59
- }
60
-
61
- /**
62
- * 格式化日期
63
- * @param date 日期
64
- * @param format 格式
65
- */
66
- export function formatDate(date: Date | string | number, format = 'YYYY-MM-DD HH:mm:ss'): string {
67
- const d = new Date(date);
68
- const year = d.getFullYear();
69
- const month = String(d.getMonth() + 1).padStart(2, '0');
70
- const day = String(d.getDate()).padStart(2, '0');
71
- const hours = String(d.getHours()).padStart(2, '0');
72
- const minutes = String(d.getMinutes()).padStart(2, '0');
73
- const seconds = String(d.getSeconds()).padStart(2, '0');
74
-
75
- return format
76
- .replace('YYYY', String(year))
77
- .replace('MM', month)
78
- .replace('DD', day)
79
- .replace('HH', hours)
80
- .replace('mm', minutes)
81
- .replace('ss', seconds);
82
- }
83
-
1
+ /**
2
+ * 工具函数
3
+ * 通用工具方法
4
+ */
5
+
6
+ /**
7
+ * 延迟执行
8
+ * @param ms 延迟毫秒数
9
+ * @returns Promise,在指定时间后 resolve
10
+ */
11
+ export function sleep(ms: number): Promise<void> {
12
+ return new Promise((resolve) => setTimeout(resolve, ms));
13
+ }
14
+
15
+ /**
16
+ * 深拷贝
17
+ * @param obj 要拷贝的对象
18
+ * @returns 深拷贝后的新对象
19
+ */
20
+ export function deepClone<T>(obj: T): T {
21
+ return JSON.parse(JSON.stringify(obj));
22
+ }
23
+
24
+ /**
25
+ * 防抖函数
26
+ * @param fn 要防抖的函数
27
+ * @param delay 延迟时间(毫秒)
28
+ * @returns 防抖后的函数
29
+ */
30
+ export function debounce<T extends (...args: unknown[]) => unknown>(
31
+ fn: T,
32
+ delay: number
33
+ ): (...args: Parameters<T>) => void {
34
+ let timer: ReturnType<typeof setTimeout> | null = null;
35
+ return function (this: unknown, ...args: Parameters<T>) {
36
+ if (timer) {
37
+ clearTimeout(timer);
38
+ }
39
+ timer = setTimeout(() => {
40
+ fn.apply(this, args);
41
+ }, delay);
42
+ };
43
+ }
44
+
45
+ /**
46
+ * 节流函数
47
+ * @param fn 要节流的函数
48
+ * @param delay 间隔时间(毫秒)
49
+ * @returns 节流后的函数
50
+ */
51
+ export function throttle<T extends (...args: unknown[]) => unknown>(
52
+ fn: T,
53
+ delay: number
54
+ ): (...args: Parameters<T>) => void {
55
+ let lastTime = 0;
56
+ return function (this: unknown, ...args: Parameters<T>) {
57
+ const now = Date.now();
58
+ if (now - lastTime >= delay) {
59
+ lastTime = now;
60
+ fn.apply(this, args);
61
+ }
62
+ };
63
+ }
64
+
65
+ /**
66
+ * 格式化日期
67
+ * @param date 日期(Date 对象、时间戳或日期字符串)
68
+ * @param format 格式字符串,默认为 'YYYY-MM-DD HH:mm:ss'
69
+ * @returns 格式化后的日期字符串
70
+ */
71
+ export function formatDate(date: Date | string | number, format = 'YYYY-MM-DD HH:mm:ss'): string {
72
+ const d = new Date(date);
73
+ const year = d.getFullYear();
74
+ const month = String(d.getMonth() + 1).padStart(2, '0');
75
+ const day = String(d.getDate()).padStart(2, '0');
76
+ const hours = String(d.getHours()).padStart(2, '0');
77
+ const minutes = String(d.getMinutes()).padStart(2, '0');
78
+ const seconds = String(d.getSeconds()).padStart(2, '0');
79
+
80
+ return format
81
+ .replace('YYYY', String(year))
82
+ .replace('MM', month)
83
+ .replace('DD', day)
84
+ .replace('HH', hours)
85
+ .replace('mm', minutes)
86
+ .replace('ss', seconds);
87
+ }
88
+
@@ -1,13 +1,11 @@
1
- /**
2
- * Vite 配置文件
3
- * 基于 @moluoxixi/vite-config 的配置
4
- */
5
-
6
1
  import path from 'node:path'
7
2
  import process from 'node:process'
8
3
  import cssModuleGlobalRootPlugin from '@moluoxixi/css-module-global-root-plugin'
9
4
  import { ViteConfig, wrapperEnv } from '@moluoxixi/vite-config'
10
5
  import { loadEnv } from 'vite'
6
+ <% if (sentry) { -%>
7
+ import { sentryVitePlugin } from '@sentry/vite-plugin'
8
+ <% } -%>
11
9
 
12
10
  export default ViteConfig(
13
11
  ({ mode }) => {
@@ -17,15 +15,39 @@ export default ViteConfig(
17
15
  const appCode = viteEnv.VITE_APP_CODE
18
16
  const appTitle = viteEnv.VITE_APP_TITLE
19
17
  const port = viteEnv.VITE_APP_PORT
18
+
20
19
  return {
21
20
  rootPath,
22
21
  appTitle,
23
22
  appCode,
24
23
  port,
24
+ <% if (framework === 'vue') { -%>
25
25
  vue: true,
26
26
  autoComponent: true,
27
+ <% } else if (framework === 'react') { -%>
28
+ react: true,
29
+ <% } -%>
30
+ <% if (routeMode === 'file-system') { -%>
31
+ pageRoutes: true,
32
+ <% } -%>
27
33
  viteConfig: {
28
- plugins: [],
34
+ plugins: [
35
+ cssModuleGlobalRootPlugin() as any,
36
+ <% if (sentry) { -%>
37
+ viteEnv.VITE_SENTRY && mode === 'production' && sentryVitePlugin({
38
+ authToken: process.env.SENTRY_AUTH_TOKEN,
39
+ org: 'f1f562b9b82f',
40
+ project: 'javascript-<%= framework %>',
41
+ sourcemaps: {
42
+ assets: './dist/**',
43
+ ignore: ['node_modules'],
44
+ },
45
+ release: {
46
+ name: viteEnv.VITE_APP_VERSION || 'unknown',
47
+ },
48
+ }),
49
+ <% } -%>
50
+ ],
29
51
  server: {
30
52
  proxy: {
31
53
  '/api': {
@@ -35,11 +57,6 @@ export default ViteConfig(
35
57
  },
36
58
  },
37
59
  css: {
38
- postcss: {
39
- plugins: [
40
- cssModuleGlobalRootPlugin,
41
- ],
42
- },
43
60
  preprocessorOptions: {
44
61
  scss: {
45
62
  silenceDeprecations: ['legacy-js-api'],
@@ -1,35 +1,35 @@
1
- /**
2
- * Commitizen 自定义配置
3
- * 定义 commit 类型和提交规范
4
- */
5
-
6
- module.exports = {
7
- types: [
8
- { value: 'feat', name: 'feat: ✨ 新功能' },
9
- { value: 'fix', name: 'fix: 🐛 修复 Bug' },
10
- { value: 'docs', name: 'docs: 📝 文档更新' },
11
- { value: 'style', name: 'style: 💄 代码格式(不影响功能)' },
12
- { value: 'refactor', name: 'refactor: ♻️ 代码重构' },
13
- { value: 'perf', name: 'perf: ⚡ 性能优化' },
14
- { value: 'test', name: 'test: ✅ 测试相关' },
15
- { value: 'build', name: 'build: 📦 构建相关' },
16
- { value: 'ci', name: 'ci: 🔧 CI 配置' },
17
- { value: 'chore', name: 'chore: 🔨 其他修改' },
18
- { value: 'revert', name: 'revert: ⏪ 回退' },
19
- ],
20
- scopes: [],
21
- messages: {
22
- type: '请选择提交类型:',
23
- scope: '请输入修改范围(可选):',
24
- customScope: '请输入自定义修改范围:',
25
- subject: '请简要描述提交(必填):',
26
- body: '请输入详细描述(可选):',
27
- breaking: '列出任何破坏性变更(可选):',
28
- footer: '请输入要关闭的 issue(可选):',
29
- confirmCommit: '确认使用以上信息提交?',
30
- },
31
- allowCustomScopes: true,
32
- allowBreakingChanges: ['feat', 'fix'],
33
- skipQuestions: ['scope', 'body', 'breaking', 'footer'],
34
- subjectLimit: 100,
35
- }
1
+ /**
2
+ * Commitizen 自定义配置
3
+ * 定义 commit 类型和提交规范
4
+ */
5
+
6
+ module.exports = {
7
+ types: [
8
+ { value: 'feat', name: 'feat: ✨ 新功能' },
9
+ { value: 'fix', name: 'fix: 🐛 修复 Bug' },
10
+ { value: 'docs', name: 'docs: 📝 文档更新' },
11
+ { value: 'style', name: 'style: 💄 代码格式(不影响功能)' },
12
+ { value: 'refactor', name: 'refactor: ♻️ 代码重构' },
13
+ { value: 'perf', name: 'perf: ⚡ 性能优化' },
14
+ { value: 'test', name: 'test: ✅ 测试相关' },
15
+ { value: 'build', name: 'build: 📦 构建相关' },
16
+ { value: 'ci', name: 'ci: 🔧 CI 配置' },
17
+ { value: 'chore', name: 'chore: 🔨 其他修改' },
18
+ { value: 'revert', name: 'revert: ⏪ 回退' },
19
+ ],
20
+ scopes: [],
21
+ messages: {
22
+ type: '请选择提交类型:',
23
+ scope: '请输入修改范围(可选):',
24
+ customScope: '请输入自定义修改范围:',
25
+ subject: '请简要描述提交(必填):',
26
+ body: '请输入详细描述(可选):',
27
+ breaking: '列出任何破坏性变更(可选):',
28
+ footer: '请输入要关闭的 issue(可选):',
29
+ confirmCommit: '确认使用以上信息提交?',
30
+ },
31
+ allowCustomScopes: true,
32
+ allowBreakingChanges: ['feat', 'fix'],
33
+ skipQuestions: ['scope', 'body', 'breaking', 'footer'],
34
+ subjectLimit: 100,
35
+ }
@@ -1,32 +1,32 @@
1
- /**
2
- * Commitlint 配置
3
- * 验证 commit message 格式
4
- */
5
-
6
- import type { UserConfig } from '@commitlint/types'
7
-
8
- const config: UserConfig = {
9
- extends: ['@commitlint/config-conventional'],
10
- rules: {
11
- 'type-enum': [
12
- 2,
13
- 'always',
14
- [
15
- 'feat',
16
- 'fix',
17
- 'docs',
18
- 'style',
19
- 'refactor',
20
- 'perf',
21
- 'test',
22
- 'build',
23
- 'ci',
24
- 'chore',
25
- 'revert',
26
- ],
27
- ],
28
- 'subject-case': [0],
29
- },
30
- }
31
-
32
- export default config
1
+ /**
2
+ * Commitlint 配置
3
+ * 验证 commit message 格式
4
+ */
5
+
6
+ import type { UserConfig } from '@commitlint/types'
7
+
8
+ const config: UserConfig = {
9
+ extends: ['@commitlint/config-conventional'],
10
+ rules: {
11
+ 'type-enum': [
12
+ 2,
13
+ 'always',
14
+ [
15
+ 'feat',
16
+ 'fix',
17
+ 'docs',
18
+ 'style',
19
+ 'refactor',
20
+ 'perf',
21
+ 'test',
22
+ 'build',
23
+ 'ci',
24
+ 'chore',
25
+ 'revert',
26
+ ],
27
+ ],
28
+ 'subject-case': [0],
29
+ },
30
+ }
31
+
32
+ export default config
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../commitizen/bin/commitizen" "$@"
15
+ else
16
+ exec node "$basedir/../commitizen/bin/commitizen" "$@"
17
+ fi
@@ -0,0 +1,12 @@
1
+ @SETLOCAL
2
+ @IF NOT DEFINED NODE_PATH (
3
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules\commitizen\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules\commitizen\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
4
+ ) ELSE (
5
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules\commitizen\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules\commitizen\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
+ )
7
+ @IF EXIST "%~dp0\node.exe" (
8
+ "%~dp0\node.exe" "%~dp0\..\commitizen\bin\commitizen" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\commitizen\bin\commitizen" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules\commitizen\bin\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules\commitizen\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../commitizen/bin/commitizen" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../commitizen/bin/commitizen" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../commitizen/bin/commitizen" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../commitizen/bin/commitizen" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules/@commitlint/cli/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules/@commitlint/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules/@commitlint/cli/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules/@commitlint/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../@commitlint/cli/cli.js" "$@"
15
+ else
16
+ exec node "$basedir/../@commitlint/cli/cli.js" "$@"
17
+ fi
@@ -0,0 +1,12 @@
1
+ @SETLOCAL
2
+ @IF NOT DEFINED NODE_PATH (
3
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules\@commitlint\cli\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules\@commitlint\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
4
+ ) ELSE (
5
+ @SET "NODE_PATH=E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules\@commitlint\cli\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules\@commitlint\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
+ )
7
+ @IF EXIST "%~dp0\node.exe" (
8
+ "%~dp0\node.exe" "%~dp0\..\@commitlint\cli\cli.js" %*
9
+ ) ELSE (
10
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
11
+ node "%~dp0\..\@commitlint\cli\cli.js" %*
12
+ )
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ $pathsep=":"
6
+ $env_node_path=$env:NODE_PATH
7
+ $new_node_path="E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules\@commitlint\cli\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules\@commitlint\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3\node_modules;E:\project\template\vite-cli\node_modules\.pnpm\node_modules"
8
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
+ # Fix case when both the Windows and Linux builds of Node
10
+ # are installed in the same directory
11
+ $exe=".exe"
12
+ $pathsep=";"
13
+ } else {
14
+ $new_node_path="/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules/@commitlint/cli/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules/@commitlint/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/@commitlint+cli@19.8.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
15
+ }
16
+ if ([string]::IsNullOrEmpty($env_node_path)) {
17
+ $env:NODE_PATH=$new_node_path
18
+ } else {
19
+ $env:NODE_PATH="$new_node_path$pathsep$env_node_path"
20
+ }
21
+
22
+ $ret=0
23
+ if (Test-Path "$basedir/node$exe") {
24
+ # Support pipeline input
25
+ if ($MyInvocation.ExpectingInput) {
26
+ $input | & "$basedir/node$exe" "$basedir/../@commitlint/cli/cli.js" $args
27
+ } else {
28
+ & "$basedir/node$exe" "$basedir/../@commitlint/cli/cli.js" $args
29
+ }
30
+ $ret=$LASTEXITCODE
31
+ } else {
32
+ # Support pipeline input
33
+ if ($MyInvocation.ExpectingInput) {
34
+ $input | & "node$exe" "$basedir/../@commitlint/cli/cli.js" $args
35
+ } else {
36
+ & "node$exe" "$basedir/../@commitlint/cli/cli.js" $args
37
+ }
38
+ $ret=$LASTEXITCODE
39
+ }
40
+ $env:NODE_PATH=$env_node_path
41
+ exit $ret
@@ -0,0 +1,17 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6
+ esac
7
+
8
+ if [ -z "$NODE_PATH" ]; then
9
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules"
10
+ else
11
+ export NODE_PATH="/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/bin/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules/commitizen/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/commitizen@4.3.1_@types+node@22.19.3_typescript@5.8.3/node_modules:/mnt/e/project/template/vite-cli/node_modules/.pnpm/node_modules:$NODE_PATH"
12
+ fi
13
+ if [ -x "$basedir/node" ]; then
14
+ exec "$basedir/node" "$basedir/../commitizen/bin/git-cz" "$@"
15
+ else
16
+ exec node "$basedir/../commitizen/bin/git-cz" "$@"
17
+ fi