@modern-js/repo-generator 0.0.0-next-20230919065032 → 0.0.0-next-20230920090905
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
|
@@ -124680,12 +124680,11 @@ var require_config4 = __commonJS({
|
|
|
124680
124680
|
var _constants = require_constants3();
|
|
124681
124681
|
var _type = require_type2();
|
|
124682
124682
|
var isSSR = (config) => {
|
|
124683
|
-
var _server, _server1;
|
|
124684
124683
|
const { server } = config;
|
|
124685
|
-
if (
|
|
124684
|
+
if (server === null || server === void 0 ? void 0 : server.ssr) {
|
|
124686
124685
|
return true;
|
|
124687
124686
|
}
|
|
124688
|
-
if ((
|
|
124687
|
+
if ((server === null || server === void 0 ? void 0 : server.ssrByEntries) && !(0, _type.isEmpty)(server.ssrByEntries)) {
|
|
124689
124688
|
for (const name of Object.keys(server.ssrByEntries)) {
|
|
124690
124689
|
if (server.ssrByEntries[name]) {
|
|
124691
124690
|
return true;
|
|
@@ -124695,29 +124694,28 @@ var require_config4 = __commonJS({
|
|
|
124695
124694
|
return false;
|
|
124696
124695
|
};
|
|
124697
124696
|
var isUseSSRBundle = (config) => {
|
|
124698
|
-
var _output;
|
|
124699
124697
|
const { output: output2 } = config;
|
|
124700
|
-
if (
|
|
124698
|
+
if (output2 === null || output2 === void 0 ? void 0 : output2.ssg) {
|
|
124701
124699
|
return true;
|
|
124702
124700
|
}
|
|
124703
124701
|
return isSSR(config);
|
|
124704
124702
|
};
|
|
124705
124703
|
var isServiceWorker = (config) => {
|
|
124706
|
-
var _deploy_worker
|
|
124704
|
+
var _deploy_worker;
|
|
124707
124705
|
const { output: output2, deploy } = config;
|
|
124708
|
-
if ((
|
|
124706
|
+
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))) {
|
|
124709
124707
|
return true;
|
|
124710
124708
|
}
|
|
124711
124709
|
return false;
|
|
124712
124710
|
};
|
|
124713
124711
|
var isRouterV5 = (config) => {
|
|
124714
|
-
var _config_runtime, _config_runtime_router, _config_runtime1
|
|
124715
|
-
return typeof ((_config_runtime = config.runtime) === null || _config_runtime === void 0 ? void 0 : _config_runtime.router) !== "boolean" && (
|
|
124712
|
+
var _config_runtime, _config_runtime_router, _config_runtime1;
|
|
124713
|
+
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";
|
|
124716
124714
|
};
|
|
124717
124715
|
var isSSGEntry = (config, entryName, entrypoints) => {
|
|
124718
|
-
var _config_source
|
|
124716
|
+
var _config_source;
|
|
124719
124717
|
const ssgConfig = config.output.ssg;
|
|
124720
|
-
const useSSG = isSingleEntry(entrypoints, (_config_source = config.source) === null || _config_source === void 0 ? void 0 : _config_source.mainEntryName) ? Boolean(ssgConfig) : ssgConfig === true || typeof (
|
|
124718
|
+
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]);
|
|
124721
124719
|
return useSSG;
|
|
124722
124720
|
};
|
|
124723
124721
|
var isSingleEntry = (entrypoints, mainEntryName = _constants.MAIN_ENTRY_NAME) => entrypoints.length === 1 && entrypoints[0].entryName === mainEntryName;
|
|
@@ -125483,7 +125481,7 @@ var require_alias2 = __commonJS({
|
|
|
125483
125481
|
};
|
|
125484
125482
|
var mergeAlias = (alias) => (0, _applyOptionsChain.applyOptionsChain)({}, alias);
|
|
125485
125483
|
var getAliasConfig = (aliasOption, option) => {
|
|
125486
|
-
var _tsconfig_compilerOptions,
|
|
125484
|
+
var _tsconfig_compilerOptions, _tsconfig_compilerOptions1;
|
|
125487
125485
|
const isTsProject = _fs.default.existsSync(option.tsconfigPath);
|
|
125488
125486
|
const alias = mergeAlias(aliasOption);
|
|
125489
125487
|
if (!isTsProject) {
|
|
@@ -125495,12 +125493,12 @@ var require_alias2 = __commonJS({
|
|
|
125495
125493
|
};
|
|
125496
125494
|
}
|
|
125497
125495
|
const tsconfig = (0, _get.readTsConfigByFile)(option.tsconfigPath);
|
|
125498
|
-
const baseUrl =
|
|
125496
|
+
const baseUrl = tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions === void 0 ? void 0 : _tsconfig_compilerOptions.baseUrl;
|
|
125499
125497
|
return {
|
|
125500
125498
|
absoluteBaseUrl: baseUrl ? _path.default.join(option.appDirectory, baseUrl) : option.appDirectory,
|
|
125501
125499
|
paths: {
|
|
125502
125500
|
...alias,
|
|
125503
|
-
...
|
|
125501
|
+
...tsconfig === null || tsconfig === void 0 ? void 0 : (_tsconfig_compilerOptions1 = tsconfig.compilerOptions) === null || _tsconfig_compilerOptions1 === void 0 ? void 0 : _tsconfig_compilerOptions1.paths
|
|
125504
125502
|
},
|
|
125505
125503
|
isTsPath: true,
|
|
125506
125504
|
isTsProject
|
|
@@ -125947,10 +125945,7 @@ var require_prettyInstructions2 = __commonJS({
|
|
|
125947
125945
|
var getAddressUrls = (protocol = "http", port, host) => {
|
|
125948
125946
|
const LOCAL_LABEL = "Local: ";
|
|
125949
125947
|
const NETWORK_LABEL = "Network: ";
|
|
125950
|
-
const isLocalhost = (url) =>
|
|
125951
|
-
var _url;
|
|
125952
|
-
return (_url = url) === null || _url === void 0 ? void 0 : _url.includes("localhost");
|
|
125953
|
-
};
|
|
125948
|
+
const isLocalhost = (url) => url === null || url === void 0 ? void 0 : url.includes("localhost");
|
|
125954
125949
|
if (host && host !== _constants.DEFAULT_DEV_HOST) {
|
|
125955
125950
|
return [
|
|
125956
125951
|
{
|
|
@@ -126043,9 +126038,8 @@ var require_require2 = __commonJS({
|
|
|
126043
126038
|
});
|
|
126044
126039
|
var _fs = require_fs2();
|
|
126045
126040
|
var compatRequire = (filePath, interop = true) => {
|
|
126046
|
-
var _mod;
|
|
126047
126041
|
const mod = require(filePath);
|
|
126048
|
-
const rtnESMDefault = interop && (
|
|
126042
|
+
const rtnESMDefault = interop && (mod === null || mod === void 0 ? void 0 : mod.__esModule);
|
|
126049
126043
|
return rtnESMDefault ? mod.default : mod;
|
|
126050
126044
|
};
|
|
126051
126045
|
var dynamicImport = new Function("modulePath", "return import(modulePath)");
|
|
@@ -145776,18 +145770,12 @@ var getSolutionSchema = (extra = {}) => {
|
|
|
145776
145770
|
type: "string",
|
|
145777
145771
|
title: extra.isMonorepo ? i18n2.t(localeKeys2.sub_solution.self) : i18n2.t(localeKeys2.solution.self),
|
|
145778
145772
|
enum: (() => {
|
|
145779
|
-
var
|
|
145780
|
-
const items = ((
|
|
145781
|
-
|
|
145782
|
-
|
|
145783
|
-
})
|
|
145784
|
-
|
|
145785
|
-
return {
|
|
145786
|
-
value: solution,
|
|
145787
|
-
label: ((_extra3 = extra) === null || _extra3 === void 0 ? void 0 : _extra3.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
|
145788
|
-
};
|
|
145789
|
-
});
|
|
145790
|
-
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) {
|
|
145773
|
+
var _extra_customPlugin_custom, _extra_customPlugin;
|
|
145774
|
+
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) => ({
|
|
145775
|
+
value: solution,
|
|
145776
|
+
label: (extra === null || extra === void 0 ? void 0 : extra.isMonorepo) ? SubSolutionText[solution]() : SolutionText[solution]()
|
|
145777
|
+
}));
|
|
145778
|
+
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) {
|
|
145791
145779
|
return [
|
|
145792
145780
|
...items,
|
|
145793
145781
|
{
|
|
@@ -145803,8 +145791,7 @@ var getSolutionSchema = (extra = {}) => {
|
|
|
145803
145791
|
};
|
|
145804
145792
|
};
|
|
145805
145793
|
var getScenesSchema = (extra = {}) => {
|
|
145806
|
-
|
|
145807
|
-
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;
|
|
145794
|
+
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;
|
|
145808
145795
|
return {
|
|
145809
145796
|
type: "object",
|
|
145810
145797
|
properties: hasPlugin ? {
|
|
@@ -145812,17 +145799,15 @@ var getScenesSchema = (extra = {}) => {
|
|
|
145812
145799
|
type: "string",
|
|
145813
145800
|
title: i18n2.t(localeKeys2.scenes.self),
|
|
145814
145801
|
enum: (() => {
|
|
145815
|
-
|
|
145816
|
-
const
|
|
145817
|
-
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) => ({
|
|
145802
|
+
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;
|
|
145803
|
+
const items = ((extra === null || extra === void 0 ? void 0 : extra.customPlugin) ? (extra === null || extra === void 0 ? void 0 : extra.customPlugin[solution]) || [] : []).map((plugin) => ({
|
|
145818
145804
|
value: plugin.key,
|
|
145819
145805
|
label: extra.locale === "zh" ? plugin.name_zh || plugin.name : plugin.name
|
|
145820
145806
|
}));
|
|
145821
145807
|
if (solution && solution !== "custom") {
|
|
145822
|
-
var _extra52;
|
|
145823
145808
|
items.unshift({
|
|
145824
145809
|
value: solution,
|
|
145825
|
-
label: `${(
|
|
145810
|
+
label: `${(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? SubSolutionText[solution]() : SolutionText[solution]()}(${i18n2.t(localeKeys2.solution.default)})`
|
|
145826
145811
|
});
|
|
145827
145812
|
}
|
|
145828
145813
|
return items;
|
|
@@ -145878,14 +145863,10 @@ var PackageManagerName = {
|
|
|
145878
145863
|
[PackageManager.Npm]: "npm"
|
|
145879
145864
|
};
|
|
145880
145865
|
var getPackageManagerSchema = (extra = {}) => {
|
|
145881
|
-
var _extra, _extra1;
|
|
145882
145866
|
return {
|
|
145883
145867
|
type: "string",
|
|
145884
145868
|
title: i18n2.t(localeKeys2.packageManager.self),
|
|
145885
|
-
enum: Object.values(PackageManager).filter((packageManager) => {
|
|
145886
|
-
var _extra2;
|
|
145887
|
-
return ((_extra2 = extra) === null || _extra2 === void 0 ? void 0 : _extra2.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true;
|
|
145888
|
-
}).map((packageManager) => ({
|
|
145869
|
+
enum: Object.values(PackageManager).filter((packageManager) => (extra === null || extra === void 0 ? void 0 : extra.solution) === "monorepo" ? packageManager !== PackageManager.Npm : true).map((packageManager) => ({
|
|
145889
145870
|
value: packageManager,
|
|
145890
145871
|
label: PackageManagerName[packageManager]
|
|
145891
145872
|
})),
|
|
@@ -145894,7 +145875,7 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
|
145894
145875
|
dependencies: [],
|
|
145895
145876
|
fulfill: {
|
|
145896
145877
|
state: {
|
|
145897
|
-
visible: !(
|
|
145878
|
+
visible: !(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) && !(extra === null || extra === void 0 ? void 0 : extra.isSubProject)
|
|
145898
145879
|
}
|
|
145899
145880
|
}
|
|
145900
145881
|
}
|
|
@@ -145904,16 +145885,15 @@ var getPackageManagerSchema = (extra = {}) => {
|
|
|
145904
145885
|
|
|
145905
145886
|
// ../../generator-common/dist/esm-node/common/packageName.js
|
|
145906
145887
|
var getPackageNameSchema = (extra = {}) => {
|
|
145907
|
-
var _extra, _extra1, _extra2;
|
|
145908
145888
|
return {
|
|
145909
145889
|
type: "string",
|
|
145910
|
-
title: (
|
|
145890
|
+
title: (extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) ? i18n2.t(localeKeys2.packageName.sub_name) : i18n2.t(localeKeys2.packageName.self),
|
|
145911
145891
|
"x-reactions": [
|
|
145912
145892
|
{
|
|
145913
145893
|
dependencies: [],
|
|
145914
145894
|
fulfill: {
|
|
145915
145895
|
state: {
|
|
145916
|
-
visible: Boolean(
|
|
145896
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject) || !(extra === null || extra === void 0 ? void 0 : extra.isMwa)
|
|
145917
145897
|
}
|
|
145918
145898
|
}
|
|
145919
145899
|
}
|
|
@@ -145930,7 +145910,6 @@ var getPackageNameSchema = (extra = {}) => {
|
|
|
145930
145910
|
// ../../generator-common/dist/esm-node/common/packagePath.js
|
|
145931
145911
|
var PackagePathRegex = new RegExp("^[a-z0-9-_]+[a-z0-9-/_]*$");
|
|
145932
145912
|
var getPackagePathSchema = (extra) => {
|
|
145933
|
-
var _extra;
|
|
145934
145913
|
return {
|
|
145935
145914
|
type: "string",
|
|
145936
145915
|
title: i18n2.t(localeKeys2.packagePath.self),
|
|
@@ -145942,7 +145921,7 @@ var getPackagePathSchema = (extra) => {
|
|
|
145942
145921
|
fulfill: {
|
|
145943
145922
|
state: {
|
|
145944
145923
|
value: "{{$deps[0]}}",
|
|
145945
|
-
visible: Boolean(
|
|
145924
|
+
visible: Boolean(extra === null || extra === void 0 ? void 0 : extra.isMonorepoSubProject)
|
|
145946
145925
|
}
|
|
145947
145926
|
}
|
|
145948
145927
|
}
|
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-20230920090905",
|
|
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/
|
|
33
|
-
"@modern-js/generator
|
|
34
|
-
"@modern-js/generator
|
|
35
|
-
"@modern-js/generator
|
|
36
|
-
"@modern-js/
|
|
37
|
-
"@modern-js/
|
|
38
|
-
"@modern-js/
|
|
39
|
-
"@
|
|
40
|
-
"@scripts/
|
|
41
|
-
"@
|
|
32
|
+
"@modern-js/generator-common": "0.0.0-next-20230920090905",
|
|
33
|
+
"@modern-js/monorepo-generator": "0.0.0-next-20230920090905",
|
|
34
|
+
"@modern-js/module-generator": "0.0.0-next-20230920090905",
|
|
35
|
+
"@modern-js/mwa-generator": "0.0.0-next-20230920090905",
|
|
36
|
+
"@modern-js/utils": "0.0.0-next-20230920090905",
|
|
37
|
+
"@modern-js/base-generator": "0.0.0-next-20230920090905",
|
|
38
|
+
"@modern-js/generator-plugin": "0.0.0-next-20230920090905",
|
|
39
|
+
"@modern-js/generator-utils": "0.0.0-next-20230920090905",
|
|
40
|
+
"@scripts/build": "0.0.0-next-20230920090905",
|
|
41
|
+
"@scripts/jest-config": "0.0.0-next-20230920090905"
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"publishConfig": {
|