@varlet/cli 2.20.0-alpha.1701880061001 → 2.20.0
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/lib/node/bin.js
CHANGED
|
@@ -129,7 +129,7 @@ program
|
|
|
129
129
|
.command('commit-lint <gitParams>')
|
|
130
130
|
.description('Lint commit message')
|
|
131
131
|
.action(async (options) => {
|
|
132
|
-
const { commitLint } = await import('
|
|
132
|
+
const { commitLint } = await import('@varlet/release');
|
|
133
133
|
return commitLint(options);
|
|
134
134
|
});
|
|
135
135
|
program
|
|
@@ -2,7 +2,7 @@ import fse from 'fs-extra';
|
|
|
2
2
|
import markdownIt from 'markdown-it';
|
|
3
3
|
import logger from '../shared/logger.js';
|
|
4
4
|
import { CHECKLIST_FILE } from '../shared/constant.js';
|
|
5
|
-
import { COMMIT_MESSAGE_RE, isVersionCommitMessage, getCommitMessage } from '
|
|
5
|
+
import { COMMIT_MESSAGE_RE, isVersionCommitMessage, getCommitMessage } from '@varlet/release';
|
|
6
6
|
const { readFileSync, existsSync } = fse;
|
|
7
7
|
const blockRE = /<h3>(.|\n|\r)+?<\/ul>/g;
|
|
8
8
|
const typeRE = /<h3>(.+)<\/h3>/;
|
package/lib/node/index.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ export * from '@varlet/release';
|
|
|
3
3
|
export * from './commands/dev.js';
|
|
4
4
|
export * from './commands/build.js';
|
|
5
5
|
export * from './commands/compile.js';
|
|
6
|
-
export * from './commands/commitLint.js';
|
|
7
6
|
export * from './commands/gen.js';
|
|
8
7
|
export * from './commands/test.js';
|
|
9
8
|
export * from './commands/create.js';
|
package/lib/node/index.js
CHANGED
|
@@ -3,7 +3,6 @@ export * from '@varlet/release';
|
|
|
3
3
|
export * from './commands/dev.js';
|
|
4
4
|
export * from './commands/build.js';
|
|
5
5
|
export * from './commands/compile.js';
|
|
6
|
-
export * from './commands/commitLint.js';
|
|
7
6
|
export * from './commands/gen.js';
|
|
8
7
|
export * from './commands/test.js';
|
|
9
8
|
export * from './commands/create.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@varlet/cli",
|
|
3
|
-
"version": "2.20.0
|
|
3
|
+
"version": "2.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "cli of varlet",
|
|
6
6
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "https://github.com/varletjs/varlet/issues"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@varlet/release": "0.0.
|
|
37
|
+
"@varlet/release": "^0.0.5",
|
|
38
38
|
"@babel/core": "^7.22.5",
|
|
39
39
|
"@babel/preset-typescript": "^7.22.5",
|
|
40
40
|
"@vitejs/plugin-vue": "4.2.3",
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"vite": "4.3.5",
|
|
65
65
|
"vue": "3.3.4",
|
|
66
66
|
"webfont": "^9.0.0",
|
|
67
|
-
"@varlet/
|
|
68
|
-
"@varlet/
|
|
67
|
+
"@varlet/vite-plugins": "2.20.0",
|
|
68
|
+
"@varlet/shared": "2.20.0"
|
|
69
69
|
},
|
|
70
70
|
"devDependencies": {
|
|
71
71
|
"@types/babel__core": "^7.20.1",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"@types/semver": "^7.3.9",
|
|
81
81
|
"@types/sharp": "0.31.1",
|
|
82
82
|
"rimraf": "^5.0.1",
|
|
83
|
-
"@varlet/
|
|
84
|
-
"@varlet/
|
|
85
|
-
"@varlet/touch-emulator": "2.20.0
|
|
83
|
+
"@varlet/ui": "2.20.0",
|
|
84
|
+
"@varlet/icons": "2.20.0",
|
|
85
|
+
"@varlet/touch-emulator": "2.20.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"@vue/runtime-core": "3.3.4",
|
|
@@ -95,9 +95,9 @@
|
|
|
95
95
|
"lodash-es": "^4.17.21",
|
|
96
96
|
"vue": "3.3.4",
|
|
97
97
|
"vue-router": "4.2.0",
|
|
98
|
-
"@varlet/icons": "2.20.0
|
|
99
|
-
"@varlet/ui": "2.20.0
|
|
100
|
-
"@varlet/touch-emulator": "2.20.0
|
|
98
|
+
"@varlet/icons": "2.20.0",
|
|
99
|
+
"@varlet/ui": "2.20.0",
|
|
100
|
+
"@varlet/touch-emulator": "2.20.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"dev": "tsc --watch",
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import logger from '../shared/logger.js';
|
|
2
|
-
import semver from 'semver';
|
|
3
|
-
import fse from 'fs-extra';
|
|
4
|
-
const { readFileSync } = fse;
|
|
5
|
-
export const COMMIT_MESSAGE_RE = /^(revert|fix|feat|docs|perf|test|types|style|build|chore|release|refactor)(\(.+\))?!?: (.|\n)+/;
|
|
6
|
-
export function isVersionCommitMessage(message) {
|
|
7
|
-
return message.startsWith('v') && semver.valid(message.slice(1));
|
|
8
|
-
}
|
|
9
|
-
export function getCommitMessage(gitParams) {
|
|
10
|
-
return readFileSync(gitParams, 'utf-8').trim();
|
|
11
|
-
}
|
|
12
|
-
export function commitLint(gitParams) {
|
|
13
|
-
const commitMessage = getCommitMessage(gitParams);
|
|
14
|
-
if (!isVersionCommitMessage(commitMessage) && !COMMIT_MESSAGE_RE.test(commitMessage)) {
|
|
15
|
-
logger.error(`Commit message invalid`);
|
|
16
|
-
logger.warning(`\
|
|
17
|
-
The rules for commit messages are as follows
|
|
18
|
-
|
|
19
|
-
Example:
|
|
20
|
-
|
|
21
|
-
feat: add a new feature
|
|
22
|
-
feat(ui/button): add a new feature in the ui/button scope
|
|
23
|
-
|
|
24
|
-
fix: fix a bug
|
|
25
|
-
fix(ui/button): fix a bug in the ui/button scope
|
|
26
|
-
|
|
27
|
-
docs: fix an error in the documentation
|
|
28
|
-
docs(ui/button): fix a documentation error in the ui/button scope
|
|
29
|
-
|
|
30
|
-
Allowed types:
|
|
31
|
-
- fix
|
|
32
|
-
- feat
|
|
33
|
-
- docs
|
|
34
|
-
- perf
|
|
35
|
-
- test
|
|
36
|
-
- types
|
|
37
|
-
- style
|
|
38
|
-
- build
|
|
39
|
-
- chore
|
|
40
|
-
- release
|
|
41
|
-
- refactor
|
|
42
|
-
- revert
|
|
43
|
-
|
|
44
|
-
Commit message reference: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y
|
|
45
|
-
参考阮一峰Commit message编写指南: https://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html`);
|
|
46
|
-
process.exit(1);
|
|
47
|
-
}
|
|
48
|
-
}
|