@sentry/wizard 2.6.1 → 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 +19 -2
- 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.d.ts +1 -0
- package/dist/lib/Helper/Package.js +46 -0
- package/dist/lib/Helper/Package.js.map +1 -0
- package/dist/lib/Helper/PackageManager.d.ts +22 -0
- package/dist/lib/Helper/PackageManager.js +132 -0
- package/dist/lib/Helper/PackageManager.js.map +1 -0
- 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 +13 -12
- 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 +29 -18
- 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 -7
- package/dist/lib/Steps/Integrations/NextJs.js +59 -134
- package/dist/lib/Steps/Integrations/NextJs.js.map +1 -1
- package/dist/lib/Steps/Integrations/ReactNative.d.ts +9 -2
- package/dist/lib/Steps/Integrations/ReactNative.js +148 -78
- package/dist/lib/Steps/Integrations/ReactNative.js.map +1 -1
- package/dist/lib/Steps/Integrations/__tests__/ReactNative.js +43 -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 +16 -1
- package/dist/lib/__tests__/Setup.js.map +1 -1
- package/lib/Helper/File.ts +2 -8
- package/lib/Helper/Package.ts +61 -0
- package/lib/Helper/PackageManager.ts +64 -0
- package/lib/Helper/SentryCli.ts +3 -3
- package/lib/Helper/Wizard.ts +7 -6
- package/lib/Helper/__tests__/File.ts +5 -5
- package/lib/Helper/__tests__/MergeConfig.ts +36 -20
- 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 +15 -114
- package/lib/Steps/Integrations/ReactNative.ts +143 -52
- package/lib/Steps/Integrations/__tests__/ReactNative.ts +37 -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 +23 -0
- 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"]}
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
jest.mock('../Helper/Logging'); // We mock logging to not pollute the output
|
|
4
|
+
jest.mock('child_process');
|
|
5
|
+
var child_process = require("child_process");
|
|
4
6
|
var Constants_1 = require("../Constants");
|
|
5
7
|
var Setup_1 = require("../Setup");
|
|
8
|
+
var originalExec = child_process.exec;
|
|
9
|
+
var restoreExec = function () {
|
|
10
|
+
child_process.exec = originalExec;
|
|
11
|
+
};
|
|
12
|
+
var mockExec = function () {
|
|
13
|
+
child_process.exec.mockImplementation(function (_command, callback) { return callback(null, { stdout: '' }); });
|
|
14
|
+
};
|
|
6
15
|
describe('Wizard', function () {
|
|
16
|
+
beforeEach(function () {
|
|
17
|
+
mockExec();
|
|
18
|
+
});
|
|
19
|
+
afterEach(function () {
|
|
20
|
+
restoreExec();
|
|
21
|
+
});
|
|
7
22
|
describe('React Native', function () {
|
|
8
23
|
test('run', function () {
|
|
9
24
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
10
|
-
expect(Setup_1.run({
|
|
25
|
+
expect((0, Setup_1.run)({
|
|
11
26
|
quiet: true,
|
|
12
27
|
integration: Constants_1.Integration.reactNative,
|
|
13
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,0CAAqD;AACrD,kCAA+B;AAE/B,QAAQ,CAAC,QAAQ,EAAE;IACjB,QAAQ,CAAC,cAAc,EAAE;QACvB,IAAI,CAAC,KAAK,EAAE;YACV,mEAAmE;YACnE,MAAM,CACJ,WAAG,
|
|
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
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as _ from 'lodash';
|
|
2
|
+
import { satisfies, subset, valid, validRange } from 'semver';
|
|
3
|
+
|
|
4
|
+
import { green, red } from './Logging';
|
|
5
|
+
|
|
6
|
+
export function checkPackageVersion(
|
|
7
|
+
appPackage: unknown,
|
|
8
|
+
packageName: string,
|
|
9
|
+
acceptableVersions: string,
|
|
10
|
+
canBeLatest: boolean,
|
|
11
|
+
): boolean {
|
|
12
|
+
const depsVersion = _.get(appPackage, ['dependencies', packageName]);
|
|
13
|
+
const devDepsVersion = _.get(appPackage, ['devDependencies', packageName]);
|
|
14
|
+
|
|
15
|
+
if (!depsVersion && !devDepsVersion) {
|
|
16
|
+
red(`✗ ${packageName} isn't in your dependencies.`);
|
|
17
|
+
red(' Please install it with yarn/npm.');
|
|
18
|
+
return false;
|
|
19
|
+
} else if (
|
|
20
|
+
!fulfillsVersionRange(depsVersion, acceptableVersions, canBeLatest) &&
|
|
21
|
+
!fulfillsVersionRange(devDepsVersion, acceptableVersions, canBeLatest)
|
|
22
|
+
) {
|
|
23
|
+
red(
|
|
24
|
+
`✗ Your \`package.json\` specifies a version of \`${packageName}\` outside of the compatible version range ${acceptableVersions}.\n`,
|
|
25
|
+
);
|
|
26
|
+
return false;
|
|
27
|
+
} else {
|
|
28
|
+
green(
|
|
29
|
+
`✓ A compatible version of \`${packageName}\` is specified in \`package.json\`.`,
|
|
30
|
+
);
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function fulfillsVersionRange(
|
|
36
|
+
version: string,
|
|
37
|
+
acceptableVersions: string,
|
|
38
|
+
canBeLatest: boolean,
|
|
39
|
+
): boolean {
|
|
40
|
+
if (version === 'latest') {
|
|
41
|
+
return canBeLatest;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
let cleanedUserVersion, isRange;
|
|
45
|
+
|
|
46
|
+
if (valid(version)) {
|
|
47
|
+
cleanedUserVersion = valid(version);
|
|
48
|
+
isRange = false;
|
|
49
|
+
} else if (validRange(version)) {
|
|
50
|
+
cleanedUserVersion = validRange(version);
|
|
51
|
+
isRange = true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
// If the given version is a bogus format, this will still be undefined and we'll automatically reject it
|
|
56
|
+
!!cleanedUserVersion &&
|
|
57
|
+
(isRange
|
|
58
|
+
? subset(cleanedUserVersion, acceptableVersions)
|
|
59
|
+
: satisfies(cleanedUserVersion, acceptableVersions))
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/typedef */
|
|
2
|
+
import { exec } from 'child_process';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { promisify } from 'util';
|
|
6
|
+
|
|
7
|
+
import { green } from './Logging';
|
|
8
|
+
|
|
9
|
+
export function getPackageMangerChoice(): PackageManager | null {
|
|
10
|
+
if (fs.existsSync(path.join(process.cwd(), Yarn.LOCK_FILE))) {
|
|
11
|
+
return new Yarn();
|
|
12
|
+
}
|
|
13
|
+
if (fs.existsSync(path.join(process.cwd(), Pnpm.LOCK_FILE))) {
|
|
14
|
+
return new Pnpm();
|
|
15
|
+
}
|
|
16
|
+
if (fs.existsSync(path.join(process.cwd(), Npm.LOCK_FILE))) {
|
|
17
|
+
return new Npm();
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface PackageManager {
|
|
23
|
+
installPackage(packageName: string): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export class Npm implements PackageManager {
|
|
27
|
+
public static LOCK_FILE = 'package-lock.json';
|
|
28
|
+
public static LABEL = 'npm';
|
|
29
|
+
public static INSTALL_COMMAND = 'npm install';
|
|
30
|
+
|
|
31
|
+
public async installPackage(packageName: string): Promise<void> {
|
|
32
|
+
await installPackage(Npm.INSTALL_COMMAND, packageName, Npm.LABEL);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class Yarn implements PackageManager {
|
|
37
|
+
public static LOCK_FILE = 'yarn.lock';
|
|
38
|
+
public static LABEL = 'yarn';
|
|
39
|
+
public static INSTALL_COMMAND = 'yarn add';
|
|
40
|
+
|
|
41
|
+
public async installPackage(packageName: string): Promise<void> {
|
|
42
|
+
await installPackage(Yarn.INSTALL_COMMAND, packageName, Yarn.LABEL);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class Pnpm implements PackageManager {
|
|
47
|
+
public static LOCK_FILE = 'pnpm-lock.yaml';
|
|
48
|
+
public static LABEL = 'pnpm';
|
|
49
|
+
public static INSTALL_COMMAND = 'pnpm add';
|
|
50
|
+
|
|
51
|
+
public async installPackage(packageName: string): Promise<void> {
|
|
52
|
+
await installPackage(Pnpm.INSTALL_COMMAND, packageName, Pnpm.LABEL);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function installPackage(
|
|
57
|
+
command: string,
|
|
58
|
+
packageName: string,
|
|
59
|
+
label: string,
|
|
60
|
+
): Promise<void> {
|
|
61
|
+
await promisify(exec)(`${command} ${packageName}`);
|
|
62
|
+
green(`✓ Added \`${packageName}\` using \`${label}\`.`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
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);
|
|
@@ -62,6 +63,6 @@ export async function startWizard<M extends IStep>(
|
|
|
62
63
|
nl();
|
|
63
64
|
red('Protip: Add --debug to see whats going on');
|
|
64
65
|
red('OR use --help to see your options');
|
|
65
|
-
|
|
66
|
+
process.exit(1);
|
|
66
67
|
}
|
|
67
68
|
}
|
|
@@ -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
|
});
|
|
@@ -10,7 +10,7 @@ const templatePath = path.join(
|
|
|
10
10
|
'..',
|
|
11
11
|
'..',
|
|
12
12
|
'..',
|
|
13
|
-
'scripts/
|
|
13
|
+
'scripts/NextJs/configs/next.config.template.js',
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
function configFileNames(num: number): {
|
|
@@ -31,47 +31,63 @@ function configFileNames(num: number): {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
describe('Merging next.config.js', () => {
|
|
34
|
+
|
|
35
|
+
afterEach(() => {
|
|
36
|
+
fs.unlinkSync(configPath);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('merge basic next.config.js return true', () => {
|
|
40
|
+
const { sourcePath } = configFileNames(1);
|
|
41
|
+
fs.copyFileSync(sourcePath, configPath);
|
|
42
|
+
|
|
43
|
+
expect(mergeConfigFile(configPath, templatePath)).toBe(true);
|
|
44
|
+
});
|
|
45
|
+
|
|
34
46
|
test('merge basic next.config.js', () => {
|
|
35
47
|
const { sourcePath, mergedPath } = configFileNames(1);
|
|
36
48
|
fs.copyFileSync(sourcePath, configPath);
|
|
37
49
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
fs.readFileSync(mergedPath, 'utf8'),
|
|
42
|
-
).toBe(true);
|
|
43
|
-
fs.unlinkSync(configPath);
|
|
50
|
+
mergeConfigFile(configPath, templatePath);
|
|
51
|
+
|
|
52
|
+
expect(fs.readFileSync(configPath, 'utf8')).toEqual(fs.readFileSync(mergedPath, 'utf8'));
|
|
44
53
|
});
|
|
45
54
|
|
|
46
|
-
test('merge invalid javascript config', () => {
|
|
55
|
+
test('merge invalid javascript config return false', () => {
|
|
47
56
|
const { sourcePath } = configFileNames(2);
|
|
48
57
|
fs.copyFileSync(sourcePath, configPath);
|
|
49
58
|
|
|
50
59
|
expect(mergeConfigFile(configPath, templatePath)).toBe(false);
|
|
51
|
-
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('merge more complicated next.config.js return true', () => {
|
|
63
|
+
const { sourcePath } = configFileNames(3);
|
|
64
|
+
fs.copyFileSync(sourcePath, configPath);
|
|
65
|
+
|
|
66
|
+
expect(mergeConfigFile(configPath, templatePath)).toBe(true);
|
|
52
67
|
});
|
|
53
68
|
|
|
54
69
|
test('merge more complicated next.config.js', () => {
|
|
55
70
|
const { sourcePath, mergedPath } = configFileNames(3);
|
|
56
71
|
fs.copyFileSync(sourcePath, configPath);
|
|
57
72
|
|
|
73
|
+
mergeConfigFile(configPath, templatePath);
|
|
74
|
+
|
|
75
|
+
expect(fs.readFileSync(configPath, 'utf8')).toEqual(fs.readFileSync(mergedPath, 'utf8'));
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('merge next.config.js with function return true', () => {
|
|
79
|
+
const { sourcePath } = configFileNames(4);
|
|
80
|
+
fs.copyFileSync(sourcePath, configPath);
|
|
81
|
+
|
|
58
82
|
expect(mergeConfigFile(configPath, templatePath)).toBe(true);
|
|
59
|
-
expect(
|
|
60
|
-
fs.readFileSync(configPath, 'utf8') ===
|
|
61
|
-
fs.readFileSync(mergedPath, 'utf8'),
|
|
62
|
-
).toBe(true);
|
|
63
|
-
fs.unlinkSync(configPath);
|
|
64
83
|
});
|
|
65
84
|
|
|
66
85
|
test('merge next.config.js with function', () => {
|
|
67
86
|
const { sourcePath, mergedPath } = configFileNames(4);
|
|
68
87
|
fs.copyFileSync(sourcePath, configPath);
|
|
69
88
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
fs.readFileSync(mergedPath, 'utf8'),
|
|
74
|
-
).toBe(true);
|
|
75
|
-
fs.unlinkSync(configPath);
|
|
89
|
+
mergeConfigFile(configPath, templatePath);
|
|
90
|
+
|
|
91
|
+
expect(fs.readFileSync(configPath, 'utf8')).toEqual(fs.readFileSync(mergedPath, 'utf8'));
|
|
76
92
|
});
|
|
77
93
|
});
|
|
@@ -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 &&
|