@sentry/wizard 2.0.0 → 2.1.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 (34) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/NextJs/sentry_sample_error.js +47 -0
  3. package/dist/lib/Constants.d.ts +1 -1
  4. package/dist/lib/Constants.js.map +1 -1
  5. package/dist/lib/Helper/File.d.ts +1 -0
  6. package/dist/lib/Helper/File.js +9 -3
  7. package/dist/lib/Helper/File.js.map +1 -1
  8. package/dist/lib/Helper/Logging.d.ts +1 -0
  9. package/dist/lib/Helper/Logging.js +5 -1
  10. package/dist/lib/Helper/Logging.js.map +1 -1
  11. package/dist/lib/Helper/__tests__/SentryCli.js +1 -1
  12. package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
  13. package/dist/lib/Steps/Integrations/Electron.js +2 -11
  14. package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
  15. package/dist/lib/Steps/Integrations/NextJs.js +16 -5
  16. package/dist/lib/Steps/Integrations/NextJs.js.map +1 -1
  17. package/dist/lib/Steps/Integrations/ReactNative.d.ts +1 -0
  18. package/dist/lib/Steps/Integrations/ReactNative.js +34 -13
  19. package/dist/lib/Steps/Integrations/ReactNative.js.map +1 -1
  20. package/dist/lib/Steps/Integrations/__tests__/ReactNative.d.ts +1 -0
  21. package/dist/lib/Steps/Integrations/__tests__/ReactNative.js +103 -0
  22. package/dist/lib/Steps/Integrations/__tests__/ReactNative.js.map +1 -0
  23. package/lib/Constants.ts +1 -1
  24. package/lib/Helper/File.ts +8 -2
  25. package/lib/Helper/Logging.ts +4 -0
  26. package/lib/Helper/__tests__/SentryCli.ts +1 -1
  27. package/lib/Steps/Integrations/Electron.ts +1 -25
  28. package/lib/Steps/Integrations/NextJs.ts +29 -1
  29. package/lib/Steps/Integrations/ReactNative.ts +29 -16
  30. package/lib/Steps/Integrations/__tests__/ReactNative.ts +67 -0
  31. package/package.json +4 -1
  32. package/scripts/NextJs/sentry_sample_error.js +47 -0
  33. package/dist/Electron/symbols.js +0 -94
  34. package/scripts/Electron/symbols.js +0 -94
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.1.0
4
+
5
+ - feat(rn): Add support for RN TypeScript and other templates
6
+
7
+ ## 2.0.2
8
+
9
+ - fix(electron): Remove Electron symbols.js script
10
+
11
+ ## 2.0.1
12
+
13
+ - feat(nextjs): Add page to send onboarding sample error for Next.js (#179)
14
+
3
15
  ## 2.0.0
4
16
 
5
17
  - fix(react-native) Xcode linking for RN 0.69 and higher (#178)
@@ -0,0 +1,47 @@
1
+ import Head from 'next/head'
2
+
3
+ const boxStyles = { padding: '12px', border: '1px solid #eaeaea', borderRadius: '10px' };
4
+ export default function Home() {
5
+ return (
6
+ <div>
7
+ <Head>
8
+ <title>Sentry Onboarding</title>
9
+ <meta name="description" content="Make your Next.js ready for Sentry" />
10
+ </Head>
11
+
12
+ <main style={{
13
+ minHeight: '100vh',
14
+ display: 'flex',
15
+ flexDirection: 'column',
16
+ justifyContent: 'center',
17
+ alignItems: 'center',
18
+ }}>
19
+ <h1 style={{ fontSize: '4rem' }}>
20
+ <svg style={{
21
+ height: '1em'
22
+ }} xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 44">
23
+ <path fill="currentColor" d="M124.32,28.28,109.56,9.22h-3.68V34.77h3.73V15.19l15.18,19.58h3.26V9.22h-3.73ZM87.15,23.54h13.23V20.22H87.14V12.53h14.93V9.21H83.34V34.77h18.92V31.45H87.14ZM71.59,20.3h0C66.44,19.06,65,18.08,65,15.7c0-2.14,1.89-3.59,4.71-3.59a12.06,12.06,0,0,1,7.07,2.55l2-2.83a14.1,14.1,0,0,0-9-3c-5.06,0-8.59,3-8.59,7.27,0,4.6,3,6.19,8.46,7.52C74.51,24.74,76,25.78,76,28.11s-2,3.77-5.09,3.77a12.34,12.34,0,0,1-8.3-3.26l-2.25,2.69a15.94,15.94,0,0,0,10.42,3.85c5.48,0,9-2.95,9-7.51C79.75,23.79,77.47,21.72,71.59,20.3ZM195.7,9.22l-7.69,12-7.64-12h-4.46L186,24.67V34.78h3.84V24.55L200,9.22Zm-64.63,3.46h8.37v22.1h3.84V12.68h8.37V9.22H131.08ZM169.41,24.8c3.86-1.07,6-3.77,6-7.63,0-4.91-3.59-8-9.38-8H154.67V34.76h3.8V25.58h6.45l6.48,9.2h4.44l-7-9.82Zm-10.95-2.5V12.6h7.17c3.74,0,5.88,1.77,5.88,4.84s-2.29,4.86-5.84,4.86Z M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"></path>
24
+ </svg>
25
+ </h1>
26
+
27
+ <p >
28
+ Get started by sending us a sample error
29
+ </p>
30
+ <button type="button" style={{
31
+ ...boxStyles,
32
+ backgroundColor: '#c73852',
33
+ borderRadius: '12px',
34
+ border: 'none'
35
+ }} onClick={() => {
36
+ throw new Error("Sentry Frontend Error");
37
+ }}>
38
+ Throw error
39
+ </button>
40
+
41
+ <p>
42
+ For more information, see <a href="https://docs.sentry.io/platforms/javascript/guides/nextjs/">https://docs.sentry.io/platforms/javascript/guides/nextjs/</a>
43
+ </p>
44
+ </main>
45
+ </div>
46
+ )
47
+ }
@@ -19,7 +19,7 @@ export interface Args {
19
19
  debug: boolean;
20
20
  uninstall: boolean;
21
21
  integration: Integration;
22
- platform: Platform;
22
+ platform: Platform[];
23
23
  skipConnect: boolean;
24
24
  quiet: boolean;
25
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../lib/Constants.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,wCAAwC;AACxC,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,+BAAmB,CAAA;AACrB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,SAAgB,kBAAkB;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,UAAC,QAAgB,IAAK,OAAA,CAAC;QACtD,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;QACtC,KAAK,EAAE,QAAQ;KAChB,CAAC,EAJqD,CAIrD,CAAC,CAAC;AACN,CAAC;AAND,gDAMC;AAED,SAAgB,sBAAsB,CAAC,IAAY;IACjD,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ,CAAC,GAAG;YACf,OAAO,KAAK,CAAC;QACf;YACE,OAAO,SAAS,CAAC;KACpB;AACH,CAAC;AAPD,wDAOC;AAED,SAAgB,yBAAyB,CAAC,IAAY;IACpD,QAAQ,IAAI,EAAE;QACZ,KAAK,WAAW,CAAC,WAAW;YAC1B,OAAO,cAAc,CAAC;QACxB,KAAK,WAAW,CAAC,OAAO;YACtB,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW,CAAC,QAAQ;YACvB,OAAO,UAAU,CAAC;QACpB,KAAK,WAAW,CAAC,MAAM;YACrB,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC;AAbD,8DAaC;AAED,SAAgB,qBAAqB;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,IAAY,IAAK,OAAA,CAAC;QACrD,IAAI,EAAE,yBAAyB,CAAC,IAAI,CAAC;QACrC,KAAK,EAAE,IAAI;KACZ,CAAC,EAHoD,CAGpD,CAAC,CAAC;AACN,CAAC;AALD,sDAKC;AAYY,QAAA,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["/** Key value should be the same here */\nexport enum Integration {\n reactNative = 'reactNative',\n cordova = 'cordova',\n electron = 'electron',\n nextjs = 'nextjs',\n}\n\n/** Key value should be the same here */\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n}\n\nexport function getPlatformChoices(): any[] {\n return Object.keys(Platform).map((platform: string) => ({\n checked: true,\n name: getPlatformDescription(platform),\n value: platform,\n }));\n}\n\nexport function getPlatformDescription(type: string): string {\n switch (type) {\n case Platform.ios:\n return 'iOS';\n default:\n return 'Android';\n }\n}\n\nexport function getIntegrationDescription(type: string): string {\n switch (type) {\n case Integration.reactNative:\n return 'React Native';\n case Integration.cordova:\n return 'Cordova';\n case Integration.electron:\n return 'Electron';\n case Integration.nextjs:\n return 'Next.js';\n default:\n return 'React Native';\n }\n}\n\nexport function getIntegrationChoices(): any[] {\n return Object.keys(Integration).map((type: string) => ({\n name: getIntegrationDescription(type),\n value: type,\n }));\n}\n\nexport interface Args {\n url: string;\n debug: boolean;\n uninstall: boolean;\n integration: Integration;\n platform: Platform;\n skipConnect: boolean;\n quiet: boolean;\n}\n\nexport const DEFAULT_URL = 'https://sentry.io/';\n"]}
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../lib/Constants.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,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AAK,EAAE,IAAI;KACZ,CAAC,EAHoD,CAGpD,CAAC,CAAC;AACN,CAAC;AALD,sDAKC;AAYY,QAAA,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["/** Key value should be the same here */\nexport enum Integration {\n reactNative = 'reactNative',\n cordova = 'cordova',\n electron = 'electron',\n nextjs = 'nextjs',\n}\n\n/** Key value should be the same here */\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n}\n\nexport function getPlatformChoices(): any[] {\n return Object.keys(Platform).map((platform: string) => ({\n checked: true,\n name: getPlatformDescription(platform),\n value: platform,\n }));\n}\n\nexport function getPlatformDescription(type: string): string {\n switch (type) {\n case Platform.ios:\n return 'iOS';\n default:\n return 'Android';\n }\n}\n\nexport function getIntegrationDescription(type: string): string {\n switch (type) {\n case Integration.reactNative:\n return 'React Native';\n case Integration.cordova:\n return 'Cordova';\n case Integration.electron:\n return 'Electron';\n case Integration.nextjs:\n return 'Next.js';\n default:\n return 'React Native';\n }\n}\n\nexport function getIntegrationChoices(): any[] {\n return Object.keys(Integration).map((type: string) => ({\n name: getIntegrationDescription(type),\n value: type,\n }));\n}\n\nexport interface Args {\n url: string;\n debug: boolean;\n uninstall: boolean;\n integration: Integration;\n platform: Platform[];\n skipConnect: boolean;\n quiet: boolean;\n}\n\nexport const DEFAULT_URL = 'https://sentry.io/';\n"]}
@@ -1,3 +1,4 @@
1
1
  export declare function patchMatchingFile(globPattern: string, func: any, ...args: any[]): Promise<void>;
2
+ export declare function matchFiles(globPattern: string): string[];
2
3
  export declare function exists(globPattern: string): boolean;
3
4
  export declare function matchesContent(globPattern: string, contentPattern: RegExp): boolean;
@@ -7,9 +7,9 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
7
7
  return r;
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.matchesContent = exports.exists = exports.patchMatchingFile = void 0;
10
+ exports.matchesContent = exports.exists = exports.matchFiles = exports.patchMatchingFile = void 0;
11
11
  var fs = require("fs");
12
- var glob = require('glob');
12
+ var glob = require("glob");
13
13
  var IGNORE_PATTERN = ['node_modules/**', 'ios/Pods/**', '**/Pods/**'];
14
14
  function patchMatchingFile(globPattern, func) {
15
15
  var args = [];
@@ -37,6 +37,12 @@ function patchMatchingFile(globPattern, func) {
37
37
  return rv;
38
38
  }
39
39
  exports.patchMatchingFile = patchMatchingFile;
40
+ function matchFiles(globPattern) {
41
+ return glob.sync(globPattern, {
42
+ ignore: IGNORE_PATTERN,
43
+ });
44
+ }
45
+ exports.matchFiles = matchFiles;
40
46
  function exists(globPattern) {
41
47
  var matches = glob.sync(globPattern, {
42
48
  ignore: IGNORE_PATTERN,
@@ -57,7 +63,7 @@ function matchesContent(globPattern, contentPattern) {
57
63
  return false;
58
64
  }
59
65
  return matches.reduce(function (prev, match) {
60
- return (prev &&
66
+ return !!(prev &&
61
67
  fs
62
68
  .readFileSync(match)
63
69
  .toString()
@@ -1 +1 @@
1
- {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../lib/Helper/File.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uBAAyB;AACzB,IAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,IAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAExE,SAAgB,iBAAiB,CAC/B,WAAmB,EACnB,IAAS;IACT,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACrC,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;IACH,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,OAAO,CAAC,OAAO,CAAC,UAAC,KAAa;QAC5B,IAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE;YACtC,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAC;QACH,EAAE,GA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AAC;AAnBD,wCAmBC","sourcesContent":["import * as fs from 'fs';\nconst glob = require('glob');\n\nconst IGNORE_PATTERN = ['node_modules/**', 'ios/Pods/**', '**/Pods/**'];\n\nexport function patchMatchingFile(\n globPattern: string,\n func: any,\n ...args: any[]\n): Promise<void> {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n let rv = Promise.resolve();\n matches.forEach((match: string) => {\n const contents = fs.readFileSync(match, {\n encoding: 'utf-8',\n });\n rv = rv\n .then(() => func(contents, match, ...args))\n .then(newContents => {\n if (\n newContents !== null &&\n newContents !== undefined &&\n contents !== newContents\n ) {\n fs.writeFileSync(match, newContents);\n }\n });\n });\n return rv;\n}\n\nexport function exists(globPattern: string): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return prev && fs.existsSync(match);\n }, true);\n}\n\nexport function matchesContent(\n globPattern: string,\n contentPattern: RegExp,\n): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return (\n prev &&\n fs\n .readFileSync(match)\n .toString()\n .match(contentPattern)\n );\n }, true);\n}\n"]}
1
+ {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../lib/Helper/File.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uBAAyB;AACzB,2BAA6B;AAE7B,IAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAExE,SAAgB,iBAAiB,CAC/B,WAAmB,EACnB,IAAS;IACT,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACrC,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;IACH,IAAI,EAAE,GAAG,O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AAM,EAAE,cAAc;KACvB,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC;KACd;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAC,IAAa,EAAE,KAAa;QACjD,OAAO,CAAC,CAAC,CACP,IAAI;YACJ,EAAE;iBACC,YAAY,CAAC,KAAK,CAAC;iBACnB,QAAQ,EAAE;iBACV,KAAK,CAAC,cAAc,CAAC,CACzB,CAAC;IACJ,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC;AAnBD,wCAmBC","sourcesContent":["import * as fs from 'fs';\nimport * as glob from 'glob';\n\nconst IGNORE_PATTERN = ['node_modules/**', 'ios/Pods/**', '**/Pods/**'];\n\nexport function patchMatchingFile(\n globPattern: string,\n func: any,\n ...args: any[]\n): Promise<void> {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n let rv = Promise.resolve();\n matches.forEach((match: string) => {\n const contents = fs.readFileSync(match, {\n encoding: 'utf-8',\n });\n rv = rv\n .then(() => func(contents, match, ...args))\n .then(newContents => {\n if (\n newContents !== null &&\n newContents !== undefined &&\n contents !== newContents\n ) {\n fs.writeFileSync(match, newContents);\n }\n });\n });\n return rv;\n}\n\nexport function matchFiles(globPattern: string): string[] {\n return glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n}\n\nexport function exists(globPattern: string): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return prev && fs.existsSync(match);\n }, true);\n}\n\nexport function matchesContent(\n globPattern: string,\n contentPattern: RegExp,\n): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return !!(\n prev &&\n fs\n .readFileSync(match)\n .toString()\n .match(contentPattern)\n );\n }, true);\n}\n"]}
@@ -3,4 +3,5 @@ export declare function nl(): void;
3
3
  export declare function green(msg: string): void;
4
4
  export declare function red(msg: string): void;
5
5
  export declare function dim(msg: string): void;
6
+ export declare function yellow(msg: string): void;
6
7
  export declare function debug(msg: any): void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.debug = exports.dim = exports.red = exports.green = exports.nl = exports.l = void 0;
3
+ exports.debug = exports.yellow = exports.dim = exports.red = exports.green = exports.nl = exports.l = void 0;
4
4
  var chalk_1 = require("chalk");
5
5
  function prepareMessage(msg) {
6
6
  if (typeof msg === 'string') {
@@ -32,6 +32,10 @@ function dim(msg) {
32
32
  return l(chalk_1.default.dim(prepareMessage(msg)));
33
33
  }
34
34
  exports.dim = dim;
35
+ function yellow(msg) {
36
+ return l(chalk_1.default.yellow(prepareMessage(msg)));
37
+ }
38
+ exports.yellow = yellow;
35
39
  function debug(msg) {
36
40
  return l(chalk_1.default.italic.yellow(prepareMessage(msg)));
37
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../lib/Helper/Logging.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAE1B,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,CAAC;KACZ;IACD,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,OAAO,MAAG,GAAG,CAAC,KAAK,IAAI,EAAE,CAAE,CAAC;KAC7B;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,CAAC,CAAC,GAAW;IAC3B,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAHD,cAGC;AAED,SAAgB,EAAE;IAChB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AACf,CAAC;AAFD,gBAEC;AAED,SAAgB,KAAK,CAAC,GAAW;IAC/B,OAAO,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC;AAED,SAAgB,GAAG,CAAC,GAAW;IAC7B,OAAO,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,GAAG,CAAC,GAAW;IAC7B,OAAO,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,KAAK,CAAC,GAAQ;IAC5B,OAAO,CAAC,CAAC,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,sBAEC","sourcesContent":["import Chalk from 'chalk';\n\nfunction prepareMessage(msg: unknown): string {\n if (typeof msg === 'string') {\n return msg;\n }\n if (msg instanceof Error) {\n return `${msg.stack || ''}`;\n }\n return JSON.stringify(msg, null, '\\t');\n}\n\nexport function l(msg: string): void {\n // eslint-disable-next-line no-console\n console.log(msg);\n}\n\nexport function nl(): void {\n return l('');\n}\n\nexport function green(msg: string): void {\n return l(Chalk.green(prepareMessage(msg)));\n}\n\nexport function red(msg: string): void {\n return l(Chalk.red(prepareMessage(msg)));\n}\n\nexport function dim(msg: string): void {\n return l(Chalk.dim(prepareMessage(msg)));\n}\n\nexport function debug(msg: any): void {\n return l(Chalk.italic.yellow(prepareMessage(msg)));\n}\n"]}
1
+ {"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../lib/Helper/Logging.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAE1B,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,OAAO,GAAG,KAAK,QAAQ,EA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n if (typeof msg === 'string') {\n return msg;\n }\n if (msg instanceof Error) {\n return `${msg.stack || ''}`;\n }\n return JSON.stringify(msg, null, '\\t');\n}\n\nexport function l(msg: string): void {\n // eslint-disable-next-line no-console\n console.log(msg);\n}\n\nexport function nl(): void {\n return l('');\n}\n\nexport function green(msg: string): void {\n return l(Chalk.green(prepareMessage(msg)));\n}\n\nexport function red(msg: string): void {\n return l(Chalk.red(prepareMessage(msg)));\n}\n\nexport function dim(msg: string): void {\n return l(Chalk.dim(prepareMessage(msg)));\n}\n\nexport function yellow(msg: string): void {\n return l(Chalk.yellow(prepareMessage(msg)));\n}\n\nexport function debug(msg: any): void {\n return l(Chalk.italic.yellow(prepareMessage(msg)));\n}\n"]}
@@ -5,7 +5,7 @@ var SentryCli_1 = require("../SentryCli");
5
5
  var args = {
6
6
  debug: false,
7
7
  integration: Constants_1.Integration.reactNative,
8
- platform: Constants_1.Platform.ios,
8
+ platform: [Constants_1.Platform.ios],
9
9
  quiet: false,
10
10
  skipConnect: false,
11
11
  uninstall: false,
@@ -1 +1 @@
1
- {"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/SentryCli.ts"],"names":[],"mappings":";;AAGA,6CAA8D;AAC9D,0CAAyC;AAEzC,IAAM,IAAI,GAAS;IACjB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,uBAAW,CAAC,WAAW;IACpC,QAAQ,EAAE,oBAAQ,CAAC,GAAG;IACtB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,GAAG,EAAE,wBAAwB;CAC9B,CAAC;AAEF,IAAM,WAAW,GAAY;IAC3B,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;SACd;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,UAAU;SACjB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;SAClB;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,W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from '../../Constants';\nimport { SentryCli } from '../SentryCli';\n\nconst args: Args = {\n debug: false,\n integration: Integration.reactNative,\n platform: Platform.ios,\n quiet: false,\n skipConnect: false,\n uninstall: false,\n url: 'https://localhost:1234',\n};\n\nconst demoAnswers: Answers = {\n config: {\n auth: {\n token: 'abcd',\n },\n organization: {\n slug: 'test_org',\n },\n project: {\n slug: 'test_proj',\n },\n },\n};\n\ndescribe('SentryCli', () => {\n test('convertAnswersToProperties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules/sentry/cli');\n });\n\n test('dump properties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules/sentry/cli\n`);\n });\n\n test('convertAnswersToProperties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules\\\\\\\\sentry\\\\\\\\cli');\n });\n\n test('dump properties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules\\\\\\\\sentry\\\\\\\\cli\n`);\n });\n});\n"]}
1
+ {"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/SentryCli.ts"],"names":[],"mappings":";;AAGA,6CAA8D;AAC9D,0CAAyC;AAEzC,IAAM,IAAI,GAAS;IACjB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,uBAAW,CAAC,WAAW;IACpC,QAAQ,EAAE,CAAC,oBAAQ,CAAC,GAAG,CAAC;IACxB,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,KAAK;IAClB,SAAS,EAAE,KAAK;IAChB,GAAG,EAAE,wBAAwB;CAC9B,CAAC;AAEF,IAAM,WAAW,GAAY;IAC3B,MAAM,EAAE;QACN,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;SACd;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,UAAU;SACjB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,WAAW;SAClB;KACF;CACF,CAAC;AAEF,QAAQ,CAAC,WAAW,EAAE;IACpB,IAAI,CAAC,4BAA4B,EAAE;QACjC,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;QACzE,IAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QAC7D,MAAM,CAAC,KAAK,CAAC,cAAc,CA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,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,+BAA+B,CAAC,CAAC;IACxE,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE;QAC9B,IAAM,WAAW,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,eAAe,CAAC,2BAA2B,CAAC,CAAC;QAC3E,IAAM,MAAM,GAAG,IAAI,qBAAS,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;QACvC,IAAM,KAAK,GAAG,MAAM,CAAC,0BAA0B,CAAC,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;aACjC,IAAI,CAAC,yJAKX,CAAC,CAAC;IACD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport { Answers } from 'inquirer';\n\nimport { Args, Integration, Platform } from '../../Constants';\nimport { SentryCli } from '../SentryCli';\n\nconst args: Args = {\n debug: false,\n integration: Integration.reactNative,\n platform: [Platform.ios],\n quiet: false,\n skipConnect: false,\n uninstall: false,\n url: 'https://localhost:1234',\n};\n\nconst demoAnswers: Answers = {\n config: {\n auth: {\n token: 'abcd',\n },\n organization: {\n slug: 'test_org',\n },\n project: {\n slug: 'test_proj',\n },\n },\n};\n\ndescribe('SentryCli', () => {\n test('convertAnswersToProperties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules/sentry/cli');\n });\n\n test('dump properties', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules/sentry/cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules/sentry/cli\n`);\n });\n\n test('convertAnswersToProperties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(props['defaults/url']).toBe('https://localhost:1234');\n expect(props['defaults/org']).toBe('test_org');\n expect(props['defaults/project']).toBe('test_proj');\n expect(props['auth/token']).toBe('abcd');\n expect(props['cli/executable']).toBe('node_modules\\\\\\\\sentry\\\\\\\\cli');\n });\n\n test('dump properties windows', () => {\n const resolveFunc = jest.fn().mockReturnValue('node_modules\\\\sentry\\\\cli');\n const sentry = new SentryCli(args);\n sentry.setResolveFunction(resolveFunc);\n const props = sentry.convertAnswersToProperties(demoAnswers);\n expect(sentry.dumpProperties(props))\n .toBe(`defaults.url=https://localhost:1234\ndefaults.org=test_org\ndefaults.project=test_proj\nauth.token=abcd\ncli.executable=node_modules\\\\\\\\sentry\\\\\\\\cli\n`);\n });\n});\n"]}
@@ -57,10 +57,9 @@ var path = require("path");
57
57
  var Logging_1 = require("../../Helper/Logging");
58
58
  var SentryCli_1 = require("../../Helper/SentryCli");
59
59
  var BaseIntegration_1 = require("./BaseIntegration");
60
- var MIN_ELECTRON_VERSION_STRING = '1.7.0';
60
+ var MIN_ELECTRON_VERSION_STRING = '2.0.0';
61
61
  var MIN_ELECTRON_VERSION = parseInt(MIN_ELECTRON_VERSION_STRING.replace(/\D+/g, ''), 10);
62
62
  var CODE_EXAMPLE = "const Sentry = require('@sentry/electron');\n\nSentry.init({\n dsn: '___DSN___',\n});";
63
- var UPLOAD_EXAMPLE = "npm install --save-dev @sentry/cli electron-download\nnode sentry-symbols.js";
64
63
  var appPackage = {};
65
64
  function printExample(example, title) {
66
65
  if (title === void 0) { title = ''; }
@@ -87,7 +86,7 @@ var Electron = /** @class */ (function (_super) {
87
86
  }
88
87
  Electron.prototype.emit = function (answers) {
89
88
  return __awaiter(this, void 0, void 0, function () {
90
- var dsn, sentryCliProps, symbolsScript;
89
+ var dsn, sentryCliProps;
91
90
  return __generator(this, function (_a) {
92
91
  dsn = _.get(answers, ['config', 'dsn', 'public'], null);
93
92
  Logging_1.nl();
@@ -95,15 +94,7 @@ var Electron = /** @class */ (function (_super) {
95
94
  fs.writeFileSync('./sentry.properties', this._sentryCli.dumpProperties(sentryCliProps));
96
95
  Logging_1.green("Successfully created sentry.properties");
97
96
  Logging_1.nl();
98
- symbolsScript = path.join(__dirname, '..', '..', '..', 'Electron', 'symbols.js');
99
- if (fs.existsSync(symbolsScript)) {
100
- fs.writeFileSync('sentry-symbols.js', fs.readFileSync(symbolsScript));
101
- }
102
- else {
103
- Logging_1.debug("Couldn't find " + symbolsScript + ", probably because you run from src");
104
- }
105
97
  printExample(CODE_EXAMPLE.replace('___DSN___', dsn), 'Put these lines in to your main and renderer processes to setup Sentry:');
106
- printExample(UPLOAD_EXAMPLE, 'To upload debug information for native crashes when updating Electron, run:');
107
98
  Logging_1.l('For more information, see https://docs.sentry.io/clients/electron/');
108
99
  Logging_1.nl();
109
100
  return [2 /*return*/, {}];
@@ -1 +1 @@
1
- {"version":3,"file":"Electron.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/Electron.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB;AACzB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,CAAC;YACzC,OAAO,KAAK,CAAC;SACd;aAAM,IACL,UAAU;YACV,UAAU,GAAG,oBAAoB;YACjC,aAAa,GAAG,oBAAoB,EACpC;YACA,aAAG,CACD,sCAA+B,WAAW,qBAAgB,2BAA2B,YAAS,CAC/F,CAAC;YACF,OAAO,KAAK,CAAC;SACd;aAAM;YACL,oEAAoE;YACpE,UAAU;gBACR,CAAC,CAAC,eAAK,CAAC,YAAK,WAAW,WAAM,UAAU,kBAAe,CAAC;gBACxD,CAAC,CAAC,eAAK,CAAC,YAAK,WAAW,kBAAe,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AA5HD,CAA8B,iCAAe,GA4H5C;AA5HY,4BAAQ","sourcesContent":["import * as fs from 'fs';\nimport { Answers, prompt } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport { Args } from '../../Constants';\nimport { debug, dim, green, l, nl, red } from '../../Helper/Logging';\nimport { SentryCli } from '../../Helper/SentryCli';\nimport { BaseIntegration } from './BaseIntegration';\n\nconst MIN_ELECTRON_VERSION_STRING = '1.7.0';\nconst MIN_ELECTRON_VERSION = parseInt(\n MIN_ELECTRON_VERSION_STRING.replace(/\\D+/g, ''),\n 10,\n);\n\nconst CODE_EXAMPLE = `const Sentry = require('@sentry/electron');\n\nSentry.init({\n dsn: '___DSN___',\n});`;\n\nconst UPLOAD_EXAMPLE = `npm install --save-dev @sentry/cli electron-download\nnode sentry-symbols.js`;\n\nlet appPackage: any = {};\n\nfunction printExample(example: string, title: string = ''): void {\n if (title) {\n l(title);\n }\n\n nl();\n dim(example.replace(/^/gm, ' '));\n nl();\n}\n\ntry {\n appPackage = require(path.join(process.cwd(), 'package.json'));\n} catch {\n // We don't need to have this\n}\n\nexport class Electron extends BaseIntegration {\n protected _sentryCli: SentryCli;\n\n constructor(protected _argv: Args) {\n super(_argv);\n this._sentryCli = new SentryCli(this._argv);\n }\n\n public async emit(answers: Answers): Promise<Answers> {\n const dsn = _.get(answers, ['config', 'dsn', 'public'], null);\n nl();\n\n const sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);\n fs.writeFileSync(\n './sentry.properties',\n this._sentryCli.dumpProperties(sentryCliProps),\n );\n green(`Successfully created sentry.properties`);\n nl();\n\n const symbolsScript = path.join(\n __dirname,\n '..',\n '..',\n '..',\n 'Electron',\n 'symbols.js',\n );\n\n if (fs.existsSync(symbolsScript)) {\n fs.writeFileSync('sentry-symbols.js', fs.readFileSync(symbolsScript));\n } else {\n debug(\n `Couldn't find ${symbolsScript}, probably because you run from src`,\n );\n }\n\n printExample(\n CODE_EXAMPLE.replace('___DSN___', dsn),\n 'Put these lines in to your main and renderer processes to setup Sentry:',\n );\n\n printExample(\n UPLOAD_EXAMPLE,\n 'To upload debug information for native crashes when updating Electron, run:',\n );\n\n l('For more information, see https://docs.sentry.io/clients/electron/');\n nl();\n\n return {};\n }\n\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n\n let success = true;\n nl();\n\n success =\n this._checkDep('electron', MIN_ELECTRON_VERSION_STRING) && success;\n success = this._checkDep('@sentry/electron') && success;\n\n let continued: Answers = { continue: true };\n if (!success && !this._argv.quiet) {\n continued = await prompt({\n message:\n 'There were errors during your project checkup, do you still want to continue?',\n name: 'continue',\n default: false,\n type: 'confirm',\n });\n }\n\n nl();\n\n if (!_.get(continued, 'continue', false)) {\n throw new Error('Please install the required dependencies to continue.');\n }\n\n this._shouldConfigure = Promise.resolve({ electron: true });\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return this.shouldConfigure;\n }\n\n private _checkDep(packageName: string, minVersion?: string): boolean {\n const depVersion = parseInt(\n _.get(appPackage, ['dependencies', packageName], '0').replace(/\\D+/g, ''),\n 10,\n );\n const devDepVersion = parseInt(\n _.get(appPackage, ['devDependencies', packageName], '0').replace(\n /\\D+/g,\n '',\n ),\n 10,\n );\n\n if (\n !_.get(appPackage, `dependencies.${packageName}`, false) &&\n !_.get(appPackage, `devDependencies.${packageName}`, false)\n ) {\n red(`✗ ${packageName} isn't in your dependencies`);\n red(` please install it with yarn/npm`);\n return false;\n } else if (\n minVersion &&\n depVersion < MIN_ELECTRON_VERSION &&\n devDepVersion < MIN_ELECTRON_VERSION\n ) {\n red(\n `✗ Your installed version of ${packageName} is to old, >${MIN_ELECTRON_VERSION_STRING} needed`,\n );\n return false;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n minVersion\n ? green(`✓ ${packageName} > ${minVersion} is installed`)\n : green(`✓ ${packageName} is installed`);\n return true;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"Electron.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/Electron.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB;AACzB,qCAA2C;AAC3C,0BAA4B;AAC5B,2BAA6B;AAG7B,gDAAqE;AACrE,oDAAmD;AACnD,qDAAoD;AAEpD,IAAM,2BAA2B,GAAG,OAAO,CAAC;AAC5C,IAAM,oBAAoB,GAAG,QAAQ,CACnC,2BAA2B,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAC/C,EAAE,CACH,CAAC;AAEF,IAAM,YAAY,GAAG,wFAIjB,CAAC;AAGL,IAAI,UAAU,GAAQ,EAAE,CAAC;AAEzB,SAAS,YAAY,CAAC,OAAe,EAAE,KAAkB;IAAlB,sBAAA,EAAA,UAAkB;IACvD,IAAI,KAAK,EAAE;QACT,WAAC,CAAC,KAAK,CAAC,CAAC;KACV;IAED,YAAE,EAAE,CAAC;IACL,aAAG,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IACpC,YAAE,EAAE,CAAC;AACP,CAAC;AAED,IAAI;IACF,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CA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C,GAAG,CAAC,UAAU,EAAE,qBAAmB,WAAa,EAAE,KAAK,CAAC,EAC3D;YACA,aAAG,CAAC,YAAK,WAAW,gCAA6B,CAAC,CAAC;YACnD,aAAG,CAAC,mCAAmC,CAAC,CAAC;YACzC,OAAO,KAAK,CAAC;SACd;aAAM,IACL,UAAU;YACV,UAAU,GAAG,oBAAoB;YACjC,aAAa,GAAG,oBAAoB,EACpC;YACA,aAAG,CACD,sCAA+B,WAAW,qBAAgB,2BAA2B,YAAS,CAC/F,CAAC;YACF,OAAO,KAAK,CAAC;SACd;aAAM;YACL,oEAAoE;YACpE,UAAU;gBACR,CAAC,CAAC,eAAK,CAAC,YAAK,WAAW,WAAM,UAAU,kBAAe,CAAC;gBACxD,CAAC,CAAC,eAAK,CAAC,YAAK,WAAW,kBAAe,CAAC,CAAC;YAC3C,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IACH,eAAC;AAAD,CAAC,AAtGD,CAA8B,iCAAe,GAsG5C;AAtGY,4BAAQ","sourcesContent":["import * as fs from 'fs';\nimport { Answers, prompt } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport { Args } from '../../Constants';\nimport { debug, dim, green, l, nl, red } from '../../Helper/Logging';\nimport { SentryCli } from '../../Helper/SentryCli';\nimport { BaseIntegration } from './BaseIntegration';\n\nconst MIN_ELECTRON_VERSION_STRING = '2.0.0';\nconst MIN_ELECTRON_VERSION = parseInt(\n MIN_ELECTRON_VERSION_STRING.replace(/\\D+/g, ''),\n 10,\n);\n\nconst CODE_EXAMPLE = `const Sentry = require('@sentry/electron');\n\nSentry.init({\n dsn: '___DSN___',\n});`;\n\n\nlet appPackage: any = {};\n\nfunction printExample(example: string, title: string = ''): void {\n if (title) {\n l(title);\n }\n\n nl();\n dim(example.replace(/^/gm, ' '));\n nl();\n}\n\ntry {\n appPackage = require(path.join(process.cwd(), 'package.json'));\n} catch {\n // We don't need to have this\n}\n\nexport class Electron extends BaseIntegration {\n protected _sentryCli: SentryCli;\n\n constructor(protected _argv: Args) {\n super(_argv);\n this._sentryCli = new SentryCli(this._argv);\n }\n\n public async emit(answers: Answers): Promise<Answers> {\n const dsn = _.get(answers, ['config', 'dsn', 'public'], null);\n nl();\n\n const sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);\n fs.writeFileSync(\n './sentry.properties',\n this._sentryCli.dumpProperties(sentryCliProps),\n );\n green(`Successfully created sentry.properties`);\n nl();\n\n printExample(\n CODE_EXAMPLE.replace('___DSN___', dsn),\n 'Put these lines in to your main and renderer processes to setup Sentry:',\n );\n\n l('For more information, see https://docs.sentry.io/clients/electron/');\n nl();\n\n return {};\n }\n\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n\n let success = true;\n nl();\n\n success =\n this._checkDep('electron', MIN_ELECTRON_VERSION_STRING) && success;\n success = this._checkDep('@sentry/electron') && success;\n\n let continued: Answers = { continue: true };\n if (!success && !this._argv.quiet) {\n continued = await prompt({\n message:\n 'There were errors during your project checkup, do you still want to continue?',\n name: 'continue',\n default: false,\n type: 'confirm',\n });\n }\n\n nl();\n\n if (!_.get(continued, 'continue', false)) {\n throw new Error('Please install the required dependencies to continue.');\n }\n\n this._shouldConfigure = Promise.resolve({ electron: true });\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return this.shouldConfigure;\n }\n\n private _checkDep(packageName: string, minVersion?: string): boolean {\n const depVersion = parseInt(\n _.get(appPackage, ['dependencies', packageName], '0').replace(/\\D+/g, ''),\n 10,\n );\n const devDepVersion = parseInt(\n _.get(appPackage, ['devDependencies', packageName], '0').replace(\n /\\D+/g,\n '',\n ),\n 10,\n );\n\n if (\n !_.get(appPackage, `dependencies.${packageName}`, false) &&\n !_.get(appPackage, `devDependencies.${packageName}`, false)\n ) {\n red(`✗ ${packageName} isn't in your dependencies`);\n red(` please install it with yarn/npm`);\n return false;\n } else if (\n minVersion &&\n depVersion < MIN_ELECTRON_VERSION &&\n devDepVersion < MIN_ELECTRON_VERSION\n ) {\n red(\n `✗ Your installed version of ${packageName} is to old, >${MIN_ELECTRON_VERSION_STRING} needed`,\n );\n return false;\n } else {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n minVersion\n ? green(`✓ ${packageName} > ${minVersion} is installed`)\n : green(`✓ ${packageName} is installed`);\n return true;\n }\n }\n}\n"]}
@@ -69,6 +69,7 @@ var __spreadArrays = (this && this.__spreadArrays) || function () {
69
69
  Object.defineProperty(exports, "__esModule", { value: true });
70
70
  exports.NextJs = void 0;
71
71
  /* eslint-disable max-lines */
72
+ var chalk_1 = require("chalk");
72
73
  var fs = require("fs");
73
74
  var inquirer_1 = require("inquirer");
74
75
  var _ = require("lodash");
@@ -108,18 +109,20 @@ var NextJs = /** @class */ (function (_super) {
108
109
  return _this;
109
110
  }
110
111
  NextJs.prototype.emit = function (answers) {
112
+ var _a, _b, _c, _d, _e, _f;
111
113
  return __awaiter(this, void 0, void 0, function () {
112
- var dsn, sentryCliProps, configDirectory;
113
- return __generator(this, function (_a) {
114
- switch (_a.label) {
114
+ var dsn, sentryCliProps, templateDirectory, configDirectory, selectedProjectSlug, hasFirstEvent;
115
+ return __generator(this, function (_g) {
116
+ switch (_g.label) {
115
117
  case 0:
116
118
  dsn = _.get(answers, ['config', 'dsn', 'public'], null);
117
119
  Logging_1.nl();
118
120
  sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);
119
121
  return [4 /*yield*/, this._createSentryCliConfig(sentryCliProps)];
120
122
  case 1:
121
- _a.sent();
122
- configDirectory = path.join(__dirname, '..', '..', '..', 'NextJs', CONFIG_DIR);
123
+ _g.sent();
124
+ templateDirectory = path.join(__dirname, '..', '..', '..', 'NextJs');
125
+ configDirectory = path.join(templateDirectory, CONFIG_DIR);
123
126
  if (fs.existsSync(configDirectory)) {
124
127
  this._createNextConfig(configDirectory, dsn);
125
128
  }
@@ -127,6 +130,14 @@ var NextJs = /** @class */ (function (_super) {
127
130
  Logging_1.debug("Couldn't find " + configDirectory + ", probably because you ran this from inside of `/lib` rather than `/dist`");
128
131
  Logging_1.nl();
129
132
  }
133
+ selectedProjectSlug = (_b = (_a = answers.config) === null || _a === void 0 ? void 0 : _a.project) === null || _b === void 0 ? void 0 : _b.slug;
134
+ if (selectedProjectSlug) {
135
+ hasFirstEvent = (_f = (_e = (_d = (_c = answers.wizard) === null || _c === void 0 ? void 0 : _c.projects) === null || _d === void 0 ? void 0 : _d.find) === null || _e === void 0 ? void 0 : _e.call(_d, function (p) { return p.slug === selectedProjectSlug; })) === null || _f === void 0 ? void 0 : _f.firstEvent;
136
+ if (!hasFirstEvent) {
137
+ this._setTemplate(templateDirectory, 'sentry_sample_error.js', ['pages', 'src/pages'], dsn);
138
+ Logging_1.l(chalk_1.default.bgYellowBright("\n|------------------------------------------------------------------------|\n| Installation Complete |\n| To verify your installation and finish onboarding, launch your Next.js |\n| application, navigate to https://localhost:3000/sentry_sample_error |\n| and send us a sample error. |\n|------------------------------------------------------------------------|\n"));
139
+ }
140
+ }
130
141
  Logging_1.l('For more information, see https://docs.sentry.io/platforms/javascript/guides/nextjs/');
131
142
  Logging_1.nl();
132
143
  return [2 /*return*/, {}];
@@ -1 +1 @@
1
- {"version":3,"file":"NextJs.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/NextJs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,uBAAyB;AACzB,qCAA2C;AAC3C,0BAA4B;AAC5B,2BAA6B;AAC7B,iCAA8D;AAG9D,gDAAgE;AAChE,oDAAmE;AACnE,qDAAoD;AAEpD,IAAM,0BAA0B,GAAG,kBAAkB,CAAC;AACtD,IAAM,uBAAuB,GAAG,SAAS,CAAC;AAC1C,IAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,IAAM,oBAAoB,GAAG,cAAc,CAAC;AAC5C,IAAM,kBAAkB,GAA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;YAAjB,gCAAiB;;QAEjB,GAAG,CAAC,MAAM,OAAV,GAAG,kBAAQ,KAAK,EAAE,WAAW,GAAK,OAAO,GAAE;QAC3C,OAAO,GAAG,CAAC;IACb,CAAC;IACH,aAAC;AAAD,CAAC,AA7TD,CAA4B,iCAAe,GA6T1C;AA7TY,wBAAM","sourcesContent":["/* eslint-disable max-lines */\nimport * as fs from 'fs';\nimport { Answers, prompt } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\nimport { satisfies, subset, valid, validRange } from 'semver';\n\nimport { Args } from '../../Constants';\nimport { debug, green, l, nl, red } from '../../Helper/Logging';\nimport { SentryCli, SentryCliProps } from '../../Helper/SentryCli';\nimport { BaseIntegration } from './BaseIntegration';\n\nconst COMPATIBLE_NEXTJS_VERSIONS = '>=10.0.8 <13.0.0';\nconst COMPATIBLE_SDK_VERSIONS = '>=7.3.0';\nconst PROPERTIES_FILENAME = 'sentry.properties';\nconst SENTRYCLIRC_FILENAME = '.sentryclirc';\nconst GITIGNORE_FILENAME = '.gitignore';\nconst CONFIG_DIR = 'configs/';\nconst MERGEABLE_CONFIG_INFIX = 'wizardcopy';\n\n// for those files which can go in more than one place, the list of places they\n// could go (the first one which works will be used)\nconst TEMPLATE_DESTINATIONS: { [key: string]: string[] } = {\n '_error.js': ['pages', 'src/pages'],\n 'next.config.js': ['.'],\n 'sentry.server.config.js': ['.'],\n 'sentry.client.config.js': ['.'],\n};\n\nlet appPackage: any = {};\n\ntry {\n appPackage = require(path.join(process.cwd(), 'package.json'));\n} catch {\n // We don't need to have this\n}\n\nexport class NextJs extends BaseIntegration {\n protected _sentryCli: SentryCli;\n\n constructor(protected _argv: Args) {\n super(_argv);\n this._sentryCli = new SentryCli(this._argv);\n }\n\n public async emit(answers: Answers): Promise<Answers> {\n const dsn = _.get(answers, ['config', 'dsn', 'public'], null);\n nl();\n\n const sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);\n await this._createSentryCliConfig(sentryCliProps);\n\n const configDirectory = path.join(\n __dirname,\n '..',\n '..',\n '..',\n 'NextJs',\n CONFIG_DIR,\n );\n\n if (fs.existsSync(configDirectory)) {\n this._createNextConfig(configDirectory, dsn);\n } else {\n debug(\n `Couldn't find ${configDirectory}, probably because you ran this from inside of \\`/lib\\` rather than \\`/dist\\``,\n );\n nl();\n }\n\n l(\n 'For more information, see https://docs.sentry.io/platforms/javascript/guides/nextjs/',\n );\n nl();\n\n return {};\n }\n\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n\n nl();\n\n let userAnswers: Answers = { continue: true };\n if (\n (!this._checkPackageVersion('next', COMPATIBLE_NEXTJS_VERSIONS, true) ||\n !this._checkPackageVersion(\n '@sentry/nextjs',\n COMPATIBLE_SDK_VERSIONS,\n true,\n )) &&\n !this._argv.quiet\n ) {\n userAnswers = await prompt({\n message:\n 'There were errors during your project checkup, do you still want to continue?',\n name: 'continue',\n default: false,\n type: 'confirm',\n });\n }\n\n nl();\n\n if (!userAnswers['continue']) {\n throw new Error('Please install the required dependencies to continue.');\n }\n\n this._shouldConfigure = Promise.resolve({ nextjs: true });\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return this.shouldConfigure;\n }\n\n private async _createSentryCliConfig(\n cliProps: SentryCliProps,\n ): Promise<void> {\n const { 'auth/token': authToken, ...cliPropsToWrite } = cliProps;\n\n /**\n * To not commit the auth token to the VCS, instead of adding it to the\n * properties file (like the rest of props), it's added to the Sentry CLI\n * config, which is added to the gitignore. This way makes the properties\n * file safe to commit without exposing any auth tokens.\n */\n if (authToken) {\n try {\n await fs.promises.appendFile(\n SENTRYCLIRC_FILENAME,\n this._sentryCli.dumpConfig({ auth: { token: authToken } }),\n );\n green(`✓ Successfully added the auth token to ${SENTRYCLIRC_FILENAME}`);\n } catch {\n red(\n `⚠ Could not add the auth token to ${SENTRYCLIRC_FILENAME}, ` +\n `please add it to identify your user account:\\n${authToken}`,\n );\n nl();\n }\n } else {\n red(\n `⚠ Did not find an auth token, please add your token to ${SENTRYCLIRC_FILENAME}`,\n );\n l(\n 'To generate an auth token, visit https://sentry.io/settings/account/api/auth-tokens/',\n );\n l(\n 'To learn how to configure Sentry CLI, visit ' +\n 'https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli',\n );\n }\n\n await this._addToGitignore(\n SENTRYCLIRC_FILENAME,\n `⚠ Could not add ${SENTRYCLIRC_FILENAME} to ${GITIGNORE_FILENAME}, ` +\n 'please add it to not commit your auth key.',\n );\n\n try {\n await fs.promises.writeFile(\n `./${PROPERTIES_FILENAME}`,\n this._sentryCli.dumpProperties(cliPropsToWrite),\n );\n green(`✓ Successfully created sentry.properties`);\n } catch {\n red(`⚠ Could not add org and project data to ${PROPERTIES_FILENAME}`);\n l(\n 'See docs for a manual setup: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli',\n );\n }\n nl();\n }\n\n private async _addToGitignore(\n filepath: string,\n errorMsg: string,\n ): Promise<void> {\n /**\n * Don't check whether the given file is ignored because:\n * 1. It's tricky to check it without git.\n * 2. Git might not be installed or accessible.\n * 3. It's convenient to use a module to interact with git, but it would\n * increase the size x2 approximately. Docs say to run the Wizard without\n * installing it, and duplicating the size would slow the set-up down.\n * 4. The Wizard is meant to be run once.\n * 5. A message is logged informing users it's been added to the gitignore.\n * 6. It will be added to the gitignore as many times as it runs - not a big\n * deal.\n * 7. It's straightforward to remove it from the gitignore.\n */\n try {\n await fs.promises.appendFile(\n GITIGNORE_FILENAME,\n `\\n# Sentry\\n${filepath}\\n`,\n );\n green(`✓ ${filepath} added to ${GITIGNORE_FILENAME}`);\n } catch {\n red(errorMsg);\n }\n }\n\n private _createNextConfig(configDirectory: string, dsn: any): void {\n const templates = fs.readdirSync(configDirectory);\n for (const template of templates) {\n this._setTemplate(\n configDirectory,\n template,\n TEMPLATE_DESTINATIONS[template],\n dsn,\n );\n }\n red(\n '⚠ Performance monitoring is enabled capturing 100% of transactions.\\n' +\n ' Learn more in https://docs.sentry.io/product/performance/',\n );\n nl();\n }\n\n private _setTemplate(\n configDirectory: string,\n templateFile: string,\n destinationOptions: string[],\n dsn: string,\n ): void {\n const templatePath = path.join(configDirectory, templateFile);\n\n for (const destinationDir of destinationOptions) {\n if (!fs.existsSync(destinationDir)) {\n continue;\n }\n\n const destinationPath = path.join(destinationDir, templateFile);\n // in case the file in question already exists, we'll make a copy with\n // `MERGEABLE_CONFIG_INFIX` inserted just before the extension, so as not\n // to overwrite the existing file\n const mergeableFilePath = path.join(\n destinationDir,\n this._spliceInPlace(\n templateFile.split('.'),\n -1,\n 0,\n MERGEABLE_CONFIG_INFIX,\n ).join('.'),\n );\n\n if (!fs.existsSync(destinationPath)) {\n this._fillAndCopyTemplate(templatePath, destinationPath, dsn);\n } else if (!fs.existsSync(mergeableFilePath)) {\n this._fillAndCopyTemplate(templatePath, mergeableFilePath, dsn);\n red(\n `File \\`${templateFile}\\` already exists, so created \\`${mergeableFilePath}\\`.\\n` +\n 'Please merge those files.',\n );\n nl();\n } else {\n red(\n `Both \\`${templateFile}\\` and \\`${mergeableFilePath}\\` already exist.\\n` +\n 'Please merge those files.',\n );\n nl();\n }\n return;\n }\n\n red(\n `Could not find appropriate destination for \\`${templateFile}\\`. Tried: ${destinationOptions}.`,\n );\n nl();\n }\n\n private _fillAndCopyTemplate(\n sourcePath: string,\n targetPath: string,\n dsn: string,\n ): void {\n const templateContent = fs.readFileSync(sourcePath).toString();\n const filledTemplate = templateContent.replace('___DSN___', dsn);\n fs.writeFileSync(targetPath, filledTemplate);\n }\n\n private _checkPackageVersion(\n packageName: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n ): boolean {\n const depsVersion = _.get(appPackage, ['dependencies', packageName]);\n const devDepsVersion = _.get(appPackage, ['devDependencies', packageName]);\n\n if (!depsVersion && !devDepsVersion) {\n red(`✗ ${packageName} isn't in your dependencies.`);\n red(' Please install it with yarn/npm.');\n return false;\n } else if (\n !this._fulfillsVersionRange(\n depsVersion,\n acceptableVersions,\n canBeLatest,\n ) &&\n !this._fulfillsVersionRange(\n devDepsVersion,\n acceptableVersions,\n canBeLatest,\n )\n ) {\n red(\n `✗ Your \\`package.json\\` specifies a version of \\`${packageName}\\` outside of the compatible version range ${acceptableVersions}.\\n`,\n );\n return false;\n } else {\n green(\n `✓ A compatible version of \\`${packageName}\\` is specified in \\`package.json\\`.`,\n );\n return true;\n }\n }\n\n private _fulfillsVersionRange(\n version: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n ): boolean {\n if (version === 'latest') {\n return canBeLatest;\n }\n\n let cleanedUserVersion, isRange;\n\n if (valid(version)) {\n cleanedUserVersion = valid(version);\n isRange = false;\n } else if (validRange(version)) {\n cleanedUserVersion = validRange(version);\n isRange = true;\n }\n\n return (\n // If the given version is a bogus format, this will still be undefined and we'll automatically reject it\n !!cleanedUserVersion &&\n (isRange\n ? subset(cleanedUserVersion, acceptableVersions)\n : satisfies(cleanedUserVersion, acceptableVersions))\n );\n }\n\n private _spliceInPlace(\n arr: Array<any>,\n start: number,\n deleteCount: number,\n ...inserts: any[]\n ): Array<any> {\n arr.splice(start, deleteCount, ...inserts);\n return arr;\n }\n}\n"]}
1
+ {"version":3,"file":"NextJs.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/NextJs.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8BAA8B;AAC9B,+BAA0B;AAC1B,uBAAyB;AACzB,qCAA2C;AAC3C,0BAA4B;AAC5B,2BAA6B;AAC7B,iCAA8D;AAG9D,gDAAgE;AAChE,oDAAmE;AACnE,qDAAoD;AAEpD,IAAM,0BAA0B,GAAG,kBAAkB,CAAC;AACtD,IAAM,uBAAuB,GAAG,SAAS,CAAC;AAC1C,IAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAChD,IAAM,oBAAoB,GAAG,cAAc,CAAC;A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AAK,CAAC,OAAO,CAAC,EAAE;YAClB,kBAAkB,GAAG,cAAK,CAAC,OAAO,CAAC,CAAC;YACpC,OAAO,GAAG,KAAK,CAAC;SACjB;aAAM,IAAI,mBAAU,CAAC,OAAO,CAAC,EAAE;YAC9B,kBAAkB,GAAG,mBAAU,CAAC,OAAO,CAAC,CAAC;YACzC,OAAO,GAAG,IAAI,CAAC;SAChB;QAED,OAAO;QACL,yGAAyG;QACzG,CAAC,CAAC,kBAAkB;YACpB,CAAC,OAAO;gBACN,CAAC,CAAC,eAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;gBAChD,CAAC,CAAC,kBAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CACvD,CAAC;IACJ,CAAC;IAEO,+BAAc,GAAtB,UACE,GAAe,EACf,KAAa,EACb,WAAmB;QACnB,iBAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,gCAAiB;;QAEjB,GAAG,CAAC,MAAM,OAAV,GAAG,kBAAQ,KAAK,EAAE,WAAW,GAAK,OAAO,GAAE;QAC3C,OAAO,GAAG,CAAC;IACb,CAAC;IACH,aAAC;AAAD,CAAC,AAxVD,CAA4B,iCAAe,GAwV1C;AAxVY,wBAAM","sourcesContent":["/* eslint-disable max-lines */\nimport Chalk from 'chalk';\nimport * as fs from 'fs';\nimport { Answers, prompt } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\nimport { satisfies, subset, valid, validRange } from 'semver';\n\nimport { Args } from '../../Constants';\nimport { debug, green, l, nl, red } from '../../Helper/Logging';\nimport { SentryCli, SentryCliProps } from '../../Helper/SentryCli';\nimport { BaseIntegration } from './BaseIntegration';\n\nconst COMPATIBLE_NEXTJS_VERSIONS = '>=10.0.8 <13.0.0';\nconst COMPATIBLE_SDK_VERSIONS = '>=7.3.0';\nconst PROPERTIES_FILENAME = 'sentry.properties';\nconst SENTRYCLIRC_FILENAME = '.sentryclirc';\nconst GITIGNORE_FILENAME = '.gitignore';\nconst CONFIG_DIR = 'configs/';\nconst MERGEABLE_CONFIG_INFIX = 'wizardcopy';\n\n// for those files which can go in more than one place, the list of places they\n// could go (the first one which works will be used)\nconst TEMPLATE_DESTINATIONS: { [key: string]: string[] } = {\n '_error.js': ['pages', 'src/pages'],\n 'next.config.js': ['.'],\n 'sentry.server.config.js': ['.'],\n 'sentry.client.config.js': ['.'],\n};\n\nlet appPackage: any = {};\n\ntry {\n appPackage = require(path.join(process.cwd(), 'package.json'));\n} catch {\n // We don't need to have this\n}\n\nexport class NextJs extends BaseIntegration {\n protected _sentryCli: SentryCli;\n\n constructor(protected _argv: Args) {\n super(_argv);\n this._sentryCli = new SentryCli(this._argv);\n }\n\n public async emit(answers: Answers): Promise<Answers> {\n const dsn = _.get(answers, ['config', 'dsn', 'public'], null);\n nl();\n\n const sentryCliProps = this._sentryCli.convertAnswersToProperties(answers);\n await this._createSentryCliConfig(sentryCliProps);\n\n const templateDirectory = path.join(\n __dirname,\n '..',\n '..',\n '..',\n 'NextJs',\n );\n const configDirectory = path.join(\n templateDirectory,\n CONFIG_DIR,\n );\n\n if (fs.existsSync(configDirectory)) {\n this._createNextConfig(configDirectory, dsn);\n } else {\n debug(\n `Couldn't find ${configDirectory}, probably because you ran this from inside of \\`/lib\\` rather than \\`/dist\\``,\n );\n nl();\n }\n\n const selectedProjectSlug: string | null = answers.config?.project?.slug;\n if (selectedProjectSlug) {\n const hasFirstEvent = answers.wizard?.projects?.find?.((p: { slug: string; }) => p.slug === selectedProjectSlug)?.firstEvent;\n if (!hasFirstEvent) {\n this._setTemplate(\n templateDirectory,\n 'sentry_sample_error.js',\n ['pages', 'src/pages'],\n dsn,\n );\n l(\n Chalk.bgYellowBright(`\n|------------------------------------------------------------------------|\n| Installation Complete |\n| To verify your installation and finish onboarding, launch your Next.js |\n| application, navigate to https://localhost:3000/sentry_sample_error |\n| and send us a sample error. |\n|------------------------------------------------------------------------|\n`\n )\n );\n }\n }\n\n l(\n 'For more information, see https://docs.sentry.io/platforms/javascript/guides/nextjs/',\n );\n nl();\n\n return {};\n }\n\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n\n nl();\n\n let userAnswers: Answers = { continue: true };\n if (\n (!this._checkPackageVersion('next', COMPATIBLE_NEXTJS_VERSIONS, true) ||\n !this._checkPackageVersion(\n '@sentry/nextjs',\n COMPATIBLE_SDK_VERSIONS,\n true,\n )) &&\n !this._argv.quiet\n ) {\n userAnswers = await prompt({\n message:\n 'There were errors during your project checkup, do you still want to continue?',\n name: 'continue',\n default: false,\n type: 'confirm',\n });\n }\n\n nl();\n\n if (!userAnswers['continue']) {\n throw new Error('Please install the required dependencies to continue.');\n }\n\n this._shouldConfigure = Promise.resolve({ nextjs: true });\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return this.shouldConfigure;\n }\n\n private async _createSentryCliConfig(\n cliProps: SentryCliProps,\n ): Promise<void> {\n const { 'auth/token': authToken, ...cliPropsToWrite } = cliProps;\n\n /**\n * To not commit the auth token to the VCS, instead of adding it to the\n * properties file (like the rest of props), it's added to the Sentry CLI\n * config, which is added to the gitignore. This way makes the properties\n * file safe to commit without exposing any auth tokens.\n */\n if (authToken) {\n try {\n await fs.promises.appendFile(\n SENTRYCLIRC_FILENAME,\n this._sentryCli.dumpConfig({ auth: { token: authToken } }),\n );\n green(`✓ Successfully added the auth token to ${SENTRYCLIRC_FILENAME}`);\n } catch {\n red(\n `⚠ Could not add the auth token to ${SENTRYCLIRC_FILENAME}, ` +\n `please add it to identify your user account:\\n${authToken}`,\n );\n nl();\n }\n } else {\n red(\n `⚠ Did not find an auth token, please add your token to ${SENTRYCLIRC_FILENAME}`,\n );\n l(\n 'To generate an auth token, visit https://sentry.io/settings/account/api/auth-tokens/',\n );\n l(\n 'To learn how to configure Sentry CLI, visit ' +\n 'https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli',\n );\n }\n\n await this._addToGitignore(\n SENTRYCLIRC_FILENAME,\n `⚠ Could not add ${SENTRYCLIRC_FILENAME} to ${GITIGNORE_FILENAME}, ` +\n 'please add it to not commit your auth key.',\n );\n\n try {\n await fs.promises.writeFile(\n `./${PROPERTIES_FILENAME}`,\n this._sentryCli.dumpProperties(cliPropsToWrite),\n );\n green(`✓ Successfully created sentry.properties`);\n } catch {\n red(`⚠ Could not add org and project data to ${PROPERTIES_FILENAME}`);\n l(\n 'See docs for a manual setup: https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/#configure-sentry-cli',\n );\n }\n nl();\n }\n\n private async _addToGitignore(\n filepath: string,\n errorMsg: string,\n ): Promise<void> {\n /**\n * Don't check whether the given file is ignored because:\n * 1. It's tricky to check it without git.\n * 2. Git might not be installed or accessible.\n * 3. It's convenient to use a module to interact with git, but it would\n * increase the size x2 approximately. Docs say to run the Wizard without\n * installing it, and duplicating the size would slow the set-up down.\n * 4. The Wizard is meant to be run once.\n * 5. A message is logged informing users it's been added to the gitignore.\n * 6. It will be added to the gitignore as many times as it runs - not a big\n * deal.\n * 7. It's straightforward to remove it from the gitignore.\n */\n try {\n await fs.promises.appendFile(\n GITIGNORE_FILENAME,\n `\\n# Sentry\\n${filepath}\\n`,\n );\n green(`✓ ${filepath} added to ${GITIGNORE_FILENAME}`);\n } catch {\n red(errorMsg);\n }\n }\n\n private _createNextConfig(configDirectory: string, dsn: any): void {\n const templates = fs.readdirSync(configDirectory);\n for (const template of templates) {\n this._setTemplate(\n configDirectory,\n template,\n TEMPLATE_DESTINATIONS[template],\n dsn,\n );\n }\n red(\n '⚠ Performance monitoring is enabled capturing 100% of transactions.\\n' +\n ' Learn more in https://docs.sentry.io/product/performance/',\n );\n nl();\n }\n\n private _setTemplate(\n configDirectory: string,\n templateFile: string,\n destinationOptions: string[],\n dsn: string,\n ): void {\n const templatePath = path.join(configDirectory, templateFile);\n\n for (const destinationDir of destinationOptions) {\n if (!fs.existsSync(destinationDir)) {\n continue;\n }\n\n const destinationPath = path.join(destinationDir, templateFile);\n // in case the file in question already exists, we'll make a copy with\n // `MERGEABLE_CONFIG_INFIX` inserted just before the extension, so as not\n // to overwrite the existing file\n const mergeableFilePath = path.join(\n destinationDir,\n this._spliceInPlace(\n templateFile.split('.'),\n -1,\n 0,\n MERGEABLE_CONFIG_INFIX,\n ).join('.'),\n );\n\n if (!fs.existsSync(destinationPath)) {\n this._fillAndCopyTemplate(templatePath, destinationPath, dsn);\n } else if (!fs.existsSync(mergeableFilePath)) {\n this._fillAndCopyTemplate(templatePath, mergeableFilePath, dsn);\n red(\n `File \\`${templateFile}\\` already exists, so created \\`${mergeableFilePath}\\`.\\n` +\n 'Please merge those files.',\n );\n nl();\n } else {\n red(\n `Both \\`${templateFile}\\` and \\`${mergeableFilePath}\\` already exist.\\n` +\n 'Please merge those files.',\n );\n nl();\n }\n return;\n }\n\n red(\n `Could not find appropriate destination for \\`${templateFile}\\`. Tried: ${destinationOptions}.`,\n );\n nl();\n }\n\n private _fillAndCopyTemplate(\n sourcePath: string,\n targetPath: string,\n dsn: string,\n ): void {\n const templateContent = fs.readFileSync(sourcePath).toString();\n const filledTemplate = templateContent.replace('___DSN___', dsn);\n fs.writeFileSync(targetPath, filledTemplate);\n }\n\n private _checkPackageVersion(\n packageName: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n ): boolean {\n const depsVersion = _.get(appPackage, ['dependencies', packageName]);\n const devDepsVersion = _.get(appPackage, ['devDependencies', packageName]);\n\n if (!depsVersion && !devDepsVersion) {\n red(`✗ ${packageName} isn't in your dependencies.`);\n red(' Please install it with yarn/npm.');\n return false;\n } else if (\n !this._fulfillsVersionRange(\n depsVersion,\n acceptableVersions,\n canBeLatest,\n ) &&\n !this._fulfillsVersionRange(\n devDepsVersion,\n acceptableVersions,\n canBeLatest,\n )\n ) {\n red(\n `✗ Your \\`package.json\\` specifies a version of \\`${packageName}\\` outside of the compatible version range ${acceptableVersions}.\\n`,\n );\n return false;\n } else {\n green(\n `✓ A compatible version of \\`${packageName}\\` is specified in \\`package.json\\`.`,\n );\n return true;\n }\n }\n\n private _fulfillsVersionRange(\n version: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n ): boolean {\n if (version === 'latest') {\n return canBeLatest;\n }\n\n let cleanedUserVersion, isRange;\n\n if (valid(version)) {\n cleanedUserVersion = valid(version);\n isRange = false;\n } else if (validRange(version)) {\n cleanedUserVersion = validRange(version);\n isRange = true;\n }\n\n return (\n // If the given version is a bogus format, this will still be undefined and we'll automatically reject it\n !!cleanedUserVersion &&\n (isRange\n ? subset(cleanedUserVersion, acceptableVersions)\n : satisfies(cleanedUserVersion, acceptableVersions))\n );\n }\n\n private _spliceInPlace(\n arr: Array<any>,\n start: number,\n deleteCount: number,\n ...inserts: any[]\n ): Array<any> {\n arr.splice(start, deleteCount, ...inserts);\n return arr;\n }\n}\n"]}
@@ -10,6 +10,7 @@ export declare class ReactNative extends MobileProject {
10
10
  emit(answers: Answers): Promise<Answers>;
11
11
  uninstall(_answers: Answers): Promise<Answers>;
12
12
  protected _shouldConfigurePlatform(platform: string): Promise<boolean>;
13
+ private _patchJsSentryInit;
13
14
  private _addSentryProperties;
14
15
  private _patchJs;
15
16
  private _patchBuildGradle;
@@ -93,7 +93,7 @@ var ReactNative = /** @class */ (function (_super) {
93
93
  return __generator(this, function (_a) {
94
94
  switch (_a.label) {
95
95
  case 0:
96
- _a.trys.push([0, 8, , 9]);
96
+ _a.trys.push([0, 7, , 8]);
97
97
  if (!(platform === 'ios')) return [3 /*break*/, 2];
98
98
  return [4 /*yield*/, File_1.patchMatchingFile('ios/*.xcodeproj/project.pbxproj', this._patchXcodeProj.bind(this))];
99
99
  case 1:
@@ -105,26 +105,20 @@ var ReactNative = /** @class */ (function (_super) {
105
105
  _a.sent();
106
106
  Logging_1.dim("\u2705 Patched build.gradle file.");
107
107
  _a.label = 4;
108
- case 4: return [4 /*yield*/, File_1.patchMatchingFile("index." + platform + ".js", this._patchJs.bind(this), answers, platform)];
108
+ case 4: return [4 /*yield*/, this._patchJsSentryInit(platform, answers)];
109
109
  case 5:
110
110
  _a.sent();
111
- // rm 0.49 introduced an App.js for both platforms
112
- return [4 /*yield*/, File_1.patchMatchingFile('App.js', this._patchJs.bind(this), answers, platform)];
113
- case 6:
114
- // rm 0.49 introduced an App.js for both platforms
115
- _a.sent();
116
- Logging_1.dim("\u2705 Patched App.js file.");
117
111
  return [4 /*yield*/, this._addSentryProperties(platform, sentryCliProperties)];
118
- case 7:
112
+ case 6:
119
113
  _a.sent();
120
114
  Logging_1.dim("\u2705 Added sentry.properties file to " + platform);
121
115
  Logging_1.green("Successfully set up " + platform + " for react-native");
122
- return [3 /*break*/, 9];
123
- case 8:
116
+ return [3 /*break*/, 8];
117
+ case 7:
124
118
  e_1 = _a.sent();
125
119
  Logging_1.red(e_1);
126
- return [3 /*break*/, 9];
127
- case 9: return [2 /*return*/];
120
+ return [3 /*break*/, 8];
121
+ case 8: return [2 /*return*/];
128
122
  }
129
123
  });
130
124
  }); });
@@ -189,6 +183,33 @@ var ReactNative = /** @class */ (function (_super) {
189
183
  });
190
184
  });
191
185
  };
186
+ ReactNative.prototype._patchJsSentryInit = function (platform, answers) {
187
+ return __awaiter(this, void 0, void 0, function () {
188
+ var prefixGlob, suffixGlob, platformGlob, universalGlob, jsFileGlob, jsFileToPatch;
189
+ return __generator(this, function (_a) {
190
+ switch (_a.label) {
191
+ case 0:
192
+ prefixGlob = '{.,./src}';
193
+ suffixGlob = '@(j|t|cj|mj)s?(x)';
194
+ platformGlob = "index." + platform + "." + suffixGlob;
195
+ universalGlob = "App." + suffixGlob;
196
+ jsFileGlob = prefixGlob + "/+(" + platformGlob + "|" + universalGlob + ")";
197
+ jsFileToPatch = File_1.matchFiles(jsFileGlob);
198
+ if (!(jsFileToPatch.length !== 0)) return [3 /*break*/, 2];
199
+ return [4 /*yield*/, File_1.patchMatchingFile(jsFileGlob, this._patchJs.bind(this), answers, platform)];
200
+ case 1:
201
+ _a.sent();
202
+ Logging_1.dim("\u2705 Patched " + jsFileToPatch.join(', ') + " file(s).");
203
+ return [3 /*break*/, 3];
204
+ case 2:
205
+ Logging_1.dim("\uD83D\uDEA8 Could not find " + platformGlob + " nor " + universalGlob + " files.");
206
+ Logging_1.yellow('❓ Please, visit https://docs.sentry.io/platforms/react-native');
207
+ _a.label = 3;
208
+ case 3: return [2 /*return*/];
209
+ }
210
+ });
211
+ });
212
+ };
192
213
  ReactNative.prototype._addSentryProperties = function (platform, properties) {
193
214
  var _this = this;
194
215
  var rv = Promise.resolve();