esa-cli 0.0.1-beta.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/LICENSE +21 -0
- package/README.md +175 -0
- package/bin/enter.cjs +52 -0
- package/dist/README.md +175 -0
- package/dist/bin/enter.cjs +52 -0
- package/dist/cliconfig.toml +6 -0
- package/dist/commands/commit/index.js +147 -0
- package/dist/commands/commit/prodBuild.js +50 -0
- package/dist/commands/common/constant.js +54 -0
- package/dist/commands/config.js +51 -0
- package/dist/commands/deploy/helper.js +108 -0
- package/dist/commands/deploy/index.js +217 -0
- package/dist/commands/deployments/delete.js +92 -0
- package/dist/commands/deployments/index.js +27 -0
- package/dist/commands/deployments/list.js +89 -0
- package/dist/commands/dev/config/devBuild.js +26 -0
- package/dist/commands/dev/config/devEntry.js +71 -0
- package/dist/commands/dev/config/mock/cache.js +31 -0
- package/dist/commands/dev/config/mock/kv.js +87 -0
- package/dist/commands/dev/devPack.js +113 -0
- package/dist/commands/dev/doProcess.js +73 -0
- package/dist/commands/dev/index.js +240 -0
- package/dist/commands/dev/server.js +100 -0
- package/dist/commands/domain/add.js +72 -0
- package/dist/commands/domain/delete.js +74 -0
- package/dist/commands/domain/index.js +29 -0
- package/dist/commands/domain/list.js +51 -0
- package/dist/commands/init/index.js +149 -0
- package/dist/commands/lang.js +32 -0
- package/dist/commands/login/index.js +108 -0
- package/dist/commands/logout.js +44 -0
- package/dist/commands/route/add.js +115 -0
- package/dist/commands/route/delete.js +74 -0
- package/dist/commands/route/index.js +29 -0
- package/dist/commands/route/list.js +63 -0
- package/dist/commands/routine/delete.js +54 -0
- package/dist/commands/routine/index.js +27 -0
- package/dist/commands/routine/list.js +101 -0
- package/dist/commands/site/index.js +25 -0
- package/dist/commands/site/list.js +47 -0
- package/dist/commands/utils.js +139 -0
- package/dist/components/descriptionInput.js +38 -0
- package/dist/components/filterSelector.js +132 -0
- package/dist/components/mutiSelectTable.js +95 -0
- package/dist/components/selectInput.js +17 -0
- package/dist/components/selectItem.js +6 -0
- package/dist/components/yesNoPrompt.js +9 -0
- package/dist/docs/Commands_en.md +224 -0
- package/dist/docs/Commands_zh_CN.md +224 -0
- package/dist/docs/dev.png +0 -0
- package/dist/i18n/index.js +27 -0
- package/dist/i18n/locales.json +766 -0
- package/dist/index.js +80 -0
- package/dist/libs/apiService.js +914 -0
- package/dist/libs/git/index.js +52 -0
- package/dist/libs/interface.js +21 -0
- package/dist/libs/logger.js +149 -0
- package/dist/libs/request.js +98 -0
- package/dist/libs/templates/index.js +16 -0
- package/dist/package.json +93 -0
- package/dist/utils/checkDevPort.js +113 -0
- package/dist/utils/checkIsRoutineCreated.js +56 -0
- package/dist/utils/checkVersion.js +26 -0
- package/dist/utils/debounce.js +18 -0
- package/dist/utils/fileUtils/index.js +219 -0
- package/dist/utils/fileUtils/interface.js +1 -0
- package/dist/utils/install/install.ps1 +33 -0
- package/dist/utils/install/install.sh +53 -0
- package/dist/utils/installRuntime.js +80 -0
- package/dist/utils/openInBrowser.js +24 -0
- package/dist/utils/sleep.js +6 -0
- package/dist/zh_CN.md +177 -0
- package/package.json +93 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import yargs from 'yargs';
|
|
11
|
+
import { hideBin } from 'yargs/helpers';
|
|
12
|
+
import login from './commands/login/index.js';
|
|
13
|
+
import config from './commands/config.js';
|
|
14
|
+
import dev from './commands/dev/index.js';
|
|
15
|
+
import init from './commands/init/index.js';
|
|
16
|
+
import routine from './commands/routine/index.js';
|
|
17
|
+
import deploy from './commands/deploy/index.js';
|
|
18
|
+
import commit from './commands/commit/index.js';
|
|
19
|
+
import deployments from './commands/deployments/index.js';
|
|
20
|
+
import domainCommand from './commands/domain/index.js';
|
|
21
|
+
import routeCommand from './commands/route/index.js';
|
|
22
|
+
import logout from './commands/logout.js';
|
|
23
|
+
import lang from './commands/lang.js';
|
|
24
|
+
import { getCliConfig } from './utils/fileUtils/index.js';
|
|
25
|
+
import { handleCheckVersion } from './utils/checkVersion.js';
|
|
26
|
+
import t from './i18n/index.js';
|
|
27
|
+
import site from './commands/site/index.js';
|
|
28
|
+
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const argv = hideBin(process.argv);
|
|
30
|
+
const cliConfig = getCliConfig();
|
|
31
|
+
const esa = yargs(argv)
|
|
32
|
+
.strict()
|
|
33
|
+
.fail((msg, err) => {
|
|
34
|
+
console.error(msg, err);
|
|
35
|
+
})
|
|
36
|
+
.scriptName('esa')
|
|
37
|
+
.locale((cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.lang) || 'en')
|
|
38
|
+
.version(false)
|
|
39
|
+
.wrap(null)
|
|
40
|
+
.help(false)
|
|
41
|
+
// .epilogue(
|
|
42
|
+
// `${t('main_epilogue').d('For more information, visit DCDN')}: ${chalk.underline.blue('https://dcdnnext.console.aliyun.com/')}`
|
|
43
|
+
// )
|
|
44
|
+
.options('version', {
|
|
45
|
+
describe: t('main_version_describe').d('Show version'),
|
|
46
|
+
alias: 'v'
|
|
47
|
+
})
|
|
48
|
+
.options('help', {
|
|
49
|
+
describe: t('main_help_describe').d('Show help'),
|
|
50
|
+
alias: 'h'
|
|
51
|
+
});
|
|
52
|
+
esa.command('*', false, () => { }, (args) => {
|
|
53
|
+
if (args._.length > 0) {
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
if (args.v) {
|
|
57
|
+
handleCheckVersion();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
esa.showHelp('log');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
esa.command(init);
|
|
65
|
+
esa.command(dev);
|
|
66
|
+
esa.command(commit);
|
|
67
|
+
esa.command(deploy);
|
|
68
|
+
esa.command(deployments);
|
|
69
|
+
esa.command(routine);
|
|
70
|
+
esa.command(site);
|
|
71
|
+
esa.command(domainCommand);
|
|
72
|
+
esa.command(routeCommand);
|
|
73
|
+
esa.command(login);
|
|
74
|
+
esa.command(logout);
|
|
75
|
+
esa.command(config);
|
|
76
|
+
esa.command(lang);
|
|
77
|
+
esa.group(['help', 'version'], 'Options:');
|
|
78
|
+
esa.parse();
|
|
79
|
+
});
|
|
80
|
+
main();
|