zcatalyst-cli 1.17.3 → 1.17.4
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.
|
@@ -34,9 +34,9 @@ const logger_1 = require("../../../../util_modules/logger");
|
|
|
34
34
|
const project_1 = require("../../../../util_modules/project");
|
|
35
35
|
const shell_1 = require("../../../../util_modules/shell");
|
|
36
36
|
exports.default = (details, masterPort) => __awaiter(void 0, void 0, void 0, function* () {
|
|
37
|
-
var _a, _b;
|
|
37
|
+
var _a, _b, _c, _d, _e, _f;
|
|
38
38
|
const label = `${details.type}[${(_a = details.target) === null || _a === void 0 ? void 0 : _a.name}]`;
|
|
39
|
-
const
|
|
39
|
+
const _g = details.target, { ['watcher']: _ } = _g, serialisableTarget = __rest(_g, ['watcher']);
|
|
40
40
|
const projectRoot = runtime_store_1.default.get('project.root');
|
|
41
41
|
serialisableTarget.index = serialisableTarget.index
|
|
42
42
|
? serialisableTarget.index.replace(projectRoot, (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build))
|
|
@@ -44,13 +44,20 @@ exports.default = (details, masterPort) => __awaiter(void 0, void 0, void 0, fun
|
|
|
44
44
|
const opts = [
|
|
45
45
|
(0, path_1.join)(__dirname, 'server'),
|
|
46
46
|
details.httpPort + '',
|
|
47
|
-
JSON.stringify(
|
|
47
|
+
JSON.stringify({
|
|
48
|
+
index: ((_b = details.target) === null || _b === void 0 ? void 0 : _b.index)
|
|
49
|
+
? details.target.index.replace(projectRoot, (0, path_1.join)(projectRoot, constants_1.FOLDERNAME.build))
|
|
50
|
+
: undefined,
|
|
51
|
+
name: (_c = details.target) === null || _c === void 0 ? void 0 : _c.name,
|
|
52
|
+
type: (_d = details.target) === null || _d === void 0 ? void 0 : _d.type,
|
|
53
|
+
source: (_e = details.target) === null || _e === void 0 ? void 0 : _e.source
|
|
54
|
+
})
|
|
48
55
|
];
|
|
49
56
|
if (details.debugPort !== -1) {
|
|
50
57
|
(0, logger_1.labeled)(label, 'you can attach your debugger at port : ' + details.debugPort).MESSAGE();
|
|
51
58
|
opts.unshift('--inspect=' + details.debugPort);
|
|
52
59
|
}
|
|
53
|
-
const targetSource = (
|
|
60
|
+
const targetSource = (_f = details.target) === null || _f === void 0 ? void 0 : _f.source;
|
|
54
61
|
const servePlugin = yield (0, plugin_loader_1.default)('functions', 'start', targetSource).catch((err) => (0, logger_1.debug)(err));
|
|
55
62
|
if (typeof servePlugin === 'function') {
|
|
56
63
|
const logStreamPlugin = yield (0, plugin_loader_1.default)('functions', 'logs', targetSource).catch((err) => (0, logger_1.debug)(err));
|
|
@@ -184,12 +184,13 @@ class HttpFunctions {
|
|
|
184
184
|
exit: 2
|
|
185
185
|
});
|
|
186
186
|
}
|
|
187
|
+
const slaveFnTarget = { index: fnTarget.index, name: fnTarget.name };
|
|
187
188
|
if ((_a = fnTarget.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.node.value)) {
|
|
188
189
|
if (debugPort !== -1) {
|
|
189
190
|
slaveOptions.push('--inspect-brk=' + debugPort);
|
|
190
191
|
}
|
|
191
192
|
slaveOptions.push(this.nodeInvoker[fnTarget.type]);
|
|
192
|
-
slaveOptions.push(JSON.stringify(
|
|
193
|
+
slaveOptions.push(JSON.stringify(slaveFnTarget));
|
|
193
194
|
slaveOptions.push(query);
|
|
194
195
|
slaveOptions.push(JSON.stringify({
|
|
195
196
|
'x-zc-projectid': request.headers['x-zc-projectid'],
|
|
@@ -232,7 +233,7 @@ class HttpFunctions {
|
|
|
232
233
|
}
|
|
233
234
|
slaveOptions.push((0, path_1.basename)(invoker));
|
|
234
235
|
slaveOptions.push(javaInvokerDir);
|
|
235
|
-
slaveOptions.push(JSON.stringify(
|
|
236
|
+
slaveOptions.push(JSON.stringify(slaveFnTarget));
|
|
236
237
|
slaveOptions.push(query);
|
|
237
238
|
slaveOptions.push(JSON.stringify({
|
|
238
239
|
'x-zc-projectid': request.headers['x-zc-projectid'],
|
|
@@ -95,12 +95,13 @@ class LocalFunction {
|
|
|
95
95
|
const debugPort = runtime_store_1.default.get('context.port.debug.' + constants_1.FN_TYPE.basic, null);
|
|
96
96
|
yield fs_1.ASYNC.ensureFile(this.responseFile, true);
|
|
97
97
|
yield fs_1.ASYNC.ensureFile(this.metaFile, true);
|
|
98
|
+
const slaveFnTarget = { index: this.target.index, name: this.target.name };
|
|
98
99
|
if ((_a = this.target.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.node.value)) {
|
|
99
100
|
if (debugPort !== null) {
|
|
100
101
|
slaveOptions.push('--inspect-brk=' + debugPort);
|
|
101
102
|
}
|
|
102
103
|
slaveOptions.push(this.nodeInvoker);
|
|
103
|
-
slaveOptions.push(JSON.stringify(
|
|
104
|
+
slaveOptions.push(JSON.stringify(slaveFnTarget));
|
|
104
105
|
slaveOptions.push(data);
|
|
105
106
|
slaveOptions.push(JSON.stringify({
|
|
106
107
|
'x-zc-projectid': (0, project_1.getProjectId)(),
|
|
@@ -132,7 +133,7 @@ class LocalFunction {
|
|
|
132
133
|
}
|
|
133
134
|
slaveOptions.push((0, path_1.basename)(this.javaInvoker));
|
|
134
135
|
slaveOptions.push(javaInvokerDir);
|
|
135
|
-
slaveOptions.push(JSON.stringify(
|
|
136
|
+
slaveOptions.push(JSON.stringify(slaveFnTarget));
|
|
136
137
|
slaveOptions.push(data);
|
|
137
138
|
slaveOptions.push(JSON.stringify({
|
|
138
139
|
'x-zc-projectid': (0, project_1.getProjectId)(),
|