@sentry/wizard 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/bin.ts +5 -1
- package/dist/bin.js +6 -1
- package/dist/bin.js.map +1 -1
- package/dist/lib/Constants.d.ts +2 -1
- package/dist/lib/Constants.js +5 -0
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/File.js +25 -2
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Git.d.ts +7 -0
- package/dist/lib/Helper/Git.js +94 -0
- package/dist/lib/Helper/Git.js.map +1 -0
- package/dist/lib/Helper/Logging.d.ts +1 -0
- package/dist/lib/Helper/Logging.js +9 -2
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/MergeConfig.js +24 -1
- package/dist/lib/Helper/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +9 -0
- package/dist/lib/Helper/Package.js +39 -2
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/PackageManager.d.ts +1 -1
- package/dist/lib/Helper/PackageManager.js +32 -11
- package/dist/lib/Helper/PackageManager.js.map +1 -1
- package/dist/lib/Helper/SentryCli.d.ts +11 -0
- package/dist/lib/Helper/SentryCli.js +141 -2
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +24 -1
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +25 -2
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Setup.js +25 -2
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +28 -1
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/Initial.js +25 -2
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +25 -2
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +26 -3
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +24 -1
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/Integrations/NextJs.d.ts +5 -11
- package/dist/lib/Steps/Integrations/NextJs.js +14 -343
- package/dist/lib/Steps/Integrations/NextJs.js.map +1 -1
- package/dist/lib/Steps/Integrations/ReactNative.d.ts +1 -0
- package/dist/lib/Steps/Integrations/ReactNative.js +67 -6
- package/dist/lib/Steps/Integrations/ReactNative.js.map +1 -1
- package/dist/lib/Steps/Integrations/SvelteKit.d.ts +13 -0
- package/dist/lib/Steps/Integrations/SvelteKit.js +95 -0
- package/dist/lib/Steps/Integrations/SvelteKit.js.map +1 -0
- package/dist/lib/Steps/Integrations/__tests__/ReactNative.js +28 -5
- package/dist/lib/Steps/Integrations/__tests__/ReactNative.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.js +24 -1
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +25 -1
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/__tests__/Setup.js +24 -1
- package/dist/lib/__tests__/Setup.js.map +1 -1
- package/dist/src/{nextjs-wizard.js → nextjs/nextjs-wizard.js} +113 -108
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -0
- package/dist/src/sveltekit/sdk-example.d.ts +10 -0
- package/dist/src/sveltekit/sdk-example.js +106 -0
- package/dist/src/sveltekit/sdk-example.js.map +1 -0
- package/dist/src/sveltekit/sdk-setup.d.ts +13 -0
- package/dist/src/sveltekit/sdk-setup.js +451 -0
- package/dist/src/sveltekit/sdk-setup.js.map +1 -0
- package/dist/src/sveltekit/sentry-cli-setup.d.ts +2 -0
- package/dist/src/sveltekit/sentry-cli-setup.js +71 -0
- package/dist/src/sveltekit/sentry-cli-setup.js.map +1 -0
- package/dist/src/sveltekit/sveltekit-wizard.d.ts +5 -0
- package/dist/src/sveltekit/sveltekit-wizard.js +147 -0
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -0
- package/dist/src/templates/nextjs-templates.js +2 -2
- package/dist/src/templates/nextjs-templates.js.map +1 -1
- package/dist/src/templates/sveltekit-templates.d.ts +12 -0
- package/dist/src/templates/sveltekit-templates.js +26 -0
- package/dist/src/templates/sveltekit-templates.js.map +1 -0
- package/dist/src/{clack-utils.d.ts → utils/clack-utils.d.ts} +7 -0
- package/dist/src/{clack-utils.js → utils/clack-utils.js} +127 -42
- package/dist/src/utils/clack-utils.js.map +1 -0
- package/lib/Constants.ts +5 -0
- package/lib/Helper/Git.ts +39 -0
- package/lib/Helper/Logging.ts +4 -0
- package/lib/Helper/Package.ts +17 -0
- package/lib/Helper/PackageManager.ts +4 -9
- package/lib/Helper/SentryCli.ts +74 -0
- package/lib/Steps/ChooseIntegration.ts +4 -0
- package/lib/Steps/Integrations/NextJs.ts +7 -397
- package/lib/Steps/Integrations/ReactNative.ts +49 -3
- package/lib/Steps/Integrations/SvelteKit.ts +29 -0
- package/lib/Steps/SentryProjectSelector.ts +1 -0
- package/package.json +1 -1
- package/src/{nextjs-wizard.ts → nextjs/nextjs-wizard.ts} +13 -44
- package/src/sveltekit/sdk-example.ts +56 -0
- package/src/sveltekit/sdk-setup.ts +430 -0
- package/src/sveltekit/sentry-cli-setup.ts +27 -0
- package/src/sveltekit/sveltekit-wizard.ts +116 -0
- package/src/templates/nextjs-templates.ts +2 -2
- package/src/templates/sveltekit-templates.ts +172 -0
- package/src/{clack-utils.ts → utils/clack-utils.ts} +73 -11
- package/dist/src/clack-utils.js.map +0 -1
- package/dist/src/nextjs-wizard.js.map +0 -1
- /package/dist/src/{nextjs-wizard.d.ts → nextjs/nextjs-wizard.d.ts} +0 -0
|
@@ -1,8 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
62
|
+
var t = {};
|
|
63
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
64
|
+
t[p] = s[p];
|
|
65
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
66
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
67
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
68
|
+
t[p[i]] = s[p[i]];
|
|
69
|
+
}
|
|
70
|
+
return t;
|
|
71
|
+
};
|
|
2
72
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
73
|
exports.SentryCli = void 0;
|
|
4
|
-
var
|
|
5
|
-
var
|
|
74
|
+
var fs = __importStar(require("fs"));
|
|
75
|
+
var _ = __importStar(require("lodash"));
|
|
76
|
+
var path = __importStar(require("path"));
|
|
77
|
+
var Git_1 = require("./Git");
|
|
78
|
+
var Logging_1 = require("./Logging");
|
|
79
|
+
var SENTRYCLIRC_FILENAME = '.sentryclirc';
|
|
80
|
+
var GITIGNORE_FILENAME = '.gitignore';
|
|
81
|
+
var PROPERTIES_FILENAME = 'sentry.properties';
|
|
6
82
|
var SentryCli = /** @class */ (function () {
|
|
7
83
|
function SentryCli(_argv) {
|
|
8
84
|
this._argv = _argv;
|
|
@@ -63,6 +139,69 @@ var SentryCli = /** @class */ (function () {
|
|
|
63
139
|
}
|
|
64
140
|
return dumpedSections.join('\n');
|
|
65
141
|
};
|
|
142
|
+
/**
|
|
143
|
+
* Creates `.sentryclirc` and `sentry.properties` files with the CLI properties
|
|
144
|
+
* obtained from the user answers (or from logging into Sentry).
|
|
145
|
+
* The `.sentryclirc` only contains the auth token and will be added to the
|
|
146
|
+
* user's `.gitignore` file. The properties file contains the rest of the
|
|
147
|
+
* properties (org, project, etc.).
|
|
148
|
+
*
|
|
149
|
+
* @param sentryCli instance of the Sentry CLI
|
|
150
|
+
* @param cliProps the properties to write to the files
|
|
151
|
+
*/
|
|
152
|
+
SentryCli.prototype.createSentryCliConfig = function (cliProps) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
154
|
+
var authToken, cliPropsToWrite, _a, _b;
|
|
155
|
+
return __generator(this, function (_c) {
|
|
156
|
+
switch (_c.label) {
|
|
157
|
+
case 0:
|
|
158
|
+
authToken = cliProps["auth/token"], cliPropsToWrite = __rest(cliProps, ['auth/token']);
|
|
159
|
+
if (!authToken) return [3 /*break*/, 5];
|
|
160
|
+
_c.label = 1;
|
|
161
|
+
case 1:
|
|
162
|
+
_c.trys.push([1, 3, , 4]);
|
|
163
|
+
return [4 /*yield*/, fs.promises.appendFile(SENTRYCLIRC_FILENAME, this.dumpConfig({ auth: { token: authToken } }))];
|
|
164
|
+
case 2:
|
|
165
|
+
_c.sent();
|
|
166
|
+
(0, Logging_1.green)("\u2713 Successfully added the auth token to ".concat(SENTRYCLIRC_FILENAME));
|
|
167
|
+
return [3 /*break*/, 4];
|
|
168
|
+
case 3:
|
|
169
|
+
_a = _c.sent();
|
|
170
|
+
(0, Logging_1.red)("\u26A0 Could not add the auth token to ".concat(SENTRYCLIRC_FILENAME, ", ") +
|
|
171
|
+
"please add it to identify your user account:\n".concat(authToken));
|
|
172
|
+
(0, Logging_1.nl)();
|
|
173
|
+
return [3 /*break*/, 4];
|
|
174
|
+
case 4: return [3 /*break*/, 6];
|
|
175
|
+
case 5:
|
|
176
|
+
(0, Logging_1.red)("\u26A0 Did not find an auth token, please add your token to ".concat(SENTRYCLIRC_FILENAME));
|
|
177
|
+
(0, Logging_1.l)('To generate an auth token, visit https://sentry.io/settings/account/api/auth-tokens/');
|
|
178
|
+
(0, Logging_1.l)('To learn how to configure Sentry CLI, visit ' +
|
|
179
|
+
'https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli');
|
|
180
|
+
_c.label = 6;
|
|
181
|
+
case 6: return [4 /*yield*/, (0, Git_1.addToGitignore)(SENTRYCLIRC_FILENAME, "\u26A0 Could not add ".concat(SENTRYCLIRC_FILENAME, " to ").concat(GITIGNORE_FILENAME, ", ") +
|
|
182
|
+
'please add it to not commit your auth key.')];
|
|
183
|
+
case 7:
|
|
184
|
+
_c.sent();
|
|
185
|
+
_c.label = 8;
|
|
186
|
+
case 8:
|
|
187
|
+
_c.trys.push([8, 10, , 11]);
|
|
188
|
+
return [4 /*yield*/, fs.promises.writeFile("./".concat(PROPERTIES_FILENAME), this.dumpProperties(cliPropsToWrite))];
|
|
189
|
+
case 9:
|
|
190
|
+
_c.sent();
|
|
191
|
+
(0, Logging_1.green)('✓ Successfully created sentry.properties');
|
|
192
|
+
return [3 /*break*/, 11];
|
|
193
|
+
case 10:
|
|
194
|
+
_b = _c.sent();
|
|
195
|
+
(0, Logging_1.red)("\u26A0 Could not add org and project data to ".concat(PROPERTIES_FILENAME));
|
|
196
|
+
(0, Logging_1.l)('See docs for a manual setup: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli');
|
|
197
|
+
return [3 /*break*/, 11];
|
|
198
|
+
case 11:
|
|
199
|
+
(0, Logging_1.nl)();
|
|
200
|
+
return [2 /*return*/];
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
};
|
|
66
205
|
return SentryCli;
|
|
67
206
|
}());
|
|
68
207
|
exports.SentryCli = SentryCli;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../lib/Helper/SentryCli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../lib/Helper/SentryCli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAyB;AAEzB,w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AK,eAAe,UAAK,QAAQ,EAA1D,cAA+C,CAAF,CAAc;6BAQ7D,SAAS,EAAT,wBAAS;;;;wBAET,qBAAM,EAAE,CAAC,QAAQ,CAAC,UAAU,CAC1B,oBAAoB,EACpB,IAAI,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAChD,EAAA;;wBAHD,SAGC,CAAC;wBACF,IAAA,eAAK,EAAC,sDAA0C,oBAAoB,CAAE,CAAC,CAAC;;;;wBAExE,IAAA,aAAG,EACD,iDAAqC,oBAAoB,OAAI;4BAC3D,wDAAiD,SAAS,CAAE,CAC/D,CAAC;wBACF,IAAA,YAAE,GAAE,CAAC;;;;wBAGP,IAAA,aAAG,EACD,sEAA0D,oBAAoB,CAAE,CACjF,CAAC;wBACF,IAAA,WAAC,EACC,sFAAsF,CACvF,CAAC;wBACF,IAAA,WAAC,EACC,8CAA8C;4BAC5C,8FAA8F,CACjG,CAAC;;4BAGJ,qBAAM,IAAA,oBAAc,EAClB,oBAAoB,EACpB,+BAAmB,oBAAoB,iBAAO,kBAAkB,OAAI;4BAClE,4CAA4C,CAC/C,EAAA;;wBAJD,SAIC,CAAC;;;;wBAGA,qBAAM,EAAE,CAAC,QAAQ,CAAC,SAAS,CACzB,YAAK,mBAAmB,CAAE,EAC1B,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CACrC,EAAA;;wBAHD,SAGC,CAAC;wBACF,IAAA,eAAK,EAAC,0CAA0C,CAAC,CAAC;;;;wBAElD,IAAA,aAAG,EAAC,uDAA2C,mBAAmB,CAAE,CAAC,CAAC;wBACtE,IAAA,WAAC,EACC,2HAA2H,CAC5H,CAAC;;;wBAEJ,IAAA,YAAE,GAAE,CAAC;;;;;KACN;IACH,gBAAC;AAAD,CAAC,AAhID,IAgIC;AAhIY,8BAAS","sourcesContent":["import * as fs from 'fs';\nimport type { Answers } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport type { Args } from '../Constants';\nimport { addToGitignore } from './Git';\nimport { green, l, nl, red } from './Logging';\n\nconst SENTRYCLIRC_FILENAME = '.sentryclirc';\nconst GITIGNORE_FILENAME = '.gitignore';\nconst PROPERTIES_FILENAME = 'sentry.properties';\n\nexport interface SentryCliProps {\n [s: string]: string;\n}\n\ntype SentryCliConfig = Record<string, SentryCliProps>;\n\nexport class SentryCli {\n // eslint-disable-next-line @typescript-eslint/typedef\n private _resolve = require.resolve;\n\n public constructor(protected _argv: Args) {}\n\n public setResolveFunction(resolve: (path: string) => string): void {\n this._resolve = resolve as any;\n }\n\n public convertAnswersToProperties(answers: Answers): SentryCliProps {\n const props: SentryCliProps = {};\n props['defaults/url'] = this._argv.url;\n props['defaults/org'] = _.get(answers, 'config.organization.slug', null);\n props['defaults/project'] = _.get(answers, 'config.project.slug', null);\n props['auth/token'] = _.get(answers, 'config.auth.token', null);\n try {\n const cliPath = this._resolve('@sentry/cli/bin/sentry-cli', {\n paths: [process.cwd()],\n });\n props['cli/executable'] = path\n .relative(process.cwd(), cliPath)\n .replace(/\\\\/g, '\\\\\\\\');\n } catch (e) {\n // we do nothing and leave everyting as it is\n }\n return props;\n }\n\n /** Create the contents of a `sentry.properties` file */\n public dumpProperties(props: SentryCliProps): string {\n const rv = [];\n for (let key in props) {\n // eslint-disable-next-line no-prototype-builtins\n if (props.hasOwnProperty(key)) {\n const value = props[key];\n key = key.replace(/\\//g, '.');\n if (value === undefined || value === null) {\n // comment that property out since it has no value\n rv.push(`#${key}=`);\n } else {\n rv.push(`${key}=${value}`);\n }\n }\n }\n // eslint-disable-next-line prefer-template\n return rv.join('\\n') + '\\n';\n }\n\n public dumpConfig(config: SentryCliConfig): string {\n const dumpedSections: string[] = [];\n for (const sectionName in config) {\n // eslint-disable-next-line no-prototype-builtins\n if (config.hasOwnProperty(sectionName)) {\n const props = this.dumpProperties(config[sectionName]);\n const section = `[${sectionName}]\\n${props}`;\n dumpedSections.push(section);\n }\n }\n return dumpedSections.join('\\n');\n }\n\n /**\n * Creates `.sentryclirc` and `sentry.properties` files with the CLI properties\n * obtained from the user answers (or from logging into Sentry).\n * The `.sentryclirc` only contains the auth token and will be added to the\n * user's `.gitignore` file. The properties file contains the rest of the\n * properties (org, project, etc.).\n *\n * @param sentryCli instance of the Sentry CLI\n * @param cliProps the properties to write to the files\n */\n public async createSentryCliConfig(cliProps: SentryCliProps): Promise<void> {\n const { 'auth/token': authToken, ...cliPropsToWrite } = cliProps;\n\n /**\n * To not commit the auth token to the VCS, instead of adding it to the\n * properties file (like the rest of props), it's added to the Sentry CLI\n * config, which is added to the gitignore. This way makes the properties\n * file safe to commit without exposing any auth tokens.\n */\n if (authToken) {\n try {\n await fs.promises.appendFile(\n SENTRYCLIRC_FILENAME,\n this.dumpConfig({ auth: { token: authToken } }),\n );\n green(`✓ Successfully added the auth token to ${SENTRYCLIRC_FILENAME}`);\n } catch {\n red(\n `⚠ Could not add the auth token to ${SENTRYCLIRC_FILENAME}, ` +\n `please add it to identify your user account:\\n${authToken}`,\n );\n nl();\n }\n } else {\n red(\n `⚠ Did not find an auth token, please add your token to ${SENTRYCLIRC_FILENAME}`,\n );\n l(\n 'To generate an auth token, visit https://sentry.io/settings/account/api/auth-tokens/',\n );\n l(\n 'To learn how to configure Sentry CLI, visit ' +\n 'https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli',\n );\n }\n\n await addToGitignore(\n SENTRYCLIRC_FILENAME,\n `⚠ Could not add ${SENTRYCLIRC_FILENAME} to ${GITIGNORE_FILENAME}, ` +\n 'please add it to not commit your auth key.',\n );\n\n try {\n await fs.promises.writeFile(\n `./${PROPERTIES_FILENAME}`,\n this.dumpProperties(cliPropsToWrite),\n );\n green('✓ Successfully created sentry.properties');\n } catch {\n red(`⚠ Could not add org and project data to ${PROPERTIES_FILENAME}`);\n l(\n 'See docs for a manual setup: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli',\n );\n }\n nl();\n }\n}\n"]}
|
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
37
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
38
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -48,7 +71,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
48
71
|
};
|
|
49
72
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
73
|
exports.startWizard = exports.getCurrentIntegration = void 0;
|
|
51
|
-
var _ = require("lodash");
|
|
74
|
+
var _ = __importStar(require("lodash"));
|
|
52
75
|
var Constants_1 = require("../Constants");
|
|
53
76
|
var BottomBar_1 = require("./BottomBar");
|
|
54
77
|
var Logging_1 = require("./Logging");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../lib/Helper/Wizard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../lib/Helper/Wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAA4B;AAG5B,0CAA2C;AAG3C,yCAAwC;AACxC,qCAAgD;AAEhD,SAAS,uBAAuB,CAAC,IAAU;IACzC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,aAAG,EAAC,uCAAgC,IAAI,CAAC,GAAG,CAAE,CAAC,CAAC;KACjD;IACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAA,aAAG,EAAC,kCAAkC,CAAC,CAAC;KACzC;IACD,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;IACnB,iDAAiD;IACjD,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE;QACxB,iDAAiD;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,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,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;oBAChC,IAAA,YAAE,GAAE,CAAC;oBACL,IAAA,aAAG,EAAC,2CAA2C,CAAC,CAAC;oBACjD,IAAA,aAAG,EAAC,mCAAmC,CAAC,CAAC;oBACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;CAEnB;AA7BD,kCA6BC","sourcesContent":["import type { Answers } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport type { Args } from '../Constants';\nimport { DEFAULT_URL } from '../Constants';\nimport type { IStep } from '../Steps/BaseStep';\nimport type { BaseIntegration } from '../Steps/Integrations/BaseIntegration';\nimport { BottomBar } from './BottomBar';\nimport { debug, dim, nl, red } from './Logging';\n\nfunction sanitizeAndValidateArgs(argv: Args): void {\n if (!argv.url) {\n argv.url = DEFAULT_URL;\n dim(`no URL provided, fallback to ${argv.url}`);\n }\n if (argv.quiet === undefined) {\n argv.quiet = true;\n dim('will activate quiet mode for you');\n }\n let baseUrl = argv.url;\n baseUrl += baseUrl.endsWith('/') ? '' : '/';\n baseUrl = baseUrl.replace(/:\\/(?!\\/)/g, '://');\n argv.url = baseUrl;\n // @ts-ignore skip-connect does not exist on args\n if (argv['skip-connect']) {\n // @ts-ignore skip-connect does not exist on args\n argv.skipConnect = argv['skip-connect'];\n // @ts-ignore skip-connect does not exist on args\n delete argv['skip-connect'];\n }\n // @ts-ignore skip-connect does not exist on args\n argv.promoCode = argv['promo-code'];\n}\n\nexport function getCurrentIntegration(answers: Answers): BaseIntegration {\n return _.get(answers, 'integration') as BaseIntegration;\n}\n\nexport async function startWizard<M extends IStep>(\n argv: Args,\n ...steps: Array<{ new (debug: Args): M }>\n): Promise<Answers> {\n try {\n sanitizeAndValidateArgs(argv);\n if (argv.debug) {\n debug(argv);\n }\n if (argv.quiet) {\n dim(\"Quiet mode On, DAMA, don't ask me anything\");\n }\n return await steps\n .map((step) => new step(argv))\n .reduce(async (answer, step) => {\n const prevAnswer = await answer;\n const answers = await step.emit(prevAnswer);\n return { ...prevAnswer, ...answers };\n }, Promise.resolve({}));\n } catch (e) {\n BottomBar.hide();\n nl();\n red('Sentry Wizard failed with:');\n red(argv.debug ? e : e.message);\n nl();\n red('Protip: Add --debug to see whats going on');\n red('OR use --help to see your options');\n process.exit(1);\n }\n}\n"]}
|
|
@@ -1,8 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
/// <reference types="jest" />
|
|
4
|
-
var fs = require("fs");
|
|
5
|
-
var path = require("path");
|
|
27
|
+
var fs = __importStar(require("fs"));
|
|
28
|
+
var path = __importStar(require("path"));
|
|
6
29
|
var MergeConfig_1 = require("../MergeConfig");
|
|
7
30
|
var configPath = path.join(__dirname, '..', 'test-fixtures/next.config.js');
|
|
8
31
|
var templatePath = path.join(__dirname, '..', '..', '..', 'scripts/NextJs/configs/next.config.template.js');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/MergeConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/MergeConfig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,qCAAyB;AACzB,yCAA6B;AAE7B,8CAAiD;AAEjD,IAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,8BAA8B,CAAC,CAAC;AAC9E,IAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAC5B,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,gDAAgD,CACjD,CAAC;AAEF,SAAS,eAAe,CAAC,GAAW;IAIlC,IAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAC1B,SAAS,EACT,IAAI,EACJ,oCAA6B,GAAG,QAAK,CACtC,CAAC;IACF,IAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAC1B,SAAS,EACT,IAAI,EACJ,oCAA6B,GAAG,eAAY,CAC7C,CAAC;IACF,OAAO,EAAE,UAAU,YAAA,EAAE,UAAU,YAAA,EAAE,CAAC;AACpC,CAAC;AAED,QAAQ,CAAC,wBAAwB,EAAE;IAEjC,SAAS,CAAC;QACR,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,wCAAwC,EAAE;QACrC,IAAA,UAAU,GAAK,eAAe,CAAC,CAAC,CAAC,WAAvB,CAAwB;QAC1C,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,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AE,UAAU,gBAAuB,CAAC;QACtD,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAExC,IAAA,6BAAe,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QAE1C,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,gDAAgD,EAAE;QAC7C,IAAA,UAAU,GAAK,eAAe,CAAC,CAAC,CAAC,WAAvB,CAAwB;QAC1C,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAExC,MAAM,CAAC,IAAA,6BAAe,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,oCAAoC,EAAE;QACnC,IAAA,KAA6B,eAAe,CAAC,CAAC,CAAC,EAA7C,UAAU,gBAAA,EAAE,UAAU,gBAAuB,CAAC;QACtD,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAExC,IAAA,6BAAe,EAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QAE1C,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport * as fs from 'fs';\nimport * as path from 'path';\n\nimport { mergeConfigFile } from '../MergeConfig';\n\nconst configPath = path.join(__dirname, '..', 'test-fixtures/next.config.js');\nconst templatePath = path.join(\n __dirname,\n '..',\n '..',\n '..',\n 'scripts/NextJs/configs/next.config.template.js',\n);\n\nfunction configFileNames(num: number): {\n sourcePath: string;\n mergedPath: string;\n} {\n const sourcePath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}.js`,\n );\n const mergedPath = path.join(\n __dirname,\n '..',\n `test-fixtures/next.config.${num}-merged.js`,\n );\n return { sourcePath, mergedPath };\n}\n\ndescribe('Merging next.config.js', () => {\n\n afterEach(() => {\n fs.unlinkSync(configPath);\n });\n\n test('merge basic next.config.js return true', () => {\n const { sourcePath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge basic next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(1);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(fs.readFileSync(mergedPath, 'utf8'));\n });\n\n test('merge invalid javascript config return false', () => {\n const { sourcePath } = configFileNames(2);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(false);\n });\n\n test('merge more complicated next.config.js return true', () => {\n const { sourcePath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge more complicated next.config.js', () => {\n const { sourcePath, mergedPath } = configFileNames(3);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(fs.readFileSync(mergedPath, 'utf8'));\n });\n\n test('merge next.config.js with function return true', () => {\n const { sourcePath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n expect(mergeConfigFile(configPath, templatePath)).toBe(true);\n });\n\n test('merge next.config.js with function', () => {\n const { sourcePath, mergedPath } = configFileNames(4);\n fs.copyFileSync(sourcePath, configPath);\n\n mergeConfigFile(configPath, templatePath);\n\n expect(fs.readFileSync(configPath, 'utf8')).toEqual(fs.readFileSync(mergedPath, 'utf8'));\n });\n});\n"]}
|
package/dist/lib/Setup.js
CHANGED
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
37
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
38
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -57,10 +80,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
57
80
|
};
|
|
58
81
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
82
|
exports.run = void 0;
|
|
60
|
-
var _ = require("lodash");
|
|
83
|
+
var _ = __importStar(require("lodash"));
|
|
61
84
|
var Env_1 = require("./Helper/Env");
|
|
62
85
|
var Wizard_1 = require("./Helper/Wizard");
|
|
63
|
-
var Step = require("./Steps");
|
|
86
|
+
var Step = __importStar(require("./Steps"));
|
|
64
87
|
function run(argv) {
|
|
65
88
|
return __awaiter(this, void 0, void 0, function () {
|
|
66
89
|
var args, steps;
|
package/dist/lib/Setup.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA4B;AAE5B,oCAA+C;AAC/C,0CAA8C;AAC9C,4CAAgC;AAEhC,SAAsB,GAAG,CAAC,IAAS;;;;YAC3B,IAAI,yBAAQ,IAAI,GAAK,IAAA,qBAAe,GAAE,CAAE,CAAC;YAC/C,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;aACxB;YACG,KAAK,GAAG;gBACV,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,iBAAiB;gBACtB,IAAI,CAAC,eAAe;aACrB,CAAC;YACF,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;gBAC5B,KAAK,GAAG,CAAC,CAAC,MAAM,CACd,KAAK,EACL,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,mBAAmB,CACzB,CAAC;aACH;YACD,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5D,sBAAO,oBAAW,8BAAC,IAAI,GAAK,KAAK,WAAE;;;CACpC;AAtBD,kBAsBC","sourcesContent":["import * as _ from 'lodash';\n\nimport { readEnvironment } from './Helper/Env';\nimport { startWizard } from './Helper/Wizard';\nimport * as Step from './Steps';\n\nexport async function run(argv: any): Promise<any> {\n const args = { ...argv, ...readEnvironment() };\n if (args.uninstall === undefined) {\n args.uninstall = false;\n }\n let steps = [\n Step.Initial,\n Step.Welcome,\n Step.ChooseIntegration,\n Step.ShouldConfigure,\n ];\n if (args.uninstall === false) {\n steps = _.concat(\n steps,\n Step.OpenSentry,\n Step.WaitForSentry,\n Step.SentryProjectSelector,\n Step.PromptForParameters,\n );\n }\n steps = _.concat(steps, Step.ConfigureProject, Step.Result);\n return startWizard(args, ...steps);\n}\n"]}
|
|
@@ -14,6 +14,29 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
17
40
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
41
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
42
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -53,13 +76,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
53
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
77
|
exports.ChooseIntegration = void 0;
|
|
55
78
|
var inquirer_1 = require("inquirer");
|
|
56
|
-
var _ = require("lodash");
|
|
79
|
+
var _ = __importStar(require("lodash"));
|
|
57
80
|
var Constants_1 = require("../Constants");
|
|
58
81
|
var BaseStep_1 = require("./BaseStep");
|
|
59
82
|
var Cordova_1 = require("./Integrations/Cordova");
|
|
60
83
|
var Electron_1 = require("./Integrations/Electron");
|
|
61
84
|
var NextJs_1 = require("./Integrations/NextJs");
|
|
62
85
|
var ReactNative_1 = require("./Integrations/ReactNative");
|
|
86
|
+
var SvelteKit_1 = require("./Integrations/SvelteKit");
|
|
63
87
|
var projectPackage = {};
|
|
64
88
|
try {
|
|
65
89
|
// If we run directly in setup-wizard
|
|
@@ -115,6 +139,9 @@ var ChooseIntegration = /** @class */ (function (_super) {
|
|
|
115
139
|
case Constants_1.Integration.nextjs:
|
|
116
140
|
integration = new NextJs_1.NextJs(this._argv);
|
|
117
141
|
break;
|
|
142
|
+
case Constants_1.Integration.sveltekit:
|
|
143
|
+
integration = new SvelteKit_1.SvelteKit(this._argv);
|
|
144
|
+
break;
|
|
118
145
|
default:
|
|
119
146
|
integration = new ReactNative_1.ReactNative(this._argv);
|
|
120
147
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAClC,wCAA4B;AAE5B,0CAAkE;AAClE,uCAAsC;AACtC,kDAAiD;AACjD,oDAAmD;AACnD,gDAA+C;AAC/C,0DAAyD;AACzD,sDAAqD;AAErD,IAAI,cAAc,GAAQ,EAAE,CAAC;AAE7B,IAAI;IACF,qCAAqC;IACrC,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAChD;AAAC,WAAM;IACN,cAAc,GAAG,OAAO,CAAC,UAAG,OAAO,CAAC,GAAG,EAAE,kBAAe,CAAC,CAAC;CAC3D;AAED;IAAuC,qCAAQ;IAA/C;;IAwDA,CAAC;IAvDc,gCAAI,GAAjB,UAAkB,QAAiB;;;;;;wBAE7B,iBAAiB,GAAQ,IAAI,CAAC;6BAC9B,IAAI,CAAC,KAAK,CAAC,WAAW,EAAtB,wBAAsB;wBACxB,iBAAiB,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;;;wBAE5D,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;4BACpB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;yBACrD;wBACD,iBAAiB,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;wBAC/B,qBAAM,IAAA,iBAAM,EAAC;gCAC/B;oCACE,OAAO,EAAE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O;IACT,CAAC;IACH,wBAAC;AAAD,CAAC,AAxDD,CAAuC,mBAAQ,GAwD9C;AAxDY,8CAAiB","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport { getIntegrationChoices, Integration } from '../Constants';\nimport { BaseStep } from './BaseStep';\nimport { Cordova } from './Integrations/Cordova';\nimport { Electron } from './Integrations/Electron';\nimport { NextJs } from './Integrations/NextJs';\nimport { ReactNative } from './Integrations/ReactNative';\nimport { SvelteKit } from './Integrations/SvelteKit';\n\nlet projectPackage: any = {};\n\ntry {\n // If we run directly in setup-wizard\n projectPackage = require('../../package.json');\n} catch {\n projectPackage = require(`${process.cwd()}/package.json`);\n}\n\nexport class ChooseIntegration extends BaseStep {\n public async emit(_answers: Answers): Promise<Answers> {\n // If we receive project type as an arg we skip asking\n let integrationPrompt: any = null;\n if (this._argv.integration) {\n integrationPrompt = { integration: this._argv.integration };\n } else {\n if (this._argv.quiet) {\n throw new Error('You need to choose a integration');\n }\n integrationPrompt = this.tryDetectingIntegration();\n integrationPrompt = await prompt([\n {\n choices: getIntegrationChoices(),\n default: integrationPrompt,\n message: 'What integration do you want to set up?',\n name: 'integration',\n type: 'list',\n },\n ]);\n }\n\n let integration = null;\n switch (integrationPrompt.integration) {\n case Integration.reactNative:\n integration = new ReactNative(this._argv);\n break;\n case Integration.cordova:\n integration = new Cordova(this._argv);\n break;\n case Integration.electron:\n integration = new Electron(this._argv);\n break;\n case Integration.nextjs:\n integration = new NextJs(this._argv);\n break;\n case Integration.sveltekit:\n integration = new SvelteKit(this._argv);\n break;\n default:\n integration = new ReactNative(this._argv);\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n if (_.has(projectPackage, 'dependencies.react-native')) {\n return Integration.reactNative;\n }\n if (_.has(projectPackage, 'dependencies.cordova')) {\n return Integration.cordova;\n }\n return;\n }\n}\n"]}
|
|
@@ -14,6 +14,29 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
17
40
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
41
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
42
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -52,8 +75,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
75
|
};
|
|
53
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
77
|
exports.Initial = void 0;
|
|
55
|
-
var _ = require("lodash");
|
|
56
|
-
var path = require("path");
|
|
78
|
+
var _ = __importStar(require("lodash"));
|
|
79
|
+
var path = __importStar(require("path"));
|
|
57
80
|
var Logging_1 = require("../Helper/Logging");
|
|
58
81
|
var BaseStep_1 = require("./BaseStep");
|
|
59
82
|
var wizardPackage = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Initial.js","sourceRoot":"","sources":["../../../lib/Steps/Initial.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Initial.js","sourceRoot":"","sources":["../../../lib/Steps/Initial.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAA4B;AAC5B,yCAA6B;AAE7B,6CAAwC;AACxC,uCAAsC;AAEtC,IAAI,aAAa,GAAQ,EAAE,CAAC;AAC5B,IAAI,gBAAgB,GAAQ,EAAE,CAAC;AAE/B,IAAI;IACF,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAC/B,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAC/C,IAAI,EACJ,cAAc,CACf,CAAC,CAAC;CACJ;AAAC,WAAM;IACN,6BAA6B;CAC9B;AAED,IAAI;IACF,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAClC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,EAC5C,IAAI,EACJ,cAAc,CACf,CAAC,CAAC;CACJ;AAAC,WAAM;IACN,8BAA8B;CAC/B;AAED;IAA6B,2BAAQ;IAArC;;IAaA,CAAC;IAZC,4DAA4D;IAC/C,sBAAI,GAAjB,UAAkB,QAAiB;;;gBACjC,IAAA,aAAG,EAAC,0BAA0B,CAAC,CAAC;gBAChC,IAAA,aAAG,EACD,mBAAY,CAAC,CAAC,GAAG,CACf,aAAa,EACb,SAAS,EACT,KAAK,CACN,oCAA0B,CAAC,CAAC,GAAG,CAAC,gBAAgB,EAAE,SAAS,EAAE,KAAK,CAAC,CAAE,CACvE,CAAC;gBACF,sBAAO,EAAE,EAAC;;;KACX;IACH,cAAC;AAAD,CAAC,AAbD,CAA6B,mBAAQ,GAapC;AAbY,0BAAO","sourcesContent":["import type { Answers } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport { dim } from '../Helper/Logging';\nimport { BaseStep } from './BaseStep';\n\nlet wizardPackage: any = {};\nlet sentryCliPackage: any = {};\n\ntry {\n wizardPackage = require(path.join(\n path.dirname(require.resolve('@sentry/wizard')),\n '..',\n 'package.json',\n ));\n} catch {\n // We don't need to have this\n}\n\ntry {\n sentryCliPackage = require(path.join(\n path.dirname(require.resolve('@sentry/cli')),\n '..',\n 'package.json',\n ));\n} catch {\n // We don't need to have tahis\n}\n\nexport class Initial extends BaseStep {\n // eslint-disable-next-line @typescript-eslint/require-await\n public async emit(_answers: Answers): Promise<Answers> {\n dim('Running Sentry Wizard...');\n dim(\n `version: ${_.get(\n wizardPackage,\n 'version',\n 'DEV',\n )} | sentry-cli version: ${_.get(sentryCliPackage, 'version', 'DEV')}`,\n );\n return {};\n }\n}\n"]}
|
|
@@ -14,6 +14,29 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
17
40
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
41
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
42
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -52,7 +75,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
75
|
};
|
|
53
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
77
|
exports.BaseIntegration = void 0;
|
|
55
|
-
var _ = require("lodash");
|
|
78
|
+
var _ = __importStar(require("lodash"));
|
|
56
79
|
var BaseStep_1 = require("../BaseStep");
|
|
57
80
|
var BaseIntegration = /** @class */ (function (_super) {
|
|
58
81
|
__extends(BaseIntegration, _super);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseIntegration.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/BaseIntegration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BaseIntegration.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/BaseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAA4B;AAG5B,wCAAuC;AAEvC;IAA8C,mCAAQ;IAIpD,yBAA6B,KAAW;QAAxC,YACE,kBAAM,KAAK,CAAC,SAGb;QAJ4B,WAAK,GAAL,KAAK,CAAM;QAEtC,kEAAkE;QAClE,KAAI,CAAC,IAAI,GAAG,KAAI,CAAC,SAAS,CAAC;;IAC7B,CAAC;IAED,4DAA4D;IAC/C,mCAAS,GAAtB,UAAuB,QAAiB;;;gBACtC,sBAAO,EAAE,EAAC;;;KACX;IAED;;;;OAIG;IACU,yCAAe,GAA5B,UAA6B,QAAiB;;;gBAC5C,kEAAkE;gBAClE,IAAI,IAAI,CAAC,gBAAgB,EAAE;oBACzB,sBAAO,IAAI,CAAC,gBAAgB,EAAC;iBAC9B;gBACD,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC5D,sBAAO,IAAI,CAAC,gBAAgB,EAAC;;;KAC9B;IAEY,oCAAU,GAAvB,UAAwB,QAAiB;;;;;;wBAErC,KAAA,CAAA,KAAA,CAAC,CAAA,CAAC,IAAI,CAAA;wBACJ,KAAA,CAAA,KAAA,CAAC,CAAA,CAAC,MAAM,CAAA;wBACN,qBAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAA;4BAH1C,sBAAO,CACL,cACE,cACE,SAAoC,EACpC,UAAC,MAAe,IAAK,OAAA,MAAM,EAAN,CAAM,EAC5B,EACF,CAAC,MAAM,GAAG,CAAC,CACb,EAAC;;;;KACH;IAGH,sBAAC;AAAD,CAAC,AAzCD,CAA8C,mBAAQ,GAyCrD;AAzCqB,0CAAe","sourcesContent":["import type { Answers } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport type { Args } from '../../Constants';\nimport { BaseStep } from '../BaseStep';\n\nexport abstract class BaseIntegration extends BaseStep {\n public type: string;\n protected _shouldConfigure: Promise<Answers>;\n\n public constructor(protected _argv: Args) {\n super(_argv);\n // @ts-ignore property construct does not exist on BaseIntegration\n this.type = this.construct;\n }\n\n // eslint-disable-next-line @typescript-eslint/require-await\n public async uninstall(_answers: Answers): Promise<Answers> {\n return {};\n }\n\n /**\n * This can be used for example for platform:boolean to determine\n * if we should configure iOS/Android.\n * Basically this will be merged into answers so it can be checked by a later step.\n */\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n this._shouldConfigure = Promise.resolve({ platform: true });\n return this._shouldConfigure;\n }\n\n public async shouldEmit(_answers: Answers): Promise<boolean> {\n return (\n _.keys(\n _.pickBy(\n await this.shouldConfigure(_answers),\n (active: boolean) => active,\n ),\n ).length > 0\n );\n }\n\n public abstract emit(answers: Answers): Promise<Answers>;\n}\n"]}
|
|
@@ -14,6 +14,29 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
+
if (k2 === undefined) k2 = k;
|
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(o, k2, desc);
|
|
24
|
+
}) : (function(o, m, k, k2) {
|
|
25
|
+
if (k2 === undefined) k2 = k;
|
|
26
|
+
o[k2] = m[k];
|
|
27
|
+
}));
|
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
+
}) : function(o, v) {
|
|
31
|
+
o["default"] = v;
|
|
32
|
+
});
|
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
17
40
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
41
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
42
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -52,8 +75,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
75
|
};
|
|
53
76
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
77
|
exports.Cordova = void 0;
|
|
55
|
-
var fs = require("fs");
|
|
56
|
-
var path = require("path");
|
|
78
|
+
var fs = __importStar(require("fs"));
|
|
79
|
+
var path = __importStar(require("path"));
|
|
57
80
|
var File_1 = require("../../Helper/File");
|
|
58
81
|
var Logging_1 = require("../../Helper/Logging");
|
|
59
82
|
var SentryCli_1 = require("../../Helper/SentryCli");
|