@modern-js/repo-generator 0.0.0-next-20241014055508 → 0.0.0-next-20241014073503
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/dist/index.js +40 -53
- package/package.json +9 -9
- package/src/index.ts +12 -0
package/dist/index.js
CHANGED
|
@@ -129,6 +129,13 @@
|
|
|
129
129
|
module1.exports = (typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self || Function("return this")())["codesmithFsUtils"];
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
+
// globals:@modern-js/codesmith-utils/ora
|
|
133
|
+
var require_ora = __commonJS({
|
|
134
|
+
"globals:@modern-js/codesmith-utils/ora" (exports, module1) {
|
|
135
|
+
"use strict";
|
|
136
|
+
module1.exports = (typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self || Function("return this")())["codesmithOraUtils"];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
132
139
|
// globals:@modern-js/codesmith-utils/execa
|
|
133
140
|
var require_execa = __commonJS({
|
|
134
141
|
"globals:@modern-js/codesmith-utils/execa" (exports, module1) {
|
|
@@ -143,13 +150,6 @@
|
|
|
143
150
|
module1.exports = (typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self || Function("return this")())["codesmithNpmUtils"];
|
|
144
151
|
}
|
|
145
152
|
});
|
|
146
|
-
// globals:@modern-js/codesmith-utils/ora
|
|
147
|
-
var require_ora = __commonJS({
|
|
148
|
-
"globals:@modern-js/codesmith-utils/ora" (exports, module1) {
|
|
149
|
-
"use strict";
|
|
150
|
-
module1.exports = (typeof globalThis !== "undefined" ? globalThis : typeof global !== "undefined" ? global : self || Function("return this")())["codesmithOraUtils"];
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
153
|
// globals:@modern-js/codesmith-utils/semver
|
|
154
154
|
var require_semver = __commonJS({
|
|
155
155
|
"globals:@modern-js/codesmith-utils/semver" (exports, module1) {
|
|
@@ -19593,13 +19593,12 @@ function encode_char(c) {
|
|
|
19593
19593
|
}
|
|
19594
19594
|
}
|
|
19595
19595
|
// ../../generator-plugin/dist/esm/index.js
|
|
19596
|
-
var
|
|
19596
|
+
var import_codesmith7 = __toESM(require_codesmith());
|
|
19597
19597
|
var import_fs_extra3 = __toESM(require_fs_extra());
|
|
19598
19598
|
var import_lodash5 = __toESM(require_lodash());
|
|
19599
19599
|
// ../../generator-utils/dist/esm/index.js
|
|
19600
|
-
var
|
|
19600
|
+
var import_codesmith = __toESM(require_codesmith());
|
|
19601
19601
|
var import_fs_extra = __toESM(require_fs_extra());
|
|
19602
|
-
var import_npm2 = __toESM(require_npm());
|
|
19603
19602
|
var import_ora = __toESM(require_ora());
|
|
19604
19603
|
// ../../generator-utils/dist/esm/locale/index.js
|
|
19605
19604
|
var import_plugin_i18n2 = __toESM(require_plugin_i18n());
|
|
@@ -20832,46 +20831,25 @@ function encode_char(c) {
|
|
|
20832
20831
|
var lib = JSON5;
|
|
20833
20832
|
var dist_default = lib;
|
|
20834
20833
|
// ../../generator-utils/dist/esm/index.js
|
|
20835
|
-
var
|
|
20834
|
+
var import_npm2 = __toESM(require_npm());
|
|
20836
20835
|
var import_fs_extra2 = __toESM(require_fs_extra());
|
|
20837
20836
|
var import_ora2 = __toESM(require_ora());
|
|
20838
20837
|
var import_semver2 = __toESM(require_semver());
|
|
20839
|
-
var
|
|
20838
|
+
var import_execa2 = __toESM(require_execa());
|
|
20840
20839
|
var import_chalk = __toESM(require_chalk());
|
|
20841
|
-
function getPackageVersion(packageName,
|
|
20840
|
+
function getPackageVersion(packageName, registryUrl) {
|
|
20842
20841
|
return __async(this, null, function*() {
|
|
20843
20842
|
const spinner = (0, import_ora.ora)({
|
|
20844
20843
|
text: "Load Generator...",
|
|
20845
20844
|
spinner: "runner"
|
|
20846
20845
|
}).start();
|
|
20847
|
-
|
|
20848
|
-
|
|
20849
|
-
|
|
20850
|
-
|
|
20851
|
-
|
|
20852
|
-
];
|
|
20853
|
-
if (registry) {
|
|
20854
|
-
args.push(`--registry=${registry}`);
|
|
20855
|
-
}
|
|
20856
|
-
const result = yield (0, import_execa2.execa)("pnpm", args);
|
|
20857
|
-
spinner.stop();
|
|
20858
|
-
return stripAnsi(result.stdout);
|
|
20859
|
-
}
|
|
20860
|
-
if (yield (0, import_npm2.canUseNpm)()) {
|
|
20861
|
-
const args = [
|
|
20862
|
-
"view",
|
|
20863
|
-
packageName,
|
|
20864
|
-
"version"
|
|
20865
|
-
];
|
|
20866
|
-
if (registry) {
|
|
20867
|
-
args.push(`--registry=${registry}`);
|
|
20868
|
-
}
|
|
20869
|
-
const result = yield (0, import_execa2.execa)("npm", args);
|
|
20870
|
-
spinner.stop();
|
|
20871
|
-
return stripAnsi(result.stdout);
|
|
20872
|
-
}
|
|
20846
|
+
const { name, version: pkgVersion } = (0, import_codesmith.getPackageInfo)(packageName);
|
|
20847
|
+
const version = yield (0, import_codesmith.getNpmVersion)(name, {
|
|
20848
|
+
version: pkgVersion,
|
|
20849
|
+
registryUrl
|
|
20850
|
+
});
|
|
20873
20851
|
spinner.stop();
|
|
20874
|
-
|
|
20852
|
+
return version;
|
|
20875
20853
|
});
|
|
20876
20854
|
}
|
|
20877
20855
|
function getModernPluginVersion(_0, _1) {
|
|
@@ -20929,7 +20907,7 @@ function encode_char(c) {
|
|
|
20929
20907
|
return Constructor;
|
|
20930
20908
|
}
|
|
20931
20909
|
// ../../generator-plugin/dist/esm/context/file.js
|
|
20932
|
-
var
|
|
20910
|
+
var import_codesmith2 = __toESM(require_codesmith());
|
|
20933
20911
|
var import_codesmith_api_json = __toESM(require_codesmith_api_json());
|
|
20934
20912
|
var import_globby = __toESM(require_globby());
|
|
20935
20913
|
var FileType;
|
|
@@ -21305,7 +21283,7 @@ function encode_char(c) {
|
|
|
21305
21283
|
return __generator(this, function(_state) {
|
|
21306
21284
|
switch(_state.label){
|
|
21307
21285
|
case 0:
|
|
21308
|
-
fsMaterial = new
|
|
21286
|
+
fsMaterial = new import_codesmith2.FsMaterial(_this.projectPath);
|
|
21309
21287
|
return [
|
|
21310
21288
|
4,
|
|
21311
21289
|
_this.jsonAPI.update(fsMaterial.get(fileName), {
|
|
@@ -21845,7 +21823,7 @@ function encode_char(c) {
|
|
|
21845
21823
|
});
|
|
21846
21824
|
}
|
|
21847
21825
|
// ../../new-action/dist/esm/mwa.js
|
|
21848
|
-
var
|
|
21826
|
+
var import_codesmith3 = __toESM(require_codesmith());
|
|
21849
21827
|
var import_codesmith_formily = __toESM(require_codesmith_formily());
|
|
21850
21828
|
var import_lodash2 = __toESM(require_lodash());
|
|
21851
21829
|
// ../../new-action/dist/esm/constants.js
|
|
@@ -21866,7 +21844,7 @@ function encode_char(c) {
|
|
|
21866
21844
|
i18n.changeLanguage({
|
|
21867
21845
|
locale: language
|
|
21868
21846
|
});
|
|
21869
|
-
const smith = new
|
|
21847
|
+
const smith = new import_codesmith3.CodeSmith({
|
|
21870
21848
|
debug,
|
|
21871
21849
|
registryUrl: registry
|
|
21872
21850
|
});
|
|
@@ -21947,7 +21925,7 @@ function encode_char(c) {
|
|
|
21947
21925
|
});
|
|
21948
21926
|
});
|
|
21949
21927
|
// ../../new-action/dist/esm/module.js
|
|
21950
|
-
var
|
|
21928
|
+
var import_codesmith4 = __toESM(require_codesmith());
|
|
21951
21929
|
var import_codesmith_formily2 = __toESM(require_codesmith_formily());
|
|
21952
21930
|
var import_lodash3 = __toESM(require_lodash());
|
|
21953
21931
|
var ModuleNewAction = (options)=>__async(void 0, null, function*() {
|
|
@@ -21962,7 +21940,7 @@ function encode_char(c) {
|
|
|
21962
21940
|
i18n.changeLanguage({
|
|
21963
21941
|
locale: language
|
|
21964
21942
|
});
|
|
21965
|
-
const smith = new
|
|
21943
|
+
const smith = new import_codesmith4.CodeSmith({
|
|
21966
21944
|
debug,
|
|
21967
21945
|
registryUrl: registry
|
|
21968
21946
|
});
|
|
@@ -22328,7 +22306,7 @@ function encode_char(c) {
|
|
|
22328
22306
|
en: EN_LOCALE3
|
|
22329
22307
|
});
|
|
22330
22308
|
// ../../generator-plugin/dist/esm/utils/index.js
|
|
22331
|
-
var
|
|
22309
|
+
var import_codesmith6 = __toESM(require_codesmith());
|
|
22332
22310
|
// ../../generator-plugin/dist/esm/utils/module.js
|
|
22333
22311
|
var import_lodash4 = __toESM(require_lodash());
|
|
22334
22312
|
function requireModule(modulePath) {
|
|
@@ -22338,7 +22316,7 @@ function encode_char(c) {
|
|
|
22338
22316
|
]) || module1;
|
|
22339
22317
|
}
|
|
22340
22318
|
// ../../generator-plugin/dist/esm/utils/getPackageMeta.js
|
|
22341
|
-
var
|
|
22319
|
+
var import_codesmith5 = __toESM(require_codesmith());
|
|
22342
22320
|
var NPM_API_TIMEOUT = 3e4;
|
|
22343
22321
|
function getPackageMeta(packageName, packageVersion, options) {
|
|
22344
22322
|
return _getPackageMeta.apply(this, arguments);
|
|
@@ -22360,10 +22338,10 @@ function encode_char(c) {
|
|
|
22360
22338
|
params.push("--registry");
|
|
22361
22339
|
params.push(registryUrl);
|
|
22362
22340
|
}
|
|
22363
|
-
getPkgInfoPromise = (0,
|
|
22341
|
+
getPkgInfoPromise = (0, import_execa2.execa)("npm", params);
|
|
22364
22342
|
return [
|
|
22365
22343
|
4,
|
|
22366
|
-
(0,
|
|
22344
|
+
(0, import_codesmith5.timeoutPromise)(getPkgInfoPromise, NPM_API_TIMEOUT, "Get npm version of '".concat(packageName, "'"))
|
|
22367
22345
|
];
|
|
22368
22346
|
case 1:
|
|
22369
22347
|
stdout = _state.sent().stdout;
|
|
@@ -22428,10 +22406,10 @@ function encode_char(c) {
|
|
|
22428
22406
|
}
|
|
22429
22407
|
];
|
|
22430
22408
|
}
|
|
22431
|
-
_getPackageInfo = (0,
|
|
22409
|
+
_getPackageInfo = (0, import_codesmith6.getPackageInfo)(plugin), name = _getPackageInfo.name, version = _getPackageInfo.version;
|
|
22432
22410
|
return [
|
|
22433
22411
|
4,
|
|
22434
|
-
(0,
|
|
22412
|
+
(0, import_codesmith6.downloadPackage)(name, version, {
|
|
22435
22413
|
registryUrl,
|
|
22436
22414
|
install: true
|
|
22437
22415
|
})
|
|
@@ -22526,7 +22504,7 @@ function encode_char(c) {
|
|
|
22526
22504
|
6
|
|
22527
22505
|
];
|
|
22528
22506
|
case 4:
|
|
22529
|
-
_getPackageInfo = (0,
|
|
22507
|
+
_getPackageInfo = (0, import_codesmith7.getPackageInfo)(plugin), name = _getPackageInfo.name, pkgVersion = _getPackageInfo.version;
|
|
22530
22508
|
return [
|
|
22531
22509
|
4,
|
|
22532
22510
|
getPackageMeta(name, pkgVersion, {
|
|
@@ -22934,6 +22912,15 @@ function encode_char(c) {
|
|
|
22934
22912
|
var src_default = (context, generator)=>__async(void 0, null, function*() {
|
|
22935
22913
|
var _a;
|
|
22936
22914
|
process.setMaxListeners(20);
|
|
22915
|
+
const { distTag } = context.config;
|
|
22916
|
+
yield generator.prepareGlobal();
|
|
22917
|
+
yield generator.prepareGenerators([
|
|
22918
|
+
`@modern-js/repo-generator@${distTag || "latest"}`,
|
|
22919
|
+
`@modern-js/base-generator@${distTag || "latest"}`,
|
|
22920
|
+
`@modern-js/mwa-generator@${distTag || "latest"}`,
|
|
22921
|
+
`@modern-js/entry-generator@${distTag || "latest"}`,
|
|
22922
|
+
`@modern-js/module-generator@${distTag || "latest"}`
|
|
22923
|
+
]);
|
|
22937
22924
|
const appApi = new import_codesmith_api_app.AppAPI(context, generator);
|
|
22938
22925
|
const { locale } = context.config;
|
|
22939
22926
|
i18n.changeLanguage({
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-next-
|
|
18
|
+
"version": "0.0.0-next-20241014073503",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@types/node": "^14",
|
|
31
31
|
"jest": "^29",
|
|
32
32
|
"typescript": "^5",
|
|
33
|
-
"@modern-js/
|
|
34
|
-
"@modern-js/generator
|
|
35
|
-
"@modern-js/
|
|
36
|
-
"@modern-js/generator-
|
|
37
|
-
"@modern-js/generator
|
|
38
|
-
"@modern-js/mwa-generator": "0.0.0-next-
|
|
39
|
-
"@scripts/
|
|
40
|
-
"@scripts/
|
|
33
|
+
"@modern-js/generator-common": "0.0.0-next-20241014073503",
|
|
34
|
+
"@modern-js/base-generator": "0.0.0-next-20241014073503",
|
|
35
|
+
"@modern-js/generator-utils": "0.0.0-next-20241014073503",
|
|
36
|
+
"@modern-js/generator-plugin": "0.0.0-next-20241014073503",
|
|
37
|
+
"@modern-js/module-generator": "0.0.0-next-20241014073503",
|
|
38
|
+
"@modern-js/mwa-generator": "0.0.0-next-20241014073503",
|
|
39
|
+
"@scripts/jest-config": "0.0.0-next-20241014073503",
|
|
40
|
+
"@scripts/build": "0.0.0-next-20241014073503"
|
|
41
41
|
},
|
|
42
42
|
"sideEffects": false,
|
|
43
43
|
"publishConfig": {
|
package/src/index.ts
CHANGED
|
@@ -90,6 +90,18 @@ const handlePlugin = async (
|
|
|
90
90
|
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
|
91
91
|
process.setMaxListeners(20);
|
|
92
92
|
|
|
93
|
+
const { distTag } = context.config;
|
|
94
|
+
|
|
95
|
+
// avoid create tools version is older
|
|
96
|
+
await generator.prepareGlobal();
|
|
97
|
+
await generator.prepareGenerators([
|
|
98
|
+
`@modern-js/repo-generator@${distTag || 'latest'}`,
|
|
99
|
+
`@modern-js/base-generator@${distTag || 'latest'}`,
|
|
100
|
+
`@modern-js/mwa-generator@${distTag || 'latest'}`,
|
|
101
|
+
`@modern-js/entry-generator@${distTag || 'latest'}`,
|
|
102
|
+
`@modern-js/module-generator@${distTag || 'latest'}`,
|
|
103
|
+
]);
|
|
104
|
+
|
|
93
105
|
const appApi = new AppAPI(context, generator);
|
|
94
106
|
|
|
95
107
|
const { locale } = context.config;
|