@modern-js/generator-utils 1.0.0-rc.15 → 1.0.0-rc.19
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 +58 -0
- package/dist/js/modern/index.js +2 -3
- package/dist/js/node/index.js +15 -10
- package/dist/types/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/index.ts +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @modern-js/generator-utils
|
|
2
2
|
|
|
3
|
+
## 1.0.0-rc.19
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 224f7fe: fix server route match
|
|
8
|
+
- 30ac27c: feat: add generator package description
|
|
9
|
+
- 204c626: feat: initial
|
|
10
|
+
- 63be0a5: fix: #118 #104
|
|
11
|
+
- Updated dependencies [224f7fe]
|
|
12
|
+
- Updated dependencies [30ac27c]
|
|
13
|
+
- Updated dependencies [204c626]
|
|
14
|
+
- Updated dependencies [63be0a5]
|
|
15
|
+
- @modern-js/plugin-i18n@1.0.0-rc.19
|
|
16
|
+
- @modern-js/utils@1.0.0-rc.19
|
|
17
|
+
|
|
18
|
+
## 1.0.0-rc.18
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 224f7fe: fix server route match
|
|
23
|
+
- 30ac27c: feat: add generator package description
|
|
24
|
+
- 204c626: feat: initial
|
|
25
|
+
- 63be0a5: fix: #118 #104
|
|
26
|
+
- Updated dependencies [224f7fe]
|
|
27
|
+
- Updated dependencies [30ac27c]
|
|
28
|
+
- Updated dependencies [204c626]
|
|
29
|
+
- Updated dependencies [63be0a5]
|
|
30
|
+
- @modern-js/plugin-i18n@1.0.0-rc.18
|
|
31
|
+
- @modern-js/utils@1.0.0-rc.18
|
|
32
|
+
|
|
33
|
+
## 1.0.0-rc.17
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 224f7fe: fix server route match
|
|
38
|
+
- 30ac27c: feat: add generator package description
|
|
39
|
+
- 204c626: feat: initial
|
|
40
|
+
- fix: #118 #104
|
|
41
|
+
- Updated dependencies [224f7fe]
|
|
42
|
+
- Updated dependencies [30ac27c]
|
|
43
|
+
- Updated dependencies [204c626]
|
|
44
|
+
- Updated dependencies [undefined]
|
|
45
|
+
- @modern-js/plugin-i18n@1.0.0-rc.17
|
|
46
|
+
- @modern-js/utils@1.0.0-rc.17
|
|
47
|
+
|
|
48
|
+
## 1.0.0-rc.16
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- 224f7fe: fix server route match
|
|
53
|
+
- 30ac27c: feat: add generator package description
|
|
54
|
+
- 204c626: feat: initial
|
|
55
|
+
- Updated dependencies [224f7fe]
|
|
56
|
+
- Updated dependencies [30ac27c]
|
|
57
|
+
- Updated dependencies [204c626]
|
|
58
|
+
- @modern-js/plugin-i18n@1.0.0-rc.16
|
|
59
|
+
- @modern-js/utils@1.0.0-rc.16
|
|
60
|
+
|
|
3
61
|
## 1.0.0-rc.15
|
|
4
62
|
|
|
5
63
|
### Patch Changes
|
package/dist/js/modern/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import os from 'os';
|
|
2
|
+
import { path, fs, getMonorepoPackages } from '@modern-js/utils';
|
|
3
3
|
import execa from 'execa';
|
|
4
4
|
import ora from 'ora';
|
|
5
|
-
import { fs, getMonorepoPackages } from '@modern-js/utils';
|
|
6
5
|
import { canUseNpm, canUsePnpm, canUseYarn } from "./utils/env";
|
|
7
6
|
import { stripAnsi } from "./utils/strip-ansi";
|
|
8
7
|
import { i18n, localeKeys } from "./locale";
|
|
9
8
|
export * from "./utils";
|
|
10
|
-
export { fs } from '@modern-js/utils';
|
|
9
|
+
export { fs, path } from '@modern-js/utils';
|
|
11
10
|
export { i18n } from "./locale"; // eslint-disable-next-line max-statements
|
|
12
11
|
|
|
13
12
|
export async function getPackageVersion(packageName, registry) {
|
package/dist/js/node/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var _exportNames = {
|
|
|
14
14
|
getModuleProjectPath: true,
|
|
15
15
|
getMWAProjectPath: true,
|
|
16
16
|
fs: true,
|
|
17
|
+
path: true,
|
|
17
18
|
i18n: true
|
|
18
19
|
};
|
|
19
20
|
Object.defineProperty(exports, "fs", {
|
|
@@ -35,19 +36,23 @@ Object.defineProperty(exports, "i18n", {
|
|
|
35
36
|
}
|
|
36
37
|
});
|
|
37
38
|
exports.isTsProject = isTsProject;
|
|
39
|
+
Object.defineProperty(exports, "path", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function () {
|
|
42
|
+
return _utils.path;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
38
45
|
exports.validatePackageName = validatePackageName;
|
|
39
46
|
exports.validatePackagePath = validatePackagePath;
|
|
40
47
|
|
|
41
|
-
var _path = _interopRequireDefault(require("path"));
|
|
42
|
-
|
|
43
48
|
var _os = _interopRequireDefault(require("os"));
|
|
44
49
|
|
|
50
|
+
var _utils = require("@modern-js/utils");
|
|
51
|
+
|
|
45
52
|
var _execa = _interopRequireDefault(require("execa"));
|
|
46
53
|
|
|
47
54
|
var _ora = _interopRequireDefault(require("ora"));
|
|
48
55
|
|
|
49
|
-
var _utils = require("@modern-js/utils");
|
|
50
|
-
|
|
51
56
|
var _env = require("./utils/env");
|
|
52
57
|
|
|
53
58
|
var _stripAnsi = require("./utils/strip-ansi");
|
|
@@ -119,26 +124,26 @@ function getPackageManager(cwd = process.cwd()) {
|
|
|
119
124
|
let appDirectory = cwd;
|
|
120
125
|
|
|
121
126
|
while (_os.default.homedir() !== appDirectory) {
|
|
122
|
-
if (_utils.fs.existsSync(
|
|
127
|
+
if (_utils.fs.existsSync(_utils.path.resolve(appDirectory, 'pnpm-lock.yaml'))) {
|
|
123
128
|
return 'pnpm';
|
|
124
129
|
}
|
|
125
130
|
|
|
126
|
-
if (_utils.fs.existsSync(
|
|
131
|
+
if (_utils.fs.existsSync(_utils.path.resolve(appDirectory, 'yarn.lock'))) {
|
|
127
132
|
return 'yarn';
|
|
128
133
|
}
|
|
129
134
|
|
|
130
|
-
if (_utils.fs.existsSync(
|
|
135
|
+
if (_utils.fs.existsSync(_utils.path.resolve(appDirectory, 'package-lock.json'))) {
|
|
131
136
|
return 'npm';
|
|
132
137
|
}
|
|
133
138
|
|
|
134
|
-
appDirectory =
|
|
139
|
+
appDirectory = _utils.path.join(appDirectory, '..');
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
return 'npm';
|
|
138
143
|
}
|
|
139
144
|
|
|
140
145
|
function isTsProject(appDir) {
|
|
141
|
-
return _utils.fs.existsSync(
|
|
146
|
+
return _utils.fs.existsSync(_utils.path.join(appDir, 'tsconfig.json'));
|
|
142
147
|
}
|
|
143
148
|
|
|
144
149
|
async function getPackageObj(context) {
|
|
@@ -184,7 +189,7 @@ function validatePackagePath(value, projectDir, options) {
|
|
|
184
189
|
dir = isPublic ? 'packages' : 'features';
|
|
185
190
|
}
|
|
186
191
|
|
|
187
|
-
const packageDir =
|
|
192
|
+
const packageDir = _utils.path.resolve(projectDir || '', dir, value);
|
|
188
193
|
|
|
189
194
|
if (_utils.fs.existsSync(packageDir)) {
|
|
190
195
|
return {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GeneratorContext } from '@modern-js/codesmith';
|
|
2
2
|
export * from './utils';
|
|
3
|
-
export { fs } from '@modern-js/utils';
|
|
3
|
+
export { fs, path } from '@modern-js/utils';
|
|
4
4
|
export { i18n } from './locale';
|
|
5
5
|
export declare function getPackageVersion(packageName: string, registry?: string): Promise<string>;
|
|
6
6
|
export declare function getPackageManager(cwd?: string): "npm" | "yarn" | "pnpm";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modern-js/generator-utils",
|
|
3
3
|
"description": "Modern.js generator common utils, include create project and new option",
|
|
4
|
-
"version": "1.0.0-rc.
|
|
4
|
+
"version": "1.0.0-rc.19",
|
|
5
5
|
"jsnext:source": "./src/index.ts",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
7
7
|
"main": "./dist/js/node/index.js",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7",
|
|
21
|
-
"@modern-js/plugin-i18n": "^1.0.0-rc.
|
|
22
|
-
"@modern-js/utils": "^1.0.0-rc.
|
|
21
|
+
"@modern-js/plugin-i18n": "^1.0.0-rc.19",
|
|
22
|
+
"@modern-js/utils": "^1.0.0-rc.19",
|
|
23
23
|
"execa": "^5.1.1",
|
|
24
24
|
"ora": "^5.4.1"
|
|
25
25
|
},
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@types/jest": "^26",
|
|
29
29
|
"@types/node": "^14",
|
|
30
30
|
"typescript": "^4",
|
|
31
|
-
"@modern-js/module-tools": "^1.0.0-rc.
|
|
32
|
-
"@modern-js/plugin-testing": "^1.0.0-rc.
|
|
31
|
+
"@modern-js/module-tools": "^1.0.0-rc.19",
|
|
32
|
+
"@modern-js/plugin-testing": "^1.0.0-rc.19"
|
|
33
33
|
},
|
|
34
34
|
"sideEffects": false,
|
|
35
35
|
"modernConfig": {
|
package/src/index.ts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
1
|
import os from 'os';
|
|
2
|
+
import { path, fs, getMonorepoPackages } from '@modern-js/utils';
|
|
3
3
|
import execa from 'execa';
|
|
4
4
|
import ora from 'ora';
|
|
5
5
|
import { GeneratorContext } from '@modern-js/codesmith';
|
|
6
|
-
import { fs, getMonorepoPackages } from '@modern-js/utils';
|
|
7
6
|
import { canUseNpm, canUsePnpm, canUseYarn } from './utils/env';
|
|
8
7
|
import { stripAnsi } from './utils/strip-ansi';
|
|
9
8
|
import { i18n, localeKeys } from './locale';
|
|
10
9
|
|
|
11
10
|
export * from './utils';
|
|
12
11
|
|
|
13
|
-
export { fs } from '@modern-js/utils';
|
|
12
|
+
export { fs, path } from '@modern-js/utils';
|
|
14
13
|
|
|
15
14
|
export { i18n } from './locale';
|
|
16
15
|
|