@sentry/wizard 3.15.0 → 3.16.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/lib/Steps/ChooseIntegration.js +1 -1
  3. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  4. package/dist/lib/Steps/Integrations/ReactNative.d.ts +7 -32
  5. package/dist/lib/Steps/Integrations/ReactNative.js +17 -485
  6. package/dist/lib/Steps/Integrations/ReactNative.js.map +1 -1
  7. package/dist/package.json +1 -1
  8. package/dist/src/android/android-wizard.js +13 -18
  9. package/dist/src/android/android-wizard.js.map +1 -1
  10. package/dist/src/apple/apple-wizard.js +11 -4
  11. package/dist/src/apple/apple-wizard.js.map +1 -1
  12. package/dist/src/apple/cocoapod.d.ts +1 -0
  13. package/dist/src/apple/cocoapod.js +36 -13
  14. package/dist/src/apple/cocoapod.js.map +1 -1
  15. package/dist/src/nextjs/nextjs-wizard.js +1 -1
  16. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  17. package/dist/src/react-native/glob.d.ts +3 -0
  18. package/dist/src/react-native/glob.js +18 -0
  19. package/dist/src/react-native/glob.js.map +1 -0
  20. package/dist/src/react-native/gradle.d.ts +4 -0
  21. package/dist/src/react-native/gradle.js +49 -0
  22. package/dist/src/react-native/gradle.js.map +1 -0
  23. package/dist/src/react-native/javascript.d.ts +8 -0
  24. package/dist/src/react-native/javascript.js +25 -0
  25. package/dist/src/react-native/javascript.js.map +1 -0
  26. package/dist/src/react-native/options.d.ts +4 -0
  27. package/dist/src/react-native/options.js +3 -0
  28. package/dist/src/react-native/options.js.map +1 -0
  29. package/dist/src/react-native/react-native-wizard.d.ts +9 -0
  30. package/dist/src/react-native/react-native-wizard.js +356 -0
  31. package/dist/src/react-native/react-native-wizard.js.map +1 -0
  32. package/dist/src/react-native/uninstall.d.ts +2 -0
  33. package/dist/src/react-native/uninstall.js +130 -0
  34. package/dist/src/react-native/uninstall.js.map +1 -0
  35. package/dist/src/react-native/xcode.d.ts +18 -0
  36. package/dist/src/react-native/xcode.js +170 -0
  37. package/dist/src/react-native/xcode.js.map +1 -0
  38. package/dist/src/remix/remix-wizard.js +1 -1
  39. package/dist/src/remix/remix-wizard.js.map +1 -1
  40. package/dist/src/sourcemaps/tools/nextjs.js +3 -3
  41. package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
  42. package/dist/src/sourcemaps/tools/sentry-cli.js +1 -1
  43. package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
  44. package/dist/src/sveltekit/sveltekit-wizard.js +1 -1
  45. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  46. package/dist/src/utils/clack-utils.d.ts +19 -3
  47. package/dist/src/utils/clack-utils.js +141 -39
  48. package/dist/src/utils/clack-utils.js.map +1 -1
  49. package/dist/src/utils/semver.d.ts +5 -0
  50. package/dist/src/utils/semver.js +27 -0
  51. package/dist/src/utils/semver.js.map +1 -0
  52. package/dist/src/utils/sentrycli-utils.js +4 -1
  53. package/dist/src/utils/sentrycli-utils.js.map +1 -1
  54. package/dist/src/utils/types.d.ts +3 -0
  55. package/dist/src/utils/types.js.map +1 -1
  56. package/dist/test/react-native/gradle.test.js +57 -0
  57. package/dist/test/react-native/gradle.test.js.map +1 -0
  58. package/dist/test/react-native/javascript.test.js +47 -0
  59. package/dist/test/react-native/javascript.test.js.map +1 -0
  60. package/dist/test/react-native/xcode.test.d.ts +1 -0
  61. package/dist/test/react-native/xcode.test.js +144 -0
  62. package/dist/test/react-native/xcode.test.js.map +1 -0
  63. package/lib/Steps/ChooseIntegration.ts +1 -1
  64. package/lib/Steps/Integrations/ReactNative.ts +17 -573
  65. package/package.json +1 -1
  66. package/src/android/android-wizard.ts +3 -18
  67. package/src/apple/apple-wizard.ts +12 -3
  68. package/src/apple/cocoapod.ts +20 -9
  69. package/src/nextjs/nextjs-wizard.ts +1 -1
  70. package/src/react-native/glob.ts +13 -0
  71. package/src/react-native/gradle.ts +26 -0
  72. package/src/react-native/javascript.ts +33 -0
  73. package/src/react-native/options.ts +5 -0
  74. package/src/react-native/react-native-wizard.ts +369 -0
  75. package/src/react-native/uninstall.ts +107 -0
  76. package/src/react-native/xcode.ts +228 -0
  77. package/src/remix/remix-wizard.ts +2 -2
  78. package/src/sourcemaps/tools/nextjs.ts +6 -6
  79. package/src/sourcemaps/tools/sentry-cli.ts +1 -1
  80. package/src/sveltekit/sveltekit-wizard.ts +1 -1
  81. package/src/utils/clack-utils.ts +229 -74
  82. package/src/utils/semver.ts +33 -0
  83. package/src/utils/sentrycli-utils.ts +3 -1
  84. package/src/utils/types.ts +3 -0
  85. package/test/react-native/gradle.test.ts +310 -0
  86. package/test/react-native/javascript.test.ts +131 -0
  87. package/test/react-native/xcode.test.ts +238 -0
  88. package/dist/lib/Steps/Integrations/__tests__/ReactNative.js +0 -198
  89. package/dist/lib/Steps/Integrations/__tests__/ReactNative.js.map +0 -1
  90. package/dist/lib/__tests__/Setup.js +0 -57
  91. package/dist/lib/__tests__/Setup.js.map +0 -1
  92. package/lib/Steps/Integrations/__tests__/ReactNative.ts +0 -136
  93. package/lib/__tests__/Setup.ts +0 -42
  94. /package/dist/{lib/Steps/Integrations/__tests__/ReactNative.d.ts → test/react-native/gradle.test.d.ts} +0 -0
  95. /package/dist/{lib/__tests__/Setup.d.ts → test/react-native/javascript.test.d.ts} +0 -0
@@ -0,0 +1,238 @@
1
+ /* eslint-disable no-useless-escape */
2
+ import {
3
+ addSentryToBundleShellScript,
4
+ doesBundlePhaseIncludeSentry,
5
+ findBundlePhase,
6
+ findDebugFilesUploadPhase,
7
+ removeSentryFromBundleShellScript,
8
+ } from '../../src/react-native/xcode';
9
+
10
+ describe('react-native xcode', () => {
11
+ describe('addSentryToBundleShellScript', () => {
12
+ it('adds sentry cli to rn bundle build phase', () => {
13
+ const input = `set -e
14
+
15
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
16
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
17
+
18
+ /bin/sh -c "$WITH_ENVIRONMENT $REACT_NATIVE_XCODE"`;
19
+ // actual shell script looks like this:
20
+ // /bin/sh -c "$WITH_ENVIRONMENT \"$REACT_NATIVE_XCODE\""
21
+ // but during parsing xcode library removes the quotes
22
+ const expectedOutput = `export SENTRY_PROPERTIES=sentry.properties
23
+ export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
24
+ set -e
25
+
26
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
27
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
28
+
29
+ /bin/sh -c "$WITH_ENVIRONMENT \\"../node_modules/@sentry/cli/bin/sentry-cli react-native xcode $REACT_NATIVE_XCODE\\""
30
+ /bin/sh -c "$WITH_ENVIRONMENT ../node_modules/@sentry/react-native/scripts/collect-modules.sh"
31
+ `;
32
+
33
+ expect(addSentryToBundleShellScript(input)).toBe(expectedOutput);
34
+ });
35
+ });
36
+
37
+ describe('removeSentryFromBundleShellScript', () => {
38
+ it('removes sentry cli from rn bundle build phase', () => {
39
+ const input = `export SENTRY_PROPERTIES=sentry.properties
40
+ export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
41
+ set -e
42
+
43
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
44
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
45
+
46
+ /bin/sh -c "$WITH_ENVIRONMENT \"../node_modules/@sentry/cli/bin/sentry-cli react-native xcode $REACT_NATIVE_XCODE\""
47
+
48
+ /bin/sh -c "$WITH_ENVIRONMENT ../node_modules/@sentry/react-native/scripts/collect-modules.sh"
49
+ `;
50
+ const expectedOutput = `export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
51
+ set -e
52
+
53
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
54
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
55
+
56
+ /bin/sh -c "$WITH_ENVIRONMENT \"$REACT_NATIVE_XCODE\""
57
+
58
+ `;
59
+
60
+ expect(removeSentryFromBundleShellScript(input)).toBe(expectedOutput);
61
+ });
62
+ });
63
+
64
+ describe('findBundlePhase', () => {
65
+ it('returns build phase with react native xcode shell script', () => {
66
+ const inputMap = {
67
+ 1: {
68
+ shellScript: 'foo',
69
+ },
70
+ 2: {
71
+ shellScript: 'bar',
72
+ },
73
+ 3: {
74
+ shellScript: `set -e
75
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
76
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
77
+
78
+ /bin/sh -c "$WITH_ENVIRONMENT \"$REACT_NATIVE_XCODE\""
79
+
80
+ `,
81
+ },
82
+ 4: {
83
+ shellScript: 'qux',
84
+ },
85
+ };
86
+
87
+ const expected = {
88
+ shellScript: `set -e
89
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
90
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
91
+
92
+ /bin/sh -c "$WITH_ENVIRONMENT \"$REACT_NATIVE_XCODE\""
93
+
94
+ `,
95
+ };
96
+
97
+ expect(findBundlePhase(inputMap)).toEqual(expected);
98
+ });
99
+
100
+ it('returns undefined if bundle phase not present', () => {
101
+ const inputMap = {
102
+ 1: {
103
+ shellScript: 'foo',
104
+ },
105
+ 2: {
106
+ shellScript: 'bar',
107
+ },
108
+ 3: {
109
+ // note different path to the script
110
+ shellScript: `set -e
111
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
112
+ REACT_NATIVE_XCODE="../node_modules/react-native/unknown/react-native-xcode.sh"
113
+
114
+ /bin/sh -c "$WITH_ENVIRONMENT \"$REACT_NATIVE_XCODE\""
115
+
116
+ `,
117
+ },
118
+ 4: {
119
+ shellScript: 'qux',
120
+ },
121
+ };
122
+
123
+ expect(findBundlePhase(inputMap)).toBeUndefined();
124
+ });
125
+ });
126
+
127
+ describe('doesBundlePhaseIncludeSentry', () => {
128
+ it('returns true for script containing sentry cli calling react native xcode command', () => {
129
+ const input = {
130
+ shellScript: `set -e
131
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
132
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
133
+ SENTRY_CLI="sentry-cli react-native xcode"
134
+
135
+ /bin/sh -c "$WITH_ENVIRONMENT \"$SENTRY_CLI $REACT_NATIVE_XCODE\""
136
+ `,
137
+ };
138
+ expect(doesBundlePhaseIncludeSentry(input)).toBeTruthy();
139
+ });
140
+
141
+ it('returns false', () => {
142
+ const input = {
143
+ // note sentry-cli can be part of the script but doesn't call react native xcode script
144
+ shellScript: `set -e
145
+ WITH_ENVIRONMENT="../node_modules/react-native/scripts/xcode/with-environment.sh"
146
+ REACT_NATIVE_XCODE="../node_modules/react-native/scripts/react-native-xcode.sh"
147
+
148
+ /bin/sh -c "$WITH_ENVIRONMENT \"$REACT_NATIVE_XCODE\""
149
+
150
+ sentry-cli --version
151
+ `,
152
+ };
153
+ expect(doesBundlePhaseIncludeSentry(input)).toBeFalsy();
154
+ });
155
+ });
156
+
157
+ describe('findDebugFilesUploadPhase', () => {
158
+ it('returns debug files build phase using debug files command', () => {
159
+ const input = {
160
+ 1: {
161
+ shellScript: 'foo',
162
+ },
163
+ 2: {
164
+ shellScript: `set -e
165
+ sentry-cli debug-files upload path/to/dsym --include-sources
166
+ `,
167
+ },
168
+ };
169
+ const expected = [
170
+ '2',
171
+ {
172
+ shellScript: `set -e
173
+ sentry-cli debug-files upload path/to/dsym --include-sources
174
+ `,
175
+ },
176
+ ];
177
+ expect(findDebugFilesUploadPhase(input)).toEqual(expected);
178
+ });
179
+
180
+ it('returns debug files build phase with sentry-cli absolute path', () => {
181
+ const input = {
182
+ 1: {
183
+ shellScript: 'foo',
184
+ },
185
+ 2: {
186
+ shellScript: `set -e
187
+ /path/to/bin/sentry-cli debug-files upload path/to/dsym --include-sources
188
+ `,
189
+ },
190
+ };
191
+ const expected = [
192
+ '2',
193
+ {
194
+ shellScript: `set -e
195
+ /path/to/bin/sentry-cli debug-files upload path/to/dsym --include-sources
196
+ `,
197
+ },
198
+ ];
199
+ expect(findDebugFilesUploadPhase(input)).toEqual(expected);
200
+ });
201
+
202
+ it('returns debug files build phase using dsym command', () => {
203
+ const input = {
204
+ 1: {
205
+ shellScript: 'foo',
206
+ },
207
+ 2: {
208
+ shellScript: `set -e
209
+ sentry-cli upload-dsym path/to/dsym --include-sources
210
+ `,
211
+ },
212
+ };
213
+ const expected = [
214
+ '2',
215
+ {
216
+ shellScript: `set -e
217
+ sentry-cli upload-dsym path/to/dsym --include-sources
218
+ `,
219
+ },
220
+ ];
221
+ expect(findDebugFilesUploadPhase(input)).toEqual(expected);
222
+ });
223
+
224
+ it('returns undefined if build phase not present', () => {
225
+ const input = {
226
+ 1: {
227
+ shellScript: 'foo',
228
+ },
229
+ 2: {
230
+ // sentry-cli present but with different command
231
+ shellScript: 'sentry-cli sourcempas upload',
232
+ },
233
+ };
234
+
235
+ expect(findDebugFilesUploadPhase(input)).toBeUndefined();
236
+ });
237
+ });
238
+ });
@@ -1,198 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
62
- jest.mock('../../../Helper/Logging.ts'); // We mock logging to not pollute the output
63
- jest.mock('child_process');
64
- var child_process = __importStar(require("child_process"));
65
- var fs = __importStar(require("fs"));
66
- var path = __importStar(require("path"));
67
- var process = __importStar(require("process"));
68
- var rimraf = __importStar(require("rimraf"));
69
- var Constants_1 = require("../../../Constants");
70
- var ReactNative_1 = require("../ReactNative");
71
- var testDir = 'rn-test';
72
- var iosIndexJs = 'index.ios.js';
73
- var appTsx = 'src/App.tsx';
74
- var appBuildGradle = 'android/app/build.gradle';
75
- var yarnLock = 'yarn.lock';
76
- var dummyJsContent = 'import React from "react";\n';
77
- var dummyAppBuildGradleContent = 'apply plugin: "com.facebook.react"\n\nandroid {\n}\n';
78
- var testArgs = {
79
- debug: false,
80
- integration: Constants_1.Integration.reactNative,
81
- platform: [Constants_1.Platform.ios],
82
- quiet: true,
83
- skipConnect: true,
84
- uninstall: false,
85
- url: 'https://not.used',
86
- };
87
- var mockIosAnswers = {
88
- shouldConfigurePlatforms: { ios: true },
89
- config: {
90
- dsn: {
91
- public: 'dns.public.com',
92
- },
93
- },
94
- };
95
- var mockAndroidAnswers = {
96
- shouldConfigurePlatforms: { android: true },
97
- config: {
98
- dsn: {
99
- public: 'dns.public.com',
100
- },
101
- },
102
- };
103
- var originalExec = child_process.exec;
104
- var restoreExec = function () {
105
- child_process.exec = originalExec;
106
- };
107
- var mockExec = function () {
108
- child_process.exec.mockImplementation(function (_command, callback) { return callback(null, { stdout: '' }); });
109
- };
110
- describe('ReactNative', function () {
111
- var defaultCwd = process.cwd();
112
- beforeEach(function () {
113
- rimraf.sync(testDir);
114
- fs.mkdirSync(testDir);
115
- process.chdir(testDir);
116
- fs.writeFileSync(iosIndexJs, dummyJsContent);
117
- fs.mkdirSync(path.dirname(appTsx), { recursive: true });
118
- fs.writeFileSync(appTsx, dummyJsContent);
119
- fs.mkdirSync(path.dirname(appBuildGradle), { recursive: true });
120
- fs.writeFileSync(appBuildGradle, dummyAppBuildGradleContent);
121
- fs.writeFileSync(yarnLock, '');
122
- mockExec();
123
- });
124
- afterEach(function () {
125
- restoreExec();
126
- process.chdir(defaultCwd);
127
- rimraf.sync(testDir);
128
- });
129
- test('patches js files', function () { return __awaiter(void 0, void 0, void 0, function () {
130
- var project, patchedIosIndexJs, patchedAppTsx, expectedPatch;
131
- return __generator(this, function (_a) {
132
- switch (_a.label) {
133
- case 0:
134
- project = new ReactNative_1.ReactNative(testArgs);
135
- return [4 /*yield*/, project.emit(mockIosAnswers)];
136
- case 1:
137
- _a.sent();
138
- patchedIosIndexJs = fs.readFileSync(iosIndexJs, 'utf8');
139
- patchedAppTsx = fs.readFileSync(appTsx, 'utf8');
140
- expectedPatch = 'import React from "react";\n\n' +
141
- "import * as Sentry from '@sentry/react-native';\n\n" +
142
- 'Sentry.init({ \n' +
143
- " dsn: 'dns.public.com', \n" +
144
- '});\n\n';
145
- expect(patchedIosIndexJs).toEqual(expectedPatch);
146
- expect(patchedAppTsx).toEqual(expectedPatch);
147
- return [2 /*return*/];
148
- }
149
- });
150
- }); });
151
- test('patches android app build gradle file', function () { return __awaiter(void 0, void 0, void 0, function () {
152
- var project, patchedAppBuildGradle, expectedPatch;
153
- return __generator(this, function (_a) {
154
- switch (_a.label) {
155
- case 0:
156
- project = new ReactNative_1.ReactNative(testArgs);
157
- return [4 /*yield*/, project.emit(mockAndroidAnswers)];
158
- case 1:
159
- _a.sent();
160
- patchedAppBuildGradle = fs.readFileSync(appBuildGradle, 'utf8');
161
- expectedPatch = 'apply plugin: "com.facebook.react"\n\n' +
162
- 'apply from: "../../node_modules/@sentry/react-native/sentry.gradle"\n' +
163
- 'android {\n}\n';
164
- expect(patchedAppBuildGradle).toEqual(expectedPatch);
165
- return [2 /*return*/];
166
- }
167
- });
168
- }); });
169
- test('does install sentry sdk', function () { return __awaiter(void 0, void 0, void 0, function () {
170
- var project;
171
- return __generator(this, function (_a) {
172
- switch (_a.label) {
173
- case 0:
174
- project = new ReactNative_1.ReactNative(testArgs);
175
- return [4 /*yield*/, project.emit(mockIosAnswers)];
176
- case 1:
177
- _a.sent();
178
- expect(child_process.exec).toHaveBeenCalledWith('yarn add @sentry/react-native', expect.anything());
179
- return [2 /*return*/];
180
- }
181
- });
182
- }); });
183
- test('executes pod install', function () { return __awaiter(void 0, void 0, void 0, function () {
184
- var project;
185
- return __generator(this, function (_a) {
186
- switch (_a.label) {
187
- case 0:
188
- project = new ReactNative_1.ReactNative(testArgs);
189
- return [4 /*yield*/, project.emit(mockIosAnswers)];
190
- case 1:
191
- _a.sent();
192
- expect(child_process.exec).toHaveBeenCalledWith('npx --yes pod-install --non-interactive --quiet', expect.anything());
193
- return [2 /*return*/];
194
- }
195
- });
196
- }); });
197
- });
198
- //# sourceMappingURL=ReactNative.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReactNative.js","sourceRoot":"","sources":["../../../../../lib/Steps/Integrations/__tests__/ReactNative.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,CAAC,4CAA4C;AACrF,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AAC3B,2DAA+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EnC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAC7C,iDAAiD,EACjD,MAAM,CAAC,QAAQ,EAAE,CAClB,CAAC;;;;SACH,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["jest.mock('../../../Helper/Logging.ts'); // We mock logging to not pollute the output\njest.mock('child_process');\nimport * as child_process from 'child_process';\nimport * as fs from 'fs';\nimport type { Answers } from 'inquirer';\nimport * as path from 'path';\nimport * as process from 'process';\nimport * as rimraf from 'rimraf';\n\nimport type { Args } from '../../../Constants';\nimport { Integration, Platform } from '../../../Constants';\nimport { ReactNative } from '../ReactNative';\n\nconst testDir = 'rn-test';\nconst iosIndexJs = 'index.ios.js';\nconst appTsx = 'src/App.tsx';\nconst appBuildGradle = 'android/app/build.gradle';\nconst yarnLock = 'yarn.lock';\n\nconst dummyJsContent = 'import React from \"react\";\\n';\nconst dummyAppBuildGradleContent =\n 'apply plugin: \"com.facebook.react\"\\n\\nandroid {\\n}\\n';\n\nconst testArgs = {\n debug: false,\n integration: Integration.reactNative,\n platform: [Platform.ios],\n quiet: true,\n skipConnect: true,\n uninstall: false,\n url: 'https://not.used',\n};\n\nconst mockIosAnswers: Answers = {\n shouldConfigurePlatforms: { ios: true },\n config: {\n dsn: {\n public: 'dns.public.com',\n },\n },\n};\n\nconst mockAndroidAnswers: Answers = {\n shouldConfigurePlatforms: { android: true },\n config: {\n dsn: {\n public: 'dns.public.com',\n },\n },\n};\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('ReactNative', () => {\n const defaultCwd = process.cwd();\n\n beforeEach(() => {\n rimraf.sync(testDir);\n fs.mkdirSync(testDir);\n process.chdir(testDir);\n fs.writeFileSync(iosIndexJs, dummyJsContent);\n fs.mkdirSync(path.dirname(appTsx), { recursive: true });\n fs.writeFileSync(appTsx, dummyJsContent);\n fs.mkdirSync(path.dirname(appBuildGradle), { recursive: true });\n fs.writeFileSync(appBuildGradle, dummyAppBuildGradleContent);\n fs.writeFileSync(yarnLock, '');\n mockExec();\n });\n\n afterEach(() => {\n restoreExec();\n process.chdir(defaultCwd);\n rimraf.sync(testDir);\n });\n\n test('patches js files', async () => {\n const project = new ReactNative(testArgs as Args);\n await project.emit(mockIosAnswers);\n\n const patchedIosIndexJs = fs.readFileSync(iosIndexJs, 'utf8');\n const patchedAppTsx = fs.readFileSync(appTsx, 'utf8');\n const expectedPatch =\n 'import React from \"react\";\\n\\n' +\n \"import * as Sentry from '@sentry/react-native';\\n\\n\" +\n 'Sentry.init({ \\n' +\n \" dsn: 'dns.public.com', \\n\" +\n '});\\n\\n';\n expect(patchedIosIndexJs).toEqual(expectedPatch);\n expect(patchedAppTsx).toEqual(expectedPatch);\n });\n\n test('patches android app build gradle file', async () => {\n const project = new ReactNative(testArgs as Args);\n\n await project.emit(mockAndroidAnswers);\n\n const patchedAppBuildGradle = fs.readFileSync(appBuildGradle, 'utf8');\n const expectedPatch =\n 'apply plugin: \"com.facebook.react\"\\n\\n' +\n 'apply from: \"../../node_modules/@sentry/react-native/sentry.gradle\"\\n' +\n 'android {\\n}\\n';\n expect(patchedAppBuildGradle).toEqual(expectedPatch);\n });\n\n test('does install sentry sdk', async () => {\n const project = new ReactNative(testArgs as Args);\n\n await project.emit(mockIosAnswers);\n\n expect(child_process.exec).toHaveBeenCalledWith(\n 'yarn add @sentry/react-native',\n expect.anything(),\n );\n });\n\n test('executes pod install', async () => {\n const project = new ReactNative(testArgs as Args);\n\n await project.emit(mockIosAnswers);\n\n expect(child_process.exec).toHaveBeenCalledWith(\n 'npx --yes pod-install --non-interactive --quiet',\n expect.anything(),\n );\n });\n});\n"]}
@@ -1,57 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
26
- jest.mock('../Helper/Logging'); // We mock logging to not pollute the output
27
- jest.mock('child_process');
28
- var child_process = __importStar(require("child_process"));
29
- var Constants_1 = require("../Constants");
30
- var Setup_1 = require("../Setup");
31
- var originalExec = child_process.exec;
32
- var restoreExec = function () {
33
- child_process.exec = originalExec;
34
- };
35
- var mockExec = function () {
36
- child_process.exec.mockImplementation(function (_command, callback) { return callback(null, { stdout: '' }); });
37
- };
38
- describe('Wizard', function () {
39
- beforeEach(function () {
40
- mockExec();
41
- });
42
- afterEach(function () {
43
- restoreExec();
44
- });
45
- describe('React Native', function () {
46
- test('run', function () {
47
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
48
- expect((0, Setup_1.run)({
49
- quiet: true,
50
- integration: Constants_1.Integration.reactNative,
51
- platform: [Constants_1.Platform.ios, Constants_1.Platform.android],
52
- skipConnect: true,
53
- })).toBeTruthy();
54
- });
55
- });
56
- });
57
- //# sourceMappingURL=Setup.js.map
@@ -1 +0,0 @@
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,2DAA+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"]}
@@ -1,136 +0,0 @@
1
- jest.mock('../../../Helper/Logging.ts'); // We mock logging to not pollute the output
2
- jest.mock('child_process');
3
- import * as child_process from 'child_process';
4
- import * as fs from 'fs';
5
- import type { Answers } from 'inquirer';
6
- import * as path from 'path';
7
- import * as process from 'process';
8
- import * as rimraf from 'rimraf';
9
-
10
- import type { Args } from '../../../Constants';
11
- import { Integration, Platform } from '../../../Constants';
12
- import { ReactNative } from '../ReactNative';
13
-
14
- const testDir = 'rn-test';
15
- const iosIndexJs = 'index.ios.js';
16
- const appTsx = 'src/App.tsx';
17
- const appBuildGradle = 'android/app/build.gradle';
18
- const yarnLock = 'yarn.lock';
19
-
20
- const dummyJsContent = 'import React from "react";\n';
21
- const dummyAppBuildGradleContent =
22
- 'apply plugin: "com.facebook.react"\n\nandroid {\n}\n';
23
-
24
- const testArgs = {
25
- debug: false,
26
- integration: Integration.reactNative,
27
- platform: [Platform.ios],
28
- quiet: true,
29
- skipConnect: true,
30
- uninstall: false,
31
- url: 'https://not.used',
32
- };
33
-
34
- const mockIosAnswers: Answers = {
35
- shouldConfigurePlatforms: { ios: true },
36
- config: {
37
- dsn: {
38
- public: 'dns.public.com',
39
- },
40
- },
41
- };
42
-
43
- const mockAndroidAnswers: Answers = {
44
- shouldConfigurePlatforms: { android: true },
45
- config: {
46
- dsn: {
47
- public: 'dns.public.com',
48
- },
49
- },
50
- };
51
-
52
- const originalExec = child_process.exec;
53
-
54
- const restoreExec = (): void => {
55
- (child_process as any).exec = originalExec;
56
- };
57
-
58
- const mockExec = (): void => {
59
- (child_process.exec as unknown as jest.Mock).mockImplementation(
60
- (_command, callback) => callback(null, { stdout: '' }),
61
- );
62
- };
63
-
64
- describe('ReactNative', () => {
65
- const defaultCwd = process.cwd();
66
-
67
- beforeEach(() => {
68
- rimraf.sync(testDir);
69
- fs.mkdirSync(testDir);
70
- process.chdir(testDir);
71
- fs.writeFileSync(iosIndexJs, dummyJsContent);
72
- fs.mkdirSync(path.dirname(appTsx), { recursive: true });
73
- fs.writeFileSync(appTsx, dummyJsContent);
74
- fs.mkdirSync(path.dirname(appBuildGradle), { recursive: true });
75
- fs.writeFileSync(appBuildGradle, dummyAppBuildGradleContent);
76
- fs.writeFileSync(yarnLock, '');
77
- mockExec();
78
- });
79
-
80
- afterEach(() => {
81
- restoreExec();
82
- process.chdir(defaultCwd);
83
- rimraf.sync(testDir);
84
- });
85
-
86
- test('patches js files', async () => {
87
- const project = new ReactNative(testArgs as Args);
88
- await project.emit(mockIosAnswers);
89
-
90
- const patchedIosIndexJs = fs.readFileSync(iosIndexJs, 'utf8');
91
- const patchedAppTsx = fs.readFileSync(appTsx, 'utf8');
92
- const expectedPatch =
93
- 'import React from "react";\n\n' +
94
- "import * as Sentry from '@sentry/react-native';\n\n" +
95
- 'Sentry.init({ \n' +
96
- " dsn: 'dns.public.com', \n" +
97
- '});\n\n';
98
- expect(patchedIosIndexJs).toEqual(expectedPatch);
99
- expect(patchedAppTsx).toEqual(expectedPatch);
100
- });
101
-
102
- test('patches android app build gradle file', async () => {
103
- const project = new ReactNative(testArgs as Args);
104
-
105
- await project.emit(mockAndroidAnswers);
106
-
107
- const patchedAppBuildGradle = fs.readFileSync(appBuildGradle, 'utf8');
108
- const expectedPatch =
109
- 'apply plugin: "com.facebook.react"\n\n' +
110
- 'apply from: "../../node_modules/@sentry/react-native/sentry.gradle"\n' +
111
- 'android {\n}\n';
112
- expect(patchedAppBuildGradle).toEqual(expectedPatch);
113
- });
114
-
115
- test('does install sentry sdk', async () => {
116
- const project = new ReactNative(testArgs as Args);
117
-
118
- await project.emit(mockIosAnswers);
119
-
120
- expect(child_process.exec).toHaveBeenCalledWith(
121
- 'yarn add @sentry/react-native',
122
- expect.anything(),
123
- );
124
- });
125
-
126
- test('executes pod install', async () => {
127
- const project = new ReactNative(testArgs as Args);
128
-
129
- await project.emit(mockIosAnswers);
130
-
131
- expect(child_process.exec).toHaveBeenCalledWith(
132
- 'npx --yes pod-install --non-interactive --quiet',
133
- expect.anything(),
134
- );
135
- });
136
- });