@lage-run/cli 0.19.3 → 0.21.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.json +91 -1
- package/CHANGELOG.md +28 -2
- package/lib/cli.js +0 -2
- package/lib/commands/exec/action.js +6 -15
- package/lib/commands/exec/index.js +0 -1
- package/lib/commands/server/action.d.ts +3 -1
- package/lib/commands/server/action.js +73 -45
- package/lib/commands/server/index.js +2 -1
- package/lib/commands/server/lageService.d.ts +2 -2
- package/lib/commands/server/lageService.js +66 -4
- package/lib/server.d.ts +1 -0
- package/lib/server.js +25 -0
- package/package.json +10 -10
- /package/lib/commands/{exec → server}/executeRemotely.d.ts +0 -0
- /package/lib/commands/{exec → server}/executeRemotely.js +0 -0
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,97 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Wed,
|
|
5
|
+
"date": "Wed, 25 Sep 2024 20:27:33 GMT",
|
|
6
|
+
"version": "0.21.0",
|
|
7
|
+
"tag": "@lage-run/cli_v0.21.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "beachball",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"comment": "Bump @lage-run/hasher to v1.4.0",
|
|
14
|
+
"commit": "not available"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@lage-run/cli",
|
|
19
|
+
"comment": "Bump @lage-run/scheduler to v1.3.0",
|
|
20
|
+
"commit": "not available"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"date": "Fri, 13 Sep 2024 18:05:04 GMT",
|
|
27
|
+
"version": "0.20.0",
|
|
28
|
+
"tag": "@lage-run/cli_v0.20.0",
|
|
29
|
+
"comments": {
|
|
30
|
+
"minor": [
|
|
31
|
+
{
|
|
32
|
+
"author": "kchau@microsoft.com",
|
|
33
|
+
"package": "@lage-run/cli",
|
|
34
|
+
"commit": "924b93e66ae3cc60effa7cfc1f5254e1e59e9969",
|
|
35
|
+
"comment": "adds a lage-server binary that listens and executes and auto shutsdown"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"author": "beachball",
|
|
39
|
+
"package": "@lage-run/cli",
|
|
40
|
+
"comment": "Bump @lage-run/cache to v1.3.3",
|
|
41
|
+
"commit": "not available"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"author": "beachball",
|
|
45
|
+
"package": "@lage-run/cli",
|
|
46
|
+
"comment": "Bump @lage-run/config to v0.4.2",
|
|
47
|
+
"commit": "not available"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"author": "beachball",
|
|
51
|
+
"package": "@lage-run/cli",
|
|
52
|
+
"comment": "Bump @lage-run/hasher to v1.3.4",
|
|
53
|
+
"commit": "not available"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"author": "beachball",
|
|
57
|
+
"package": "@lage-run/cli",
|
|
58
|
+
"comment": "Bump @lage-run/reporters to v1.2.10",
|
|
59
|
+
"commit": "not available"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"author": "beachball",
|
|
63
|
+
"package": "@lage-run/cli",
|
|
64
|
+
"comment": "Bump @lage-run/rpc to v1.2.0",
|
|
65
|
+
"commit": "not available"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"author": "beachball",
|
|
69
|
+
"package": "@lage-run/cli",
|
|
70
|
+
"comment": "Bump @lage-run/runners to v1.0.2",
|
|
71
|
+
"commit": "not available"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"author": "beachball",
|
|
75
|
+
"package": "@lage-run/cli",
|
|
76
|
+
"comment": "Bump @lage-run/scheduler to v1.2.14",
|
|
77
|
+
"commit": "not available"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"author": "beachball",
|
|
81
|
+
"package": "@lage-run/cli",
|
|
82
|
+
"comment": "Bump @lage-run/scheduler-types to v0.3.15",
|
|
83
|
+
"commit": "not available"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"author": "beachball",
|
|
87
|
+
"package": "@lage-run/cli",
|
|
88
|
+
"comment": "Bump @lage-run/target-graph to v0.8.10",
|
|
89
|
+
"commit": "not available"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"date": "Wed, 11 Sep 2024 20:52:15 GMT",
|
|
6
96
|
"version": "0.19.3",
|
|
7
97
|
"tag": "@lage-run/cli_v0.19.3",
|
|
8
98
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
# Change Log - @lage-run/cli
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on Wed,
|
|
3
|
+
<!-- This log was last generated on Wed, 25 Sep 2024 20:27:33 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.21.0
|
|
8
|
+
|
|
9
|
+
Wed, 25 Sep 2024 20:27:33 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Bump @lage-run/hasher to v1.4.0
|
|
14
|
+
- Bump @lage-run/scheduler to v1.3.0
|
|
15
|
+
|
|
16
|
+
## 0.20.0
|
|
17
|
+
|
|
18
|
+
Fri, 13 Sep 2024 18:05:04 GMT
|
|
19
|
+
|
|
20
|
+
### Minor changes
|
|
21
|
+
|
|
22
|
+
- adds a lage-server binary that listens and executes and auto shutsdown (kchau@microsoft.com)
|
|
23
|
+
- Bump @lage-run/cache to v1.3.3
|
|
24
|
+
- Bump @lage-run/config to v0.4.2
|
|
25
|
+
- Bump @lage-run/hasher to v1.3.4
|
|
26
|
+
- Bump @lage-run/reporters to v1.2.10
|
|
27
|
+
- Bump @lage-run/rpc to v1.2.0
|
|
28
|
+
- Bump @lage-run/runners to v1.0.2
|
|
29
|
+
- Bump @lage-run/scheduler to v1.2.14
|
|
30
|
+
- Bump @lage-run/scheduler-types to v0.3.15
|
|
31
|
+
- Bump @lage-run/target-graph to v0.8.10
|
|
32
|
+
|
|
7
33
|
## 0.19.3
|
|
8
34
|
|
|
9
|
-
Wed, 11 Sep 2024 20:52:
|
|
35
|
+
Wed, 11 Sep 2024 20:52:15 GMT
|
|
10
36
|
|
|
11
37
|
### Patches
|
|
12
38
|
|
package/lib/cli.js
CHANGED
|
@@ -10,7 +10,6 @@ const _index2 = require("./commands/affected/index.js");
|
|
|
10
10
|
const _index3 = require("./commands/init/index.js");
|
|
11
11
|
const _index4 = require("./commands/info/index.js");
|
|
12
12
|
const _index5 = require("./commands/exec/index.js");
|
|
13
|
-
const _index6 = require("./commands/server/index.js");
|
|
14
13
|
async function main() {
|
|
15
14
|
const program = new _commander.Command();
|
|
16
15
|
program.addCommand(_index.runCommand, {
|
|
@@ -21,7 +20,6 @@ async function main() {
|
|
|
21
20
|
program.addCommand(_index3.initCommand);
|
|
22
21
|
program.addCommand(_index4.infoCommand);
|
|
23
22
|
program.addCommand(_index5.execCommand);
|
|
24
|
-
program.addCommand(_index6.serverCommand);
|
|
25
23
|
await program.parseAsync(process.argv);
|
|
26
24
|
}
|
|
27
25
|
main().catch((err)=>{
|
|
@@ -11,7 +11,6 @@ Object.defineProperty(exports, "execAction", {
|
|
|
11
11
|
const _logger = /*#__PURE__*/ _interop_require_default(require("@lage-run/logger"));
|
|
12
12
|
const _initializeReporters = require("../initializeReporters.js");
|
|
13
13
|
const _executeInProcess = require("./executeInProcess.js");
|
|
14
|
-
const _executeRemotely = require("./executeRemotely.js");
|
|
15
14
|
function _interop_require_default(obj) {
|
|
16
15
|
return obj && obj.__esModule ? obj : {
|
|
17
16
|
default: obj
|
|
@@ -22,18 +21,10 @@ async function execAction(options, command) {
|
|
|
22
21
|
options.logLevel = options.logLevel ?? "info";
|
|
23
22
|
options.reporter = options.reporter ?? "json";
|
|
24
23
|
(0, _initializeReporters.initializeReporters)(logger, options);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} else {
|
|
32
|
-
await (0, _executeInProcess.executeInProcess)({
|
|
33
|
-
logger,
|
|
34
|
-
args: command.args,
|
|
35
|
-
cwd: options.cwd,
|
|
36
|
-
nodeArg: options.nodeArg
|
|
37
|
-
});
|
|
38
|
-
}
|
|
24
|
+
await (0, _executeInProcess.executeInProcess)({
|
|
25
|
+
logger,
|
|
26
|
+
args: command.args,
|
|
27
|
+
cwd: options.cwd,
|
|
28
|
+
nodeArg: options.nodeArg
|
|
29
|
+
});
|
|
39
30
|
}
|
|
@@ -12,5 +12,4 @@ const _commander = require("commander");
|
|
|
12
12
|
const _action = require("./action.js");
|
|
13
13
|
const _addLoggerOptions = require("../addLoggerOptions.js");
|
|
14
14
|
const execCommand = new _commander.Command("exec");
|
|
15
|
-
execCommand.option("--server [server:port]", "Execute on lage server via RPC", "localhost:5332");
|
|
16
15
|
(0, _addLoggerOptions.addLoggerOptions)(execCommand).action(_action.execAction);
|
|
@@ -4,6 +4,8 @@ interface WorkerOptions extends ReporterInitOptions {
|
|
|
4
4
|
nodeArg?: string[];
|
|
5
5
|
port?: number;
|
|
6
6
|
host?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
shutdown: boolean;
|
|
7
9
|
}
|
|
8
|
-
export declare function
|
|
10
|
+
export declare function serverAction(options: WorkerOptions, command: Command): Promise<void>;
|
|
9
11
|
export {};
|
|
@@ -2,68 +2,96 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "serverAction", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return serverAction;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _config = require("@lage-run/config");
|
|
12
11
|
const _logger = /*#__PURE__*/ _interop_require_default(require("@lage-run/logger"));
|
|
13
12
|
const _initializeReporters = require("../initializeReporters.js");
|
|
14
13
|
const _lageService = require("./lageService.js");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const _targetId = require("@lage-run/target-graph/lib/targetId.js");
|
|
14
|
+
const _filterArgsForTasks = require("../run/filterArgsForTasks.js");
|
|
15
|
+
const _rpc = require("@lage-run/rpc");
|
|
18
16
|
function _interop_require_default(obj) {
|
|
19
17
|
return obj && obj.__esModule ? obj : {
|
|
20
18
|
default: obj
|
|
21
19
|
};
|
|
22
20
|
}
|
|
23
|
-
function
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
async function tryCreateClient(host, port) {
|
|
22
|
+
const client = (0, _rpc.createClient)({
|
|
23
|
+
baseUrl: `http://${host}:${port}`,
|
|
24
|
+
httpVersion: "1.1"
|
|
25
|
+
});
|
|
26
|
+
try {
|
|
27
|
+
const success = await client.ping({});
|
|
28
|
+
if (success.pong) {
|
|
29
|
+
return client;
|
|
30
|
+
}
|
|
31
|
+
} catch (e) {
|
|
32
|
+
if (e instanceof _rpc.ConnectError) {
|
|
33
|
+
return undefined;
|
|
31
34
|
}
|
|
35
|
+
throw e;
|
|
36
|
+
}
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
async function executeOnServer(args, client, logger) {
|
|
40
|
+
const task = args.length === 1 ? args[0] : args[1];
|
|
41
|
+
const packageName = args.length > 1 ? args[0] : undefined;
|
|
42
|
+
if (!task) {
|
|
43
|
+
throw new Error("No task provided");
|
|
32
44
|
}
|
|
33
|
-
|
|
45
|
+
const { taskArgs } = (0, _filterArgsForTasks.filterArgsForTasks)(args ?? []);
|
|
46
|
+
const response = await client.runTarget({
|
|
47
|
+
packageName,
|
|
48
|
+
task,
|
|
49
|
+
taskArgs
|
|
50
|
+
});
|
|
51
|
+
logger.info(`Task ${response.packageName} #${response.task} exited with code ${response.exitCode} `);
|
|
52
|
+
process.exitCode = response.exitCode;
|
|
34
53
|
}
|
|
35
|
-
async function
|
|
36
|
-
const { port =5332 , host ="localhost" } = options;
|
|
37
|
-
const cwd = process.cwd();
|
|
54
|
+
async function serverAction(options, command) {
|
|
55
|
+
const { port =5332 , host ="localhost" , timeout =1 } = options;
|
|
38
56
|
const logger = (0, _logger.default)();
|
|
39
57
|
options.logLevel = options.logLevel ?? "info";
|
|
40
58
|
options.reporter = options.reporter ?? "json";
|
|
41
59
|
(0, _initializeReporters.initializeReporters)(logger, options);
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
const client = await tryCreateClient(host, port);
|
|
61
|
+
if (client) {
|
|
62
|
+
logger.info(`Executing on server http://${host}:${port}`);
|
|
63
|
+
const args = command.args;
|
|
64
|
+
await executeOnServer(args, client, logger);
|
|
65
|
+
} else {
|
|
66
|
+
logger.info(`Starting server on http://${host}:${port}`);
|
|
67
|
+
const abortController = new AbortController();
|
|
68
|
+
const lageService = await (0, _lageService.createLageService)(process.cwd(), abortController, logger, options.concurrency);
|
|
69
|
+
const server = await (0, _rpc.createServer)(lageService, abortController);
|
|
70
|
+
server.addHook("onRequest", (req, res, next)=>{
|
|
71
|
+
resetTimer(logger, timeout, abortController, server);
|
|
72
|
+
next();
|
|
73
|
+
});
|
|
74
|
+
await server.listen({
|
|
75
|
+
host,
|
|
76
|
+
port
|
|
77
|
+
});
|
|
78
|
+
logger.info(`Server listening on http://${host}:${port}, timeout in ${timeout} seconds`);
|
|
79
|
+
const client = await tryCreateClient(host, port);
|
|
80
|
+
if (!client) {
|
|
81
|
+
throw new Error("Server could not be reached");
|
|
82
|
+
}
|
|
83
|
+
const args = command.args;
|
|
84
|
+
await executeOnServer(args, client, logger);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
let timeoutHandle;
|
|
88
|
+
function resetTimer(logger, timeout, abortController, server) {
|
|
89
|
+
if (timeoutHandle) {
|
|
90
|
+
clearTimeout(timeoutHandle);
|
|
91
|
+
}
|
|
92
|
+
timeoutHandle = setTimeout(()=>{
|
|
93
|
+
logger.info(`Server timed out after ${timeout} seconds`);
|
|
94
|
+
abortController.abort();
|
|
95
|
+
server.close();
|
|
96
|
+
}, timeout * 1000);
|
|
69
97
|
}
|
|
@@ -21,4 +21,5 @@ const serverCommand = new _commander.Command("server");
|
|
|
21
21
|
serverCommand.option("-c|--concurrency <number>", "max jobs to run at a time", (v)=>parseInt(v), _os.default.cpus().length - 1);
|
|
22
22
|
serverCommand.option("-h|--host <host>", "lage server host", "localhost");
|
|
23
23
|
serverCommand.option("-p|--port <port>", "lage worker server port", (v)=>parseInt(v), 5332);
|
|
24
|
-
(
|
|
24
|
+
serverCommand.option("-t|--timeout <seconds>", "lage server autoshutoff timeout", (v)=>parseInt(v), 1 * 60);
|
|
25
|
+
(0, _addLoggerOptions.addLoggerOptions)(serverCommand).action(_action.serverAction);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
1
2
|
import type { Logger } from "@lage-run/logger";
|
|
2
3
|
import type { ILageService } from "@lage-run/rpc";
|
|
3
|
-
|
|
4
|
-
export declare function createLageService(targetGraph: TargetGraph, logger: Logger, npmClient: string, maxWorkers?: number): Promise<ILageService>;
|
|
4
|
+
export declare function createLageService(cwd: string, abortController: AbortController, logger: Logger, maxWorkers?: number): Promise<ILageService>;
|
|
@@ -8,23 +8,79 @@ Object.defineProperty(exports, "createLageService", {
|
|
|
8
8
|
return createLageService;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
+
const _config = require("@lage-run/config");
|
|
11
12
|
const _targetgraph = require("@lage-run/target-graph");
|
|
12
|
-
|
|
13
|
+
const _workspacetools = require("workspace-tools");
|
|
14
|
+
const _createTargetGraph = require("../run/createTargetGraph.js");
|
|
15
|
+
const _workerthreadspool = require("@lage-run/worker-threads-pool");
|
|
16
|
+
function findAllTasks(pipeline) {
|
|
17
|
+
const tasks = new Set();
|
|
18
|
+
for (const key of Object.keys(pipeline)){
|
|
19
|
+
if (key.includes("#") || key.startsWith("#") || key.endsWith("//")) {
|
|
20
|
+
const { task } = (0, _targetgraph.getPackageAndTask)(key);
|
|
21
|
+
tasks.add(task);
|
|
22
|
+
} else {
|
|
23
|
+
tasks.add(key);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return Array.from(tasks);
|
|
27
|
+
}
|
|
28
|
+
let targetGraph;
|
|
29
|
+
let config;
|
|
30
|
+
async function initializeOnce(cwd, logger) {
|
|
31
|
+
if (!config) {
|
|
32
|
+
config = await (0, _config.getConfig)(cwd);
|
|
33
|
+
}
|
|
34
|
+
if (!targetGraph) {
|
|
35
|
+
const { pipeline } = config;
|
|
36
|
+
const root = (0, _workspacetools.getWorkspaceRoot)(cwd);
|
|
37
|
+
const packageInfos = (0, _workspacetools.getPackageInfos)(root);
|
|
38
|
+
const tasks = findAllTasks(pipeline);
|
|
39
|
+
targetGraph = (0, _createTargetGraph.createTargetGraph)({
|
|
40
|
+
logger,
|
|
41
|
+
root,
|
|
42
|
+
dependencies: false,
|
|
43
|
+
dependents: false,
|
|
44
|
+
ignore: [],
|
|
45
|
+
pipeline,
|
|
46
|
+
repoWideChanges: config.repoWideChanges,
|
|
47
|
+
scope: [],
|
|
48
|
+
since: "",
|
|
49
|
+
outputs: config.cacheOptions.outputGlob,
|
|
50
|
+
tasks,
|
|
51
|
+
packageInfos
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
config,
|
|
56
|
+
targetGraph
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
let pool;
|
|
60
|
+
async function createLageService(cwd, abortController, logger, maxWorkers) {
|
|
13
61
|
logger.info(`Server started with ${maxWorkers} workers`);
|
|
14
|
-
|
|
15
|
-
const pool = new poolModule.WorkerPool({
|
|
62
|
+
pool = new _workerthreadspool.WorkerPool({
|
|
16
63
|
script: require.resolve("./singleTargetWorker.js"),
|
|
17
64
|
maxWorkers
|
|
18
65
|
});
|
|
66
|
+
abortController.signal.addEventListener("abort", ()=>{
|
|
67
|
+
pool?.close();
|
|
68
|
+
});
|
|
19
69
|
return {
|
|
70
|
+
async ping () {
|
|
71
|
+
return {
|
|
72
|
+
pong: true
|
|
73
|
+
};
|
|
74
|
+
},
|
|
20
75
|
async runTarget (request) {
|
|
76
|
+
const { config , targetGraph } = await initializeOnce(cwd, logger);
|
|
21
77
|
const runners = {
|
|
22
78
|
npmScript: {
|
|
23
79
|
script: require.resolve("../run/runners/NpmScriptRunner.js"),
|
|
24
80
|
options: {
|
|
25
81
|
nodeOptions: request.nodeOptions,
|
|
26
82
|
taskArgs: request.taskArgs,
|
|
27
|
-
npmCmd: npmClient
|
|
83
|
+
npmCmd: config.npmClient
|
|
28
84
|
}
|
|
29
85
|
},
|
|
30
86
|
worker: {
|
|
@@ -51,13 +107,19 @@ async function createLageService(targetGraph, logger, npmClient, maxWorkers) {
|
|
|
51
107
|
target,
|
|
52
108
|
runners
|
|
53
109
|
};
|
|
110
|
+
let pipedStdout;
|
|
111
|
+
let pipedStderr;
|
|
54
112
|
try {
|
|
55
113
|
await pool.exec(task, 0, (worker, stdout, stderr)=>{
|
|
56
114
|
logger.info(`[${worker.threadId}] ${request.packageName}#${request.task} start`);
|
|
115
|
+
pipedStdout = stdout;
|
|
116
|
+
pipedStderr = stderr;
|
|
57
117
|
stdout.pipe(process.stdout);
|
|
58
118
|
stderr.pipe(process.stderr);
|
|
59
119
|
}, (worker)=>{
|
|
60
120
|
logger.info(`[${worker.threadId}] ${request.packageName}#${request.task} end`);
|
|
121
|
+
pipedStdout.unpipe(process.stdout);
|
|
122
|
+
pipedStderr.unpipe(process.stderr);
|
|
61
123
|
});
|
|
62
124
|
return {
|
|
63
125
|
packageName: request.packageName,
|
package/lib/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/server.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
const _commander = require("commander");
|
|
6
|
+
const _errors = require("./types/errors.js");
|
|
7
|
+
const _index = require("./commands/server/index.js");
|
|
8
|
+
async function main() {
|
|
9
|
+
const program = new _commander.Command();
|
|
10
|
+
program.addCommand(_index.serverCommand, {
|
|
11
|
+
isDefault: true
|
|
12
|
+
});
|
|
13
|
+
await program.parseAsync(process.argv);
|
|
14
|
+
}
|
|
15
|
+
main().catch((err)=>{
|
|
16
|
+
/* eslint-disable no-console */ switch(err){
|
|
17
|
+
case _errors.NoTargetFoundError:
|
|
18
|
+
console.log("lage: no targets found that matches the given scope.");
|
|
19
|
+
break;
|
|
20
|
+
default:
|
|
21
|
+
console.error(err);
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
/* eslint-enable no-console */ process.exitCode = 1;
|
|
25
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"description": "Command Line Interface for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,16 +20,16 @@
|
|
|
20
20
|
"lint": "monorepo-scripts lint"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@lage-run/cache": "^1.3.
|
|
24
|
-
"@lage-run/config": "^0.4.
|
|
25
|
-
"@lage-run/hasher": "^1.
|
|
23
|
+
"@lage-run/cache": "^1.3.3",
|
|
24
|
+
"@lage-run/config": "^0.4.2",
|
|
25
|
+
"@lage-run/hasher": "^1.4.0",
|
|
26
26
|
"@lage-run/logger": "^1.3.1",
|
|
27
|
-
"@lage-run/reporters": "^1.2.
|
|
28
|
-
"@lage-run/rpc": "^1.
|
|
29
|
-
"@lage-run/runners": "^1.0.
|
|
30
|
-
"@lage-run/scheduler": "^1.
|
|
31
|
-
"@lage-run/scheduler-types": "^0.3.
|
|
32
|
-
"@lage-run/target-graph": "^0.8.
|
|
27
|
+
"@lage-run/reporters": "^1.2.10",
|
|
28
|
+
"@lage-run/rpc": "^1.2.0",
|
|
29
|
+
"@lage-run/runners": "^1.0.2",
|
|
30
|
+
"@lage-run/scheduler": "^1.3.0",
|
|
31
|
+
"@lage-run/scheduler-types": "^0.3.15",
|
|
32
|
+
"@lage-run/target-graph": "^0.8.10",
|
|
33
33
|
"@lage-run/worker-threads-pool": "^0.8.1",
|
|
34
34
|
"chokidar": "3.5.3",
|
|
35
35
|
"commander": "9.5.0",
|
|
File without changes
|
|
File without changes
|