@modern-js/plugin-changeset 2.7.0 → 2.8.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/CHANGELOG.md +17 -0
- package/README.md +2 -2
- package/dist/cjs/commands/releaseNote.js +8 -5
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/locale/en.js +1 -1
- package/dist/cjs/locale/zh.js +1 -1
- package/dist/esm/commands/releaseNote.js +8 -5
- package/dist/esm/index.js +3 -1
- package/dist/esm/locale/en.js +1 -1
- package/dist/esm/locale/zh.js +1 -1
- package/dist/types/commands/releaseNote.d.ts +1 -1
- package/package.json +21 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @modern-js/plugin-changeset
|
|
2
2
|
|
|
3
|
+
## 2.8.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1e7c2c5a65: feat: bump @changesets/cli version
|
|
8
|
+
|
|
9
|
+
feat: 升级 @changesets/cli 版本
|
|
10
|
+
|
|
11
|
+
- 45d726979b: feat: gen release note support return result
|
|
12
|
+
|
|
13
|
+
feat: 生成 ReleaseNote 函数支持返回结果
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [1104a9f18b]
|
|
16
|
+
- Updated dependencies [1f6ca2c7fb]
|
|
17
|
+
- @modern-js/utils@2.8.0
|
|
18
|
+
- @modern-js/plugin-i18n@2.8.0
|
|
19
|
+
|
|
3
20
|
## 2.7.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -19,8 +19,8 @@ Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-sta
|
|
|
19
19
|
|
|
20
20
|
## Contributing
|
|
21
21
|
|
|
22
|
-
Please read the [Contributing Guide](https://github.com/
|
|
22
|
+
Please read the [Contributing Guide](https://github.com/web-infra-dev/modern.js/blob/main/CONTRIBUTING.md).
|
|
23
23
|
|
|
24
24
|
## License
|
|
25
25
|
|
|
26
|
-
Modern.js is [MIT licensed](https://github.com/
|
|
26
|
+
Modern.js is [MIT licensed](https://github.com/web-infra-dev/modern.js/blob/main/LICENSE).
|
|
@@ -109,7 +109,7 @@ async function genReleaseNote(options) {
|
|
|
109
109
|
const changesets = await (0, import_read.default)(cwd);
|
|
110
110
|
if (changesets.length === 0) {
|
|
111
111
|
console.warn("No unreleased changesets found.");
|
|
112
|
-
|
|
112
|
+
return "";
|
|
113
113
|
}
|
|
114
114
|
const features = [];
|
|
115
115
|
const bugFix = [];
|
|
@@ -146,26 +146,29 @@ async function genReleaseNote(options) {
|
|
|
146
146
|
"no release note found, you can run `pnpm run add` to add changeset"
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
|
+
let result = "";
|
|
149
150
|
if (features.length) {
|
|
150
|
-
|
|
151
|
+
result += "## Features:\n";
|
|
151
152
|
for (const commit of features) {
|
|
152
153
|
const releaseNote = await getReleaseNoteLine(
|
|
153
154
|
commit,
|
|
154
155
|
customReleaseNoteFunction
|
|
155
156
|
);
|
|
156
|
-
|
|
157
|
+
result += releaseNote;
|
|
157
158
|
}
|
|
158
159
|
}
|
|
159
160
|
if (bugFix.length) {
|
|
160
|
-
|
|
161
|
+
result += "## Bug Fix:\n";
|
|
161
162
|
for (const commit of bugFix) {
|
|
162
163
|
const relesaeNote = await getReleaseNoteLine(
|
|
163
164
|
commit,
|
|
164
165
|
customReleaseNoteFunction
|
|
165
166
|
);
|
|
166
|
-
|
|
167
|
+
result += relesaeNote;
|
|
167
168
|
}
|
|
168
169
|
}
|
|
170
|
+
console.info(result);
|
|
171
|
+
return result;
|
|
169
172
|
}
|
|
170
173
|
// Annotate the CommonJS export names for ESM import in node:
|
|
171
174
|
0 && (module.exports = {
|
package/dist/cjs/index.js
CHANGED
|
@@ -66,7 +66,9 @@ var src_default = () => ({
|
|
|
66
66
|
).option(
|
|
67
67
|
"--custom <custom>",
|
|
68
68
|
import_locale.i18n.t(import_locale.localeKeys.command.gen_release_note.custom)
|
|
69
|
-
).action((options) =>
|
|
69
|
+
).action(async (options) => {
|
|
70
|
+
await (0, import_commands.genReleaseNote)(options);
|
|
71
|
+
});
|
|
70
72
|
}
|
|
71
73
|
};
|
|
72
74
|
}
|
package/dist/cjs/locale/en.js
CHANGED
|
@@ -53,7 +53,7 @@ const EN_LOCALE = {
|
|
|
53
53
|
},
|
|
54
54
|
gen_release_note: {
|
|
55
55
|
describe: "generator release note info from changesets",
|
|
56
|
-
repo: "reponame to generator pull request link, like
|
|
56
|
+
repo: "reponame to generator pull request link, like web-infra-dev/modern.js",
|
|
57
57
|
custom: "custom release note render rules"
|
|
58
58
|
}
|
|
59
59
|
}
|
package/dist/cjs/locale/zh.js
CHANGED
|
@@ -53,7 +53,7 @@ const ZH_LOCALE = {
|
|
|
53
53
|
},
|
|
54
54
|
gen_release_note: {
|
|
55
55
|
describe: "根据当前仓库 changeset 文件生成 Release Note",
|
|
56
|
-
repo: "仓库名称,用于生成 Pull Request 链接, 例如:
|
|
56
|
+
repo: "仓库名称,用于生成 Pull Request 链接, 例如: web-infra-dev/modern.js",
|
|
57
57
|
custom: "自定义 Release Note 生成函数"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -75,7 +75,7 @@ async function genReleaseNote(options) {
|
|
|
75
75
|
const changesets = await readChangesets(cwd);
|
|
76
76
|
if (changesets.length === 0) {
|
|
77
77
|
console.warn("No unreleased changesets found.");
|
|
78
|
-
|
|
78
|
+
return "";
|
|
79
79
|
}
|
|
80
80
|
const features = [];
|
|
81
81
|
const bugFix = [];
|
|
@@ -112,26 +112,29 @@ async function genReleaseNote(options) {
|
|
|
112
112
|
"no release note found, you can run `pnpm run add` to add changeset"
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
+
let result = "";
|
|
115
116
|
if (features.length) {
|
|
116
|
-
|
|
117
|
+
result += "## Features:\n";
|
|
117
118
|
for (const commit of features) {
|
|
118
119
|
const releaseNote = await getReleaseNoteLine(
|
|
119
120
|
commit,
|
|
120
121
|
customReleaseNoteFunction
|
|
121
122
|
);
|
|
122
|
-
|
|
123
|
+
result += releaseNote;
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
if (bugFix.length) {
|
|
126
|
-
|
|
127
|
+
result += "## Bug Fix:\n";
|
|
127
128
|
for (const commit of bugFix) {
|
|
128
129
|
const relesaeNote = await getReleaseNoteLine(
|
|
129
130
|
commit,
|
|
130
131
|
customReleaseNoteFunction
|
|
131
132
|
);
|
|
132
|
-
|
|
133
|
+
result += relesaeNote;
|
|
133
134
|
}
|
|
134
135
|
}
|
|
136
|
+
console.info(result);
|
|
137
|
+
return result;
|
|
135
138
|
}
|
|
136
139
|
export {
|
|
137
140
|
genReleaseNote,
|
package/dist/esm/index.js
CHANGED
|
@@ -43,7 +43,9 @@ var src_default = () => ({
|
|
|
43
43
|
).option(
|
|
44
44
|
"--custom <custom>",
|
|
45
45
|
i18n.t(localeKeys.command.gen_release_note.custom)
|
|
46
|
-
).action((options) =>
|
|
46
|
+
).action(async (options) => {
|
|
47
|
+
await genReleaseNote(options);
|
|
48
|
+
});
|
|
47
49
|
}
|
|
48
50
|
};
|
|
49
51
|
}
|
package/dist/esm/locale/en.js
CHANGED
|
@@ -31,7 +31,7 @@ const EN_LOCALE = {
|
|
|
31
31
|
},
|
|
32
32
|
gen_release_note: {
|
|
33
33
|
describe: "generator release note info from changesets",
|
|
34
|
-
repo: "reponame to generator pull request link, like
|
|
34
|
+
repo: "reponame to generator pull request link, like web-infra-dev/modern.js",
|
|
35
35
|
custom: "custom release note render rules"
|
|
36
36
|
}
|
|
37
37
|
}
|
package/dist/esm/locale/zh.js
CHANGED
|
@@ -31,7 +31,7 @@ const ZH_LOCALE = {
|
|
|
31
31
|
},
|
|
32
32
|
gen_release_note: {
|
|
33
33
|
describe: "根据当前仓库 changeset 文件生成 Release Note",
|
|
34
|
-
repo: "仓库名称,用于生成 Pull Request 链接, 例如:
|
|
34
|
+
repo: "仓库名称,用于生成 Pull Request 链接, 例如: web-infra-dev/modern.js",
|
|
35
35
|
custom: "自定义 Release Note 生成函数"
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -18,5 +18,5 @@ export type CustomReleaseNoteFunction = {
|
|
|
18
18
|
} | undefined;
|
|
19
19
|
export declare function getReleaseInfo(commit: string, commitObj: Commit): Commit;
|
|
20
20
|
export declare function getReleaseNoteLine(commit: Commit, customReleaseNoteFunction?: CustomReleaseNoteFunction): string | Promise<string>;
|
|
21
|
-
export declare function genReleaseNote(options: ReleaseNoteOptions): Promise<
|
|
21
|
+
export declare function genReleaseNote(options: ReleaseNoteOptions): Promise<string>;
|
|
22
22
|
export {};
|
package/package.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"name": "@modern-js/plugin-changeset",
|
|
3
3
|
"description": "A Progressive React Framework for modern web development.",
|
|
4
4
|
"homepage": "https://modernjs.dev",
|
|
5
|
-
"bugs": "https://github.com/
|
|
6
|
-
"repository": "
|
|
5
|
+
"bugs": "https://github.com/web-infra-dev/modern.js/issues",
|
|
6
|
+
"repository": "web-infra-dev/modern.js",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"react",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "2.
|
|
14
|
+
"version": "2.8.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/cjs/index.js",
|
|
@@ -27,25 +27,37 @@
|
|
|
27
27
|
"./cli": {
|
|
28
28
|
"jsnext:source": "./src/index.ts",
|
|
29
29
|
"default": "./dist/cjs/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./release-note": {
|
|
32
|
+
"jsnext:source": "./src/commands/releaseNote.ts",
|
|
33
|
+
"import": "./dist/esm/commands/releaseNote.js",
|
|
34
|
+
"require": "./dist/cjs/commands/releaseNote.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"typesVersions": {
|
|
38
|
+
"*": {
|
|
39
|
+
"release-note": [
|
|
40
|
+
"./dist/types/commands/releaseNote.d.ts"
|
|
41
|
+
]
|
|
30
42
|
}
|
|
31
43
|
},
|
|
32
44
|
"dependencies": {
|
|
33
45
|
"@babel/runtime": "^7.18.0",
|
|
34
|
-
"@changesets/cli": "^2.
|
|
46
|
+
"@changesets/cli": "^2.26.0",
|
|
35
47
|
"@changesets/git": "^1.3.2",
|
|
36
48
|
"@changesets/read": "^0.5.5",
|
|
37
49
|
"resolve-from": "^5.0.0",
|
|
38
|
-
"@modern-js/plugin-i18n": "2.
|
|
39
|
-
"@modern-js/utils": "2.
|
|
50
|
+
"@modern-js/plugin-i18n": "2.8.0",
|
|
51
|
+
"@modern-js/utils": "2.8.0"
|
|
40
52
|
},
|
|
41
53
|
"devDependencies": {
|
|
42
54
|
"@types/jest": "^27",
|
|
43
55
|
"@types/node": "^14",
|
|
44
56
|
"typescript": "^4",
|
|
45
57
|
"jest": "^27",
|
|
46
|
-
"@modern-js/core": "2.
|
|
47
|
-
"@scripts/
|
|
48
|
-
"@scripts/
|
|
58
|
+
"@modern-js/core": "2.8.0",
|
|
59
|
+
"@scripts/build": "2.8.0",
|
|
60
|
+
"@scripts/jest-config": "2.8.0"
|
|
49
61
|
},
|
|
50
62
|
"sideEffects": false,
|
|
51
63
|
"publishConfig": {
|