UNPKG

@sentry/wizard

Version:

Sentry wizard helping you to configure your project

68 lines 2.63 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.run = void 0; const debug_1 = require("../src/utils/debug"); const Env_1 = require("./Helper/Env"); const Wizard_1 = require("./Helper/Wizard"); const Step = __importStar(require("./Steps")); const telemetry_1 = require("../src/telemetry"); const node_1 = require("@sentry/node"); /** * @deprecated this function is the entry point to the old, step-based wizards located in `lib`. * When creating new wizards, we now add them to clack-based wizards under `src`. * Therefor, do not call this function anymore. * Use `run` from {@link ../src/run.ts} instead. */ async function run(argv, wizardOptions) { const args = { ...argv, ...(0, Env_1.readEnvironment)() }; if (argv.debug) { (0, debug_1.enableDebugLogs)(); } if (args.uninstall === undefined) { args.uninstall = false; } const steps = [ Step.Initial, Step.Welcome, Step.ChooseIntegration, Step.ShouldConfigure, ]; if (args.uninstall === false) { steps.push(Step.OpenSentry, Step.WaitForSentry, Step.SentryProjectSelector, Step.PromptForParameters); } steps.push(Step.ConfigureProject, Step.Result); return (0, telemetry_1.withTelemetry)({ enabled: wizardOptions.telemetryEnabled, integration: args.integration, wizardOptions, }, async () => { const res = await (0, Wizard_1.startWizard)(args, ...steps); await (0, node_1.flush)(3000); return res; }); } exports.run = run; //# sourceMappingURL=Setup.js.map