@modern-js/monorepo-tools 2.35.0 → 2.36.0
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/cjs/cli/build.js +26 -9
- package/dist/cjs/cli/buildWatch.js +26 -9
- package/dist/cjs/cli/clear.js +26 -9
- package/dist/cjs/cli/deploy.js +26 -9
- package/dist/cjs/cli/index.js +30 -9
- package/dist/cjs/cli/install.js +26 -9
- package/dist/cjs/cli/new.js +29 -12
- package/dist/cjs/commands/build.js +33 -16
- package/dist/cjs/commands/buildWatch.js +32 -15
- package/dist/cjs/commands/clear.js +30 -13
- package/dist/cjs/commands/deploy.js +34 -17
- package/dist/cjs/commands/index.js +28 -8
- package/dist/cjs/commands/install.js +32 -15
- package/dist/cjs/constants.js +25 -15
- package/dist/cjs/dag/create.js +25 -9
- package/dist/cjs/dag/edgeManager.js +26 -9
- package/dist/cjs/dag/index.js +28 -11
- package/dist/cjs/dag/operator.js +59 -34
- package/dist/cjs/dag/task.js +46 -20
- package/dist/cjs/dag/utils.js +33 -25
- package/dist/cjs/features/build/index.js +51 -32
- package/dist/cjs/features/clear/index.js +47 -28
- package/dist/cjs/features/deploy/index.js +66 -41
- package/dist/cjs/features/dev/cmds.js +24 -7
- package/dist/cjs/features/dev/createTask.js +50 -31
- package/dist/cjs/features/dev/index.js +47 -21
- package/dist/cjs/features/dev/watchProjectsState.js +43 -17
- package/dist/cjs/features/install/index.js +55 -29
- package/dist/cjs/hooks/index.js +26 -9
- package/dist/cjs/index.js +45 -35
- package/dist/cjs/locale/en.js +24 -7
- package/dist/cjs/locale/index.js +31 -21
- package/dist/cjs/locale/zh.js +24 -7
- package/dist/cjs/log/error.js +24 -7
- package/dist/cjs/log/multiTasksLog.js +33 -16
- package/dist/cjs/log/time.js +29 -20
- package/dist/cjs/log/utils.js +24 -7
- package/dist/cjs/package/index.js +28 -11
- package/dist/cjs/parse-config/index.js +39 -13
- package/dist/cjs/parse-config/monorepo.js +55 -39
- package/dist/cjs/projects/checkProjectChange.js +65 -50
- package/dist/cjs/projects/clearMemoryFiles.js +39 -13
- package/dist/cjs/projects/getProjects.js +37 -27
- package/dist/cjs/projects/getProjectsByPackagesConfig.js +51 -33
- package/dist/cjs/projects/getProjectsByWorkspaceFile.js +63 -44
- package/dist/cjs/type.js +15 -3
- package/dist/cjs/utils/install.js +43 -24
- package/dist/cjs/utils/types.js +15 -3
- package/dist/esm/cli/build.js +4 -1
- package/dist/esm/cli/buildWatch.js +4 -1
- package/dist/esm/cli/clear.js +4 -1
- package/dist/esm/cli/deploy.js +4 -1
- package/dist/esm/cli/install.js +4 -1
- package/dist/esm/cli/new.js +4 -1
- package/dist/esm/commands/build.js +4 -1
- package/dist/esm/commands/buildWatch.js +4 -1
- package/dist/esm/commands/clear.js +4 -1
- package/dist/esm/commands/deploy.js +4 -1
- package/dist/esm/commands/install.js +4 -1
- package/dist/esm/constants.js +6 -2
- package/dist/esm/dag/create.js +5 -3
- package/dist/esm/dag/edgeManager.js +4 -1
- package/dist/esm/dag/index.js +4 -1
- package/dist/esm/dag/operator.js +5 -3
- package/dist/esm/dag/task.js +4 -1
- package/dist/esm/dag/utils.js +10 -4
- package/dist/esm/features/build/index.js +6 -2
- package/dist/esm/features/clear/index.js +6 -2
- package/dist/esm/features/deploy/index.js +5 -3
- package/dist/esm/features/dev/cmds.js +4 -1
- package/dist/esm/features/dev/createTask.js +6 -2
- package/dist/esm/features/dev/index.js +4 -1
- package/dist/esm/features/dev/watchProjectsState.js +4 -1
- package/dist/esm/features/install/index.js +6 -3
- package/dist/esm/hooks/index.js +4 -1
- package/dist/esm/index.js +6 -2
- package/dist/esm/locale/en.js +4 -1
- package/dist/esm/locale/index.js +4 -1
- package/dist/esm/locale/zh.js +4 -1
- package/dist/esm/log/error.js +4 -1
- package/dist/esm/log/multiTasksLog.js +4 -1
- package/dist/esm/log/time.js +8 -3
- package/dist/esm/log/utils.js +4 -1
- package/dist/esm/package/index.js +4 -1
- package/dist/esm/parse-config/index.js +4 -1
- package/dist/esm/parse-config/monorepo.js +12 -5
- package/dist/esm/projects/checkProjectChange.js +12 -5
- package/dist/esm/projects/clearMemoryFiles.js +4 -1
- package/dist/esm/projects/getProjects.js +6 -2
- package/dist/esm/projects/getProjectsByPackagesConfig.js +6 -2
- package/dist/esm/projects/getProjectsByWorkspaceFile.js +10 -6
- package/dist/esm/type.js +0 -1
- package/dist/esm/utils/install.js +6 -2
- package/dist/esm/utils/types.js +0 -1
- package/package.json +11 -11
|
@@ -1,38 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var dev_exports = {};
|
|
30
|
+
__export(dev_exports, {
|
|
31
|
+
runBuildWatchTask: () => runBuildWatchTask
|
|
10
32
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
33
|
+
module.exports = __toCommonJS(dev_exports);
|
|
34
|
+
var import_anymatch = __toESM(require("anymatch"));
|
|
35
|
+
var import_utils = require("@modern-js/utils");
|
|
36
|
+
var import_multiTasksLog = require("../../log/multiTasksLog");
|
|
37
|
+
var import_watchProjectsState = require("./watchProjectsState");
|
|
38
|
+
var import_cmds = require("./cmds");
|
|
39
|
+
var import_createTask = require("./createTask");
|
|
18
40
|
const getIgnored = (config) => (watchFilePath) => {
|
|
19
41
|
const nodeModulesPattern = /(?:^|[\\/])node_modules/g;
|
|
20
42
|
if (nodeModulesPattern.test(watchFilePath) || watchFilePath.includes("dist")) {
|
|
21
43
|
return true;
|
|
22
44
|
}
|
|
23
45
|
if (config.ignoreMaybeChanged) {
|
|
24
|
-
return (0,
|
|
46
|
+
return (0, import_anymatch.default)(config.ignoreMaybeChanged)(watchFilePath);
|
|
25
47
|
}
|
|
26
48
|
return false;
|
|
27
49
|
};
|
|
28
|
-
const runBuildWatchTask = async (projectName, operator, config, taskCmds =
|
|
50
|
+
const runBuildWatchTask = async (projectName, operator, config, taskCmds = import_cmds.defaultBuildWatchCmds) => {
|
|
29
51
|
const { needInit = true } = config;
|
|
30
|
-
const taskLogger = new
|
|
31
|
-
const dependenciesTask = (0,
|
|
32
|
-
const devTask = (0,
|
|
52
|
+
const taskLogger = new import_multiTasksLog.MultitasksLogger();
|
|
53
|
+
const dependenciesTask = (0, import_createTask.createDependenciesTask)(config, taskCmds, taskLogger);
|
|
54
|
+
const devTask = (0, import_createTask.createDevTask)(config, taskCmds, taskLogger);
|
|
33
55
|
const fromNodes = operator.getNodeAllDependencyData(projectName);
|
|
34
|
-
const watchedProjectState = new
|
|
35
|
-
const watcher = new
|
|
56
|
+
const watchedProjectState = new import_watchProjectsState.WatchedProjectsState(fromNodes, config);
|
|
57
|
+
const watcher = new import_utils.chokidar.FSWatcher({
|
|
36
58
|
persistent: true,
|
|
37
59
|
cwd: config.rootPath,
|
|
38
60
|
followSymlinks: false,
|
|
@@ -78,3 +100,7 @@ const runBuildWatchTask = async (projectName, operator, config, taskCmds = _cmds
|
|
|
78
100
|
checkExist: true
|
|
79
101
|
}));
|
|
80
102
|
};
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
runBuildWatchTask
|
|
106
|
+
});
|
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var watchProjectsState_exports = {};
|
|
30
|
+
__export(watchProjectsState_exports, {
|
|
31
|
+
WatchedProjectsState: () => WatchedProjectsState
|
|
10
32
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
33
|
+
module.exports = __toCommonJS(watchProjectsState_exports);
|
|
34
|
+
var import_define_property = require("@swc/helpers/_/_define_property");
|
|
35
|
+
var path = __toESM(require("path"));
|
|
36
|
+
var import_utils = require("@modern-js/utils");
|
|
15
37
|
class WatchedProjectsState {
|
|
16
38
|
_initState() {
|
|
17
39
|
const globOption = {
|
|
@@ -26,9 +48,9 @@ class WatchedProjectsState {
|
|
|
26
48
|
]
|
|
27
49
|
};
|
|
28
50
|
this._watchProjects = this._fromNodes.reduce((ret, node) => {
|
|
29
|
-
const files =
|
|
51
|
+
const files = import_utils.globby.sync(`${node.extra.path}/**`, globOption);
|
|
30
52
|
for (const filePath of files) {
|
|
31
|
-
this._projectsFileMap.set(
|
|
53
|
+
this._projectsFileMap.set(path.relative(this._config.rootPath, filePath), node.extra.path);
|
|
32
54
|
}
|
|
33
55
|
return {
|
|
34
56
|
...ret,
|
|
@@ -56,10 +78,10 @@ class WatchedProjectsState {
|
|
|
56
78
|
return Object.keys(this._watchProjects).map((projectPath) => this._watchProjects[projectPath].name);
|
|
57
79
|
}
|
|
58
80
|
constructor(fromNodes, config) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
81
|
+
(0, import_define_property._)(this, "_config", void 0);
|
|
82
|
+
(0, import_define_property._)(this, "_fromNodes", void 0);
|
|
83
|
+
(0, import_define_property._)(this, "_watchProjects", void 0);
|
|
84
|
+
(0, import_define_property._)(this, "_projectsFileMap", void 0);
|
|
63
85
|
this._fromNodes = fromNodes;
|
|
64
86
|
this._config = config;
|
|
65
87
|
this._projectsFileMap = /* @__PURE__ */ new Map();
|
|
@@ -67,3 +89,7 @@ class WatchedProjectsState {
|
|
|
67
89
|
this._initState();
|
|
68
90
|
}
|
|
69
91
|
}
|
|
92
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
93
|
+
0 && (module.exports = {
|
|
94
|
+
WatchedProjectsState
|
|
95
|
+
});
|
|
@@ -1,41 +1,63 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
17
|
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var install_exports = {};
|
|
30
|
+
__export(install_exports, {
|
|
31
|
+
runInstallTask: () => runInstallTask
|
|
10
32
|
});
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
33
|
+
module.exports = __toCommonJS(install_exports);
|
|
34
|
+
var path = __toESM(require("path"));
|
|
35
|
+
var import_utils = require("@modern-js/utils");
|
|
36
|
+
var import_node_core_library = require("@rushstack/node-core-library");
|
|
37
|
+
var import_constants = require("../../constants");
|
|
38
|
+
var import_install = require("../../utils/install");
|
|
17
39
|
const replaceWorkspaces = ({ rootPath, projectsInWorkspaces }) => {
|
|
18
|
-
const pnpmWsFilePath =
|
|
19
|
-
if (
|
|
20
|
-
const pnpmWorkspace =
|
|
21
|
-
const originalPnpmWorkspaces =
|
|
22
|
-
|
|
40
|
+
const pnpmWsFilePath = path.join(rootPath, import_constants.WORKSPACE_FILE.PNPM);
|
|
41
|
+
if (import_utils.fs.existsSync(pnpmWsFilePath)) {
|
|
42
|
+
const pnpmWorkspace = import_utils.fs.readFileSync(pnpmWsFilePath, "utf-8");
|
|
43
|
+
const originalPnpmWorkspaces = import_utils.yaml.load(pnpmWorkspace);
|
|
44
|
+
import_utils.fs.writeFileSync(pnpmWsFilePath, import_utils.yaml.dump({
|
|
23
45
|
packages: projectsInWorkspaces
|
|
24
46
|
}));
|
|
25
47
|
return () => {
|
|
26
|
-
|
|
48
|
+
import_utils.yaml.dump(originalPnpmWorkspaces);
|
|
27
49
|
};
|
|
28
50
|
}
|
|
29
|
-
const pkgFilePath =
|
|
30
|
-
if (
|
|
31
|
-
var _pkg_workspaces
|
|
32
|
-
const pkg =
|
|
33
|
-
if (
|
|
51
|
+
const pkgFilePath = path.join(rootPath, import_constants.WORKSPACE_FILE.YARN);
|
|
52
|
+
if (import_utils.fs.existsSync(pkgFilePath)) {
|
|
53
|
+
var _pkg_workspaces;
|
|
54
|
+
const pkg = import_node_core_library.JsonFile.load(pkgFilePath);
|
|
55
|
+
if (pkg === null || pkg === void 0 ? void 0 : (_pkg_workspaces = pkg.workspaces) === null || _pkg_workspaces === void 0 ? void 0 : _pkg_workspaces.packages) {
|
|
34
56
|
const originalPkg = pkg;
|
|
35
57
|
pkg.workspaces.packages = projectsInWorkspaces;
|
|
36
|
-
|
|
58
|
+
import_node_core_library.JsonFile.save(pkg, pkgFilePath);
|
|
37
59
|
return () => {
|
|
38
|
-
|
|
60
|
+
import_node_core_library.JsonFile.save(originalPkg, pkgFilePath);
|
|
39
61
|
};
|
|
40
62
|
}
|
|
41
63
|
}
|
|
@@ -52,8 +74,8 @@ const runInstallTask = async (projectNames, operator, config) => {
|
|
|
52
74
|
const allDeps = operator.getNodeAllDependencyData(projectName);
|
|
53
75
|
projectsInWorkspaces = [
|
|
54
76
|
...projectsInWorkspaces,
|
|
55
|
-
|
|
56
|
-
...allDeps.map((p) =>
|
|
77
|
+
path.relative(rootPath, operator.getNodeData(projectName).extra.path),
|
|
78
|
+
...allDeps.map((p) => path.relative(rootPath, p.extra.path))
|
|
57
79
|
];
|
|
58
80
|
}
|
|
59
81
|
const noDupProjectList = Array.from(new Set(projectsInWorkspaces));
|
|
@@ -61,7 +83,7 @@ const runInstallTask = async (projectNames, operator, config) => {
|
|
|
61
83
|
rootPath,
|
|
62
84
|
projectsInWorkspaces: noDupProjectList
|
|
63
85
|
});
|
|
64
|
-
await (0,
|
|
86
|
+
await (0, import_install.installByPackageManager)(packageManager, {
|
|
65
87
|
rootPath,
|
|
66
88
|
removeLock: true
|
|
67
89
|
});
|
|
@@ -69,3 +91,7 @@ const runInstallTask = async (projectNames, operator, config) => {
|
|
|
69
91
|
restorWorkspace();
|
|
70
92
|
}
|
|
71
93
|
};
|
|
94
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
95
|
+
0 && (module.exports = {
|
|
96
|
+
runInstallTask
|
|
97
|
+
});
|
package/dist/cjs/hooks/index.js
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
15
|
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var hooks_exports = {};
|
|
20
|
+
__export(hooks_exports, {
|
|
21
|
+
hooks: () => hooks
|
|
10
22
|
});
|
|
11
|
-
|
|
12
|
-
|
|
23
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
24
|
+
var import_plugin = require("@modern-js/plugin");
|
|
25
|
+
const afterMonorepoDeploy = (0, import_plugin.createAsyncWorkflow)();
|
|
13
26
|
const hooks = {
|
|
14
27
|
afterMonorepoDeploy
|
|
15
28
|
};
|
|
29
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
+
0 && (module.exports = {
|
|
31
|
+
hooks
|
|
32
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,55 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
6
7
|
for (var name in all)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return monorepoTools;
|
|
15
|
-
},
|
|
16
|
-
default: function() {
|
|
17
|
-
return _default;
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
var src_exports = {};
|
|
21
|
+
__export(src_exports, {
|
|
22
|
+
default: () => src_default,
|
|
23
|
+
monorepoTools: () => monorepoTools
|
|
19
24
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const upgradeModel =
|
|
25
|
+
module.exports = __toCommonJS(src_exports);
|
|
26
|
+
var import_plugin_changeset = require("@modern-js/plugin-changeset");
|
|
27
|
+
var import_plugin_lint = require("@modern-js/plugin-lint");
|
|
28
|
+
var import_utils = require("@modern-js/utils");
|
|
29
|
+
var import_language_detector = require("@modern-js/plugin-i18n/language-detector");
|
|
30
|
+
var import_locale = require("./locale");
|
|
31
|
+
var import_cli = require("./cli");
|
|
32
|
+
var import_hooks = require("./hooks");
|
|
33
|
+
__reExport(src_exports, require("./projects/getProjects"), module.exports);
|
|
34
|
+
const upgradeModel = import_utils.Import.lazy("@modern-js/upgrade", require);
|
|
30
35
|
const monorepoTools = () => ({
|
|
31
36
|
name: "@modern-js/monorepo-tools",
|
|
32
37
|
usePlugins: [
|
|
33
|
-
(0,
|
|
34
|
-
(0,
|
|
38
|
+
(0, import_plugin_changeset.changesetPlugin)(),
|
|
39
|
+
(0, import_plugin_lint.lintPlugin)()
|
|
35
40
|
],
|
|
36
|
-
registerHook:
|
|
41
|
+
registerHook: import_hooks.hooks,
|
|
37
42
|
setup: (api) => {
|
|
38
43
|
const appContext = api.useAppContext();
|
|
39
44
|
api.setAppContext({
|
|
40
45
|
...appContext,
|
|
41
46
|
toolsType: "monorepo-tools"
|
|
42
47
|
});
|
|
43
|
-
const locale = (0,
|
|
44
|
-
|
|
48
|
+
const locale = (0, import_language_detector.getLocaleLanguage)();
|
|
49
|
+
import_locale.i18n.changeLanguage({
|
|
45
50
|
locale
|
|
46
51
|
});
|
|
47
52
|
return {
|
|
48
53
|
commands({ program }) {
|
|
49
|
-
(0,
|
|
50
|
-
(0,
|
|
51
|
-
(0,
|
|
52
|
-
upgradeModel.defineCommand(program.command("upgrade").option("-c --config <config>",
|
|
54
|
+
(0, import_cli.clearCli)(program, api);
|
|
55
|
+
(0, import_cli.deployCli)(program, api);
|
|
56
|
+
(0, import_cli.newCli)(program, locale);
|
|
57
|
+
upgradeModel.defineCommand(program.command("upgrade").option("-c --config <config>", import_locale.i18n.t(import_locale.localeKeys.command.shared.config)).option("--no-need-install", import_locale.i18n.t(import_locale.localeKeys.command.shared.noNeedInstall)));
|
|
53
58
|
}
|
|
54
59
|
};
|
|
55
60
|
},
|
|
@@ -57,4 +62,9 @@ const monorepoTools = () => ({
|
|
|
57
62
|
"@modern-js/plugin-changeset"
|
|
58
63
|
]
|
|
59
64
|
});
|
|
60
|
-
|
|
65
|
+
var src_default = monorepoTools;
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
monorepoTools,
|
|
69
|
+
...require("./projects/getProjects")
|
|
70
|
+
});
|
package/dist/cjs/locale/en.js
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
15
|
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var en_exports = {};
|
|
20
|
+
__export(en_exports, {
|
|
21
|
+
EN_LOCALE: () => EN_LOCALE
|
|
10
22
|
});
|
|
23
|
+
module.exports = __toCommonJS(en_exports);
|
|
11
24
|
const EN_LOCALE = {
|
|
12
25
|
command: {
|
|
13
26
|
shared: {
|
|
@@ -25,3 +38,7 @@ const EN_LOCALE = {
|
|
|
25
38
|
}
|
|
26
39
|
}
|
|
27
40
|
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
EN_LOCALE
|
|
44
|
+
});
|
package/dist/cjs/locale/index.js
CHANGED
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
6
7
|
for (var name in all)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return i18n;
|
|
15
|
-
},
|
|
16
|
-
localeKeys: function() {
|
|
17
|
-
return localeKeys;
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
15
|
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var locale_exports = {};
|
|
20
|
+
__export(locale_exports, {
|
|
21
|
+
i18n: () => i18n,
|
|
22
|
+
localeKeys: () => localeKeys
|
|
19
23
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
module.exports = __toCommonJS(locale_exports);
|
|
25
|
+
var import_plugin_i18n = require("@modern-js/plugin-i18n");
|
|
26
|
+
var import_zh = require("./zh");
|
|
27
|
+
var import_en = require("./en");
|
|
28
|
+
const i18n = new import_plugin_i18n.I18n();
|
|
24
29
|
const localeKeys = i18n.init("en", {
|
|
25
|
-
zh:
|
|
26
|
-
en:
|
|
30
|
+
zh: import_zh.ZH_LOCALE,
|
|
31
|
+
en: import_en.EN_LOCALE
|
|
32
|
+
});
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
i18n,
|
|
36
|
+
localeKeys
|
|
27
37
|
});
|
package/dist/cjs/locale/zh.js
CHANGED
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
15
|
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var zh_exports = {};
|
|
20
|
+
__export(zh_exports, {
|
|
21
|
+
ZH_LOCALE: () => ZH_LOCALE
|
|
10
22
|
});
|
|
23
|
+
module.exports = __toCommonJS(zh_exports);
|
|
11
24
|
const ZH_LOCALE = {
|
|
12
25
|
command: {
|
|
13
26
|
shared: {
|
|
@@ -25,3 +38,7 @@ const ZH_LOCALE = {
|
|
|
25
38
|
}
|
|
26
39
|
}
|
|
27
40
|
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
ZH_LOCALE
|
|
44
|
+
});
|
package/dist/cjs/log/error.js
CHANGED
|
@@ -1,13 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
15
|
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var error_exports = {};
|
|
20
|
+
__export(error_exports, {
|
|
21
|
+
errorLog: () => errorLog
|
|
10
22
|
});
|
|
23
|
+
module.exports = __toCommonJS(error_exports);
|
|
11
24
|
const errorLog = (...rest) => {
|
|
12
25
|
throw new Error(rest.join("\n"));
|
|
13
26
|
};
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
errorLog
|
|
30
|
+
});
|