@lage-run/cli 0.21.0 → 0.22.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 +46 -1
- package/CHANGELOG.md +15 -2
- package/lib/commands/run/createTargetGraph.d.ts +1 -1
- package/lib/commands/server/action.js +23 -10
- package/lib/commands/server/getOutputFiles.d.ts +4 -0
- package/lib/commands/server/getOutputFiles.js +28 -0
- package/lib/commands/server/lageService.d.ts +10 -1
- package/lib/commands/server/lageService.js +56 -20
- package/lib/commands/server/simulateFileAccess.d.ts +2 -0
- package/lib/commands/server/simulateFileAccess.js +37 -0
- package/package.json +6 -5
- package/lib/commands/server/executeRemotely.d.ts +0 -8
- package/lib/commands/server/executeRemotely.js +0 -32
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,52 @@
|
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Fri, 27 Sep 2024 20:03:27 GMT",
|
|
6
|
+
"version": "0.22.0",
|
|
7
|
+
"tag": "@lage-run/cli_v0.22.0",
|
|
8
|
+
"comments": {
|
|
9
|
+
"minor": [
|
|
10
|
+
{
|
|
11
|
+
"author": "kchau@microsoft.com",
|
|
12
|
+
"package": "@lage-run/cli",
|
|
13
|
+
"commit": "2919f9041f931dc6ef65017f7aedb9fef9dab66d",
|
|
14
|
+
"comment": "Simulate file access for lage server"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"author": "beachball",
|
|
18
|
+
"package": "@lage-run/cli",
|
|
19
|
+
"comment": "Bump @lage-run/globby to v14.1.0",
|
|
20
|
+
"commit": "not available"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"author": "beachball",
|
|
24
|
+
"package": "@lage-run/cli",
|
|
25
|
+
"comment": "Bump @lage-run/hasher to v1.5.0",
|
|
26
|
+
"commit": "not available"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"author": "beachball",
|
|
30
|
+
"package": "@lage-run/cli",
|
|
31
|
+
"comment": "Bump @lage-run/rpc to v1.2.1",
|
|
32
|
+
"commit": "not available"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"author": "beachball",
|
|
36
|
+
"package": "@lage-run/cli",
|
|
37
|
+
"comment": "Bump @lage-run/scheduler to v1.3.1",
|
|
38
|
+
"commit": "not available"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"author": "beachball",
|
|
42
|
+
"package": "@lage-run/cli",
|
|
43
|
+
"comment": "Bump @lage-run/worker-threads-pool to v0.8.2",
|
|
44
|
+
"commit": "not available"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"date": "Wed, 25 Sep 2024 20:28:10 GMT",
|
|
6
51
|
"version": "0.21.0",
|
|
7
52
|
"tag": "@lage-run/cli_v0.21.0",
|
|
8
53
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
# Change Log - @lage-run/cli
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Fri, 27 Sep 2024 20:03:27 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## 0.22.0
|
|
8
|
+
|
|
9
|
+
Fri, 27 Sep 2024 20:03:27 GMT
|
|
10
|
+
|
|
11
|
+
### Minor changes
|
|
12
|
+
|
|
13
|
+
- Simulate file access for lage server (kchau@microsoft.com)
|
|
14
|
+
- Bump @lage-run/globby to v14.1.0
|
|
15
|
+
- Bump @lage-run/hasher to v1.5.0
|
|
16
|
+
- Bump @lage-run/rpc to v1.2.1
|
|
17
|
+
- Bump @lage-run/scheduler to v1.3.1
|
|
18
|
+
- Bump @lage-run/worker-threads-pool to v0.8.2
|
|
19
|
+
|
|
7
20
|
## 0.21.0
|
|
8
21
|
|
|
9
|
-
Wed, 25 Sep 2024 20:
|
|
22
|
+
Wed, 25 Sep 2024 20:28:10 GMT
|
|
10
23
|
|
|
11
24
|
### Minor changes
|
|
12
25
|
|
|
@@ -13,6 +13,7 @@ const _initializeReporters = require("../initializeReporters.js");
|
|
|
13
13
|
const _lageService = require("./lageService.js");
|
|
14
14
|
const _filterArgsForTasks = require("../run/filterArgsForTasks.js");
|
|
15
15
|
const _rpc = require("@lage-run/rpc");
|
|
16
|
+
const _simulateFileAccess = require("./simulateFileAccess.js");
|
|
16
17
|
function _interop_require_default(obj) {
|
|
17
18
|
return obj && obj.__esModule ? obj : {
|
|
18
19
|
default: obj
|
|
@@ -48,8 +49,12 @@ async function executeOnServer(args, client, logger) {
|
|
|
48
49
|
task,
|
|
49
50
|
taskArgs
|
|
50
51
|
});
|
|
51
|
-
logger.info(`Task ${response.packageName}
|
|
52
|
+
logger.info(`Task ${response.packageName} ${response.task} exited with code ${response.exitCode} `);
|
|
52
53
|
process.exitCode = response.exitCode;
|
|
54
|
+
if (response.exitCode === 0) {
|
|
55
|
+
await (0, _simulateFileAccess.simulateFileAccess)(logger, response.inputs, response.outputs);
|
|
56
|
+
}
|
|
57
|
+
logger.info("Task execution finished");
|
|
53
58
|
}
|
|
54
59
|
async function serverAction(options, command) {
|
|
55
60
|
const { port =5332 , host ="localhost" , timeout =1 } = options;
|
|
@@ -65,12 +70,17 @@ async function serverAction(options, command) {
|
|
|
65
70
|
} else {
|
|
66
71
|
logger.info(`Starting server on http://${host}:${port}`);
|
|
67
72
|
const abortController = new AbortController();
|
|
68
|
-
const lageService = await (0, _lageService.createLageService)(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
const lageService = await (0, _lageService.createLageService)({
|
|
74
|
+
cwd: process.cwd(),
|
|
75
|
+
serverControls: {
|
|
76
|
+
abortController,
|
|
77
|
+
countdownToShutdown: ()=>resetTimer(logger, timeout, abortController, server),
|
|
78
|
+
clearCountdown: clearTimer
|
|
79
|
+
},
|
|
80
|
+
logger,
|
|
81
|
+
maxWorkers: options.concurrency
|
|
73
82
|
});
|
|
83
|
+
const server = await (0, _rpc.createServer)(lageService, abortController);
|
|
74
84
|
await server.listen({
|
|
75
85
|
host,
|
|
76
86
|
port
|
|
@@ -86,12 +96,15 @@ async function serverAction(options, command) {
|
|
|
86
96
|
}
|
|
87
97
|
let timeoutHandle;
|
|
88
98
|
function resetTimer(logger, timeout, abortController, server) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
timeoutHandle = setTimeout(()=>{
|
|
99
|
+
clearTimer();
|
|
100
|
+
timeoutHandle = globalThis.setTimeout(()=>{
|
|
93
101
|
logger.info(`Server timed out after ${timeout} seconds`);
|
|
94
102
|
abortController.abort();
|
|
95
103
|
server.close();
|
|
96
104
|
}, timeout * 1000);
|
|
97
105
|
}
|
|
106
|
+
function clearTimer() {
|
|
107
|
+
if (timeoutHandle) {
|
|
108
|
+
globalThis.clearTimeout(timeoutHandle);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CacheOptions } from "@lage-run/config";
|
|
2
|
+
import type { PackageTree } from "@lage-run/hasher";
|
|
3
|
+
import type { Target } from "@lage-run/target-graph";
|
|
4
|
+
export declare function getOutputFiles(root: string, target: Target, outputGlob: CacheOptions["outputGlob"], packageTree: PackageTree): string[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "getOutputFiles", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return getOutputFiles;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _globby = require("@lage-run/globby");
|
|
12
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
13
|
+
function _interop_require_default(obj) {
|
|
14
|
+
return obj && obj.__esModule ? obj : {
|
|
15
|
+
default: obj
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function getOutputFiles(root, target, outputGlob, packageTree) {
|
|
19
|
+
const patterns = target.outputs ?? outputGlob ?? [
|
|
20
|
+
"**/*"
|
|
21
|
+
];
|
|
22
|
+
const sourceControlledFiles = new Set(packageTree.getPackageFiles(target.packageName ?? "", patterns));
|
|
23
|
+
const outputs = (0, _globby.glob)(patterns, {
|
|
24
|
+
cwd: target.cwd,
|
|
25
|
+
gitignore: false
|
|
26
|
+
}).map((file)=>_path.default.relative(root, _path.default.join(target.cwd, file))).filter((file)=>!sourceControlledFiles.has(file));
|
|
27
|
+
return outputs;
|
|
28
|
+
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Logger } from "@lage-run/logger";
|
|
3
3
|
import type { ILageService } from "@lage-run/rpc";
|
|
4
|
-
export declare function createLageService(cwd
|
|
4
|
+
export declare function createLageService({ cwd, serverControls, logger, maxWorkers, }: {
|
|
5
|
+
cwd: string;
|
|
6
|
+
serverControls: {
|
|
7
|
+
abortController: AbortController;
|
|
8
|
+
countdownToShutdown: () => void;
|
|
9
|
+
clearCountdown: () => void;
|
|
10
|
+
};
|
|
11
|
+
logger: Logger;
|
|
12
|
+
maxWorkers?: number;
|
|
13
|
+
}): Promise<ILageService>;
|
|
@@ -13,6 +13,9 @@ const _targetgraph = require("@lage-run/target-graph");
|
|
|
13
13
|
const _workspacetools = require("workspace-tools");
|
|
14
14
|
const _createTargetGraph = require("../run/createTargetGraph.js");
|
|
15
15
|
const _workerthreadspool = require("@lage-run/worker-threads-pool");
|
|
16
|
+
const _hasher = require("@lage-run/hasher");
|
|
17
|
+
const _getOutputFiles = require("./getOutputFiles.js");
|
|
18
|
+
const _globby = require("@lage-run/globby");
|
|
16
19
|
function findAllTasks(pipeline) {
|
|
17
20
|
const tasks = new Set();
|
|
18
21
|
for (const key of Object.keys(pipeline)){
|
|
@@ -25,18 +28,15 @@ function findAllTasks(pipeline) {
|
|
|
25
28
|
}
|
|
26
29
|
return Array.from(tasks);
|
|
27
30
|
}
|
|
28
|
-
let
|
|
29
|
-
let config;
|
|
31
|
+
let context;
|
|
30
32
|
async function initializeOnce(cwd, logger) {
|
|
31
|
-
if (!
|
|
32
|
-
config = await (0, _config.getConfig)(cwd);
|
|
33
|
-
}
|
|
34
|
-
if (!targetGraph) {
|
|
35
|
-
const { pipeline } = config;
|
|
33
|
+
if (!context) {
|
|
34
|
+
const config = await (0, _config.getConfig)(cwd);
|
|
36
35
|
const root = (0, _workspacetools.getWorkspaceRoot)(cwd);
|
|
36
|
+
const { pipeline } = config;
|
|
37
37
|
const packageInfos = (0, _workspacetools.getPackageInfos)(root);
|
|
38
38
|
const tasks = findAllTasks(pipeline);
|
|
39
|
-
targetGraph = (0, _createTargetGraph.createTargetGraph)({
|
|
39
|
+
const targetGraph = (0, _createTargetGraph.createTargetGraph)({
|
|
40
40
|
logger,
|
|
41
41
|
root,
|
|
42
42
|
dependencies: false,
|
|
@@ -44,28 +44,46 @@ async function initializeOnce(cwd, logger) {
|
|
|
44
44
|
ignore: [],
|
|
45
45
|
pipeline,
|
|
46
46
|
repoWideChanges: config.repoWideChanges,
|
|
47
|
-
scope:
|
|
47
|
+
scope: undefined,
|
|
48
48
|
since: "",
|
|
49
49
|
outputs: config.cacheOptions.outputGlob,
|
|
50
50
|
tasks,
|
|
51
51
|
packageInfos
|
|
52
52
|
});
|
|
53
|
+
const dependencyMap = (0, _workspacetools.createDependencyMap)(packageInfos, {
|
|
54
|
+
withDevDependencies: true,
|
|
55
|
+
withPeerDependencies: false
|
|
56
|
+
});
|
|
57
|
+
const packageTree = new _hasher.PackageTree({
|
|
58
|
+
root,
|
|
59
|
+
packageInfos,
|
|
60
|
+
includeUntracked: true
|
|
61
|
+
});
|
|
62
|
+
await packageTree.initialize();
|
|
63
|
+
context = {
|
|
64
|
+
config,
|
|
65
|
+
targetGraph,
|
|
66
|
+
packageTree,
|
|
67
|
+
dependencyMap,
|
|
68
|
+
root
|
|
69
|
+
};
|
|
53
70
|
}
|
|
54
|
-
return
|
|
55
|
-
config,
|
|
56
|
-
targetGraph
|
|
57
|
-
};
|
|
71
|
+
return context;
|
|
58
72
|
}
|
|
59
73
|
let pool;
|
|
60
|
-
async function createLageService(cwd,
|
|
74
|
+
async function createLageService({ cwd , serverControls , logger , maxWorkers }) {
|
|
61
75
|
logger.info(`Server started with ${maxWorkers} workers`);
|
|
62
76
|
pool = new _workerthreadspool.WorkerPool({
|
|
63
77
|
script: require.resolve("./singleTargetWorker.js"),
|
|
64
78
|
maxWorkers
|
|
65
79
|
});
|
|
66
|
-
abortController.signal.addEventListener("abort", ()=>{
|
|
80
|
+
serverControls.abortController.signal.addEventListener("abort", ()=>{
|
|
67
81
|
pool?.close();
|
|
68
82
|
});
|
|
83
|
+
pool?.on("idle", ()=>{
|
|
84
|
+
logger.info("All workers are idle, shutting down after timeout");
|
|
85
|
+
serverControls.countdownToShutdown();
|
|
86
|
+
});
|
|
69
87
|
return {
|
|
70
88
|
async ping () {
|
|
71
89
|
return {
|
|
@@ -73,7 +91,8 @@ async function createLageService(cwd, abortController, logger, maxWorkers) {
|
|
|
73
91
|
};
|
|
74
92
|
},
|
|
75
93
|
async runTarget (request) {
|
|
76
|
-
|
|
94
|
+
serverControls.clearCountdown();
|
|
95
|
+
const { config , targetGraph , dependencyMap , packageTree , root } = await initializeOnce(cwd, logger);
|
|
77
96
|
const runners = {
|
|
78
97
|
npmScript: {
|
|
79
98
|
script: require.resolve("../run/runners/NpmScriptRunner.js"),
|
|
@@ -94,7 +113,8 @@ async function createLageService(cwd, abortController, logger, maxWorkers) {
|
|
|
94
113
|
options: {}
|
|
95
114
|
}
|
|
96
115
|
};
|
|
97
|
-
|
|
116
|
+
const id = (0, _targetgraph.getTargetId)(request.packageName, request.task);
|
|
117
|
+
if (!targetGraph.targets.has(id)) {
|
|
98
118
|
logger.error(`Target not found: ${request.packageName}#${request.task}`);
|
|
99
119
|
return {
|
|
100
120
|
packageName: request.packageName,
|
|
@@ -102,7 +122,7 @@ async function createLageService(cwd, abortController, logger, maxWorkers) {
|
|
|
102
122
|
exitCode: 1
|
|
103
123
|
};
|
|
104
124
|
}
|
|
105
|
-
const target = targetGraph.targets.get(
|
|
125
|
+
const target = targetGraph.targets.get(id);
|
|
106
126
|
const task = {
|
|
107
127
|
target,
|
|
108
128
|
runners
|
|
@@ -121,16 +141,32 @@ async function createLageService(cwd, abortController, logger, maxWorkers) {
|
|
|
121
141
|
pipedStdout.unpipe(process.stdout);
|
|
122
142
|
pipedStderr.unpipe(process.stderr);
|
|
123
143
|
});
|
|
144
|
+
const globalInputs = target.environmentGlob ? (0, _globby.glob)(target.environmentGlob, {
|
|
145
|
+
cwd: root,
|
|
146
|
+
gitignore: true
|
|
147
|
+
}) : (0, _globby.glob)(config.cacheOptions?.environmentGlob, {
|
|
148
|
+
cwd: root,
|
|
149
|
+
gitignore: true
|
|
150
|
+
});
|
|
151
|
+
const inputs = ((0, _hasher.getInputFiles)(target, dependencyMap, packageTree) ?? []).concat(globalInputs);
|
|
124
152
|
return {
|
|
125
153
|
packageName: request.packageName,
|
|
126
154
|
task: request.task,
|
|
127
|
-
exitCode: 0
|
|
155
|
+
exitCode: 0,
|
|
156
|
+
hash: "",
|
|
157
|
+
inputs,
|
|
158
|
+
outputs: (0, _getOutputFiles.getOutputFiles)(root, target, config.cacheOptions?.outputGlob, packageTree),
|
|
159
|
+
id
|
|
128
160
|
};
|
|
129
161
|
} catch (e) {
|
|
130
162
|
return {
|
|
131
163
|
packageName: request.packageName,
|
|
132
164
|
task: request.task,
|
|
133
|
-
exitCode: 1
|
|
165
|
+
exitCode: 1,
|
|
166
|
+
hash: "",
|
|
167
|
+
inputs: [],
|
|
168
|
+
outputs: [],
|
|
169
|
+
id
|
|
134
170
|
};
|
|
135
171
|
}
|
|
136
172
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "simulateFileAccess", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return simulateFileAccess;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _path = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
12
|
+
const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
13
|
+
const _workspacetools = require("workspace-tools");
|
|
14
|
+
function _interop_require_default(obj) {
|
|
15
|
+
return obj && obj.__esModule ? obj : {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async function simulateFileAccess(logger, inputs, outputs) {
|
|
20
|
+
const root = (0, _workspacetools.getWorkspaceRoot)(process.cwd());
|
|
21
|
+
logger.silly("Now probing and touching inputs and outputs");
|
|
22
|
+
// probe input files
|
|
23
|
+
let fd;
|
|
24
|
+
for (const input of inputs){
|
|
25
|
+
fd = _fs.default.openSync(_path.default.join(root, input), "r");
|
|
26
|
+
_fs.default.closeSync(fd);
|
|
27
|
+
}
|
|
28
|
+
// touch output files
|
|
29
|
+
const time = new Date();
|
|
30
|
+
for (const output of outputs){
|
|
31
|
+
try {
|
|
32
|
+
_fs.default.utimesSync(_path.default.join(root, output), time, time);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
// ignore
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lage-run/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Command Line Interface for Lage",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,15 +22,16 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@lage-run/cache": "^1.3.3",
|
|
24
24
|
"@lage-run/config": "^0.4.2",
|
|
25
|
-
"@lage-run/
|
|
25
|
+
"@lage-run/globby": "^14.1.0",
|
|
26
|
+
"@lage-run/hasher": "^1.5.0",
|
|
26
27
|
"@lage-run/logger": "^1.3.1",
|
|
27
28
|
"@lage-run/reporters": "^1.2.10",
|
|
28
|
-
"@lage-run/rpc": "^1.2.
|
|
29
|
+
"@lage-run/rpc": "^1.2.1",
|
|
29
30
|
"@lage-run/runners": "^1.0.2",
|
|
30
|
-
"@lage-run/scheduler": "^1.3.
|
|
31
|
+
"@lage-run/scheduler": "^1.3.1",
|
|
31
32
|
"@lage-run/scheduler-types": "^0.3.15",
|
|
32
33
|
"@lage-run/target-graph": "^0.8.10",
|
|
33
|
-
"@lage-run/worker-threads-pool": "^0.8.
|
|
34
|
+
"@lage-run/worker-threads-pool": "^0.8.2",
|
|
34
35
|
"chokidar": "3.5.3",
|
|
35
36
|
"commander": "9.5.0",
|
|
36
37
|
"execa": "5.1.1",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "executeRemotely", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return executeRemotely;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _filterArgsForTasks = require("../run/filterArgsForTasks.js");
|
|
12
|
-
async function executeRemotely({ logger , server , args }) {
|
|
13
|
-
const task = args?.length === 1 ? args?.[0] : args?.[1];
|
|
14
|
-
const packageName = args?.length ?? 0 > 1 ? args?.[0] : undefined;
|
|
15
|
-
if (!task) {
|
|
16
|
-
throw new Error("No task provided");
|
|
17
|
-
}
|
|
18
|
-
const { taskArgs } = (0, _filterArgsForTasks.filterArgsForTasks)(args ?? []);
|
|
19
|
-
const rpc = (await import("@lage-run/rpc")).default;
|
|
20
|
-
const baseUrl = server.startsWith("http") ? server : `http://${server}`;
|
|
21
|
-
const client = rpc.createClient({
|
|
22
|
-
baseUrl,
|
|
23
|
-
httpVersion: baseUrl.startsWith("https") ? "2" : "1.1"
|
|
24
|
-
});
|
|
25
|
-
const response = await client.runTarget({
|
|
26
|
-
packageName,
|
|
27
|
-
task,
|
|
28
|
-
taskArgs
|
|
29
|
-
});
|
|
30
|
-
logger.info(`Task ${response.packageName}#${response.task} exited with code ${response.exitCode}`);
|
|
31
|
-
process.exitCode = response.exitCode;
|
|
32
|
-
}
|