@sentry/wizard 3.25.1 → 3.26.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 (75) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bin.ts +10 -2
  3. package/dist/bin.js +12 -3
  4. package/dist/bin.js.map +1 -1
  5. package/dist/lib/Helper/Env.js +1 -0
  6. package/dist/lib/Helper/Env.js.map +1 -1
  7. package/dist/lib/Setup.d.ts +6 -0
  8. package/dist/lib/Setup.js +6 -0
  9. package/dist/lib/Setup.js.map +1 -1
  10. package/dist/lib/Steps/ChooseIntegration.js +0 -29
  11. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  12. package/dist/lib/Steps/OpenSentry.js +1 -1
  13. package/dist/lib/Steps/OpenSentry.js.map +1 -1
  14. package/dist/package.json +2 -1
  15. package/dist/src/nextjs/nextjs-wizard.d.ts +1 -1
  16. package/dist/src/nextjs/nextjs-wizard.js +166 -84
  17. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  18. package/dist/src/nextjs/templates.d.ts +3 -2
  19. package/dist/src/nextjs/templates.js +10 -8
  20. package/dist/src/nextjs/templates.js.map +1 -1
  21. package/dist/src/run.d.ts +16 -0
  22. package/dist/src/run.js +195 -0
  23. package/dist/src/run.js.map +1 -0
  24. package/dist/src/telemetry.js +10 -3
  25. package/dist/src/telemetry.js.map +1 -1
  26. package/dist/src/utils/clack-utils.js +35 -11
  27. package/dist/src/utils/clack-utils.js.map +1 -1
  28. package/dist/src/utils/package-json.d.ts +1 -0
  29. package/dist/src/utils/package-json.js.map +1 -1
  30. package/dist/src/utils/package-manager.d.ts +1 -1
  31. package/dist/src/utils/package-manager.js +5 -52
  32. package/dist/src/utils/package-manager.js.map +1 -1
  33. package/dist/test/nextjs/templates.test.js +14 -0
  34. package/dist/test/nextjs/templates.test.js.map +1 -1
  35. package/lib/Helper/Env.ts +1 -0
  36. package/lib/Setup.ts +6 -0
  37. package/lib/Steps/ChooseIntegration.ts +0 -29
  38. package/lib/Steps/OpenSentry.ts +1 -1
  39. package/package.json +2 -1
  40. package/src/nextjs/nextjs-wizard.ts +188 -99
  41. package/src/nextjs/templates.ts +19 -4
  42. package/src/run.ts +142 -0
  43. package/src/telemetry.ts +7 -1
  44. package/src/utils/clack-utils.ts +44 -7
  45. package/src/utils/package-json.ts +1 -0
  46. package/src/utils/package-manager.ts +5 -9
  47. package/test/nextjs/templates.test.ts +56 -0
  48. package/dist/lib/Steps/Integrations/Android.d.ts +0 -9
  49. package/dist/lib/Steps/Integrations/Android.js +0 -86
  50. package/dist/lib/Steps/Integrations/Android.js.map +0 -1
  51. package/dist/lib/Steps/Integrations/Apple.d.ts +0 -10
  52. package/dist/lib/Steps/Integrations/Apple.js +0 -92
  53. package/dist/lib/Steps/Integrations/Apple.js.map +0 -1
  54. package/dist/lib/Steps/Integrations/NextJsShim.d.ts +0 -13
  55. package/dist/lib/Steps/Integrations/NextJsShim.js +0 -99
  56. package/dist/lib/Steps/Integrations/NextJsShim.js.map +0 -1
  57. package/dist/lib/Steps/Integrations/ReactNative.d.ts +0 -10
  58. package/dist/lib/Steps/Integrations/ReactNative.js +0 -93
  59. package/dist/lib/Steps/Integrations/ReactNative.js.map +0 -1
  60. package/dist/lib/Steps/Integrations/Remix.d.ts +0 -12
  61. package/dist/lib/Steps/Integrations/Remix.js +0 -98
  62. package/dist/lib/Steps/Integrations/Remix.js.map +0 -1
  63. package/dist/lib/Steps/Integrations/SourceMapsShim.d.ts +0 -13
  64. package/dist/lib/Steps/Integrations/SourceMapsShim.js +0 -94
  65. package/dist/lib/Steps/Integrations/SourceMapsShim.js.map +0 -1
  66. package/dist/lib/Steps/Integrations/SvelteKitShim.d.ts +0 -13
  67. package/dist/lib/Steps/Integrations/SvelteKitShim.js +0 -99
  68. package/dist/lib/Steps/Integrations/SvelteKitShim.js.map +0 -1
  69. package/lib/Steps/Integrations/Android.ts +0 -23
  70. package/lib/Steps/Integrations/Apple.ts +0 -27
  71. package/lib/Steps/Integrations/NextJsShim.ts +0 -33
  72. package/lib/Steps/Integrations/ReactNative.ts +0 -28
  73. package/lib/Steps/Integrations/Remix.ts +0 -32
  74. package/lib/Steps/Integrations/SourceMapsShim.ts +0 -28
  75. package/lib/Steps/Integrations/SvelteKitShim.ts +0 -33
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.26.0
4
+
5
+ - fix(nextjs): Don't add '.env.sentry-build-plugin' to .gitignore if it's already there (#610)
6
+ - feat(nextjs): Support all `next.config` file types (#630)
7
+ - fix(nextjs): Update instrumentation and example creation logic for app or pages usage (#629)
8
+ - feat(nextjs): Prompt for `reactComponentAnnotation` (#634)
9
+ - fix(nextjs): Add missing Error.getInitialProps calls in Next.js error page snippets (#632)
10
+ - fix/feat: Improve error logging for package installation (#635)
11
+ - fix: Properly close open handles (#638)
12
+
13
+ ## 3.25.2
14
+
15
+ - ref: Improve intro and wizard selection (#625)
16
+
3
17
  ## 3.25.1
4
18
 
5
19
  - fix(remix): Change `handleError` in server entry (#621)
package/bin.ts CHANGED
@@ -2,6 +2,9 @@
2
2
  import { satisfies } from 'semver';
3
3
  import { red } from './lib/Helper/Logging';
4
4
 
5
+ import yargs from 'yargs';
6
+ import { hideBin } from 'yargs/helpers';
7
+
5
8
  const NODE_VERSION_RANGE = '>=14.18.0';
6
9
 
7
10
  // Have to run this above the other imports because they are importing clack that
@@ -14,11 +17,12 @@ if (!satisfies(process.version, NODE_VERSION_RANGE)) {
14
17
  }
15
18
 
16
19
  import { Integration, Platform } from './lib/Constants';
17
- import { run } from './lib/Setup';
20
+ import { run } from './src/run';
21
+
18
22
  export * from './lib/Setup';
19
23
 
20
24
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
21
- const argv = require('yargs')
25
+ const argv = yargs(hideBin(process.argv))
22
26
  .option('debug', {
23
27
  default: false,
24
28
  describe: 'Enable verbose logging\nenv: SENTRY_WIZARD_DEBUG',
@@ -70,6 +74,10 @@ const argv = require('yargs')
70
74
  .option('promo-code', {
71
75
  alias: 'promo-code',
72
76
  describe: 'A promo code that will be applied during signup',
77
+ type: 'string',
73
78
  }).argv;
74
79
 
80
+ // @ts-expect-error - for some reason TS doesn't recognize the aliases as valid properties
81
+ // meaning it only knows e.g. u but not url. Maybe a bug in this old version of yargs?
82
+ // Can't upgrade yargs though without dropping support for Node 14.
75
83
  void run(argv);
package/dist/bin.js CHANGED
@@ -14,9 +14,14 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
14
14
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
16
  };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
17
20
  Object.defineProperty(exports, "__esModule", { value: true });
18
21
  var semver_1 = require("semver");
19
22
  var Logging_1 = require("./lib/Helper/Logging");
23
+ var yargs_1 = __importDefault(require("yargs"));
24
+ var helpers_1 = require("yargs/helpers");
20
25
  var NODE_VERSION_RANGE = '>=14.18.0';
21
26
  // Have to run this above the other imports because they are importing clack that
22
27
  // has the problematic imports.
@@ -25,10 +30,10 @@ if (!(0, semver_1.satisfies)(process.version, NODE_VERSION_RANGE)) {
25
30
  process.exit(1);
26
31
  }
27
32
  var Constants_1 = require("./lib/Constants");
28
- var Setup_1 = require("./lib/Setup");
33
+ var run_1 = require("./src/run");
29
34
  __exportStar(require("./lib/Setup"), exports);
30
35
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
31
- var argv = require('yargs')
36
+ var argv = (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv))
32
37
  .option('debug', {
33
38
  default: false,
34
39
  describe: 'Enable verbose logging\nenv: SENTRY_WIZARD_DEBUG',
@@ -78,6 +83,10 @@ var argv = require('yargs')
78
83
  .option('promo-code', {
79
84
  alias: 'promo-code',
80
85
  describe: 'A promo code that will be applied during signup',
86
+ type: 'string',
81
87
  }).argv;
82
- void (0, Setup_1.run)(argv);
88
+ // @ts-expect-error - for some reason TS doesn't recognize the aliases as valid properties
89
+ // meaning it only knows e.g. u but not url. Maybe a bug in this old version of yargs?
90
+ // Can't upgrade yargs though without dropping support for Node 14.
91
+ void (0, run_1.run)(argv);
83
92
  //# sourceMappingURL=bin.js.map
package/dist/bin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.js","sourceRoot":"","sources":["../bin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,iCAAmC;AACnC,gDAA2C;AAE3C,IAAM,kBAAkB,GAAG,WAAW,CAAC;AAEvC,iFAAiF;AACjF,+BAA+B;AAC/B,IAAI,CAAC,IAAA,kBAAS,EAAC,OAAO,CAAC,OAAO,EAAE,kBAAkB,CAAC,EAAE;IACnD,IAAA,aAAG,EACD,yCAAkC,kBAAkB,qCAA2B,OAAO,CAAC,OAAO,2CAAwC,CACvI,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,6CAAwD;AACxD,qCAAkC;AAClC,8CAA4B;AAE5B,kJAAkJ;AAClJ,IAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;KAC1B,MAAM,CAAC,OAAO,EAAE;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,kDAAkD;IAC5D,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,WAAW,EAAE;IACnB,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,4DAA4D;IACtE,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,cAAc,EAAE;IACtB,OAAO,EAAE,KAAK;IACd,QAAQ,EACN,qEAAqE;IACvE,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,OAAO,EAAE;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EACN,8EAA8E;IAChF,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,GAAG,EAAE;IACX,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,uBAAW,CAAC;IACjC,QAAQ,EAAE,iEAAiE;CAC5E,CAAC;KACD,MAAM,CAAC,GAAG,EAAE;IACX,KAAK,EAAE,UAAU;IACjB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,oBAAQ,CAAC;IAC9B,QAAQ,EAAE,iDAAiD;IAC3D,IAAI,EAAE,OAAO;CACd,CAAC;KACD,MAAM,CAAC,GAAG,EAAE;IACX,KAAK,EAAE,KAAK;IACZ,QAAQ,EAAE,6DAA6D;CACxE,CAAC;KACD,MAAM,CAAC,GAAG,EAAE;IACX,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,0CAA0C;IACpD,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,mBAAmB,EAAE;IAC3B,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,qCAAqC;IAC/C,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,YAAY,EAAE;IACpB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,iDAAiD;CAC5D,CAAC,CAAC,IAAI,CAAC;AAEV,KAAK,IAAA,WAAG,EAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { satisfies } from 'semver';\nimport { red } from './lib/Helper/Logging';\n\nconst NODE_VERSION_RANGE = '>=14.18.0';\n\n// Have to run this above the other imports because they are importing clack that\n// has the problematic imports.\nif (!satisfies(process.version, NODE_VERSION_RANGE)) {\n red(\n `Sentry wizard requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`,\n );\n process.exit(1);\n}\n\nimport { Integration, Platform } from './lib/Constants';\nimport { run } from './lib/Setup';\nexport * from './lib/Setup';\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\nconst argv = require('yargs')\n .option('debug', {\n default: false,\n describe: 'Enable verbose logging\\nenv: SENTRY_WIZARD_DEBUG',\n type: 'boolean',\n })\n .option('uninstall', {\n default: false,\n describe: 'Revert project setup process\\nenv: SENTRY_WIZARD_UNINSTALL',\n type: 'boolean',\n })\n .option('skip-connect', {\n default: false,\n describe:\n 'Skips the connection to the server\\nenv: SENTRY_WIZARD_SKIP_CONNECT',\n type: 'boolean',\n })\n .option('quiet', {\n default: false,\n describe:\n 'Do not fallback to prompting user asking questions\\nenv: SENTRY_WIZARD_QUIET',\n type: 'boolean',\n })\n .option('i', {\n alias: 'integration',\n choices: Object.keys(Integration),\n describe: 'Choose the integration to setup\\nenv: SENTRY_WIZARD_INTEGRATION',\n })\n .option('p', {\n alias: 'platform',\n choices: Object.keys(Platform),\n describe: 'Choose platform(s)\\nenv: SENTRY_WIZARD_PLATFORM',\n type: 'array',\n })\n .option('u', {\n alias: 'url',\n describe: 'The url to your Sentry installation\\nenv: SENTRY_WIZARD_URL',\n })\n .option('s', {\n alias: 'signup',\n default: false,\n describe: 'Redirect to signup page if not logged in',\n type: 'boolean',\n })\n .option('disable-telemetry', {\n default: false,\n describe: \"Don't send telemetry data to Sentry\",\n type: 'boolean',\n })\n .option('promo-code', {\n alias: 'promo-code',\n describe: 'A promo code that will be applied during signup',\n }).argv;\n\nvoid run(argv);\n"]}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../bin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AACA,iCAAmC;AACnC,gDAA2C;AAE3C,gDAA0B;AAC1B,yCAAwC;AAExC,IAAM,kBAAkB,GAAG,WAAW,CAAC;AAEvC,iFAAiF;AACjF,+BAA+B;AAC/B,IAAI,CAAC,IAAA,kB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AAC,GAAG,EAAE;IACX,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,0CAA0C;IACpD,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,mBAAmB,EAAE;IAC3B,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,qCAAqC;IAC/C,IAAI,EAAE,SAAS;CAChB,CAAC;KACD,MAAM,CAAC,YAAY,EAAE;IACpB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,iDAAiD;IAC3D,IAAI,EAAE,QAAQ;CACf,CAAC,CAAC,IAAI,CAAC;AAEV,0FAA0F;AAC1F,sFAAsF;AACtF,mEAAmE;AACnE,KAAK,IAAA,SAAG,EAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { satisfies } from 'semver';\nimport { red } from './lib/Helper/Logging';\n\nimport yargs from 'yargs';\nimport { hideBin } from 'yargs/helpers';\n\nconst NODE_VERSION_RANGE = '>=14.18.0';\n\n// Have to run this above the other imports because they are importing clack that\n// has the problematic imports.\nif (!satisfies(process.version, NODE_VERSION_RANGE)) {\n red(\n `Sentry wizard requires Node.js ${NODE_VERSION_RANGE}. You are using Node.js ${process.version}. Please upgrade your Node.js version.`,\n );\n process.exit(1);\n}\n\nimport { Integration, Platform } from './lib/Constants';\nimport { run } from './src/run';\n\nexport * from './lib/Setup';\n\n// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\nconst argv = yargs(hideBin(process.argv))\n .option('debug', {\n default: false,\n describe: 'Enable verbose logging\\nenv: SENTRY_WIZARD_DEBUG',\n type: 'boolean',\n })\n .option('uninstall', {\n default: false,\n describe: 'Revert project setup process\\nenv: SENTRY_WIZARD_UNINSTALL',\n type: 'boolean',\n })\n .option('skip-connect', {\n default: false,\n describe:\n 'Skips the connection to the server\\nenv: SENTRY_WIZARD_SKIP_CONNECT',\n type: 'boolean',\n })\n .option('quiet', {\n default: false,\n describe:\n 'Do not fallback to prompting user asking questions\\nenv: SENTRY_WIZARD_QUIET',\n type: 'boolean',\n })\n .option('i', {\n alias: 'integration',\n choices: Object.keys(Integration),\n describe: 'Choose the integration to setup\\nenv: SENTRY_WIZARD_INTEGRATION',\n })\n .option('p', {\n alias: 'platform',\n choices: Object.keys(Platform),\n describe: 'Choose platform(s)\\nenv: SENTRY_WIZARD_PLATFORM',\n type: 'array',\n })\n .option('u', {\n alias: 'url',\n describe: 'The url to your Sentry installation\\nenv: SENTRY_WIZARD_URL',\n })\n .option('s', {\n alias: 'signup',\n default: false,\n describe: 'Redirect to signup page if not logged in',\n type: 'boolean',\n })\n .option('disable-telemetry', {\n default: false,\n describe: \"Don't send telemetry data to Sentry\",\n type: 'boolean',\n })\n .option('promo-code', {\n alias: 'promo-code',\n describe: 'A promo code that will be applied during signup',\n type: 'string',\n }).argv;\n\n// @ts-expect-error - for some reason TS doesn't recognize the aliases as valid properties\n// meaning it only knows e.g. u but not url. Maybe a bug in this old version of yargs?\n// Can't upgrade yargs though without dropping support for Node 14.\nvoid run(argv);\n"]}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.readEnvironment = void 0;
4
4
  var readEnv = require('read-env').default;
5
+ // TODO: move to src/utils (+tests)
5
6
  function readEnvironment() {
6
7
  var result = readEnv('SENTRY_WIZARD');
7
8
  return result;
@@ -1 +1 @@
1
- {"version":3,"file":"Env.js","sourceRoot":"","sources":["../../../lib/Helper/Env.ts"],"names":[],"mappings":";;;AAAA,IAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;AAE5C,SAAgB,eAAe;IAC7B,IAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AAChB,CAAC;AAHD,0CAGC","sourcesContent":["const readEnv = require('read-env').default;\n\nexport function readEnvironment(): Record<string, unknown> {\n const result = readEnv('SENTRY_WIZARD');\n return result;\n}\n"]}
1
+ {"version":3,"file":"Env.js","sourceRoot":"","sources":["../../../lib/Helper/Env.ts"],"names":[],"mappings":";;;AAAA,IAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC;AAE5C,mCAAmC;AACnC,SAAgB,eAAe;IAC7B,IAAM,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,OAAO,MAAM,CAAC;AAChB,CAAC;AAHD,0CAGC","sourcesContent":["const readEnv = require('read-env').default;\n\n// TODO: move to src/utils (+tests)\nexport function readEnvironment(): Record<string, unknown> {\n const result = readEnv('SENTRY_WIZARD');\n return result;\n}\n"]}
@@ -1 +1,7 @@
1
+ /**
2
+ * @deprecated this function is the entry point to the old, step-based wizards located in `lib`.
3
+ * When creating new wizards, we now add them to clack-based wizards under `src`.
4
+ * Therefor, do not call this function anymore.
5
+ * Use `run` from {@link ../src/run.ts} instead.
6
+ */
1
7
  export declare function run(argv: any): Promise<any>;
package/dist/lib/Setup.js CHANGED
@@ -85,6 +85,12 @@ var debug_1 = require("../src/utils/debug");
85
85
  var Env_1 = require("./Helper/Env");
86
86
  var Wizard_1 = require("./Helper/Wizard");
87
87
  var Step = __importStar(require("./Steps"));
88
+ /**
89
+ * @deprecated this function is the entry point to the old, step-based wizards located in `lib`.
90
+ * When creating new wizards, we now add them to clack-based wizards under `src`.
91
+ * Therefor, do not call this function anymore.
92
+ * Use `run` from {@link ../src/run.ts} instead.
93
+ */
88
94
  function run(argv) {
89
95
  return __awaiter(this, void 0, void 0, function () {
90
96
  var args, steps;
@@ -1 +1 @@
1
- {"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA4B;AAC5B,4CAAqD;AAErD,oCAA+C;AAC/C,0CAA8C;AAC9C,4CAAgC;AAEhC,SAAsB,GAAG,CAAC,IAAS;;;;YAC3B,IAAI,yBAAQ,IAAI,GAAK,IAAA,qBAAe,GAAE,CAAE,CAAC;YAE/C,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,IAAA,uBAAe,GAAE,CAAC;aACnB;YAED,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;aACxB;YACG,KAAK,GAAG;gBACV,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,iBAAiB;gBACtB,IAAI,CAAC,eAAe;aACrB,CAAC;YACF,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;gBAC5B,KAAK,GAAG,CAAC,CAAC,MAAM,CACd,KAAK,EACL,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,mBAAmB,CACzB,CAAC;aACH;YACD,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5D,sBAAO,oBAAW,8BAAC,IAAI,GAAK,KAAK,WAAE;;;CACpC;AA3BD,kBA2BC","sourcesContent":["import * as _ from 'lodash';\nimport { enableDebugLogs } from '../src/utils/debug';\n\nimport { readEnvironment } from './Helper/Env';\nimport { startWizard } from './Helper/Wizard';\nimport * as Step from './Steps';\n\nexport async function run(argv: any): Promise<any> {\n const args = { ...argv, ...readEnvironment() };\n\n if (argv.debug) {\n enableDebugLogs();\n }\n\n if (args.uninstall === undefined) {\n args.uninstall = false;\n }\n let steps = [\n Step.Initial,\n Step.Welcome,\n Step.ChooseIntegration,\n Step.ShouldConfigure,\n ];\n if (args.uninstall === false) {\n steps = _.concat(\n steps,\n Step.OpenSentry,\n Step.WaitForSentry,\n Step.SentryProjectSelector,\n Step.PromptForParameters,\n );\n }\n steps = _.concat(steps, Step.ConfigureProject, Step.Result);\n return startWizard(args, ...steps);\n}\n"]}
1
+ {"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA4B;AAC5B,4CAAqD;AAErD,oCAA+C;AAC/C,0CAA8C;AAC9C,4CAAgC;AAEhC;;;;;GAKG;AACH,SAAsB,GAAG,CAAC,IAAS;;;;YAC3B,IAAI,yBAAQ,IAAI,GAAK,IAAA,qBAAe,GAAE,CAAE,CAAC;YAE/C,IAAI,IAAI,CAAC,KAAK,EAAE;gBACd,IAAA,uBAAe,GAAE,CAAC;aACnB;YAED,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE;gBAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;aACxB;YACG,KAAK,GAAG;gBACV,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,OAAO;gBACZ,IAAI,CAAC,iBAAiB;gBACtB,IAAI,CAAC,eAAe;aACrB,CAAC;YACF,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,EAAE;gBAC5B,KAAK,GAAG,CAAC,CAAC,MAAM,CACd,KAAK,EACL,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,qBAAqB,EAC1B,IAAI,CAAC,mBAAmB,CACzB,CAAC;aACH;YACD,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC5D,sBAAO,oBAAW,8BAAC,IAAI,GAAK,KAAK,WAAE;;;CACpC;AA3BD,kBA2BC","sourcesContent":["import * as _ from 'lodash';\nimport { enableDebugLogs } from '../src/utils/debug';\n\nimport { readEnvironment } from './Helper/Env';\nimport { startWizard } from './Helper/Wizard';\nimport * as Step from './Steps';\n\n/**\n * @deprecated this function is the entry point to the old, step-based wizards located in `lib`.\n * When creating new wizards, we now add them to clack-based wizards under `src`.\n * Therefor, do not call this function anymore.\n * Use `run` from {@link ../src/run.ts} instead.\n */\nexport async function run(argv: any): Promise<any> {\n const args = { ...argv, ...readEnvironment() };\n\n if (argv.debug) {\n enableDebugLogs();\n }\n\n if (args.uninstall === undefined) {\n args.uninstall = false;\n }\n let steps = [\n Step.Initial,\n Step.Welcome,\n Step.ChooseIntegration,\n Step.ShouldConfigure,\n ];\n if (args.uninstall === false) {\n steps = _.concat(\n steps,\n Step.OpenSentry,\n Step.WaitForSentry,\n Step.SentryProjectSelector,\n Step.PromptForParameters,\n );\n }\n steps = _.concat(steps, Step.ConfigureProject, Step.Result);\n return startWizard(args, ...steps);\n}\n"]}
@@ -57,14 +57,7 @@ var Constants_1 = require("../Constants");
57
57
  var BaseStep_1 = require("./BaseStep");
58
58
  var Cordova_1 = require("./Integrations/Cordova");
59
59
  var Electron_1 = require("./Integrations/Electron");
60
- var NextJsShim_1 = require("./Integrations/NextJsShim");
61
- var ReactNative_1 = require("./Integrations/ReactNative");
62
- var SourceMapsShim_1 = require("./Integrations/SourceMapsShim");
63
- var Apple_1 = require("./Integrations/Apple");
64
- var SvelteKitShim_1 = require("./Integrations/SvelteKitShim");
65
60
  var package_json_1 = require("../../src/utils/package-json");
66
- var Remix_1 = require("./Integrations/Remix");
67
- var Android_1 = require("./Integrations/Android");
68
61
  var Logging_1 = require("../Helper/Logging");
69
62
  var projectPackage = {};
70
63
  try {
@@ -89,34 +82,12 @@ var ChooseIntegration = /** @class */ (function (_super) {
89
82
  integrationPrompt = _a.sent();
90
83
  integration = null;
91
84
  switch (integrationPrompt.integration) {
92
- case Constants_1.Integration.android:
93
- integration = new Android_1.Android(this._argv);
94
- break;
95
85
  case Constants_1.Integration.cordova:
96
86
  integration = new Cordova_1.Cordova(sanitizeUrl(this._argv));
97
87
  break;
98
88
  case Constants_1.Integration.electron:
99
89
  integration = new Electron_1.Electron(sanitizeUrl(this._argv));
100
90
  break;
101
- case Constants_1.Integration.nextjs:
102
- integration = new NextJsShim_1.NextJsShim(this._argv);
103
- break;
104
- case Constants_1.Integration.remix:
105
- integration = new Remix_1.Remix(this._argv);
106
- break;
107
- case Constants_1.Integration.sveltekit:
108
- integration = new SvelteKitShim_1.SvelteKitShim(this._argv);
109
- break;
110
- case Constants_1.Integration.sourcemaps:
111
- integration = new SourceMapsShim_1.SourceMapsShim(this._argv);
112
- break;
113
- case Constants_1.Integration.ios:
114
- integration = new Apple_1.Apple(this._argv);
115
- break;
116
- case Constants_1.Integration.reactNative:
117
- default:
118
- integration = new ReactNative_1.ReactNative(this._argv);
119
- break;
120
91
  }
121
92
  return [2 /*return*/, { integration: integration }];
122
93
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAElC,0CAKsB;AACtB,uCAAsC;AACtC,kDAAiD;AACjD,oDAAmD;AACnD,wDAAuD;AACvD,0DAAyD;AACzD,gEAA+D;AAC/D,8CAA6C;AAC7C,8DAA6D;AAC7D,6DAAmE;AACnE,8CAA6C;AAC7C,kDAAiD;AACjD,6CAAwC;AAExC,IAAI,cAAc,GAAQ,EAAE,CAAC;AAE7B,IAAI;IACF,qCAAqC;IACrC,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAChD;AAAC,WAAM;IACN,cAAc,GAAG,OAAO,CAAC,UAAG,OAAO,CAAC,GAAG,EAAE,kBAAe,CAAC,CAAC;CAC3D;AAMD;IAAuC,qCAAQ;IAA/C;;IAqFA,CAAC;IApFc,gCAAI,GAAjB,UAAkB,QAAiB;;;;;4BACP,qBAAM,IAAI,CAAC,8BAA8B,EAAE,EAAA;;wBAA/D,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b;yBACF,CAAC,EAAC;iBACJ;;;;KACF;IACH,wBAAC;AAAD,CAAC,AArFD,CAAuC,mBAAQ,GAqF9C;AArFY,8CAAiB;AAuF9B;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAU;IAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,aAAG,EAAC,uCAAgC,IAAI,CAAC,GAAG,CAAE,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;IAEnB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\n\nimport {\n Args,\n DEFAULT_URL,\n getIntegrationChoices,\n Integration,\n} from '../Constants';\nimport { BaseStep } from './BaseStep';\nimport { Cordova } from './Integrations/Cordova';\nimport { Electron } from './Integrations/Electron';\nimport { NextJsShim } from './Integrations/NextJsShim';\nimport { ReactNative } from './Integrations/ReactNative';\nimport { SourceMapsShim } from './Integrations/SourceMapsShim';\nimport { Apple } from './Integrations/Apple';\nimport { SvelteKitShim } from './Integrations/SvelteKitShim';\nimport { hasPackageInstalled } from '../../src/utils/package-json';\nimport { Remix } from './Integrations/Remix';\nimport { Android } from './Integrations/Android';\nimport { dim } from '../Helper/Logging';\n\nlet projectPackage: any = {};\n\ntry {\n // If we run directly in setup-wizard\n projectPackage = require('../../package.json');\n} catch {\n projectPackage = require(`${process.cwd()}/package.json`);\n}\n\ntype IntegrationPromptAnswer = {\n integration: Integration;\n};\n\nexport class ChooseIntegration extends BaseStep {\n public async emit(_answers: Answers): Promise<Answers> {\n const integrationPrompt = await this._getIntegrationPromptSelection();\n\n let integration = null;\n switch (integrationPrompt.integration) {\n case Integration.android:\n integration = new Android(this._argv);\n break;\n case Integration.cordova:\n integration = new Cordova(sanitizeUrl(this._argv));\n break;\n case Integration.electron:\n integration = new Electron(sanitizeUrl(this._argv));\n break;\n case Integration.nextjs:\n integration = new NextJsShim(this._argv);\n break;\n case Integration.remix:\n integration = new Remix(this._argv);\n break;\n case Integration.sveltekit:\n integration = new SvelteKitShim(this._argv);\n break;\n case Integration.sourcemaps:\n integration = new SourceMapsShim(this._argv);\n break;\n case Integration.ios:\n integration = new Apple(this._argv);\n break;\n case Integration.reactNative:\n default:\n integration = new ReactNative(this._argv);\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n if (hasPackageInstalled('react-native', projectPackage)) {\n return Integration.reactNative;\n }\n if (hasPackageInstalled('cordova', projectPackage)) {\n return Integration.cordova;\n }\n if (hasPackageInstalled('electron', projectPackage)) {\n return Integration.electron;\n }\n if (hasPackageInstalled('next', projectPackage)) {\n return Integration.nextjs;\n }\n if (hasPackageInstalled('remix-run', projectPackage)) {\n return Integration.remix;\n }\n if (hasPackageInstalled('@sveltejs/kit', projectPackage)) {\n return Integration.sveltekit;\n }\n\n return;\n }\n\n private async _getIntegrationPromptSelection(): Promise<IntegrationPromptAnswer> {\n // If we receive project type as an arg we skip asking\n if (this._argv.integration) {\n return { integration: this._argv.integration };\n } else {\n if (this._argv.quiet) {\n throw new Error('You need to choose a platform');\n }\n\n const detectedDefaultSelection = this.tryDetectingIntegration();\n\n return prompt([\n {\n choices: getIntegrationChoices(),\n default: detectedDefaultSelection,\n message: 'What platform do you want to set up?',\n name: 'integration',\n type: 'list',\n pageSize: 10,\n },\n ]);\n }\n }\n}\n\n/**\n * For the `clack`-based wizard flows, which we only shim here, we don't set\n * a default url value. For backwards-compatibility with the other flows,\n * we fill it here and sanitize a user-enterd url.\n */\nfunction sanitizeUrl(argv: Args): Args {\n if (!argv.url) {\n argv.url = DEFAULT_URL;\n dim(`no URL provided, fallback to ${argv.url}`);\n return argv;\n }\n\n let baseUrl = argv.url;\n baseUrl += baseUrl.endsWith('/') ? '' : '/';\n baseUrl = baseUrl.replace(/:\\/(?!\\/)/g, '://');\n argv.url = baseUrl;\n\n return argv;\n}\n"]}
1
+ {"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAElC,0CAKsB;AACtB,uCAAsC;AACtC,kDAAiD;AACjD,oDAAmD;AACnD,6DAAmE;AACnE,6CAAwC;AAExC,IAAI,cAAc,GAAQ,EAAE,CAAC;AAE7B,IAAI;IACF,qCAAqC;IACrC,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;CAChD;AAAC,WAAM;IACN,cAAc,GAAG,OAAO,CAAC,UAAG,OAAO,CAAC,GAAG,EAAE,kBAAe,CAAC,CAAC;CAC3D;AAMD;IAAuC,qCAAQ;IAA/C;;IA+DA,CAAC;IA9Dc,gCAAI,GAAjB,UAAkB,QAAiB;;;;;4BACP,qBAAM,IAAI,CAAC,8BAA8B,EAAE,EAAA;;wBAA/D,iBAAiB,GAAG,SAA2C;wBAEjE,WAAW,GAAG,IAAI,CAAC;wBACvB,QAAQ,iBAAiB,CAAC,WAAW,EAAE;4BACrC,KAAK,uBAAW,CAAC,OAAO;gCACtB,WAAW,GAAG,IAAI,iBAAO,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gCACnD,MAAM;4BACR,KAAK,uBAAW,CAAC,QAAQ;gCACvB,WAAW,GAAG,IAAI,mBAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;gCACpD,MAAM;yBACT;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Aa;gCACnB,IAAI,EAAE,MAAM;gCACZ,QAAQ,EAAE,EAAE;6BACb;yBACF,CAAC,EAAC;iBACJ;;;;KACF;IACH,wBAAC;AAAD,CAAC,AA/DD,CAAuC,mBAAQ,GA+D9C;AA/DY,8CAAiB;AAiE9B;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAU;IAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,aAAG,EAAC,uCAAgC,IAAI,CAAC,GAAG,CAAE,CAAC,CAAC;QAChD,OAAO,IAAI,CAAC;KACb;IAED,IAAI,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC;IACvB,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5C,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC;IAEnB,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\n\nimport {\n Args,\n DEFAULT_URL,\n getIntegrationChoices,\n Integration,\n} from '../Constants';\nimport { BaseStep } from './BaseStep';\nimport { Cordova } from './Integrations/Cordova';\nimport { Electron } from './Integrations/Electron';\nimport { hasPackageInstalled } from '../../src/utils/package-json';\nimport { dim } from '../Helper/Logging';\n\nlet projectPackage: any = {};\n\ntry {\n // If we run directly in setup-wizard\n projectPackage = require('../../package.json');\n} catch {\n projectPackage = require(`${process.cwd()}/package.json`);\n}\n\ntype IntegrationPromptAnswer = {\n integration: Integration;\n};\n\nexport class ChooseIntegration extends BaseStep {\n public async emit(_answers: Answers): Promise<Answers> {\n const integrationPrompt = await this._getIntegrationPromptSelection();\n\n let integration = null;\n switch (integrationPrompt.integration) {\n case Integration.cordova:\n integration = new Cordova(sanitizeUrl(this._argv));\n break;\n case Integration.electron:\n integration = new Electron(sanitizeUrl(this._argv));\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n if (hasPackageInstalled('react-native', projectPackage)) {\n return Integration.reactNative;\n }\n if (hasPackageInstalled('cordova', projectPackage)) {\n return Integration.cordova;\n }\n if (hasPackageInstalled('electron', projectPackage)) {\n return Integration.electron;\n }\n if (hasPackageInstalled('next', projectPackage)) {\n return Integration.nextjs;\n }\n if (hasPackageInstalled('remix-run', projectPackage)) {\n return Integration.remix;\n }\n if (hasPackageInstalled('@sveltejs/kit', projectPackage)) {\n return Integration.sveltekit;\n }\n\n return;\n }\n\n private async _getIntegrationPromptSelection(): Promise<IntegrationPromptAnswer> {\n // If we receive project type as an arg we skip asking\n if (this._argv.integration) {\n return { integration: this._argv.integration };\n } else {\n if (this._argv.quiet) {\n throw new Error('You need to choose a platform');\n }\n\n const detectedDefaultSelection = this.tryDetectingIntegration();\n\n return prompt([\n {\n choices: getIntegrationChoices(),\n default: detectedDefaultSelection,\n message: 'What platform do you want to set up?',\n name: 'integration',\n type: 'list',\n pageSize: 10,\n },\n ]);\n }\n }\n}\n\n/**\n * For the `clack`-based wizard flows, which we only shim here, we don't set\n * a default url value. For backwards-compatibility with the other flows,\n * we fill it here and sanitize a user-enterd url.\n */\nfunction sanitizeUrl(argv: Args): Args {\n if (!argv.url) {\n argv.url = DEFAULT_URL;\n dim(`no URL provided, fallback to ${argv.url}`);\n return argv;\n }\n\n let baseUrl = argv.url;\n baseUrl += baseUrl.endsWith('/') ? '' : '/';\n baseUrl = baseUrl.replace(/:\\/(?!\\/)/g, '://');\n argv.url = baseUrl;\n\n return argv;\n}\n"]}
@@ -105,7 +105,7 @@ var OpenSentry = /** @class */ (function (_super) {
105
105
  }
106
106
  }
107
107
  urlToOpen = urlObj.toString();
108
- opn(urlToOpen).catch(function () {
108
+ opn(urlToOpen, { wait: false }).catch(function () {
109
109
  // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
110
110
  });
111
111
  (0, Logging_1.nl)();
@@ -1 +1 @@
1
- {"version":3,"file":"OpenSentry.js","sourceRoot":"","sources":["../../../lib/Steps/OpenSentry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2BAA0B;AAE1B,0CAAwD;AACxD,iDAAgD;AAChD,6CAA2D;AAC3D,2CAAyD;AACzD,uCAAsC;AAEtC,IAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3B,IAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB;IAAgC,8BAAQ;IAAxC;;IA8DA,CAAC;IA7Dc,yBAAI,GAAjB,UAAkB,OAAgB;;;;;4BAC1B,qBAAM,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAA;;wBAA9D,IAAI,CAAC,CAAC,SAAwD,CAAC,EAAE;4BAC/D,IAAA,aAAG,EAAC,yDAAyD,CAAC,CAAC;4BAC/D,sBAAO,EAAE,EAAC;yBACX;wBACD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;4BAC1B,IAAA,aAAG,EAAC,+BAA+B,CAAC,CAAC;4BACrC,sBAAO,EAAE,EAAC;yBACX;wBAEK,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;wBAE/B,qBAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;wBACpC,IAAI,CAAC,KAAK,CAAC,6BAAsB,OAAO,CAAE,CAAC,CAAC;;;;wBAG7B,qBAAM,EAAE,CAAC,GAAG,CAAC,UAAG,OAAO,kBAAe,CAAC,CAAC,IAAI,EAAA;;wBAAnD,IAAI,GAAG,SAA4C;wBAEzD,qBAAS,CAAC,IAAI,EAAE,CAAC;wBAEX,MAAM,GAAG,IAAI,SAAG,CAAC,UAAG,OAAO,qCAA2B,IAA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EAAC;;;;;KAEb;IACH,iBAAC;AAAD,CAAC,AA9DD,CAAgC,mBAAQ,GA8DvC;AA9DY,gCAAU","sourcesContent":["import type { Answers } from 'inquirer';\nimport { URL } from 'url';\n\nimport { mapIntegrationToPlatform } from '../Constants';\nimport { BottomBar } from '../Helper/BottomBar';\nimport { dim, green, l, nl, red } from '../Helper/Logging';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nconst opn = require('opn');\nconst r2 = require('r2');\n\nexport class OpenSentry extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n dim('Skipping connection to Sentry due files already patched');\n return {};\n }\n if (this._argv.skipConnect) {\n dim('Skipping connection to Sentry');\n return {};\n }\n\n const baseUrl = this._argv.url;\n\n BottomBar.show('Loading wizard...');\n this.debug(`Loading wizard for ${baseUrl}`);\n\n try {\n const data = await r2.get(`${baseUrl}api/0/wizard/`).json;\n\n BottomBar.hide();\n\n const urlObj = new URL(`${baseUrl}account/settings/wizard/${data.hash}/`);\n if (this._argv.signup) {\n urlObj.searchParams.set('signup', '1');\n // integration maps to platform in the wizard\n if (this._argv.integration) {\n const platform = mapIntegrationToPlatform(this._argv.integration);\n if (platform) {\n urlObj.searchParams.set('project_platform', platform);\n }\n }\n if (this._argv.promoCode) {\n urlObj.searchParams.set('code', this._argv.promoCode);\n }\n }\n\n const urlToOpen = urlObj.toString();\n\n opn(urlToOpen).catch(() => {\n // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here\n });\n\n nl();\n l('Please open');\n green(urlToOpen);\n l(\"in your browser (if it's not open already)\");\n nl();\n\n return { hash: data.hash };\n } catch (e) {\n this._argv.skipConnect = true;\n BottomBar.hide();\n nl();\n red(\n `Wizard couldn't connect to ${baseUrl}\\nmake sure the url is correct`,\n );\n l(\n 'But no worries, we fall back to asking you stuff instead, so here we go:',\n );\n return {};\n }\n }\n}\n"]}
1
+ {"version":3,"file":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gC,mBAAQ,GA8DvC;AA9DY,gCAAU","sourcesContent":["import type { Answers } from 'inquirer';\nimport { URL } from 'url';\n\nimport { mapIntegrationToPlatform } from '../Constants';\nimport { BottomBar } from '../Helper/BottomBar';\nimport { dim, green, l, nl, red } from '../Helper/Logging';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nconst opn = require('opn');\nconst r2 = require('r2');\n\nexport class OpenSentry extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n dim('Skipping connection to Sentry due files already patched');\n return {};\n }\n if (this._argv.skipConnect) {\n dim('Skipping connection to Sentry');\n return {};\n }\n\n const baseUrl = this._argv.url;\n\n BottomBar.show('Loading wizard...');\n this.debug(`Loading wizard for ${baseUrl}`);\n\n try {\n const data = await r2.get(`${baseUrl}api/0/wizard/`).json;\n\n BottomBar.hide();\n\n const urlObj = new URL(`${baseUrl}account/settings/wizard/${data.hash}/`);\n if (this._argv.signup) {\n urlObj.searchParams.set('signup', '1');\n // integration maps to platform in the wizard\n if (this._argv.integration) {\n const platform = mapIntegrationToPlatform(this._argv.integration);\n if (platform) {\n urlObj.searchParams.set('project_platform', platform);\n }\n }\n if (this._argv.promoCode) {\n urlObj.searchParams.set('code', this._argv.promoCode);\n }\n }\n\n const urlToOpen = urlObj.toString();\n\n opn(urlToOpen, { wait: false }).catch(() => {\n // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here\n });\n\n nl();\n l('Please open');\n green(urlToOpen);\n l(\"in your browser (if it's not open already)\");\n nl();\n\n return { hash: data.hash };\n } catch (e) {\n this._argv.skipConnect = true;\n BottomBar.hide();\n nl();\n red(\n `Wizard couldn't connect to ${baseUrl}\\nmake sure the url is correct`,\n );\n l(\n 'But no worries, we fall back to asking you stuff instead, so here we go:',\n );\n return {};\n }\n }\n}\n"]}
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/wizard",
3
- "version": "3.25.1",
3
+ "version": "3.26.0",
4
4
  "homepage": "https://github.com/getsentry/sentry-wizard",
5
5
  "repository": "https://github.com/getsentry/sentry-wizard",
6
6
  "description": "Sentry wizard helping you to configure your project",
@@ -50,6 +50,7 @@
50
50
  "@types/node": "^10.11.0",
51
51
  "@types/rimraf": "^3.0.2",
52
52
  "@types/semver": "^7.3.7",
53
+ "@types/yargs": "^16.0.9",
53
54
  "@typescript-eslint/eslint-plugin": "^5.13.0",
54
55
  "@typescript-eslint/parser": "^5.13.0",
55
56
  "eslint": "^8.18.0",
@@ -1,3 +1,3 @@
1
- import { WizardOptions } from '../utils/types';
1
+ import type { WizardOptions } from '../utils/types';
2
2
  export declare function runNextjsWizard(options: WizardOptions): Promise<void>;
3
3
  export declare function runNextjsWizardWithTelemetry(options: WizardOptions): Promise<void>;