@modern-js/plugin-changeset 1.3.1-alpha.0 → 1.4.1
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/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,43 @@
|
|
|
1
1
|
# @modern-js/plugin-changeset
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.4.1
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
- 3c20a5e: fix: `@modern-js/plugin-changeset` export fields
|
|
8
|
+
|
|
9
|
+
fix: 修复 `@modern-js/plugin-changeset` 导出字段路径
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [79e83ef]
|
|
12
|
+
- Updated dependencies [22f4dca]
|
|
13
|
+
- Updated dependencies [7b9067f]
|
|
14
|
+
- @modern-js/utils@1.9.0
|
|
15
|
+
|
|
16
|
+
## 1.4.0
|
|
17
|
+
|
|
18
|
+
### Minor Changes
|
|
19
|
+
|
|
20
|
+
- 33cebd2: chore(plugin-i18n): merge `@modern-js/i18n-cli-language-detector` to `@modern-js/plugin-i18n`
|
|
21
|
+
|
|
22
|
+
chore(plugin-i18n): 合并 `@modern-js/i18n-cli-language-detector` 包到 `@modern-js/plugin-i18n` 包作为子路径
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- 2e8ea92: feat: optimize release note
|
|
27
|
+
|
|
28
|
+
feat: 优化 Release Note 格式
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [33cebd2]
|
|
31
|
+
- @modern-js/plugin-i18n@1.3.0
|
|
32
|
+
- @modern-js/utils@1.7.12
|
|
33
|
+
|
|
34
|
+
## 1.3.1
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- 42741db: perf(plugin-changeset): optimize custom generator release note
|
|
39
|
+
- Updated dependencies [a90bc96]
|
|
40
|
+
- @modern-js/utils@1.7.9
|
|
11
41
|
|
|
12
42
|
## 1.3.0
|
|
13
43
|
|
|
@@ -15,6 +15,24 @@ export function getReleaseInfo(commit, commitObj) {
|
|
|
15
15
|
|
|
16
16
|
return commitObj;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
function formatSummary(summary, pullRequestId) {
|
|
20
|
+
const [firstLine, ...futureLines] = summary.split('\n').map(l => l.trimRight());
|
|
21
|
+
let returnVal = firstLine;
|
|
22
|
+
|
|
23
|
+
if (futureLines.length > 0) {
|
|
24
|
+
if (pullRequestId) {
|
|
25
|
+
returnVal = `\n\n ${returnVal}`;
|
|
26
|
+
} else {
|
|
27
|
+
returnVal = `\n ${returnVal}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
returnVal += `\n\n ${futureLines.filter(l => Boolean(l)).map(l => l).join('\n\n')}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return returnVal;
|
|
34
|
+
}
|
|
35
|
+
|
|
18
36
|
export function getReleaseNoteLine(commit, customReleaseNoteFunction) {
|
|
19
37
|
if (customReleaseNoteFunction !== null && customReleaseNoteFunction !== void 0 && customReleaseNoteFunction.getReleaseNoteLine) {
|
|
20
38
|
return customReleaseNoteFunction.getReleaseNoteLine(commit);
|
|
@@ -23,17 +41,18 @@ export function getReleaseNoteLine(commit, customReleaseNoteFunction) {
|
|
|
23
41
|
const {
|
|
24
42
|
repository,
|
|
25
43
|
pullRequestId,
|
|
26
|
-
summary
|
|
27
|
-
author
|
|
44
|
+
summary
|
|
28
45
|
} = commit;
|
|
29
46
|
|
|
30
47
|
if (pullRequestId && repository) {
|
|
31
|
-
return
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return
|
|
48
|
+
return `- [#${pullRequestId}](https://github.com/${repository}/pull/${pullRequestId}) ${formatSummary(summary, pullRequestId)}\n`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (pullRequestId) {
|
|
52
|
+
return `#${pullRequestId} ${formatSummary(summary, pullRequestId)}\n`;
|
|
36
53
|
}
|
|
54
|
+
|
|
55
|
+
return `${formatSummary(summary, pullRequestId)}\n`;
|
|
37
56
|
}
|
|
38
57
|
export async function genReleaseNote(options) {
|
|
39
58
|
const cwd = process.cwd();
|
|
@@ -111,18 +130,20 @@ export async function genReleaseNote(options) {
|
|
|
111
130
|
}
|
|
112
131
|
|
|
113
132
|
if (features.length) {
|
|
114
|
-
console.info('Features:\n');
|
|
115
|
-
|
|
133
|
+
console.info('## Features:\n');
|
|
134
|
+
|
|
135
|
+
for (const commit of features) {
|
|
116
136
|
const releaseNote = await getReleaseNoteLine(commit, customReleaseNoteFunction);
|
|
117
137
|
console.info(releaseNote);
|
|
118
|
-
}
|
|
138
|
+
}
|
|
119
139
|
}
|
|
120
140
|
|
|
121
141
|
if (bugFix.length) {
|
|
122
|
-
console.info('Bug Fix:\n');
|
|
123
|
-
|
|
142
|
+
console.info('## Bug Fix:\n');
|
|
143
|
+
|
|
144
|
+
for (const commit of bugFix) {
|
|
124
145
|
const relesaeNote = await getReleaseNoteLine(commit, customReleaseNoteFunction);
|
|
125
146
|
console.info(relesaeNote);
|
|
126
|
-
}
|
|
147
|
+
}
|
|
127
148
|
}
|
|
128
149
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I18CLILanguageDetector } from '@modern-js/i18n
|
|
1
|
+
import { I18CLILanguageDetector } from '@modern-js/plugin-i18n/language-detector';
|
|
2
2
|
export function getLocaleLanguage() {
|
|
3
3
|
const detector = new I18CLILanguageDetector();
|
|
4
4
|
return detector.detect();
|
|
@@ -31,6 +31,23 @@ function getReleaseInfo(commit, commitObj) {
|
|
|
31
31
|
return commitObj;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
function formatSummary(summary, pullRequestId) {
|
|
35
|
+
const [firstLine, ...futureLines] = summary.split('\n').map(l => l.trimRight());
|
|
36
|
+
let returnVal = firstLine;
|
|
37
|
+
|
|
38
|
+
if (futureLines.length > 0) {
|
|
39
|
+
if (pullRequestId) {
|
|
40
|
+
returnVal = `\n\n ${returnVal}`;
|
|
41
|
+
} else {
|
|
42
|
+
returnVal = `\n ${returnVal}`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
returnVal += `\n\n ${futureLines.filter(l => Boolean(l)).map(l => l).join('\n\n')}`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return returnVal;
|
|
49
|
+
}
|
|
50
|
+
|
|
34
51
|
function getReleaseNoteLine(commit, customReleaseNoteFunction) {
|
|
35
52
|
if (customReleaseNoteFunction !== null && customReleaseNoteFunction !== void 0 && customReleaseNoteFunction.getReleaseNoteLine) {
|
|
36
53
|
return customReleaseNoteFunction.getReleaseNoteLine(commit);
|
|
@@ -39,17 +56,18 @@ function getReleaseNoteLine(commit, customReleaseNoteFunction) {
|
|
|
39
56
|
const {
|
|
40
57
|
repository,
|
|
41
58
|
pullRequestId,
|
|
42
|
-
summary
|
|
43
|
-
author
|
|
59
|
+
summary
|
|
44
60
|
} = commit;
|
|
45
61
|
|
|
46
62
|
if (pullRequestId && repository) {
|
|
47
|
-
return
|
|
48
|
-
} else if (pullRequestId) {
|
|
49
|
-
return `[#${pullRequestId}] ${summary}${author ? ` -- ${author}` : ''}\n`;
|
|
50
|
-
} else {
|
|
51
|
-
return `${summary}${author ? ` -- ${author}` : ''}\n`;
|
|
63
|
+
return `- [#${pullRequestId}](https://github.com/${repository}/pull/${pullRequestId}) ${formatSummary(summary, pullRequestId)}\n`;
|
|
52
64
|
}
|
|
65
|
+
|
|
66
|
+
if (pullRequestId) {
|
|
67
|
+
return `#${pullRequestId} ${formatSummary(summary, pullRequestId)}\n`;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return `${formatSummary(summary, pullRequestId)}\n`;
|
|
53
71
|
}
|
|
54
72
|
|
|
55
73
|
async function genReleaseNote(options) {
|
|
@@ -128,18 +146,20 @@ async function genReleaseNote(options) {
|
|
|
128
146
|
}
|
|
129
147
|
|
|
130
148
|
if (features.length) {
|
|
131
|
-
console.info('Features:\n');
|
|
132
|
-
|
|
149
|
+
console.info('## Features:\n');
|
|
150
|
+
|
|
151
|
+
for (const commit of features) {
|
|
133
152
|
const releaseNote = await getReleaseNoteLine(commit, customReleaseNoteFunction);
|
|
134
153
|
console.info(releaseNote);
|
|
135
|
-
}
|
|
154
|
+
}
|
|
136
155
|
}
|
|
137
156
|
|
|
138
157
|
if (bugFix.length) {
|
|
139
|
-
console.info('Bug Fix:\n');
|
|
140
|
-
|
|
158
|
+
console.info('## Bug Fix:\n');
|
|
159
|
+
|
|
160
|
+
for (const commit of bugFix) {
|
|
141
161
|
const relesaeNote = await getReleaseNoteLine(commit, customReleaseNoteFunction);
|
|
142
162
|
console.info(relesaeNote);
|
|
143
|
-
}
|
|
163
|
+
}
|
|
144
164
|
}
|
|
145
165
|
}
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getLocaleLanguage = getLocaleLanguage;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _languageDetector = require("@modern-js/plugin-i18n/language-detector");
|
|
9
9
|
|
|
10
10
|
function getLocaleLanguage() {
|
|
11
|
-
const detector = new
|
|
11
|
+
const detector = new _languageDetector.I18CLILanguageDetector();
|
|
12
12
|
return detector.detect();
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.4.1",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
18
|
-
"module": "./dist/js/treeshaking/index.js",
|
|
19
18
|
"jsnext:modern": "./dist/js/modern/index.js",
|
|
20
19
|
"exports": {
|
|
21
20
|
".": {
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
"import": "./dist/js/modern/index.js",
|
|
25
24
|
"require": "./dist/js/node/index.js"
|
|
26
25
|
},
|
|
27
|
-
"default": "./dist/js/
|
|
26
|
+
"default": "./dist/js/node/index.js"
|
|
28
27
|
},
|
|
29
28
|
"./cli": {
|
|
30
29
|
"jsnext:source": "./src/index.ts",
|
|
@@ -36,14 +35,13 @@
|
|
|
36
35
|
"@changesets/cli": "^2.23.0",
|
|
37
36
|
"@changesets/git": "^1.3.2",
|
|
38
37
|
"@changesets/read": "^0.5.5",
|
|
39
|
-
"@modern-js/i18n
|
|
40
|
-
"@modern-js/
|
|
41
|
-
"@modern-js/utils": "^1.7.9-alpha.0",
|
|
38
|
+
"@modern-js/plugin-i18n": "^1.3.0",
|
|
39
|
+
"@modern-js/utils": "^1.9.0",
|
|
42
40
|
"execa": "^5.1.1",
|
|
43
41
|
"resolve-from": "^5.0.0"
|
|
44
42
|
},
|
|
45
43
|
"devDependencies": {
|
|
46
|
-
"@modern-js/core": "1.
|
|
44
|
+
"@modern-js/core": "1.14.0",
|
|
47
45
|
"@scripts/build": "0.0.0",
|
|
48
46
|
"@types/jest": "^27",
|
|
49
47
|
"@types/node": "^14",
|