@modern-js/monorepo-tools 2.15.0 → 2.17.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/CHANGELOG.md +38 -0
- package/dist/cjs/cli/build.js +10 -31
- package/dist/cjs/cli/buildWatch.js +11 -31
- package/dist/cjs/cli/clear.js +11 -31
- package/dist/cjs/cli/deploy.js +14 -36
- package/dist/cjs/cli/index.js +23 -22
- package/dist/cjs/cli/install.js +11 -31
- package/dist/cjs/cli/new.js +17 -37
- package/dist/cjs/commands/build.js +21 -46
- package/dist/cjs/commands/buildWatch.js +19 -36
- package/dist/cjs/commands/clear.js +17 -34
- package/dist/cjs/commands/deploy.js +25 -41
- package/dist/cjs/commands/index.js +22 -21
- package/dist/cjs/commands/install.js +19 -36
- package/dist/cjs/constants.js +13 -26
- package/dist/cjs/dag/create.js +16 -28
- package/dist/cjs/dag/edgeManager.js +24 -28
- package/dist/cjs/dag/index.js +11 -29
- package/dist/cjs/dag/operator.js +106 -123
- package/dist/cjs/dag/task.js +52 -63
- package/dist/cjs/dag/utils.js +52 -49
- package/dist/cjs/features/build/index.js +52 -68
- package/dist/cjs/features/clear/index.js +66 -47
- package/dist/cjs/features/deploy/index.js +126 -96
- package/dist/cjs/features/dev/cmds.js +10 -25
- package/dist/cjs/features/dev/createTask.js +93 -56
- package/dist/cjs/features/dev/index.js +43 -71
- package/dist/cjs/features/dev/watchProjectsState.js +89 -64
- package/dist/cjs/features/install/index.js +74 -63
- package/dist/cjs/hooks/index.js +9 -27
- package/dist/cjs/index.js +36 -53
- package/dist/cjs/locale/en.js +7 -25
- package/dist/cjs/locale/index.js +18 -28
- package/dist/cjs/locale/zh.js +7 -25
- package/dist/cjs/log/error.js +7 -25
- package/dist/cjs/log/multiTasksLog.js +42 -43
- package/dist/cjs/log/time.js +19 -29
- package/dist/cjs/log/utils.js +7 -25
- package/dist/cjs/package/index.js +28 -30
- package/dist/cjs/parse-config/index.js +61 -49
- package/dist/cjs/parse-config/monorepo.js +81 -67
- package/dist/cjs/projects/checkProjectChange.js +95 -73
- package/dist/cjs/projects/clearMemoryFiles.js +52 -44
- package/dist/cjs/projects/getProjects.js +38 -65
- package/dist/cjs/projects/getProjectsByPackagesConfig.js +93 -71
- package/dist/cjs/projects/getProjectsByWorkspaceFile.js +89 -85
- package/dist/cjs/type.js +4 -15
- package/dist/cjs/utils/install.js +69 -44
- package/dist/cjs/utils/types.js +4 -15
- package/dist/esm/cli/build.js +2 -8
- package/dist/esm/cli/buildWatch.js +4 -9
- package/dist/esm/cli/clear.js +4 -9
- package/dist/esm/cli/deploy.js +7 -14
- package/dist/esm/cli/install.js +4 -9
- package/dist/esm/cli/new.js +9 -14
- package/dist/esm/commands/build.js +7 -17
- package/dist/esm/commands/buildWatch.js +6 -8
- package/dist/esm/commands/clear.js +6 -8
- package/dist/esm/commands/deploy.js +10 -11
- package/dist/esm/commands/install.js +6 -8
- package/dist/esm/constants.js +2 -6
- package/dist/esm/dag/create.js +10 -7
- package/dist/esm/dag/edgeManager.js +17 -6
- package/dist/esm/dag/index.js +1 -4
- package/dist/esm/dag/operator.js +77 -74
- package/dist/esm/dag/task.js +39 -30
- package/dist/esm/dag/utils.js +39 -27
- package/dist/esm/features/build/index.js +22 -27
- package/dist/esm/features/clear/index.js +4 -6
- package/dist/esm/features/deploy/index.js +55 -50
- package/dist/esm/features/dev/cmds.js +4 -4
- package/dist/esm/features/dev/createTask.js +31 -15
- package/dist/esm/features/dev/index.js +19 -27
- package/dist/esm/features/dev/watchProjectsState.js +41 -31
- package/dist/esm/features/install/index.js +11 -15
- package/dist/esm/hooks/index.js +1 -4
- package/dist/esm/index.js +12 -11
- package/dist/esm/locale/en.js +1 -4
- package/dist/esm/locale/index.js +5 -5
- package/dist/esm/locale/zh.js +1 -4
- package/dist/esm/log/error.js +1 -4
- package/dist/esm/log/multiTasksLog.js +32 -18
- package/dist/esm/log/time.js +7 -8
- package/dist/esm/log/utils.js +1 -4
- package/dist/esm/package/index.js +21 -8
- package/dist/esm/parse-config/index.js +11 -14
- package/dist/esm/parse-config/monorepo.js +20 -27
- package/dist/esm/projects/checkProjectChange.js +19 -23
- package/dist/esm/projects/clearMemoryFiles.js +3 -13
- package/dist/esm/projects/getProjects.js +21 -45
- package/dist/esm/projects/getProjectsByPackagesConfig.js +29 -33
- package/dist/esm/projects/getProjectsByWorkspaceFile.js +21 -41
- package/dist/esm/type.js +1 -0
- package/dist/esm/utils/install.js +12 -8
- package/dist/esm/utils/types.js +1 -0
- package/package.json +16 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @modern-js/monorepo-tools
|
|
2
2
|
|
|
3
|
+
## 2.17.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @modern-js/core@2.17.0
|
|
8
|
+
- @modern-js/plugin-changeset@2.17.0
|
|
9
|
+
- @modern-js/plugin-i18n@2.17.0
|
|
10
|
+
- @modern-js/plugin-lint@2.17.0
|
|
11
|
+
- @modern-js/new-action@2.17.0
|
|
12
|
+
- @modern-js/plugin@2.17.0
|
|
13
|
+
- @modern-js/upgrade@2.17.0
|
|
14
|
+
- @modern-js/utils@2.17.0
|
|
15
|
+
|
|
16
|
+
## 2.16.0
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- 4e876ab: chore: package.json include the monorepo-relative directory
|
|
21
|
+
|
|
22
|
+
chore: 在 package.json 中声明 monorepo 的子路径
|
|
23
|
+
|
|
24
|
+
- 355d36e: feat: adjust create tools and new command option order
|
|
25
|
+
|
|
26
|
+
feat: 调整 create 工具及 new 命令 option 操作顺序
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [5954330]
|
|
29
|
+
- Updated dependencies [7596520]
|
|
30
|
+
- Updated dependencies [4e876ab]
|
|
31
|
+
- Updated dependencies [6d5219e]
|
|
32
|
+
- @modern-js/utils@2.16.0
|
|
33
|
+
- @modern-js/plugin@2.16.0
|
|
34
|
+
- @modern-js/plugin-changeset@2.16.0
|
|
35
|
+
- @modern-js/new-action@2.16.0
|
|
36
|
+
- @modern-js/plugin-i18n@2.16.0
|
|
37
|
+
- @modern-js/plugin-lint@2.16.0
|
|
38
|
+
- @modern-js/upgrade@2.16.0
|
|
39
|
+
- @modern-js/core@2.16.0
|
|
40
|
+
|
|
3
41
|
## 2.15.0
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
package/dist/cjs/cli/build.js
CHANGED
|
@@ -1,35 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var build_exports = {};
|
|
19
|
-
__export(build_exports, {
|
|
20
|
-
buildCli: () => buildCli
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
Object.defineProperty(exports, "buildCli", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => buildCli
|
|
8
|
+
});
|
|
9
|
+
const _commands = require("../commands");
|
|
24
10
|
const buildCli = (program, api) => {
|
|
25
|
-
program.command("build [project]").usage("[options]").option("--no-self", "build without target project").option("-t, --dept", "build target project with project’s dependent").option("--no-deps", "build target project without project’s dependencies").option("--only-self", "build target project with nothing").option(
|
|
26
|
-
|
|
27
|
-
"build target project with project’s dependencies and dependent"
|
|
28
|
-
).option("--content-hash", "build target project use content hash cache").option("--git-hash", "build target project use git hash cache").description("build target project").action(async (targetProjectName, option) => {
|
|
29
|
-
await (0, import_commands.build)(targetProjectName, option, api);
|
|
11
|
+
program.command("build [project]").usage("[options]").option("--no-self", "build without target project").option("-t, --dept", "build target project with project’s dependent").option("--no-deps", "build target project without project’s dependencies").option("--only-self", "build target project with nothing").option("-a, --all", "build target project with project’s dependencies and dependent").option("--content-hash", "build target project use content hash cache").option("--git-hash", "build target project use git hash cache").description("build target project").action(async (targetProjectName, option) => {
|
|
12
|
+
await (0, _commands.build)(targetProjectName, option, api);
|
|
30
13
|
});
|
|
31
14
|
};
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
buildCli
|
|
35
|
-
});
|
|
@@ -1,34 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var buildWatch_exports = {};
|
|
19
|
-
__export(buildWatch_exports, {
|
|
20
|
-
buildWatchCli: () => buildWatchCli
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
Object.defineProperty(exports, "buildWatchCli", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => buildWatchCli
|
|
8
|
+
});
|
|
9
|
+
const _commands = require("../commands");
|
|
24
10
|
const buildWatchCli = (program, api) => {
|
|
25
|
-
program.command("build-watch [project]").usage("[options]").option("--only-self", "build target project with nothing").option("-i, --init", "init build beforebuild watch ").description("watch target project and target project’s dependencies").action(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
);
|
|
11
|
+
program.command("build-watch [project]").usage("[options]").option("--only-self", "build target project with nothing").option("-i, --init", "init build beforebuild watch ").description("watch target project and target project’s dependencies").action(async (targetProjectName, option) => {
|
|
12
|
+
await (0, _commands.buildWatch)(targetProjectName, option, api);
|
|
13
|
+
});
|
|
30
14
|
};
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
buildWatchCli
|
|
34
|
-
});
|
package/dist/cjs/cli/clear.js
CHANGED
|
@@ -1,34 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var clear_exports = {};
|
|
19
|
-
__export(clear_exports, {
|
|
20
|
-
clearCli: () => clearCli
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
Object.defineProperty(exports, "clearCli", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => clearCli
|
|
8
|
+
});
|
|
9
|
+
const _commands = require("../commands");
|
|
24
10
|
const clearCli = (program, api) => {
|
|
25
|
-
program.command("clear [projects...]").usage("[options]").option("--remove-dirs [dirs...]", "remove dirs, default is node_modules").description("clear project dirs").action(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
);
|
|
11
|
+
program.command("clear [projects...]").usage("[options]").option("--remove-dirs [dirs...]", "remove dirs, default is node_modules").description("clear project dirs").action(async (targetProjectNames, option) => {
|
|
12
|
+
await (0, _commands.clear)(targetProjectNames, option, api);
|
|
13
|
+
});
|
|
30
14
|
};
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
clearCli
|
|
34
|
-
});
|
package/dist/cjs/cli/deploy.js
CHANGED
|
@@ -1,39 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var deploy_exports = {};
|
|
19
|
-
__export(deploy_exports, {
|
|
20
|
-
deployCli: () => deployCli
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
Object.defineProperty(exports, "deployCli", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => deployCli
|
|
8
|
+
});
|
|
9
|
+
const _commands = require("../commands");
|
|
24
10
|
const deployCli = (program, api) => {
|
|
25
|
-
program.command("deploy [project...]").usage("[options]").option(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const ignoreMatchs = ["**/output/**"];
|
|
32
|
-
await (0, import_commands.deploy)(api, deployProjectNames, option, ignoreMatchs);
|
|
33
|
-
}
|
|
34
|
-
);
|
|
11
|
+
program.command("deploy [project...]").usage("[options]").option("-p, --path [path]", "Specify the path of the product output", "output").description("deploy project").action(async (deployProjectNames, option) => {
|
|
12
|
+
const ignoreMatchs = [
|
|
13
|
+
"**/output/**"
|
|
14
|
+
];
|
|
15
|
+
await (0, _commands.deploy)(api, deployProjectNames, option, ignoreMatchs);
|
|
16
|
+
});
|
|
35
17
|
};
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
deployCli
|
|
39
|
-
});
|
package/dist/cjs/cli/index.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
_export_star(require("./new"), exports);
|
|
6
|
+
_export_star(require("./deploy"), exports);
|
|
7
|
+
_export_star(require("./build"), exports);
|
|
8
|
+
_export_star(require("./buildWatch"), exports);
|
|
9
|
+
_export_star(require("./clear"), exports);
|
|
10
|
+
_export_star(require("./install"), exports);
|
|
11
|
+
function _export_star(from, to) {
|
|
12
|
+
Object.keys(from).forEach(function(k) {
|
|
13
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
14
|
+
Object.defineProperty(to, k, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return from[k];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return from;
|
|
23
|
+
}
|
package/dist/cjs/cli/install.js
CHANGED
|
@@ -1,34 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var install_exports = {};
|
|
19
|
-
__export(install_exports, {
|
|
20
|
-
installCli: () => installCli
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
Object.defineProperty(exports, "installCli", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => installCli
|
|
8
|
+
});
|
|
9
|
+
const _commands = require("../commands");
|
|
24
10
|
const installCli = (program, api) => {
|
|
25
|
-
program.command("install [project...]").usage("[options]").description("install deps for some projects").action(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
);
|
|
11
|
+
program.command("install [project...]").usage("[options]").description("install deps for some projects").action(async (installProjectNames, option) => {
|
|
12
|
+
await (0, _commands.install)(installProjectNames, option, api);
|
|
13
|
+
});
|
|
30
14
|
};
|
|
31
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
installCli
|
|
34
|
-
});
|
package/dist/cjs/cli/new.js
CHANGED
|
@@ -1,41 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var new_exports = {};
|
|
19
|
-
__export(new_exports, {
|
|
20
|
-
newCli: () => newCli
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
Object.defineProperty(exports, "newCli", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => newCli
|
|
8
|
+
});
|
|
9
|
+
const _newaction = require("@modern-js/new-action");
|
|
10
|
+
const _locale = require("../locale");
|
|
25
11
|
const newCli = (program, locale) => {
|
|
26
|
-
program.command("new").usage("[options]").description(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
).option("--lang <lang>", import_locale.i18n.t(import_locale.localeKeys.command.new.lang)).option("--dist-tag <tag>", import_locale.i18n.t(import_locale.localeKeys.command.new.distTag)).option("--registry", import_locale.i18n.t(import_locale.localeKeys.command.new.registry)).action(async (options) => {
|
|
35
|
-
await (0, import_new_action.MonorepoNewAction)({ ...options, locale: options.lang || locale });
|
|
12
|
+
program.command("new").usage("[options]").description(_locale.i18n.t(_locale.localeKeys.command.new.describe)).option("--lang <lang>", _locale.i18n.t(_locale.localeKeys.command.new.lang)).option("-c, --config <config>", _locale.i18n.t(_locale.localeKeys.command.new.config)).option("-p, --plugin <plugin>", _locale.i18n.t(_locale.localeKeys.command.new.plugin), (val, memo) => {
|
|
13
|
+
memo.push(val);
|
|
14
|
+
return memo;
|
|
15
|
+
}, []).option("-d, --debug", _locale.i18n.t(_locale.localeKeys.command.new.debug), false).option("--dist-tag <tag>", _locale.i18n.t(_locale.localeKeys.command.new.distTag)).option("--registry", _locale.i18n.t(_locale.localeKeys.command.new.registry)).action(async (options) => {
|
|
16
|
+
await (0, _newaction.MonorepoNewAction)({
|
|
17
|
+
...options,
|
|
18
|
+
locale: options.lang || locale
|
|
19
|
+
});
|
|
36
20
|
});
|
|
37
21
|
};
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
newCli
|
|
41
|
-
});
|
|
@@ -1,47 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var build_exports = {};
|
|
19
|
-
__export(build_exports, {
|
|
20
|
-
build: () => build
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
Object.defineProperty(exports, "build", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => build
|
|
8
|
+
});
|
|
9
|
+
const _monorepo = require("../parse-config/monorepo");
|
|
10
|
+
const _build = require("../features/build");
|
|
11
|
+
const _getProjects = require("../projects/getProjects");
|
|
12
|
+
const _dag = require("../dag");
|
|
27
13
|
const build = async (targetProjectName, option, api) => {
|
|
28
14
|
const { appDirectory } = api.useAppContext();
|
|
29
|
-
const {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
gitHash = false
|
|
37
|
-
} = option;
|
|
38
|
-
const projects = await (0, import_getProjects.getProjects)(
|
|
39
|
-
{ packagesMatchs: { enableAutoFinder: true } },
|
|
40
|
-
appDirectory
|
|
41
|
-
);
|
|
42
|
-
const operator = (0, import_dag.initDAG)(projects);
|
|
15
|
+
const { self = true, dept = false, deps = true, onlySelf = false, all = false, contentHash = false, gitHash = false } = option;
|
|
16
|
+
const projects = await (0, _getProjects.getProjects)({
|
|
17
|
+
packagesMatchs: {
|
|
18
|
+
enableAutoFinder: true
|
|
19
|
+
}
|
|
20
|
+
}, appDirectory);
|
|
21
|
+
const operator = (0, _dag.initDAG)(projects);
|
|
43
22
|
operator.checkCircle();
|
|
44
|
-
const { rootPath, packageManager } = (0,
|
|
23
|
+
const { rootPath, packageManager } = (0, _monorepo.getMonorepoBaseData)(appDirectory);
|
|
45
24
|
const overrideConfig = {};
|
|
46
25
|
if (all) {
|
|
47
26
|
overrideConfig.disableWithDeps = false;
|
|
@@ -49,7 +28,7 @@ const build = async (targetProjectName, option, api) => {
|
|
|
49
28
|
overrideConfig.withDept = true;
|
|
50
29
|
}
|
|
51
30
|
if (targetProjectName) {
|
|
52
|
-
(0,
|
|
31
|
+
(0, _build.runBuildTask)(targetProjectName, operator, {
|
|
53
32
|
rootPath,
|
|
54
33
|
packageManager,
|
|
55
34
|
withSelf: self,
|
|
@@ -64,7 +43,7 @@ const build = async (targetProjectName, option, api) => {
|
|
|
64
43
|
} else {
|
|
65
44
|
const currentDir = process.cwd();
|
|
66
45
|
if (currentDir === appDirectory) {
|
|
67
|
-
await (0,
|
|
46
|
+
await (0, _build.runAllBuildTask)(operator, {
|
|
68
47
|
rootPath: currentDir,
|
|
69
48
|
packageManager,
|
|
70
49
|
disableContentHash: !contentHash,
|
|
@@ -73,7 +52,3 @@ const build = async (targetProjectName, option, api) => {
|
|
|
73
52
|
}
|
|
74
53
|
}
|
|
75
54
|
};
|
|
76
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
77
|
-
0 && (module.exports = {
|
|
78
|
-
build
|
|
79
|
-
});
|
|
@@ -1,47 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var buildWatch_exports = {};
|
|
19
|
-
__export(buildWatch_exports, {
|
|
20
|
-
buildWatch: () => buildWatch
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
Object.defineProperty(exports, "buildWatch", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => buildWatch
|
|
8
|
+
});
|
|
9
|
+
const _monorepo = require("../parse-config/monorepo");
|
|
10
|
+
const _dev = require("../features/dev");
|
|
11
|
+
const _getProjects = require("../projects/getProjects");
|
|
12
|
+
const _dag = require("../dag");
|
|
27
13
|
const buildWatch = async (targetProjectName, option, api) => {
|
|
28
14
|
const { appDirectory } = api.useAppContext();
|
|
29
15
|
const { onlySelf = false, init = false } = option;
|
|
30
|
-
const projects = await (0,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
16
|
+
const projects = await (0, _getProjects.getProjects)({
|
|
17
|
+
packagesMatchs: {
|
|
18
|
+
enableAutoFinder: true
|
|
19
|
+
}
|
|
20
|
+
}, appDirectory);
|
|
21
|
+
const operator = (0, _dag.initDAG)(projects);
|
|
35
22
|
operator.checkCircle();
|
|
36
|
-
const { rootPath, packageManager } = (0,
|
|
37
|
-
await (0,
|
|
23
|
+
const { rootPath, packageManager } = (0, _monorepo.getMonorepoBaseData)(process.cwd());
|
|
24
|
+
await (0, _dev.runBuildWatchTask)(targetProjectName, operator, {
|
|
38
25
|
rootPath,
|
|
39
26
|
packageManager,
|
|
40
27
|
onlySelf,
|
|
41
28
|
needInit: init
|
|
42
29
|
});
|
|
43
30
|
};
|
|
44
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
-
0 && (module.exports = {
|
|
46
|
-
buildWatch
|
|
47
|
-
});
|
|
@@ -1,42 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
-
var clear_exports = {};
|
|
19
|
-
__export(clear_exports, {
|
|
20
|
-
clear: () => clear
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
21
4
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
5
|
+
Object.defineProperty(exports, "clear", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => clear
|
|
8
|
+
});
|
|
9
|
+
const _getProjects = require("../projects/getProjects");
|
|
10
|
+
const _monorepo = require("../parse-config/monorepo");
|
|
11
|
+
const _clear = require("../features/clear");
|
|
26
12
|
const clear = async (projectNames, option, api) => {
|
|
27
13
|
const { removeDirs } = option;
|
|
28
14
|
const { appDirectory } = api.useAppContext();
|
|
29
|
-
const projects = await (0,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
(0,
|
|
15
|
+
const projects = await (0, _getProjects.getProjects)({
|
|
16
|
+
packagesMatchs: {
|
|
17
|
+
enableAutoFinder: true
|
|
18
|
+
}
|
|
19
|
+
}, appDirectory);
|
|
20
|
+
const { rootPath } = (0, _monorepo.getMonorepoBaseData)(appDirectory);
|
|
21
|
+
(0, _clear.runClearTask)(projectNames, projects, {
|
|
35
22
|
rootPath,
|
|
36
23
|
removeDirs
|
|
37
24
|
});
|
|
38
25
|
};
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
clear
|
|
42
|
-
});
|