@sentry/wizard 3.4.0 → 3.6.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 (122) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/bin.ts +29 -20
  3. package/dist/bin.js +27 -19
  4. package/dist/bin.js.map +1 -1
  5. package/dist/lib/Constants.d.ts +2 -0
  6. package/dist/lib/Constants.js +5 -0
  7. package/dist/lib/Constants.js.map +1 -1
  8. package/dist/lib/Helper/Wizard.js +2 -9
  9. package/dist/lib/Helper/Wizard.js.map +1 -1
  10. package/dist/lib/Helper/__tests__/SentryCli.js +1 -0
  11. package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
  12. package/dist/lib/Setup.js.map +1 -1
  13. package/dist/lib/Steps/ChooseIntegration.js +30 -10
  14. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  15. package/dist/lib/Steps/Integrations/Apple.d.ts +10 -0
  16. package/dist/lib/Steps/Integrations/Apple.js +92 -0
  17. package/dist/lib/Steps/Integrations/Apple.js.map +1 -0
  18. package/dist/lib/Steps/Integrations/{NextJs.d.ts → NextJsShim.d.ts} +1 -1
  19. package/dist/lib/Steps/Integrations/{NextJs.js → NextJsShim.js} +14 -10
  20. package/dist/lib/Steps/Integrations/NextJsShim.js.map +1 -0
  21. package/dist/lib/Steps/Integrations/SourceMapsShim.js +5 -1
  22. package/dist/lib/Steps/Integrations/SourceMapsShim.js.map +1 -1
  23. package/dist/lib/Steps/Integrations/{SvelteKit.d.ts → SvelteKitShim.d.ts} +1 -1
  24. package/dist/lib/Steps/Integrations/{SvelteKit.js → SvelteKitShim.js} +14 -10
  25. package/dist/lib/Steps/Integrations/SvelteKitShim.js.map +1 -0
  26. package/dist/package.json +4 -4
  27. package/dist/src/apple/apple-wizard.d.ts +2 -0
  28. package/dist/src/apple/apple-wizard.js +197 -0
  29. package/dist/src/apple/apple-wizard.js.map +1 -0
  30. package/dist/src/apple/code-tools.d.ts +1 -0
  31. package/dist/src/apple/code-tools.js +100 -0
  32. package/dist/src/apple/code-tools.js.map +1 -0
  33. package/dist/src/apple/templates.d.ts +4 -0
  34. package/dist/src/apple/templates.js +19 -0
  35. package/dist/src/apple/templates.js.map +1 -0
  36. package/dist/src/apple/xcode-manager.d.ts +4 -0
  37. package/dist/src/apple/xcode-manager.js +145 -0
  38. package/dist/src/apple/xcode-manager.js.map +1 -0
  39. package/dist/src/nextjs/nextjs-wizard.d.ts +2 -5
  40. package/dist/src/nextjs/nextjs-wizard.js +1 -1
  41. package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
  42. package/dist/src/sourcemaps/sourcemaps-wizard.d.ts +2 -5
  43. package/dist/src/sourcemaps/sourcemaps-wizard.js +154 -67
  44. package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
  45. package/dist/src/sourcemaps/tools/angular.d.ts +1 -0
  46. package/dist/src/sourcemaps/tools/angular.js +76 -0
  47. package/dist/src/sourcemaps/tools/angular.js.map +1 -0
  48. package/dist/src/sourcemaps/tools/create-react-app.d.ts +1 -0
  49. package/dist/src/sourcemaps/tools/create-react-app.js +69 -0
  50. package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -0
  51. package/dist/src/sourcemaps/tools/esbuild.js +2 -1
  52. package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
  53. package/dist/src/sourcemaps/tools/rollup.js +2 -1
  54. package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
  55. package/dist/src/sourcemaps/tools/sentry-cli.js +7 -1
  56. package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
  57. package/dist/src/sourcemaps/tools/vite.js +2 -1
  58. package/dist/src/sourcemaps/tools/vite.js.map +1 -1
  59. package/dist/src/sourcemaps/tools/webpack.js +2 -1
  60. package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
  61. package/dist/src/sourcemaps/utils/detect-tool.d.ts +3 -0
  62. package/dist/src/sourcemaps/utils/detect-tool.js +73 -0
  63. package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -0
  64. package/dist/src/sourcemaps/utils/other-wizards.d.ts +4 -0
  65. package/dist/src/sourcemaps/utils/other-wizards.js +183 -0
  66. package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -0
  67. package/dist/src/sourcemaps/utils/sdk-version.d.ts +14 -0
  68. package/dist/src/sourcemaps/utils/sdk-version.js +276 -0
  69. package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -0
  70. package/dist/src/sveltekit/sveltekit-wizard.d.ts +2 -5
  71. package/dist/src/sveltekit/sveltekit-wizard.js +3 -2
  72. package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
  73. package/dist/src/telemetry.d.ts +1 -0
  74. package/dist/src/telemetry.js +7 -1
  75. package/dist/src/telemetry.js.map +1 -1
  76. package/dist/src/utils/bash.d.ts +3 -0
  77. package/dist/src/utils/bash.js +118 -0
  78. package/dist/src/utils/bash.js.map +1 -0
  79. package/dist/src/utils/clack-utils.d.ts +21 -9
  80. package/dist/src/utils/clack-utils.js +122 -56
  81. package/dist/src/utils/clack-utils.js.map +1 -1
  82. package/dist/src/utils/package-json.d.ts +19 -0
  83. package/dist/src/utils/package-json.js +29 -0
  84. package/dist/src/utils/package-json.js.map +1 -0
  85. package/dist/src/utils/types.d.ts +16 -0
  86. package/dist/src/utils/types.js +3 -0
  87. package/dist/src/utils/types.js.map +1 -0
  88. package/lib/Constants.ts +6 -0
  89. package/lib/Helper/Wizard.ts +3 -9
  90. package/lib/Helper/__tests__/SentryCli.ts +2 -1
  91. package/lib/Setup.ts +1 -0
  92. package/lib/Steps/ChooseIntegration.ts +39 -11
  93. package/lib/Steps/Integrations/Apple.ts +27 -0
  94. package/lib/Steps/Integrations/{NextJs.ts → NextJsShim.ts} +6 -2
  95. package/lib/Steps/Integrations/SourceMapsShim.ts +5 -1
  96. package/lib/Steps/Integrations/{SvelteKit.ts → SvelteKitShim.ts} +6 -2
  97. package/package-lock.json +8910 -0
  98. package/package.json +4 -4
  99. package/src/apple/apple-wizard.ts +150 -0
  100. package/src/apple/code-tools.ts +81 -0
  101. package/src/apple/templates.ts +39 -0
  102. package/src/apple/xcode-manager.ts +147 -0
  103. package/src/nextjs/nextjs-wizard.ts +3 -8
  104. package/src/sourcemaps/sourcemaps-wizard.ts +166 -91
  105. package/src/sourcemaps/tools/angular.ts +42 -0
  106. package/src/sourcemaps/tools/create-react-app.ts +19 -0
  107. package/src/sourcemaps/tools/esbuild.ts +1 -1
  108. package/src/sourcemaps/tools/rollup.ts +2 -4
  109. package/src/sourcemaps/tools/sentry-cli.ts +6 -1
  110. package/src/sourcemaps/tools/vite.ts +1 -1
  111. package/src/sourcemaps/tools/webpack.ts +1 -1
  112. package/src/sourcemaps/utils/detect-tool.ts +41 -0
  113. package/src/sourcemaps/utils/other-wizards.ts +148 -0
  114. package/src/sourcemaps/utils/sdk-version.ts +257 -0
  115. package/src/sveltekit/sveltekit-wizard.ts +4 -7
  116. package/src/telemetry.ts +8 -0
  117. package/src/utils/bash.ts +44 -0
  118. package/src/utils/clack-utils.ts +100 -51
  119. package/src/utils/package-json.ts +45 -0
  120. package/src/utils/types.ts +18 -0
  121. package/dist/lib/Steps/Integrations/NextJs.js.map +0 -1
  122. package/dist/lib/Steps/Integrations/SvelteKit.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.6.0
4
+
5
+ - feat(apple): Add support for iOS (#334)
6
+ - feat(sourcemaps): Add CLI-based flow for Angular (#349)
7
+ - feat(sourcemaps): Detect SvelteKit and NextJS projects and redirect to dedicated wizards (#341)
8
+ - feat(sourcemaps): Pre-select auto-detected build tool option (#354)
9
+ - ref(sourcemaps): Improve Outro message (#344)
10
+
11
+ ## 3.5.0
12
+
13
+ - feat(sourcemaps): Check if correct SDK version is installed (#336)
14
+ - feat: Open browser when logging in (sourcemaps, sveltekit, nextjs) (#328)
15
+ - feat(sourcmaps): Add create-react-app option (#335)
16
+ - fix: Support `--url` arg in NextJs, SvelteKit and Sourcemaps wizards (#331)
17
+ - fix: Update minimum Node version to Node 14 (#332)
18
+
3
19
  ## 3.4.0
4
20
 
5
21
  - feat(sourcemaps): Add setup flow for esbuild (#327)
@@ -67,6 +83,10 @@ fix(sveltekit): Bump magicast to handle satisfies keyword (#279)
67
83
 
68
84
  ## 3.0.0
69
85
 
86
+ ### Node Version Compatibility
87
+
88
+ - The minimum Node version for the wizard is now Node 14.
89
+
70
90
  ### Various fixes & improvements
71
91
 
72
92
  - build: Update a bunch of dev dependencies (#248) by @lforst
package/bin.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { DEFAULT_URL, Integration, Platform } from './lib/Constants';
2
+ import { Integration, Platform } from './lib/Constants';
3
3
  import { run } from './lib/Setup';
4
4
  import { runNextjsWizard } from './src/nextjs/nextjs-wizard';
5
5
  import { runSourcemapsWizard } from './src/sourcemaps/sourcemaps-wizard';
6
6
  import { runSvelteKitWizard } from './src/sveltekit/sveltekit-wizard';
7
- import { withTelemetry } from './src/telemetry';
7
+ import { runAppleWizard } from './src/apple/apple-wizard';
8
+ import { WizardOptions } from './src/utils/types';
8
9
  export * from './lib/Setup';
9
10
 
10
11
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
@@ -44,7 +45,6 @@ const argv = require('yargs')
44
45
  })
45
46
  .option('u', {
46
47
  alias: 'url',
47
- default: DEFAULT_URL,
48
48
  describe: 'The url to your Sentry installation\nenv: SENTRY_WIZARD_URL',
49
49
  })
50
50
  .option('s', {
@@ -63,22 +63,31 @@ const argv = require('yargs')
63
63
  describe: 'A promo code that will be applied during signup',
64
64
  }).argv;
65
65
 
66
- if (argv.i === 'nextjs') {
67
- // eslint-disable-next-line no-console
68
- runNextjsWizard({ promoCode: argv['promo-code'] }).catch(console.error);
69
- } else if (argv.i === 'sveltekit') {
70
- // eslint-disable-next-line no-console
71
- runSvelteKitWizard({ promoCode: argv['promo-code'] }).catch(console.error);
72
- } else if (argv.i === 'sourcemaps') {
73
- withTelemetry(
74
- {
75
- enabled: !argv['disable-telemetry'],
76
- integration: 'sourcemaps',
77
- },
78
- () => runSourcemapsWizard({ promoCode: argv['promo-code'] }),
66
+ // Collect argv options that are relevant for the new wizard
67
+ // flows based on `clack`
68
+ const wizardOptions: WizardOptions = {
69
+ url: argv.url as string | undefined,
70
+ promoCode: argv['promo-code'] as string | undefined,
71
+ telemetryEnabled: !argv['disable-telemetry'],
72
+ };
73
+
74
+ switch (argv.i) {
75
+ case 'nextjs':
76
+ // eslint-disable-next-line no-console
77
+ runNextjsWizard(wizardOptions).catch(console.error);
78
+ break;
79
+ case 'sveltekit':
80
+ // eslint-disable-next-line no-console
81
+ runSvelteKitWizard(wizardOptions).catch(console.error);
82
+ break;
83
+ case 'sourcemaps':
84
+ // eslint-disable-next-line no-console
85
+ runSourcemapsWizard(wizardOptions).catch(console.error);
86
+ break;
87
+ case 'ios':
79
88
  // eslint-disable-next-line no-console
80
- ).catch(console.error);
81
- } else {
82
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
83
- run(argv);
89
+ runAppleWizard(wizardOptions).catch(console.error);
90
+ break;
91
+ default:
92
+ void run(argv);
84
93
  }
package/dist/bin.js CHANGED
@@ -20,7 +20,7 @@ var Setup_1 = require("./lib/Setup");
20
20
  var nextjs_wizard_1 = require("./src/nextjs/nextjs-wizard");
21
21
  var sourcemaps_wizard_1 = require("./src/sourcemaps/sourcemaps-wizard");
22
22
  var sveltekit_wizard_1 = require("./src/sveltekit/sveltekit-wizard");
23
- var telemetry_1 = require("./src/telemetry");
23
+ var apple_wizard_1 = require("./src/apple/apple-wizard");
24
24
  __exportStar(require("./lib/Setup"), exports);
25
25
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
26
26
  var argv = require('yargs')
@@ -57,7 +57,6 @@ var argv = require('yargs')
57
57
  })
58
58
  .option('u', {
59
59
  alias: 'url',
60
- default: Constants_1.DEFAULT_URL,
61
60
  describe: 'The url to your Sentry installation\nenv: SENTRY_WIZARD_URL',
62
61
  })
63
62
  .option('s', {
@@ -75,22 +74,31 @@ var argv = require('yargs')
75
74
  alias: 'promo-code',
76
75
  describe: 'A promo code that will be applied during signup',
77
76
  }).argv;
78
- if (argv.i === 'nextjs') {
79
- // eslint-disable-next-line no-console
80
- (0, nextjs_wizard_1.runNextjsWizard)({ promoCode: argv['promo-code'] }).catch(console.error);
81
- }
82
- else if (argv.i === 'sveltekit') {
83
- // eslint-disable-next-line no-console
84
- (0, sveltekit_wizard_1.runSvelteKitWizard)({ promoCode: argv['promo-code'] }).catch(console.error);
85
- }
86
- else if (argv.i === 'sourcemaps') {
87
- (0, telemetry_1.withTelemetry)({
88
- enabled: !argv['disable-telemetry'],
89
- integration: 'sourcemaps',
90
- }, function () { return (0, sourcemaps_wizard_1.runSourcemapsWizard)({ promoCode: argv['promo-code'] }); }).catch(console.error);
91
- }
92
- else {
93
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
94
- (0, Setup_1.run)(argv);
77
+ // Collect argv options that are relevant for the new wizard
78
+ // flows based on `clack`
79
+ var wizardOptions = {
80
+ url: argv.url,
81
+ promoCode: argv['promo-code'],
82
+ telemetryEnabled: !argv['disable-telemetry'],
83
+ };
84
+ switch (argv.i) {
85
+ case 'nextjs':
86
+ // eslint-disable-next-line no-console
87
+ (0, nextjs_wizard_1.runNextjsWizard)(wizardOptions).catch(console.error);
88
+ break;
89
+ case 'sveltekit':
90
+ // eslint-disable-next-line no-console
91
+ (0, sveltekit_wizard_1.runSvelteKitWizard)(wizardOptions).catch(console.error);
92
+ break;
93
+ case 'sourcemaps':
94
+ // eslint-disable-next-line no-console
95
+ (0, sourcemaps_wizard_1.runSourcemapsWizard)(wizardOptions).catch(console.error);
96
+ break;
97
+ case 'ios':
98
+ // eslint-disable-next-line no-console
99
+ (0, apple_wizard_1.runAppleWizard)(wizardOptions).catch(console.error);
100
+ break;
101
+ default:
102
+ void (0, Setup_1.run)(argv);
95
103
  }
96
104
  //# 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,6CAAqE;AACrE,qCAAkC;AAClC,4DAA6D;AAC7D,wEAAyE;AACzE,qEAAsE;AACtE,6CAAgD;AAChD,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;I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/bin/env node\nimport { DEFAULT_URL, Integration, Platform } from './lib/Constants';\nimport { run } from './lib/Setup';\nimport { runNextjsWizard } from './src/nextjs/nextjs-wizard';\nimport { runSourcemapsWizard } from './src/sourcemaps/sourcemaps-wizard';\nimport { runSvelteKitWizard } from './src/sveltekit/sveltekit-wizard';\nimport { withTelemetry } from './src/telemetry';\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 default: DEFAULT_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\nif (argv.i === 'nextjs') {\n // eslint-disable-next-line no-console\n runNextjsWizard({ promoCode: argv['promo-code'] }).catch(console.error);\n} else if (argv.i === 'sveltekit') {\n // eslint-disable-next-line no-console\n runSvelteKitWizard({ promoCode: argv['promo-code'] }).catch(console.error);\n} else if (argv.i === 'sourcemaps') {\n withTelemetry(\n {\n enabled: !argv['disable-telemetry'],\n integration: 'sourcemaps',\n },\n () => runSourcemapsWizard({ promoCode: argv['promo-code'] }),\n // eslint-disable-next-line no-console\n ).catch(console.error);\n} else {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n run(argv);\n}\n"]}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../bin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,6CAAwD;AACxD,qCAAkC;AAClC,4DAA6D;AAC7D,wEAAyE;AACzE,qEAAsE;AACtE,yDAA0D;AAE1D,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;IAC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AsC;QACtC,IAAA,6BAAc,EAAC,aAAa,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACnD,MAAM;IACR;QACE,KAAK,IAAA,WAAG,EAAC,IAAI,CAAC,CAAC;CAClB","sourcesContent":["#!/usr/bin/env node\nimport { Integration, Platform } from './lib/Constants';\nimport { run } from './lib/Setup';\nimport { runNextjsWizard } from './src/nextjs/nextjs-wizard';\nimport { runSourcemapsWizard } from './src/sourcemaps/sourcemaps-wizard';\nimport { runSvelteKitWizard } from './src/sveltekit/sveltekit-wizard';\nimport { runAppleWizard } from './src/apple/apple-wizard';\nimport { WizardOptions } from './src/utils/types';\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\n// Collect argv options that are relevant for the new wizard\n// flows based on `clack`\nconst wizardOptions: WizardOptions = {\n url: argv.url as string | undefined,\n promoCode: argv['promo-code'] as string | undefined,\n telemetryEnabled: !argv['disable-telemetry'],\n};\n\nswitch (argv.i) {\n case 'nextjs':\n // eslint-disable-next-line no-console\n runNextjsWizard(wizardOptions).catch(console.error);\n break;\n case 'sveltekit':\n // eslint-disable-next-line no-console\n runSvelteKitWizard(wizardOptions).catch(console.error);\n break;\n case 'sourcemaps':\n // eslint-disable-next-line no-console\n runSourcemapsWizard(wizardOptions).catch(console.error);\n break;\n case 'ios':\n // eslint-disable-next-line no-console\n runAppleWizard(wizardOptions).catch(console.error);\n break;\n default:\n void run(argv);\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  /** Key value should be the same here */
2
2
  export declare enum Integration {
3
3
  reactNative = "reactNative",
4
+ ios = "ios",
4
5
  cordova = "cordova",
5
6
  electron = "electron",
6
7
  nextjs = "nextjs",
@@ -31,6 +32,7 @@ export interface Args {
31
32
  quiet: boolean;
32
33
  signup: boolean;
33
34
  promoCode?: string;
35
+ disableTelemetry?: boolean;
34
36
  }
35
37
  export declare const DEFAULT_URL = "https://sentry.io/";
36
38
  export {};
@@ -5,6 +5,7 @@ exports.DEFAULT_URL = exports.getIntegrationChoices = exports.mapIntegrationToPl
5
5
  var Integration;
6
6
  (function (Integration) {
7
7
  Integration["reactNative"] = "reactNative";
8
+ Integration["ios"] = "ios";
8
9
  Integration["cordova"] = "cordova";
9
10
  Integration["electron"] = "electron";
10
11
  Integration["nextjs"] = "nextjs";
@@ -48,6 +49,8 @@ function getIntegrationDescription(type) {
48
49
  return 'SvelteKit';
49
50
  case Integration.sourcemaps:
50
51
  return 'Configure Source Maps Upload';
52
+ case Integration.ios:
53
+ return 'iOS';
51
54
  default:
52
55
  return 'React Native';
53
56
  }
@@ -67,6 +70,8 @@ function mapIntegrationToPlatform(type) {
67
70
  return 'javascript-sveltekit';
68
71
  case Integration.sourcemaps:
69
72
  return undefined;
73
+ case Integration.ios:
74
+ return 'iOS';
70
75
  default:
71
76
  throw new Error("Unknown integration ".concat(type));
72
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../lib/Constants.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;IACjB,sCAAuB,CAAA;IACvB,wCAAyB,CAAA;AAC3B,CAAC,EAPW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAOtB;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,KAAK,WAAW,CAAC,SAAS;YACxB,OAAO,WAAW,CAAC;QACrB,KAAK,WAAW,CAAC,UAAU;YACzB,OAAO,8BAA8B,CAAC;QACxC;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC;AAjBD,8DAiBC;AAED,SAAgB,wBAAwB,CAAC,IAAY;IACnD,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,qBAAqB,CAAC;QAC/B,KAAK,WAAW,CAAC,MAAM;YACrB,OAAO,mBAAmB,CAAC;QAC7B,KAAK,WAAW,CAAC,SAAS;YACxB,OAAO,sBAAsB,CAAC;QAChC,KAAK,WAAW,CAAC,UAAU;YACzB,OAAO,SAAS,CAAC;QACnB;YACE,MAAM,IAAI,KAAK,CAAC,8BAAuB,IAAI,CAAE,CAAC,CAAC;KAClD;AACH,CAAC;AAjBD,4DAiBC;AAOD,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;AAcY,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 sveltekit = 'sveltekit',\n sourcemaps = 'sourcemaps',\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 case Integration.sveltekit:\n return 'SvelteKit';\n case Integration.sourcemaps:\n return 'Configure Source Maps Upload';\n default:\n return 'React Native';\n }\n}\n\nexport function mapIntegrationToPlatform(type: string): string | undefined {\n switch (type) {\n case Integration.reactNative:\n return 'react-native';\n case Integration.cordova:\n return 'cordova';\n case Integration.electron:\n return 'javascript-electron';\n case Integration.nextjs:\n return 'javascript-nextjs';\n case Integration.sveltekit:\n return 'javascript-sveltekit';\n case Integration.sourcemaps:\n return undefined;\n default:\n throw new Error(`Unknown integration ${type}`);\n }\n}\n\ntype IntegrationChoice = {\n name: string;\n value: string;\n};\n\nexport function getIntegrationChoices(): IntegrationChoice[] {\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 signup: boolean;\n promoCode?: string;\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,WAQX;AARD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,0BAAW,CAAA;IACX,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,gC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,IAAY;IACnD,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,qBAAqB,CAAC;QAC/B,KAAK,WAAW,CAAC,MAAM;YACrB,OAAO,mBAAmB,CAAC;QAC7B,KAAK,WAAW,CAAC,SAAS;YACxB,OAAO,sBAAsB,CAAC;QAChC,KAAK,WAAW,CAAC,UAAU;YACzB,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW,CAAC,GAAG;YAClB,OAAO,KAAK,CAAC;QACf;YACE,MAAM,IAAI,KAAK,CAAC,8BAAuB,IAAI,CAAE,CAAC,CAAC;KAClD;AACH,CAAC;AAnBD,4DAmBC;AAOD,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;AAeY,QAAA,WAAW,GAAG,oBAAoB,CAAC","sourcesContent":["/** Key value should be the same here */\nexport enum Integration {\n reactNative = 'reactNative',\n ios = 'ios',\n cordova = 'cordova',\n electron = 'electron',\n nextjs = 'nextjs',\n sveltekit = 'sveltekit',\n sourcemaps = 'sourcemaps',\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 case Integration.sveltekit:\n return 'SvelteKit';\n case Integration.sourcemaps:\n return 'Configure Source Maps Upload';\n case Integration.ios:\n return 'iOS';\n default:\n return 'React Native';\n }\n}\n\nexport function mapIntegrationToPlatform(type: string): string | undefined {\n switch (type) {\n case Integration.reactNative:\n return 'react-native';\n case Integration.cordova:\n return 'cordova';\n case Integration.electron:\n return 'javascript-electron';\n case Integration.nextjs:\n return 'javascript-nextjs';\n case Integration.sveltekit:\n return 'javascript-sveltekit';\n case Integration.sourcemaps:\n return undefined;\n case Integration.ios:\n return 'iOS';\n default:\n throw new Error(`Unknown integration ${type}`);\n }\n}\n\ntype IntegrationChoice = {\n name: string;\n value: string;\n};\n\nexport function getIntegrationChoices(): IntegrationChoice[] {\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 signup: boolean;\n promoCode?: string;\n disableTelemetry?: boolean;\n}\n\nexport const DEFAULT_URL = 'https://sentry.io/';\n"]}
@@ -72,22 +72,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
72
72
  Object.defineProperty(exports, "__esModule", { value: true });
73
73
  exports.startWizard = exports.getCurrentIntegration = void 0;
74
74
  var _ = __importStar(require("lodash"));
75
- var Constants_1 = require("../Constants");
76
75
  var BottomBar_1 = require("./BottomBar");
77
76
  var Logging_1 = require("./Logging");
78
77
  function sanitizeAndValidateArgs(argv) {
79
- if (!argv.url) {
80
- argv.url = Constants_1.DEFAULT_URL;
81
- (0, Logging_1.dim)("no URL provided, fallback to ".concat(argv.url));
82
- }
83
78
  if (argv.quiet === undefined) {
84
79
  argv.quiet = true;
85
80
  (0, Logging_1.dim)('will activate quiet mode for you');
86
81
  }
87
- var baseUrl = argv.url;
88
- baseUrl += baseUrl.endsWith('/') ? '' : '/';
89
- baseUrl = baseUrl.replace(/:\/(?!\/)/g, '://');
90
- argv.url = baseUrl;
91
82
  // @ts-ignore skip-connect does not exist on args
92
83
  if (argv['skip-connect']) {
93
84
  // @ts-ignore skip-connect does not exist on args
@@ -97,6 +88,8 @@ function sanitizeAndValidateArgs(argv) {
97
88
  }
98
89
  // @ts-ignore skip-connect does not exist on args
99
90
  argv.promoCode = argv['promo-code'];
91
+ // @ts-ignore skip-connect does not exist on args
92
+ argv.disableTelemetry = argv['disable-telemetry'] != undefined;
100
93
  }
101
94
  function getCurrentIntegration(answers) {
102
95
  return _.get(answers, 'integration');
@@ -1 +1 @@
1
- {"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../lib/Helper/Wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAA4B;AAG5B,0CAA2C;AAG3C,yCAAwC;AACxC,qCAAgD;AAEhD,SAAS,uBAAuB,CAAC,IAAU;IACzC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,aAAG,EAAC,uCAAgC,IAAI,CAAC,GAAG,CAAE,CAAC,CAAC;KACjD;IACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAA,aAAG,EAAC,kCAAkC,CAAC,CAAC;KACzC;IACD,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,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C,IAAI,EAAE,CAAC;oBACjB,IAAA,YAAE,GAAE,CAAC;oBACL,IAAA,aAAG,EAAC,4BAA4B,CAAC,CAAC;oBAClC,IAAA,aAAG,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,GAAC,CAAC,OAAO,CAAC,CAAC;oBAChC,IAAA,YAAE,GAAE,CAAC;oBACL,IAAA,aAAG,EAAC,2CAA2C,CAAC,CAAC;oBACjD,IAAA,aAAG,EAAC,mCAAmC,CAAC,CAAC;oBACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;;;;;;CAEnB;AA7BD,kCA6BC","sourcesContent":["import type { Answers } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport type { Args } from '../Constants';\nimport { DEFAULT_URL } from '../Constants';\nimport type { IStep } from '../Steps/BaseStep';\nimport type { BaseIntegration } from '../Steps/Integrations/BaseIntegration';\nimport { BottomBar } from './BottomBar';\nimport { debug, dim, nl, red } from './Logging';\n\nfunction sanitizeAndValidateArgs(argv: Args): void {\n if (!argv.url) {\n argv.url = DEFAULT_URL;\n dim(`no URL provided, fallback to ${argv.url}`);\n }\n if (argv.quiet === undefined) {\n argv.quiet = true;\n dim('will activate quiet mode for you');\n }\n let baseUrl = argv.url;\n baseUrl += baseUrl.endsWith('/') ? '' : '/';\n baseUrl = baseUrl.replace(/:\\/(?!\\/)/g, '://');\n argv.url = baseUrl;\n // @ts-ignore skip-connect does not exist on args\n if (argv['skip-connect']) {\n // @ts-ignore skip-connect does not exist on args\n argv.skipConnect = argv['skip-connect'];\n // @ts-ignore skip-connect does not exist on args\n delete argv['skip-connect'];\n }\n // @ts-ignore skip-connect does not exist on args\n argv.promoCode = argv['promo-code'];\n}\n\nexport function getCurrentIntegration(answers: Answers): BaseIntegration {\n return _.get(answers, 'integration') as BaseIntegration;\n}\n\nexport async function startWizard<M extends IStep>(\n argv: Args,\n ...steps: Array<{ new (debug: Args): M }>\n): Promise<Answers> {\n try {\n sanitizeAndValidateArgs(argv);\n if (argv.debug) {\n debug(argv);\n }\n if (argv.quiet) {\n dim(\"Quiet mode On, DAMA, don't ask me anything\");\n }\n return await steps\n .map((step) => new step(argv))\n .reduce(async (answer, step) => {\n const prevAnswer = await answer;\n const answers = await step.emit(prevAnswer);\n return { ...prevAnswer, ...answers };\n }, Promise.resolve({}));\n } catch (e) {\n BottomBar.hide();\n nl();\n red('Sentry Wizard failed with:');\n red(argv.debug ? e : e.message);\n nl();\n red('Protip: Add --debug to see whats going on');\n red('OR use --help to see your options');\n process.exit(1);\n }\n}\n"]}
1
+ {"version":3,"file":"Wizard.js","sourceRoot":"","sources":["../../../lib/Helper/Wizard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAA4B;AAK5B,yCAAwC;AACxC,qCAAgD;AAEhD,SAAS,uBAAuB,CAAC,IAAU;IACzC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;QAC5B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAA,aAAG,EAAC,kCAAkC,CAAC,CAAC;KACzC;IACD,iDAAiD;IACjD,IAAI,IAAI,CAAC,cAAc,CAAC,EAAE;QACxB,iDAAiD;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,CAAC;QACxC,iDAAiD;QACjD,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC;KAC7B;IACD,iDAAiD;IACjD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IAEpC,iDAAiD;IACjD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,SAAS,CAAC;AACjE,CAAC;AAED,SAAgB,qBAAqB,CAAC,OAAgB;IACpD,OAAO,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAoB,CAAC;AAC1D,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';\nimport * as _ from 'lodash';\n\nimport type { Args } from '../Constants';\nimport type { IStep } from '../Steps/BaseStep';\nimport type { BaseIntegration } from '../Steps/Integrations/BaseIntegration';\nimport { BottomBar } from './BottomBar';\nimport { debug, dim, nl, red } from './Logging';\n\nfunction sanitizeAndValidateArgs(argv: Args): void {\n if (argv.quiet === undefined) {\n argv.quiet = true;\n dim('will activate quiet mode for you');\n }\n // @ts-ignore skip-connect does not exist on args\n if (argv['skip-connect']) {\n // @ts-ignore skip-connect does not exist on args\n argv.skipConnect = argv['skip-connect'];\n // @ts-ignore skip-connect does not exist on args\n delete argv['skip-connect'];\n }\n // @ts-ignore skip-connect does not exist on args\n argv.promoCode = argv['promo-code'];\n\n // @ts-ignore skip-connect does not exist on args\n argv.disableTelemetry = argv['disable-telemetry'] != undefined;\n}\n\nexport function getCurrentIntegration(answers: Answers): BaseIntegration {\n return _.get(answers, 'integration') as BaseIntegration;\n}\n\nexport async function startWizard<M extends IStep>(\n argv: Args,\n ...steps: Array<{ new (debug: Args): M }>\n): Promise<Answers> {\n try {\n sanitizeAndValidateArgs(argv);\n if (argv.debug) {\n debug(argv);\n }\n if (argv.quiet) {\n dim(\"Quiet mode On, DAMA, don't ask me anything\");\n }\n return await steps\n .map((step) => new step(argv))\n .reduce(async (answer, step) => {\n const prevAnswer = await answer;\n const answers = await step.emit(prevAnswer);\n return { ...prevAnswer, ...answers };\n }, Promise.resolve({}));\n } catch (e) {\n BottomBar.hide();\n nl();\n red('Sentry Wizard failed with:');\n red(argv.debug ? e : e.message);\n nl();\n red('Protip: Add --debug to see whats going on');\n red('OR use --help to see your options');\n process.exit(1);\n }\n}\n"]}
@@ -11,6 +11,7 @@ var args = {
11
11
  uninstall: false,
12
12
  url: 'https://localhost:1234',
13
13
  signup: false,
14
+ disableTelemetry: false,
14
15
  };
15
16
  var demoAnswers = {
16
17
  config: {
@@ -1 +1 @@
1
- {"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../../lib/Helper/__tests__/S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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 type { Answers } from 'inquirer';\n\nimport type { Args} from '../../Constants';\nimport { 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 signup: false,\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":";;AAIA,6CAAwD;AACxD,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;IAC7B,MAAM,EAAE,KAAK;IACb,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF,IAAM,WAAW,GAAY;IAC3B,MAA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,cAAc,CAAC,KAAK,CAAC,CAAC;aACjC,IAAI,CAAC,yJAKX,CAAC,CAAC;IACD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/// <reference types=\"jest\" />\nimport type { Answers } from 'inquirer';\n\nimport type { Args } from '../../Constants';\nimport { 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 signup: false,\n disableTelemetry: false,\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 +1 @@
1
- {"version":3,"file":"Setup.js","sourceRoot":"","sources":["../../lib/Setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAA4B;AAE5B,oCAA+C;AAC/C,0CAA8C;AAC9C,4CAAgC;AAEhC,SAAsB,GAAG,CAAC,IAAS;;;;YAC3B,IAAI,yBAAQ,IAAI,GAAK,IAAA,qBAAe,GAAE,CAAE,CAAC;YAC/C,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;AAtBD,kBAsBC","sourcesContent":["import * as _ from 'lodash';\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 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;AAE5B,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,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;AAvBD,kBAuBC","sourcesContent":["import * as _ from 'lodash';\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 (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"]}
@@ -77,14 +77,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
77
77
  exports.ChooseIntegration = void 0;
78
78
  var inquirer_1 = require("inquirer");
79
79
  var _ = __importStar(require("lodash"));
80
+ var picocolors_1 = require("picocolors");
80
81
  var Constants_1 = require("../Constants");
81
82
  var BaseStep_1 = require("./BaseStep");
82
83
  var Cordova_1 = require("./Integrations/Cordova");
83
84
  var Electron_1 = require("./Integrations/Electron");
84
- var NextJs_1 = require("./Integrations/NextJs");
85
+ var NextJsShim_1 = require("./Integrations/NextJsShim");
85
86
  var ReactNative_1 = require("./Integrations/ReactNative");
86
87
  var SourceMapsShim_1 = require("./Integrations/SourceMapsShim");
87
- var SvelteKit_1 = require("./Integrations/SvelteKit");
88
+ var Apple_1 = require("./Integrations/Apple");
89
+ var SvelteKitShim_1 = require("./Integrations/SvelteKitShim");
88
90
  var projectPackage = {};
89
91
  try {
90
92
  // If we run directly in setup-wizard
@@ -108,26 +110,27 @@ var ChooseIntegration = /** @class */ (function (_super) {
108
110
  integrationPrompt = _a.sent();
109
111
  integration = null;
110
112
  switch (integrationPrompt.integration) {
111
- case Constants_1.Integration.reactNative:
112
- integration = new ReactNative_1.ReactNative(this._argv);
113
- break;
114
113
  case Constants_1.Integration.cordova:
115
- integration = new Cordova_1.Cordova(this._argv);
114
+ integration = new Cordova_1.Cordova(sanitizeUrl(this._argv));
116
115
  break;
117
116
  case Constants_1.Integration.electron:
118
- integration = new Electron_1.Electron(this._argv);
117
+ integration = new Electron_1.Electron(sanitizeUrl(this._argv));
119
118
  break;
120
119
  case Constants_1.Integration.nextjs:
121
- integration = new NextJs_1.NextJs(this._argv);
120
+ integration = new NextJsShim_1.NextJsShim(this._argv);
122
121
  break;
123
122
  case Constants_1.Integration.sveltekit:
124
- integration = new SvelteKit_1.SvelteKit(this._argv);
123
+ integration = new SvelteKitShim_1.SvelteKitShim(this._argv);
125
124
  break;
126
125
  case Constants_1.Integration.sourcemaps:
127
126
  integration = new SourceMapsShim_1.SourceMapsShim(this._argv);
128
127
  break;
128
+ case Constants_1.Integration.ios:
129
+ integration = new Apple_1.Apple(this._argv);
130
+ break;
131
+ case Constants_1.Integration.reactNative:
129
132
  default:
130
- integration = new ReactNative_1.ReactNative(this._argv);
133
+ integration = new ReactNative_1.ReactNative(sanitizeUrl(this._argv));
131
134
  break;
132
135
  }
133
136
  return [2 /*return*/, { integration: integration }];
@@ -174,4 +177,21 @@ var ChooseIntegration = /** @class */ (function (_super) {
174
177
  return ChooseIntegration;
175
178
  }(BaseStep_1.BaseStep));
176
179
  exports.ChooseIntegration = ChooseIntegration;
180
+ /**
181
+ * For the `clack`-based wizard flows, which we only shim here, we don't set
182
+ * a default url value. For backwards-compatibility with the other flows,
183
+ * we fill it here and sanitize a user-enterd url.
184
+ */
185
+ function sanitizeUrl(argv) {
186
+ if (!argv.url) {
187
+ argv.url = Constants_1.DEFAULT_URL;
188
+ (0, picocolors_1.dim)("no URL provided, fallback to ".concat(argv.url));
189
+ return argv;
190
+ }
191
+ var baseUrl = argv.url;
192
+ baseUrl += baseUrl.endsWith('/') ? '' : '/';
193
+ baseUrl = baseUrl.replace(/:\/(?!\/)/g, '://');
194
+ argv.url = baseUrl;
195
+ return argv;
196
+ }
177
197
  //# sourceMappingURL=ChooseIntegration.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAClC,wCAA4B;AAE5B,0CAAkE;AAClE,uCAAsC;AACtC,kDAAiD;AACjD,oDAAmD;AACnD,gDAA+C;AAC/C,0DAAyD;AACzD,gEAA+D;AAC/D,sDAAqD;AAErD,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;;IAgEA,CAAC;IA/Dc,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,WAAW;gCAC1B,WAAW,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gCAC1C,MAAM;4BACR,KAAK,uBA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CAAC,CAAC;qBACrD;oBAEK,wBAAwB,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;oBAEhE,sBAAO,IAAA,iBAAM,EAAC;4BACZ;gCACE,OAAO,EAAE,IAAA,iCAAqB,GAAE;gCAChC,OAAO,EAAE,wBAAwB;gCACjC,OAAO,EAAE,yCAAyC;gCAClD,IAAI,EAAE,aAAa;gCACnB,IAAI,EAAE,MAAM;6BACb;yBACF,CAAC,EAAC;iBACJ;;;;KACF;IACH,wBAAC;AAAD,CAAC,AAhED,CAAuC,mBAAQ,GAgE9C;AAhEY,8CAAiB","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport { getIntegrationChoices, Integration } from '../Constants';\nimport { BaseStep } from './BaseStep';\nimport { Cordova } from './Integrations/Cordova';\nimport { Electron } from './Integrations/Electron';\nimport { NextJs } from './Integrations/NextJs';\nimport { ReactNative } from './Integrations/ReactNative';\nimport { SourceMapsShim } from './Integrations/SourceMapsShim';\nimport { SvelteKit } from './Integrations/SvelteKit';\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.reactNative:\n integration = new ReactNative(this._argv);\n break;\n case Integration.cordova:\n integration = new Cordova(this._argv);\n break;\n case Integration.electron:\n integration = new Electron(this._argv);\n break;\n case Integration.nextjs:\n integration = new NextJs(this._argv);\n break;\n case Integration.sveltekit:\n integration = new SvelteKit(this._argv);\n break;\n case Integration.sourcemaps:\n integration = new SourceMapsShim(this._argv);\n break;\n default:\n integration = new ReactNative(this._argv);\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n if (_.has(projectPackage, 'dependencies.react-native')) {\n return Integration.reactNative;\n }\n if (_.has(projectPackage, 'dependencies.cordova')) {\n return Integration.cordova;\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 integration');\n }\n\n const detectedDefaultSelection = this.tryDetectingIntegration();\n\n return prompt([\n {\n choices: getIntegrationChoices(),\n default: detectedDefaultSelection,\n message: 'What integration do you want to set up?',\n name: 'integration',\n type: 'list',\n },\n ]);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"ChooseIntegration.js","sourceRoot":"","sources":["../../../lib/Steps/ChooseIntegration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAClC,wCAA4B;AAC5B,yCAAiC;AAEjC,0CAKsB;AACtB,uCAAsC;AACtC,kDAAiD;AACjD,oDAAmD;AACnD,wDAAuD;AACvD,0DAAyD;AACzD,gEAA+D;AAC/D,8CAA6C;AAC7C,8DAA6D;AAE7D,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;;IAiEA,CAAC;IAhEc,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,E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;gBACtD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;oBAC1B,sBAAO,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAC;iBAChD;qBAAM;oBACL,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;wBACpB,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;qBACrD;oBAEK,wBAAwB,GAAG,IAAI,CAAC,uBAAuB,EAAE,CAAC;oBAEhE,sBAAO,IAAA,iBAAM,EAAC;4BACZ;gCACE,OAAO,EAAE,IAAA,iCAAqB,GAAE;gCAChC,OAAO,EAAE,wBAAwB;gCACjC,OAAO,EAAE,yCAAyC;gCAClD,IAAI,EAAE,aAAa;gCACnB,IAAI,EAAE,MAAM;6BACb;yBACF,CAAC,EAAC;iBACJ;;;;KACF;IACH,wBAAC;AAAD,CAAC,AAjED,CAAuC,mBAAQ,GAiE9C;AAjEY,8CAAiB;AAmE9B;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAU;IAC7B,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,GAAG,GAAG,uBAAW,CAAC;QACvB,IAAA,gBAAG,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';\nimport * as _ from 'lodash';\nimport { dim } from 'picocolors';\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';\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 case Integration.nextjs:\n integration = new NextJsShim(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(sanitizeUrl(this._argv));\n break;\n }\n\n return { integration };\n }\n\n public tryDetectingIntegration(): Integration | undefined {\n if (_.has(projectPackage, 'dependencies.react-native')) {\n return Integration.reactNative;\n }\n if (_.has(projectPackage, 'dependencies.cordova')) {\n return Integration.cordova;\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 integration');\n }\n\n const detectedDefaultSelection = this.tryDetectingIntegration();\n\n return prompt([\n {\n choices: getIntegrationChoices(),\n default: detectedDefaultSelection,\n message: 'What integration do you want to set up?',\n name: 'integration',\n type: 'list',\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"]}
@@ -0,0 +1,10 @@
1
+ import { Answers } from 'inquirer';
2
+ import type { Args } from '../../Constants';
3
+ import { BaseIntegration } from './BaseIntegration';
4
+ export declare class Apple extends BaseIntegration {
5
+ protected _argv: Args;
6
+ argv: Args;
7
+ constructor(_argv: Args);
8
+ emit(_answers: Answers): Promise<Answers>;
9
+ shouldConfigure(_answers: Answers): Promise<Answers>;
10
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
+ return new (P || (P = Promise))(function (resolve, reject) {
20
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
24
+ });
25
+ };
26
+ var __generator = (this && this.__generator) || function (thisArg, body) {
27
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
+ function verb(n) { return function (v) { return step([n, v]); }; }
30
+ function step(op) {
31
+ if (f) throw new TypeError("Generator is already executing.");
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
+ if (y = 0, t) op = [op[0] & 2, t.value];
35
+ switch (op[0]) {
36
+ case 0: case 1: t = op; break;
37
+ case 4: _.label++; return { value: op[1], done: false };
38
+ case 5: _.label++; y = op[1]; op = [0]; continue;
39
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
+ default:
41
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
+ if (t[2]) _.ops.pop();
46
+ _.trys.pop(); continue;
47
+ }
48
+ op = body.call(thisArg, _);
49
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
+ }
52
+ };
53
+ Object.defineProperty(exports, "__esModule", { value: true });
54
+ exports.Apple = void 0;
55
+ var BaseIntegration_1 = require("./BaseIntegration");
56
+ var apple_wizard_1 = require("../../../src/apple/apple-wizard");
57
+ var Apple = /** @class */ (function (_super) {
58
+ __extends(Apple, _super);
59
+ function Apple(_argv) {
60
+ var _this = _super.call(this, _argv) || this;
61
+ _this._argv = _argv;
62
+ _this.argv = _argv;
63
+ return _this;
64
+ }
65
+ Apple.prototype.emit = function (_answers) {
66
+ return __awaiter(this, void 0, void 0, function () {
67
+ return __generator(this, function (_a) {
68
+ switch (_a.label) {
69
+ case 0: return [4 /*yield*/, (0, apple_wizard_1.runAppleWizard)({
70
+ promoCode: this._argv.promoCode,
71
+ url: this._argv.url,
72
+ telemetryEnabled: !this._argv.disableTelemetry,
73
+ // eslint-disable-next-line no-console
74
+ }).catch(console.error)];
75
+ case 1:
76
+ _a.sent();
77
+ return [2 /*return*/, {}];
78
+ }
79
+ });
80
+ });
81
+ };
82
+ Apple.prototype.shouldConfigure = function (_answers) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ return __generator(this, function (_a) {
85
+ return [2 /*return*/, this._shouldConfigure];
86
+ });
87
+ });
88
+ };
89
+ return Apple;
90
+ }(BaseIntegration_1.BaseIntegration));
91
+ exports.Apple = Apple;
92
+ //# sourceMappingURL=Apple.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Apple.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/Apple.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,qDAAoD;AACpD,gEAAiE;AAEjE;IAA2B,yBAAe;IAExC,eAA6B,KAAW;QAAxC,YACE,kBAAM,KAAK,CAAC,SAEb;QAH4B,WAAK,GAAL,KAAK,CAAM;QAEtC,KAAI,CAAC,IAAI,GAAG,KAAK,CAAC;;IACpB,CAAC;IAEY,oBAAI,GAAjB,UAAkB,QAAiB;;;;4BACjC,qBAAM,IAAA,6BAAc,EAAC;4BACnB,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS;4BAC/B,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG;4BACnB,gBAAgB,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB;4BAC9C,sCAAsC;yBACvC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAA;;wBALvB,SAKuB,CAAC;wBAExB,sBAAO,EAAE,EAAC;;;;KACX;IAEY,+BAAe,GAA5B,UAA6B,QAAiB;;;gBAC5C,sBAAO,IAAI,CAAC,gBAAgB,EAAC;;;KAC9B;IACH,YAAC;AAAD,CAAC,AArBD,CAA2B,iCAAe,GAqBzC;AArBY,sBAAK","sourcesContent":["import { Answers } from 'inquirer';\nimport type { Args } from '../../Constants';\nimport { BaseIntegration } from './BaseIntegration';\nimport { runAppleWizard } from '../../../src/apple/apple-wizard';\n\nexport class Apple extends BaseIntegration {\n argv: Args;\n public constructor(protected _argv: Args) {\n super(_argv);\n this.argv = _argv;\n }\n\n public async emit(_answers: Answers): Promise<Answers> {\n await runAppleWizard({\n promoCode: this._argv.promoCode,\n url: this._argv.url,\n telemetryEnabled: !this._argv.disableTelemetry,\n // eslint-disable-next-line no-console\n }).catch(console.error);\n\n return {};\n }\n\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n return this._shouldConfigure;\n }\n}\n"]}
@@ -5,7 +5,7 @@ import { BaseIntegration } from './BaseIntegration';
5
5
  * This class just redirects to the new `nextjs-wizard.ts` flow
6
6
  * for anyone calling the wizard without the '-i nextjs' flag.
7
7
  */
8
- export declare class NextJs extends BaseIntegration {
8
+ export declare class NextJsShim extends BaseIntegration {
9
9
  protected _argv: Args;
10
10
  constructor(_argv: Args);
11
11
  emit(_answers: Answers): Promise<Answers>;