@sentry/wizard 2.7.0 → 3.0.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 +12 -3
- package/dist/NextJs/configs/next.config.template.js +1 -1
- package/dist/bin.js +7 -3
- package/dist/bin.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/Constants.js +1 -1
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.js +2 -2
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/File.js +10 -12
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Logging.js +1 -1
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/Package.js +10 -10
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/PackageManager.js +6 -9
- package/dist/lib/Helper/PackageManager.js.map +1 -1
- package/dist/lib/Helper/SentryCli.d.ts +3 -3
- package/dist/lib/Helper/SentryCli.js +3 -3
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.d.ts +4 -4
- package/dist/lib/Helper/Wizard.js +11 -11
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +5 -5
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +9 -9
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +11 -9
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.d.ts +2 -2
- package/dist/lib/Steps/BaseStep.js +3 -3
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.d.ts +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +7 -5
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.d.ts +1 -1
- package/dist/lib/Steps/ConfigureProject.js +5 -3
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.d.ts +1 -1
- package/dist/lib/Steps/Initial.js +6 -4
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.d.ts +2 -2
- package/dist/lib/Steps/Integrations/BaseIntegration.js +5 -4
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.d.ts +2 -2
- package/dist/lib/Steps/Integrations/Cordova.js +12 -10
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.d.ts +2 -2
- package/dist/lib/Steps/Integrations/Electron.js +23 -21
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.d.ts +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +7 -5
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/Integrations/NextJs.d.ts +2 -2
- package/dist/lib/Steps/Integrations/NextJs.js +56 -52
- package/dist/lib/Steps/Integrations/NextJs.js.map +1 -1
- package/dist/lib/Steps/Integrations/ReactNative.d.ts +2 -2
- package/dist/lib/Steps/Integrations/ReactNative.js +52 -51
- package/dist/lib/Steps/Integrations/ReactNative.js.map +1 -1
- package/dist/lib/Steps/Integrations/__tests__/ReactNative.js +1 -1
- package/dist/lib/Steps/Integrations/__tests__/ReactNative.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.d.ts +1 -1
- package/dist/lib/Steps/OpenSentry.js +19 -17
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.d.ts +1 -1
- package/dist/lib/Steps/PromptForParameters.js +21 -19
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.d.ts +1 -1
- package/dist/lib/Steps/Result.js +7 -5
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.d.ts +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +6 -4
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.d.ts +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +5 -3
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.d.ts +1 -1
- package/dist/lib/Steps/WaitForSentry.js +11 -9
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.d.ts +1 -1
- package/dist/lib/Steps/Welcome.js +7 -6
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/Steps/index.js +1 -0
- package/dist/lib/Steps/index.js.map +1 -1
- package/dist/lib/__tests__/Env.js +1 -1
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/lib/__tests__/Setup.js +1 -1
- package/dist/lib/__tests__/Setup.js.map +1 -1
- package/lib/Helper/File.ts +2 -8
- package/lib/Helper/SentryCli.ts +3 -3
- package/lib/Helper/Wizard.ts +6 -5
- package/lib/Helper/__tests__/File.ts +5 -5
- package/lib/Helper/__tests__/SentryCli.ts +3 -2
- package/lib/Helper/test-fixtures/next.config.1-merged.js +1 -1
- package/lib/Helper/test-fixtures/next.config.3-merged.js +1 -1
- package/lib/Helper/test-fixtures/next.config.4-merged.js +1 -1
- package/lib/Steps/BaseStep.ts +3 -3
- package/lib/Steps/ChooseIntegration.ts +2 -1
- package/lib/Steps/ConfigureProject.ts +1 -1
- package/lib/Steps/Initial.ts +1 -1
- package/lib/Steps/Integrations/BaseIntegration.ts +3 -3
- package/lib/Steps/Integrations/Cordova.ts +5 -5
- package/lib/Steps/Integrations/Electron.ts +7 -6
- package/lib/Steps/Integrations/MobileProject.ts +2 -1
- package/lib/Steps/Integrations/NextJs.ts +7 -6
- package/lib/Steps/Integrations/ReactNative.ts +44 -24
- package/lib/Steps/Integrations/__tests__/ReactNative.ts +3 -2
- package/lib/Steps/OpenSentry.ts +1 -1
- package/lib/Steps/PromptForParameters.ts +3 -2
- package/lib/Steps/Result.ts +1 -1
- package/lib/Steps/SentryProjectSelector.ts +3 -2
- package/lib/Steps/ShouldConfigure.ts +1 -1
- package/lib/Steps/WaitForSentry.ts +3 -3
- package/lib/Steps/Welcome.ts +1 -1
- package/lib/__tests__/Setup.ts +1 -1
- package/package.json +9 -13
- package/scripts/NextJs/configs/next.config.template.js +1 -1
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
9
|
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -27,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
30
|
function step(op) {
|
|
29
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
33
|
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;
|
|
32
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
35
|
switch (op[0]) {
|
|
@@ -52,7 +54,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
52
54
|
exports.Welcome = void 0;
|
|
53
55
|
var Logging_1 = require("../Helper/Logging");
|
|
54
56
|
var BaseStep_1 = require("./BaseStep");
|
|
55
|
-
var Welcome = /** @class */ (function (_super) {
|
|
57
|
+
var Welcome = exports.Welcome = /** @class */ (function (_super) {
|
|
56
58
|
__extends(Welcome, _super);
|
|
57
59
|
function Welcome() {
|
|
58
60
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
@@ -64,8 +66,8 @@ var Welcome = /** @class */ (function (_super) {
|
|
|
64
66
|
return [2 /*return*/, {}];
|
|
65
67
|
}
|
|
66
68
|
if (this._argv.uninstall === false) {
|
|
67
|
-
Logging_1.green('Sentry Wizard will help you to configure your project');
|
|
68
|
-
Logging_1.dim('Thank you for using Sentry :)');
|
|
69
|
+
(0, Logging_1.green)('Sentry Wizard will help you to configure your project');
|
|
70
|
+
(0, Logging_1.dim)('Thank you for using Sentry :)');
|
|
69
71
|
}
|
|
70
72
|
Welcome._didShow = true;
|
|
71
73
|
return [2 /*return*/, {}];
|
|
@@ -75,5 +77,4 @@ var Welcome = /** @class */ (function (_super) {
|
|
|
75
77
|
Welcome._didShow = false;
|
|
76
78
|
return Welcome;
|
|
77
79
|
}(BaseStep_1.BaseStep));
|
|
78
|
-
exports.Welcome = Welcome;
|
|
79
80
|
//# sourceMappingURL=Welcome.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Welcome.js","sourceRoot":"","sources":["../../../lib/Steps/Welcome.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Welcome.js","sourceRoot":"","sources":["../../../lib/Steps/Welcome.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,6CAA+C;AAC/C,uCAAsC;AAEtC;IAA6B,2BAAQ;IAArC;;IAcA,CAAC;IAXc,sBAAI,GAAjB,UAAkB,QAAiB;;;gBACjC,IAAI,OAAO,CAAC,QAAQ,EAAE;oBACpB,sBAAO,EAAE,EAAC;iBACX;gBACD,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,KAAK,EAAE;oBAClC,IAAA,eAAK,EAAC,uDAAuD,CAAC,CAAC;oBAC/D,IAAA,aAAG,EAAC,+BAA+B,CAAC,CAAC;iBACtC;gBACD,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;gBACxB,sBAAO,EAAE,EAAC;;;KACX;IAZc,gBAAQ,GAAY,KAAK,CAAC;IAa3C,cAAC;CAAA,AAdD,CAA6B,mBAAQ,GAcpC","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport { dim, green } from '../Helper/Logging';\nimport { BaseStep } from './BaseStep';\n\nexport class Welcome extends BaseStep {\n private static _didShow: boolean = false;\n\n public async emit(_answers: Answers): Promise<Answers> {\n if (Welcome._didShow) {\n return {};\n }\n if (this._argv.uninstall === false) {\n green('Sentry Wizard will help you to configure your project');\n dim('Thank you for using Sentry :)');\n }\n Welcome._didShow = true;\n return {};\n }\n}\n"]}
|
package/dist/lib/Steps/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PromptForParameters = exports.ShouldConfigure = exports.ChooseIntegration = exports.ConfigureProject = exports.Result = exports.SentryProjectSelector = exports.Initial = exports.WaitForSentry = exports.OpenSentry = exports.Welcome = void 0;
|
|
3
4
|
var Welcome_1 = require("./Welcome");
|
|
4
5
|
Object.defineProperty(exports, "Welcome", { enumerable: true, get: function () { return Welcome_1.Welcome; } });
|
|
5
6
|
var OpenSentry_1 = require("./OpenSentry");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/Steps/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/Steps/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,iEAAgE;AAAvD,8HAAA,qBAAqB,OAAA;AAC9B,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,yDAAwD;AAA/C,sHAAA,iBAAiB,OAAA;AAC1B,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA","sourcesContent":["export { Welcome } from './Welcome';\nexport { OpenSentry } from './OpenSentry';\nexport { WaitForSentry } from './WaitForSentry';\nexport { Initial } from './Initial';\nexport { SentryProjectSelector } from './SentryProjectSelector';\nexport { Result } from './Result';\nexport { ConfigureProject } from './ConfigureProject';\nexport { ChooseIntegration } from './ChooseIntegration';\nexport { ShouldConfigure } from './ShouldConfigure';\nexport { PromptForParameters } from './PromptForParameters';\n"]}
|
|
@@ -17,7 +17,7 @@ describe('read-env', function () {
|
|
|
17
17
|
process.env.SENTRY_WIZARD_PLATFORM = ['ios', 'android'];
|
|
18
18
|
// @ts-ignore: true not assignable to string/undefined
|
|
19
19
|
process.env.SENTRY_WIZARD_URL = 'https://sentry.io';
|
|
20
|
-
expect(Env_1.readEnvironment()).toEqual({
|
|
20
|
+
expect((0, Env_1.readEnvironment)()).toEqual({
|
|
21
21
|
debug: true,
|
|
22
22
|
integration: 'reactNative,electron',
|
|
23
23
|
platform: 'ios,android',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Env.js","sourceRoot":"","sources":["../../../lib/__tests__/Env.ts"],"names":[],"mappings":";;AAAA,qCAAgD;AAEhD,QAAQ,CAAC,UAAU,EAAE;IACnB,IAAI,CAAC,WAAW,EAAE;QAChB,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC;QACvC,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,KAAK,CAAC;QAC5C,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,IAAI,CAAC;QAC9C,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC;QACvC,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QACpE,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACxD,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,mBAAmB,CAAC;QACpD,MAAM,CAAC,qBAAe,
|
|
1
|
+
{"version":3,"file":"Env.js","sourceRoot":"","sources":["../../../lib/__tests__/Env.ts"],"names":[],"mappings":";;AAAA,qCAAgD;AAEhD,QAAQ,CAAC,UAAU,EAAE;IACnB,IAAI,CAAC,WAAW,EAAE;QAChB,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC;QACvC,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,KAAK,CAAC;QAC5C,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,0BAA0B,GAAG,IAAI,CAAC;QAC9C,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,IAAI,CAAC;QACvC,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,yBAAyB,GAAG,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;QACpE,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACxD,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,iBAAiB,GAAG,mBAAmB,CAAC;QACpD,MAAM,CAAC,IAAA,qBAAe,GAAE,CAAC,CAAC,OAAO,CAAC;YAChC,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,sBAAsB;YACnC,QAAQ,EAAE,aAAa;YACvB,KAAK,EAAE,IAAI;YACX,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,KAAK;YAChB,GAAG,EAAE,mBAAmB;SACzB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { readEnvironment } from '../Helper/Env';\n\ndescribe('read-env', () => {\n test('transform', () => {\n // @ts-ignore: true not assignable to string/undefined\n process.env.SENTRY_WIZARD_DEBUG = true;\n // @ts-ignore: true not assignable to string/undefined\n process.env.SENTRY_WIZARD_UNINSTALL = false;\n // @ts-ignore: true not assignable to string/undefined\n process.env.SENTRY_WIZARD_SKIP_CONNECT = true;\n // @ts-ignore: true not assignable to string/undefined\n process.env.SENTRY_WIZARD_QUIET = true;\n // @ts-ignore: true not assignable to string/undefined\n process.env.SENTRY_WIZARD_INTEGRATION = ['reactNative', 'electron'];\n // @ts-ignore: true not assignable to string/undefined\n process.env.SENTRY_WIZARD_PLATFORM = ['ios', 'android'];\n // @ts-ignore: true not assignable to string/undefined\n process.env.SENTRY_WIZARD_URL = 'https://sentry.io';\n expect(readEnvironment()).toEqual({\n debug: true,\n integration: 'reactNative,electron',\n platform: 'ios,android',\n quiet: true,\n skipConnect: true,\n uninstall: false,\n url: 'https://sentry.io',\n });\n });\n});\n"]}
|
|
@@ -22,7 +22,7 @@ describe('Wizard', function () {
|
|
|
22
22
|
describe('React Native', function () {
|
|
23
23
|
test('run', function () {
|
|
24
24
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
25
|
-
expect(Setup_1.run({
|
|
25
|
+
expect((0, Setup_1.run)({
|
|
26
26
|
quiet: true,
|
|
27
27
|
integration: Constants_1.Integration.reactNative,
|
|
28
28
|
platform: [Constants_1.Platform.ios, Constants_1.Platform.android],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../../lib/__tests__/Setup.ts"],"names":[],"mappings":";;AAAA,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,4CAA4C;AAC5E,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAC3B,6CAA+C;AAE/C,0CAAqD;AACrD,kCAA+B;AAE/B,IAAM,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC;AAExC,IAAM,WAAW,GAAG;IACjB,aAAqB,CAAC,IAAI,GAAG,YAAY,CAAC;AAC7C,CAAC,CAAC;AAEF,IAAM,QAAQ,GAAG;
|
|
1
|
+
{"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../../lib/__tests__/Setup.ts"],"names":[],"mappings":";;AAAA,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,4CAA4C;AAC5E,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAC3B,6CAA+C;AAE/C,0CAAqD;AACrD,kCAA+B;AAE/B,IAAM,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC;AAExC,IAAM,WAAW,GAAG;IACjB,aAAqB,CAAC,IAAI,GAAG,YAAY,CAAC;AAC7C,CAAC,CAAC;AAEF,IAAM,QAAQ,GAAG;IACd,aAAa,CAAC,IAA6B,CAAC,kBAAkB,CAC7D,UAAC,QAAQ,EAAE,QAAQ,IAAK,OAAA,QAAQ,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAA9B,CAA8B,CACvD,CAAC;AACJ,CAAC,CAAC;AAEF,QAAQ,CAAC,QAAQ,EAAE;IACjB,UAAU,CAAC;QACT,QAAQ,EAAE,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC;QACR,WAAW,EAAE,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,cAAc,EAAE;QACvB,IAAI,CAAC,KAAK,EAAE;YACV,mEAAmE;YACnE,MAAM,CACJ,IAAA,WAAG,EAAC;gBACF,KAAK,EAAE,IAAI;gBACX,WAAW,EAAE,uBAAW,CAAC,WAAW;gBACpC,QAAQ,EAAE,CAAC,oBAAQ,CAAC,GAAG,EAAE,oBAAQ,CAAC,OAAO,CAAC;gBAC1C,WAAW,EAAE,IAAI;aAClB,CAAC,CACH,CAAC,UAAU,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('../Helper/Logging'); // We mock logging to not pollute the output\njest.mock('child_process');\nimport * as child_process from 'child_process';\n\nimport { Integration, Platform } from '../Constants';\nimport { run } from '../Setup';\n\nconst originalExec = child_process.exec;\n\nconst restoreExec = (): void => {\n (child_process as any).exec = originalExec;\n};\n\nconst mockExec = (): void => {\n (child_process.exec as unknown as jest.Mock).mockImplementation(\n (_command, callback) => callback(null, { stdout: '' }),\n );\n};\n\ndescribe('Wizard', () => {\n beforeEach(() => {\n mockExec();\n });\n\n afterEach(() => {\n restoreExec();\n });\n\n describe('React Native', () => {\n test('run', () => {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n expect(\n run({\n quiet: true,\n integration: Integration.reactNative,\n platform: [Platform.ios, Platform.android],\n skipConnect: true,\n }),\n ).toBeTruthy();\n });\n });\n});\n"]}
|
package/lib/Helper/File.ts
CHANGED
|
@@ -18,7 +18,7 @@ export function patchMatchingFile(
|
|
|
18
18
|
});
|
|
19
19
|
rv = rv
|
|
20
20
|
.then(() => func(contents, match, ...args))
|
|
21
|
-
.then(newContents => {
|
|
21
|
+
.then((newContents) => {
|
|
22
22
|
if (
|
|
23
23
|
newContents !== null &&
|
|
24
24
|
newContents !== undefined &&
|
|
@@ -60,12 +60,6 @@ export function matchesContent(
|
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
return matches.reduce((prev: boolean, match: string) => {
|
|
63
|
-
return !!(
|
|
64
|
-
prev &&
|
|
65
|
-
fs
|
|
66
|
-
.readFileSync(match)
|
|
67
|
-
.toString()
|
|
68
|
-
.match(contentPattern)
|
|
69
|
-
);
|
|
63
|
+
return !!(prev && fs.readFileSync(match).toString().match(contentPattern));
|
|
70
64
|
}, true);
|
|
71
65
|
}
|
package/lib/Helper/SentryCli.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Answers } from 'inquirer';
|
|
1
|
+
import type { Answers } from 'inquirer';
|
|
2
2
|
import * as _ from 'lodash';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
|
|
5
|
-
import { Args } from '../Constants';
|
|
5
|
+
import type { Args } from '../Constants';
|
|
6
6
|
|
|
7
7
|
export interface SentryCliProps {
|
|
8
8
|
[s: string]: string;
|
|
@@ -14,7 +14,7 @@ export class SentryCli {
|
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/typedef
|
|
15
15
|
private _resolve = require.resolve;
|
|
16
16
|
|
|
17
|
-
constructor(protected _argv: Args) {}
|
|
17
|
+
public constructor(protected _argv: Args) {}
|
|
18
18
|
|
|
19
19
|
public setResolveFunction(resolve: (path: string) => string): void {
|
|
20
20
|
this._resolve = resolve as any;
|
package/lib/Helper/Wizard.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Answers } from 'inquirer';
|
|
1
|
+
import type { Answers } from 'inquirer';
|
|
2
2
|
import * as _ from 'lodash';
|
|
3
3
|
|
|
4
|
-
import { Args
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import type { Args } from '../Constants';
|
|
5
|
+
import { DEFAULT_URL } from '../Constants';
|
|
6
|
+
import type { IStep } from '../Steps/BaseStep';
|
|
7
|
+
import type { BaseIntegration } from '../Steps/Integrations/BaseIntegration';
|
|
7
8
|
import { BottomBar } from './BottomBar';
|
|
8
9
|
import { debug, dim, nl, red } from './Logging';
|
|
9
10
|
|
|
@@ -48,7 +49,7 @@ export async function startWizard<M extends IStep>(
|
|
|
48
49
|
dim("Quiet mode On, DAMA, don't ask me anything");
|
|
49
50
|
}
|
|
50
51
|
return await steps
|
|
51
|
-
.map(step => new step(argv))
|
|
52
|
+
.map((step) => new step(argv))
|
|
52
53
|
.reduce(async (answer, step) => {
|
|
53
54
|
const prevAnswer = await answer;
|
|
54
55
|
const answers = await step.emit(prevAnswer);
|
|
@@ -3,13 +3,13 @@ import { exists, matchesContent } from '../File';
|
|
|
3
3
|
|
|
4
4
|
describe('SentryCli', () => {
|
|
5
5
|
test('exists', () => {
|
|
6
|
-
expect(exists(
|
|
7
|
-
expect(exists(
|
|
6
|
+
expect(exists('**/File.ts')).toBeTruthy();
|
|
7
|
+
expect(exists('Filea.ts')).toBeFalsy();
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
test('matchesContent', () => {
|
|
11
|
-
expect(matchesContent(
|
|
12
|
-
expect(matchesContent(
|
|
13
|
-
expect(matchesContent(
|
|
11
|
+
expect(matchesContent('**/File.ts', /exists/g)).toBeTruthy();
|
|
12
|
+
expect(matchesContent('**/File.ts', /blabla/g)).toBeFalsy();
|
|
13
|
+
expect(matchesContent('Filea.ts', /exists/g)).toBeFalsy();
|
|
14
14
|
});
|
|
15
15
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="jest" />
|
|
2
|
-
import { Answers } from 'inquirer';
|
|
2
|
+
import type { Answers } from 'inquirer';
|
|
3
3
|
|
|
4
|
-
import { Args
|
|
4
|
+
import type { Args} from '../../Constants';
|
|
5
|
+
import { Integration, Platform } from '../../Constants';
|
|
5
6
|
import { SentryCli } from '../SentryCli';
|
|
6
7
|
|
|
7
8
|
const args: Args = {
|
package/lib/Steps/BaseStep.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Answers } from 'inquirer';
|
|
1
|
+
import type { Answers } from 'inquirer';
|
|
2
2
|
|
|
3
|
-
import { Args } from '../Constants';
|
|
3
|
+
import type { Args } from '../Constants';
|
|
4
4
|
import { debug, nl } from '../Helper/Logging';
|
|
5
5
|
|
|
6
6
|
export abstract class BaseStep implements IStep {
|
|
7
7
|
protected _isDebug: boolean = false;
|
|
8
|
-
constructor(protected _argv: Args) {
|
|
8
|
+
public constructor(protected _argv: Args) {
|
|
9
9
|
this._isDebug = _argv.debug;
|
|
10
10
|
}
|
|
11
11
|
|
package/lib/Steps/Initial.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Answers } from 'inquirer';
|
|
1
|
+
import type { Answers } from 'inquirer';
|
|
2
2
|
import * as _ from 'lodash';
|
|
3
3
|
|
|
4
|
-
import { Args } from '../../Constants';
|
|
4
|
+
import type { Args } from '../../Constants';
|
|
5
5
|
import { BaseStep } from '../BaseStep';
|
|
6
6
|
|
|
7
7
|
export abstract class BaseIntegration extends BaseStep {
|
|
8
8
|
public type: string;
|
|
9
9
|
protected _shouldConfigure: Promise<Answers>;
|
|
10
10
|
|
|
11
|
-
constructor(protected _argv: Args) {
|
|
11
|
+
public constructor(protected _argv: Args) {
|
|
12
12
|
super(_argv);
|
|
13
13
|
// @ts-ignore property construct does not exist on BaseIntegration
|
|
14
14
|
this.type = this.construct;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
|
-
import { Answers } from 'inquirer';
|
|
2
|
+
import type { Answers } from 'inquirer';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
|
|
5
|
-
import { Args } from '../../Constants';
|
|
5
|
+
import type { Args } from '../../Constants';
|
|
6
6
|
import { exists, matchesContent, patchMatchingFile } from '../../Helper/File';
|
|
7
7
|
import { green } from '../../Helper/Logging';
|
|
8
8
|
import { SentryCli } from '../../Helper/SentryCli';
|
|
@@ -15,7 +15,7 @@ export class Cordova extends BaseIntegration {
|
|
|
15
15
|
protected _folderPrefix: string = 'platforms';
|
|
16
16
|
protected _pluginFolder: string[] = ['.'];
|
|
17
17
|
|
|
18
|
-
constructor(protected _argv: Args) {
|
|
18
|
+
public constructor(protected _argv: Args) {
|
|
19
19
|
super(_argv);
|
|
20
20
|
this._sentryCli = new SentryCli(this._argv);
|
|
21
21
|
}
|
|
@@ -35,7 +35,7 @@ export class Cordova extends BaseIntegration {
|
|
|
35
35
|
);
|
|
36
36
|
|
|
37
37
|
await this._addSentryProperties(sentryCliProperties);
|
|
38
|
-
green(
|
|
38
|
+
green('Successfully set up for cordova');
|
|
39
39
|
|
|
40
40
|
return {};
|
|
41
41
|
}
|
|
@@ -57,7 +57,7 @@ export class Cordova extends BaseIntegration {
|
|
|
57
57
|
let result = false;
|
|
58
58
|
if (!exists(path.join('sentry.properties'))) {
|
|
59
59
|
result = true;
|
|
60
|
-
this.debug(
|
|
60
|
+
this.debug('sentry.properties not exists');
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if (
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
|
-
import { Answers
|
|
2
|
+
import type { Answers} from 'inquirer';
|
|
3
|
+
import { prompt } from 'inquirer';
|
|
3
4
|
import * as _ from 'lodash';
|
|
4
5
|
import * as path from 'path';
|
|
5
6
|
|
|
6
|
-
import { Args } from '../../Constants';
|
|
7
|
-
import {
|
|
7
|
+
import type { Args } from '../../Constants';
|
|
8
|
+
import { dim, green, l, nl, red } from '../../Helper/Logging';
|
|
8
9
|
import { SentryCli } from '../../Helper/SentryCli';
|
|
9
10
|
import { BaseIntegration } from './BaseIntegration';
|
|
10
11
|
|
|
@@ -42,7 +43,7 @@ try {
|
|
|
42
43
|
export class Electron extends BaseIntegration {
|
|
43
44
|
protected _sentryCli: SentryCli;
|
|
44
45
|
|
|
45
|
-
constructor(protected _argv: Args) {
|
|
46
|
+
public constructor(protected _argv: Args) {
|
|
46
47
|
super(_argv);
|
|
47
48
|
this._sentryCli = new SentryCli(this._argv);
|
|
48
49
|
}
|
|
@@ -56,7 +57,7 @@ export class Electron extends BaseIntegration {
|
|
|
56
57
|
'./sentry.properties',
|
|
57
58
|
this._sentryCli.dumpProperties(sentryCliProps),
|
|
58
59
|
);
|
|
59
|
-
green(
|
|
60
|
+
green('Successfully created sentry.properties');
|
|
60
61
|
nl();
|
|
61
62
|
|
|
62
63
|
printExample(
|
|
@@ -122,7 +123,7 @@ export class Electron extends BaseIntegration {
|
|
|
122
123
|
!_.get(appPackage, `devDependencies.${packageName}`, false)
|
|
123
124
|
) {
|
|
124
125
|
red(`✗ ${packageName} isn't in your dependencies`);
|
|
125
|
-
red(
|
|
126
|
+
red(' please install it with yarn/npm');
|
|
126
127
|
return false;
|
|
127
128
|
} else if (
|
|
128
129
|
minVersion &&
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import Chalk from 'chalk';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
|
-
import { Answers
|
|
4
|
+
import type { Answers } from 'inquirer';
|
|
5
|
+
import { prompt } from 'inquirer';
|
|
5
6
|
import * as _ from 'lodash';
|
|
6
7
|
import * as path from 'path';
|
|
7
|
-
import { satisfies, subset, valid, validRange } from 'semver';
|
|
8
8
|
|
|
9
|
-
import { Args } from '../../Constants';
|
|
9
|
+
import type { Args } from '../../Constants';
|
|
10
10
|
import { debug, green, l, nl, red } from '../../Helper/Logging';
|
|
11
11
|
import { mergeConfigFile } from '../../Helper/MergeConfig';
|
|
12
12
|
import { checkPackageVersion } from '../../Helper/Package';
|
|
13
13
|
import { getPackageMangerChoice } from '../../Helper/PackageManager';
|
|
14
|
-
import {
|
|
14
|
+
import type { SentryCliProps } from '../../Helper/SentryCli';
|
|
15
|
+
import { SentryCli } from '../../Helper/SentryCli';
|
|
15
16
|
import { BaseIntegration } from './BaseIntegration';
|
|
16
17
|
|
|
17
18
|
const COMPATIBLE_NEXTJS_VERSIONS = '>=10.0.8 <14.0.0';
|
|
@@ -43,7 +44,7 @@ try {
|
|
|
43
44
|
export class NextJs extends BaseIntegration {
|
|
44
45
|
protected _sentryCli: SentryCli;
|
|
45
46
|
|
|
46
|
-
constructor(protected _argv: Args) {
|
|
47
|
+
public constructor(protected _argv: Args) {
|
|
47
48
|
super(_argv);
|
|
48
49
|
this._sentryCli = new SentryCli(this._argv);
|
|
49
50
|
}
|
|
@@ -206,7 +207,7 @@ export class NextJs extends BaseIntegration {
|
|
|
206
207
|
`./${PROPERTIES_FILENAME}`,
|
|
207
208
|
this._sentryCli.dumpProperties(cliPropsToWrite),
|
|
208
209
|
);
|
|
209
|
-
green(
|
|
210
|
+
green('✓ Successfully created sentry.properties');
|
|
210
211
|
} catch {
|
|
211
212
|
red(`⚠ Could not add org and project data to ${PROPERTIES_FILENAME}`);
|
|
212
213
|
l(
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
/* eslint-disable max-lines */
|
|
2
2
|
import { exec } from 'child_process';
|
|
3
3
|
import * as fs from 'fs';
|
|
4
|
-
import { Answers
|
|
4
|
+
import type { Answers} from 'inquirer';
|
|
5
|
+
import { prompt } from 'inquirer';
|
|
5
6
|
import * as _ from 'lodash';
|
|
6
7
|
import * as path from 'path';
|
|
7
8
|
import { promisify } from 'util';
|
|
8
9
|
|
|
9
|
-
import { Args } from '../../Constants';
|
|
10
|
-
import {
|
|
10
|
+
import type { Args } from '../../Constants';
|
|
11
|
+
import {
|
|
12
|
+
exists,
|
|
13
|
+
matchesContent,
|
|
14
|
+
matchFiles,
|
|
15
|
+
patchMatchingFile,
|
|
16
|
+
} from '../../Helper/File';
|
|
11
17
|
import { dim, green, nl, red } from '../../Helper/Logging';
|
|
12
18
|
import { checkPackageVersion } from '../../Helper/Package';
|
|
13
19
|
import { getPackageMangerChoice } from '../../Helper/PackageManager';
|
|
@@ -22,10 +28,10 @@ export const COMPATIBLE_SDK_VERSION = '>= 5.0.0';
|
|
|
22
28
|
export const SENTRY_REACT_NATIVE_PACKAGE = '@sentry/react-native';
|
|
23
29
|
export const REACT_NATIVE_PACKAGE = 'react-native';
|
|
24
30
|
|
|
25
|
-
export const DOCS_MANUAL_STEPS =
|
|
31
|
+
export const DOCS_MANUAL_STEPS =
|
|
32
|
+
'https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/';
|
|
26
33
|
|
|
27
34
|
export class ReactNative extends MobileProject {
|
|
28
|
-
|
|
29
35
|
/**
|
|
30
36
|
* All React Native versions have app/build.gradle with android section.
|
|
31
37
|
*/
|
|
@@ -34,7 +40,7 @@ export class ReactNative extends MobileProject {
|
|
|
34
40
|
protected _answers: Answers;
|
|
35
41
|
protected _sentryCli: SentryCli;
|
|
36
42
|
|
|
37
|
-
constructor(protected _argv: Args) {
|
|
43
|
+
public constructor(protected _argv: Args) {
|
|
38
44
|
super(_argv);
|
|
39
45
|
this._sentryCli = new SentryCli(this._argv);
|
|
40
46
|
}
|
|
@@ -59,7 +65,7 @@ export class ReactNative extends MobileProject {
|
|
|
59
65
|
);
|
|
60
66
|
if (!hasCompatibleReactNativeVersion && !this._argv.quiet) {
|
|
61
67
|
userAnswers = await prompt({
|
|
62
|
-
message:
|
|
68
|
+
message: 'Your version of React Native is not compatible with Sentry\'s React Native SDK. Do you want to continue?',
|
|
63
69
|
name: 'continue',
|
|
64
70
|
default: false,
|
|
65
71
|
type: 'confirm',
|
|
@@ -67,7 +73,9 @@ export class ReactNative extends MobileProject {
|
|
|
67
73
|
nl();
|
|
68
74
|
}
|
|
69
75
|
if (!userAnswers.continue) {
|
|
70
|
-
throw new Error(
|
|
76
|
+
throw new Error(
|
|
77
|
+
`Please upgrade to a version that is compatible with ${COMPATIBLE_REACT_NATIVE_VERSIONS}. Or use ${DOCS_MANUAL_STEPS}`,
|
|
78
|
+
);
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
if (packageManager) {
|
|
@@ -89,7 +97,9 @@ export class ReactNative extends MobileProject {
|
|
|
89
97
|
nl();
|
|
90
98
|
}
|
|
91
99
|
if (!userAnswers.continue) {
|
|
92
|
-
throw new Error(
|
|
100
|
+
throw new Error(
|
|
101
|
+
`Please upgrade to a version that is compatible with ${COMPATIBLE_SDK_VERSION}.`,
|
|
102
|
+
);
|
|
93
103
|
}
|
|
94
104
|
|
|
95
105
|
const sentryCliProperties = this._sentryCli.convertAnswersToProperties(
|
|
@@ -104,15 +114,15 @@ export class ReactNative extends MobileProject {
|
|
|
104
114
|
'ios/*.xcodeproj/project.pbxproj',
|
|
105
115
|
this._patchXcodeProj.bind(this),
|
|
106
116
|
);
|
|
107
|
-
green(
|
|
117
|
+
green('✓ Patched build script in Xcode project.');
|
|
108
118
|
await this._podInstall();
|
|
109
|
-
green(
|
|
119
|
+
green('✓ Pods installed.');
|
|
110
120
|
} else {
|
|
111
121
|
await patchMatchingFile(
|
|
112
122
|
'**/app/build.gradle',
|
|
113
123
|
this._patchBuildGradle.bind(this),
|
|
114
124
|
);
|
|
115
|
-
green(
|
|
125
|
+
green('✓ Patched build.gradle file.');
|
|
116
126
|
}
|
|
117
127
|
await this._patchJsSentryInit(platform, answers);
|
|
118
128
|
await this._addSentryProperties(platform, sentryCliProperties);
|
|
@@ -184,7 +194,9 @@ export class ReactNative extends MobileProject {
|
|
|
184
194
|
let appPackage: Record<string, unknown> = {};
|
|
185
195
|
|
|
186
196
|
try {
|
|
187
|
-
appPackage = JSON.parse(
|
|
197
|
+
appPackage = JSON.parse(
|
|
198
|
+
fs.readFileSync(path.join(process.cwd(), 'package.json'), 'utf8'),
|
|
199
|
+
);
|
|
188
200
|
} catch {
|
|
189
201
|
// We don't need to have this
|
|
190
202
|
}
|
|
@@ -282,9 +294,9 @@ export class ReactNative extends MobileProject {
|
|
|
282
294
|
// eslint-disable-next-line prefer-template
|
|
283
295
|
match +
|
|
284
296
|
"\n\nimport * as Sentry from '@sentry/react-native';\n\n" +
|
|
285
|
-
|
|
297
|
+
'Sentry.init({ \n' +
|
|
286
298
|
` dsn: '${dsn}', \n` +
|
|
287
|
-
|
|
299
|
+
'});\n',
|
|
288
300
|
),
|
|
289
301
|
);
|
|
290
302
|
}
|
|
@@ -321,9 +333,7 @@ export class ReactNative extends MobileProject {
|
|
|
321
333
|
private _patchExistingXcodeBuildScripts(buildScripts: any): void {
|
|
322
334
|
for (const script of buildScripts) {
|
|
323
335
|
if (
|
|
324
|
-
!script.shellScript.match(
|
|
325
|
-
/\/scripts\/react-native-xcode\.sh/i,
|
|
326
|
-
) ||
|
|
336
|
+
!script.shellScript.match(/\/scripts\/react-native-xcode\.sh/i) ||
|
|
327
337
|
script.shellScript.match(/sentry-cli\s+react-native\s+xcode/i)
|
|
328
338
|
) {
|
|
329
339
|
continue;
|
|
@@ -337,7 +347,7 @@ export class ReactNative extends MobileProject {
|
|
|
337
347
|
'$REACT_NATIVE_XCODE',
|
|
338
348
|
() =>
|
|
339
349
|
// eslint-disable-next-line no-useless-escape
|
|
340
|
-
'
|
|
350
|
+
'\\"../node_modules/@sentry/cli/bin/sentry-cli react-native xcode $REACT_NATIVE_XCODE\\"',
|
|
341
351
|
) +
|
|
342
352
|
'\n/bin/sh ../node_modules/@sentry/react-native/scripts/collect-modules.sh\n';
|
|
343
353
|
script.shellScript = JSON.stringify(code);
|
|
@@ -346,7 +356,11 @@ export class ReactNative extends MobileProject {
|
|
|
346
356
|
|
|
347
357
|
private _addNewXcodeBuildPhaseForSymbols(buildScripts: any, proj: any): void {
|
|
348
358
|
for (const script of buildScripts) {
|
|
349
|
-
if (
|
|
359
|
+
if (
|
|
360
|
+
script.shellScript.match(
|
|
361
|
+
/sentry-cli\s+(upload-dsym|debug-files upload)/,
|
|
362
|
+
)
|
|
363
|
+
) {
|
|
350
364
|
return;
|
|
351
365
|
}
|
|
352
366
|
}
|
|
@@ -358,7 +372,7 @@ export class ReactNative extends MobileProject {
|
|
|
358
372
|
null,
|
|
359
373
|
{
|
|
360
374
|
shellPath: '/bin/sh',
|
|
361
|
-
shellScript
|
|
375
|
+
shellScript: `
|
|
362
376
|
export SENTRY_PROPERTIES=sentry.properties
|
|
363
377
|
[[ $SENTRY_INCLUDE_NATIVE_SOURCES == "true" ]] && INCLUDE_SOURCES_FLAG="--include-sources" || INCLUDE_SOURCES_FLAG=""
|
|
364
378
|
../node_modules/@sentry/cli/bin/sentry-cli debug-files upload "$INCLUDE_SOURCES_FLAG" "$DWARF_DSYM_FOLDER_PATH"
|
|
@@ -367,7 +381,10 @@ export SENTRY_PROPERTIES=sentry.properties
|
|
|
367
381
|
);
|
|
368
382
|
}
|
|
369
383
|
|
|
370
|
-
private _patchXcodeProj(
|
|
384
|
+
private _patchXcodeProj(
|
|
385
|
+
contents: string,
|
|
386
|
+
filename: string,
|
|
387
|
+
): Promise<string | undefined> {
|
|
371
388
|
const proj = xcode.project(filename);
|
|
372
389
|
return new Promise((resolve, reject) => {
|
|
373
390
|
proj.parse((err: any) => {
|
|
@@ -409,7 +426,7 @@ export SENTRY_PROPERTIES=sentry.properties
|
|
|
409
426
|
// continue prompt.
|
|
410
427
|
const newContents = proj.writeSync();
|
|
411
428
|
if (newContents === contents) {
|
|
412
|
-
resolve();
|
|
429
|
+
resolve(undefined);
|
|
413
430
|
} else {
|
|
414
431
|
resolve(newContents);
|
|
415
432
|
}
|
|
@@ -442,7 +459,10 @@ export SENTRY_PROPERTIES=sentry.properties
|
|
|
442
459
|
JSON.parse(script.shellScript)
|
|
443
460
|
// remove sentry properties export
|
|
444
461
|
.replace(/^export SENTRY_PROPERTIES=sentry.properties\r?\n/m, '')
|
|
445
|
-
.replace(
|
|
462
|
+
.replace(
|
|
463
|
+
/^\/bin\/sh ..\/node_modules\/@sentry\/react-native\/scripts\/collect-modules.sh\r?\n/m,
|
|
464
|
+
'',
|
|
465
|
+
)
|
|
446
466
|
// unwrap react-native-xcode.sh command. In case someone replaced it
|
|
447
467
|
// entirely with the sentry-cli command we need to put the original
|
|
448
468
|
// version back in.
|
|
@@ -2,12 +2,13 @@ jest.mock('../../../Helper/Logging.ts'); // We mock logging to not pollute the o
|
|
|
2
2
|
jest.mock('child_process');
|
|
3
3
|
import * as child_process from 'child_process';
|
|
4
4
|
import * as fs from 'fs';
|
|
5
|
-
import { Answers } from 'inquirer';
|
|
5
|
+
import type { Answers } from 'inquirer';
|
|
6
6
|
import * as path from 'path';
|
|
7
7
|
import * as process from 'process';
|
|
8
8
|
import * as rimraf from 'rimraf';
|
|
9
9
|
|
|
10
|
-
import { Args
|
|
10
|
+
import type { Args} from '../../../Constants';
|
|
11
|
+
import { Integration, Platform } from '../../../Constants';
|
|
11
12
|
import { ReactNative } from '../ReactNative';
|
|
12
13
|
|
|
13
14
|
const testDir = 'rn-test';
|