af-mobile-client-vue3 1.4.68 → 1.4.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__dummy__ +9 -9
- package/build/vite/optimize.ts +36 -36
- package/package.json +120 -121
- package/public/favicon.svg +4 -4
- package/scripts/verifyCommit.js +19 -19
- package/src/components/common/MateChat/components/MateChatContent.vue +274 -274
- package/src/components/common/MateChat/components/MateChatHeader.vue +337 -337
- package/src/components/common/MateChat/index.vue +444 -444
- package/src/components/common/MateChat/types.ts +247 -247
- package/src/components/common/otherCharge/ChargePrintSelectorAndRemarks.vue +137 -137
- package/src/components/common/otherCharge/CodePayment.vue +357 -357
- package/src/components/common/otherCharge/FileUploader.vue +602 -602
- package/src/components/common/otherCharge/GridFileUploader.vue +846 -846
- package/src/components/common/otherCharge/PaymentMethodSelector.vue +202 -202
- package/src/components/common/otherCharge/PaymentMethodSelectorCard.vue +45 -45
- package/src/components/common/otherCharge/ReceiptModal.vue +273 -273
- package/src/components/common/otherCharge/index.ts +43 -43
- package/src/components/core/ImageUploader/index.vue +9 -2
- package/src/components/data/OtherCharge/OtherChargeItemModal.vue +547 -547
- package/src/components/data/UserDetail/types.ts +1 -1
- package/src/components/data/XReportGrid/XAddReport/index.ts +1 -1
- package/src/components/data/XReportGrid/XReportDrawer/index.ts +1 -1
- package/src/components/data/XTag/index.vue +10 -10
- package/src/components/layout/TabBarLayout/index.vue +40 -40
- package/src/hooks/useCommon.ts +9 -9
- package/src/plugins/AppData.ts +38 -38
- package/src/router/invoiceRoutes.ts +33 -33
- package/src/services/api/common.ts +109 -109
- package/src/services/api/manage.ts +8 -8
- package/src/services/api/search.ts +16 -16
- package/src/services/restTools.ts +56 -56
- package/src/utils/authority-utils.ts +84 -84
- package/src/utils/crypto.ts +39 -39
- package/src/utils/queryFormDefaultRangePicker.ts +57 -57
- package/src/utils/runEvalFunction.ts +13 -13
- package/src/views/component/EvaluateRecordView/index.vue +40 -40
- package/src/views/component/MateChat/MateChatView.vue +10 -10
- package/src/views/component/XCellDetailView/index.vue +217 -217
- package/src/views/component/XCellListView/index.vue +138 -107
- package/src/views/component/XFormGroupView/index.vue +82 -78
- package/src/views/component/XFormView/index.vue +46 -41
- package/src/views/component/XReportFormIframeView/index.vue +47 -47
- package/src/views/component/XReportFormView/index.vue +13 -13
- package/src/views/component/XSignatureView/index.vue +50 -50
- package/src/views/component/notice.vue +46 -46
- package/src/views/component/topNav.vue +36 -36
- package/src/views/invoiceShow/index.vue +61 -61
- package/src/views/user/login/index.vue +22 -22
- package/pnpm-lock.yaml +0 -11070
package/__dummy__
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cells": [],
|
|
3
|
-
"metadata": {
|
|
4
|
-
"language_info": {
|
|
5
|
-
"name": "python"
|
|
6
|
-
}
|
|
7
|
-
},
|
|
8
|
-
"nbformat": 4,
|
|
9
|
-
"nbformat_minor": 2
|
|
1
|
+
{
|
|
2
|
+
"cells": [],
|
|
3
|
+
"metadata": {
|
|
4
|
+
"language_info": {
|
|
5
|
+
"name": "python"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"nbformat": 4,
|
|
9
|
+
"nbformat_minor": 2
|
|
10
10
|
}
|
package/build/vite/optimize.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
const include = [
|
|
2
|
-
'axios',
|
|
3
|
-
'echarts',
|
|
4
|
-
'lodash-es',
|
|
5
|
-
'resize-detector',
|
|
6
|
-
'vant/es',
|
|
7
|
-
'vant/es/cell-group/style/index',
|
|
8
|
-
'vant/es/popup/style/index',
|
|
9
|
-
'vant/es/picker/style/index',
|
|
10
|
-
'vant/es/cell/style/index',
|
|
11
|
-
'vant/es/switch/style/index',
|
|
12
|
-
'vant/es/space/style/index',
|
|
13
|
-
'vant/es/button/style/index',
|
|
14
|
-
'vant/es/empty/style/index',
|
|
15
|
-
'vant/es/icon/style/index',
|
|
16
|
-
'vant/es/stepper/style/index',
|
|
17
|
-
'vant/es/image/style/index',
|
|
18
|
-
'vant/es/form/style/index',
|
|
19
|
-
'vant/es/field/style/index',
|
|
20
|
-
'vant/es/notify/style/index',
|
|
21
|
-
'vant/es/config-provider/style/index',
|
|
22
|
-
'vant/es/nav-bar/style/index',
|
|
23
|
-
'vant/es/tabbar/style/index',
|
|
24
|
-
'vant/es/tabbar-item/style/index',
|
|
25
|
-
'vant/es/list/style/index',
|
|
26
|
-
'vant/es/text-ellipsis/style/index',
|
|
27
|
-
// 确保 @matechat/core 及其依赖 xss 被正确预构建
|
|
28
|
-
'@matechat/core',
|
|
29
|
-
]
|
|
30
|
-
|
|
31
|
-
const exclude = [
|
|
32
|
-
'@iconify/json',
|
|
33
|
-
'@iconify/vue',
|
|
34
|
-
]
|
|
35
|
-
|
|
36
|
-
export { exclude, include }
|
|
1
|
+
const include = [
|
|
2
|
+
'axios',
|
|
3
|
+
'echarts',
|
|
4
|
+
'lodash-es',
|
|
5
|
+
'resize-detector',
|
|
6
|
+
'vant/es',
|
|
7
|
+
'vant/es/cell-group/style/index',
|
|
8
|
+
'vant/es/popup/style/index',
|
|
9
|
+
'vant/es/picker/style/index',
|
|
10
|
+
'vant/es/cell/style/index',
|
|
11
|
+
'vant/es/switch/style/index',
|
|
12
|
+
'vant/es/space/style/index',
|
|
13
|
+
'vant/es/button/style/index',
|
|
14
|
+
'vant/es/empty/style/index',
|
|
15
|
+
'vant/es/icon/style/index',
|
|
16
|
+
'vant/es/stepper/style/index',
|
|
17
|
+
'vant/es/image/style/index',
|
|
18
|
+
'vant/es/form/style/index',
|
|
19
|
+
'vant/es/field/style/index',
|
|
20
|
+
'vant/es/notify/style/index',
|
|
21
|
+
'vant/es/config-provider/style/index',
|
|
22
|
+
'vant/es/nav-bar/style/index',
|
|
23
|
+
'vant/es/tabbar/style/index',
|
|
24
|
+
'vant/es/tabbar-item/style/index',
|
|
25
|
+
'vant/es/list/style/index',
|
|
26
|
+
'vant/es/text-ellipsis/style/index',
|
|
27
|
+
// 确保 @matechat/core 及其依赖 xss 被正确预构建
|
|
28
|
+
'@matechat/core',
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
const exclude = [
|
|
32
|
+
'@iconify/json',
|
|
33
|
+
'@iconify/vue',
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
export { exclude, include }
|
package/package.json
CHANGED
|
@@ -1,121 +1,120 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "af-mobile-client-vue3",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "1.4.
|
|
5
|
-
"packageManager": "pnpm@10.13.1",
|
|
6
|
-
"description": "Vue + Vite component lib",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=20.19.0"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"dev": "cross-env MOCK_SERVER_PORT=8086 vite",
|
|
12
|
-
"compress": "node ./compress.js",
|
|
13
|
-
"build:dev": "vue-tsc --noEmit && vite build --mode development && pnpm run compress",
|
|
14
|
-
"build:pro": "vue-tsc --noEmit && vite build --mode production && pnpm run compress",
|
|
15
|
-
"preview": "vite preview",
|
|
16
|
-
"lint": "eslint .",
|
|
17
|
-
"lint:fix": "eslint . --fix",
|
|
18
|
-
"release": "bumpp --commit --push --tag",
|
|
19
|
-
"typecheck": "vue-tsc --noEmit",
|
|
20
|
-
"commitlint": "commitlint --edit",
|
|
21
|
-
"prepare": "simple-git-hooks"
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@iconify/vue": "4.3.0",
|
|
25
|
-
"@matechat/core": "^1.10.0",
|
|
26
|
-
"@micro-zoe/micro-app": "1.0.0-rc.26",
|
|
27
|
-
"@unhead/vue": "2.0.12",
|
|
28
|
-
"@vant/area-data": "^2.0.0",
|
|
29
|
-
"@vant/touch-emulator": "^1.4.0",
|
|
30
|
-
"@vant/use": "^1.6.0",
|
|
31
|
-
"@vueuse/core": "^13.5.0",
|
|
32
|
-
"axios": "^1.10.0",
|
|
33
|
-
"bcryptjs": "^2.4.3",
|
|
34
|
-
"crypto-js": "^4.2.0",
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"jsencrypt": "^3.3.2",
|
|
39
|
-
"lodash-es": "^4.17.21",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"vue": "^
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"@
|
|
57
|
-
"@commitlint/
|
|
58
|
-
"@commitlint/
|
|
59
|
-
"@
|
|
60
|
-
"@iconify/
|
|
61
|
-
"@
|
|
62
|
-
"@
|
|
63
|
-
"@types/
|
|
64
|
-
"@types/
|
|
65
|
-
"@types/
|
|
66
|
-
"@
|
|
67
|
-
"@
|
|
68
|
-
"@vitejs/plugin-
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"eslint": "^
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"vite": "^
|
|
87
|
-
"vite-plugin-
|
|
88
|
-
"vite-plugin-
|
|
89
|
-
"vite-plugin-
|
|
90
|
-
"vite-plugin-
|
|
91
|
-
"vite-plugin-
|
|
92
|
-
"
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "af-mobile-client-vue3",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.4.69",
|
|
5
|
+
"packageManager": "pnpm@10.13.1",
|
|
6
|
+
"description": "Vue + Vite component lib",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=20.19.0"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "cross-env MOCK_SERVER_PORT=8086 vite",
|
|
12
|
+
"compress": "node ./compress.js",
|
|
13
|
+
"build:dev": "vue-tsc --noEmit && vite build --mode development && pnpm run compress",
|
|
14
|
+
"build:pro": "vue-tsc --noEmit && vite build --mode production && pnpm run compress",
|
|
15
|
+
"preview": "vite preview",
|
|
16
|
+
"lint": "eslint .",
|
|
17
|
+
"lint:fix": "eslint . --fix",
|
|
18
|
+
"release": "bumpp --commit --push --tag",
|
|
19
|
+
"typecheck": "vue-tsc --noEmit",
|
|
20
|
+
"commitlint": "commitlint --edit",
|
|
21
|
+
"prepare": "simple-git-hooks"
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@iconify/vue": "4.3.0",
|
|
25
|
+
"@matechat/core": "^1.10.0",
|
|
26
|
+
"@micro-zoe/micro-app": "1.0.0-rc.26",
|
|
27
|
+
"@unhead/vue": "2.0.12",
|
|
28
|
+
"@vant/area-data": "^2.0.0",
|
|
29
|
+
"@vant/touch-emulator": "^1.4.0",
|
|
30
|
+
"@vant/use": "^1.6.0",
|
|
31
|
+
"@vueuse/core": "^13.5.0",
|
|
32
|
+
"axios": "^1.10.0",
|
|
33
|
+
"bcryptjs": "^2.4.3",
|
|
34
|
+
"crypto-js": "^4.2.0",
|
|
35
|
+
"moment": "^2.21.0",
|
|
36
|
+
"dayjs": "^1.11.13",
|
|
37
|
+
"echarts": "^5.6.0",
|
|
38
|
+
"jsencrypt": "^3.3.2",
|
|
39
|
+
"lodash-es": "^4.17.21",
|
|
40
|
+
"nprogress": "^0.2.0",
|
|
41
|
+
"ol": "^10.5.0",
|
|
42
|
+
"pinia": "^3.0.3",
|
|
43
|
+
"pinia-plugin-persistedstate": "^4.4.1",
|
|
44
|
+
"resize-detector": "^0.3.0",
|
|
45
|
+
"vant": "^4.9.21",
|
|
46
|
+
"vconsole": "^3.15.1",
|
|
47
|
+
"vue": "^3.5.17",
|
|
48
|
+
"vue-i18n": "^11.1.10",
|
|
49
|
+
"vue-router": "^4.5.1",
|
|
50
|
+
"vue3-hash-calendar": "^1.1.3",
|
|
51
|
+
"weixin-js-sdk": "^1.6.5",
|
|
52
|
+
"js-base64": "^3.7.8"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@antfu/eslint-config": "4.17.0",
|
|
56
|
+
"@commitlint/cli": "^19.8.1",
|
|
57
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
58
|
+
"@commitlint/types": "^19.8.1",
|
|
59
|
+
"@iconify/json": "2.2.318",
|
|
60
|
+
"@iconify/utils": "^2.3.0",
|
|
61
|
+
"@intlify/unplugin-vue-i18n": "^6.0.8",
|
|
62
|
+
"@types/crypto-js": "^4.2.2",
|
|
63
|
+
"@types/lodash-es": "^4.17.12",
|
|
64
|
+
"@types/node": "^24.0.14",
|
|
65
|
+
"@types/nprogress": "^0.2.3",
|
|
66
|
+
"@unocss/eslint-config": "66.3.3",
|
|
67
|
+
"@vitejs/plugin-legacy": "^7.0.1",
|
|
68
|
+
"@vitejs/plugin-vue": "^6.0.0",
|
|
69
|
+
"autoprefixer": "^10.4.21",
|
|
70
|
+
"bumpp": "^10.2.0",
|
|
71
|
+
"consola": "^3.4.2",
|
|
72
|
+
"cross-env": "^7.0.3",
|
|
73
|
+
"eslint": "^9.31.0",
|
|
74
|
+
"eslint-plugin-format": "^1.0.1",
|
|
75
|
+
"less": "^4.4.0",
|
|
76
|
+
"lint-staged": "^16.1.2",
|
|
77
|
+
"mockjs": "^1.1.0",
|
|
78
|
+
"postcss-mobile-forever": "^5.0.0",
|
|
79
|
+
"rollup": "^4.45.1",
|
|
80
|
+
"simple-git-hooks": "^2.13.0",
|
|
81
|
+
"tar": "^7.4.3",
|
|
82
|
+
"terser": "^5.43.1",
|
|
83
|
+
"typescript": "^5.8.3",
|
|
84
|
+
"unocss": "66.3.3",
|
|
85
|
+
"vite": "^7.0.5",
|
|
86
|
+
"vite-plugin-compression": "^0.5.1",
|
|
87
|
+
"vite-plugin-mock-dev-server": "^1.9.1",
|
|
88
|
+
"vite-plugin-pwa": "^1.0.1",
|
|
89
|
+
"vite-plugin-sitemap": "^0.8.2",
|
|
90
|
+
"vite-plugin-vconsole": "^2.1.1",
|
|
91
|
+
"vite-plugin-vue-devtools": "^7.7.7",
|
|
92
|
+
"vue-tsc": "^3.0.2"
|
|
93
|
+
},
|
|
94
|
+
"pnpm": {
|
|
95
|
+
"allowedDeprecatedVersions": {
|
|
96
|
+
"glob": "7.2.3",
|
|
97
|
+
"inflight": "1.0.6",
|
|
98
|
+
"sourcemap-codec": "1.4.8"
|
|
99
|
+
},
|
|
100
|
+
"peerDependencyRules": {
|
|
101
|
+
"allowedVersions": {}
|
|
102
|
+
},
|
|
103
|
+
"onlyBuiltDependencies": [
|
|
104
|
+
"core-js",
|
|
105
|
+
"esbuild",
|
|
106
|
+
"simple-git-hooks",
|
|
107
|
+
"unrs-resolver"
|
|
108
|
+
]
|
|
109
|
+
},
|
|
110
|
+
"resolutions": {
|
|
111
|
+
"vite": "^7.0.5"
|
|
112
|
+
},
|
|
113
|
+
"simple-git-hooks": {
|
|
114
|
+
"pre-commit": "pnpm lint-staged",
|
|
115
|
+
"commit-msg": "pnpm commitlint $1"
|
|
116
|
+
},
|
|
117
|
+
"lint-staged": {
|
|
118
|
+
"*": "eslint --fix"
|
|
119
|
+
}
|
|
120
|
+
}
|
package/public/favicon.svg
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<svg t="1709866807903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4913" width="32" height="32">
|
|
2
|
-
<path d="M512 598.528a111.232 111.232 0 0 0-111.232 111.2064V870.4h222.464v-160.6656c0-61.44-49.792-111.232-111.232-111.232z m0 58.0608c-30.72 0-55.6032 24.9088-55.6032 55.6288v105.0368h111.2064v-105.0368c0-30.72-24.8832-55.6288-55.6032-55.6288z" fill="#FB4D31" p-id="4914"></path>
|
|
3
|
-
<path d="M542.08 270.208l45.2608-78.5408a24.5248 24.5248 0 0 0 0-25.6A26.4448 26.4448 0 0 0 564.1472 153.6a26.3424 26.3424 0 0 0-22.5792 13.44L512 217.6256l-29.5424-50.5344c-4.5824-8.192-13.184-13.312-22.5536-13.4912a26.4448 26.4448 0 0 0-23.2448 12.4928 24.5248 24.5248 0 0 0 0 25.6l45.2352 78.5152L156.928 832.768a24.4736 24.4736 0 0 0 0.3328 25.088c4.8384 7.8336 13.3888 12.544 22.5792 12.5184h664.3456c9.3184 0 17.92-4.7616 22.6304-12.4672a24.4736 24.4736 0 0 0 0.3072-25.088l-325.0176-562.688v0.0512zM619.52 816.64h-33.3568c-12.3648 0-9.6768 0.1024-65.0496 0H512c-55.3728 0.1024-24.704 0-61.7984 0H225.28L512 322.1248 798.72 816.64h-179.2z" fill="#000000" p-id="4915"></path>
|
|
4
|
-
</svg>
|
|
1
|
+
<svg t="1709866807903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4913" width="32" height="32">
|
|
2
|
+
<path d="M512 598.528a111.232 111.232 0 0 0-111.232 111.2064V870.4h222.464v-160.6656c0-61.44-49.792-111.232-111.232-111.232z m0 58.0608c-30.72 0-55.6032 24.9088-55.6032 55.6288v105.0368h111.2064v-105.0368c0-30.72-24.8832-55.6288-55.6032-55.6288z" fill="#FB4D31" p-id="4914"></path>
|
|
3
|
+
<path d="M542.08 270.208l45.2608-78.5408a24.5248 24.5248 0 0 0 0-25.6A26.4448 26.4448 0 0 0 564.1472 153.6a26.3424 26.3424 0 0 0-22.5792 13.44L512 217.6256l-29.5424-50.5344c-4.5824-8.192-13.184-13.312-22.5536-13.4912a26.4448 26.4448 0 0 0-23.2448 12.4928 24.5248 24.5248 0 0 0 0 25.6l45.2352 78.5152L156.928 832.768a24.4736 24.4736 0 0 0 0.3328 25.088c4.8384 7.8336 13.3888 12.544 22.5792 12.5184h664.3456c9.3184 0 17.92-4.7616 22.6304-12.4672a24.4736 24.4736 0 0 0 0.3072-25.088l-325.0176-562.688v0.0512zM619.52 816.64h-33.3568c-12.3648 0-9.6768 0.1024-65.0496 0H512c-55.3728 0.1024-24.704 0-61.7984 0H225.28L512 322.1248 798.72 816.64h-179.2z" fill="#000000" p-id="4915"></path>
|
|
4
|
+
</svg>
|
package/scripts/verifyCommit.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import fs from 'node:fs'
|
|
2
|
-
|
|
3
|
-
// import process from 'node:process'
|
|
4
|
-
|
|
5
|
-
const msg = fs.readFileSync('.git/COMMIT_EDITMSG', 'utf-8').trim()
|
|
6
|
-
|
|
7
|
-
const commitRE = /^(?:revert: )?(?:feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(?:\(.+\))?: .{1,50}/
|
|
8
|
-
// const mergeRe = /^(Merge pull request|Merge branch)/
|
|
9
|
-
|
|
10
|
-
if (!commitRE.test(msg)) {
|
|
11
|
-
// if (!mergeRe.test(msg)) {
|
|
12
|
-
// console.log('git commit unpass')
|
|
13
|
-
// console.error('git commit error, needs title(scope): desc')
|
|
14
|
-
// process.exit(1)
|
|
15
|
-
// }
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
console.log('git commit pass')
|
|
19
|
-
}
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
|
|
3
|
+
// import process from 'node:process'
|
|
4
|
+
|
|
5
|
+
const msg = fs.readFileSync('.git/COMMIT_EDITMSG', 'utf-8').trim()
|
|
6
|
+
|
|
7
|
+
const commitRE = /^(?:revert: )?(?:feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release)(?:\(.+\))?: .{1,50}/
|
|
8
|
+
// const mergeRe = /^(Merge pull request|Merge branch)/
|
|
9
|
+
|
|
10
|
+
if (!commitRE.test(msg)) {
|
|
11
|
+
// if (!mergeRe.test(msg)) {
|
|
12
|
+
// console.log('git commit unpass')
|
|
13
|
+
// console.error('git commit error, needs title(scope): desc')
|
|
14
|
+
// process.exit(1)
|
|
15
|
+
// }
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
console.log('git commit pass')
|
|
19
|
+
}
|