zcatalyst-cli 1.13.3 → 1.14.1
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/docs/client-utils.toml +6 -1
- package/docs/commands/ds/import.toml +5 -0
- package/docs/fn-utils/lib/python.toml +4 -0
- package/docs/init/dependencies/python/ensure-python.toml +12 -0
- package/docs/init/dependencies/python/pip-install.toml +4 -0
- package/docs/serve/index.toml +5 -0
- package/lib/authentication/login.js +2 -1
- package/lib/cli_table/index.js +26 -2
- package/lib/cli_table/src/cell.js +359 -267
- package/lib/cli_table/src/layout-manager.js +231 -209
- package/lib/cli_table/src/table.js +76 -60
- package/lib/cli_table/src/utils.js +259 -224
- package/lib/client-utils.js +18 -4
- package/lib/command_needs/rc.js +57 -8
- package/lib/commands/config/delete.js +23 -0
- package/lib/commands/config/get.js +23 -0
- package/lib/commands/config/list.js +23 -0
- package/lib/commands/config/set.js +29 -0
- package/lib/commands/console/cache.js +31 -1
- package/lib/commands/console/queue.js +31 -1
- package/lib/commands/console/zcql.js +27 -1
- package/lib/commands/ds/export.js +2 -2
- package/lib/commands/ds/import.js +25 -5
- package/lib/commands/ds/status.js +2 -2
- package/lib/commands/iac/export.js +1 -1
- package/lib/commands/iac/import.js +1 -1
- package/lib/commands/iac/pack.js +16 -5
- package/lib/commands/iac/status.js +1 -1
- package/lib/commands/index.js +4 -0
- package/lib/commands/project/list.js +1 -1
- package/lib/commands/project/use.js +1 -1
- package/lib/deploy/features/client.js +2 -2
- package/lib/deploy/features/functions/index.js +13 -3
- package/lib/deploy/features/functions/languages/index.js +19 -2
- package/lib/endpoints/index.js +12 -5
- package/lib/endpoints/lib/env.js +5 -2
- package/lib/endpoints/lib/functions.js +30 -0
- package/lib/endpoints/lib/org.js +35 -0
- package/lib/endpoints/lib/project.js +7 -3
- package/lib/express_middlewares/unknownReqProxy.js +4 -1
- package/lib/fn-utils/index.js +2 -0
- package/lib/fn-utils/lib/common.js +68 -7
- package/lib/fn-utils/lib/integ.js +15 -11
- package/lib/fn-utils/lib/java.js +7 -3
- package/lib/fn-utils/lib/python.js +121 -0
- package/lib/fn-watcher.js +10 -2
- package/lib/index.js +2 -1
- package/lib/init/dependencies/python/ensure-python.js +151 -0
- package/lib/init/dependencies/python/pip-install.js +189 -0
- package/lib/init/features/functions/index.js +50 -29
- package/lib/init/features/functions/languages/index.js +3 -1
- package/lib/init/features/functions/languages/python.js +115 -0
- package/lib/init/features/index.js +2 -2
- package/lib/init/features/project.js +26 -6
- package/lib/init/util/project.js +2 -2
- package/lib/internal/api.js +2 -0
- package/lib/internal/command.js +1 -1
- package/lib/internal/rc.js +2 -0
- package/lib/port-resolver.js +4 -3
- package/lib/prompt/types/file-path.js +1 -1
- package/lib/pull/features/functions/index.js +35 -2
- package/lib/pull/features/functions/languages.js +8 -1
- package/lib/readLineUtils.js +37 -1
- package/lib/readline/features/cache.js +175 -1
- package/lib/readline/features/index.js +7 -1
- package/lib/readline/features/queue.js +209 -1
- package/lib/readline/features/zcql.js +237 -1
- package/lib/readline/index.js +30 -1
- package/lib/serve/index.js +48 -7
- package/lib/serve/server/index.js +118 -44
- package/lib/serve/server/lib/java/lib/catalyst-cli-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-function-sdk-1.0.0.jar +0 -0
- package/lib/serve/server/lib/java/lib/catalyst-java-runtime-1.0.0.jar +0 -0
- package/lib/serve/server/lib/master.js +18 -5
- package/lib/serve/server/lib/node.mjs +41 -0
- package/lib/serve/server/lib/web_client/index.js +7 -3
- package/lib/serve/server/lib/web_client/server.js +31 -15
- package/lib/shell/dependencies/http-functions.js +57 -21
- package/lib/shell/dependencies/invoker/bio/java/JavabioInvoker.java +1 -2
- package/lib/shell/dependencies/invoker/bio/node.mjs +127 -0
- package/lib/shell/dependencies/invoker/cron/java/JavacronInvoker.java +1 -1
- package/lib/shell/dependencies/invoker/cron/node.mjs +87 -0
- package/lib/shell/dependencies/invoker/event/java/JavaeventInvoker.java +3 -3
- package/lib/shell/dependencies/invoker/event/node.mjs +84 -0
- package/lib/shell/dependencies/invoker/integ/java/JavaintegInvoker.java +1 -1
- package/lib/shell/dependencies/invoker/integ/node.mjs +88 -0
- package/lib/shell/dependencies/local-function.js +74 -22
- package/lib/shell/index.js +11 -2
- package/lib/shell/prepare/index.js +21 -0
- package/lib/shell/prepare/languages/index.js +8 -2
- package/lib/shell/prepare/languages/java.js +39 -2
- package/lib/shell/prepare/languages/node.js +21 -2
- package/lib/shell/prepare/languages/python.js +65 -0
- package/lib/throbber/index.js +3 -1
- package/lib/userConfig.js +48 -0
- package/lib/util_modules/constants/index.js +3 -1
- package/lib/util_modules/constants/lib/apig-rules.js +8 -0
- package/lib/util_modules/constants/lib/cliq-handlers.js +17 -1
- package/lib/util_modules/constants/lib/dc-type.js +8 -0
- package/lib/util_modules/constants/lib/default.js +2 -2
- package/lib/util_modules/constants/lib/env-path.js +12 -0
- package/lib/util_modules/constants/lib/file-names.js +4 -1
- package/lib/util_modules/constants/lib/folder-names.js +3 -1
- package/lib/util_modules/constants/lib/placeholders.js +6 -1
- package/lib/util_modules/constants/lib/runtime.js +2 -1
- package/lib/util_modules/constants/lib/scopes.js +1 -0
- package/lib/util_modules/constants/lib/template.js +9 -0
- package/lib/util_modules/constants/lib/urls.js +2 -6
- package/lib/util_modules/context-help.js +2 -0
- package/lib/util_modules/fs/lib/async.js +35 -11
- package/lib/util_modules/project.js +20 -1
- package/package.json +2 -1
- package/templates/init/functions/java/aio/catalyst-config.json +3 -2
- package/templates/init/functions/java/bio/catalyst-config.json +3 -2
- package/templates/init/functions/java/cron/catalyst-config.json +3 -2
- package/templates/init/functions/java/event/catalyst-config.json +3 -2
- package/templates/init/functions/java/integ/cliq/catalyst-config.json +1 -0
- package/templates/init/functions/node/aio/catalyst-config.json +3 -2
- package/templates/init/functions/node/bio/catalyst-config.json +3 -2
- package/templates/init/functions/node/cron/catalyst-config.json +3 -2
- package/templates/init/functions/node/event/catalyst-config.json +3 -2
- package/templates/init/functions/node/integ/cliq/catalyst-config.json +1 -0
- package/templates/init/functions/node/integ/cliq/handlers/bot-handler.js +2 -2
- package/templates/init/functions/node/integ/cliq/handlers/command-handler.js +1 -2
- package/templates/init/functions/node/integ/cliq/handlers/function-handler.js +1 -1
- package/templates/init/functions/node/integ/cliq/handlers/installation-handler.js +1 -1
- package/templates/init/functions/node/integ/cliq/handlers/installation-validator.js +1 -1
- package/templates/init/functions/node/integ/cliq/handlers/message-action-handler.js +1 -1
- package/templates/init/functions/node/integ/cliq/handlers/widget-handler.js +1 -1
- package/templates/init/functions/node/integ/cliq/sample.js +4 -4
- package/templates/init/functions/python/aio/catalyst-config.json +11 -0
- package/templates/init/functions/python/aio/requirements.txt +1 -0
- package/templates/init/functions/python/aio/sample.py +26 -0
- package/templates/init/functions/python/bio/catalyst-config.json +11 -0
- package/templates/init/functions/python/bio/requirements.txt +1 -0
- package/templates/init/functions/python/bio/sample.py +6 -0
- package/templates/init/functions/python/cron/catalyst-config.json +11 -0
- package/templates/init/functions/python/cron/requirements.txt +1 -0
- package/templates/init/functions/python/cron/sample.py +18 -0
- package/templates/init/functions/python/event/catalyst-config.json +11 -0
- package/templates/init/functions/python/event/requirements.txt +1 -0
- package/templates/init/functions/python/event/sample.py +21 -0
- package/templates/init/functions/python/integ/cliq/catalyst-config.json +11 -0
- package/templates/init/functions/python/integ/cliq/handlers/bot_handler.py +174 -0
- package/templates/init/functions/python/integ/cliq/handlers/command_handler.py +102 -0
- package/templates/init/functions/python/integ/cliq/handlers/function_handler.py +409 -0
- package/templates/init/functions/python/integ/cliq/handlers/installation_handler.py +12 -0
- package/templates/init/functions/python/integ/cliq/handlers/installation_validator.py +16 -0
- package/templates/init/functions/python/integ/cliq/handlers/message_action_handler.py +18 -0
- package/templates/init/functions/python/integ/cliq/handlers/widget_handler.py +269 -0
- package/templates/init/functions/python/integ/cliq/requirements.txt +1 -0
- package/templates/init/functions/python/integ/cliq/sample.py +21 -0
- package/lib/serve/server/lib/node.js +0 -62
- package/lib/shell/dependencies/invoker/bio/node.js +0 -80
- package/lib/shell/dependencies/invoker/cron/node.js +0 -54
- package/lib/shell/dependencies/invoker/event/node.js +0 -56
- package/lib/shell/dependencies/invoker/integ/node.js +0 -79
- package/templates/.DS_Store +0 -0
- package/templates/init/.DS_Store +0 -0
- package/templates/init/client/.DS_Store +0 -0
- package/templates/init/client/react/.DS_Store +0 -0
- package/templates/init/functions/node/integ/cliq/.DS_Store +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.ensurePythonWithPip = exports.ensurePython = void 0;
|
|
16
|
+
const error_1 = __importDefault(require("../../../error"));
|
|
17
|
+
const prompt_1 = __importDefault(require("../../../prompt"));
|
|
18
|
+
const env_1 = require("../../../util_modules/env");
|
|
19
|
+
const shell_1 = require("../../../util_modules/shell");
|
|
20
|
+
const userConfig_1 = __importDefault(require("../../../userConfig"));
|
|
21
|
+
const ansi_colors_1 = require("ansi-colors");
|
|
22
|
+
const console_1 = require("console");
|
|
23
|
+
function ensurePython(version, fallBackNeeded, skipHelp) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const configKey = `python${version.replace('.', '_')}.bin`;
|
|
26
|
+
const spawnCommand = userConfig_1.default.get(configKey);
|
|
27
|
+
try {
|
|
28
|
+
if (spawnCommand) {
|
|
29
|
+
yield validateCommand(version, spawnCommand, true);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch (_a) { }
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
const child = (0, shell_1.spawn)('python' + version, ['--version'], {
|
|
36
|
+
stdio: 'ignore'
|
|
37
|
+
}).RAW();
|
|
38
|
+
child.on('error', (error) => __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (env_1.isWindows) {
|
|
40
|
+
try {
|
|
41
|
+
yield (0, shell_1.spawn)('py -' + version, ['--version'], {
|
|
42
|
+
stdio: 'ignore'
|
|
43
|
+
}).ASYNC();
|
|
44
|
+
userConfig_1.default.set(configKey, 'py -' + version);
|
|
45
|
+
return resolve();
|
|
46
|
+
}
|
|
47
|
+
catch (_a) { }
|
|
48
|
+
}
|
|
49
|
+
if (fallBackNeeded) {
|
|
50
|
+
(0, console_1.info)(`unable to locate python${version} in your system`);
|
|
51
|
+
const ans = yield prompt_1.default.ask(prompt_1.default.question('binPath', `Please provide the binary path for python${version}:`, {
|
|
52
|
+
type: 'input'
|
|
53
|
+
}));
|
|
54
|
+
yield validateCommand(version, ans.binPath, skipHelp)
|
|
55
|
+
.then(() => {
|
|
56
|
+
userConfig_1.default.set(`python${version.replace('.', '_')}.bin`, ans.binPath);
|
|
57
|
+
resolve();
|
|
58
|
+
})
|
|
59
|
+
.catch((err) => {
|
|
60
|
+
reject(err);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
reject(new error_1.default(`unable to locate python${version} in your system`, {
|
|
65
|
+
original: error,
|
|
66
|
+
exit: 1,
|
|
67
|
+
errorId: 'PY-2',
|
|
68
|
+
arg: [
|
|
69
|
+
version,
|
|
70
|
+
(0, ansi_colors_1.italic)((0, ansi_colors_1.bold)(`catalyst config:set ${configKey}=<binary_path>`))
|
|
71
|
+
],
|
|
72
|
+
skipHelp
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
child.on('exit', (code) => {
|
|
77
|
+
if (code == 0) {
|
|
78
|
+
userConfig_1.default.set(configKey, 'python' + version);
|
|
79
|
+
}
|
|
80
|
+
resolve();
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
exports.ensurePython = ensurePython;
|
|
86
|
+
function validateCommand(version, spawnCommand, skipHelp) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const versionResponse = yield new Promise((resolve, reject) => {
|
|
89
|
+
var _a;
|
|
90
|
+
const child = (0, shell_1.spawn)(spawnCommand, ['--version'], {
|
|
91
|
+
stdio: 'pipe'
|
|
92
|
+
}).RAW();
|
|
93
|
+
const dataBuf = [];
|
|
94
|
+
(_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (chunk) => {
|
|
95
|
+
dataBuf.push(chunk);
|
|
96
|
+
});
|
|
97
|
+
child.on('exit', (code) => {
|
|
98
|
+
if (code == 0) {
|
|
99
|
+
const data = Buffer.concat(dataBuf).toString();
|
|
100
|
+
return resolve(data);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
reject(new error_1.default(`unable to locate python${version} with the given binary path`, {
|
|
104
|
+
exit: 1,
|
|
105
|
+
errorId: 'PY-1',
|
|
106
|
+
arg: [version, (0, ansi_colors_1.bold)(spawnCommand)],
|
|
107
|
+
skipHelp
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
child.on('error', (err) => {
|
|
112
|
+
reject(new error_1.default(`unable to locate python${version} with the given binary path`, {
|
|
113
|
+
errorId: 'PY-1',
|
|
114
|
+
original: err,
|
|
115
|
+
exit: 1,
|
|
116
|
+
arg: [version, (0, ansi_colors_1.bold)(spawnCommand)],
|
|
117
|
+
skipHelp
|
|
118
|
+
}));
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
if (!versionResponse.split(' ')[1].startsWith(version)) {
|
|
122
|
+
throw new error_1.default(`unable to locate python${version} with the given binary path`, {
|
|
123
|
+
exit: 1,
|
|
124
|
+
errorId: 'PY-1',
|
|
125
|
+
arg: [version, (0, ansi_colors_1.bold)(spawnCommand)],
|
|
126
|
+
skipHelp
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
function ensurePythonWithPip(version, fallBackNeeded = false, skipHelp = false) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
yield ensurePython(version, fallBackNeeded, skipHelp);
|
|
134
|
+
return new Promise((resolve, reject) => {
|
|
135
|
+
const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${version.replace('.', '_')}.bin`), ['-m', 'pip', '--version'], {
|
|
136
|
+
stdio: 'ignore'
|
|
137
|
+
}).RAW();
|
|
138
|
+
child.on('error', (err) => {
|
|
139
|
+
reject(new error_1.default(`unable to ensure pip for python${version}`, {
|
|
140
|
+
errorId: 'PIP',
|
|
141
|
+
original: err,
|
|
142
|
+
arg: [version],
|
|
143
|
+
exit: 1,
|
|
144
|
+
skipHelp
|
|
145
|
+
}));
|
|
146
|
+
});
|
|
147
|
+
child.on('exit', resolve);
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
exports.ensurePythonWithPip = ensurePythonWithPip;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.installRequirements = exports.pypiRes = exports.ensurePyRuntime = void 0;
|
|
16
|
+
const error_1 = __importDefault(require("../../../error"));
|
|
17
|
+
const prompt_1 = __importDefault(require("../../../prompt"));
|
|
18
|
+
const shell_1 = require("../../../util_modules/shell");
|
|
19
|
+
const constants_1 = require("../../../util_modules/constants");
|
|
20
|
+
const path_1 = require("path");
|
|
21
|
+
const fs_1 = require("../../../util_modules/fs");
|
|
22
|
+
const https_1 = __importDefault(require("https"));
|
|
23
|
+
const runtime_1 = __importDefault(require("../../../util_modules/constants/lib/runtime"));
|
|
24
|
+
const env_1 = require("../../../util_modules/env");
|
|
25
|
+
const ensure_python_1 = require("./ensure-python");
|
|
26
|
+
const userConfig_1 = __importDefault(require("../../../userConfig"));
|
|
27
|
+
const sdkPipOpts = (0, env_1.envOverride)('CATALYST_SDK_PIP_OPTS', 'zcatalyst-sdk');
|
|
28
|
+
const cliqSdkPipOpts = (0, env_1.envOverride)('CATALYST_CLIQ_SDK_PIP_OPTS', 'zcatalyst-cliq');
|
|
29
|
+
const testPypi = (0, env_1.envOverride)('CATALYST_TEST_PYPI', 'false');
|
|
30
|
+
exports.default = (pth, stack, isIntegFn = false, integService = false) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
|
+
const stackVersion = stack.replace('python_', '');
|
|
32
|
+
const ans = yield prompt_1.default.ask(prompt_1.default.question('pipInstall', 'Do you wish to install all dependency libraries now ? ', {
|
|
33
|
+
type: 'confirm',
|
|
34
|
+
defaultAns: true,
|
|
35
|
+
when: () => !isIntegFn
|
|
36
|
+
}));
|
|
37
|
+
if (ans.pipInstall && !isIntegFn) {
|
|
38
|
+
yield (0, ensure_python_1.ensurePythonWithPip)(stackVersion.replace('_', '.'), true);
|
|
39
|
+
const spawnOpts = ['-m', 'pip', 'install', ...sdkPipOpts.split(' '), '-t', '.'];
|
|
40
|
+
return (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
|
|
41
|
+
cwd: pth
|
|
42
|
+
})
|
|
43
|
+
.ASYNC()
|
|
44
|
+
.catch((err) => {
|
|
45
|
+
throw new error_1.default('Failure while installing zcatalyst SDk', {
|
|
46
|
+
exit: 2,
|
|
47
|
+
original: err
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
else if ((isIntegFn || ans.pipInstall === undefined) &&
|
|
52
|
+
integService === constants_1.INTEG.services.cliq) {
|
|
53
|
+
yield (0, ensure_python_1.ensurePythonWithPip)(stackVersion.replace('_', '.'), true);
|
|
54
|
+
const spawnOpts = ['-m', 'pip', 'install', ...cliqSdkPipOpts.split(' '), '-t', '.'];
|
|
55
|
+
return (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, { cwd: pth })
|
|
56
|
+
.ASYNC()
|
|
57
|
+
.catch((err) => {
|
|
58
|
+
throw error_1.default.getErrorInstance(err, {
|
|
59
|
+
message: 'Failure while installing zcatalyst cliq SDK.'
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
function ensurePyRuntime(pth, stack) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const stackVersion = stack.replace('python_', '');
|
|
67
|
+
const runtimePkgName = 'zcatalyst-runtime-' + stackVersion.replace('_', '');
|
|
68
|
+
yield fs_1.ASYNC.ensureDir(pth);
|
|
69
|
+
const runtimeDir = (0, path_1.join)(pth, runtime_1.default.language.python, `zcatalyst_runtime_${stackVersion.replace('_', '')}`);
|
|
70
|
+
const isInitializerExists = yield fs_1.ASYNC.fileExists((0, path_1.join)(runtimeDir, 'main.py'));
|
|
71
|
+
if (isInitializerExists) {
|
|
72
|
+
const runtimeMetaData = yield fs_1.ASYNC.readJSONFile((0, path_1.join)(runtimeDir, 'meta.json'));
|
|
73
|
+
const pyRespJson = yield (0, exports.pypiRes)(runtimePkgName);
|
|
74
|
+
if ((runtimeMetaData === null || runtimeMetaData === void 0 ? void 0 : runtimeMetaData.version) == pyRespJson.info.version) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
yield new Promise((resolve, reject) => {
|
|
79
|
+
var _a;
|
|
80
|
+
const spawnOpts = ['-m', 'pip', 'install', runtimePkgName, '--upgrade', '-t', './python'];
|
|
81
|
+
if (testPypi === 'true') {
|
|
82
|
+
spawnOpts.push('-i', 'https://test.pypi.org/simple/', '--extra-index-url', 'https://pypi.org/simple/');
|
|
83
|
+
}
|
|
84
|
+
const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
|
|
85
|
+
cwd: pth,
|
|
86
|
+
stdio: 'pipe'
|
|
87
|
+
}).RAW();
|
|
88
|
+
const errData = [];
|
|
89
|
+
(_a = child.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (chunk) => {
|
|
90
|
+
errData.push(chunk);
|
|
91
|
+
});
|
|
92
|
+
child.on('error', (err) => {
|
|
93
|
+
reject(new error_1.default(`Error while installing python${stackVersion.replace('_', '.')} runtime`, {
|
|
94
|
+
original: err,
|
|
95
|
+
exit: 2
|
|
96
|
+
}));
|
|
97
|
+
});
|
|
98
|
+
child.on('exit', (code) => {
|
|
99
|
+
if (code != 0) {
|
|
100
|
+
process.stderr.write(Buffer.concat(errData).toString());
|
|
101
|
+
reject(new error_1.default(`Error while installing python${stackVersion.replace('_', '.')} runtime`, {
|
|
102
|
+
exit: 1
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
resolve();
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
try {
|
|
109
|
+
const runtimeReqFile = (0, path_1.join)(runtimeDir, constants_1.FILENAME.functions.python_requirements);
|
|
110
|
+
if (yield fs_1.ASYNC.fileExists(runtimeReqFile)) {
|
|
111
|
+
yield installRequirements(runtimeReqFile, runtimeDir, stackVersion);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
yield fs_1.ASYNC.deleteDir(runtimeDir);
|
|
116
|
+
throw new error_1.default(`Error while installing python${stackVersion.replace('_', '.')} runtime dependencies`);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
exports.ensurePyRuntime = ensurePyRuntime;
|
|
121
|
+
const pypiRes = (pkg) => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
+
const url = testPypi === 'true'
|
|
123
|
+
? `https://test.pypi.org/pypi/${pkg}/json`
|
|
124
|
+
: `https://pypi.org/pypi/${pkg}/json`;
|
|
125
|
+
return new Promise((res) => {
|
|
126
|
+
https_1.default
|
|
127
|
+
.get(url, (resp) => {
|
|
128
|
+
const resBuffer = [];
|
|
129
|
+
resp.on('data', (chunk) => {
|
|
130
|
+
resBuffer.push(chunk);
|
|
131
|
+
});
|
|
132
|
+
resp.on('end', () => {
|
|
133
|
+
res(JSON.parse(Buffer.concat(resBuffer).toString()));
|
|
134
|
+
});
|
|
135
|
+
})
|
|
136
|
+
.on('error', (e) => {
|
|
137
|
+
throw new error_1.default('Error getting latest runtime version', {
|
|
138
|
+
original: e,
|
|
139
|
+
exit: 2
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
exports.pypiRes = pypiRes;
|
|
145
|
+
function installRequirements(reqFile, pth, stackVersion, linuxMode = false) {
|
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
147
|
+
const spawnOpts = ['-m', 'pip', 'install', '-r', reqFile, '-t', '.', '--upgrade'];
|
|
148
|
+
if (linuxMode) {
|
|
149
|
+
spawnOpts.push(...[
|
|
150
|
+
'--platform',
|
|
151
|
+
'manylinux2014_x86_64',
|
|
152
|
+
'--implementation',
|
|
153
|
+
'cp',
|
|
154
|
+
'--only-binary=:all:'
|
|
155
|
+
]);
|
|
156
|
+
}
|
|
157
|
+
if (testPypi === 'true') {
|
|
158
|
+
spawnOpts.push('-i', 'https://test.pypi.org/simple/', '--extra-index-url', 'https://pypi.org/simple/');
|
|
159
|
+
}
|
|
160
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
var _a;
|
|
162
|
+
const child = (0, shell_1.spawn)(userConfig_1.default.get(`python${stackVersion}.bin`), spawnOpts, {
|
|
163
|
+
cwd: pth,
|
|
164
|
+
stdio: 'pipe'
|
|
165
|
+
}).RAW();
|
|
166
|
+
const errData = [];
|
|
167
|
+
(_a = child.stderr) === null || _a === void 0 ? void 0 : _a.on('data', (chunk) => {
|
|
168
|
+
errData.push(chunk);
|
|
169
|
+
});
|
|
170
|
+
child.on('error', (err) => {
|
|
171
|
+
reject(new error_1.default('unable to process requirements.txt', {
|
|
172
|
+
exit: 2,
|
|
173
|
+
original: err
|
|
174
|
+
}));
|
|
175
|
+
});
|
|
176
|
+
child.on('exit', (code) => {
|
|
177
|
+
if (code != 0) {
|
|
178
|
+
process.stderr.write(Buffer.concat(errData).toString());
|
|
179
|
+
reject(new error_1.default('unable to process requirements.txt', {
|
|
180
|
+
exit: 1,
|
|
181
|
+
skipHelp: true
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
resolve();
|
|
185
|
+
});
|
|
186
|
+
}));
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
exports.installRequirements = installRequirements;
|
|
@@ -13,6 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const ansi_colors_1 = require("ansi-colors");
|
|
16
|
+
const dc_1 = require("../../../dc");
|
|
16
17
|
const catalyst_details_1 = __importDefault(require("../../../endpoints/lib/catalyst-details"));
|
|
17
18
|
const integ_1 = require("../../../fn-utils/lib/integ");
|
|
18
19
|
const prompt_1 = __importDefault(require("../../../prompt"));
|
|
@@ -20,6 +21,7 @@ const runtime_store_1 = __importDefault(require("../../../runtime-store"));
|
|
|
20
21
|
const char_1 = require("../../../util_modules/char");
|
|
21
22
|
const constants_1 = require("../../../util_modules/constants");
|
|
22
23
|
const fs_1 = require("../../../util_modules/fs");
|
|
24
|
+
const js_1 = require("../../../util_modules/js");
|
|
23
25
|
const logger_1 = require("../../../util_modules/logger");
|
|
24
26
|
const option_1 = require("../../../util_modules/option");
|
|
25
27
|
const project_1 = require("../../../util_modules/project");
|
|
@@ -49,30 +51,33 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
49
51
|
}
|
|
50
52
|
const catalystDetailsAPI = new catalyst_details_1.default();
|
|
51
53
|
const runtimeDetailsPromise = catalystDetailsAPI.getDetails('runtime');
|
|
54
|
+
const fnTypeChoices = [
|
|
55
|
+
prompt_1.default.choice('BasicIO', {
|
|
56
|
+
value: constants_1.FN_TYPE.basic,
|
|
57
|
+
short: 'basicIO'
|
|
58
|
+
}),
|
|
59
|
+
prompt_1.default.choice('AdvancedIO', {
|
|
60
|
+
value: constants_1.FN_TYPE.advanced,
|
|
61
|
+
short: 'advancedIO'
|
|
62
|
+
}),
|
|
63
|
+
prompt_1.default.choice('Event', {
|
|
64
|
+
value: constants_1.FN_TYPE.event,
|
|
65
|
+
short: 'event'
|
|
66
|
+
}),
|
|
67
|
+
prompt_1.default.choice('Cron', {
|
|
68
|
+
value: constants_1.FN_TYPE.cron,
|
|
69
|
+
short: 'cron'
|
|
70
|
+
})
|
|
71
|
+
];
|
|
72
|
+
if ((0, dc_1.getActiveDC)() === constants_1.DC_TYPE.us.value) {
|
|
73
|
+
fnTypeChoices.push(prompt_1.default.choice('Integration', {
|
|
74
|
+
value: constants_1.FN_TYPE.integration,
|
|
75
|
+
short: 'integration'
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
52
78
|
const fnTypeAns = yield prompt_1.default.ask(prompt_1.default.question('type', 'Which type of function do you like to create?', {
|
|
53
79
|
type: 'list',
|
|
54
|
-
choices:
|
|
55
|
-
prompt_1.default.choice('BasicIO', {
|
|
56
|
-
value: constants_1.FN_TYPE.basic,
|
|
57
|
-
short: 'basicIO'
|
|
58
|
-
}),
|
|
59
|
-
prompt_1.default.choice('AdvancedIO', {
|
|
60
|
-
value: constants_1.FN_TYPE.advanced,
|
|
61
|
-
short: 'advancedIO'
|
|
62
|
-
}),
|
|
63
|
-
prompt_1.default.choice('Event', {
|
|
64
|
-
value: constants_1.FN_TYPE.event,
|
|
65
|
-
short: 'event'
|
|
66
|
-
}),
|
|
67
|
-
prompt_1.default.choice('Cron', {
|
|
68
|
-
value: constants_1.FN_TYPE.cron,
|
|
69
|
-
short: 'cron'
|
|
70
|
-
}),
|
|
71
|
-
prompt_1.default.choice('Integration', {
|
|
72
|
-
value: constants_1.FN_TYPE.integration,
|
|
73
|
-
short: 'integration'
|
|
74
|
-
})
|
|
75
|
-
]
|
|
80
|
+
choices: fnTypeChoices
|
|
76
81
|
}));
|
|
77
82
|
runtime_store_1.default.set('context.functions.type', fnTypeAns.type);
|
|
78
83
|
if (fnTypeAns.type === constants_1.FN_TYPE.integration) {
|
|
@@ -80,14 +85,21 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
80
85
|
}
|
|
81
86
|
const runtimeDetails = (yield runtimeDetailsPromise);
|
|
82
87
|
const runtimeChoices = runtimeDetails.runtimes.reduce((acc, value) => {
|
|
83
|
-
const langArr = value.match(
|
|
84
|
-
if (langArr === null ||
|
|
88
|
+
const langArr = value.match(/^([a-zA-Z]+)([0-9_]+)$/);
|
|
89
|
+
if (langArr === null ||
|
|
90
|
+
languages_1.default[langArr[1]] === undefined) {
|
|
85
91
|
(0, logger_1.debug)('Language cannot be identified hence skipping');
|
|
86
92
|
return acc;
|
|
87
93
|
}
|
|
88
|
-
const runtimeLang = langArr[
|
|
94
|
+
const runtimeLang = langArr[1];
|
|
89
95
|
const langFn = languages_1.default[runtimeLang];
|
|
90
96
|
let displayValue = value;
|
|
97
|
+
if (displayValue.startsWith('python')) {
|
|
98
|
+
displayValue = 'Python ' + displayValue.replace('python_', '').replace('_', '.');
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
displayValue = js_1.JS.startCase(langArr[1]) + ' ' + langArr[2];
|
|
102
|
+
}
|
|
91
103
|
let disabled = false;
|
|
92
104
|
if (runtimeDetails.eol_runtimes && runtimeDetails.eol_runtimes[value]) {
|
|
93
105
|
switch (runtimeDetails.eol_runtimes[value]) {
|
|
@@ -110,14 +122,23 @@ exports.default = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
110
122
|
if (acc[runtimeLang].length === 0) {
|
|
111
123
|
const sep = {
|
|
112
124
|
node: '---NodeJS---',
|
|
113
|
-
java: '----Java----'
|
|
125
|
+
java: '----Java----',
|
|
126
|
+
python: '----Python----'
|
|
114
127
|
};
|
|
115
128
|
acc[runtimeLang].push(prompt_1.default.separator(sep[runtimeLang]));
|
|
116
129
|
}
|
|
117
|
-
acc[runtimeLang].push(prompt_1.default.choice(displayValue, { value: langFn(value), short:
|
|
130
|
+
acc[runtimeLang].push(prompt_1.default.choice(displayValue, { value: langFn(value), short: displayValue, disabled }));
|
|
118
131
|
return acc;
|
|
119
|
-
}, {
|
|
120
|
-
|
|
132
|
+
}, {
|
|
133
|
+
node: [],
|
|
134
|
+
java: [],
|
|
135
|
+
python: []
|
|
136
|
+
});
|
|
137
|
+
const runtimeChoicesArr = [
|
|
138
|
+
...runtimeChoices.python,
|
|
139
|
+
...runtimeChoices.java,
|
|
140
|
+
...runtimeChoices.node
|
|
141
|
+
];
|
|
121
142
|
const runtimeAns = yield prompt_1.default.ask(prompt_1.default.question('runtime', 'Which runtime do you prefer to write your function?', {
|
|
122
143
|
type: 'list',
|
|
123
144
|
choices: runtimeChoicesArr,
|
|
@@ -5,7 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const java_1 = __importDefault(require("./java"));
|
|
7
7
|
const node_1 = __importDefault(require("./node"));
|
|
8
|
+
const python_1 = __importDefault(require("./python"));
|
|
8
9
|
exports.default = {
|
|
9
10
|
node: node_1.default,
|
|
10
|
-
java: java_1.default
|
|
11
|
+
java: java_1.default,
|
|
12
|
+
python: python_1.default
|
|
11
13
|
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const ansi_colors_1 = require("ansi-colors");
|
|
16
|
+
const path_1 = require("path");
|
|
17
|
+
const prompt_1 = __importDefault(require("../../../../prompt"));
|
|
18
|
+
const fn_utils_1 = require("../../../../fn-utils");
|
|
19
|
+
const runtime_store_1 = __importDefault(require("../../../../runtime-store"));
|
|
20
|
+
const constants_1 = require("../../../../util_modules/constants");
|
|
21
|
+
const fs_1 = require("../../../../util_modules/fs");
|
|
22
|
+
const logger_1 = require("../../../../util_modules/logger");
|
|
23
|
+
const js_1 = require("../../../../util_modules/js");
|
|
24
|
+
const integ_1 = require("../../../../fn-utils/lib/integ");
|
|
25
|
+
const runtime_1 = __importDefault(require("../../../../util_modules/constants/lib/runtime"));
|
|
26
|
+
const functions_1 = require("../../../util/functions");
|
|
27
|
+
const project_1 = require("../../../../util_modules/project");
|
|
28
|
+
const ensure_python_1 = require("../../../dependencies/python/ensure-python");
|
|
29
|
+
const error_1 = __importDefault(require("../../../../error"));
|
|
30
|
+
const pip_install_1 = require("../../../dependencies/python/pip-install");
|
|
31
|
+
const cli_table_1 = require("../../../../cli_table");
|
|
32
|
+
const char_1 = require("../../../../util_modules/char");
|
|
33
|
+
exports.default = (stack) => () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
const fnType = runtime_store_1.default.get('context.functions.type');
|
|
35
|
+
const fnDirPath = runtime_store_1.default.get('context.functions.dir_path');
|
|
36
|
+
yield fs_1.ASYNC.ensureDir(fnDirPath);
|
|
37
|
+
const service = runtime_store_1.default.get('context.functions.integration.service', '');
|
|
38
|
+
const templatePath = fnType === constants_1.FN_TYPE.integration
|
|
39
|
+
? js_1.JS.get(constants_1.TEMPLATE.functions.python[fnType], service)
|
|
40
|
+
: constants_1.TEMPLATE.functions.python[fnType];
|
|
41
|
+
const functionAns = yield prompt_1.default.ask(prompt_1.default.question('name', 'package name: ', {
|
|
42
|
+
defaultAns: js_1.JS.snakeCase((0, project_1.getProjectName)('sample') + '_function'),
|
|
43
|
+
validate: (ans) => {
|
|
44
|
+
if (ans.match(constants_1.REGEX.folder_name)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return 'Invalid package name';
|
|
48
|
+
}
|
|
49
|
+
}), prompt_1.default.question('main', 'entry point: ', {
|
|
50
|
+
defaultAns: 'main.py',
|
|
51
|
+
validate: (ans) => {
|
|
52
|
+
if (js_1.JS.endsWith(ans, '.py')) {
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
return 'Invalid entry point';
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
const targetPath = (0, path_1.join)(fnDirPath, functionAns.name);
|
|
59
|
+
const dirExists = yield fs_1.ASYNC.dirExists(targetPath);
|
|
60
|
+
const overwriteAns = dirExists
|
|
61
|
+
? yield prompt_1.default.ask(prompt_1.default.question('overwrite', 'Directory ' +
|
|
62
|
+
(0, ansi_colors_1.underline)(functionAns.name) +
|
|
63
|
+
' already exists inside functions directory. Overwrite ?', {
|
|
64
|
+
type: 'confirm',
|
|
65
|
+
defaultAns: false
|
|
66
|
+
}))
|
|
67
|
+
: { overwrite: true };
|
|
68
|
+
if (!overwriteAns.overwrite) {
|
|
69
|
+
(0, logger_1.warning)('Skipping functions python setup...');
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
yield fs_1.ASYNC.deleteDir(targetPath).catch();
|
|
73
|
+
if (fnType === constants_1.FN_TYPE.integration) {
|
|
74
|
+
yield (0, integ_1.copyIntegHandlers)(templatePath, targetPath, runtime_1.default.language.python);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
yield fs_1.ASYNC.copyDir(templatePath, targetPath);
|
|
78
|
+
}
|
|
79
|
+
const pyRespJson = fnType === constants_1.FN_TYPE.integration
|
|
80
|
+
? yield (0, pip_install_1.pypiRes)('zcatalyst-cliq')
|
|
81
|
+
: yield (0, pip_install_1.pypiRes)('zcatalyst-sdk');
|
|
82
|
+
yield fs_1.ASYNC.findAndReplace(targetPath)([
|
|
83
|
+
constants_1.PLACEHOLDER.functions.python_package.name,
|
|
84
|
+
constants_1.PLACEHOLDER.functions.python_package.main,
|
|
85
|
+
constants_1.PLACEHOLDER.functions.python_package.sdkVersion
|
|
86
|
+
], [
|
|
87
|
+
functionAns.name,
|
|
88
|
+
functionAns.main,
|
|
89
|
+
pyRespJson.info.version
|
|
90
|
+
]);
|
|
91
|
+
yield fs_1.ASYNC.rename((0, path_1.join)(targetPath, constants_1.FILENAME.functions.python_main), () => functionAns.main);
|
|
92
|
+
const integ_config = runtime_store_1.default.get('context.functions.integration.config', '');
|
|
93
|
+
yield fn_utils_1.fnUtils.common.findAndReplaceConfigProps(targetPath, {
|
|
94
|
+
stack,
|
|
95
|
+
type: fnType,
|
|
96
|
+
integ_config
|
|
97
|
+
});
|
|
98
|
+
const stackVersion = stack.replace('python_', '');
|
|
99
|
+
try {
|
|
100
|
+
yield (0, ensure_python_1.ensurePython)(stackVersion.replace('_', '.'), false, true);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
const error = error_1.default.getErrorInstance(err);
|
|
104
|
+
const table = (0, cli_table_1.getCustomColourTable)(ansi_colors_1.yellow);
|
|
105
|
+
table.push([
|
|
106
|
+
(0, ansi_colors_1.yellow)(char_1.CHAR.warning + ' ') +
|
|
107
|
+
error.message +
|
|
108
|
+
'\n' +
|
|
109
|
+
`you can set it later with the command ` +
|
|
110
|
+
`"${(0, ansi_colors_1.italic)((0, ansi_colors_1.bold)(`catalyst config:set python${stackVersion}.bin=<binary_path>`))}"`
|
|
111
|
+
]);
|
|
112
|
+
(0, logger_1.info)(table.toString());
|
|
113
|
+
}
|
|
114
|
+
return (0, functions_1.fillFunctionsInitPayload)(targetPath, functionAns.name, stack, fnType);
|
|
115
|
+
});
|
|
@@ -85,7 +85,7 @@ function setFnConfig(featureName, add) {
|
|
|
85
85
|
case 'functions':
|
|
86
86
|
if (!add) {
|
|
87
87
|
config.set(featureName + '.targets', [context.name]);
|
|
88
|
-
config.set(featureName + '.ignore', ((_a = context.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.java)) ? [
|
|
88
|
+
config.set(featureName + '.ignore', ((_a = context.stack) === null || _a === void 0 ? void 0 : _a.startsWith(runtime_1.default.language.java)) ? [constants_1.FOLDERNAME.output] : []);
|
|
89
89
|
config.set(featureName + '.source', targetSource);
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
@@ -93,7 +93,7 @@ function setFnConfig(featureName, add) {
|
|
|
93
93
|
config.set(featureName + '.targets', js_1.JS.uniq(targetArr.concat([context.name])));
|
|
94
94
|
const ignoreArr = config.get(featureName + '.ignore', []);
|
|
95
95
|
config.set(featureName + '.ignore', ((_b = context.stack) === null || _b === void 0 ? void 0 : _b.startsWith(runtime_1.default.language.java))
|
|
96
|
-
? js_1.JS.uniq(ignoreArr.concat([
|
|
96
|
+
? js_1.JS.uniq(ignoreArr.concat([constants_1.FOLDERNAME.output]))
|
|
97
97
|
: ignoreArr);
|
|
98
98
|
if (config.get(featureName + '.source') !== targetSource) {
|
|
99
99
|
(0, logger_1.warning)(featureName + ' source has been modified');
|