@sentry/wizard 1.2.12 → 1.2.16
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 +99 -81
- package/README.md +29 -12
- package/dist/NextJs/configs/_error.js +65 -0
- package/dist/NextJs/configs/next.config.js +2 -2
- package/dist/lib/Helper/SentryCli.d.ts +4 -0
- package/dist/lib/Helper/SentryCli.js +14 -0
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.d.ts +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +3 -2
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/NextJs.d.ts +3 -2
- package/dist/lib/Steps/Integrations/NextJs.js +83 -53
- package/dist/lib/Steps/Integrations/NextJs.js.map +1 -1
- package/lib/Helper/SentryCli.ts +17 -0
- package/lib/Steps/Integrations/BaseIntegration.ts +5 -2
- package/lib/Steps/Integrations/NextJs.ts +105 -65
- package/package.json +1 -1
- package/scripts/NextJs/configs/_error.js +65 -0
- package/scripts/NextJs/configs/next.config.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,272 +2,290 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.2.16
|
|
6
|
+
|
|
7
|
+
- fix(nextjs): Do not capture 404s as exceptions in `_error` (#146)
|
|
8
|
+
|
|
9
|
+
## 1.2.15
|
|
10
|
+
|
|
11
|
+
- Check version range rather than minimum version for nextjs (#143)
|
|
12
|
+
|
|
13
|
+
## 1.2.14
|
|
14
|
+
|
|
15
|
+
- Automatically include `pages/_error.js` when setting up nextjs project (#140)
|
|
16
|
+
- Clarify "Usage" section of `README.md` (#139)
|
|
17
|
+
|
|
18
|
+
## 1.2.13
|
|
19
|
+
|
|
20
|
+
- Fix `.sentryclirc` file formatting (#131)
|
|
21
|
+
|
|
5
22
|
## 1.2.12
|
|
6
23
|
|
|
7
|
-
|
|
24
|
+
- Don't expose auth token in `sentry.properties` (#128)
|
|
8
25
|
|
|
9
26
|
## 1.2.11
|
|
10
27
|
|
|
11
|
-
|
|
28
|
+
- Parse Next.js version as a string, instead of int (#122)
|
|
12
29
|
|
|
13
30
|
## 1.2.10
|
|
14
31
|
|
|
15
|
-
|
|
32
|
+
- Check new contents before overwriting a file (#117)
|
|
16
33
|
|
|
17
34
|
## 1.2.9
|
|
18
35
|
|
|
19
|
-
|
|
20
|
-
|
|
36
|
+
- Add performance monitoring support to nextjs scripts (#114)
|
|
37
|
+
- Make webpack silent by default in nextjs config (#113)
|
|
21
38
|
|
|
22
39
|
## v1.2.8
|
|
23
40
|
|
|
24
|
-
|
|
41
|
+
- Fix React Native JS patching throwing errors due to incorrect argument
|
|
25
42
|
|
|
26
43
|
## v1.2.7
|
|
27
44
|
|
|
28
|
-
|
|
29
|
-
|
|
45
|
+
- Fix React Native uninstall script
|
|
46
|
+
- Fix platform selection issues and repeated prompts on Mobile Projects.
|
|
30
47
|
|
|
31
48
|
## v1.2.6
|
|
32
49
|
|
|
33
|
-
|
|
50
|
+
- Get release from environment for the Next.js SDK
|
|
34
51
|
|
|
35
52
|
## v1.2.5
|
|
36
53
|
|
|
37
|
-
|
|
54
|
+
- Ignore coverage when linting and clarify Next.js messages.
|
|
38
55
|
|
|
39
56
|
## v1.2.4
|
|
40
57
|
|
|
41
|
-
|
|
42
|
-
|
|
58
|
+
- Add Next.js SDK initialization config files.
|
|
59
|
+
- Update webpack config file of Next.js.
|
|
43
60
|
|
|
44
61
|
## v1.2.3
|
|
45
62
|
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
- Don't use `package` as a varname in the NextJS config
|
|
64
|
+
- Enable env variables in the NextJS config
|
|
48
65
|
|
|
49
66
|
## v1.2.2
|
|
50
67
|
|
|
51
|
-
|
|
68
|
+
- Add support for `NEXT_PUBLIC_SENTRY_DSN`
|
|
52
69
|
|
|
53
70
|
## v1.2.1
|
|
54
71
|
|
|
55
|
-
|
|
72
|
+
- Update `next.config.js`, and create mergeable configs when they already exist
|
|
56
73
|
|
|
57
74
|
## v1.2.0
|
|
58
75
|
|
|
59
|
-
|
|
76
|
+
- Add support for Next.js
|
|
60
77
|
|
|
61
78
|
## v1.1.4
|
|
62
79
|
|
|
63
|
-
|
|
80
|
+
- Bump @sentry/cli `1.52.4`
|
|
64
81
|
|
|
65
82
|
## v1.1.3
|
|
66
83
|
|
|
67
|
-
|
|
68
|
-
|
|
84
|
+
- Add sourcemap output path to derived data to react native ios script
|
|
85
|
+
- Bump @sentry/cli `1.52.3`
|
|
69
86
|
|
|
70
87
|
## v1.1.2
|
|
71
88
|
|
|
72
|
-
|
|
89
|
+
- Don't `cli/executable` for Android project on react-native
|
|
73
90
|
|
|
74
91
|
## v1.1.1
|
|
75
92
|
|
|
76
|
-
|
|
93
|
+
- Bump @sentry/cli `1.51.0`
|
|
77
94
|
|
|
78
95
|
## v1.1.0
|
|
79
96
|
|
|
80
|
-
|
|
97
|
+
- Bump @sentry/cli `1.50.0`
|
|
81
98
|
|
|
82
99
|
## v1.0.2
|
|
83
100
|
|
|
84
|
-
|
|
101
|
+
- Several dependeny bumps with related security updates
|
|
85
102
|
|
|
86
103
|
## v1.0.1
|
|
87
104
|
|
|
88
|
-
|
|
89
|
-
|
|
105
|
+
- Strip only `Sentry*` frameworks for Cordova
|
|
106
|
+
- Guard Xcode project updates for react-native
|
|
90
107
|
|
|
91
108
|
## v1.0.0
|
|
92
109
|
|
|
93
|
-
|
|
110
|
+
- Support for new `@sentry/react-native`
|
|
94
111
|
|
|
95
112
|
## v0.13.0
|
|
96
113
|
|
|
97
|
-
|
|
114
|
+
- Bump @sentry/cli `1.43.0`
|
|
98
115
|
|
|
99
116
|
## v0.12.1
|
|
100
117
|
|
|
101
|
-
|
|
118
|
+
- Bump @sentry/cli `1.36.1`
|
|
102
119
|
|
|
103
120
|
## v0.12.0
|
|
104
121
|
|
|
105
|
-
|
|
106
|
-
|
|
122
|
+
- Fixed #22
|
|
123
|
+
- Bumped dependencies
|
|
107
124
|
|
|
108
125
|
## v0.11.1
|
|
109
126
|
|
|
110
|
-
|
|
127
|
+
- Fixed #16
|
|
111
128
|
|
|
112
129
|
## v0.11.0
|
|
113
130
|
|
|
114
|
-
|
|
131
|
+
- Update all dependencies, Fix tests on travis
|
|
115
132
|
|
|
116
133
|
## v0.10.3
|
|
117
134
|
|
|
118
|
-
|
|
135
|
+
- Use public DSN for react-native
|
|
119
136
|
|
|
120
137
|
## v0.10.2
|
|
121
138
|
|
|
122
|
-
|
|
139
|
+
- Remove secret DSN part check for prompt
|
|
123
140
|
|
|
124
141
|
## v0.10.1
|
|
125
142
|
|
|
126
|
-
|
|
143
|
+
- Use opn in favor of open
|
|
127
144
|
|
|
128
145
|
## v0.10.0
|
|
129
146
|
|
|
130
|
-
|
|
147
|
+
- Change Cordova wizard steps to only run once and create properties file in
|
|
148
|
+
root
|
|
131
149
|
|
|
132
150
|
## v0.9.7
|
|
133
151
|
|
|
134
|
-
|
|
152
|
+
- Fix a bug where sentry-wizard will ask for parameters on uninstall
|
|
135
153
|
|
|
136
154
|
## v0.9.6
|
|
137
155
|
|
|
138
|
-
|
|
156
|
+
- Fix electron symbol upload script
|
|
139
157
|
|
|
140
158
|
## v0.9.5
|
|
141
159
|
|
|
142
|
-
|
|
160
|
+
- Update Electron instructions to latest SDK version
|
|
143
161
|
|
|
144
162
|
## v0.9.4
|
|
145
163
|
|
|
146
|
-
|
|
147
|
-
|
|
164
|
+
- Restore Node compatibility
|
|
165
|
+
- Add more tests
|
|
148
166
|
|
|
149
167
|
## v0.9.3
|
|
150
168
|
|
|
151
|
-
|
|
169
|
+
- Fix Electron installation code - Fixes #7
|
|
152
170
|
|
|
153
171
|
## v0.9.2
|
|
154
172
|
|
|
155
|
-
|
|
156
|
-
|
|
173
|
+
- Support Electron prereleases in symbol upload
|
|
174
|
+
- Correctly upload Electron dSYMs for macOS
|
|
157
175
|
|
|
158
176
|
## v0.9.1
|
|
159
177
|
|
|
160
|
-
|
|
178
|
+
- Add strip arch script for cordova
|
|
161
179
|
|
|
162
180
|
## v0.9.0
|
|
163
181
|
|
|
164
|
-
|
|
182
|
+
- Add support for electron projects
|
|
165
183
|
|
|
166
184
|
## v0.8.3
|
|
167
185
|
|
|
168
|
-
|
|
186
|
+
- Fixed an issue where file exsists always returned false
|
|
169
187
|
|
|
170
188
|
## v0.8.2
|
|
171
189
|
|
|
172
|
-
|
|
190
|
+
- Move sentry.properties file to plugins folder for Cordova
|
|
173
191
|
|
|
174
192
|
## v0.8.1
|
|
175
193
|
|
|
176
|
-
|
|
177
|
-
|
|
194
|
+
- Fix react-native js file patching
|
|
195
|
+
- Bump sentry-cli to 1.28.4
|
|
178
196
|
|
|
179
197
|
## v0.8.0
|
|
180
198
|
|
|
181
|
-
|
|
199
|
+
- Fix Cordova sentry-cli upload-dsym command for Xcode
|
|
182
200
|
|
|
183
201
|
## v0.7.5
|
|
184
202
|
|
|
185
|
-
|
|
203
|
+
- Bump sentry-cli version to 1.28.1
|
|
186
204
|
|
|
187
205
|
## v0.7.4
|
|
188
206
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
207
|
+
- Bump sentry-cli version to 1.27.1
|
|
208
|
+
- Fix Cordova integration
|
|
209
|
+
- Fix issue in file checker to default to false
|
|
192
210
|
|
|
193
211
|
## v0.7.3
|
|
194
212
|
|
|
195
|
-
|
|
213
|
+
- Bump sentry-cli version
|
|
196
214
|
|
|
197
215
|
## v0.7.2
|
|
198
216
|
|
|
199
|
-
|
|
200
|
-
|
|
217
|
+
- Fix quiet mode and default parameter
|
|
218
|
+
- Fix version detection for @sentry/cli
|
|
201
219
|
|
|
202
220
|
## v0.7.1
|
|
203
221
|
|
|
204
|
-
|
|
222
|
+
- Improve function call for wizard and parameter validation/sanitation
|
|
205
223
|
|
|
206
224
|
## v0.7.0
|
|
207
225
|
|
|
208
|
-
|
|
226
|
+
- Use @sentry/cli
|
|
209
227
|
|
|
210
228
|
## v0.6.1
|
|
211
229
|
|
|
212
|
-
|
|
230
|
+
- Fixed https://github.com/getsentry/react-native-sentry/issues/304
|
|
213
231
|
|
|
214
232
|
## v0.6.0
|
|
215
233
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
234
|
+
- Add quiet mode --quiet
|
|
235
|
+
- Fallback to user prompts when not able to connect to Sentry
|
|
236
|
+
- Renamed parameter type/protype to integration
|
|
219
237
|
|
|
220
238
|
## v0.5.3
|
|
221
239
|
|
|
222
|
-
|
|
240
|
+
- Passing answers fixed in file helper
|
|
223
241
|
|
|
224
242
|
## v0.5.2
|
|
225
243
|
|
|
226
|
-
|
|
244
|
+
- Platform check
|
|
227
245
|
|
|
228
246
|
## v0.5.1
|
|
229
247
|
|
|
230
|
-
|
|
248
|
+
- Fix skip connection also for polling
|
|
231
249
|
|
|
232
250
|
## v0.5.0
|
|
233
251
|
|
|
234
|
-
|
|
235
|
-
|
|
252
|
+
- Add skip connection option to skip connecting to Sentry
|
|
253
|
+
- Add possiblity to overwrite args with ENV vars SENTRY_WIZARD prefixed
|
|
236
254
|
|
|
237
255
|
## v0.4.0
|
|
238
256
|
|
|
239
|
-
|
|
257
|
+
- Fix uninstall step for react-native
|
|
240
258
|
|
|
241
259
|
## v0.3.2
|
|
242
260
|
|
|
243
|
-
|
|
261
|
+
- Fix sentry-cli version
|
|
244
262
|
|
|
245
263
|
## v0.3.1
|
|
246
264
|
|
|
247
|
-
|
|
265
|
+
- Fix polling and json reponse parsing
|
|
248
266
|
|
|
249
267
|
## v0.3.0
|
|
250
268
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
269
|
+
- Add support for cordova
|
|
270
|
+
- Internal refactorings
|
|
271
|
+
- Check if project is already setup
|
|
254
272
|
|
|
255
273
|
## v0.2.2
|
|
256
274
|
|
|
257
|
-
|
|
275
|
+
- Fix build process
|
|
258
276
|
|
|
259
277
|
## v0.2.1
|
|
260
278
|
|
|
261
|
-
|
|
279
|
+
- Fix build process
|
|
262
280
|
|
|
263
281
|
## v0.2.0
|
|
264
282
|
|
|
265
|
-
|
|
283
|
+
- Add support for react-native
|
|
266
284
|
|
|
267
285
|
## v0.1.1
|
|
268
286
|
|
|
269
|
-
|
|
287
|
+
- Fix build process
|
|
270
288
|
|
|
271
289
|
## v0.1.0
|
|
272
290
|
|
|
273
|
-
|
|
291
|
+
- Inital release
|
package/README.md
CHANGED
|
@@ -4,34 +4,51 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
<br/>
|
|
6
6
|
<h1>Sentry Wizard</h1>
|
|
7
|
-
<h4>
|
|
7
|
+
<h4>The Sentry Wizard helps you set up your React Native, Cordova, Electron or Next.js projects with Sentry.</h4>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
[](https://travis-ci.org/getsentry/sentry-wizard)
|
|
11
10
|
[](https://www.npmjs.com/package/@sentry/wizard)
|
|
12
11
|
[](https://www.npmjs.com/package/@sentry/wizard)
|
|
13
12
|
[](https://www.npmjs.com/package/@sentry/wizard)
|
|
14
|
-
[](https://discord.gg/Ww9hbqr)
|
|
13
|
+
[](https://discord.gg/Ww9hbqr)
|
|
15
14
|
|
|
16
15
|
[](https://david-dm.org/getsentry/sentry-wizard?view=list)
|
|
17
16
|
[](https://david-dm.org/getsentry/sentry-wizard?type=dev&view=list)
|
|
18
17
|
[](https://david-dm.org/getsentry/sentry-wizard?type=peer&view=list)
|
|
19
18
|
|
|
20
|
-
|
|
21
19
|

|
|
22
20
|
|
|
23
|
-
|
|
24
21
|
# Usage
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
There are multiple ways to run the Wizard.
|
|
24
|
+
|
|
25
|
+
1. Install globally and run it anywhere:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g @sentry/wizard
|
|
29
|
+
# or
|
|
30
|
+
yarn global add @sentry/wizard
|
|
31
|
+
|
|
32
|
+
sentry-wizard
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
2. Install and run it in your project with `yarn`:
|
|
27
36
|
|
|
37
|
+
```bash
|
|
38
|
+
yarn add @sentry/wizard
|
|
39
|
+
yarn sentry-wizard
|
|
28
40
|
```
|
|
29
|
-
|
|
41
|
+
|
|
42
|
+
3. Run it directly without installing:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @sentry/wizard
|
|
30
46
|
```
|
|
31
47
|
|
|
32
|
-
|
|
48
|
+
At the current moment, the wizard is meant to be used for React Native, Cordova, Electron or Next.js. If you have other platforms you would like the wizard to support, please open a [GitHub issue](https://github.com/getsentry/sentry-wizard/issues)!
|
|
33
49
|
|
|
34
50
|
# Options
|
|
51
|
+
|
|
35
52
|
```
|
|
36
53
|
Options:
|
|
37
54
|
--help Show help [boolean]
|
|
@@ -56,7 +73,7 @@ Options:
|
|
|
56
73
|
|
|
57
74
|
## Resources
|
|
58
75
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
76
|
+
- [](https://forum.sentry.io/c/sdks)
|
|
77
|
+
- [](https://discord.gg/Ww9hbqr)
|
|
78
|
+
- [](http://stackoverflow.com/questions/tagged/sentry)
|
|
79
|
+
- [](https://twitter.com/intent/follow?screen_name=getsentry)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import NextErrorComponent from 'next/error';
|
|
2
|
+
|
|
3
|
+
import * as Sentry from '@sentry/nextjs';
|
|
4
|
+
|
|
5
|
+
const MyError = ({ statusCode, hasGetInitialPropsRun, err }) => {
|
|
6
|
+
if (!hasGetInitialPropsRun && err) {
|
|
7
|
+
// getInitialProps is not called in case of
|
|
8
|
+
// https://github.com/vercel/next.js/issues/8592. As a workaround, we pass
|
|
9
|
+
// err via _app.js so it can be captured
|
|
10
|
+
Sentry.captureException(err);
|
|
11
|
+
// Flushing is not required in this case as it only happens on the client
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return <NextErrorComponent statusCode={statusCode} />;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
MyError.getInitialProps = async (context) => {
|
|
18
|
+
const errorInitialProps = await NextErrorComponent.getInitialProps(context);
|
|
19
|
+
|
|
20
|
+
const { res, err, asPath } = context;
|
|
21
|
+
|
|
22
|
+
// Workaround for https://github.com/vercel/next.js/issues/8592, mark when
|
|
23
|
+
// getInitialProps has run
|
|
24
|
+
errorInitialProps.hasGetInitialPropsRun = true;
|
|
25
|
+
|
|
26
|
+
// Returning early because we don't want to log 404 errors to Sentry.
|
|
27
|
+
if (res?.statusCode === 404) {
|
|
28
|
+
return errorInitialProps;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Running on the server, the response object (`res`) is available.
|
|
32
|
+
//
|
|
33
|
+
// Next.js will pass an err on the server if a page's data fetching methods
|
|
34
|
+
// threw or returned a Promise that rejected
|
|
35
|
+
//
|
|
36
|
+
// Running on the client (browser), Next.js will provide an err if:
|
|
37
|
+
//
|
|
38
|
+
// - a page's `getInitialProps` threw or returned a Promise that rejected
|
|
39
|
+
// - an exception was thrown somewhere in the React lifecycle (render,
|
|
40
|
+
// componentDidMount, etc) that was caught by Next.js's React Error
|
|
41
|
+
// Boundary. Read more about what types of exceptions are caught by Error
|
|
42
|
+
// Boundaries: https://reactjs.org/docs/error-boundaries.html
|
|
43
|
+
|
|
44
|
+
if (err) {
|
|
45
|
+
Sentry.captureException(err);
|
|
46
|
+
|
|
47
|
+
// Flushing before returning is necessary if deploying to Vercel, see
|
|
48
|
+
// https://vercel.com/docs/platform/limits#streaming-responses
|
|
49
|
+
await Sentry.flush(2000);
|
|
50
|
+
|
|
51
|
+
return errorInitialProps;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// If this point is reached, getInitialProps was called without any
|
|
55
|
+
// information about what the error might be. This is unexpected and may
|
|
56
|
+
// indicate a bug introduced in Next.js, so record it in Sentry
|
|
57
|
+
Sentry.captureException(
|
|
58
|
+
new Error(`_error.js getInitialProps missing data at path: ${asPath}`),
|
|
59
|
+
);
|
|
60
|
+
await Sentry.flush(2000);
|
|
61
|
+
|
|
62
|
+
return errorInitialProps;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default MyError;
|
|
@@ -9,7 +9,7 @@ const moduleExports = {
|
|
|
9
9
|
// Your existing module.exports
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const sentryWebpackPluginOptions = {
|
|
13
13
|
// Additional config options for the Sentry Webpack plugin. Keep in mind that
|
|
14
14
|
// the following options are set automatically, and overriding them is not
|
|
15
15
|
// recommended:
|
|
@@ -23,4 +23,4 @@ const SentryWebpackPluginOptions = {
|
|
|
23
23
|
|
|
24
24
|
// Make sure adding Sentry options is the last code to run before exporting, to
|
|
25
25
|
// ensure that your source maps include changes from all other Webpack plugins
|
|
26
|
-
module.exports = withSentryConfig(moduleExports,
|
|
26
|
+
module.exports = withSentryConfig(moduleExports, sentryWebpackPluginOptions);
|
|
@@ -3,11 +3,15 @@ import { Args } from '../Constants';
|
|
|
3
3
|
export interface SentryCliProps {
|
|
4
4
|
[s: string]: string;
|
|
5
5
|
}
|
|
6
|
+
declare type SentryCliConfig = Record<string, SentryCliProps>;
|
|
6
7
|
export declare class SentryCli {
|
|
7
8
|
protected _argv: Args;
|
|
8
9
|
private _resolve;
|
|
9
10
|
constructor(_argv: Args);
|
|
10
11
|
setResolveFunction(resolve: (path: string) => string): void;
|
|
11
12
|
convertAnswersToProperties(answers: Answers): SentryCliProps;
|
|
13
|
+
/** Create the contents of a `sentry.properties` file */
|
|
12
14
|
dumpProperties(props: SentryCliProps): string;
|
|
15
|
+
dumpConfig(config: SentryCliConfig): string;
|
|
13
16
|
}
|
|
17
|
+
export {};
|
|
@@ -29,6 +29,7 @@ var SentryCli = /** @class */ (function () {
|
|
|
29
29
|
}
|
|
30
30
|
return props;
|
|
31
31
|
};
|
|
32
|
+
/** Create the contents of a `sentry.properties` file */
|
|
32
33
|
SentryCli.prototype.dumpProperties = function (props) {
|
|
33
34
|
var rv = [];
|
|
34
35
|
for (var key in props) {
|
|
@@ -37,6 +38,7 @@ var SentryCli = /** @class */ (function () {
|
|
|
37
38
|
var value = props[key];
|
|
38
39
|
key = key.replace(/\//g, '.');
|
|
39
40
|
if (value === undefined || value === null) {
|
|
41
|
+
// comment that property out since it has no value
|
|
40
42
|
rv.push("#" + key + "=");
|
|
41
43
|
}
|
|
42
44
|
else {
|
|
@@ -47,6 +49,18 @@ var SentryCli = /** @class */ (function () {
|
|
|
47
49
|
// eslint-disable-next-line prefer-template
|
|
48
50
|
return rv.join('\n') + '\n';
|
|
49
51
|
};
|
|
52
|
+
SentryCli.prototype.dumpConfig = function (config) {
|
|
53
|
+
var dumpedSections = [];
|
|
54
|
+
for (var sectionName in config) {
|
|
55
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
56
|
+
if (config.hasOwnProperty(sectionName)) {
|
|
57
|
+
var props = this.dumpProperties(config[sectionName]);
|
|
58
|
+
var section = "[" + sectionName + "]\n" + props;
|
|
59
|
+
dumpedSections.push(section);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return dumpedSections.join('\n');
|
|
63
|
+
};
|
|
50
64
|
return SentryCli;
|
|
51
65
|
}());
|
|
52
66
|
exports.SentryCli = SentryCli;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../lib/Helper/SentryCli.ts"],"names":[],"mappings":";;;AACA,0BAA4B;AAC5B,2BAA6B;
|
|
1
|
+
{"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../lib/Helper/SentryCli.ts"],"names":[],"mappings":";;;AACA,0BAA4B;AAC5B,2BAA6B;AAU7B;IAIE,mBAAsB,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;QAHjC,sDAAsD;QAC9C,aAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAEC,CAAC;IAE9B,sCAAkB,GAAzB,UAA0B,OAAiC;QACzD,IAAI,CAAC,QAAQ,GAAG,OAAc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CAAC,MAAI,GAAG,MAAG,CAAC,CAAC;iBACrB;qBAAM;oBACL,EAAE,CAAC,IAAI,CAAI,GAAG,SAAI,KAAO,CAAC,CAAC;iBAC5B;aACF;SACF;QACD,2CAA2C;QAC3C,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC9B,CAAC;IAEM,8BAAU,GAAjB,UAAkB,MAAuB;QACvC,IAAM,cAAc,GAAa,EAAE,CAAC;QACpC,KAAK,IAAM,WAAW,IAAI,MAAM,EAAE;YAChC,iDAAiD;YACjD,IAAI,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;gBACtC,IAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;gBACvD,IAAM,OAAO,GAAG,MAAI,WAAW,WAAM,KAAO,CAAC;gBAC7C,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC9B;SACF;QACD,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACH,gBAAC;AAAD,CAAC,AA3DD,IA2DC;AA3DY,8BAAS","sourcesContent":["import { Answers } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport { Args } from '../Constants';\n\nexport interface SentryCliProps {\n [s: string]: string;\n}\n\ntype SentryCliConfig = Record<string, SentryCliProps>;\n\nexport class SentryCli {\n // eslint-disable-next-line @typescript-eslint/typedef\n private _resolve = require.resolve;\n\n constructor(protected _argv: Args) {}\n\n public setResolveFunction(resolve: (path: string) => string): void {\n this._resolve = resolve as any;\n }\n\n public convertAnswersToProperties(answers: Answers): SentryCliProps {\n const props: SentryCliProps = {};\n props['defaults/url'] = this._argv.url;\n props['defaults/org'] = _.get(answers, 'config.organization.slug', null);\n props['defaults/project'] = _.get(answers, 'config.project.slug', null);\n props['auth/token'] = _.get(answers, 'config.auth.token', null);\n try {\n const cliPath = this._resolve('@sentry/cli/bin/sentry-cli');\n props['cli/executable'] = path\n .relative(process.cwd(), cliPath)\n .replace(/\\\\/g, '\\\\\\\\');\n } catch (e) {\n // we do nothing and leave everyting as it is\n }\n return props;\n }\n\n /** Create the contents of a `sentry.properties` file */\n public dumpProperties(props: SentryCliProps): string {\n const rv = [];\n for (let key in props) {\n // eslint-disable-next-line no-prototype-builtins\n if (props.hasOwnProperty(key)) {\n const value = props[key];\n key = key.replace(/\\//g, '.');\n if (value === undefined || value === null) {\n // comment that property out since it has no value\n rv.push(`#${key}=`);\n } else {\n rv.push(`${key}=${value}`);\n }\n }\n }\n // eslint-disable-next-line prefer-template\n return rv.join('\\n') + '\\n';\n }\n\n public dumpConfig(config: SentryCliConfig): string {\n const dumpedSections: string[] = [];\n for (const sectionName in config) {\n // eslint-disable-next-line no-prototype-builtins\n if (config.hasOwnProperty(sectionName)) {\n const props = this.dumpProperties(config[sectionName]);\n const section = `[${sectionName}]\\n${props}`;\n dumpedSections.push(section);\n }\n }\n return dumpedSections.join('\\n');\n }\n}\n"]}
|
|
@@ -10,7 +10,7 @@ export declare abstract class BaseIntegration extends BaseStep {
|
|
|
10
10
|
/**
|
|
11
11
|
* This can be used for example for platform:boolean to determine
|
|
12
12
|
* if we should configure iOS/Android.
|
|
13
|
-
* Basically this will be merged into answers so it can be
|
|
13
|
+
* Basically this will be merged into answers so it can be checked by a later step.
|
|
14
14
|
*/
|
|
15
15
|
shouldConfigure(_answers: Answers): Promise<Answers>;
|
|
16
16
|
shouldEmit(_answers: Answers): Promise<boolean>;
|
|
@@ -71,7 +71,7 @@ var BaseIntegration = /** @class */ (function (_super) {
|
|
|
71
71
|
/**
|
|
72
72
|
* This can be used for example for platform:boolean to determine
|
|
73
73
|
* if we should configure iOS/Android.
|
|
74
|
-
* Basically this will be merged into answers so it can be
|
|
74
|
+
* Basically this will be merged into answers so it can be checked by a later step.
|
|
75
75
|
*/
|
|
76
76
|
BaseIntegration.prototype.shouldConfigure = function (_answers) {
|
|
77
77
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -93,7 +93,8 @@ var BaseIntegration = /** @class */ (function (_super) {
|
|
|
93
93
|
_b = (_a = _).keys;
|
|
94
94
|
_d = (_c = _).pickBy;
|
|
95
95
|
return [4 /*yield*/, this.shouldConfigure(_answers)];
|
|
96
|
-
case 1: return [2 /*return*/, (_b.apply(_a, [_d.apply(_c, [_e.sent(),
|
|
96
|
+
case 1: return [2 /*return*/, (_b.apply(_a, [_d.apply(_c, [_e.sent(),
|
|
97
|
+
function (active) { return active; }])]).length > 0)];
|
|
97
98
|
}
|
|
98
99
|
});
|
|
99
100
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseIntegration.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/BaseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0BAA4B;AAG5B,wCAAuC;AAEvC;IAA8C,mCAAQ;IAIpD,yBAAsB,KAAW;QAAjC,YACE,kBAAM,KAAK,CAAC,SAGb;QAJqB,WAAK,GAAL,KAAK,CAAM;QAE/B,kEAAkE;QAClE,KAAI,CAAC,IAAI,GAAG,KAAI,CAAC,SAAS,CAAC;;IAC7B,CAAC;IAEY,mCAAS,GAAtB,UAAuB,QAAiB;;;gBACtC,sBAAO,EAAE,EAAC;;;KACX;IAED;;;;OAIG;IACU,yCAAe,GAA5B,UAA6B,QAAiB;;;gBAC5C,IAAI,IAAI,CAAC,gBAAgB,EAAE;oBACzB,sBAAO,IAAI,CAAC,gBAAgB,EAAC;iBAC9B;gBACD,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC5D,sBAAO,IAAI,CAAC,gBAAgB,EAAC;;;KAC9B;IAEY,oCAAU,GAAvB,UAAwB,QAAiB;;;;;;wBAErC,KAAA,CAAA,KAAA,CAAC,CAAA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AAvCqB,0CAAe","sourcesContent":["import { Answers } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport { Args } from '../../Constants';\nimport { BaseStep } from '../BaseStep';\n\nexport abstract class BaseIntegration extends BaseStep {\n public type: string;\n protected _shouldConfigure: Promise<Answers>;\n\n constructor(protected _argv: Args) {\n super(_argv);\n // @ts-ignore property construct does not exist on BaseIntegration\n this.type = this.construct;\n }\n\n public async uninstall(_answers: Answers): Promise<Answers> {\n return {};\n }\n\n /**\n * This can be used for example for platform:boolean to determine\n * if we should configure iOS/Android.\n * Basically this will be merged into answers so it can be checked by a later step.\n */\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n this._shouldConfigure = Promise.resolve({ platform: true });\n return this._shouldConfigure;\n }\n\n public async shouldEmit(_answers: Answers): Promise<boolean> {\n return (\n _.keys(\n _.pickBy(\n await this.shouldConfigure(_answers),\n (active: boolean) => active,\n ),\n ).length > 0\n );\n }\n\n public abstract emit(answers: Answers): Promise<Answers>;\n}\n"]}
|
|
@@ -13,6 +13,7 @@ export declare class NextJs extends BaseIntegration {
|
|
|
13
13
|
private _createNextConfig;
|
|
14
14
|
private _setTemplate;
|
|
15
15
|
private _fillAndCopyTemplate;
|
|
16
|
-
private
|
|
17
|
-
private
|
|
16
|
+
private _checkUserNextVersion;
|
|
17
|
+
private _fulfillsVersionRange;
|
|
18
|
+
private _spliceInPlace;
|
|
18
19
|
}
|