@sentry/wizard
Version:
Sentry wizard helping you to configure your project
66 lines • 3.55 kB
JavaScript
;
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;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.configureFastlane = void 0;
// @ts-expect-error - clack is ESM and TS complains about that. It works though
const prompts_1 = __importDefault(require("@clack/prompts"));
const Sentry = __importStar(require("@sentry/node"));
const chalk_1 = __importDefault(require("chalk"));
const telemetry_1 = require("../telemetry");
const debug_1 = require("../utils/debug");
const fastlane = __importStar(require("./fastlane"));
async function configureFastlane({ projectDir, orgSlug, projectSlug, }) {
(0, debug_1.debug)(`Checking if Fastfile exists in directory: ${chalk_1.default.cyan(projectDir)}`);
const isFastlaneAvailable = fastlane.fastFile(projectDir);
Sentry.setTag('fastlane-exists', isFastlaneAvailable);
if (!isFastlaneAvailable) {
(0, debug_1.debug)(`Fastfile not found, not configuring Fastlane`);
// If fastlane is not available, we don't need to configure it and exit early.
return;
}
(0, debug_1.debug)(`Fastfile found, asking user if they want to configure Fastlane`);
const shouldAddLane = await prompts_1.default.confirm({
message: 'Found a Fastfile in your project. Do you want to configure a lane to upload debug symbols to Sentry?',
});
(0, debug_1.debug)(`User wants to add lane: ${chalk_1.default.cyan(shouldAddLane.toString())}`);
Sentry.setTag('fastlane-desired', shouldAddLane);
if (shouldAddLane) {
(0, debug_1.debug)(`Adding Sentry lane to Fastlane`);
const added = await (0, telemetry_1.traceStep)('Configure fastlane', () => fastlane.addSentryToFastlane(projectDir, orgSlug, projectSlug));
Sentry.setTag('fastlane-added', added);
(0, debug_1.debug)(`Fastlane added: ${chalk_1.default.cyan(added.toString())}`);
if (added) {
prompts_1.default.log.step('A new step was added to your fastlane file. Now and you build your project with fastlane, debug symbols and source context will be uploaded to Sentry.');
}
else {
prompts_1.default.log.warn('Could not edit your fastlane file to upload debug symbols to Sentry. Please follow the instructions at https://docs.sentry.io/platforms/apple/guides/ios/dsym/#fastlane');
}
}
}
exports.configureFastlane = configureFastlane;
//# sourceMappingURL=configure-fastlane.js.map