@modern-js/generator-utils 1.2.1 → 1.2.4
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/.eslintrc.js +8 -0
- package/CHANGELOG.md +45 -0
- package/dist/js/modern/index.js +3 -6
- package/dist/js/modern/locale/en.js +1 -1
- package/dist/js/modern/locale/zh.js +1 -1
- package/dist/js/node/index.js +5 -10
- package/dist/js/node/locale/en.js +1 -1
- package/dist/js/node/locale/zh.js +1 -1
- package/dist/types/locale/en.d.ts +1 -1
- package/dist/types/locale/index.d.ts +2 -2
- package/dist/types/locale/zh.d.ts +1 -1
- package/jest.config.js +0 -1
- package/package.json +5 -8
- package/tests/.eslintrc.js +0 -6
- package/tests/index.test.ts +0 -8
- package/tests/tsconfig.json +0 -9
package/.eslintrc.js
ADDED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @modern-js/generator-utils
|
|
2
2
|
|
|
3
|
+
## 1.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6b0bb5e3b: feat: bump codesmith version
|
|
8
|
+
- 69a728375: fix: remove exports.jsnext:source after publish
|
|
9
|
+
- Updated dependencies [cd7346b0d]
|
|
10
|
+
- Updated dependencies [69a728375]
|
|
11
|
+
- @modern-js/utils@1.7.2
|
|
12
|
+
- @modern-js/plugin-i18n@1.2.5
|
|
13
|
+
|
|
14
|
+
## 1.2.3
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 592edabc: feat: prebundle url-join,mime-types,json5,fast-glob,globby,ora,inquirer
|
|
19
|
+
- Updated dependencies [2d155c4c]
|
|
20
|
+
- Updated dependencies [123e432d]
|
|
21
|
+
- Updated dependencies [e5a9b26d]
|
|
22
|
+
- Updated dependencies [0b26b93b]
|
|
23
|
+
- Updated dependencies [123e432d]
|
|
24
|
+
- Updated dependencies [f9f66ef9]
|
|
25
|
+
- Updated dependencies [592edabc]
|
|
26
|
+
- Updated dependencies [895fa0ff]
|
|
27
|
+
- Updated dependencies [3578913e]
|
|
28
|
+
- Updated dependencies [1c3beab3]
|
|
29
|
+
- @modern-js/utils@1.6.0
|
|
30
|
+
|
|
31
|
+
## 1.2.2
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- 6cffe99d: chore:
|
|
36
|
+
remove react eslint rules for `modern-js` rule set.
|
|
37
|
+
add .eslintrc for each package to speed up linting
|
|
38
|
+
- 04ae5262: chore: bump @modern-js/utils to v1.4.1 in dependencies
|
|
39
|
+
- 60f7d8bf: feat: add tests dir to npmignore
|
|
40
|
+
- Updated dependencies [b8599d09]
|
|
41
|
+
- Updated dependencies [6cffe99d]
|
|
42
|
+
- Updated dependencies [04ae5262]
|
|
43
|
+
- Updated dependencies [60f7d8bf]
|
|
44
|
+
- Updated dependencies [3bf4f8b0]
|
|
45
|
+
- @modern-js/utils@1.5.0
|
|
46
|
+
- @modern-js/plugin-i18n@1.2.4
|
|
47
|
+
|
|
3
48
|
## 1.2.1
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
package/dist/js/modern/index.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
import { fs, getMonorepoPackages, canUseNpm, canUsePnpm, canUseYarn } from '@modern-js/utils';
|
|
3
|
-
import execa from 'execa';
|
|
4
|
-
import ora from 'ora';
|
|
2
|
+
import { fs, ora, execa, getMonorepoPackages, canUseNpm, canUsePnpm, canUseYarn } from '@modern-js/utils';
|
|
5
3
|
import { stripAnsi } from "./utils/strip-ansi";
|
|
6
4
|
import { i18n, localeKeys } from "./locale";
|
|
7
5
|
export * from "./utils";
|
|
8
6
|
export { fs, readTsConfigByFile, getPackageManager, canUseNpm, canUsePnpm, canUseYarn } from '@modern-js/utils';
|
|
9
|
-
export { i18n } from "./locale";
|
|
10
|
-
|
|
7
|
+
export { i18n } from "./locale";
|
|
11
8
|
export async function getPackageVersion(packageName, registry) {
|
|
12
9
|
const spinner = ora('Loading...').start();
|
|
13
10
|
spinner.color = 'yellow';
|
|
@@ -102,7 +99,7 @@ export function validatePackagePath(value, projectDir, options) {
|
|
|
102
99
|
if (fs.existsSync(packageDir)) {
|
|
103
100
|
return {
|
|
104
101
|
success: false,
|
|
105
|
-
error: i18n.t(localeKeys.
|
|
102
|
+
error: i18n.t(localeKeys.packagePath.exit, {
|
|
106
103
|
value
|
|
107
104
|
})
|
|
108
105
|
};
|
package/dist/js/node/index.js
CHANGED
|
@@ -77,10 +77,6 @@ var _path = _interopRequireDefault(require("path"));
|
|
|
77
77
|
|
|
78
78
|
var _utils = require("@modern-js/utils");
|
|
79
79
|
|
|
80
|
-
var _execa = _interopRequireDefault(require("execa"));
|
|
81
|
-
|
|
82
|
-
var _ora = _interopRequireDefault(require("ora"));
|
|
83
|
-
|
|
84
80
|
var _stripAnsi = require("./utils/strip-ansi");
|
|
85
81
|
|
|
86
82
|
var _locale = require("./locale");
|
|
@@ -101,9 +97,8 @@ Object.keys(_utils2).forEach(function (key) {
|
|
|
101
97
|
|
|
102
98
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
103
99
|
|
|
104
|
-
// eslint-disable-next-line max-statements
|
|
105
100
|
async function getPackageVersion(packageName, registry) {
|
|
106
|
-
const spinner = (0,
|
|
101
|
+
const spinner = (0, _utils.ora)('Loading...').start();
|
|
107
102
|
spinner.color = 'yellow';
|
|
108
103
|
|
|
109
104
|
if (await (0, _utils.canUsePnpm)()) {
|
|
@@ -113,7 +108,7 @@ async function getPackageVersion(packageName, registry) {
|
|
|
113
108
|
args.push(`--registry=${registry}`);
|
|
114
109
|
}
|
|
115
110
|
|
|
116
|
-
const result = await (0,
|
|
111
|
+
const result = await (0, _utils.execa)('pnpm', args);
|
|
117
112
|
spinner.stop();
|
|
118
113
|
return (0, _stripAnsi.stripAnsi)(result.stdout);
|
|
119
114
|
}
|
|
@@ -125,7 +120,7 @@ async function getPackageVersion(packageName, registry) {
|
|
|
125
120
|
args.push(`--registry=${registry}`);
|
|
126
121
|
}
|
|
127
122
|
|
|
128
|
-
const result = await (0,
|
|
123
|
+
const result = await (0, _utils.execa)('yarn', args);
|
|
129
124
|
spinner.stop();
|
|
130
125
|
return (0, _stripAnsi.stripAnsi)(result.stdout);
|
|
131
126
|
}
|
|
@@ -137,7 +132,7 @@ async function getPackageVersion(packageName, registry) {
|
|
|
137
132
|
args.push(`--registry=${registry}`);
|
|
138
133
|
}
|
|
139
134
|
|
|
140
|
-
const result = await (0,
|
|
135
|
+
const result = await (0, _utils.execa)('npm', args);
|
|
141
136
|
spinner.stop();
|
|
142
137
|
return (0, _stripAnsi.stripAnsi)(result.stdout);
|
|
143
138
|
}
|
|
@@ -202,7 +197,7 @@ function validatePackagePath(value, projectDir, options) {
|
|
|
202
197
|
if (_utils.fs.existsSync(packageDir)) {
|
|
203
198
|
return {
|
|
204
199
|
success: false,
|
|
205
|
-
error: _locale.i18n.t(_locale.localeKeys.
|
|
200
|
+
error: _locale.i18n.t(_locale.localeKeys.packagePath.exit, {
|
|
206
201
|
value
|
|
207
202
|
})
|
|
208
203
|
};
|
package/jest.config.js
CHANGED
|
@@ -2,7 +2,6 @@ const sharedConfig = require('@scripts/jest-config');
|
|
|
2
2
|
|
|
3
3
|
/** @type {import('@jest/types').Config.InitialOptions} */
|
|
4
4
|
module.exports = {
|
|
5
|
-
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
|
6
5
|
...sharedConfig,
|
|
7
6
|
rootDir: __dirname,
|
|
8
7
|
modulePathIgnorePatterns: [
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "1.2.
|
|
14
|
+
"version": "1.2.4",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -29,13 +29,11 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7",
|
|
32
|
-
"@modern-js/plugin-i18n": "^1.2.
|
|
33
|
-
"@modern-js/utils": "^1.
|
|
34
|
-
"execa": "^5.1.1",
|
|
35
|
-
"ora": "^5.4.1"
|
|
32
|
+
"@modern-js/plugin-i18n": "^1.2.5",
|
|
33
|
+
"@modern-js/utils": "^1.7.2"
|
|
36
34
|
},
|
|
37
35
|
"devDependencies": {
|
|
38
|
-
"@modern-js/codesmith": "^1.0.
|
|
36
|
+
"@modern-js/codesmith": "^1.0.10",
|
|
39
37
|
"@types/jest": "^26",
|
|
40
38
|
"@types/node": "^14",
|
|
41
39
|
"typescript": "^4",
|
|
@@ -51,8 +49,7 @@
|
|
|
51
49
|
},
|
|
52
50
|
"publishConfig": {
|
|
53
51
|
"registry": "https://registry.npmjs.org/",
|
|
54
|
-
"access": "public"
|
|
55
|
-
"types": "./dist/types/index.d.ts"
|
|
52
|
+
"access": "public"
|
|
56
53
|
},
|
|
57
54
|
"scripts": {
|
|
58
55
|
"new": "modern new",
|
package/tests/.eslintrc.js
DELETED
package/tests/index.test.ts
DELETED