@sentry/wizard 1.2.11 → 1.2.15
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 +98 -80
- package/README.md +26 -11
- package/dist/NextJs/configs/_error.js +61 -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 +5 -2
- package/dist/lib/Steps/Integrations/NextJs.js +187 -67
- 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 +195 -71
- package/package.json +1 -1
- package/scripts/NextJs/configs/_error.js +61 -0
- package/scripts/NextJs/configs/next.config.js +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,268 +2,286 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.2.15
|
|
6
|
+
|
|
7
|
+
- Check version range rather than minimum version for nextjs (#143)
|
|
8
|
+
|
|
9
|
+
## 1.2.14
|
|
10
|
+
|
|
11
|
+
- Automatically include `pages/_error.js` when setting up nextjs project (#140)
|
|
12
|
+
- Clarify "Usage" section of `README.md` (#139)
|
|
13
|
+
|
|
14
|
+
## 1.2.13
|
|
15
|
+
|
|
16
|
+
- Fix `.sentryclirc` file formatting (#131)
|
|
17
|
+
|
|
18
|
+
## 1.2.12
|
|
19
|
+
|
|
20
|
+
- Don't expose auth token in `sentry.properties` (#128)
|
|
21
|
+
|
|
5
22
|
## 1.2.11
|
|
6
23
|
|
|
7
|
-
|
|
24
|
+
- Parse Next.js version as a string, instead of int (#122)
|
|
8
25
|
|
|
9
26
|
## 1.2.10
|
|
10
27
|
|
|
11
|
-
|
|
28
|
+
- Check new contents before overwriting a file (#117)
|
|
12
29
|
|
|
13
30
|
## 1.2.9
|
|
14
31
|
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
- Add performance monitoring support to nextjs scripts (#114)
|
|
33
|
+
- Make webpack silent by default in nextjs config (#113)
|
|
17
34
|
|
|
18
35
|
## v1.2.8
|
|
19
36
|
|
|
20
|
-
|
|
37
|
+
- Fix React Native JS patching throwing errors due to incorrect argument
|
|
21
38
|
|
|
22
39
|
## v1.2.7
|
|
23
40
|
|
|
24
|
-
|
|
25
|
-
|
|
41
|
+
- Fix React Native uninstall script
|
|
42
|
+
- Fix platform selection issues and repeated prompts on Mobile Projects.
|
|
26
43
|
|
|
27
44
|
## v1.2.6
|
|
28
45
|
|
|
29
|
-
|
|
46
|
+
- Get release from environment for the Next.js SDK
|
|
30
47
|
|
|
31
48
|
## v1.2.5
|
|
32
49
|
|
|
33
|
-
|
|
50
|
+
- Ignore coverage when linting and clarify Next.js messages.
|
|
34
51
|
|
|
35
52
|
## v1.2.4
|
|
36
53
|
|
|
37
|
-
|
|
38
|
-
|
|
54
|
+
- Add Next.js SDK initialization config files.
|
|
55
|
+
- Update webpack config file of Next.js.
|
|
39
56
|
|
|
40
57
|
## v1.2.3
|
|
41
58
|
|
|
42
|
-
|
|
43
|
-
|
|
59
|
+
- Don't use `package` as a varname in the NextJS config
|
|
60
|
+
- Enable env variables in the NextJS config
|
|
44
61
|
|
|
45
62
|
## v1.2.2
|
|
46
63
|
|
|
47
|
-
|
|
64
|
+
- Add support for `NEXT_PUBLIC_SENTRY_DSN`
|
|
48
65
|
|
|
49
66
|
## v1.2.1
|
|
50
67
|
|
|
51
|
-
|
|
68
|
+
- Update `next.config.js`, and create mergeable configs when they already exist
|
|
52
69
|
|
|
53
70
|
## v1.2.0
|
|
54
71
|
|
|
55
|
-
|
|
72
|
+
- Add support for Next.js
|
|
56
73
|
|
|
57
74
|
## v1.1.4
|
|
58
75
|
|
|
59
|
-
|
|
76
|
+
- Bump @sentry/cli `1.52.4`
|
|
60
77
|
|
|
61
78
|
## v1.1.3
|
|
62
79
|
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
- Add sourcemap output path to derived data to react native ios script
|
|
81
|
+
- Bump @sentry/cli `1.52.3`
|
|
65
82
|
|
|
66
83
|
## v1.1.2
|
|
67
84
|
|
|
68
|
-
|
|
85
|
+
- Don't `cli/executable` for Android project on react-native
|
|
69
86
|
|
|
70
87
|
## v1.1.1
|
|
71
88
|
|
|
72
|
-
|
|
89
|
+
- Bump @sentry/cli `1.51.0`
|
|
73
90
|
|
|
74
91
|
## v1.1.0
|
|
75
92
|
|
|
76
|
-
|
|
93
|
+
- Bump @sentry/cli `1.50.0`
|
|
77
94
|
|
|
78
95
|
## v1.0.2
|
|
79
96
|
|
|
80
|
-
|
|
97
|
+
- Several dependeny bumps with related security updates
|
|
81
98
|
|
|
82
99
|
## v1.0.1
|
|
83
100
|
|
|
84
|
-
|
|
85
|
-
|
|
101
|
+
- Strip only `Sentry*` frameworks for Cordova
|
|
102
|
+
- Guard Xcode project updates for react-native
|
|
86
103
|
|
|
87
104
|
## v1.0.0
|
|
88
105
|
|
|
89
|
-
|
|
106
|
+
- Support for new `@sentry/react-native`
|
|
90
107
|
|
|
91
108
|
## v0.13.0
|
|
92
109
|
|
|
93
|
-
|
|
110
|
+
- Bump @sentry/cli `1.43.0`
|
|
94
111
|
|
|
95
112
|
## v0.12.1
|
|
96
113
|
|
|
97
|
-
|
|
114
|
+
- Bump @sentry/cli `1.36.1`
|
|
98
115
|
|
|
99
116
|
## v0.12.0
|
|
100
117
|
|
|
101
|
-
|
|
102
|
-
|
|
118
|
+
- Fixed #22
|
|
119
|
+
- Bumped dependencies
|
|
103
120
|
|
|
104
121
|
## v0.11.1
|
|
105
122
|
|
|
106
|
-
|
|
123
|
+
- Fixed #16
|
|
107
124
|
|
|
108
125
|
## v0.11.0
|
|
109
126
|
|
|
110
|
-
|
|
127
|
+
- Update all dependencies, Fix tests on travis
|
|
111
128
|
|
|
112
129
|
## v0.10.3
|
|
113
130
|
|
|
114
|
-
|
|
131
|
+
- Use public DSN for react-native
|
|
115
132
|
|
|
116
133
|
## v0.10.2
|
|
117
134
|
|
|
118
|
-
|
|
135
|
+
- Remove secret DSN part check for prompt
|
|
119
136
|
|
|
120
137
|
## v0.10.1
|
|
121
138
|
|
|
122
|
-
|
|
139
|
+
- Use opn in favor of open
|
|
123
140
|
|
|
124
141
|
## v0.10.0
|
|
125
142
|
|
|
126
|
-
|
|
143
|
+
- Change Cordova wizard steps to only run once and create properties file in
|
|
144
|
+
root
|
|
127
145
|
|
|
128
146
|
## v0.9.7
|
|
129
147
|
|
|
130
|
-
|
|
148
|
+
- Fix a bug where sentry-wizard will ask for parameters on uninstall
|
|
131
149
|
|
|
132
150
|
## v0.9.6
|
|
133
151
|
|
|
134
|
-
|
|
152
|
+
- Fix electron symbol upload script
|
|
135
153
|
|
|
136
154
|
## v0.9.5
|
|
137
155
|
|
|
138
|
-
|
|
156
|
+
- Update Electron instructions to latest SDK version
|
|
139
157
|
|
|
140
158
|
## v0.9.4
|
|
141
159
|
|
|
142
|
-
|
|
143
|
-
|
|
160
|
+
- Restore Node compatibility
|
|
161
|
+
- Add more tests
|
|
144
162
|
|
|
145
163
|
## v0.9.3
|
|
146
164
|
|
|
147
|
-
|
|
165
|
+
- Fix Electron installation code - Fixes #7
|
|
148
166
|
|
|
149
167
|
## v0.9.2
|
|
150
168
|
|
|
151
|
-
|
|
152
|
-
|
|
169
|
+
- Support Electron prereleases in symbol upload
|
|
170
|
+
- Correctly upload Electron dSYMs for macOS
|
|
153
171
|
|
|
154
172
|
## v0.9.1
|
|
155
173
|
|
|
156
|
-
|
|
174
|
+
- Add strip arch script for cordova
|
|
157
175
|
|
|
158
176
|
## v0.9.0
|
|
159
177
|
|
|
160
|
-
|
|
178
|
+
- Add support for electron projects
|
|
161
179
|
|
|
162
180
|
## v0.8.3
|
|
163
181
|
|
|
164
|
-
|
|
182
|
+
- Fixed an issue where file exsists always returned false
|
|
165
183
|
|
|
166
184
|
## v0.8.2
|
|
167
185
|
|
|
168
|
-
|
|
186
|
+
- Move sentry.properties file to plugins folder for Cordova
|
|
169
187
|
|
|
170
188
|
## v0.8.1
|
|
171
189
|
|
|
172
|
-
|
|
173
|
-
|
|
190
|
+
- Fix react-native js file patching
|
|
191
|
+
- Bump sentry-cli to 1.28.4
|
|
174
192
|
|
|
175
193
|
## v0.8.0
|
|
176
194
|
|
|
177
|
-
|
|
195
|
+
- Fix Cordova sentry-cli upload-dsym command for Xcode
|
|
178
196
|
|
|
179
197
|
## v0.7.5
|
|
180
198
|
|
|
181
|
-
|
|
199
|
+
- Bump sentry-cli version to 1.28.1
|
|
182
200
|
|
|
183
201
|
## v0.7.4
|
|
184
202
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
203
|
+
- Bump sentry-cli version to 1.27.1
|
|
204
|
+
- Fix Cordova integration
|
|
205
|
+
- Fix issue in file checker to default to false
|
|
188
206
|
|
|
189
207
|
## v0.7.3
|
|
190
208
|
|
|
191
|
-
|
|
209
|
+
- Bump sentry-cli version
|
|
192
210
|
|
|
193
211
|
## v0.7.2
|
|
194
212
|
|
|
195
|
-
|
|
196
|
-
|
|
213
|
+
- Fix quiet mode and default parameter
|
|
214
|
+
- Fix version detection for @sentry/cli
|
|
197
215
|
|
|
198
216
|
## v0.7.1
|
|
199
217
|
|
|
200
|
-
|
|
218
|
+
- Improve function call for wizard and parameter validation/sanitation
|
|
201
219
|
|
|
202
220
|
## v0.7.0
|
|
203
221
|
|
|
204
|
-
|
|
222
|
+
- Use @sentry/cli
|
|
205
223
|
|
|
206
224
|
## v0.6.1
|
|
207
225
|
|
|
208
|
-
|
|
226
|
+
- Fixed https://github.com/getsentry/react-native-sentry/issues/304
|
|
209
227
|
|
|
210
228
|
## v0.6.0
|
|
211
229
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
230
|
+
- Add quiet mode --quiet
|
|
231
|
+
- Fallback to user prompts when not able to connect to Sentry
|
|
232
|
+
- Renamed parameter type/protype to integration
|
|
215
233
|
|
|
216
234
|
## v0.5.3
|
|
217
235
|
|
|
218
|
-
|
|
236
|
+
- Passing answers fixed in file helper
|
|
219
237
|
|
|
220
238
|
## v0.5.2
|
|
221
239
|
|
|
222
|
-
|
|
240
|
+
- Platform check
|
|
223
241
|
|
|
224
242
|
## v0.5.1
|
|
225
243
|
|
|
226
|
-
|
|
244
|
+
- Fix skip connection also for polling
|
|
227
245
|
|
|
228
246
|
## v0.5.0
|
|
229
247
|
|
|
230
|
-
|
|
231
|
-
|
|
248
|
+
- Add skip connection option to skip connecting to Sentry
|
|
249
|
+
- Add possiblity to overwrite args with ENV vars SENTRY_WIZARD prefixed
|
|
232
250
|
|
|
233
251
|
## v0.4.0
|
|
234
252
|
|
|
235
|
-
|
|
253
|
+
- Fix uninstall step for react-native
|
|
236
254
|
|
|
237
255
|
## v0.3.2
|
|
238
256
|
|
|
239
|
-
|
|
257
|
+
- Fix sentry-cli version
|
|
240
258
|
|
|
241
259
|
## v0.3.1
|
|
242
260
|
|
|
243
|
-
|
|
261
|
+
- Fix polling and json reponse parsing
|
|
244
262
|
|
|
245
263
|
## v0.3.0
|
|
246
264
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
265
|
+
- Add support for cordova
|
|
266
|
+
- Internal refactorings
|
|
267
|
+
- Check if project is already setup
|
|
250
268
|
|
|
251
269
|
## v0.2.2
|
|
252
270
|
|
|
253
|
-
|
|
271
|
+
- Fix build process
|
|
254
272
|
|
|
255
273
|
## v0.2.1
|
|
256
274
|
|
|
257
|
-
|
|
275
|
+
- Fix build process
|
|
258
276
|
|
|
259
277
|
## v0.2.0
|
|
260
278
|
|
|
261
|
-
|
|
279
|
+
- Add support for react-native
|
|
262
280
|
|
|
263
281
|
## v0.1.1
|
|
264
282
|
|
|
265
|
-
|
|
283
|
+
- Fix build process
|
|
266
284
|
|
|
267
285
|
## v0.1.0
|
|
268
286
|
|
|
269
|
-
|
|
287
|
+
- Inital release
|
package/README.md
CHANGED
|
@@ -7,31 +7,46 @@
|
|
|
7
7
|
<h4>Helping you to set up your project 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:
|
|
27
26
|
|
|
27
|
+
```bash
|
|
28
|
+
npm install -g @sentry/wizard
|
|
29
|
+
# or
|
|
30
|
+
yarn global add @sentry/wizard
|
|
31
|
+
|
|
32
|
+
sentry-wizard
|
|
28
33
|
```
|
|
29
|
-
|
|
34
|
+
|
|
35
|
+
2. Install and run it in your project with `yarn`:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
yarn add @sentry/wizard
|
|
39
|
+
yarn sentry-wizard
|
|
30
40
|
```
|
|
31
41
|
|
|
32
|
-
|
|
42
|
+
3. Run it directly without installing:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @sentry/wizard
|
|
46
|
+
```
|
|
33
47
|
|
|
34
48
|
# Options
|
|
49
|
+
|
|
35
50
|
```
|
|
36
51
|
Options:
|
|
37
52
|
--help Show help [boolean]
|
|
@@ -56,7 +71,7 @@ Options:
|
|
|
56
71
|
|
|
57
72
|
## Resources
|
|
58
73
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
- [](https://forum.sentry.io/c/sdks)
|
|
75
|
+
- [](https://discord.gg/Ww9hbqr)
|
|
76
|
+
- [](http://stackoverflow.com/questions/tagged/sentry)
|
|
77
|
+
- [](https://twitter.com/intent/follow?screen_name=getsentry)
|
|
@@ -0,0 +1,61 @@
|
|
|
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 ({ res, err, asPath }) => {
|
|
18
|
+
const errorInitialProps = await NextErrorComponent.getInitialProps({
|
|
19
|
+
res,
|
|
20
|
+
err,
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Workaround for https://github.com/vercel/next.js/issues/8592, mark when
|
|
24
|
+
// getInitialProps has run
|
|
25
|
+
errorInitialProps.hasGetInitialPropsRun = true;
|
|
26
|
+
|
|
27
|
+
// Running on the server, the response object (`res`) is available.
|
|
28
|
+
//
|
|
29
|
+
// Next.js will pass an err on the server if a page's data fetching methods
|
|
30
|
+
// threw or returned a Promise that rejected
|
|
31
|
+
//
|
|
32
|
+
// Running on the client (browser), Next.js will provide an err if:
|
|
33
|
+
//
|
|
34
|
+
// - a page's `getInitialProps` threw or returned a Promise that rejected
|
|
35
|
+
// - an exception was thrown somewhere in the React lifecycle (render,
|
|
36
|
+
// componentDidMount, etc) that was caught by Next.js's React Error
|
|
37
|
+
// Boundary. Read more about what types of exceptions are caught by Error
|
|
38
|
+
// Boundaries: https://reactjs.org/docs/error-boundaries.html
|
|
39
|
+
|
|
40
|
+
if (err) {
|
|
41
|
+
Sentry.captureException(err);
|
|
42
|
+
|
|
43
|
+
// Flushing before returning is necessary if deploying to Vercel, see
|
|
44
|
+
// https://vercel.com/docs/platform/limits#streaming-responses
|
|
45
|
+
await Sentry.flush(2000);
|
|
46
|
+
|
|
47
|
+
return errorInitialProps;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// If this point is reached, getInitialProps was called without any
|
|
51
|
+
// information about what the error might be. This is unexpected and may
|
|
52
|
+
// indicate a bug introduced in Next.js, so record it in Sentry
|
|
53
|
+
Sentry.captureException(
|
|
54
|
+
new Error(`_error.js getInitialProps missing data at path: ${asPath}`),
|
|
55
|
+
);
|
|
56
|
+
await Sentry.flush(2000);
|
|
57
|
+
|
|
58
|
+
return errorInitialProps;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
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,CAAC;IACjC,CAAC;IAEM,8CAA0B,GAAjC,UAAkC,OAAgB;QAChD,IAAM,KAAK,GAAmB,EAAE,CAAC;QACjC,KAAK,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;QACvC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,CAAC;QACzE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAC;QACxE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;QAChE,IAAI;YACF,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC,CAAC;YAC5D,KAAK,CAAC,gBAAgB,CAAC,GAAG,IAAI;iBAC3B,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC;iBAChC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;SAC3B;QAAC,OAAO,CAAC,EAAE;YACV,6CAA6C;SAC9C;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,wDAAwD;IACjD,kCAAc,GAArB,UAAsB,KAAqB;QACzC,IAAM,EAAE,GAAG,EAAE,CAAC;QACd,KAAK,IAAI,GAAG,IAAI,KAAK,EAAE;YACrB,iDAAiD;YACjD,IAAI,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;gBAC7B,IAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBAC9B,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,EAAE;oBACzC,kDAAkD;oBAClD,EAAE,CAAC,IAAI,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,CAAC,IAAI,CAAA;wBACJ,KAAA,CAAA,KAAA,CAAC,CAAA,CAAC,MAAM,CAAA;
|
|
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,CAAC,IAAI,CAAA;wBACJ,KAAA,CAAA,KAAA,CAAC,CAAA,CAAC,MAAM,CAAA;wBACN,qBAAM,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAA;4BAH1C,sBAAO,CACL,cACE,cACE,SAAoC;gCACpC,UAAC,MAAe,IAAK,OAAA,MAAM,EAAN,CAAM,EAC5B,EACF,CAAC,MAAM,GAAG,CAAC,CACb,EAAC;;;;KACH;IAGH,sBAAC;AAAD,CAAC,AAvCD,CAA8C,mBAAQ,GAuCrD;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"]}
|
|
@@ -8,9 +8,12 @@ export declare class NextJs extends BaseIntegration {
|
|
|
8
8
|
constructor(_argv: Args);
|
|
9
9
|
emit(answers: Answers): Promise<Answers>;
|
|
10
10
|
shouldConfigure(_answers: Answers): Promise<Answers>;
|
|
11
|
+
private _createSentryCliConfig;
|
|
12
|
+
private _addToGitignore;
|
|
11
13
|
private _createNextConfig;
|
|
12
14
|
private _setTemplate;
|
|
13
15
|
private _fillAndCopyTemplate;
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
+
private _checkUserNextVersion;
|
|
17
|
+
private _fulfillsVersionRange;
|
|
18
|
+
private _spliceInPlace;
|
|
16
19
|
}
|