@modern-js/monorepo-tools 2.0.0-beta.3 → 2.0.0-beta.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/CHANGELOG.md +103 -0
- package/bin/modern.js +3 -1
- package/dist/js/modern/cli/build-watch.js +30 -5
- package/dist/js/modern/cli/build.js +31 -5
- package/dist/js/modern/cli/clear.js +30 -5
- package/dist/js/modern/cli/deploy.js +35 -7
- package/dist/js/modern/cli/index.js +1 -1
- package/dist/js/modern/cli/install.js +30 -5
- package/dist/js/modern/cli/new.js +56 -14
- package/dist/js/modern/commands/build-watch.js +32 -18
- package/dist/js/modern/commands/build.js +49 -23
- package/dist/js/modern/commands/clear.js +31 -15
- package/dist/js/modern/commands/deploy.js +38 -24
- package/dist/js/modern/commands/index.js +1 -1
- package/dist/js/modern/commands/install.js +32 -17
- package/dist/js/modern/constants.js +13 -9
- package/dist/js/modern/dag/create.js +27 -23
- package/dist/js/modern/dag/edge-manager.js +5 -4
- package/dist/js/modern/dag/index.js +6 -5
- package/dist/js/modern/dag/operator.js +174 -156
- package/dist/js/modern/dag/task.js +64 -39
- package/dist/js/modern/dag/utils.js +32 -38
- package/dist/js/modern/features/build/index.js +47 -28
- package/dist/js/modern/features/clear/index.js +16 -15
- package/dist/js/modern/features/deploy/index.js +107 -82
- package/dist/js/modern/features/dev/cmds.js +4 -3
- package/dist/js/modern/features/dev/create-task.js +43 -34
- package/dist/js/modern/features/dev/index.js +60 -41
- package/dist/js/modern/features/dev/watch-projects-state.js +47 -24
- package/dist/js/modern/features/install/index.js +43 -22
- package/dist/js/modern/hooks/index.js +6 -3
- package/dist/js/modern/index.js +18 -16
- package/dist/js/modern/locale/en.js +10 -7
- package/dist/js/modern/locale/index.js +6 -6
- package/dist/js/modern/locale/zh.js +11 -8
- package/dist/js/modern/log/error.js +6 -3
- package/dist/js/modern/log/multi-tasks-log.js +25 -34
- package/dist/js/modern/log/time.js +26 -11
- package/dist/js/modern/log/utils.js +9 -5
- package/dist/js/modern/package/index.js +5 -6
- package/dist/js/modern/parse-config/index.js +49 -22
- package/dist/js/modern/parse-config/monorepo.js +41 -26
- package/dist/js/modern/projects/check-project-change.js +59 -30
- package/dist/js/modern/projects/clear-memory-files.js +17 -7
- package/dist/js/modern/projects/get-projects-by-packages-config.js +89 -52
- package/dist/js/modern/projects/get-projects-by-workspace-file.js +68 -32
- package/dist/js/modern/projects/get-projects.js +96 -53
- package/dist/js/modern/type.js +0 -1
- package/dist/js/modern/utils/install.js +36 -19
- package/dist/js/modern/utils/language.js +6 -3
- package/dist/js/node/cli/build-watch.js +51 -10
- package/dist/js/node/cli/build.js +52 -10
- package/dist/js/node/cli/clear.js +51 -10
- package/dist/js/node/cli/deploy.js +56 -12
- package/dist/js/node/cli/index.js +22 -71
- package/dist/js/node/cli/install.js +51 -10
- package/dist/js/node/cli/new.js +75 -19
- package/dist/js/node/commands/build-watch.js +59 -29
- package/dist/js/node/commands/build.js +74 -32
- package/dist/js/node/commands/clear.js +57 -25
- package/dist/js/node/commands/deploy.js +65 -35
- package/dist/js/node/commands/index.js +21 -60
- package/dist/js/node/commands/install.js +59 -28
- package/dist/js/node/constants.js +33 -13
- package/dist/js/node/dag/create.js +46 -28
- package/dist/js/node/dag/edge-manager.js +25 -8
- package/dist/js/node/dag/index.js +30 -13
- package/dist/js/node/dag/operator.js +211 -174
- package/dist/js/node/dag/task.js +92 -46
- package/dist/js/node/dag/utils.js +58 -47
- package/dist/js/node/features/build/index.js +84 -47
- package/dist/js/node/features/clear/index.js +49 -28
- package/dist/js/node/features/deploy/index.js +139 -104
- package/dist/js/node/features/dev/cmds.js +26 -9
- package/dist/js/node/features/dev/create-task.js +80 -51
- package/dist/js/node/features/dev/index.js +98 -58
- package/dist/js/node/features/dev/watch-projects-state.js +71 -30
- package/dist/js/node/features/install/index.js +82 -41
- package/dist/js/node/hooks/index.js +27 -8
- package/dist/js/node/index.js +53 -32
- package/dist/js/node/locale/en.js +30 -11
- package/dist/js/node/locale/index.js +31 -14
- package/dist/js/node/locale/zh.js +31 -12
- package/dist/js/node/log/error.js +26 -7
- package/dist/js/node/log/multi-tasks-log.js +48 -41
- package/dist/js/node/log/time.js +47 -18
- package/dist/js/node/log/utils.js +30 -10
- package/dist/js/node/package/index.js +25 -10
- package/dist/js/node/parse-config/index.js +76 -31
- package/dist/js/node/parse-config/monorepo.js +79 -44
- package/dist/js/node/projects/check-project-change.js +104 -56
- package/dist/js/node/projects/clear-memory-files.js +42 -15
- package/dist/js/node/projects/get-projects-by-packages-config.js +119 -65
- package/dist/js/node/projects/get-projects-by-workspace-file.js +108 -55
- package/dist/js/node/projects/get-projects.js +112 -61
- package/dist/js/node/type.js +15 -5
- package/dist/js/node/utils/install.js +68 -31
- package/dist/js/node/utils/language.js +28 -8
- package/dist/js/node/utils/types.js +15 -0
- package/dist/types/dag/operator.d.ts +3 -0
- package/dist/types/dag/utils.d.ts +1 -0
- package/dist/types/features/dev/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/projects/get-projects.d.ts +1 -0
- package/package.json +12 -19
|
@@ -1,24 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __async = (__this, __arguments, generator) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
step(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var rejected = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.throw(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
4
37
|
import { errorLog } from "../log/error";
|
|
5
38
|
import { getMonorepoBaseData } from "../parse-config/monorepo";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
39
|
+
import {
|
|
40
|
+
getProjectsByPackageConfig,
|
|
41
|
+
syncGetProjectsByPackageConfig
|
|
42
|
+
} from "./get-projects-by-packages-config";
|
|
43
|
+
import {
|
|
44
|
+
getProjectsByWorkspaceFile,
|
|
45
|
+
syncGetProjectsByWorkspaceFile
|
|
46
|
+
} from "./get-projects-by-workspace-file";
|
|
47
|
+
var FindProjectsMode = /* @__PURE__ */ ((FindProjectsMode2) => {
|
|
48
|
+
FindProjectsMode2[FindProjectsMode2["Rough"] = 0] = "Rough";
|
|
49
|
+
FindProjectsMode2[FindProjectsMode2["Precise"] = 1] = "Precise";
|
|
50
|
+
return FindProjectsMode2;
|
|
51
|
+
})(FindProjectsMode || {});
|
|
13
52
|
const getProjectsByProjectsConfig = (rootPath, configs = []) => {
|
|
14
53
|
const subProjects = [];
|
|
15
54
|
for (const config of configs) {
|
|
16
55
|
subProjects.push({
|
|
17
56
|
name: config.name,
|
|
18
|
-
extra: {
|
|
19
|
-
path: config.path
|
|
20
|
-
},
|
|
21
|
-
// dagNodeEdge: 0,
|
|
57
|
+
extra: { path: config.path },
|
|
22
58
|
dependencyEdge: 0,
|
|
23
59
|
dependentEdge: 0,
|
|
24
60
|
checkedCircle: false,
|
|
@@ -27,23 +63,24 @@ const getProjectsByProjectsConfig = (rootPath, configs = []) => {
|
|
|
27
63
|
}
|
|
28
64
|
return subProjects;
|
|
29
65
|
};
|
|
30
|
-
const getProjectsByPackagesMatch =
|
|
66
|
+
const getProjectsByPackagesMatch = (rootPath, match, ignore) => __async(void 0, null, function* () {
|
|
31
67
|
let projects = [];
|
|
32
68
|
if (Array.isArray(match)) {
|
|
33
|
-
|
|
34
|
-
projects = await getProjectsByPackageConfig(rootPath, match, ignore);
|
|
69
|
+
projects = yield getProjectsByPackageConfig(rootPath, match, ignore);
|
|
35
70
|
} else {
|
|
36
|
-
|
|
37
|
-
|
|
71
|
+
projects = yield getProjectsByWorkspaceFile(
|
|
72
|
+
rootPath,
|
|
73
|
+
match,
|
|
74
|
+
ignore
|
|
75
|
+
);
|
|
38
76
|
}
|
|
39
77
|
const subProjects = [];
|
|
40
78
|
for (const project of projects) {
|
|
41
79
|
subProjects.push({
|
|
42
80
|
name: project.name,
|
|
43
|
-
extra:
|
|
81
|
+
extra: __spreadValues({
|
|
44
82
|
path: project.path
|
|
45
83
|
}, project.json),
|
|
46
|
-
// dagNodeEdge: 0,
|
|
47
84
|
dependencyEdge: 0,
|
|
48
85
|
dependentEdge: 0,
|
|
49
86
|
checkedCircle: false,
|
|
@@ -51,25 +88,25 @@ const getProjectsByPackagesMatch = async (rootPath, match, ignore) => {
|
|
|
51
88
|
});
|
|
52
89
|
}
|
|
53
90
|
return subProjects;
|
|
54
|
-
};
|
|
91
|
+
});
|
|
55
92
|
const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
|
|
56
93
|
let projects = [];
|
|
57
|
-
// TODO: code start
|
|
58
94
|
if (Array.isArray(match)) {
|
|
59
|
-
// like lerna`s packages config
|
|
60
95
|
projects = syncGetProjectsByPackageConfig(rootPath, match, ignore);
|
|
61
96
|
} else {
|
|
62
|
-
|
|
63
|
-
|
|
97
|
+
projects = syncGetProjectsByWorkspaceFile(
|
|
98
|
+
rootPath,
|
|
99
|
+
match,
|
|
100
|
+
ignore
|
|
101
|
+
);
|
|
64
102
|
}
|
|
65
103
|
const subProjects = [];
|
|
66
104
|
for (const project of projects) {
|
|
67
105
|
subProjects.push({
|
|
68
106
|
name: project.name,
|
|
69
|
-
extra:
|
|
107
|
+
extra: __spreadValues({
|
|
70
108
|
path: project.path
|
|
71
109
|
}, project.json),
|
|
72
|
-
// dagNodeEdge: 0,
|
|
73
110
|
dependencyEdge: 0,
|
|
74
111
|
dependentEdge: 0,
|
|
75
112
|
checkedCircle: false,
|
|
@@ -78,46 +115,52 @@ const syncGetProjectsByPackagesMatch = (rootPath, match, ignore) => {
|
|
|
78
115
|
}
|
|
79
116
|
return subProjects;
|
|
80
117
|
};
|
|
81
|
-
const checkFindProjectsMode = (config
|
|
82
|
-
// eslint-disable-next-line consistent-return
|
|
83
|
-
) => {
|
|
118
|
+
const checkFindProjectsMode = (config) => {
|
|
84
119
|
if (config.packagesMatchs && Array.isArray(config.packagesMatchs)) {
|
|
85
|
-
return
|
|
120
|
+
return 0 /* Rough */;
|
|
86
121
|
}
|
|
87
|
-
if (config.packagesMatchs && typeof config.packagesMatchs ===
|
|
88
|
-
return
|
|
122
|
+
if (config.packagesMatchs && typeof config.packagesMatchs === "object" && (config.packagesMatchs.workspaceFile || config.packagesMatchs.enableAutoFinder)) {
|
|
123
|
+
return 0 /* Rough */;
|
|
89
124
|
}
|
|
90
125
|
if (config.projectsConfig && Array.isArray(config.projectsConfig)) {
|
|
91
|
-
return
|
|
126
|
+
return 1 /* Precise */;
|
|
92
127
|
}
|
|
93
128
|
if (config.projectsConfig && config.packagesMatchs) {
|
|
94
|
-
errorLog(
|
|
129
|
+
errorLog("There can not be both `packagesMatchs` and `projectsConfig`");
|
|
95
130
|
}
|
|
96
|
-
errorLog(
|
|
131
|
+
errorLog("No `packagesMatchs` and `projectsConfig` configurations found");
|
|
97
132
|
};
|
|
98
|
-
|
|
99
|
-
const {
|
|
100
|
-
rootPath
|
|
101
|
-
} = getMonorepoBaseData(currentDir);
|
|
133
|
+
const getProjects = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (config, currentDir = process.cwd()) {
|
|
134
|
+
const { rootPath } = getMonorepoBaseData(currentDir);
|
|
102
135
|
const mode = checkFindProjectsMode(config);
|
|
103
136
|
let projects = [];
|
|
104
|
-
if (mode ===
|
|
105
|
-
projects =
|
|
106
|
-
|
|
137
|
+
if (mode === 0 /* Rough */) {
|
|
138
|
+
projects = yield getProjectsByPackagesMatch(
|
|
139
|
+
rootPath,
|
|
140
|
+
config.packagesMatchs,
|
|
141
|
+
config.packagesIgnoreMatchs || []
|
|
142
|
+
);
|
|
143
|
+
} else if (mode === 1 /* Precise */) {
|
|
107
144
|
projects = getProjectsByProjectsConfig(rootPath, config.projectsConfig);
|
|
108
145
|
}
|
|
109
146
|
return projects;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const {
|
|
113
|
-
rootPath
|
|
114
|
-
} = getMonorepoBaseData(currentDir);
|
|
147
|
+
});
|
|
148
|
+
const syncGetProjects = (config, currentDir = process.cwd()) => {
|
|
149
|
+
const { rootPath } = getMonorepoBaseData(currentDir);
|
|
115
150
|
const mode = checkFindProjectsMode(config);
|
|
116
151
|
let projects = [];
|
|
117
|
-
if (mode ===
|
|
118
|
-
projects = syncGetProjectsByPackagesMatch(
|
|
119
|
-
|
|
152
|
+
if (mode === 0 /* Rough */) {
|
|
153
|
+
projects = syncGetProjectsByPackagesMatch(
|
|
154
|
+
rootPath,
|
|
155
|
+
config.packagesMatchs,
|
|
156
|
+
config.packagesIgnoreMatchs || []
|
|
157
|
+
);
|
|
158
|
+
} else if (mode === 1 /* Precise */) {
|
|
120
159
|
projects = getProjectsByProjectsConfig(rootPath, config.projectsConfig);
|
|
121
160
|
}
|
|
122
161
|
return projects;
|
|
123
|
-
};
|
|
162
|
+
};
|
|
163
|
+
export {
|
|
164
|
+
getProjects,
|
|
165
|
+
syncGetProjects
|
|
166
|
+
};
|
package/dist/js/modern/type.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,30 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import * as path from "path";
|
|
22
|
+
import { fs, execa } from "@modern-js/utils";
|
|
3
23
|
import { LOCK_FILE } from "../constants";
|
|
4
|
-
|
|
5
|
-
if (packageManager ===
|
|
24
|
+
const removeLockFile = (rootPath, packageManager) => {
|
|
25
|
+
if (packageManager === "pnpm") {
|
|
6
26
|
fs.removeSync(path.join(rootPath, LOCK_FILE.PNPM));
|
|
7
|
-
} else if (packageManager ===
|
|
27
|
+
} else if (packageManager === "yarn") {
|
|
8
28
|
fs.removeSync(path.join(rootPath, LOCK_FILE.YARN));
|
|
9
|
-
} else if (packageManager ===
|
|
29
|
+
} else if (packageManager === "npm") {
|
|
10
30
|
fs.removeSync(path.join(rootPath, LOCK_FILE.NPM));
|
|
11
31
|
}
|
|
12
32
|
};
|
|
13
|
-
|
|
14
|
-
rootPath,
|
|
15
|
-
removeLock
|
|
16
|
-
}) => {
|
|
33
|
+
const installByPackageManager = (_0, _1) => __async(void 0, [_0, _1], function* (packageManager, { rootPath, removeLock }) {
|
|
17
34
|
if (removeLock) {
|
|
18
35
|
removeLockFile(rootPath, packageManager);
|
|
19
36
|
}
|
|
20
|
-
if (packageManager ===
|
|
21
|
-
|
|
22
|
-
stdio: 'inherit'
|
|
23
|
-
});
|
|
37
|
+
if (packageManager === "pnpm") {
|
|
38
|
+
yield execa("pnpm", ["install"], { stdio: "inherit" });
|
|
24
39
|
}
|
|
25
|
-
if (packageManager ===
|
|
26
|
-
|
|
27
|
-
stdio: 'inherit'
|
|
28
|
-
});
|
|
40
|
+
if (packageManager === "yarn") {
|
|
41
|
+
yield execa("yarn", ["install"], { stdio: "inherit" });
|
|
29
42
|
}
|
|
30
|
-
};
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
installByPackageManager,
|
|
46
|
+
removeLockFile
|
|
47
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { I18CLILanguageDetector } from
|
|
2
|
-
|
|
1
|
+
import { I18CLILanguageDetector } from "@modern-js/plugin-i18n/language-detector";
|
|
2
|
+
function getLocaleLanguage() {
|
|
3
3
|
const detector = new I18CLILanguageDetector();
|
|
4
4
|
return detector.detect();
|
|
5
|
-
}
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
getLocaleLanguage
|
|
8
|
+
};
|
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 __async = (__this, __arguments, generator) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
var fulfilled = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var rejected = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.throw(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var build_watch_exports = {};
|
|
39
|
+
__export(build_watch_exports, {
|
|
40
|
+
buildWatchCli: () => buildWatchCli
|
|
5
41
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
42
|
+
module.exports = __toCommonJS(build_watch_exports);
|
|
43
|
+
var import_commands = require("../commands");
|
|
8
44
|
const buildWatchCli = (program, api) => {
|
|
9
|
-
program.command(
|
|
10
|
-
|
|
11
|
-
|
|
45
|
+
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(
|
|
46
|
+
(targetProjectName, option) => __async(void 0, null, function* () {
|
|
47
|
+
yield (0, import_commands.buildWatch)(targetProjectName, option, api);
|
|
48
|
+
})
|
|
49
|
+
);
|
|
12
50
|
};
|
|
13
|
-
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
buildWatchCli
|
|
54
|
+
});
|
|
@@ -1,13 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 __async = (__this, __arguments, generator) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
var fulfilled = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var rejected = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.throw(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var build_exports = {};
|
|
39
|
+
__export(build_exports, {
|
|
40
|
+
buildCli: () => buildCli
|
|
5
41
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
42
|
+
module.exports = __toCommonJS(build_exports);
|
|
43
|
+
var import_commands = require("../commands");
|
|
8
44
|
const buildCli = (program, api) => {
|
|
9
|
-
program.command(
|
|
10
|
-
|
|
11
|
-
|
|
45
|
+
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(
|
|
46
|
+
"-a, --all",
|
|
47
|
+
"build target project with project’s dependencies and dependent"
|
|
48
|
+
).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((targetProjectName, option) => __async(void 0, null, function* () {
|
|
49
|
+
yield (0, import_commands.build)(targetProjectName, option, api);
|
|
50
|
+
}));
|
|
12
51
|
};
|
|
13
|
-
|
|
52
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
53
|
+
0 && (module.exports = {
|
|
54
|
+
buildCli
|
|
55
|
+
});
|
|
@@ -1,13 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 __async = (__this, __arguments, generator) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
var fulfilled = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var rejected = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.throw(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var clear_exports = {};
|
|
39
|
+
__export(clear_exports, {
|
|
40
|
+
clearCli: () => clearCli
|
|
5
41
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
42
|
+
module.exports = __toCommonJS(clear_exports);
|
|
43
|
+
var import_commands = require("../commands");
|
|
8
44
|
const clearCli = (program, api) => {
|
|
9
|
-
program.command(
|
|
10
|
-
|
|
11
|
-
|
|
45
|
+
program.command("clear [projects...]").usage("[options]").option("--remove-dirs [dirs...]", "remove dirs, default is node_modules").description("clear project dirs").action(
|
|
46
|
+
(targetProjectNames, option) => __async(void 0, null, function* () {
|
|
47
|
+
yield (0, import_commands.clear)(targetProjectNames, option, api);
|
|
48
|
+
})
|
|
49
|
+
);
|
|
12
50
|
};
|
|
13
|
-
|
|
51
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
+
0 && (module.exports = {
|
|
53
|
+
clearCli
|
|
54
|
+
});
|
|
@@ -1,15 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
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 __async = (__this, __arguments, generator) => {
|
|
19
|
+
return new Promise((resolve, reject) => {
|
|
20
|
+
var fulfilled = (value) => {
|
|
21
|
+
try {
|
|
22
|
+
step(generator.next(value));
|
|
23
|
+
} catch (e) {
|
|
24
|
+
reject(e);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var rejected = (value) => {
|
|
28
|
+
try {
|
|
29
|
+
step(generator.throw(value));
|
|
30
|
+
} catch (e) {
|
|
31
|
+
reject(e);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
35
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
var deploy_exports = {};
|
|
39
|
+
__export(deploy_exports, {
|
|
40
|
+
deployCli: () => deployCli
|
|
5
41
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
42
|
+
module.exports = __toCommonJS(deploy_exports);
|
|
43
|
+
var import_commands = require("../commands");
|
|
8
44
|
const deployCli = (program, api) => {
|
|
9
|
-
program.command(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
45
|
+
program.command("deploy [project...]").usage("[options]").option(
|
|
46
|
+
"-p, --path [path]",
|
|
47
|
+
"Specify the path of the product output",
|
|
48
|
+
"output"
|
|
49
|
+
).description("deploy project").action(
|
|
50
|
+
(deployProjectNames, option) => __async(void 0, null, function* () {
|
|
51
|
+
const ignoreMatchs = ["**/output/**"];
|
|
52
|
+
yield (0, import_commands.deploy)(api, deployProjectNames, option, ignoreMatchs);
|
|
53
|
+
})
|
|
54
|
+
);
|
|
14
55
|
};
|
|
15
|
-
|
|
56
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
57
|
+
0 && (module.exports = {
|
|
58
|
+
deployCli
|
|
59
|
+
});
|