@modern-js/repo-generator 0.0.0-nightly-20230926160605 → 0.0.0-nightly-20230927160620
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 +29 -50
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -124933,12 +124933,11 @@ var require_config4 = __commonJS({
|
|
|
124933
124933
|
var import_constants10 = require_constants3();
|
|
124934
124934
|
var import_type = require_type2();
|
|
124935
124935
|
var isSSR = (config) => {
|
|
124936
|
-
var _server, _server1;
|
|
124937
124936
|
const { server } = config;
|
|
124938
|
-
if (
|
|
124937
|
+
if (server === null || server === void 0 ? void 0 : server.ssr) {
|
|
124939
124938
|
return true;
|
|
124940
124939
|
}
|
|
124941
|
-
if ((
|
|
124940
|
+
if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, import_type.isEmpty)(server.ssrByEntries)) {
|
|
124942
124941
|
for (const name of Object.keys(server.ssrByEntries)) {
|
|
124943
124942
|
if (server.ssrByEntries[name]) {
|
|
124944
124943
|
return true;
|
|
@@ -124948,29 +124947,28 @@ var require_config4 = __commonJS({
|
|
|
124948
124947
|
return false;
|
|
124949
124948
|
};
|
|
124950
124949
|
var isUseSSRBundle = (config) => {
|
|
124951
|
-
var _output;
|
|
124952
124950
|
const { output: output2 } = config;
|
|
124953
|
-
if (
|
|
124951
|
+
if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
|
|
124954
124952
|
return true;
|
|
124955
124953
|
}
|
|
124956
124954
|
return isSSR(config);
|
|
124957
124955
|
};
|
|
124958
124956
|
var isServiceWorker = (config) => {
|
|
124959
|
-
var _deploy_worker
|
|
124957
|
+
var _deploy_worker;
|
|
124960
124958
|
const { output: output2, deploy } = config;
|
|
124961
|
-
if ((
|
|
124959
|
+
if ((deploy === null || deploy === void 0 ? void 0 : (_deploy_worker = deploy.worker) === null || _deploy_worker === void 0 ? void 0 : _deploy_worker.ssr) && ((output2 === null || output2 === void 0 ? void 0 : output2.ssg) || isSSR(config))) {
|
|
124962
124960
|
return true;
|
|
124963
124961
|
}
|
|
124964
124962
|
return false;
|
|
124965
124963
|
};
|
|
124966
124964
|
var isRouterV5 = (config) => {
|
|
124967
|
-
var _config_runtime, _config_runtime_router, _config_runtime1
|
|
124968
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (
|
|
124965
|
+
var _config_runtime, _config_runtime_router, _config_runtime1;
|
|
124966
|
+
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (config === null || config === void 0 ? void 0 : (_config_runtime1 = config.runtime) === null || _config_runtime1 === void 0 ? void 0 : (_config_runtime_router = _config_runtime1.router) === null || _config_runtime_router === void 0 ? void 0 : _config_runtime_router.mode) === "react-router-5";
|
|
124969
124967
|
};
|
|
124970
124968
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
|
124971
|
-
var _config_source
|
|
124969
|
+
var _config_source;
|
|
124972
124970
|
const ssgConfig = config.output.ssg;
|
|
124973
|
-
const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (
|
|
124971
|
+
const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (ssgConfig === null || ssgConfig === void 0 ? void 0 : ssgConfig[0]) === "function" || Boolean(ssgConfig === null || ssgConfig === void 0 ? void 0 : ssgConfig[entryName]);
|
|
124974
124972
|
return useSSG;
|
|
124975
124973
|
};
|
|
124976
124974
|
var isSingleEntry = (entrypoints, mainEntryName = import_constants10.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
|
@@ -125835,7 +125833,7 @@ var require_alias2 = __commonJS({
|
|
|
125835
125833
|
};
|
|
125836
125834
|
var mergeAlias = (alias) => (0, import_applyOptionsChain.applyOptionsChain)({}, alias);
|
|
125837
125835
|
var getAliasConfig = (aliasOption, option) => {
|
|
125838
|
-
var _tsconfig_compilerOptions,
|
|
125836
|
+
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
|
125839
125837
|
const isTsProject = import_fs.default.existsSync(option.tsconfigPath);
|
|
125840
125838
|
const alias = mergeAlias(aliasOption);
|
|
125841
125839
|
if (!isTsProject) {
|
|
@@ -125847,12 +125845,12 @@ var require_alias2 = __commonJS({
|
|
|
125847
125845
|
};
|
|
125848
125846
|
}
|
|
125849
125847
|
const tsconfig = (0, import_get.readTsConfigByFile)(option.tsconfigPath);
|
|
125850
|
-
const baseUrl =
|
|
125848
|
+
const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
|
125851
125849
|
return {
|
|
125852
125850
|
absoluteBaseUrl: baseUrl ? import_path19.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
|
125853
125851
|
paths: {
|
|
125854
125852
|
...alias,
|
|
125855
|
-
...
|
|
125853
|
+
...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
|
|
125856
125854
|
},
|
|
125857
125855
|
isTsPath: true,
|
|
125858
125856
|
isTsProject
|
|
@@ -126340,10 +126338,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
|
126340
126338
|
var getAddressUrls = (protocol = "http", port, host) => {
|
|
126341
126339
|
const LOCAL_LABEL = "Local: ";
|
|
126342
126340
|
const NETWORK_LABEL = "Network: ";
|
|
126343
|
-
const isLocalhost = (url) =>
|
|
126344
|
-
var _url;
|
|
126345
|
-
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
|
126346
|
-
};
|
|
126341
|
+
const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
|
|
126347
126342
|
if (host && host !== import_constants10.DEFAULT_DEV_HOST) {
|
|
126348
126343
|
return [
|
|
126349
126344
|
{
|
|
@@ -126433,9 +126428,8 @@ var require_require2 = __commonJS({
|
|
|
126433
126428
|
module2.exports = __toCommonJS2(require_exports);
|
|
126434
126429
|
var import_fs = require_fs2();
|
|
126435
126430
|
var compatRequire = (filePath, interop = true) => {
|
|
126436
|
-
var _mod;
|
|
126437
126431
|
const mod = require(filePath);
|
|
126438
|
-
const rtnESMDefault = interop && (
|
|
126432
|
+
const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
|
|
126439
126433
|
return rtnESMDefault ? mod.default : mod;
|
|
126440
126434
|
};
|
|
126441
126435
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
|
@@ -146315,18 +146309,12 @@ var getSolutionSchema = (extra = {}) => {
|
|
|
146315
146309
|
type: "string",
|
|
146316
146310
|
title: extra.isMonorepo ? i18n2.t(localeKeys2.sub_solution.self) : i18n2.t(localeKeys2.solution.self),
|
|
146317
146311
|
enum: (() => {
|
|
146318
|
-
var
|
|
146319
|
-
const items = ((
|
|
146320
|
-
|
|
146321
|
-
|
|
146322
|
-
})
|
|
146323
|
-
|
|
146324
|
-
return {
|
|
146325
|
-
value: solution,
|
|
146326
|
-
label: ((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
|
146327
|
-
};
|
|
146328
|
-
});
|
|
146329
|
-
if ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : (_extra_customPlugin = _extra2.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : (_extra_customPlugin_custom = _extra_customPlugin.custom) === null || _extra_customPlugin_custom === void 0 ? void 0 : _extra_customPlugin_custom.length) {
|
|
146312
|
+
var _extra_customPlugin_custom, _extra_customPlugin;
|
|
146313
|
+
const items = ((extra === null || extra === void 0 ? void 0 : extra.solutions) || Object.values((extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolution : Solution)).filter((solution) => !((extra === null || extra === void 0 ? void 0 : extra.isSubProject) && solution === Solution.Monorepo)).map((solution) => ({
|
|
146314
|
+
value: solution,
|
|
146315
|
+
label: (extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
|
146316
|
+
}));
|
|
146317
|
+
if (extra === null || extra === void 0 ? void 0 : (_extra_customPlugin = extra.customPlugin) === null || _extra_customPlugin === void 0 ? void 0 : (_extra_customPlugin_custom = _extra_customPlugin.custom) === null || _extra_customPlugin_custom === void 0 ? void 0 : _extra_customPlugin_custom.length) {
|
|
146330
146318
|
return [
|
|
146331
146319
|
...items,
|
|
146332
146320
|
{
|
|
@@ -146342,8 +146330,7 @@ var getSolutionSchema = (extra = {}) => {
|
|
|
146342
146330
|
};
|
|
146343
146331
|
};
|
|
146344
146332
|
var getScenesSchema = (extra = {}) => {
|
|
146345
|
-
|
|
146346
|
-
const hasPlugin = ((_extra = extra) === null || _extra === void 0 ? void 0 : _extra.customPlugin) && extra.customPlugin[((_extra1 = extra) === null || _extra1 === void 0 ? void 0 : _extra1.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) : (_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.solution] && extra.customPlugin[((_extra4 = extra) === null || _extra4 === void 0 ? void 0 : _extra4.isMonorepoSubProject) ? getSolutionNameFromSubSolution((_extra5 = extra) === null || _extra5 === void 0 ? void 0 : _extra5.solution) : (_extra6 = extra) === null || _extra6 === void 0 ? void 0 : _extra6.solution].length > 0;
|
|
146333
|
+
const hasPlugin = (extra === null || extra === void 0 ? void 0 : extra.customPlugin) && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution] && extra.customPlugin[(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution].length > 0;
|
|
146347
146334
|
return {
|
|
146348
146335
|
type: "object",
|
|
146349
146336
|
properties: hasPlugin ? {
|
|
@@ -146351,17 +146338,15 @@ var getScenesSchema = (extra = {}) => {
|
|
|
146351
146338
|
type: "string",
|
|
146352
146339
|
title: i18n2.t(localeKeys2.scenes.self),
|
|
146353
146340
|
enum: (() => {
|
|
146354
|
-
|
|
146355
|
-
const
|
|
146356
|
-
const items = (((_extra32 = extra) === null || _extra32 === void 0 ? void 0 : _extra32.customPlugin) ? ((_extra42 = extra) === null || _extra42 === void 0 ? void 0 : _extra42.customPlugin[solution]) || [] : []).map((plugin) => ({
|
|
146341
|
+
const solution = (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? getSolutionNameFromSubSolution(extra === null || extra === void 0 ? void 0 : extra.solution) : extra === null || extra === void 0 ? void 0 : extra.solution;
|
|
146342
|
+
const items = ((extra === null || extra === void 0 ? void 0 : extra.customPlugin) ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map((plugin) => ({
|
|
146357
146343
|
value: plugin.key,
|
|
146358
146344
|
label: extra.locale === "zh" ? plugin.name_zh || plugin.name : plugin.name
|
|
146359
146345
|
}));
|
|
146360
146346
|
if (solution && solution !== "custom") {
|
|
146361
|
-
var _extra52;
|
|
146362
146347
|
items.unshift({
|
|
146363
146348
|
value: solution,
|
|
146364
|
-
label: `${(
|
|
146349
|
+
label: `${(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? SubSolutionText[solution]() : SolutionText[solution]()}(${i18n2.t(localeKeys2.solution.default)})`
|
|
146365
146350
|
});
|
|
146366
146351
|
}
|
|
146367
146352
|
return items;
|
|
@@ -146417,14 +146402,10 @@ var PackageManagerName = {
|
|
|
146417
146402
|
[PackageManager.Npm]: "npm"
|
|
146418
146403
|
};
|
|
146419
146404
|
var getPackageManagerSchema = (extra = {}) => {
|
|
146420
|
-
var _extra, _extra1;
|
|
146421
146405
|
return {
|
|
146422
146406
|
type: "string",
|
|
146423
146407
|
title: i18n2.t(localeKeys2.packageManager.self),
|
|
146424
|
-
enum: Object.values(PackageManager).filter((packageManager) => {
|
|
146425
|
-
var _extra2;
|
|
146426
|
-
return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
|
|
146427
|
-
}).map((packageManager) => ({
|
|
146408
|
+
enum: Object.values(PackageManager).filter((packageManager) => (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true).map((packageManager) => ({
|
|
146428
146409
|
value: packageManager,
|
|
146429
146410
|
label: PackageManagerName[packageManager]
|
|
146430
146411
|
})),
|
|
@@ -146433,7 +146414,7 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
|
146433
146414
|
dependencies: [],
|
|
146434
146415
|
fulfill: {
|
|
146435
146416
|
state: {
|
|
146436
|
-
visible: !(
|
|
146417
|
+
visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
|
|
146437
146418
|
}
|
|
146438
146419
|
}
|
|
146439
146420
|
}
|
|
@@ -146443,16 +146424,15 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
|
146443
146424
|
|
|
146444
146425
|
// ../../generator-common/dist/esm-node/common/packageName.js
|
|
146445
146426
|
var getPackageNameSchema = (extra = {}) => {
|
|
146446
|
-
var _extra, _extra1, _extra2;
|
|
146447
146427
|
return {
|
|
146448
146428
|
type: "string",
|
|
146449
|
-
title: (
|
|
146429
|
+
title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
|
|
146450
146430
|
"x-reactions": [
|
|
146451
146431
|
{
|
|
146452
146432
|
dependencies: [],
|
|
146453
146433
|
fulfill: {
|
|
146454
146434
|
state: {
|
|
146455
|
-
visible: Boolean(
|
|
146435
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra === null || extra === void 0 ? void 0 : extra.isMwa)
|
|
146456
146436
|
}
|
|
146457
146437
|
}
|
|
146458
146438
|
}
|
|
@@ -146469,7 +146449,6 @@ var getPackageNameSchema = (extra = {}) => {
|
|
|
146469
146449
|
// ../../generator-common/dist/esm-node/common/packagePath.js
|
|
146470
146450
|
var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
|
|
146471
146451
|
var getPackagePathSchema = (extra) => {
|
|
146472
|
-
var _extra;
|
|
146473
146452
|
return {
|
|
146474
146453
|
type: "string",
|
|
146475
146454
|
title: i18n2.t(localeKeys2.packagePath.self),
|
|
@@ -146481,7 +146460,7 @@ var getPackagePathSchema = (extra) => {
|
|
|
146481
146460
|
fulfill: {
|
|
146482
146461
|
state: {
|
|
146483
146462
|
value: "{{$deps[0]}}",
|
|
146484
|
-
visible: Boolean(
|
|
146463
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
|
|
146485
146464
|
}
|
|
146486
146465
|
}
|
|
146487
146466
|
}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"modern",
|
|
16
16
|
"modern.js"
|
|
17
17
|
],
|
|
18
|
-
"version": "0.0.0-nightly-
|
|
18
|
+
"version": "0.0.0-nightly-20230927160620",
|
|
19
19
|
"jsnext:source": "./src/index.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"files": [
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"@types/node": "^14",
|
|
30
30
|
"jest": "^29",
|
|
31
31
|
"typescript": "^5",
|
|
32
|
-
"@modern-js/base-generator": "0.0.0-nightly-
|
|
33
|
-
"@modern-js/generator-common": "0.0.0-nightly-
|
|
34
|
-
"@modern-js/generator-plugin": "0.0.0-nightly-
|
|
35
|
-
"@modern-js/generator-utils": "0.0.0-nightly-
|
|
36
|
-
"@modern-js/module-generator": "0.0.0-nightly-
|
|
37
|
-
"@modern-js/monorepo-generator": "0.0.0-nightly-
|
|
38
|
-
"@modern-js/mwa-generator": "0.0.0-nightly-
|
|
39
|
-
"@modern-js/utils": "0.0.0-nightly-
|
|
40
|
-
"@scripts/build": "0.0.0-nightly-
|
|
41
|
-
"@scripts/jest-config": "0.0.0-nightly-
|
|
32
|
+
"@modern-js/base-generator": "0.0.0-nightly-20230927160620",
|
|
33
|
+
"@modern-js/generator-common": "0.0.0-nightly-20230927160620",
|
|
34
|
+
"@modern-js/generator-plugin": "0.0.0-nightly-20230927160620",
|
|
35
|
+
"@modern-js/generator-utils": "0.0.0-nightly-20230927160620",
|
|
36
|
+
"@modern-js/module-generator": "0.0.0-nightly-20230927160620",
|
|
37
|
+
"@modern-js/monorepo-generator": "0.0.0-nightly-20230927160620",
|
|
38
|
+
"@modern-js/mwa-generator": "0.0.0-nightly-20230927160620",
|
|
39
|
+
"@modern-js/utils": "0.0.0-nightly-20230927160620",
|
|
40
|
+
"@scripts/build": "0.0.0-nightly-20230927160620",
|
|
41
|
+
"@scripts/jest-config": "0.0.0-nightly-20230927160620"
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"publishConfig": {
|