@modern-js/generator-utils 3.0.0-beta.4 → 3.0.0-beta.5
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 +33 -0
- package/dist/js/modern/index.js +15 -0
- package/dist/js/modern/utils/fs-exist.js +37 -0
- package/dist/js/node/index.js +65 -24
- package/dist/js/node/locale/en.js +7 -3
- package/dist/js/node/locale/index.js +8 -3
- package/dist/js/node/locale/zh.js +7 -3
- package/dist/js/node/utils/fs-exist.js +60 -0
- package/dist/js/node/utils/index.js +4 -4
- package/dist/js/node/utils/package.js +16 -9
- package/dist/js/node/utils/strip-ansi.js +7 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/utils/fs-exist.d.ts +1 -0
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @modern-js/generator-utils
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.5
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- dda38c9c3e: chore: v2
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [7879e8f711]
|
|
12
|
+
- Updated dependencies [6aca875011]
|
|
13
|
+
- Updated dependencies [2e6031955e]
|
|
14
|
+
- Updated dependencies [7b7d12cf8f]
|
|
15
|
+
- Updated dependencies [7efeed4]
|
|
16
|
+
- Updated dependencies [92f0eade39]
|
|
17
|
+
- Updated dependencies [edd1cfb1af]
|
|
18
|
+
- Updated dependencies [cc971eabfc]
|
|
19
|
+
- Updated dependencies [5b9049f2e9]
|
|
20
|
+
- Updated dependencies [92004d1906]
|
|
21
|
+
- Updated dependencies [b8bbe036c7]
|
|
22
|
+
- Updated dependencies [d5a31df781]
|
|
23
|
+
- Updated dependencies [dda38c9c3e]
|
|
24
|
+
- Updated dependencies [3bbea92b2a]
|
|
25
|
+
- Updated dependencies [b710adb843]
|
|
26
|
+
- Updated dependencies [ea7cf06257]
|
|
27
|
+
- Updated dependencies [bbe4c4ab64]
|
|
28
|
+
- Updated dependencies [e4558a0bc4]
|
|
29
|
+
- Updated dependencies [abf3421a75]
|
|
30
|
+
- Updated dependencies [543be9558e]
|
|
31
|
+
- Updated dependencies [14b712da84]
|
|
32
|
+
- @modern-js/utils@2.0.0-beta.6
|
|
33
|
+
- @modern-js/plugin-i18n@2.0.0-beta.6
|
|
34
|
+
- @modern-js/generator-common@3.0.0-beta.5
|
|
35
|
+
|
|
3
36
|
## 3.0.0-beta.4
|
|
4
37
|
|
|
5
38
|
### Major Changes
|
package/dist/js/modern/index.js
CHANGED
|
@@ -32,6 +32,7 @@ import { SolutionToolsMap } from "@modern-js/generator-common";
|
|
|
32
32
|
import { stripAnsi } from "./utils/strip-ansi";
|
|
33
33
|
import { i18n, localeKeys } from "./locale";
|
|
34
34
|
import { getAvailableVersion } from "./utils/package";
|
|
35
|
+
import { fileExist } from "./utils/fs-exist";
|
|
35
36
|
export * from "./utils";
|
|
36
37
|
import {
|
|
37
38
|
ora as ora2,
|
|
@@ -179,6 +180,19 @@ function getMWAProjectPath(packagePath, isMonorepoSubProject, isTest = false) {
|
|
|
179
180
|
}
|
|
180
181
|
return "";
|
|
181
182
|
}
|
|
183
|
+
function getModernConfigFile(appDir) {
|
|
184
|
+
return __async(this, null, function* () {
|
|
185
|
+
let exist = yield fileExist(path.join(appDir, "modern.config.ts"));
|
|
186
|
+
if (exist) {
|
|
187
|
+
return "modern.config.ts";
|
|
188
|
+
}
|
|
189
|
+
exist = yield fileExist(path.join(appDir, "modern.config.js"));
|
|
190
|
+
if (exist) {
|
|
191
|
+
return "modern.config.js";
|
|
192
|
+
}
|
|
193
|
+
return isTsProject(appDir) ? "modern.config.ts" : "modern.config.js";
|
|
194
|
+
});
|
|
195
|
+
}
|
|
182
196
|
export {
|
|
183
197
|
canUseNpm2 as canUseNpm,
|
|
184
198
|
canUsePnpm2 as canUsePnpm,
|
|
@@ -187,6 +201,7 @@ export {
|
|
|
187
201
|
fs2 as fs,
|
|
188
202
|
getAllPackages,
|
|
189
203
|
getMWAProjectPath,
|
|
204
|
+
getModernConfigFile,
|
|
190
205
|
getModernPluginVersion,
|
|
191
206
|
getModernVersion,
|
|
192
207
|
getModuleProjectPath,
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { fs } from "@modern-js/utils";
|
|
22
|
+
function fileExist(filePath) {
|
|
23
|
+
return __async(this, null, function* () {
|
|
24
|
+
try {
|
|
25
|
+
const stat = yield fs.stat(filePath);
|
|
26
|
+
if (stat.isFile()) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
} catch (e) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
fileExist
|
|
37
|
+
};
|
package/dist/js/node/index.js
CHANGED
|
@@ -22,8 +22,28 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var
|
|
26
|
-
|
|
25
|
+
var __async = (__this, __arguments, generator) => {
|
|
26
|
+
return new Promise((resolve, reject) => {
|
|
27
|
+
var fulfilled = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.next(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var rejected = (value) => {
|
|
35
|
+
try {
|
|
36
|
+
step(generator.throw(value));
|
|
37
|
+
} catch (e) {
|
|
38
|
+
reject(e);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
42
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var src_exports = {};
|
|
46
|
+
__export(src_exports, {
|
|
27
47
|
canUseNpm: () => import_utils2.canUseNpm,
|
|
28
48
|
canUsePnpm: () => import_utils2.canUsePnpm,
|
|
29
49
|
canUseYarn: () => import_utils2.canUseYarn,
|
|
@@ -31,6 +51,7 @@ __export(stdin_exports, {
|
|
|
31
51
|
fs: () => import_utils2.fs,
|
|
32
52
|
getAllPackages: () => getAllPackages,
|
|
33
53
|
getMWAProjectPath: () => getMWAProjectPath,
|
|
54
|
+
getModernConfigFile: () => getModernConfigFile,
|
|
34
55
|
getModernPluginVersion: () => getModernPluginVersion,
|
|
35
56
|
getModernVersion: () => getModernVersion,
|
|
36
57
|
getModuleProjectPath: () => getModuleProjectPath,
|
|
@@ -47,36 +68,17 @@ __export(stdin_exports, {
|
|
|
47
68
|
validatePackageName: () => validatePackageName,
|
|
48
69
|
validatePackagePath: () => validatePackagePath
|
|
49
70
|
});
|
|
50
|
-
module.exports = __toCommonJS(
|
|
71
|
+
module.exports = __toCommonJS(src_exports);
|
|
51
72
|
var import_path = __toESM(require("path"));
|
|
52
73
|
var import_utils = require("@modern-js/utils");
|
|
53
74
|
var import_generator_common = require("@modern-js/generator-common");
|
|
54
75
|
var import_strip_ansi = require("./utils/strip-ansi");
|
|
55
76
|
var import_locale = require("./locale");
|
|
56
77
|
var import_package = require("./utils/package");
|
|
57
|
-
|
|
78
|
+
var import_fs_exist = require("./utils/fs-exist");
|
|
79
|
+
__reExport(src_exports, require("./utils"), module.exports);
|
|
58
80
|
var import_utils2 = require("@modern-js/utils");
|
|
59
81
|
var import_locale2 = require("./locale");
|
|
60
|
-
var __async = (__this, __arguments, generator) => {
|
|
61
|
-
return new Promise((resolve, reject) => {
|
|
62
|
-
var fulfilled = (value) => {
|
|
63
|
-
try {
|
|
64
|
-
step(generator.next(value));
|
|
65
|
-
} catch (e) {
|
|
66
|
-
reject(e);
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
var rejected = (value) => {
|
|
70
|
-
try {
|
|
71
|
-
step(generator.throw(value));
|
|
72
|
-
} catch (e) {
|
|
73
|
-
reject(e);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
77
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
78
|
-
});
|
|
79
|
-
};
|
|
80
82
|
function getPackageVersion(packageName, registry) {
|
|
81
83
|
return __async(this, null, function* () {
|
|
82
84
|
const spinner = (0, import_utils.ora)({
|
|
@@ -210,3 +212,42 @@ function getMWAProjectPath(packagePath, isMonorepoSubProject, isTest = false) {
|
|
|
210
212
|
}
|
|
211
213
|
return "";
|
|
212
214
|
}
|
|
215
|
+
function getModernConfigFile(appDir) {
|
|
216
|
+
return __async(this, null, function* () {
|
|
217
|
+
let exist = yield (0, import_fs_exist.fileExist)(import_path.default.join(appDir, "modern.config.ts"));
|
|
218
|
+
if (exist) {
|
|
219
|
+
return "modern.config.ts";
|
|
220
|
+
}
|
|
221
|
+
exist = yield (0, import_fs_exist.fileExist)(import_path.default.join(appDir, "modern.config.js"));
|
|
222
|
+
if (exist) {
|
|
223
|
+
return "modern.config.js";
|
|
224
|
+
}
|
|
225
|
+
return isTsProject(appDir) ? "modern.config.ts" : "modern.config.js";
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
229
|
+
0 && (module.exports = {
|
|
230
|
+
canUseNpm,
|
|
231
|
+
canUsePnpm,
|
|
232
|
+
canUseYarn,
|
|
233
|
+
execa,
|
|
234
|
+
fs,
|
|
235
|
+
getAllPackages,
|
|
236
|
+
getMWAProjectPath,
|
|
237
|
+
getModernConfigFile,
|
|
238
|
+
getModernPluginVersion,
|
|
239
|
+
getModernVersion,
|
|
240
|
+
getModuleProjectPath,
|
|
241
|
+
getPackageManager,
|
|
242
|
+
getPackageManagerText,
|
|
243
|
+
getPackageObj,
|
|
244
|
+
getPackageVersion,
|
|
245
|
+
i18n,
|
|
246
|
+
isReact18,
|
|
247
|
+
isTsProject,
|
|
248
|
+
ora,
|
|
249
|
+
readTsConfigByFile,
|
|
250
|
+
semver,
|
|
251
|
+
validatePackageName,
|
|
252
|
+
validatePackagePath
|
|
253
|
+
});
|
|
@@ -15,12 +15,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
18
|
+
var en_exports = {};
|
|
19
|
+
__export(en_exports, {
|
|
20
20
|
EN_LOCALE: () => EN_LOCALE
|
|
21
21
|
});
|
|
22
|
-
module.exports = __toCommonJS(
|
|
22
|
+
module.exports = __toCommonJS(en_exports);
|
|
23
23
|
const EN_LOCALE = {
|
|
24
24
|
packageName: { exit: "package name `{value}` is already exists" },
|
|
25
25
|
packagePath: { exit: "package path {value} is already exists" }
|
|
26
26
|
};
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
EN_LOCALE
|
|
30
|
+
});
|
|
@@ -15,14 +15,19 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
18
|
+
var locale_exports = {};
|
|
19
|
+
__export(locale_exports, {
|
|
20
20
|
i18n: () => i18n,
|
|
21
21
|
localeKeys: () => localeKeys
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(locale_exports);
|
|
24
24
|
var import_plugin_i18n = require("@modern-js/plugin-i18n");
|
|
25
25
|
var import_zh = require("./zh");
|
|
26
26
|
var import_en = require("./en");
|
|
27
27
|
const i18n = new import_plugin_i18n.I18n();
|
|
28
28
|
const localeKeys = i18n.init("zh", { zh: import_zh.ZH_LOCALE, en: import_en.EN_LOCALE });
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
i18n,
|
|
32
|
+
localeKeys
|
|
33
|
+
});
|
|
@@ -15,12 +15,16 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
18
|
+
var zh_exports = {};
|
|
19
|
+
__export(zh_exports, {
|
|
20
20
|
ZH_LOCALE: () => ZH_LOCALE
|
|
21
21
|
});
|
|
22
|
-
module.exports = __toCommonJS(
|
|
22
|
+
module.exports = __toCommonJS(zh_exports);
|
|
23
23
|
const ZH_LOCALE = {
|
|
24
24
|
packageName: { exit: "项目名称 {value} 已存在" },
|
|
25
25
|
packagePath: { exit: "目录 {value} 已存在" }
|
|
26
26
|
};
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
ZH_LOCALE
|
|
30
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var __async = (__this, __arguments, generator) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
var fulfilled = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var rejected = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.throw(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var fs_exist_exports = {};
|
|
39
|
+
__export(fs_exist_exports, {
|
|
40
|
+
fileExist: () => fileExist
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(fs_exist_exports);
|
|
43
|
+
var import_utils = require("@modern-js/utils");
|
|
44
|
+
function fileExist(filePath) {
|
|
45
|
+
return __async(this, null, function* () {
|
|
46
|
+
try {
|
|
47
|
+
const stat = yield import_utils.fs.stat(filePath);
|
|
48
|
+
if (stat.isFile()) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
} catch (e) {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
+
0 && (module.exports = {
|
|
59
|
+
fileExist
|
|
60
|
+
});
|
|
@@ -12,7 +12,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
12
12
|
};
|
|
13
13
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
14
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var
|
|
16
|
-
module.exports = __toCommonJS(
|
|
17
|
-
__reExport(
|
|
18
|
-
__reExport(
|
|
15
|
+
var utils_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(utils_exports);
|
|
17
|
+
__reExport(utils_exports, require("./strip-ansi"), module.exports);
|
|
18
|
+
__reExport(utils_exports, require("./package"), module.exports);
|
|
@@ -15,15 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var stdin_exports = {};
|
|
19
|
-
__export(stdin_exports, {
|
|
20
|
-
getAvailableVersion: () => getAvailableVersion,
|
|
21
|
-
isPackageDeprecated: () => isPackageDeprecated,
|
|
22
|
-
isPackageExist: () => isPackageExist,
|
|
23
|
-
semverDecrease: () => semverDecrease
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(stdin_exports);
|
|
26
|
-
var import_utils = require("@modern-js/utils");
|
|
27
18
|
var __async = (__this, __arguments, generator) => {
|
|
28
19
|
return new Promise((resolve, reject) => {
|
|
29
20
|
var fulfilled = (value) => {
|
|
@@ -44,6 +35,15 @@ var __async = (__this, __arguments, generator) => {
|
|
|
44
35
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
45
36
|
});
|
|
46
37
|
};
|
|
38
|
+
var package_exports = {};
|
|
39
|
+
__export(package_exports, {
|
|
40
|
+
getAvailableVersion: () => getAvailableVersion,
|
|
41
|
+
isPackageDeprecated: () => isPackageDeprecated,
|
|
42
|
+
isPackageExist: () => isPackageExist,
|
|
43
|
+
semverDecrease: () => semverDecrease
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(package_exports);
|
|
46
|
+
var import_utils = require("@modern-js/utils");
|
|
47
47
|
function isPackageExist(packageName, registry) {
|
|
48
48
|
return __async(this, null, function* () {
|
|
49
49
|
if (yield (0, import_utils.canUseNpm)()) {
|
|
@@ -109,3 +109,10 @@ function getAvailableVersion(packageName, currentVersion, registry) {
|
|
|
109
109
|
return currentVersion;
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
113
|
+
0 && (module.exports = {
|
|
114
|
+
getAvailableVersion,
|
|
115
|
+
isPackageDeprecated,
|
|
116
|
+
isPackageExist,
|
|
117
|
+
semverDecrease
|
|
118
|
+
});
|
|
@@ -15,11 +15,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
return to;
|
|
16
16
|
};
|
|
17
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var
|
|
19
|
-
__export(
|
|
18
|
+
var strip_ansi_exports = {};
|
|
19
|
+
__export(strip_ansi_exports, {
|
|
20
20
|
stripAnsi: () => stripAnsi
|
|
21
21
|
});
|
|
22
|
-
module.exports = __toCommonJS(
|
|
22
|
+
module.exports = __toCommonJS(strip_ansi_exports);
|
|
23
23
|
function ansiRegex({ onlyFirst = false } = {}) {
|
|
24
24
|
const pattern = [
|
|
25
25
|
"[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
|
|
@@ -33,3 +33,7 @@ function stripAnsi(string) {
|
|
|
33
33
|
}
|
|
34
34
|
return string.replace(ansiRegex(), "");
|
|
35
35
|
}
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
stripAnsi
|
|
39
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -35,4 +35,5 @@ export declare function validatePackagePath(value: string, projectDir: string, o
|
|
|
35
35
|
error?: undefined;
|
|
36
36
|
};
|
|
37
37
|
export declare function getModuleProjectPath(packagePath: string, isMonorepoSubProject: boolean, isPublic: boolean, isLocalPackages: boolean): string;
|
|
38
|
-
export declare function getMWAProjectPath(packagePath: string, isMonorepoSubProject: boolean, isTest?: boolean): string;
|
|
38
|
+
export declare function getMWAProjectPath(packagePath: string, isMonorepoSubProject: boolean, isTest?: boolean): string;
|
|
39
|
+
export declare function getModernConfigFile(appDir: string): Promise<"modern.config.ts" | "modern.config.js">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function fileExist(filePath: string): Promise<boolean>;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"modern",
|
|
12
12
|
"modern.js"
|
|
13
13
|
],
|
|
14
|
-
"version": "3.0.0-beta.
|
|
14
|
+
"version": "3.0.0-beta.5",
|
|
15
15
|
"jsnext:source": "./src/index.ts",
|
|
16
16
|
"types": "./dist/types/index.d.ts",
|
|
17
17
|
"main": "./dist/js/node/index.js",
|
|
@@ -28,18 +28,18 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.18.0",
|
|
31
|
-
"@modern-js/plugin-i18n": "2.0.0-beta.
|
|
32
|
-
"@modern-js/generator-common": "3.0.0-beta.
|
|
33
|
-
"@modern-js/utils": "2.0.0-beta.
|
|
31
|
+
"@modern-js/plugin-i18n": "2.0.0-beta.6",
|
|
32
|
+
"@modern-js/generator-common": "3.0.0-beta.5",
|
|
33
|
+
"@modern-js/utils": "2.0.0-beta.6"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@modern-js/codesmith": "2.0.
|
|
36
|
+
"@modern-js/codesmith": "2.0.3",
|
|
37
37
|
"@types/jest": "^27",
|
|
38
38
|
"@types/node": "^14",
|
|
39
39
|
"jest": "^27",
|
|
40
40
|
"typescript": "^4",
|
|
41
|
-
"@scripts/build": "2.0.0-beta.
|
|
42
|
-
"@scripts/jest-config": "2.0.0-beta.
|
|
41
|
+
"@scripts/build": "2.0.0-beta.6",
|
|
42
|
+
"@scripts/jest-config": "2.0.0-beta.6"
|
|
43
43
|
},
|
|
44
44
|
"sideEffects": false,
|
|
45
45
|
"modernConfig": {
|