esa-cli 0.0.2-beta.2 → 0.0.2-beta.21
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/dist/commands/commit/index.js +45 -117
- package/dist/commands/commit/prodBuild.js +2 -3
- package/dist/commands/common/constant.js +0 -19
- package/dist/commands/common/utils.js +419 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy/helper.js +51 -72
- package/dist/commands/deploy/index.js +48 -187
- package/dist/commands/deployments/delete.js +32 -22
- package/dist/commands/deployments/index.js +3 -3
- package/dist/commands/deployments/list.js +22 -38
- package/dist/commands/dev/build.js +3 -3
- package/dist/commands/dev/doProcess.js +5 -5
- package/dist/commands/dev/ew2/cacheService.js +33 -0
- package/dist/commands/dev/ew2/devEntry.js +2 -1
- package/dist/commands/dev/ew2/devPack.js +30 -34
- package/dist/commands/dev/ew2/kvService.js +46 -0
- package/dist/commands/dev/ew2/mock/cache.js +99 -15
- package/dist/commands/dev/ew2/mock/kv.js +142 -21
- package/dist/commands/dev/ew2/server.js +165 -28
- package/dist/commands/dev/index.js +16 -16
- package/dist/commands/dev/mockWorker/devPack.js +32 -21
- package/dist/commands/dev/mockWorker/server.js +7 -6
- package/dist/commands/domain/add.js +3 -3
- package/dist/commands/domain/delete.js +7 -7
- package/dist/commands/domain/index.js +3 -3
- package/dist/commands/domain/list.js +10 -10
- package/dist/commands/init/helper.js +761 -0
- package/dist/commands/init/index.js +88 -220
- package/dist/commands/init/snippets/nextjs/next.config.mjs +6 -0
- package/dist/commands/init/snippets/nextjs/next.config.ts +7 -0
- package/dist/commands/init/snippets/react-router/react-router.config.ts +7 -0
- package/dist/commands/init/template.jsonc +84 -0
- package/dist/commands/init/types.js +1 -0
- package/dist/commands/lang.js +2 -2
- package/dist/commands/login/index.js +74 -34
- package/dist/commands/logout.js +6 -6
- package/dist/commands/route/add.js +138 -49
- package/dist/commands/route/delete.js +33 -27
- package/dist/commands/route/helper.js +124 -0
- package/dist/commands/route/index.js +3 -3
- package/dist/commands/route/list.js +56 -17
- package/dist/commands/routine/delete.js +2 -2
- package/dist/commands/routine/index.js +3 -3
- package/dist/commands/routine/list.js +9 -21
- package/dist/commands/site/index.js +2 -2
- package/dist/commands/site/list.js +6 -7
- package/dist/commands/utils.js +55 -19
- package/dist/components/descriptionInput.js +1 -1
- package/dist/components/mutiLevelSelect.js +43 -55
- package/dist/components/mutiSelectTable.js +1 -1
- package/dist/components/selectInput.js +2 -3
- package/dist/components/selectItem.js +1 -1
- package/dist/docs/Commands_en.md +142 -131
- package/dist/docs/Commands_zh_CN.md +139 -127
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/locales.json +401 -21
- package/dist/index.js +27 -20
- package/dist/libs/api.js +32 -9
- package/dist/libs/apiService.js +262 -84
- package/dist/libs/git/index.js +86 -9
- package/dist/libs/interface.js +0 -1
- package/dist/libs/logger.js +162 -10
- package/dist/libs/service.js +2 -2
- package/dist/libs/templates/index.js +3 -2
- package/dist/utils/checkAssetsExist.js +80 -0
- package/dist/utils/checkDevPort.js +3 -17
- package/dist/utils/checkEntryFileExist.js +10 -0
- package/dist/utils/checkIsRoutineCreated.js +27 -26
- package/dist/utils/checkVersion.js +119 -1
- package/dist/utils/command.js +149 -0
- package/dist/utils/compress.js +136 -0
- package/dist/utils/download.js +182 -0
- package/dist/utils/fileMd5.js +1 -1
- package/dist/utils/fileUtils/base.js +1 -1
- package/dist/utils/fileUtils/index.js +69 -28
- package/dist/utils/installDeno.js +8 -8
- package/dist/utils/installEw2.js +7 -7
- package/dist/utils/openInBrowser.js +1 -1
- package/dist/utils/prompt.js +97 -0
- package/package.json +20 -12
|
@@ -7,25 +7,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
var t = {};
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
15
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
16
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17
|
-
t[p[i]] = s[p[i]];
|
|
18
|
-
}
|
|
19
|
-
return t;
|
|
20
|
-
};
|
|
10
|
+
import chalk from 'chalk';
|
|
21
11
|
import Table from 'cli-table3';
|
|
12
|
+
import moment from 'moment';
|
|
13
|
+
import t from '../../i18n/index.js';
|
|
14
|
+
import { ApiService } from '../../libs/apiService.js';
|
|
22
15
|
import logger from '../../libs/logger.js';
|
|
23
|
-
import { Base64 } from 'js-base64';
|
|
24
16
|
import { checkIsLoginSuccess } from '../utils.js';
|
|
25
|
-
import chalk from 'chalk';
|
|
26
|
-
import { ApiService } from '../../libs/apiService.js';
|
|
27
|
-
import t from '../../i18n/index.js';
|
|
28
|
-
import moment from 'moment';
|
|
29
17
|
const list = {
|
|
30
18
|
command: 'list',
|
|
31
19
|
describe: `📋 ${t('list_describe').d('List all your routines')}`,
|
|
@@ -39,8 +27,8 @@ const list = {
|
|
|
39
27
|
export default list;
|
|
40
28
|
export function handleList(argv) {
|
|
41
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
var _a;
|
|
43
|
-
const { site } = argv
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const { site } = argv;
|
|
44
32
|
const isSuccess = yield checkIsLoginSuccess();
|
|
45
33
|
if (!isSuccess)
|
|
46
34
|
return;
|
|
@@ -59,8 +47,8 @@ export function handleList(argv) {
|
|
|
59
47
|
logger.tree(siteNameList);
|
|
60
48
|
return;
|
|
61
49
|
}
|
|
62
|
-
const res = yield server.
|
|
63
|
-
const routineList = res === null || res === void 0 ? void 0 : res.Routines;
|
|
50
|
+
const res = yield server.listUserRoutines();
|
|
51
|
+
const routineList = (_b = res === null || res === void 0 ? void 0 : res.body) === null || _b === void 0 ? void 0 : _b.Routines;
|
|
64
52
|
if (routineList) {
|
|
65
53
|
logger.log(chalk.bold.bgGray(`📃 ${t('list_routine_name_title').d('List all of routine')}:`));
|
|
66
54
|
displayRoutineList(routineList);
|
|
@@ -77,7 +65,7 @@ export function displayRoutineList(versionList) {
|
|
|
77
65
|
table.push([
|
|
78
66
|
version.RoutineName,
|
|
79
67
|
moment(version.CreateTime).format('YYYY/MM/DD HH:mm:ss'),
|
|
80
|
-
|
|
68
|
+
version.Description
|
|
81
69
|
]);
|
|
82
70
|
});
|
|
83
71
|
console.table(table.toString());
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import siteList from './list.js';
|
|
2
1
|
import t from '../../i18n/index.js';
|
|
2
|
+
import siteList from './list.js';
|
|
3
3
|
let yargsIns;
|
|
4
4
|
const siteCommand = {
|
|
5
5
|
command: 'site [script]',
|
|
6
|
-
describe:
|
|
6
|
+
describe: `📈 ${t('site_describe').d('Manage your sites')}`,
|
|
7
7
|
builder: (yargs) => {
|
|
8
8
|
yargsIns = yargs;
|
|
9
9
|
return yargs
|
|
@@ -7,25 +7,24 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import logger from '../../libs/logger.js';
|
|
11
|
-
import { checkIsLoginSuccess } from '../utils.js';
|
|
12
10
|
import chalk from 'chalk';
|
|
13
|
-
import { ApiService } from '../../libs/apiService.js';
|
|
14
11
|
import t from '../../i18n/index.js';
|
|
12
|
+
import { ApiService } from '../../libs/apiService.js';
|
|
13
|
+
import logger from '../../libs/logger.js';
|
|
14
|
+
import { checkIsLoginSuccess } from '../utils.js';
|
|
15
15
|
const list = {
|
|
16
16
|
command: 'list',
|
|
17
17
|
describe: `📋 ${t('site_describe_list').d('List all your sites')}`,
|
|
18
18
|
builder: (yargs) => {
|
|
19
19
|
return yargs.usage(`${t('common_usage').d('Usage')}: \$0 list []`);
|
|
20
20
|
},
|
|
21
|
-
handler: (
|
|
22
|
-
handleList(
|
|
21
|
+
handler: () => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
handleList();
|
|
23
23
|
})
|
|
24
24
|
};
|
|
25
25
|
export default list;
|
|
26
|
-
export function handleList(
|
|
26
|
+
export function handleList() {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
// const { site, ...args } = argv;
|
|
29
28
|
var _a;
|
|
30
29
|
const isSuccess = yield checkIsLoginSuccess();
|
|
31
30
|
if (!isSuccess)
|
package/dist/commands/utils.js
CHANGED
|
@@ -7,15 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import fs from 'fs';
|
|
11
10
|
import { execSync } from 'child_process';
|
|
12
|
-
import
|
|
13
|
-
import { getCliConfig, projectConfigPath } from '../utils/fileUtils/index.js';
|
|
14
|
-
import { getRoot } from '../utils/fileUtils/base.js';
|
|
11
|
+
import fs from 'fs';
|
|
15
12
|
import chalk from 'chalk';
|
|
16
13
|
import t from '../i18n/index.js';
|
|
14
|
+
import api from '../libs/api.js';
|
|
17
15
|
import { ApiService } from '../libs/apiService.js';
|
|
16
|
+
import { isInstalledGit } from '../libs/git/index.js';
|
|
18
17
|
import logger from '../libs/logger.js';
|
|
18
|
+
import { getRoot } from '../utils/fileUtils/base.js';
|
|
19
|
+
import { getCliConfig, projectConfigPath } from '../utils/fileUtils/index.js';
|
|
20
|
+
import { getRoutineDetails } from './common/utils.js';
|
|
19
21
|
export const checkDirectory = (isCheckGit = false) => {
|
|
20
22
|
const root = getRoot();
|
|
21
23
|
if (fs.existsSync(projectConfigPath)) {
|
|
@@ -66,13 +68,6 @@ export const bindRoutineWithDomain = (name, domain) => __awaiter(void 0, void 0,
|
|
|
66
68
|
logger.error(t('utils_domain_error').d('Domain is not active'));
|
|
67
69
|
}
|
|
68
70
|
});
|
|
69
|
-
export const getRoutineVersionList = (name) => __awaiter(void 0, void 0, void 0, function* () {
|
|
70
|
-
var _a;
|
|
71
|
-
const server = yield ApiService.getInstance();
|
|
72
|
-
const req = { Name: name };
|
|
73
|
-
const res = yield server.getRoutine(req);
|
|
74
|
-
return ((_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.CodeVersions) || [];
|
|
75
|
-
});
|
|
76
71
|
export function validName(name) {
|
|
77
72
|
return /^[a-zA-Z0-9-_]+$/.test(name);
|
|
78
73
|
}
|
|
@@ -82,25 +77,56 @@ export function validDomain(domain) {
|
|
|
82
77
|
}
|
|
83
78
|
export function checkIsLoginSuccess() {
|
|
84
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
let accessKeyId = process.env.ESA_ACCESS_KEY_ID;
|
|
82
|
+
let accessKeySecret = process.env.ESA_ACCESS_KEY_SECRET;
|
|
83
|
+
let endpoint = process.env.ESA_ENDPOINT;
|
|
85
84
|
const cliConfig = getCliConfig();
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
if (!accessKeyId || !accessKeySecret) {
|
|
86
|
+
accessKeyId = (_a = cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.auth) === null || _a === void 0 ? void 0 : _a.accessKeyId;
|
|
87
|
+
accessKeySecret = (_b = cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.auth) === null || _b === void 0 ? void 0 : _b.accessKeySecret;
|
|
88
|
+
}
|
|
89
|
+
if (!endpoint) {
|
|
90
|
+
endpoint = cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.endpoint;
|
|
89
91
|
}
|
|
90
|
-
|
|
92
|
+
const namedCommand = chalk.green('esa login');
|
|
93
|
+
if (!accessKeyId || !accessKeySecret) {
|
|
91
94
|
logger.log(`❌ ${t('utils_login_error').d('Maybe you are not logged in yet.')}`);
|
|
92
95
|
logger.log(`🔔 ${t('utils_login_error_config', { namedCommand }).d(`Please run command to login: ${namedCommand}`)}`);
|
|
93
96
|
return false;
|
|
94
97
|
}
|
|
98
|
+
return yield validateLoginCredentials(accessKeyId, accessKeySecret, endpoint, namedCommand);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 验证登录凭据的公共函数
|
|
103
|
+
* @param accessKeyId AccessKey ID
|
|
104
|
+
* @param accessKeySecret AccessKey Secret
|
|
105
|
+
* @param namedCommand 命令名称(用于错误提示)
|
|
106
|
+
* @param showError 是否显示错误信息
|
|
107
|
+
* @returns 登录是否成功
|
|
108
|
+
*/
|
|
109
|
+
export function validateLoginCredentials(accessKeyId_1, accessKeySecret_1, endpoint_1, namedCommand_1) {
|
|
110
|
+
return __awaiter(this, arguments, void 0, function* (accessKeyId, accessKeySecret, endpoint, namedCommand, showError = true) {
|
|
95
111
|
const server = yield ApiService.getInstance();
|
|
96
|
-
server.updateConfig(
|
|
112
|
+
server.updateConfig({
|
|
113
|
+
auth: {
|
|
114
|
+
accessKeyId,
|
|
115
|
+
accessKeySecret
|
|
116
|
+
},
|
|
117
|
+
endpoint: endpoint
|
|
118
|
+
});
|
|
97
119
|
const res = yield server.checkLogin();
|
|
98
120
|
if (res.success) {
|
|
99
121
|
return true;
|
|
100
122
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
123
|
+
if (showError) {
|
|
124
|
+
logger.log(res.message || '');
|
|
125
|
+
logger.log(`❌ ${t('utils_login_error').d('Maybe you are not logged in yet.')}`);
|
|
126
|
+
if (namedCommand) {
|
|
127
|
+
logger.log(`🔔 ${t('utils_login_error_config', { namedCommand }).d(`Please run command to login: ${namedCommand}`)}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
104
130
|
return false;
|
|
105
131
|
});
|
|
106
132
|
}
|
|
@@ -138,3 +164,13 @@ export const getAllSites = () => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
138
164
|
};
|
|
139
165
|
});
|
|
140
166
|
});
|
|
167
|
+
export const getRoutineCodeVersions = (projectName) => __awaiter(void 0, void 0, void 0, function* () {
|
|
168
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
169
|
+
const routineDetail = yield getRoutineDetails(projectName);
|
|
170
|
+
const req = { name: projectName };
|
|
171
|
+
const res = yield api.listRoutineCodeVersions(req);
|
|
172
|
+
const allVersions = (_b = (_a = res.body) === null || _a === void 0 ? void 0 : _a.codeVersions) !== null && _b !== void 0 ? _b : [];
|
|
173
|
+
const stagingVersions = ((_g = (_f = (_e = (_d = (_c = routineDetail === null || routineDetail === void 0 ? void 0 : routineDetail.data) === null || _c === void 0 ? void 0 : _c.Envs) === null || _d === void 0 ? void 0 : _d.find((item) => item.Env === 'staging')) === null || _e === void 0 ? void 0 : _e.CodeDeploy) === null || _f === void 0 ? void 0 : _f.CodeVersions) === null || _g === void 0 ? void 0 : _g.map((item) => item.CodeVersion)) || [];
|
|
174
|
+
const productionVersions = ((_m = (_l = (_k = (_j = (_h = routineDetail === null || routineDetail === void 0 ? void 0 : routineDetail.data) === null || _h === void 0 ? void 0 : _h.Envs) === null || _j === void 0 ? void 0 : _j.find((item) => item.Env === 'production')) === null || _k === void 0 ? void 0 : _k.CodeDeploy) === null || _l === void 0 ? void 0 : _l.CodeVersions) === null || _m === void 0 ? void 0 : _m.map((item) => item.CodeVersion)) || [];
|
|
175
|
+
return { allVersions, stagingVersions, productionVersions };
|
|
176
|
+
});
|
|
@@ -7,9 +7,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import React, { useState } from 'react';
|
|
11
10
|
import { Box, render, Text } from 'ink';
|
|
12
11
|
import TextInput from 'ink-text-input';
|
|
12
|
+
import React, { useState } from 'react';
|
|
13
13
|
export const DescriptionInput = ({ prompt, onSubmit, required }) => {
|
|
14
14
|
const [input, setInput] = useState('');
|
|
15
15
|
const [error, setError] = useState('');
|
|
@@ -7,63 +7,51 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
import { isCancel, select as clackSelect } from '@clack/prompts';
|
|
11
|
+
import logger from '../libs/logger.js';
|
|
12
|
+
/**
|
|
13
|
+
* Perform multi-level selection and return the final selected template path
|
|
14
|
+
* @param items Array of selection items (including categories and sub-templates)
|
|
15
|
+
* @param message Initial prompt message
|
|
16
|
+
* @returns Selected template path, or null if the user exits
|
|
17
|
+
*/
|
|
18
|
+
export default function multiLevelSelect(items_1) {
|
|
19
|
+
return __awaiter(this, arguments, void 0, function* (items, message = 'Select a template:') {
|
|
20
|
+
let currentItems = items; // Current level options
|
|
21
|
+
const stack = []; // Stack to store previous level options for back navigation
|
|
22
|
+
let selectedPath = null;
|
|
23
|
+
while (selectedPath === null) {
|
|
24
|
+
const choice = (yield clackSelect({
|
|
25
|
+
message,
|
|
26
|
+
options: [
|
|
27
|
+
...currentItems.map((item) => ({
|
|
28
|
+
label: item.label,
|
|
29
|
+
value: item.value,
|
|
30
|
+
hint: item.hint
|
|
31
|
+
})),
|
|
32
|
+
...(stack.length > 0 ? [{ label: 'Back', value: '__back__' }] : [])
|
|
33
|
+
]
|
|
34
|
+
}));
|
|
35
|
+
if (isCancel(choice)) {
|
|
36
|
+
logger.log('User canceled the operation.');
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
if (choice === '__back__') {
|
|
40
|
+
currentItems = stack.pop(); // Return to the previous level
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
// If a category with children is selected
|
|
44
|
+
const selected = currentItems.find((i) => i.value === choice);
|
|
45
|
+
if (selected && selected.children && selected.children.length > 0) {
|
|
46
|
+
stack.push(currentItems); // Save the current level
|
|
47
|
+
currentItems = selected.children; // Move to the next level
|
|
48
|
+
message = `Select a template under ${selected.label}:`;
|
|
37
49
|
}
|
|
38
50
|
else {
|
|
39
|
-
//
|
|
40
|
-
|
|
41
|
-
exit();
|
|
51
|
+
// A leaf node (no children) is selected, end the selection
|
|
52
|
+
selectedPath = choice;
|
|
42
53
|
}
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (item.children && item.children.length > 0) {
|
|
46
|
-
setStack([...stack, [...item.children, RETURN_ITEM]]); // 在子层级中添加“退出”选项
|
|
47
54
|
}
|
|
48
|
-
|
|
49
|
-
handleSelect(item);
|
|
50
|
-
exit();
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
return (React.createElement(SelectInput, { items: currentItems, onSelect: onSelect, itemComponent: Item, indicatorComponent: Indicator, limit: 10 }));
|
|
54
|
-
};
|
|
55
|
-
export const MultiLevelSelectComponent = (props) => __awaiter(void 0, void 0, void 0, function* () {
|
|
56
|
-
const { items, handleSelect, handleExit } = props;
|
|
57
|
-
return new Promise((resolve) => {
|
|
58
|
-
const { unmount } = render(React.createElement(MultiLevelSelect, { items: items, handleSelect: (item) => {
|
|
59
|
-
unmount();
|
|
60
|
-
handleSelect && handleSelect(item);
|
|
61
|
-
resolve(item);
|
|
62
|
-
}, handleExit: () => {
|
|
63
|
-
unmount();
|
|
64
|
-
handleExit && handleExit();
|
|
65
|
-
resolve(null);
|
|
66
|
-
} }));
|
|
55
|
+
return selectedPath;
|
|
67
56
|
});
|
|
68
|
-
}
|
|
69
|
-
export default MultiLevelSelectComponent;
|
|
57
|
+
}
|
|
@@ -7,8 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
import React, { useState } from 'react';
|
|
11
10
|
import { Box, render, Text, useInput } from 'ink';
|
|
11
|
+
import React, { useState } from 'react';
|
|
12
12
|
import t from '../i18n/index.js';
|
|
13
13
|
export const MultiSelectTable = ({ items, itemsPerRow, onSubmit, boxWidth = 25 }) => {
|
|
14
14
|
const [selectedIndexes, setSelectedIndexes] = useState(new Set());
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { render } from 'ink';
|
|
1
|
+
import { render, Text } from 'ink';
|
|
3
2
|
import SelectInput from 'ink-select-input';
|
|
4
|
-
import
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import Item from './selectItem.js';
|
|
6
5
|
const Indicator = ({ isSelected }) => {
|
|
7
6
|
return React.createElement(Text, null, isSelected ? '👉 ' : ' ');
|