@sentry/wizard
Version:
Sentry wizard helping you to configure your project
34 lines • 4.02 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sourceContextKts = exports.sourceContext = exports.testErrorSnippetKt = exports.testErrorSnippet = exports.sentryImportKt = exports.sentryImport = exports.manifest = exports.pluginKts = exports.plugin = exports.pluginsBlockKts = exports.pluginsBlock = void 0;
var pluginsBlock = function (version) {
if (version === void 0) { version = '3.12.0'; }
return "\nplugins {\n id 'io.sentry.android.gradle' version '".concat(version, "'\n}\n\n");
};
exports.pluginsBlock = pluginsBlock;
var pluginsBlockKts = function (version) {
if (version === void 0) { version = '3.12.0'; }
return "\nplugins {\n id(\"io.sentry.android.gradle\") version \"".concat(version, "\"\n}\n\n");
};
exports.pluginsBlockKts = pluginsBlockKts;
var plugin = function (version) {
if (version === void 0) { version = '3.12.0'; }
return "\n id 'io.sentry.android.gradle' version '".concat(version, "'\n");
};
exports.plugin = plugin;
var pluginKts = function (version) {
if (version === void 0) { version = '3.12.0'; }
return "\n id(\"io.sentry.android.gradle\") version \"".concat(version, "\"\n");
};
exports.pluginKts = pluginKts;
var manifest = function (dsn) { return "\n <!-- Required: set your sentry.io project identifier (DSN) -->\n <meta-data android:name=\"io.sentry.dsn\" android:value=\"".concat(dsn, "\" />\n\n <!-- enable automatic breadcrumbs for user interactions (clicks, swipes, scrolls) -->\n <meta-data android:name=\"io.sentry.traces.user-interaction.enable\" android:value=\"true\" />\n <!-- enable screenshot for crashes (could contain sensitive/PII data) -->\n <meta-data android:name=\"io.sentry.attach-screenshot\" android:value=\"true\" />\n <!-- enable view hierarchy for crashes -->\n <meta-data android:name=\"io.sentry.attach-view-hierarchy\" android:value=\"true\" />\n\n <!-- enable the performance API by setting a sample-rate, adjust in production env -->\n <meta-data android:name=\"io.sentry.traces.sample-rate\" android:value=\"1.0\" />\n <!-- enable profiling when starting transactions, adjust in production env -->\n <meta-data android:name=\"io.sentry.traces.profiling.sample-rate\" android:value=\"1.0\" />\n"); };
exports.manifest = manifest;
exports.sentryImport = "import io.sentry.Sentry;\n";
exports.sentryImportKt = "import io.sentry.Sentry\n";
exports.testErrorSnippet = "\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById(android.R.id.content).getViewTreeObserver().addOnGlobalLayoutListener(() -> {\n try {\n throw new Exception(\"This app uses Sentry! :)\");\n } catch (Exception e) {\n Sentry.captureException(e);\n }\n });\n";
exports.testErrorSnippetKt = "\n // waiting for view to draw to better represent a captured error with a screenshot\n findViewById<android.view.View>(android.R.id.content).viewTreeObserver.addOnGlobalLayoutListener {\n try {\n throw Exception(\"This app uses Sentry! :)\")\n } catch (e: Exception) {\n Sentry.captureException(e)\n }\n }\n";
var sourceContext = function (orgSlug, projectSlug) { return "\n\nsentry {\n org = \"".concat(orgSlug, "\"\n projectName = \"").concat(projectSlug, "\"\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext = true\n}\n"); };
exports.sourceContext = sourceContext;
var sourceContextKts = function (orgSlug, projectSlug) { return "\n\nsentry {\n org.set(\"".concat(orgSlug, "\")\n projectName.set(\"").concat(projectSlug, "\")\n\n // this will upload your source code to Sentry to show it as part of the stack traces\n // disable if you don't want to expose your sources\n includeSourceContext.set(true)\n}\n"); };
exports.sourceContextKts = sourceContextKts;
//# sourceMappingURL=templates.js.map