@modern-js/generator-utils 3.0.4 → 3.0.6

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,5 +1,36 @@
1
1
  # @modern-js/generator-utils
2
2
 
3
+ ## 3.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 1023fbb: feat: new command tooitip support code highlight
8
+
9
+ feat: new 命令提示支持代码高亮
10
+
11
+ - Updated dependencies [98a2733]
12
+ - Updated dependencies [b4e01e7]
13
+ - Updated dependencies [8c2db5f]
14
+ - @modern-js/utils@2.4.0
15
+ - @modern-js/generator-common@3.0.6
16
+ - @modern-js/plugin-i18n@2.4.0
17
+
18
+ ## 3.0.5
19
+
20
+ ### Patch Changes
21
+
22
+ - 70fb3d5: fix: use yarn not get right package version
23
+
24
+ fix: 修复使用 yarn 获取包版本失败问题
25
+
26
+ - Updated dependencies [fd5a3ed]
27
+ - Updated dependencies [61c1ce5]
28
+ - Updated dependencies [6ca1c0b]
29
+ - Updated dependencies [89b6739]
30
+ - @modern-js/utils@2.3.0
31
+ - @modern-js/generator-common@3.0.5
32
+ - @modern-js/plugin-i18n@2.3.0
33
+
3
34
  ## 3.0.4
4
35
 
5
36
  ### Patch Changes
package/README.md CHANGED
@@ -1,30 +1,26 @@
1
-
2
1
  <p align="center">
3
2
  <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>
4
3
  </p>
4
+
5
+ <h1 align="center">Modern.js</h1>
6
+
5
7
  <p align="center">
6
- 现代 Web 工程体系
7
- <br/>
8
- <a href="https://modernjs.dev" target="blank">
9
- modernjs.dev
10
- </a>
11
- </p>
12
- <p align="center">
13
- The meta-framework suite designed from scratch for frontend-focused modern web development
8
+ A Progressive React Framework for modern web development.
14
9
  </p>
15
10
 
16
- # Introduction
17
-
18
- > 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.
11
+ ## Getting Started
19
12
 
20
- - [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)
13
+ Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
21
14
 
22
- ## Getting Started
15
+ ## Documentation
23
16
 
24
- - [Quick Start](https://modernjs.dev/docs/start)
25
- - [Guides](https://modernjs.dev/docs/guides)
26
- - [API References](https://modernjs.dev/docs/apis)
17
+ - [English Documentation](https://modernjs.dev/en/)
18
+ - [中文文档](https://modernjs.dev)
27
19
 
28
20
  ## Contributing
29
21
 
30
- - [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)
22
+ Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
23
+
24
+ ## License
25
+
26
+ Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
@@ -25,8 +25,7 @@ import {
25
25
  execa,
26
26
  getMonorepoPackages,
27
27
  canUseNpm,
28
- canUsePnpm,
29
- canUseYarn
28
+ canUsePnpm
30
29
  } from "@modern-js/utils";
31
30
  import { SolutionToolsMap } from "@modern-js/generator-common";
32
31
  import { stripAnsi } from "./utils/strip-ansi";
@@ -39,11 +38,12 @@ import {
39
38
  fs as fs2,
40
39
  semver,
41
40
  execa as execa2,
41
+ chalk,
42
42
  readTsConfigByFile,
43
43
  getPackageManager,
44
44
  canUseNpm as canUseNpm2,
45
45
  canUsePnpm as canUsePnpm2,
46
- canUseYarn as canUseYarn2,
46
+ canUseYarn,
47
47
  isReact18
48
48
  } from "@modern-js/utils";
49
49
  import { i18n as i18n2 } from "./locale";
@@ -62,15 +62,6 @@ function getPackageVersion(packageName, registry) {
62
62
  spinner.stop();
63
63
  return stripAnsi(result.stdout);
64
64
  }
65
- if (yield canUseYarn()) {
66
- const args = ["info", packageName, "version", "--silent"];
67
- if (registry) {
68
- args.push(`--registry=${registry}`);
69
- }
70
- const result = yield execa("yarn", args);
71
- spinner.stop();
72
- return stripAnsi(result.stdout);
73
- }
74
65
  if (yield canUseNpm()) {
75
66
  const args = ["view", packageName, "version"];
76
67
  if (registry) {
@@ -196,7 +187,8 @@ function getModernConfigFile(appDir) {
196
187
  export {
197
188
  canUseNpm2 as canUseNpm,
198
189
  canUsePnpm2 as canUsePnpm,
199
- canUseYarn2 as canUseYarn,
190
+ canUseYarn,
191
+ chalk,
200
192
  execa2 as execa,
201
193
  fs2 as fs,
202
194
  getAllPackages,
@@ -47,6 +47,7 @@ __export(src_exports, {
47
47
  canUseNpm: () => import_utils2.canUseNpm,
48
48
  canUsePnpm: () => import_utils2.canUsePnpm,
49
49
  canUseYarn: () => import_utils2.canUseYarn,
50
+ chalk: () => import_utils2.chalk,
50
51
  execa: () => import_utils2.execa,
51
52
  fs: () => import_utils2.fs,
52
53
  getAllPackages: () => getAllPackages,
@@ -94,15 +95,6 @@ function getPackageVersion(packageName, registry) {
94
95
  spinner.stop();
95
96
  return (0, import_strip_ansi.stripAnsi)(result.stdout);
96
97
  }
97
- if (yield (0, import_utils.canUseYarn)()) {
98
- const args = ["info", packageName, "version", "--silent"];
99
- if (registry) {
100
- args.push(`--registry=${registry}`);
101
- }
102
- const result = yield (0, import_utils.execa)("yarn", args);
103
- spinner.stop();
104
- return (0, import_strip_ansi.stripAnsi)(result.stdout);
105
- }
106
98
  if (yield (0, import_utils.canUseNpm)()) {
107
99
  const args = ["view", packageName, "version"];
108
100
  if (registry) {
@@ -230,6 +222,7 @@ function getModernConfigFile(appDir) {
230
222
  canUseNpm,
231
223
  canUsePnpm,
232
224
  canUseYarn,
225
+ chalk,
233
226
  execa,
234
227
  fs,
235
228
  getAllPackages,
@@ -1,7 +1,7 @@
1
1
  import { Solution } from '@modern-js/generator-common';
2
2
  import { GeneratorContext } from '@modern-js/codesmith';
3
3
  export * from './utils';
4
- export { ora, fs, semver, execa, readTsConfigByFile, getPackageManager, canUseNpm, canUsePnpm, canUseYarn, isReact18 } from '@modern-js/utils';
4
+ export { ora, fs, semver, execa, chalk, readTsConfigByFile, getPackageManager, canUseNpm, canUsePnpm, canUseYarn, isReact18 } from '@modern-js/utils';
5
5
  export { i18n } from './locale';
6
6
  export declare function getPackageVersion(packageName: string, registry?: string): Promise<string>;
7
7
  export declare function getModernVersion(solution: Solution, registry?: string, distTag?: string): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modern-js/generator-utils",
3
- "description": "The meta-framework suite designed from scratch for frontend-focused modern web development.",
3
+ "description": "A Progressive React Framework for modern web development.",
4
4
  "homepage": "https://modernjs.dev",
5
5
  "bugs": "https://github.com/modern-js-dev/modern.js/issues",
6
6
  "repository": "modern-js-dev/modern.js",
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "3.0.4",
14
+ "version": "3.0.6",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -28,9 +28,9 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.18.0",
31
- "@modern-js/plugin-i18n": "2.2.0",
32
- "@modern-js/generator-common": "3.0.4",
33
- "@modern-js/utils": "2.2.0"
31
+ "@modern-js/generator-common": "3.0.6",
32
+ "@modern-js/plugin-i18n": "2.4.0",
33
+ "@modern-js/utils": "2.4.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@modern-js/codesmith": "2.0.3",
@@ -38,8 +38,8 @@
38
38
  "@types/node": "^14",
39
39
  "jest": "^27",
40
40
  "typescript": "^4",
41
- "@scripts/build": "2.2.0",
42
- "@scripts/jest-config": "2.2.0"
41
+ "@scripts/build": "2.4.0",
42
+ "@scripts/jest-config": "2.4.0"
43
43
  },
44
44
  "sideEffects": false,
45
45
  "modernConfig": {