@forge/cli
13.3.0-next.12-experimental-4b981ef-experimental-5b8eb3c13.3.0-next.25
out/command-line/index.js~
out/command-line/index.jsModified+25−3
Index: package/out/command-line/index.js
===================================================================
--- package/out/command-line/index.js
+++ package/out/command-line/index.js
@@ -1,12 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.main = void 0;
+exports.setupProxy = setupProxy;
exports.registerCommands = registerCommands;
+const tslib_1 = require("tslib");
const cli_shared_1 = require("@forge/cli-shared");
+const http_proxy_agent_1 = require("http-proxy-agent");
+const http_1 = tslib_1.__importDefault(require("http"));
+const https_1 = tslib_1.__importDefault(require("https"));
const dependency_injection_1 = require("./dependency-injection");
const version_info_1 = require("./version-info");
-const proxy_1 = require("./proxy");
const register_app_commands_1 = require("./register-app-commands");
const register_authentication_command_1 = require("./register-authentication-command");
const register_autocomplete_commands_1 = require("./register-autocomplete-commands");
const register_build_commands_1 = require("./register-build-commands");
@@ -30,8 +34,9 @@
const register_assistant_commands_1 = require("./register-assistant-commands");
const register_repositories_commands_1 = require("./register-repositories-commands");
const register_custom_scopes_commands_1 = require("./register-custom-scopes-commands");
const register_module_commands_1 = require("./register-module-commands");
+const register_manifest_commands_1 = require("./register-manifest-commands");
const worker_info_1 = require("../workers/worker-info");
const workers_starter_1 = require("../workers/workers-starter");
const COMMAND_HELP_GROUPS = {
[cli_shared_1.Text.commandHelp.groups.quickStart]: ['login', 'create', 'deploy', 'install', 'tunnel'],
@@ -47,9 +52,10 @@
'storage',
'webtrigger',
'version',
'uninstall',
- 'developer-spaces'
+ 'developer-spaces',
+ 'manifest'
],
[cli_shared_1.Text.commandHelp.groups.account]: ['whoami', 'logout'],
[cli_shared_1.Text.commandHelp.groups.cliExperience]: ['autocomplete', 'assistant', 'feedback']
};
@@ -60,8 +66,24 @@
}
}
deps.cmd.sortCommandsByGroup(Object.keys(COMMAND_HELP_GROUPS));
}
+function setupProxy() {
+ const cachedConf = cli_shared_1.CachedConf.getCache(cli_shared_1.CONFIG_PROJECT_NAME);
+ const proxyUrl = cachedConf.get('proxy');
+ if (proxyUrl && proxyUrl.trim()) {
+ let agent;
+ if (process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0') {
+ agent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { rejectUnauthorized: false });
+ }
+ else {
+ agent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl);
+ }
+ http_1.default.globalAgent = agent;
+ https_1.default.globalAgent = agent;
+ return agent;
+ }
+}
async function registerCommands(deps) {
(0, register_autocomplete_commands_1.registerCommands)(deps);
(0, register_authentication_command_1.registerCommands)(deps);
await (0, register_app_commands_1.registerCommands)(deps);
@@ -86,17 +108,17 @@
(0, register_repositories_commands_1.registerCommands)(deps);
(0, register_show_commands_1.registerCommands)(deps);
(0, register_assistant_commands_1.registerCommands)(deps);
(0, register_custom_scopes_commands_1.registerCommands)(deps);
+ (0, register_manifest_commands_1.registerCommands)(deps);
applyCommandHelpGroups(deps);
}
const registerEvents = ({ ui }) => {
process.on('unhandledRejection', async (reason) => {
await (0, cli_shared_1.exitOnError)(ui, reason);
});
};
const main = async () => {
- (0, proxy_1.setupProxy)();
const cliDetails = (0, version_info_1.getCLIDetails)();
const deps = await (0, dependency_injection_1.getDependencies)(cliDetails);
registerEvents(deps);
await registerCommands(deps);