@modern-js/monorepo-tools 2.4.1-beta.0 → 2.6.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 +35 -8
- package/cli.js +1 -1
- package/dist/{js/node → cjs}/cli/build-watch.js +3 -23
- package/dist/{js/node → cjs}/cli/build.js +3 -23
- package/dist/{js/node → cjs}/cli/clear.js +3 -23
- package/dist/{js/node → cjs}/cli/deploy.js +3 -23
- package/dist/cjs/cli/install.js +34 -0
- package/dist/{js/node → cjs}/cli/new.js +3 -40
- package/dist/{js/node → cjs}/commands/build-watch.js +4 -24
- package/dist/{js/node → cjs}/commands/build.js +9 -41
- package/dist/{js/node → cjs}/commands/clear.js +3 -23
- package/dist/{js/node → cjs}/commands/deploy.js +4 -24
- package/dist/{js/node → cjs}/commands/install.js +4 -24
- package/dist/{js/node → cjs}/dag/create.js +9 -16
- package/dist/cjs/dag/operator.js +269 -0
- package/dist/{js/node → cjs}/dag/task.js +33 -53
- package/dist/{js/node → cjs}/features/build/index.js +17 -33
- package/dist/{js/node → cjs}/features/clear/index.js +4 -0
- package/dist/{js/node → cjs}/features/deploy/index.js +15 -30
- package/dist/{js/node → cjs}/features/dev/create-task.js +10 -26
- package/dist/{js/node → cjs}/features/dev/index.js +18 -34
- package/dist/{js/node → cjs}/features/dev/watch-projects-state.js +7 -19
- package/dist/{js/node → cjs}/features/install/index.js +7 -23
- package/dist/{js/node → cjs}/index.js +4 -0
- package/dist/{js/node → cjs}/log/time.js +1 -15
- package/dist/{js/node → cjs}/parse-config/index.js +13 -39
- package/dist/{js/node → cjs}/parse-config/monorepo.js +4 -0
- package/dist/{js/node → cjs}/projects/check-project-change.js +16 -32
- package/dist/{js/node → cjs}/projects/clear-memory-files.js +4 -0
- package/dist/{js/node → cjs}/projects/get-projects-by-packages-config.js +17 -45
- package/dist/{js/node → cjs}/projects/get-projects-by-workspace-file.js +8 -24
- package/dist/{js/node → cjs}/projects/get-projects.js +18 -47
- package/dist/{js/node → cjs}/utils/install.js +8 -24
- package/dist/esm/cli/build-watch.js +11 -0
- package/dist/esm/cli/build.js +12 -0
- package/dist/esm/cli/clear.js +11 -0
- package/dist/esm/cli/deploy.js +16 -0
- package/dist/esm/cli/install.js +11 -0
- package/dist/esm/cli/new.js +18 -0
- package/dist/esm/commands/build-watch.js +24 -0
- package/dist/esm/commands/build.js +56 -0
- package/dist/esm/commands/clear.js +19 -0
- package/dist/{js/modern → esm}/commands/deploy.js +4 -24
- package/dist/esm/commands/install.js +23 -0
- package/dist/{js/modern → esm}/dag/create.js +9 -18
- package/dist/esm/dag/operator.js +236 -0
- package/dist/esm/dag/task.js +55 -0
- package/dist/{js/modern → esm}/features/build/index.js +13 -33
- package/dist/{js/modern → esm}/features/deploy/index.js +11 -30
- package/dist/{js/modern → esm}/features/dev/create-task.js +6 -26
- package/dist/{js/modern → esm}/features/dev/index.js +14 -34
- package/dist/{js/modern → esm}/features/dev/watch-projects-state.js +3 -21
- package/dist/{js/modern → esm}/features/install/index.js +3 -23
- package/dist/esm/log/time.js +13 -0
- package/dist/esm/parse-config/index.js +19 -0
- package/dist/{js/modern → esm}/projects/check-project-change.js +12 -32
- package/dist/{js/modern → esm}/projects/get-projects-by-packages-config.js +13 -47
- package/dist/{js/modern → esm}/projects/get-projects-by-workspace-file.js +4 -24
- package/dist/{js/modern → esm}/projects/get-projects.js +18 -49
- package/dist/esm/utils/install.js +27 -0
- package/dist/types/package/index.d.ts +1 -1
- package/package.json +16 -16
- package/dist/js/modern/cli/build-watch.js +0 -31
- package/dist/js/modern/cli/build.js +0 -32
- package/dist/js/modern/cli/clear.js +0 -31
- package/dist/js/modern/cli/deploy.js +0 -36
- package/dist/js/modern/cli/install.js +0 -31
- package/dist/js/modern/cli/new.js +0 -57
- package/dist/js/modern/commands/build-watch.js +0 -44
- package/dist/js/modern/commands/build.js +0 -90
- package/dist/js/modern/commands/clear.js +0 -39
- package/dist/js/modern/commands/install.js +0 -43
- package/dist/js/modern/dag/operator.js +0 -251
- package/dist/js/modern/dag/task.js +0 -79
- package/dist/js/modern/log/time.js +0 -29
- package/dist/js/modern/parse-config/index.js +0 -51
- package/dist/js/modern/utils/install.js +0 -47
- package/dist/js/node/cli/install.js +0 -54
- package/dist/js/node/dag/operator.js +0 -278
- /package/dist/{js/node → cjs}/cli/index.js +0 -0
- /package/dist/{js/node → cjs}/commands/index.js +0 -0
- /package/dist/{js/node → cjs}/constants.js +0 -0
- /package/dist/{js/node → cjs}/dag/edge-manager.js +0 -0
- /package/dist/{js/node → cjs}/dag/index.js +0 -0
- /package/dist/{js/node → cjs}/dag/utils.js +0 -0
- /package/dist/{js/node → cjs}/features/dev/cmds.js +0 -0
- /package/dist/{js/node → cjs}/hooks/index.js +0 -0
- /package/dist/{js/node → cjs}/locale/en.js +0 -0
- /package/dist/{js/node → cjs}/locale/index.js +0 -0
- /package/dist/{js/node → cjs}/locale/zh.js +0 -0
- /package/dist/{js/node → cjs}/log/error.js +0 -0
- /package/dist/{js/node → cjs}/log/multi-tasks-log.js +0 -0
- /package/dist/{js/node → cjs}/log/utils.js +0 -0
- /package/dist/{js/node → cjs}/package/index.js +0 -0
- /package/dist/{js/node → cjs}/type.js +0 -0
- /package/dist/{js/node → cjs}/utils/language.js +0 -0
- /package/dist/{js/node → cjs}/utils/types.js +0 -0
- /package/dist/{js/modern → esm}/cli/index.js +0 -0
- /package/dist/{js/modern → esm}/commands/index.js +0 -0
- /package/dist/{js/modern → esm}/constants.js +0 -0
- /package/dist/{js/modern → esm}/dag/edge-manager.js +0 -0
- /package/dist/{js/modern → esm}/dag/index.js +0 -0
- /package/dist/{js/modern → esm}/dag/utils.js +0 -0
- /package/dist/{js/modern → esm}/features/clear/index.js +0 -0
- /package/dist/{js/modern → esm}/features/dev/cmds.js +0 -0
- /package/dist/{js/modern → esm}/hooks/index.js +0 -0
- /package/dist/{js/modern → esm}/index.js +0 -0
- /package/dist/{js/modern → esm}/locale/en.js +0 -0
- /package/dist/{js/modern → esm}/locale/index.js +0 -0
- /package/dist/{js/modern → esm}/locale/zh.js +0 -0
- /package/dist/{js/modern → esm}/log/error.js +0 -0
- /package/dist/{js/modern → esm}/log/multi-tasks-log.js +0 -0
- /package/dist/{js/modern → esm}/log/utils.js +0 -0
- /package/dist/{js/modern → esm}/package/index.js +0 -0
- /package/dist/{js/modern → esm}/parse-config/monorepo.js +0 -0
- /package/dist/{js/modern → esm}/projects/clear-memory-files.js +0 -0
- /package/dist/{js/modern → esm}/type.js +0 -0
- /package/dist/{js/modern → esm}/utils/language.js +0 -0
- /package/dist/{js/modern → esm}/utils/types.js +0 -0
|
@@ -17,30 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
23
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
-
var __async = (__this, __arguments, generator) => {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
var fulfilled = (value) => {
|
|
27
|
-
try {
|
|
28
|
-
step(generator.next(value));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var rejected = (value) => {
|
|
34
|
-
try {
|
|
35
|
-
step(generator.throw(value));
|
|
36
|
-
} catch (e) {
|
|
37
|
-
reject(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
28
|
var create_task_exports = {};
|
|
45
29
|
__export(create_task_exports, {
|
|
46
30
|
createDependenciesTask: () => createDependenciesTask,
|
|
@@ -67,7 +51,7 @@ const getFinalTaskCmds = (taskCmds, project) => {
|
|
|
67
51
|
const createDependenciesTask = (config, taskCmds = import_cmds.defaultBuildWatchCmds, taskLogger) => {
|
|
68
52
|
const { packageManager } = config;
|
|
69
53
|
const timelogInstance = timeLog.initTimeLog();
|
|
70
|
-
const task = (project) =>
|
|
54
|
+
const task = async (project) => {
|
|
71
55
|
const finalTaskCmds = getFinalTaskCmds(taskCmds, project);
|
|
72
56
|
const cmd = project.extra.scripts || {};
|
|
73
57
|
for (const taskCmd of finalTaskCmds) {
|
|
@@ -84,7 +68,7 @@ const createDependenciesTask = (config, taskCmds = import_cmds.defaultBuildWatch
|
|
|
84
68
|
stderr: childProcess.stderr,
|
|
85
69
|
logConfig: { label: "WATCH: " }
|
|
86
70
|
});
|
|
87
|
-
|
|
71
|
+
await childProcess;
|
|
88
72
|
} catch (e) {
|
|
89
73
|
(0, import_error.errorLog)(project.name, e);
|
|
90
74
|
}
|
|
@@ -93,12 +77,12 @@ const createDependenciesTask = (config, taskCmds = import_cmds.defaultBuildWatch
|
|
|
93
77
|
import_utils.logger.info(`${project.name} not have ${taskCmd}, skip it.`);
|
|
94
78
|
}
|
|
95
79
|
}
|
|
96
|
-
}
|
|
80
|
+
};
|
|
97
81
|
return task;
|
|
98
82
|
};
|
|
99
83
|
const createDevTask = (config, taskCmds = import_cmds.defaultBuildWatchCmds, taskLogger) => {
|
|
100
84
|
const { packageManager } = config;
|
|
101
|
-
const task = (project) =>
|
|
85
|
+
const task = async (project) => {
|
|
102
86
|
const devCmds = [taskCmds[0]];
|
|
103
87
|
const cmd = project.extra.scripts || {};
|
|
104
88
|
for (const taskCmd of devCmds) {
|
|
@@ -114,7 +98,7 @@ const createDevTask = (config, taskCmds = import_cmds.defaultBuildWatchCmds, tas
|
|
|
114
98
|
stderr: childProcess.stderr,
|
|
115
99
|
logConfig: { label: `${taskCmd.toUpperCase()}: ` }
|
|
116
100
|
});
|
|
117
|
-
const ret =
|
|
101
|
+
const ret = await childProcess;
|
|
118
102
|
console.info(ret);
|
|
119
103
|
} catch (e) {
|
|
120
104
|
(0, import_error.errorLog)(project.name, e);
|
|
@@ -123,7 +107,7 @@ const createDevTask = (config, taskCmds = import_cmds.defaultBuildWatchCmds, tas
|
|
|
123
107
|
import_utils.logger.info(`${project.name} not have ${taskCmd}, skip it.`);
|
|
124
108
|
}
|
|
125
109
|
}
|
|
126
|
-
}
|
|
110
|
+
};
|
|
127
111
|
return task;
|
|
128
112
|
};
|
|
129
113
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -17,30 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
23
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
-
var __async = (__this, __arguments, generator) => {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
var fulfilled = (value) => {
|
|
27
|
-
try {
|
|
28
|
-
step(generator.next(value));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var rejected = (value) => {
|
|
34
|
-
try {
|
|
35
|
-
step(generator.throw(value));
|
|
36
|
-
} catch (e) {
|
|
37
|
-
reject(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
28
|
var dev_exports = {};
|
|
45
29
|
__export(dev_exports, {
|
|
46
30
|
runBuildWatchTask: () => runBuildWatchTask
|
|
@@ -62,7 +46,7 @@ const getIgnored = (config) => (watchFilePath) => {
|
|
|
62
46
|
}
|
|
63
47
|
return false;
|
|
64
48
|
};
|
|
65
|
-
const runBuildWatchTask =
|
|
49
|
+
const runBuildWatchTask = async (projectName, operator, config, taskCmds = import_cmds.defaultBuildWatchCmds) => {
|
|
66
50
|
const { needInit = true } = config;
|
|
67
51
|
const taskLogger = new import_multi_tasks_log.MultitasksLogger();
|
|
68
52
|
const dependenciesTask = (0, import_create_task.createDependenciesTask)(config, taskCmds, taskLogger);
|
|
@@ -80,24 +64,24 @@ const runBuildWatchTask = (_0, _1, _2, ..._3) => __async(void 0, [_0, _1, _2, ..
|
|
|
80
64
|
});
|
|
81
65
|
watcher.add(watchedProjectState.getWatchedProjectsPath());
|
|
82
66
|
if (needInit) {
|
|
83
|
-
|
|
67
|
+
await operator.traverseDependenciesToProject(
|
|
84
68
|
projectName,
|
|
85
|
-
(currentProject) =>
|
|
86
|
-
|
|
87
|
-
}
|
|
69
|
+
async (currentProject) => {
|
|
70
|
+
await dependenciesTask(currentProject);
|
|
71
|
+
}
|
|
88
72
|
);
|
|
89
73
|
}
|
|
90
|
-
|
|
74
|
+
await new Promise((resolve) => {
|
|
91
75
|
console.info("start watch");
|
|
92
|
-
watcher.on("all", (eventName, changeFilePath) =>
|
|
76
|
+
watcher.on("all", async (eventName, changeFilePath) => {
|
|
93
77
|
if (eventName === "add") {
|
|
94
78
|
watchedProjectState.updateState();
|
|
95
79
|
}
|
|
96
80
|
const changedProject = watchedProjectState.getChangedProject(changeFilePath);
|
|
97
81
|
if (changedProject) {
|
|
98
|
-
|
|
82
|
+
await operator.traverseProjectToDependent(
|
|
99
83
|
changedProject.name,
|
|
100
|
-
(currentProject, _, earlyFinish) =>
|
|
84
|
+
async (currentProject, _, earlyFinish) => {
|
|
101
85
|
if (currentProject.name === projectName) {
|
|
102
86
|
earlyFinish();
|
|
103
87
|
return;
|
|
@@ -106,20 +90,20 @@ const runBuildWatchTask = (_0, _1, _2, ..._3) => __async(void 0, [_0, _1, _2, ..
|
|
|
106
90
|
currentProject.name
|
|
107
91
|
)) {
|
|
108
92
|
console.info("run build", currentProject.name);
|
|
109
|
-
|
|
93
|
+
await dependenciesTask(currentProject);
|
|
110
94
|
}
|
|
111
|
-
}
|
|
95
|
+
},
|
|
112
96
|
{ withSelf: true }
|
|
113
97
|
);
|
|
114
98
|
resolve(null);
|
|
115
99
|
} else {
|
|
116
100
|
console.info("changed is not in monorepo manager");
|
|
117
101
|
}
|
|
118
|
-
})
|
|
102
|
+
});
|
|
119
103
|
resolve(null);
|
|
120
104
|
});
|
|
121
|
-
|
|
122
|
-
}
|
|
105
|
+
await devTask(operator.getNodeData(projectName, { checkExist: true }));
|
|
106
|
+
};
|
|
123
107
|
// Annotate the CommonJS export names for ESM import in node:
|
|
124
108
|
0 && (module.exports = {
|
|
125
109
|
runBuildWatchTask
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
7
|
var __export = (target, all) => {
|
|
25
8
|
for (var name in all)
|
|
26
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -34,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
34
17
|
return to;
|
|
35
18
|
};
|
|
36
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
38
25
|
mod
|
|
39
26
|
));
|
|
@@ -70,9 +57,10 @@ class WatchedProjectsState {
|
|
|
70
57
|
node.extra.path
|
|
71
58
|
);
|
|
72
59
|
}
|
|
73
|
-
return
|
|
60
|
+
return {
|
|
61
|
+
...ret,
|
|
74
62
|
[node.extra.path]: node
|
|
75
|
-
}
|
|
63
|
+
};
|
|
76
64
|
},
|
|
77
65
|
{}
|
|
78
66
|
);
|
|
@@ -17,30 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
23
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
-
var __async = (__this, __arguments, generator) => {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
var fulfilled = (value) => {
|
|
27
|
-
try {
|
|
28
|
-
step(generator.next(value));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var rejected = (value) => {
|
|
34
|
-
try {
|
|
35
|
-
step(generator.throw(value));
|
|
36
|
-
} catch (e) {
|
|
37
|
-
reject(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
28
|
var install_exports = {};
|
|
45
29
|
__export(install_exports, {
|
|
46
30
|
runInstallTask: () => runInstallTask
|
|
@@ -82,7 +66,7 @@ const replaceWorkspaces = ({
|
|
|
82
66
|
}
|
|
83
67
|
return false;
|
|
84
68
|
};
|
|
85
|
-
const runInstallTask = (projectNames, operator, config) =>
|
|
69
|
+
const runInstallTask = async (projectNames, operator, config) => {
|
|
86
70
|
const { rootPath, packageManager } = config;
|
|
87
71
|
let projectsInWorkspaces = [];
|
|
88
72
|
if (projectNames.length === 0) {
|
|
@@ -102,11 +86,11 @@ const runInstallTask = (projectNames, operator, config) => __async(void 0, null,
|
|
|
102
86
|
rootPath,
|
|
103
87
|
projectsInWorkspaces: noDupProjectList
|
|
104
88
|
});
|
|
105
|
-
|
|
89
|
+
await (0, import_install.installByPackageManager)(packageManager, { rootPath, removeLock: true });
|
|
106
90
|
if (restorWorkspace) {
|
|
107
91
|
restorWorkspace();
|
|
108
92
|
}
|
|
109
|
-
}
|
|
93
|
+
};
|
|
110
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
111
95
|
0 && (module.exports = {
|
|
112
96
|
runInstallTask
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -1,21 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
5
|
var __export = (target, all) => {
|
|
20
6
|
for (var name in all)
|
|
21
7
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -37,7 +23,7 @@ __export(time_exports, {
|
|
|
37
23
|
});
|
|
38
24
|
module.exports = __toCommonJS(time_exports);
|
|
39
25
|
var import_utils = require("@modern-js/utils");
|
|
40
|
-
const initTimeLog = (option = {}) => new import_utils.Signale(
|
|
26
|
+
const initTimeLog = (option = {}) => new import_utils.Signale({ interactive: true, scope: "time-log", ...option });
|
|
41
27
|
const startTime = (signaleInstance, prefix = "") => {
|
|
42
28
|
signaleInstance.time(prefix);
|
|
43
29
|
};
|
|
@@ -2,22 +2,8 @@ var __create = Object.create;
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
7
|
var __export = (target, all) => {
|
|
22
8
|
for (var name in all)
|
|
23
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -31,30 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
31
17
|
return to;
|
|
32
18
|
};
|
|
33
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
34
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
35
25
|
mod
|
|
36
26
|
));
|
|
37
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
-
var __async = (__this, __arguments, generator) => {
|
|
39
|
-
return new Promise((resolve, reject) => {
|
|
40
|
-
var fulfilled = (value) => {
|
|
41
|
-
try {
|
|
42
|
-
step(generator.next(value));
|
|
43
|
-
} catch (e) {
|
|
44
|
-
reject(e);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
var rejected = (value) => {
|
|
48
|
-
try {
|
|
49
|
-
step(generator.throw(value));
|
|
50
|
-
} catch (e) {
|
|
51
|
-
reject(e);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
55
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
56
|
-
});
|
|
57
|
-
};
|
|
58
28
|
var parse_config_exports = {};
|
|
59
29
|
__export(parse_config_exports, {
|
|
60
30
|
getFinalConfig: () => getFinalConfig
|
|
@@ -63,15 +33,19 @@ module.exports = __toCommonJS(parse_config_exports);
|
|
|
63
33
|
var path = __toESM(require("path"));
|
|
64
34
|
var import_node_core_library = require("@rushstack/node-core-library");
|
|
65
35
|
var import_monorepo = require("./monorepo");
|
|
66
|
-
const defaultConfig = {
|
|
67
|
-
|
|
36
|
+
const defaultConfig = {
|
|
37
|
+
// packagesMatchs: {
|
|
38
|
+
// workspaceFile: 'pnpm-lock.yaml',
|
|
39
|
+
// },
|
|
40
|
+
};
|
|
41
|
+
const getFinalConfig = async (currentPath = process.cwd()) => {
|
|
68
42
|
const monorepo = (0, import_monorepo.getMonorepoBaseData)(currentPath);
|
|
69
|
-
const userConfig =
|
|
43
|
+
const userConfig = await import_node_core_library.JsonFile.loadAsync(
|
|
70
44
|
path.resolve(monorepo.rootPath, "mono-config.json")
|
|
71
45
|
);
|
|
72
|
-
const config =
|
|
46
|
+
const config = { ...defaultConfig, ...userConfig };
|
|
73
47
|
return { monorepo, config };
|
|
74
|
-
}
|
|
48
|
+
};
|
|
75
49
|
// Annotate the CommonJS export names for ESM import in node:
|
|
76
50
|
0 && (module.exports = {
|
|
77
51
|
getFinalConfig
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
@@ -17,30 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|
|
23
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
24
|
-
var __async = (__this, __arguments, generator) => {
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
var fulfilled = (value) => {
|
|
27
|
-
try {
|
|
28
|
-
step(generator.next(value));
|
|
29
|
-
} catch (e) {
|
|
30
|
-
reject(e);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var rejected = (value) => {
|
|
34
|
-
try {
|
|
35
|
-
step(generator.throw(value));
|
|
36
|
-
} catch (e) {
|
|
37
|
-
reject(e);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
41
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
28
|
var check_project_change_exports = {};
|
|
45
29
|
__export(check_project_change_exports, {
|
|
46
30
|
MONOREPO_GIT_FILE_NAME: () => MONOREPO_GIT_FILE_NAME,
|
|
@@ -58,7 +42,7 @@ var import_md5 = __toESM(require("md5"));
|
|
|
58
42
|
const PROJECT_CONTENT_FILE_NAME = "project-content.json";
|
|
59
43
|
const MONOREPO_GIT_FILE_NAME = "monorepo-git.json";
|
|
60
44
|
const PROJECT_MEMORY_PATH = ".project-memory";
|
|
61
|
-
const getProjectGitHash = (project) =>
|
|
45
|
+
const getProjectGitHash = async (project) => {
|
|
62
46
|
const projectDir = project.extra.path;
|
|
63
47
|
const globOption = {
|
|
64
48
|
cwd: projectDir,
|
|
@@ -68,7 +52,7 @@ const getProjectGitHash = (project) => __async(void 0, null, function* () {
|
|
|
68
52
|
ignore: ["**/node_modules/**", ".project-memory/**", "dist/**"]
|
|
69
53
|
};
|
|
70
54
|
const globPattern = `${projectDir}/**`;
|
|
71
|
-
const files =
|
|
55
|
+
const files = await (0, import_utils.globby)(path.posix.join(globPattern), globOption);
|
|
72
56
|
const hashMap = (0, import_package_deps_hash.getGitHashForFiles)(files, projectDir);
|
|
73
57
|
const hashObject = {};
|
|
74
58
|
import_node_core_library.Sort.sortMapKeys(hashMap);
|
|
@@ -76,10 +60,10 @@ const getProjectGitHash = (project) => __async(void 0, null, function* () {
|
|
|
76
60
|
hashObject[key] = value;
|
|
77
61
|
});
|
|
78
62
|
return (0, import_md5.default)(import_node_core_library.JsonFile.stringify(hashObject));
|
|
79
|
-
}
|
|
80
|
-
const checkProjectChangeByGit = (project, rootPath) =>
|
|
63
|
+
};
|
|
64
|
+
const checkProjectChangeByGit = async (project, rootPath) => {
|
|
81
65
|
const monorepoGitMemory = path.join(rootPath, MONOREPO_GIT_FILE_NAME);
|
|
82
|
-
const currentProjectHash =
|
|
66
|
+
const currentProjectHash = await getProjectGitHash(project);
|
|
83
67
|
if (!import_node_core_library.FileSystem.exists(monorepoGitMemory)) {
|
|
84
68
|
import_node_core_library.FileSystem.writeFile(monorepoGitMemory, import_node_core_library.JsonFile.stringify({}), {
|
|
85
69
|
ensureFolderExists: true
|
|
@@ -96,8 +80,8 @@ const checkProjectChangeByGit = (project, rootPath) => __async(void 0, null, fun
|
|
|
96
80
|
);
|
|
97
81
|
}
|
|
98
82
|
return changed;
|
|
99
|
-
}
|
|
100
|
-
const getProjectContentHashObjectForFiles = (project) =>
|
|
83
|
+
};
|
|
84
|
+
const getProjectContentHashObjectForFiles = async (project) => {
|
|
101
85
|
const projectDir = project.extra.path;
|
|
102
86
|
const globOption = {
|
|
103
87
|
cwd: projectDir,
|
|
@@ -107,21 +91,21 @@ const getProjectContentHashObjectForFiles = (project) => __async(void 0, null, f
|
|
|
107
91
|
ignore: ["**/node_modules/**", ".project-memory/**", "**/dist/**"]
|
|
108
92
|
};
|
|
109
93
|
const globPattern = `${projectDir}/**`;
|
|
110
|
-
const files =
|
|
94
|
+
const files = await (0, import_utils.globby)(path.posix.join(globPattern), globOption);
|
|
111
95
|
const hashObject = {};
|
|
112
96
|
for (const file of files.sort()) {
|
|
113
97
|
hashObject[file] = (0, import_md5.default)(import_node_core_library.FileSystem.readFile(file));
|
|
114
98
|
}
|
|
115
99
|
return hashObject;
|
|
116
|
-
}
|
|
117
|
-
const checkProjectChangeByContent = (project) =>
|
|
100
|
+
};
|
|
101
|
+
const checkProjectChangeByContent = async (project) => {
|
|
118
102
|
const projectDir = project.extra.path;
|
|
119
103
|
const projectMemoryFolder = path.resolve(projectDir, ".project-memory");
|
|
120
104
|
const projectJsonFile = path.join(
|
|
121
105
|
projectMemoryFolder,
|
|
122
106
|
PROJECT_CONTENT_FILE_NAME
|
|
123
107
|
);
|
|
124
|
-
const currentHashObject =
|
|
108
|
+
const currentHashObject = await getProjectContentHashObjectForFiles(project);
|
|
125
109
|
const currentHashString = import_node_core_library.JsonFile.stringify(currentHashObject);
|
|
126
110
|
if (!import_node_core_library.FileSystem.exists(projectJsonFile)) {
|
|
127
111
|
import_node_core_library.FileSystem.writeFile(projectJsonFile, currentHashString, {
|
|
@@ -137,7 +121,7 @@ const checkProjectChangeByContent = (project) => __async(void 0, null, function*
|
|
|
137
121
|
});
|
|
138
122
|
}
|
|
139
123
|
return changed;
|
|
140
|
-
}
|
|
124
|
+
};
|
|
141
125
|
// Annotate the CommonJS export names for ESM import in node:
|
|
142
126
|
0 && (module.exports = {
|
|
143
127
|
MONOREPO_GIT_FILE_NAME,
|
|
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
return to;
|
|
18
18
|
};
|
|
19
19
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
24
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
21
25
|
mod
|
|
22
26
|
));
|