@modern-js/plugin-changeset 1.1.0 → 1.2.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 +31 -68
- package/dist/js/modern/commands/bump.js +5 -5
- package/dist/js/modern/commands/change.js +2 -2
- package/dist/js/modern/commands/pre.js +1 -1
- package/dist/js/modern/commands/release.js +2 -2
- package/dist/js/node/commands/bump.js +5 -5
- package/dist/js/node/commands/change.js +2 -2
- package/dist/js/node/commands/pre.js +1 -1
- package/dist/js/node/commands/release.js +2 -2
- package/jest.config.js +8 -0
- package/package.json +20 -13
- package/src/commands/bump.ts +13 -5
- package/src/commands/change.ts +2 -2
- package/src/commands/pre.ts +1 -1
- package/src/commands/release.ts +2 -2
- package/tests/index.test.ts +7 -0
- package/tsconfig.json +1 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,87 +1,50 @@
|
|
|
1
1
|
# @modern-js/plugin-changeset
|
|
2
2
|
|
|
3
|
-
## 1.
|
|
3
|
+
## 1.2.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
1. 全面支持 Windows 平台
|
|
10
|
-
|
|
11
|
-
ISSUE:
|
|
12
|
-
|
|
13
|
-
- [182](https://github.com/modern-js-dev/modern.js/issues/182)
|
|
14
|
-
- [236](https://github.com/modern-js-dev/modern.js/issues/236)
|
|
15
|
-
|
|
16
|
-
PR
|
|
17
|
-
|
|
18
|
-
- [219](https://github.com/modern-js-dev/modern.js/pull/219)
|
|
19
|
-
- [247](https://github.com/modern-js-dev/modern.js/pull/247)
|
|
20
|
-
- [249](https://github.com/modern-js-dev/modern.js/pull/249)
|
|
21
|
-
- [253](https://github.com/modern-js-dev/modern.js/pull/253)
|
|
22
|
-
- [268](https://github.com/modern-js-dev/modern.js/pull/268)
|
|
23
|
-
- [270](https://github.com/modern-js-dev/modern.js/pull/270)
|
|
24
|
-
- [273](https://github.com/modern-js-dev/modern.js/pull/273)
|
|
25
|
-
- [276](https://github.com/modern-js-dev/modern.js/pull/276)
|
|
26
|
-
|
|
27
|
-
2. 修复 Unbundled 模式启用问题
|
|
28
|
-
|
|
29
|
-
ISSUE
|
|
30
|
-
|
|
31
|
-
- [186](https://github.com/modern-js-dev/modern.js/issues/186)
|
|
32
|
-
- [224](https://github.com/modern-js-dev/modern.js/issues/224)
|
|
33
|
-
- [225](https://github.com/modern-js-dev/modern.js/issues/225)
|
|
34
|
-
- [238](https://github.com/modern-js-dev/modern.js/issues/238)
|
|
35
|
-
|
|
36
|
-
PR
|
|
37
|
-
|
|
38
|
-
- [226](https://github.com/modern-js-dev/modern.js/pull/226)
|
|
39
|
-
- [264](https://github.com/modern-js-dev/modern.js/pull/264)
|
|
40
|
-
- [codesmith-12](https://github.com/modern-js-dev/codesmith/pull/12)
|
|
41
|
-
|
|
42
|
-
3. 修复模块工程方案 .npmignore 文件初始化未生成
|
|
43
|
-
|
|
44
|
-
ISSUE
|
|
45
|
-
|
|
46
|
-
- [198](https://github.com/modern-js-dev/modern.js/issues/198)
|
|
7
|
+
- cfe11628: Make Modern.js self bootstraping
|
|
47
8
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
- [209](https://github.com/modern-js-dev/modern.js/pull/209)
|
|
51
|
-
|
|
52
|
-
4. 修复 Storybook 使用时浏览器打开页面报错
|
|
53
|
-
|
|
54
|
-
ISSUE
|
|
55
|
-
|
|
56
|
-
- [228](https://github.com/modern-js-dev/modern.js/issues/228)
|
|
57
|
-
|
|
58
|
-
PR
|
|
59
|
-
|
|
60
|
-
- [254](https://github.com/modern-js-dev/modern.js/pull/254)
|
|
61
|
-
|
|
62
|
-
5. 修复 BFF 一体化开发不支持 unbundle 模式
|
|
9
|
+
### Patch Changes
|
|
63
10
|
|
|
64
|
-
|
|
11
|
+
- Updated dependencies [2da09c69]
|
|
12
|
+
- Updated dependencies [fc71e36f]
|
|
13
|
+
- Updated dependencies [c3d46ee4]
|
|
14
|
+
- Updated dependencies [cfe11628]
|
|
15
|
+
- @modern-js/utils@1.2.0
|
|
16
|
+
- @modern-js/core@1.3.0
|
|
17
|
+
- @modern-js/i18n-cli-language-detector@1.2.0
|
|
18
|
+
- @modern-js/plugin-i18n@1.2.0
|
|
65
19
|
|
|
66
|
-
|
|
67
|
-
- [257](https://github.com/modern-js-dev/modern.js/issues/257)
|
|
20
|
+
## 1.1.2
|
|
68
21
|
|
|
69
|
-
|
|
22
|
+
### Patch Changes
|
|
70
23
|
|
|
71
|
-
|
|
72
|
-
|
|
24
|
+
- b7fb82ec: fix: get package manager function
|
|
25
|
+
- Updated dependencies [5e3de7d8]
|
|
26
|
+
- Updated dependencies [b7fb82ec]
|
|
27
|
+
- @modern-js/plugin-i18n@1.1.2
|
|
28
|
+
- @modern-js/utils@1.1.6
|
|
73
29
|
|
|
74
|
-
|
|
30
|
+
## 1.1.1
|
|
75
31
|
|
|
76
|
-
|
|
32
|
+
### Patch Changes
|
|
77
33
|
|
|
78
|
-
|
|
34
|
+
- 0fa83663: support more .env files
|
|
35
|
+
- Updated dependencies [6f7fe574]
|
|
36
|
+
- Updated dependencies [0fa83663]
|
|
37
|
+
- Updated dependencies [f594fbc8]
|
|
38
|
+
- @modern-js/core@1.1.2
|
|
39
|
+
- @modern-js/i18n-cli-language-detector@1.1.1
|
|
40
|
+
- @modern-js/plugin-i18n@1.1.1
|
|
41
|
+
- @modern-js/utils@1.1.2
|
|
79
42
|
|
|
80
|
-
|
|
43
|
+
## 1.1.0
|
|
81
44
|
|
|
82
|
-
|
|
45
|
+
### Minor Changes
|
|
83
46
|
|
|
84
|
-
### Patch Changes
|
|
47
|
+
- 96119db2: Relese v1.1.0### Patch Changes
|
|
85
48
|
|
|
86
49
|
- Updated dependencies [96119db2]
|
|
87
50
|
- Updated dependencies [eb00b569]
|
|
@@ -24,15 +24,15 @@ export async function bump(options) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
if (canary) {
|
|
27
|
-
await execaWithStreamLog(
|
|
27
|
+
await execaWithStreamLog(process.execPath, [CHANGESET_PATH, 'pre', 'enter', preid || 'next']);
|
|
28
28
|
|
|
29
29
|
try {
|
|
30
|
-
await execaWithStreamLog(
|
|
31
|
-
await execaWithStreamLog(
|
|
30
|
+
await execaWithStreamLog(process.execPath, params);
|
|
31
|
+
await execaWithStreamLog(process.execPath, [CHANGESET_PATH, 'pre', 'exit']);
|
|
32
32
|
} catch (e) {
|
|
33
|
-
await execaWithStreamLog(
|
|
33
|
+
await execaWithStreamLog(process.execPath, [CHANGESET_PATH, 'pre', 'exit']);
|
|
34
34
|
}
|
|
35
35
|
} else {
|
|
36
|
-
await execaWithStreamLog(
|
|
36
|
+
await execaWithStreamLog(process.execPath, params);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -8,7 +8,7 @@ export async function change(options) {
|
|
|
8
8
|
const packages = getMonorepoPackages(appDir);
|
|
9
9
|
|
|
10
10
|
if (packages.length === 0) {
|
|
11
|
-
const packageManager = getPackageManager(appDir);
|
|
11
|
+
const packageManager = await getPackageManager(appDir);
|
|
12
12
|
logger.warn(i18n.t(localeKeys.command.change.no_packages, {
|
|
13
13
|
packageManager: packageManager === 'yarn' ? 'yarn' : `${packageManager} run`
|
|
14
14
|
}));
|
|
@@ -30,5 +30,5 @@ export async function change(options) {
|
|
|
30
30
|
params.push('--open');
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
await execaWithStreamLog(
|
|
33
|
+
await execaWithStreamLog(process.execPath, params);
|
|
34
34
|
}
|
|
@@ -6,7 +6,7 @@ import { CHANGESET_PATH, execaWithStreamLog } from "../utils";
|
|
|
6
6
|
export async function release(options) {
|
|
7
7
|
const appDir = process.cwd();
|
|
8
8
|
const isMonorepo = isModernjsMonorepo(appDir);
|
|
9
|
-
const packageManager = getPackageManager(process.cwd());
|
|
9
|
+
const packageManager = await getPackageManager(process.cwd());
|
|
10
10
|
const params = ['publish'];
|
|
11
11
|
const {
|
|
12
12
|
tag,
|
|
@@ -20,7 +20,7 @@ export async function release(options) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
if (!isMonorepo || packageManager === 'yarn') {
|
|
23
|
-
await execaWithStreamLog(
|
|
23
|
+
await execaWithStreamLog(process.execPath, [CHANGESET_PATH, ...params]);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -32,15 +32,15 @@ async function bump(options) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
if (canary) {
|
|
35
|
-
await (0, _utils.execaWithStreamLog)(
|
|
35
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, [_utils.CHANGESET_PATH, 'pre', 'enter', preid || 'next']);
|
|
36
36
|
|
|
37
37
|
try {
|
|
38
|
-
await (0, _utils.execaWithStreamLog)(
|
|
39
|
-
await (0, _utils.execaWithStreamLog)(
|
|
38
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, params);
|
|
39
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, [_utils.CHANGESET_PATH, 'pre', 'exit']);
|
|
40
40
|
} catch (e) {
|
|
41
|
-
await (0, _utils.execaWithStreamLog)(
|
|
41
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, [_utils.CHANGESET_PATH, 'pre', 'exit']);
|
|
42
42
|
}
|
|
43
43
|
} else {
|
|
44
|
-
await (0, _utils.execaWithStreamLog)(
|
|
44
|
+
await (0, _utils.execaWithStreamLog)(process.execPath, params);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -18,7 +18,7 @@ async function change(options) {
|
|
|
18
18
|
const packages = (0, _utils.getMonorepoPackages)(appDir);
|
|
19
19
|
|
|
20
20
|
if (packages.length === 0) {
|
|
21
|
-
const packageManager = (0, _utils.getPackageManager)(appDir);
|
|
21
|
+
const packageManager = await (0, _utils.getPackageManager)(appDir);
|
|
22
22
|
|
|
23
23
|
_utils.logger.warn(_locale.i18n.t(_locale.localeKeys.command.change.no_packages, {
|
|
24
24
|
packageManager: packageManager === 'yarn' ? 'yarn' : `${packageManager} run`
|
|
@@ -42,5 +42,5 @@ async function change(options) {
|
|
|
42
42
|
params.push('--open');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
await (0, _utils2.execaWithStreamLog)(
|
|
45
|
+
await (0, _utils2.execaWithStreamLog)(process.execPath, params);
|
|
46
46
|
}
|
|
@@ -19,7 +19,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
19
19
|
async function release(options) {
|
|
20
20
|
const appDir = process.cwd();
|
|
21
21
|
const isMonorepo = (0, _utils.isModernjsMonorepo)(appDir);
|
|
22
|
-
const packageManager = (0, _utils.getPackageManager)(process.cwd());
|
|
22
|
+
const packageManager = await (0, _utils.getPackageManager)(process.cwd());
|
|
23
23
|
const params = ['publish'];
|
|
24
24
|
const {
|
|
25
25
|
tag,
|
|
@@ -33,7 +33,7 @@ async function release(options) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
if (!isMonorepo || packageManager === 'yarn') {
|
|
36
|
-
await (0, _utils2.execaWithStreamLog)(
|
|
36
|
+
await (0, _utils2.execaWithStreamLog)(process.execPath, [_utils2.CHANGESET_PATH, ...params]);
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.2.0",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -20,32 +20,37 @@
|
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
22
|
"node": {
|
|
23
|
+
"jsnext:source": "./src/index.ts",
|
|
23
24
|
"import": "./dist/js/modern/index.js",
|
|
24
25
|
"require": "./dist/js/node/index.js"
|
|
25
26
|
},
|
|
26
27
|
"default": "./dist/js/treeshaking/index.js"
|
|
27
28
|
},
|
|
28
|
-
"./cli":
|
|
29
|
+
"./cli": {
|
|
30
|
+
"jsnext:source": "./src/index.ts",
|
|
31
|
+
"default": "./dist/js/node/index.js"
|
|
32
|
+
}
|
|
29
33
|
},
|
|
30
34
|
"dependencies": {
|
|
31
35
|
"@babel/runtime": "^7",
|
|
32
36
|
"@changesets/cli": "2.16.0",
|
|
33
37
|
"@changesets/git": "^1.1.2",
|
|
34
|
-
"@modern-js/i18n-cli-language-detector": "^1.
|
|
35
|
-
"@modern-js/plugin-i18n": "^1.
|
|
36
|
-
"@modern-js/utils": "^1.
|
|
38
|
+
"@modern-js/i18n-cli-language-detector": "^1.2.0",
|
|
39
|
+
"@modern-js/plugin-i18n": "^1.2.0",
|
|
40
|
+
"@modern-js/utils": "^1.2.0",
|
|
37
41
|
"execa": "^5.1.1"
|
|
38
42
|
},
|
|
39
43
|
"devDependencies": {
|
|
40
|
-
"@modern-js/core": "^1.
|
|
41
|
-
"@
|
|
42
|
-
"@modern-js/plugin-testing": "^1.0.2",
|
|
44
|
+
"@modern-js/core": "^1.3.0",
|
|
45
|
+
"@scripts/build": "0.0.0",
|
|
43
46
|
"@types/jest": "^26",
|
|
44
47
|
"@types/node": "^14",
|
|
45
|
-
"typescript": "^4"
|
|
48
|
+
"typescript": "^4",
|
|
49
|
+
"jest": "^27",
|
|
50
|
+
"@scripts/jest-config": "0.0.0"
|
|
46
51
|
},
|
|
47
52
|
"peerDependencies": {
|
|
48
|
-
"@modern-js/core": "^1.
|
|
53
|
+
"@modern-js/core": "^1.3.0"
|
|
49
54
|
},
|
|
50
55
|
"sideEffects": false,
|
|
51
56
|
"modernConfig": {
|
|
@@ -55,11 +60,13 @@
|
|
|
55
60
|
},
|
|
56
61
|
"publishConfig": {
|
|
57
62
|
"registry": "https://registry.npmjs.org/",
|
|
58
|
-
"access": "public"
|
|
63
|
+
"access": "public",
|
|
64
|
+
"types": "./dist/types/index.d.ts"
|
|
59
65
|
},
|
|
60
66
|
"scripts": {
|
|
61
67
|
"new": "modern new",
|
|
62
68
|
"build": "modern build",
|
|
63
|
-
"test": "
|
|
64
|
-
}
|
|
69
|
+
"test": "jest --passWithNoTests"
|
|
70
|
+
},
|
|
71
|
+
"readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
|
|
65
72
|
}
|
package/src/commands/bump.ts
CHANGED
|
@@ -26,19 +26,27 @@ export async function bump(options: BumpOptions) {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (canary) {
|
|
29
|
-
await execaWithStreamLog(
|
|
29
|
+
await execaWithStreamLog(process.execPath, [
|
|
30
30
|
CHANGESET_PATH,
|
|
31
31
|
'pre',
|
|
32
32
|
'enter',
|
|
33
33
|
preid || 'next',
|
|
34
34
|
]);
|
|
35
35
|
try {
|
|
36
|
-
await execaWithStreamLog(
|
|
37
|
-
await execaWithStreamLog(
|
|
36
|
+
await execaWithStreamLog(process.execPath, params);
|
|
37
|
+
await execaWithStreamLog(process.execPath, [
|
|
38
|
+
CHANGESET_PATH,
|
|
39
|
+
'pre',
|
|
40
|
+
'exit',
|
|
41
|
+
]);
|
|
38
42
|
} catch (e) {
|
|
39
|
-
await execaWithStreamLog(
|
|
43
|
+
await execaWithStreamLog(process.execPath, [
|
|
44
|
+
CHANGESET_PATH,
|
|
45
|
+
'pre',
|
|
46
|
+
'exit',
|
|
47
|
+
]);
|
|
40
48
|
}
|
|
41
49
|
} else {
|
|
42
|
-
await execaWithStreamLog(
|
|
50
|
+
await execaWithStreamLog(process.execPath, params);
|
|
43
51
|
}
|
|
44
52
|
}
|
package/src/commands/change.ts
CHANGED
|
@@ -16,7 +16,7 @@ export async function change(options: ChangeOptions) {
|
|
|
16
16
|
if (isMonorepo(appDir)) {
|
|
17
17
|
const packages = getMonorepoPackages(appDir);
|
|
18
18
|
if (packages.length === 0) {
|
|
19
|
-
const packageManager = getPackageManager(appDir);
|
|
19
|
+
const packageManager = await getPackageManager(appDir);
|
|
20
20
|
logger.warn(
|
|
21
21
|
i18n.t(localeKeys.command.change.no_packages, {
|
|
22
22
|
packageManager:
|
|
@@ -36,5 +36,5 @@ export async function change(options: ChangeOptions) {
|
|
|
36
36
|
params.push('--open');
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
await execaWithStreamLog(
|
|
39
|
+
await execaWithStreamLog(process.execPath, params);
|
|
40
40
|
}
|
package/src/commands/pre.ts
CHANGED
package/src/commands/release.ts
CHANGED
|
@@ -12,7 +12,7 @@ interface PublishOptions {
|
|
|
12
12
|
export async function release(options: PublishOptions) {
|
|
13
13
|
const appDir = process.cwd();
|
|
14
14
|
const isMonorepo = isModernjsMonorepo(appDir);
|
|
15
|
-
const packageManager = getPackageManager(process.cwd());
|
|
15
|
+
const packageManager = await getPackageManager(process.cwd());
|
|
16
16
|
|
|
17
17
|
const params = ['publish'];
|
|
18
18
|
|
|
@@ -24,7 +24,7 @@ export async function release(options: PublishOptions) {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
if (!isMonorepo || packageManager === 'yarn') {
|
|
27
|
-
await execaWithStreamLog(
|
|
27
|
+
await execaWithStreamLog(process.execPath, [CHANGESET_PATH, ...params]);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
|