@modern-js/monorepo-generator 3.0.4 → 3.0.6
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/README.md +14 -18
- package/dist/index.js +52 -29
- package/package.json +10 -10
- package/src/index.ts +194 -0
package/README.md
CHANGED
@@ -1,30 +1,26 @@
|
|
1
|
-
|
2
1
|
<p align="center">
|
3
2
|
<a href="https://modernjs.dev" target="blank"><img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png" width="300" alt="Modern.js Logo" /></a>
|
4
3
|
</p>
|
4
|
+
|
5
|
+
<h1 align="center">Modern.js</h1>
|
6
|
+
|
5
7
|
<p align="center">
|
6
|
-
|
7
|
-
<br/>
|
8
|
-
<a href="https://modernjs.dev" target="blank">
|
9
|
-
modernjs.dev
|
10
|
-
</a>
|
11
|
-
</p>
|
12
|
-
<p align="center">
|
13
|
-
The meta-framework suite designed from scratch for frontend-focused modern web development
|
8
|
+
A Progressive React Framework for modern web development.
|
14
9
|
</p>
|
15
10
|
|
16
|
-
|
17
|
-
|
18
|
-
> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.
|
11
|
+
## Getting Started
|
19
12
|
|
20
|
-
|
13
|
+
Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
|
21
14
|
|
22
|
-
##
|
15
|
+
## Documentation
|
23
16
|
|
24
|
-
- [
|
25
|
-
- [
|
26
|
-
- [API References](https://modernjs.dev/docs/apis)
|
17
|
+
- [English Documentation](https://modernjs.dev/en/)
|
18
|
+
- [中文文档](https://modernjs.dev)
|
27
19
|
|
28
20
|
## Contributing
|
29
21
|
|
30
|
-
|
22
|
+
Please read the [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md).
|
23
|
+
|
24
|
+
## License
|
25
|
+
|
26
|
+
Modern.js is [MIT licensed](https://github.com/modern-js-dev/modern.js/blob/main/LICENSE).
|
package/dist/index.js
CHANGED
@@ -35785,7 +35785,7 @@ var require_nodeEnv = __commonJS({
|
|
35785
35785
|
});
|
35786
35786
|
}
|
35787
35787
|
exports.canUseNpm = canUseNpm2;
|
35788
|
-
function
|
35788
|
+
function canUseYarn2() {
|
35789
35789
|
return __async(this, null, function* () {
|
35790
35790
|
try {
|
35791
35791
|
yield (0, compiled_1.execa)("yarn", ["--version"], { env: process.env });
|
@@ -35795,7 +35795,7 @@ var require_nodeEnv = __commonJS({
|
|
35795
35795
|
}
|
35796
35796
|
});
|
35797
35797
|
}
|
35798
|
-
exports.canUseYarn =
|
35798
|
+
exports.canUseYarn = canUseYarn2;
|
35799
35799
|
function canUsePnpm3() {
|
35800
35800
|
return __async(this, null, function* () {
|
35801
35801
|
try {
|
@@ -37196,14 +37196,14 @@ var require_packageManager = __commonJS({
|
|
37196
37196
|
value: true
|
37197
37197
|
});
|
37198
37198
|
exports.canUsePnpm = canUsePnpm3;
|
37199
|
-
exports.canUseYarn =
|
37199
|
+
exports.canUseYarn = canUseYarn2;
|
37200
37200
|
exports.runInstall = runInstall;
|
37201
37201
|
var _path = _interopRequireDefault(require("path"));
|
37202
37202
|
var _utils = require_dist();
|
37203
37203
|
function _interopRequireDefault(obj) {
|
37204
37204
|
return obj && obj.__esModule ? obj : { default: obj };
|
37205
37205
|
}
|
37206
|
-
function
|
37206
|
+
function canUseYarn2() {
|
37207
37207
|
return __async(this, null, function* () {
|
37208
37208
|
try {
|
37209
37209
|
yield (0, _utils.execa)("yarn", ["--version"], {
|
@@ -37250,7 +37250,7 @@ var require_packageManager = __commonJS({
|
|
37250
37250
|
params.push(`--registry=${registryUrl}`);
|
37251
37251
|
}
|
37252
37252
|
yield (0, _utils.execa)("pnpm", params, options);
|
37253
|
-
} else if (yield
|
37253
|
+
} else if (yield canUseYarn2()) {
|
37254
37254
|
const params = ["install", "--production", "--silent", "--ignore-scripts"];
|
37255
37255
|
if (registryUrl) {
|
37256
37256
|
params.push(`--registry=${registryUrl}`);
|
@@ -53325,7 +53325,7 @@ var require_env = __commonJS({
|
|
53325
53325
|
exports.canUseNpm = canUseNpm2;
|
53326
53326
|
exports.canUseNvm = canUseNvm;
|
53327
53327
|
exports.canUsePnpm = canUsePnpm3;
|
53328
|
-
exports.canUseYarn =
|
53328
|
+
exports.canUseYarn = canUseYarn2;
|
53329
53329
|
var _utils = require_dist();
|
53330
53330
|
function canUseNvm() {
|
53331
53331
|
return __async(this, null, function* () {
|
@@ -53352,7 +53352,7 @@ var require_env = __commonJS({
|
|
53352
53352
|
}
|
53353
53353
|
});
|
53354
53354
|
}
|
53355
|
-
function
|
53355
|
+
function canUseYarn2() {
|
53356
53356
|
return __async(this, null, function* () {
|
53357
53357
|
try {
|
53358
53358
|
yield (0, _utils.execa)("yarn", ["--version"], {
|
@@ -134820,6 +134820,26 @@ var require_compiled2 = __commonJS({
|
|
134820
134820
|
}
|
134821
134821
|
});
|
134822
134822
|
|
134823
|
+
// ../../../toolkit/utils/dist/commands.js
|
134824
|
+
var require_commands = __commonJS({
|
134825
|
+
"../../../toolkit/utils/dist/commands.js"(exports) {
|
134826
|
+
"use strict";
|
134827
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
134828
|
+
exports.isDevCommand = exports.getCommand = void 0;
|
134829
|
+
var getCommand = () => {
|
134830
|
+
const args = process.argv.slice(2);
|
134831
|
+
const command = args[0];
|
134832
|
+
return command;
|
134833
|
+
};
|
134834
|
+
exports.getCommand = getCommand;
|
134835
|
+
var isDevCommand = () => {
|
134836
|
+
const command = (0, exports.getCommand)();
|
134837
|
+
return command === "dev" || command === "start";
|
134838
|
+
};
|
134839
|
+
exports.isDevCommand = isDevCommand;
|
134840
|
+
}
|
134841
|
+
});
|
134842
|
+
|
134823
134843
|
// ../../../toolkit/utils/dist/format.js
|
134824
134844
|
var require_format2 = __commonJS({
|
134825
134845
|
"../../../toolkit/utils/dist/format.js"(exports) {
|
@@ -135195,12 +135215,14 @@ var require_node_env2 = __commonJS({
|
|
135195
135215
|
"../../../toolkit/utils/dist/is/node-env.js"(exports) {
|
135196
135216
|
"use strict";
|
135197
135217
|
Object.defineProperty(exports, "__esModule", { value: true });
|
135198
|
-
exports.isProdProfile = exports.isTest = exports.isProd = exports.isDev = void 0;
|
135199
|
-
var
|
135218
|
+
exports.isProdProfile = exports.isTest = exports.isProd = exports.isDev = exports.getNodeEnv = void 0;
|
135219
|
+
var getNodeEnv = () => process.env.NODE_ENV || "development";
|
135220
|
+
exports.getNodeEnv = getNodeEnv;
|
135221
|
+
var isDev = () => (0, exports.getNodeEnv)() === "development";
|
135200
135222
|
exports.isDev = isDev;
|
135201
|
-
var isProd = () =>
|
135223
|
+
var isProd = () => (0, exports.getNodeEnv)() === "production";
|
135202
135224
|
exports.isProd = isProd;
|
135203
|
-
var isTest = () =>
|
135225
|
+
var isTest = () => (0, exports.getNodeEnv)() === "test";
|
135204
135226
|
exports.isTest = isTest;
|
135205
135227
|
var isProdProfile = () => (0, exports.isProd)() && process.argv.includes("--profile");
|
135206
135228
|
exports.isProdProfile = isProdProfile;
|
@@ -135343,10 +135365,10 @@ var require_is2 = __commonJS({
|
|
135343
135365
|
|
135344
135366
|
// ../../../toolkit/utils/dist/compatRequire.js
|
135345
135367
|
var require_compatRequire2 = __commonJS({
|
135346
|
-
"../../../toolkit/utils/dist/compatRequire.js"(exports) {
|
135368
|
+
"../../../toolkit/utils/dist/compatRequire.js"(exports, module2) {
|
135347
135369
|
"use strict";
|
135348
135370
|
Object.defineProperty(exports, "__esModule", { value: true });
|
135349
|
-
exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
135371
|
+
exports.deleteRequireCache = exports.cleanRequireCache = exports.requireExistModule = exports.dynamicImport = exports.compatRequire = void 0;
|
135350
135372
|
var findExists_1 = require_findExists2();
|
135351
135373
|
var compatRequire = (filePath, interop = true) => {
|
135352
135374
|
const mod = require(filePath);
|
@@ -135373,6 +135395,15 @@ var require_compatRequire2 = __commonJS({
|
|
135373
135395
|
});
|
135374
135396
|
};
|
135375
135397
|
exports.cleanRequireCache = cleanRequireCache;
|
135398
|
+
function deleteRequireCache(path2) {
|
135399
|
+
if (require.cache[path2]) {
|
135400
|
+
delete require.cache[path2];
|
135401
|
+
}
|
135402
|
+
if (module2.children) {
|
135403
|
+
module2.children = module2.children.filter((item) => item.filename !== path2);
|
135404
|
+
}
|
135405
|
+
}
|
135406
|
+
exports.deleteRequireCache = deleteRequireCache;
|
135376
135407
|
}
|
135377
135408
|
});
|
135378
135409
|
|
@@ -135394,7 +135425,7 @@ var require_constants6 = __commonJS({
|
|
135394
135425
|
exports.SERVER_DIR = "server";
|
135395
135426
|
exports.SHARED_DIR = "shared";
|
135396
135427
|
exports.CONFIG_CACHE_DIR = "./node_modules/.cache/node-bundle-require";
|
135397
|
-
exports.CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".
|
135428
|
+
exports.CONFIG_FILE_EXTENSIONS = [".js", ".ts", ".mjs"];
|
135398
135429
|
exports.OUTPUT_CONFIG_FILE = "modern.config.json";
|
135399
135430
|
exports.DEFAULT_SERVER_CONFIG = "modern.server-runtime.config";
|
135400
135431
|
exports.ROUTE_MINIFEST_FILE = "routes-manifest.json";
|
@@ -135885,7 +135916,7 @@ var require_nodeEnv2 = __commonJS({
|
|
135885
135916
|
});
|
135886
135917
|
}
|
135887
135918
|
exports.canUseNpm = canUseNpm2;
|
135888
|
-
function
|
135919
|
+
function canUseYarn2() {
|
135889
135920
|
return __async(this, null, function* () {
|
135890
135921
|
try {
|
135891
135922
|
yield (0, compiled_1.execa)("yarn", ["--version"], { env: process.env });
|
@@ -135895,7 +135926,7 @@ var require_nodeEnv2 = __commonJS({
|
|
135895
135926
|
}
|
135896
135927
|
});
|
135897
135928
|
}
|
135898
|
-
exports.canUseYarn =
|
135929
|
+
exports.canUseYarn = canUseYarn2;
|
135899
135930
|
function canUsePnpm3() {
|
135900
135931
|
return __async(this, null, function* () {
|
135901
135932
|
try {
|
@@ -136974,6 +137005,7 @@ var require_dist3 = __commonJS({
|
|
136974
137005
|
};
|
136975
137006
|
Object.defineProperty(exports, "__esModule", { value: true });
|
136976
137007
|
__exportStar(require_compiled2(), exports);
|
137008
|
+
__exportStar(require_commands(), exports);
|
136977
137009
|
__exportStar(require_format2(), exports);
|
136978
137010
|
__exportStar(require_FileSizeReporter2(), exports);
|
136979
137011
|
__exportStar(require_printBuildError2(), exports);
|
@@ -137194,7 +137226,7 @@ var ZH_LOCALE = {
|
|
137194
137226
|
var EN_LOCALE = {
|
137195
137227
|
solution: {
|
137196
137228
|
self: "Please select the solution you want to create",
|
137197
|
-
mwa: "
|
137229
|
+
mwa: "Web App Solution",
|
137198
137230
|
module: "Module Solution",
|
137199
137231
|
monorepo: "Monorepo Solution",
|
137200
137232
|
custom: "Custom Solution",
|
@@ -137205,10 +137237,10 @@ var EN_LOCALE = {
|
|
137205
137237
|
},
|
137206
137238
|
sub_solution: {
|
137207
137239
|
self: "Please select the solution you want to create",
|
137208
|
-
mwa: "
|
137209
|
-
mwa_test: "
|
137240
|
+
mwa: "Web App Solution",
|
137241
|
+
mwa_test: "Web App Solution (Test)",
|
137210
137242
|
module: "Module Solution",
|
137211
|
-
inner_module: "Module Solution(Inner)",
|
137243
|
+
inner_module: "Module Solution (Inner)",
|
137212
137244
|
monorepo: "Monorepo Solution"
|
137213
137245
|
},
|
137214
137246
|
action: {
|
@@ -137403,15 +137435,6 @@ function getPackageVersion(packageName, registry2) {
|
|
137403
137435
|
spinner.stop();
|
137404
137436
|
return stripAnsi2(result.stdout);
|
137405
137437
|
}
|
137406
|
-
if (yield (0, import_utils2.canUseYarn)()) {
|
137407
|
-
const args = ["info", packageName, "version", "--silent"];
|
137408
|
-
if (registry2) {
|
137409
|
-
args.push(`--registry=${registry2}`);
|
137410
|
-
}
|
137411
|
-
const result = yield (0, import_utils2.execa)("yarn", args);
|
137412
|
-
spinner.stop();
|
137413
|
-
return stripAnsi2(result.stdout);
|
137414
|
-
}
|
137415
137438
|
if (yield (0, import_utils2.canUseNpm)()) {
|
137416
137439
|
const args = ["view", packageName, "version"];
|
137417
137440
|
if (registry2) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@modern-js/monorepo-generator",
|
3
|
-
"description": "
|
3
|
+
"description": "A Progressive React Framework for modern web development.",
|
4
4
|
"homepage": "https://modernjs.dev",
|
5
5
|
"bugs": "https://github.com/modern-js-dev/modern.js/issues",
|
6
6
|
"repository": "modern-js-dev/modern.js",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "3.0.
|
14
|
+
"version": "3.0.6",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"main": "./dist/index.js",
|
17
17
|
"files": [
|
@@ -27,14 +27,14 @@
|
|
27
27
|
"@types/node": "^14",
|
28
28
|
"jest": "^27",
|
29
29
|
"typescript": "^4",
|
30
|
-
"@modern-js/generator
|
31
|
-
"@modern-js/generator-
|
32
|
-
"@modern-js/
|
33
|
-
"@modern-js/
|
34
|
-
"@modern-js/
|
35
|
-
"@modern-js/base-generator": "3.0.
|
36
|
-
"@scripts/build": "2.
|
37
|
-
"@scripts/jest-config": "2.
|
30
|
+
"@modern-js/changeset-generator": "3.0.6",
|
31
|
+
"@modern-js/generator-utils": "3.0.6",
|
32
|
+
"@modern-js/plugin-i18n": "2.4.0",
|
33
|
+
"@modern-js/packages-generator": "3.0.6",
|
34
|
+
"@modern-js/generator-common": "3.0.6",
|
35
|
+
"@modern-js/base-generator": "3.0.6",
|
36
|
+
"@scripts/build": "2.4.0",
|
37
|
+
"@scripts/jest-config": "2.4.0"
|
38
38
|
},
|
39
39
|
"sideEffects": false,
|
40
40
|
"publishConfig": {
|
package/src/index.ts
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
import path from 'path';
|
2
|
+
import {
|
3
|
+
canUsePnpm,
|
4
|
+
canUseYarn,
|
5
|
+
GeneratorContext,
|
6
|
+
GeneratorCore,
|
7
|
+
} from '@modern-js/codesmith';
|
8
|
+
import { AppAPI } from '@modern-js/codesmith-api-app';
|
9
|
+
import { JsonAPI } from '@modern-js/codesmith-api-json';
|
10
|
+
import {
|
11
|
+
i18n as commonI18n,
|
12
|
+
BaseGenerator,
|
13
|
+
Solution,
|
14
|
+
getMonorepoSchema,
|
15
|
+
PackageManager,
|
16
|
+
ChangesetGenerator,
|
17
|
+
PackagesGenerator,
|
18
|
+
} from '@modern-js/generator-common';
|
19
|
+
import {
|
20
|
+
getPackageManagerText,
|
21
|
+
getModernVersion,
|
22
|
+
} from '@modern-js/generator-utils';
|
23
|
+
import { i18n, localeKeys } from './locale';
|
24
|
+
|
25
|
+
const getGeneratorPath = (generator: string, distTag: string) => {
|
26
|
+
if (process.env.CODESMITH_ENV === 'development') {
|
27
|
+
return path.dirname(require.resolve(generator));
|
28
|
+
} else if (distTag) {
|
29
|
+
return `${generator}@${distTag}`;
|
30
|
+
}
|
31
|
+
return generator;
|
32
|
+
};
|
33
|
+
|
34
|
+
export const handleTemplateFile = async (
|
35
|
+
context: GeneratorContext,
|
36
|
+
generator: GeneratorCore,
|
37
|
+
appApi: AppAPI,
|
38
|
+
) => {
|
39
|
+
const { hasPlugin, generatorPlugin, ...extra } = context.config;
|
40
|
+
|
41
|
+
let ans: Record<string, unknown> = {};
|
42
|
+
|
43
|
+
if (hasPlugin) {
|
44
|
+
await generatorPlugin.installPlugins(Solution.Monorepo, extra);
|
45
|
+
const schema = generatorPlugin.getInputSchema();
|
46
|
+
const inputValue = generatorPlugin.getInputValue();
|
47
|
+
context.config.gitCommitMessage =
|
48
|
+
generatorPlugin.getGitMessage() || context.config.gitCommitMessage;
|
49
|
+
ans = await appApi.getInputBySchema(
|
50
|
+
schema,
|
51
|
+
'formily',
|
52
|
+
{
|
53
|
+
...context.config,
|
54
|
+
...inputValue,
|
55
|
+
isMonorepo: true,
|
56
|
+
},
|
57
|
+
{},
|
58
|
+
{},
|
59
|
+
);
|
60
|
+
} else {
|
61
|
+
ans = await appApi.getInputBySchemaFunc(getMonorepoSchema, {
|
62
|
+
...context.config,
|
63
|
+
isMonorepo: true,
|
64
|
+
});
|
65
|
+
}
|
66
|
+
|
67
|
+
const modernVersion = await getModernVersion(
|
68
|
+
Solution.Monorepo,
|
69
|
+
context.config.registry,
|
70
|
+
context.config.distTag,
|
71
|
+
);
|
72
|
+
|
73
|
+
generator.logger.debug(`ans=`, ans);
|
74
|
+
|
75
|
+
const { packageManager } = ans;
|
76
|
+
await appApi.runSubGenerator(
|
77
|
+
getGeneratorPath(BaseGenerator, context.config.distTag),
|
78
|
+
undefined,
|
79
|
+
{ ...context.config, hasPlugin: false },
|
80
|
+
);
|
81
|
+
|
82
|
+
await appApi.forgeTemplate(
|
83
|
+
'templates/base-template/**/*',
|
84
|
+
undefined,
|
85
|
+
(resourceKey: string) =>
|
86
|
+
resourceKey
|
87
|
+
.replace('templates/base-template/', '')
|
88
|
+
.replace('.handlebars', ''),
|
89
|
+
{ packageManager, modernVersion },
|
90
|
+
);
|
91
|
+
|
92
|
+
if (packageManager === PackageManager.Pnpm) {
|
93
|
+
await appApi.forgeTemplate(
|
94
|
+
'templates/pnpm-template/**/*',
|
95
|
+
undefined,
|
96
|
+
(resourceKey: string) =>
|
97
|
+
resourceKey
|
98
|
+
.replace('templates/pnpm-template/', '')
|
99
|
+
.replace('.handlebars', ''),
|
100
|
+
);
|
101
|
+
}
|
102
|
+
|
103
|
+
if (packageManager === PackageManager.Yarn) {
|
104
|
+
await appApi.forgeTemplate(
|
105
|
+
'templates/yarn-template/**/*',
|
106
|
+
undefined,
|
107
|
+
(resourceKey: string) =>
|
108
|
+
resourceKey
|
109
|
+
.replace('templates/yarn-template/', '')
|
110
|
+
.replace('.handlebars', ''),
|
111
|
+
);
|
112
|
+
|
113
|
+
const jsonAPI = new JsonAPI(generator);
|
114
|
+
|
115
|
+
await jsonAPI.update(
|
116
|
+
context.materials.default.get(
|
117
|
+
path.join(generator.outputPath, 'package.json'),
|
118
|
+
),
|
119
|
+
{
|
120
|
+
query: {},
|
121
|
+
update: {
|
122
|
+
$set: {
|
123
|
+
'scripts.prepare': 'lerna run prepare',
|
124
|
+
},
|
125
|
+
},
|
126
|
+
},
|
127
|
+
);
|
128
|
+
}
|
129
|
+
|
130
|
+
await appApi.runSubGenerator(
|
131
|
+
getGeneratorPath(ChangesetGenerator, context.config.distTag),
|
132
|
+
);
|
133
|
+
|
134
|
+
const { packagesInfo } = context.config;
|
135
|
+
if (packagesInfo && Object.keys(packagesInfo).length > 0) {
|
136
|
+
await appApi.runSubGenerator(
|
137
|
+
getGeneratorPath(PackagesGenerator, context.config.distTag),
|
138
|
+
undefined,
|
139
|
+
context.config,
|
140
|
+
);
|
141
|
+
}
|
142
|
+
};
|
143
|
+
|
144
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
145
|
+
const appApi = new AppAPI(context, generator);
|
146
|
+
|
147
|
+
const { locale, successInfo } = context.config;
|
148
|
+
commonI18n.changeLanguage({ locale });
|
149
|
+
i18n.changeLanguage({ locale });
|
150
|
+
appApi.i18n.changeLanguage({ locale });
|
151
|
+
|
152
|
+
// monorepo 场景下必须使用 pnpm 或者 yarn
|
153
|
+
if (!(await canUsePnpm()) && !(await canUseYarn())) {
|
154
|
+
generator.logger.warn(i18n.t(localeKeys.environment.yarn_pnpm));
|
155
|
+
// eslint-disable-next-line no-process-exit
|
156
|
+
process.exit(1);
|
157
|
+
}
|
158
|
+
|
159
|
+
generator.logger.debug(`start run @modern-js/monorepo-generator`);
|
160
|
+
generator.logger.debug(`context=${JSON.stringify(context)}`);
|
161
|
+
generator.logger.debug(`context.data=${JSON.stringify(context.data)}`);
|
162
|
+
|
163
|
+
try {
|
164
|
+
await handleTemplateFile(context, generator, appApi);
|
165
|
+
} catch (e) {
|
166
|
+
generator.logger.error(e);
|
167
|
+
// eslint-disable-next-line no-process-exit
|
168
|
+
process.exit(1);
|
169
|
+
}
|
170
|
+
|
171
|
+
if (context.handleForged) {
|
172
|
+
await context.handleForged(
|
173
|
+
Solution.Monorepo,
|
174
|
+
context,
|
175
|
+
context.config.hasPlugin,
|
176
|
+
);
|
177
|
+
}
|
178
|
+
|
179
|
+
try {
|
180
|
+
await appApi.runGitAndInstall(context.config.gitCommitMessage);
|
181
|
+
} catch (e) {
|
182
|
+
// eslint-disable-next-line no-process-exit
|
183
|
+
process.exit(1);
|
184
|
+
}
|
185
|
+
|
186
|
+
appApi.showSuccessInfo(
|
187
|
+
successInfo ||
|
188
|
+
i18n.t(localeKeys.success, {
|
189
|
+
packageManager: getPackageManagerText(context.config.packageManager),
|
190
|
+
}),
|
191
|
+
);
|
192
|
+
|
193
|
+
generator.logger.debug(`forge @modern-js/monorepo-generator succeed `);
|
194
|
+
};
|