@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 CHANGED
@@ -1,87 +1,50 @@
1
1
  # @modern-js/plugin-changeset
2
2
 
3
- ## 1.1.0
3
+ ## 1.2.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - 96119db2: Relese v1.1.0
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
- PR
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
- ISSUE
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
- - [235](https://github.com/modern-js-dev/modern.js/issues/235)
67
- - [257](https://github.com/modern-js-dev/modern.js/issues/257)
20
+ ## 1.1.2
68
21
 
69
- PR
22
+ ### Patch Changes
70
23
 
71
- - [269](https://github.com/modern-js-dev/modern.js/pull/269)
72
- - [271](https://github.com/modern-js-dev/modern.js/pull/271)
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
- 6. 修复 Node17 dev 命令报错问题
30
+ ## 1.1.1
75
31
 
76
- ISSUE
32
+ ### Patch Changes
77
33
 
78
- - [180](https://github.com/modern-js-dev/modern.js/issues/180)
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
- PR
43
+ ## 1.1.0
81
44
 
82
- - [214](https://github.com/modern-js-dev/modern.js/pull/214)
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('node', [CHANGESET_PATH, 'pre', 'enter', preid || 'next']);
27
+ await execaWithStreamLog(process.execPath, [CHANGESET_PATH, 'pre', 'enter', preid || 'next']);
28
28
 
29
29
  try {
30
- await execaWithStreamLog('node', params);
31
- await execaWithStreamLog('node', [CHANGESET_PATH, 'pre', 'exit']);
30
+ await execaWithStreamLog(process.execPath, params);
31
+ await execaWithStreamLog(process.execPath, [CHANGESET_PATH, 'pre', 'exit']);
32
32
  } catch (e) {
33
- await execaWithStreamLog('node', [CHANGESET_PATH, 'pre', 'exit']);
33
+ await execaWithStreamLog(process.execPath, [CHANGESET_PATH, 'pre', 'exit']);
34
34
  }
35
35
  } else {
36
- await execaWithStreamLog('node', params);
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('node', params);
33
+ await execaWithStreamLog(process.execPath, params);
34
34
  }
@@ -6,5 +6,5 @@ export async function pre(type, tag = 'next') {
6
6
  params.push(tag);
7
7
  }
8
8
 
9
- await execaWithStreamLog('node', params);
9
+ await execaWithStreamLog(process.execPath, params);
10
10
  }
@@ -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('node', [CHANGESET_PATH, ...params]);
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)('node', [_utils.CHANGESET_PATH, 'pre', 'enter', preid || 'next']);
35
+ await (0, _utils.execaWithStreamLog)(process.execPath, [_utils.CHANGESET_PATH, 'pre', 'enter', preid || 'next']);
36
36
 
37
37
  try {
38
- await (0, _utils.execaWithStreamLog)('node', params);
39
- await (0, _utils.execaWithStreamLog)('node', [_utils.CHANGESET_PATH, 'pre', 'exit']);
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)('node', [_utils.CHANGESET_PATH, 'pre', 'exit']);
41
+ await (0, _utils.execaWithStreamLog)(process.execPath, [_utils.CHANGESET_PATH, 'pre', 'exit']);
42
42
  }
43
43
  } else {
44
- await (0, _utils.execaWithStreamLog)('node', params);
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)('node', params);
45
+ await (0, _utils2.execaWithStreamLog)(process.execPath, params);
46
46
  }
@@ -14,5 +14,5 @@ async function pre(type, tag = 'next') {
14
14
  params.push(tag);
15
15
  }
16
16
 
17
- await (0, _utils.execaWithStreamLog)('node', params);
17
+ await (0, _utils.execaWithStreamLog)(process.execPath, params);
18
18
  }
@@ -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)('node', [_utils2.CHANGESET_PATH, ...params]);
36
+ await (0, _utils2.execaWithStreamLog)(process.execPath, [_utils2.CHANGESET_PATH, ...params]);
37
37
  return;
38
38
  }
39
39
 
package/jest.config.js ADDED
@@ -0,0 +1,8 @@
1
+ const sharedConfig = require('@scripts/jest-config');
2
+
3
+ /** @type {import('@jest/types').Config.InitialOptions} */
4
+ module.exports = {
5
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
6
+ ...sharedConfig,
7
+ rootDir: __dirname,
8
+ };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.1.0",
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": "./dist/js/node/index.js"
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.1.0",
35
- "@modern-js/plugin-i18n": "^1.1.0",
36
- "@modern-js/utils": "^1.1.0",
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.1.0",
41
- "@modern-js/module-tools": "^1.0.2",
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.1.0"
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": "modern test --passWithNoTests"
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
  }
@@ -26,19 +26,27 @@ export async function bump(options: BumpOptions) {
26
26
  }
27
27
 
28
28
  if (canary) {
29
- await execaWithStreamLog('node', [
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('node', params);
37
- await execaWithStreamLog('node', [CHANGESET_PATH, 'pre', 'exit']);
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('node', [CHANGESET_PATH, 'pre', 'exit']);
43
+ await execaWithStreamLog(process.execPath, [
44
+ CHANGESET_PATH,
45
+ 'pre',
46
+ 'exit',
47
+ ]);
40
48
  }
41
49
  } else {
42
- await execaWithStreamLog('node', params);
50
+ await execaWithStreamLog(process.execPath, params);
43
51
  }
44
52
  }
@@ -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('node', params);
39
+ await execaWithStreamLog(process.execPath, params);
40
40
  }
@@ -7,5 +7,5 @@ export async function pre(type: 'enter' | 'exit', tag = 'next') {
7
7
  params.push(tag);
8
8
  }
9
9
 
10
- await execaWithStreamLog('node', params);
10
+ await execaWithStreamLog(process.execPath, params);
11
11
  }
@@ -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('node', [CHANGESET_PATH, ...params]);
27
+ await execaWithStreamLog(process.execPath, [CHANGESET_PATH, ...params]);
28
28
  return;
29
29
  }
30
30
 
@@ -0,0 +1,7 @@
1
+ import plugin from '../src';
2
+
3
+ describe('plugin-changeset', () => {
4
+ it('default', () => {
5
+ expect(plugin).toBeDefined();
6
+ });
7
+ });
package/tsconfig.json CHANGED
@@ -5,9 +5,7 @@
5
5
  "jsx": "preserve",
6
6
  "baseUrl": "./",
7
7
  "isolatedModules": true,
8
- "paths": {
9
- "@/*": ["./src/*"]
10
- }
8
+ "paths": {}
11
9
  },
12
10
  "include": ["src"]
13
11
  }