UNPKG

@sentry/wizard

Version:

Sentry wizard helping you to configure your project

29 lines 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.detectUsedTool = exports.TOOL_PACKAGE_MAP = void 0; const clack_1 = require("../../utils/clack"); const package_json_1 = require("../../utils/package-json"); // A map of package names pointing to the tool slug. // The order is important, because we want to detect the most specific tool first. // For instance, webpack needs to come before tsc because typescript c // Similarly exports.TOOL_PACKAGE_MAP = { '@angular/core': 'angular', 'create-react-app': 'create-react-app', wrangler: 'wrangler', webpack: 'webpack', vite: 'vite', esbuild: 'esbuild', rollup: 'rollup', typescript: 'tsc', }; async function detectUsedTool() { const packageJson = await (0, clack_1.getPackageDotJson)(); const foundToolPackage = (0, package_json_1.findInstalledPackageFromList)(Object.keys(exports.TOOL_PACKAGE_MAP), packageJson); if (foundToolPackage) { return exports.TOOL_PACKAGE_MAP[foundToolPackage.name]; } return 'sentry-cli'; } exports.detectUsedTool = detectUsedTool; //# sourceMappingURL=detect-tool.js.map