@sentry/wizard 2.7.0 → 3.1.0-beta.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 (131) hide show
  1. package/CHANGELOG.md +16 -3
  2. package/bin.ts +9 -2
  3. package/dist/NextJs/configs/next.config.template.js +1 -1
  4. package/dist/bin.js +16 -4
  5. package/dist/bin.js.map +1 -1
  6. package/dist/index.js +7 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/Constants.js +1 -1
  9. package/dist/lib/Constants.js.map +1 -1
  10. package/dist/lib/Helper/BottomBar.js +2 -2
  11. package/dist/lib/Helper/BottomBar.js.map +1 -1
  12. package/dist/lib/Helper/File.js +10 -12
  13. package/dist/lib/Helper/File.js.map +1 -1
  14. package/dist/lib/Helper/Logging.js +1 -1
  15. package/dist/lib/Helper/Logging.js.map +1 -1
  16. package/dist/lib/Helper/MergeConfig.js +1 -0
  17. package/dist/lib/Helper/MergeConfig.js.map +1 -1
  18. package/dist/lib/Helper/Package.js +10 -10
  19. package/dist/lib/Helper/Package.js.map +1 -1
  20. package/dist/lib/Helper/PackageManager.js +6 -9
  21. package/dist/lib/Helper/PackageManager.js.map +1 -1
  22. package/dist/lib/Helper/SentryCli.d.ts +3 -3
  23. package/dist/lib/Helper/SentryCli.js +3 -3
  24. package/dist/lib/Helper/SentryCli.js.map +1 -1
  25. package/dist/lib/Helper/Wizard.d.ts +4 -4
  26. package/dist/lib/Helper/Wizard.js +11 -11
  27. package/dist/lib/Helper/Wizard.js.map +1 -1
  28. package/dist/lib/Helper/__tests__/File.js +5 -5
  29. package/dist/lib/Helper/__tests__/File.js.map +1 -1
  30. package/dist/lib/Helper/__tests__/MergeConfig.js +9 -9
  31. package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
  32. package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
  33. package/dist/lib/Setup.js +11 -9
  34. package/dist/lib/Setup.js.map +1 -1
  35. package/dist/lib/Steps/BaseStep.d.ts +2 -2
  36. package/dist/lib/Steps/BaseStep.js +3 -3
  37. package/dist/lib/Steps/BaseStep.js.map +1 -1
  38. package/dist/lib/Steps/ChooseIntegration.d.ts +1 -1
  39. package/dist/lib/Steps/ChooseIntegration.js +7 -5
  40. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  41. package/dist/lib/Steps/ConfigureProject.d.ts +1 -1
  42. package/dist/lib/Steps/ConfigureProject.js +5 -3
  43. package/dist/lib/Steps/ConfigureProject.js.map +1 -1
  44. package/dist/lib/Steps/Initial.d.ts +1 -1
  45. package/dist/lib/Steps/Initial.js +7 -4
  46. package/dist/lib/Steps/Initial.js.map +1 -1
  47. package/dist/lib/Steps/Integrations/BaseIntegration.d.ts +2 -2
  48. package/dist/lib/Steps/Integrations/BaseIntegration.js +7 -4
  49. package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
  50. package/dist/lib/Steps/Integrations/Cordova.d.ts +2 -2
  51. package/dist/lib/Steps/Integrations/Cordova.js +13 -10
  52. package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
  53. package/dist/lib/Steps/Integrations/Electron.d.ts +2 -2
  54. package/dist/lib/Steps/Integrations/Electron.js +25 -21
  55. package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
  56. package/dist/lib/Steps/Integrations/MobileProject.d.ts +1 -1
  57. package/dist/lib/Steps/Integrations/MobileProject.js +8 -5
  58. package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
  59. package/dist/lib/Steps/Integrations/NextJs.d.ts +2 -2
  60. package/dist/lib/Steps/Integrations/NextJs.js +57 -52
  61. package/dist/lib/Steps/Integrations/NextJs.js.map +1 -1
  62. package/dist/lib/Steps/Integrations/ReactNative.d.ts +2 -2
  63. package/dist/lib/Steps/Integrations/ReactNative.js +54 -52
  64. package/dist/lib/Steps/Integrations/ReactNative.js.map +1 -1
  65. package/dist/lib/Steps/Integrations/__tests__/ReactNative.js +1 -1
  66. package/dist/lib/Steps/Integrations/__tests__/ReactNative.js.map +1 -1
  67. package/dist/lib/Steps/OpenSentry.d.ts +1 -1
  68. package/dist/lib/Steps/OpenSentry.js +19 -17
  69. package/dist/lib/Steps/OpenSentry.js.map +1 -1
  70. package/dist/lib/Steps/PromptForParameters.d.ts +1 -1
  71. package/dist/lib/Steps/PromptForParameters.js +21 -19
  72. package/dist/lib/Steps/PromptForParameters.js.map +1 -1
  73. package/dist/lib/Steps/Result.d.ts +1 -1
  74. package/dist/lib/Steps/Result.js +8 -5
  75. package/dist/lib/Steps/Result.js.map +1 -1
  76. package/dist/lib/Steps/SentryProjectSelector.d.ts +1 -1
  77. package/dist/lib/Steps/SentryProjectSelector.js +6 -4
  78. package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
  79. package/dist/lib/Steps/ShouldConfigure.d.ts +1 -1
  80. package/dist/lib/Steps/ShouldConfigure.js +5 -3
  81. package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
  82. package/dist/lib/Steps/WaitForSentry.d.ts +1 -1
  83. package/dist/lib/Steps/WaitForSentry.js +47 -50
  84. package/dist/lib/Steps/WaitForSentry.js.map +1 -1
  85. package/dist/lib/Steps/Welcome.d.ts +1 -1
  86. package/dist/lib/Steps/Welcome.js +8 -6
  87. package/dist/lib/Steps/Welcome.js.map +1 -1
  88. package/dist/lib/Steps/index.js +1 -0
  89. package/dist/lib/Steps/index.js.map +1 -1
  90. package/dist/lib/__tests__/Env.js +1 -1
  91. package/dist/lib/__tests__/Env.js.map +1 -1
  92. package/dist/lib/__tests__/Setup.js +1 -1
  93. package/dist/lib/__tests__/Setup.js.map +1 -1
  94. package/dist/src/clack-utils.d.ts +40 -0
  95. package/dist/src/clack-utils.js +329 -0
  96. package/dist/src/clack-utils.js.map +1 -0
  97. package/dist/src/nextjs-wizard.d.ts +5 -0
  98. package/dist/src/nextjs-wizard.js +346 -0
  99. package/dist/src/nextjs-wizard.js.map +1 -0
  100. package/lib/Helper/File.ts +2 -8
  101. package/lib/Helper/MergeConfig.ts +1 -0
  102. package/lib/Helper/SentryCli.ts +3 -3
  103. package/lib/Helper/Wizard.ts +6 -5
  104. package/lib/Helper/__tests__/File.ts +5 -5
  105. package/lib/Helper/__tests__/SentryCli.ts +3 -2
  106. package/lib/Helper/test-fixtures/next.config.1-merged.js +1 -1
  107. package/lib/Helper/test-fixtures/next.config.3-merged.js +1 -1
  108. package/lib/Helper/test-fixtures/next.config.4-merged.js +1 -1
  109. package/lib/Steps/BaseStep.ts +4 -4
  110. package/lib/Steps/ChooseIntegration.ts +2 -1
  111. package/lib/Steps/ConfigureProject.ts +1 -1
  112. package/lib/Steps/Initial.ts +2 -1
  113. package/lib/Steps/Integrations/BaseIntegration.ts +5 -3
  114. package/lib/Steps/Integrations/Cordova.ts +7 -6
  115. package/lib/Steps/Integrations/Electron.ts +10 -7
  116. package/lib/Steps/Integrations/MobileProject.ts +3 -1
  117. package/lib/Steps/Integrations/NextJs.ts +8 -6
  118. package/lib/Steps/Integrations/ReactNative.ts +47 -26
  119. package/lib/Steps/Integrations/__tests__/ReactNative.ts +3 -2
  120. package/lib/Steps/OpenSentry.ts +1 -1
  121. package/lib/Steps/PromptForParameters.ts +3 -2
  122. package/lib/Steps/Result.ts +2 -1
  123. package/lib/Steps/SentryProjectSelector.ts +3 -2
  124. package/lib/Steps/ShouldConfigure.ts +1 -1
  125. package/lib/Steps/WaitForSentry.ts +4 -4
  126. package/lib/Steps/Welcome.ts +3 -2
  127. package/lib/__tests__/Setup.ts +1 -1
  128. package/package.json +17 -14
  129. package/scripts/NextJs/configs/next.config.template.js +1 -1
  130. package/src/clack-utils.ts +346 -0
  131. package/src/nextjs-wizard.ts +619 -0
package/CHANGELOG.md CHANGED
@@ -1,8 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.1.0-beta.0
4
+
5
+ - Redo Next.js wizard (#250)
6
+
7
+ ## 3.0.0
8
+
9
+ ### Various fixes & improvements
10
+
11
+ - build: Update a bunch of dev dependencies (#248) by @lforst
12
+ - fix: Typo `hideSourcemaps` → `hideSourceMaps` (#231) by @maxbeier
13
+
3
14
  ## 2.7.0
4
15
 
5
- - feat(rn): One line `@sentry/react-native` setup command ([#243](https://github.com/getsentry/sentry-wizard/pull/243))
16
+ - feat(rn): One line `@sentry/react-native` setup command (#243)
6
17
 
7
18
  ```bash
8
19
  npx @sentry/wizard -s -i reactNative
@@ -10,11 +21,13 @@ npx @sentry/wizard -s -i reactNative
10
21
 
11
22
  ## 2.6.1
12
23
 
13
- - fix(rn): Upload debug files from `$DWARF_DSYM_FOLDER_PATH` during Xcode build ([#240](https://github.com/getsentry/sentry-wizard/pull/240))
24
+ - fix(rn): Upload debug files from `$DWARF_DSYM_FOLDER_PATH` during Xcode build
25
+ (#240)
14
26
 
15
27
  ## 2.6.0
16
28
 
17
- - feat(rn): Support patching app/build.gradle RN 0.71.0 and Expo SDK 43+ bare workflow ([#229](https://github.com/getsentry/sentry-wizard/pull/229))
29
+ - feat(rn): Support patching app/build.gradle RN 0.71.0 and Expo SDK 43+ bare
30
+ workflow (#229)
18
31
 
19
32
  ## 2.5.0
20
33
 
package/bin.ts CHANGED
@@ -1,8 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import { DEFAULT_URL, Integration, Platform } from './lib/Constants';
3
3
  import { run } from './lib/Setup';
4
+ import { runNextjsWizard } from './src/nextjs-wizard';
4
5
  export * from './lib/Setup';
5
6
 
7
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
6
8
  const argv = require('yargs')
7
9
  .option('debug', {
8
10
  default: false,
@@ -53,5 +55,10 @@ const argv = require('yargs')
53
55
  describe: 'A promo code that will be applied during signup',
54
56
  }).argv;
55
57
 
56
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
57
- run(argv);
58
+ if (argv.i === 'nextjs') {
59
+ // eslint-disable-next-line no-console
60
+ runNextjsWizard({ promoCode: argv['promo-code'] }).catch(console.error);
61
+ } else {
62
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
63
+ run(argv);
64
+ }
@@ -8,5 +8,5 @@ const { withSentryConfig } = require('@sentry/nextjs');
8
8
  module.exports = withSentryConfig(
9
9
  module.exports,
10
10
  { silent: true },
11
- { hideSourcemaps: true },
11
+ { hideSourceMaps: true },
12
12
  );
package/dist/bin.js CHANGED
@@ -2,18 +2,24 @@
2
2
  "use strict";
3
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
4
  if (k2 === undefined) k2 = k;
5
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
6
10
  }) : (function(o, m, k, k2) {
7
11
  if (k2 === undefined) k2 = k;
8
12
  o[k2] = m[k];
9
13
  }));
10
14
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
11
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
12
16
  };
13
17
  Object.defineProperty(exports, "__esModule", { value: true });
14
18
  var Constants_1 = require("./lib/Constants");
15
19
  var Setup_1 = require("./lib/Setup");
20
+ var nextjs_wizard_1 = require("./src/nextjs-wizard");
16
21
  __exportStar(require("./lib/Setup"), exports);
22
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
17
23
  var argv = require('yargs')
18
24
  .option('debug', {
19
25
  default: false,
@@ -61,6 +67,12 @@ var argv = require('yargs')
61
67
  alias: 'promo-code',
62
68
  describe: 'A promo code that will be applied during signup',
63
69
  }).argv;
64
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
65
- Setup_1.run(argv);
70
+ if (argv.i === 'nextjs') {
71
+ // eslint-disable-next-line no-console
72
+ (0, nextjs_wizard_1.runNextjsWizard)({ promoCode: argv['promo-code'] }).catch(console.error);
73
+ }
74
+ else {
75
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
76
+ (0, Setup_1.run)(argv);
77
+ }
66
78
  //# 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,8CAA4B;AAE5B,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,OAAO,EAAE,uBAAW;IACpB,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,YAAY,EAAE;IACpB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,iDAAiD;CAC5D,CAAC,CAAC,IAAI,CAAC;AAEV,mEAAmE;AACnE,WAAG,CAAC,IAAI,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\nimport { DEFAULT_URL, Integration, Platform } from './lib/Constants';\nimport { run } from './lib/Setup';\nexport * from './lib/Setup';\n\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('promo-code', {\n alias: 'promo-code',\n describe: 'A promo code that will be applied during signup',\n }).argv;\n\n// eslint-disable-next-line @typescript-eslint/no-floating-promises\nrun(argv);\n"]}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../bin.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,6CAAqE;AACrE,qCAAkC;AAClC,qDAAsD;AACtD,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,OAAO,EAAE,uBAAW;IACpB,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,YAAY,EAAE;IACpB,KAAK,EAAE,YAAY;IACnB,QAAQ,EAAE,iDAAiD;CAC5D,CAAC,CAAC,IAAI,CAAC;AAEV,IAAI,IAAI,CAAC,CAAC,KAAK,QAAQ,EAAE;IACvB,sCAAsC;IACtC,IAAA,+BAAe,EAAC,EAAE,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;CACzE;KAAM;IACL,mEAAmE;IACnE,IAAA,WAAG,EAAC,IAAI,CAAC,CAAC;CACX","sourcesContent":["#!/usr/bin/env node\nimport { DEFAULT_URL, Integration, Platform } from './lib/Constants';\nimport { run } from './lib/Setup';\nimport { runNextjsWizard } from './src/nextjs-wizard';\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('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 {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n run(argv);\n}\n"]}
package/dist/index.js CHANGED
@@ -1,15 +1,20 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
8
12
  }));
9
13
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
15
  };
12
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Integration = void 0;
13
18
  var Constants_1 = require("./lib/Constants");
14
19
  Object.defineProperty(exports, "Integration", { enumerable: true, get: function () { return Constants_1.Integration; } });
15
20
  __exportStar(require("./lib/Setup"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAoD;AAArC,wGAAA,WAAW,OAAA;AAC1B,8CAA4B","sourcesContent":["export { Args, Integration } from './lib/Constants';\nexport * from './lib/Setup';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6CAAoD;AAArC,wGAAA,WAAW,OAAA;AAC1B,8CAA4B","sourcesContent":["export { Args, Integration } from './lib/Constants';\nexport * from './lib/Setup';\n"]}
@@ -58,7 +58,7 @@ function mapIntegrationToPlatform(type) {
58
58
  case Integration.nextjs:
59
59
  return 'javascript-nextjs';
60
60
  default:
61
- throw new Error("Unknown integration " + type);
61
+ throw new Error("Unknown integration ".concat(type));
62
62
  }
63
63
  }
64
64
  exports.mapIntegrationToPlatform = mapIntegrationToPlatform;
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../lib/Constants.ts"],"names":[],"mappings":";;;AAAA,wCAAwC;AACxC,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,wCAAwC;AACxC,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,+BAAmB,CAAA;AACrB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,SAAgB,kBAAkB;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,UAAC,QAAgB,IAAK,OAAA,CAAC;QACtD,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,sBAAsB,CAAC,QAAQ,CAAC;QACtC,KAAK,EAAE,QAAQ;KAChB,CAAC,EAJqD,CAIrD,CAAC,CAAC;AACN,CAAC;AAND,gDAMC;AAED,SAAgB,sBAAsB,CAAC,IAAY;IACjD,QAAQ,IAAI,EAAE;QACZ,KAAK,QAAQ,CAAC,GAAG;YACf,OAAO,KAAK,CAAC;QACf;YACE,OAAO,SAAS,CAAC;KACpB;AACH,CAAC;AAPD,wDAOC;AAED,SAAgB,yBAAyB,CAAC,IAAY;IACpD,QAAQ,IAAI,EAAE;QACZ,KAAK,WAAW,CAAC,WAAW;YAC1B,OAAO,cAAc,CAAC;QACxB,KAAK,WAAW,CAAC,OAAO;YACtB,OAAO,SAAS,CAAC;QACnB,KAAK,WAAW,CAAC,QAAQ;YACvB,OAAO,UAAU,CAAC;QACpB,KAAK,WAAW,CAAC,MAAM;YACrB,OAAO,SAAS,CAAC;QACnB;YACE,OAAO,cAAc,CAAC;KACzB;AACH,CAAC;AAbD,8DAaC;AAED,SAAgB,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;YACE,MAAM,IAAI,KAAK,CAAC,yBAAuB,IAAM,CAAC,CAAC;KAClD;AACH,CAAC;AAbD,4DAaC;AAED,SAAgB,qBAAqB;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,UAAC,IAAY,IAAK,OAAA,CAAC;QACrD,IAAI,EAAE,yBAAyB,CAAC,IAAI,CAAC;QACrC,KAAK,EAAE,IAAI;KACZ,CAAC,EAHoD,CAGpD,CAAC,CAAC;AACN,CAAC;AALD,sDAKC;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}\n\n/** Key value should be the same here */\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n}\n\nexport function getPlatformChoices(): any[] {\n return Object.keys(Platform).map((platform: string) => ({\n checked: true,\n name: getPlatformDescription(platform),\n value: platform,\n }));\n}\n\nexport function getPlatformDescription(type: string): string {\n switch (type) {\n case Platform.ios:\n return 'iOS';\n default:\n return 'Android';\n }\n}\n\nexport function getIntegrationDescription(type: string): string {\n switch (type) {\n case Integration.reactNative:\n return 'React Native';\n case Integration.cordova:\n return 'Cordova';\n case Integration.electron:\n return 'Electron';\n case Integration.nextjs:\n return 'Next.js';\n default:\n return 'React Native';\n }\n}\n\nexport function mapIntegrationToPlatform(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 'javascript-electron';\n case Integration.nextjs:\n return 'javascript-nextjs';\n default:\n throw new Error(`Unknown integration ${type}`);\n }\n}\n\nexport function getIntegrationChoices(): any[] {\n return Object.keys(Integration).map((type: string) => ({\n name: getIntegrationDescription(type),\n value: type,\n }));\n}\n\nexport interface Args {\n url: string;\n debug: boolean;\n uninstall: boolean;\n integration: Integration;\n platform: Platform[];\n skipConnect: boolean;\n quiet: boolean;\n 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,WAKX;AALD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IACrB,gCAAiB,CAAA;AACnB,CAAC,EALW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAKtB;AAED,wCAAwC;AACxC,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,+BAAmB,CAAA;AACrB,CAAC,EAHW,Q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AO,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}\n\n/** Key value should be the same here */\nexport enum Platform {\n ios = 'ios',\n android = 'android',\n}\n\nexport function getPlatformChoices(): any[] {\n return Object.keys(Platform).map((platform: string) => ({\n checked: true,\n name: getPlatformDescription(platform),\n value: platform,\n }));\n}\n\nexport function getPlatformDescription(type: string): string {\n switch (type) {\n case Platform.ios:\n return 'iOS';\n default:\n return 'Android';\n }\n}\n\nexport function getIntegrationDescription(type: string): string {\n switch (type) {\n case Integration.reactNative:\n return 'React Native';\n case Integration.cordova:\n return 'Cordova';\n case Integration.electron:\n return 'Electron';\n case Integration.nextjs:\n return 'Next.js';\n default:\n return 'React Native';\n }\n}\n\nexport function mapIntegrationToPlatform(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 'javascript-electron';\n case Integration.nextjs:\n return 'javascript-nextjs';\n default:\n throw new Error(`Unknown integration ${type}`);\n }\n}\n\nexport function getIntegrationChoices(): any[] {\n return Object.keys(Integration).map((type: string) => ({\n name: getIntegrationDescription(type),\n value: type,\n }));\n}\n\nexport interface Args {\n url: string;\n debug: boolean;\n uninstall: boolean;\n integration: Integration;\n platform: Platform[];\n skipConnect: boolean;\n quiet: boolean;\n signup: boolean;\n promoCode?: string;\n}\n\nexport const DEFAULT_URL = 'https://sentry.io/';\n"]}
@@ -13,14 +13,14 @@ var BottomBar = /** @class */ (function () {
13
13
  BottomBar.bar = new inquirer_1.ui.BottomBar({ bottomBar: loader[i % 4] });
14
14
  BottomBar.interval = setInterval(function () {
15
15
  // eslint-disable-next-line no-plusplus
16
- BottomBar.bar.updateBottomBar(loader[i++ % 4] + " " + msg);
16
+ BottomBar.bar.updateBottomBar("".concat(loader[i++ % 4], " ").concat(msg));
17
17
  }, 100);
18
18
  };
19
19
  BottomBar.hide = function () {
20
20
  clearInterval(BottomBar.interval);
21
21
  if (BottomBar.bar) {
22
22
  BottomBar.bar.updateBottomBar('');
23
- Logging_1.nl();
23
+ (0, Logging_1.nl)();
24
24
  BottomBar.bar.close();
25
25
  }
26
26
  };
@@ -1 +1 @@
1
- {"version":3,"file":"BottomBar.js","sourceRoot":"","sources":["../../../lib/Helper/BottomBar.ts"],"names":[],"mappings":";;;AAAA,qCAA8B;AAE9B,qCAA+B;AAE/B;IAAA;IAuBA,CAAC;IAnBC,6EAA6E;IAC/D,cAAI,GAAlB,UAAmB,GAAW;QAC5B,IAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,SAAS,CAAC,GAAG,GAAG,IAAI,aAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/D,SAAS,CAAC,QAAQ,GAAG,WAAW,CAAC;YAC/B,uCAAuC;YACvC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAI,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,SAAI,GAAK,CAAC,CAAC;QAC7D,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;IAEa,cAAI,GAAlB;QACE,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,SAAS,CAAC,GAAG,EAAE;YACjB,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;YAClC,YAAE,EAAE,CAAC;YACL,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;SACvB;IACH,CAAC;IACH,gBAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,8BAAS","sourcesContent":["import { ui } from 'inquirer';\n\nimport { nl } from './Logging';\n\nexport class BottomBar {\n public static bar: typeof ui.BottomBar;\n public static interval: NodeJS.Timer;\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n public static show(msg: string): void {\n const loader = ['/', '|', '\\\\', '-'];\n let i = 4;\n BottomBar.bar = new ui.BottomBar({ bottomBar: loader[i % 4] });\n BottomBar.interval = setInterval(() => {\n // eslint-disable-next-line no-plusplus\n BottomBar.bar.updateBottomBar(`${loader[i++ % 4]} ${msg}`);\n }, 100);\n }\n\n public static hide(): void {\n clearInterval(BottomBar.interval);\n if (BottomBar.bar) {\n BottomBar.bar.updateBottomBar('');\n nl();\n BottomBar.bar.close();\n }\n }\n}\n"]}
1
+ {"version":3,"file":"BottomBar.js","sourceRoot":"","sources":["../../../lib/Helper/BottomBar.ts"],"names":[],"mappings":";;;AAAA,qCAA8B;AAE9B,qCAA+B;AAE/B;IAAA;IAuBA,CAAC;IAnBC,6EAA6E;IAC/D,cAAI,GAAlB,UAAmB,GAAW;QAC5B,IAAM,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,SAAS,CAAC,GAAG,GAAG,IAAI,aAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;QAC/D,SAAS,CAAC,QAAQ,GAAG,WAAW,CAAC;YAC/B,uCAAuC;YACvC,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,UAAG,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,cAAI,GAAG,CAAE,CAAC,CAAC;QAC7D,CAAC,EAAE,GAAG,CAAC,CAAC;IACV,CAAC;IAEa,cAAI,GAAlB;QACE,aAAa,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAClC,IAAI,SAAS,CAAC,GAAG,EAAE;YACjB,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;YAClC,IAAA,YAAE,GAAE,CAAC;YACL,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC;SACvB;IACH,CAAC;IACH,gBAAC;AAAD,CAAC,AAvBD,IAuBC;AAvBY,8BAAS","sourcesContent":["import { ui } from 'inquirer';\n\nimport { nl } from './Logging';\n\nexport class BottomBar {\n public static bar: typeof ui.BottomBar;\n public static interval: NodeJS.Timer;\n\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n public static show(msg: string): void {\n const loader = ['/', '|', '\\\\', '-'];\n let i = 4;\n BottomBar.bar = new ui.BottomBar({ bottomBar: loader[i % 4] });\n BottomBar.interval = setInterval(() => {\n // eslint-disable-next-line no-plusplus\n BottomBar.bar.updateBottomBar(`${loader[i++ % 4]} ${msg}`);\n }, 100);\n }\n\n public static hide(): void {\n clearInterval(BottomBar.interval);\n if (BottomBar.bar) {\n BottomBar.bar.updateBottomBar('');\n nl();\n BottomBar.bar.close();\n }\n }\n}\n"]}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
- var __spreadArrays = (this && this.__spreadArrays) || function () {
3
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
4
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
5
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
6
- r[k] = a[j];
7
- return r;
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
8
10
  };
9
11
  Object.defineProperty(exports, "__esModule", { value: true });
10
12
  exports.matchesContent = exports.exists = exports.matchFiles = exports.patchMatchingFile = void 0;
@@ -25,7 +27,7 @@ function patchMatchingFile(globPattern, func) {
25
27
  encoding: 'utf-8',
26
28
  });
27
29
  rv = rv
28
- .then(function () { return func.apply(void 0, __spreadArrays([contents, match], args)); })
30
+ .then(function () { return func.apply(void 0, __spreadArray([contents, match], args, false)); })
29
31
  .then(function (newContents) {
30
32
  if (newContents !== null &&
31
33
  newContents !== undefined &&
@@ -63,11 +65,7 @@ function matchesContent(globPattern, contentPattern) {
63
65
  return false;
64
66
  }
65
67
  return matches.reduce(function (prev, match) {
66
- return !!(prev &&
67
- fs
68
- .readFileSync(match)
69
- .toString()
70
- .match(contentPattern));
68
+ return !!(prev && fs.readFileSync(match).toString().match(contentPattern));
71
69
  }, true);
72
70
  }
73
71
  exports.matchesContent = matchesContent;
@@ -1 +1 @@
1
- {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../lib/Helper/File.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,uBAAyB;AACzB,2BAA6B;AAE7B,IAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;AAExE,SAAgB,iBAAiB,CAC/B,WAAmB,EACnB,IAAS;IACT,cAAc;SAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;QAAd,6BAAc;;IAEd,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACrC,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;IACH,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,OAAO,CAAC,OAAO,CAAC,UAAC,KAAa;QAC5B,IAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE;YACtC,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAC;QACH,EAAE,GAAG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CACP,IAAI;YACJ,EAAE;iBACC,YAAY,CAAC,KAAK,CAAC;iBACnB,QAAQ,EAAE;iBACV,KAAK,CAAC,cAAc,CAAC,CACzB,CAAC;IACJ,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC;AAnBD,wCAmBC","sourcesContent":["import * as fs from 'fs';\nimport * as glob from 'glob';\n\nconst IGNORE_PATTERN = ['node_modules/**', 'ios/Pods/**', '**/Pods/**'];\n\nexport function patchMatchingFile(\n globPattern: string,\n func: any,\n ...args: any[]\n): Promise<void> {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n let rv = Promise.resolve();\n matches.forEach((match: string) => {\n const contents = fs.readFileSync(match, {\n encoding: 'utf-8',\n });\n rv = rv\n .then(() => func(contents, match, ...args))\n .then(newContents => {\n if (\n newContents !== null &&\n newContents !== undefined &&\n contents !== newContents\n ) {\n fs.writeFileSync(match, newContents);\n }\n });\n });\n return rv;\n}\n\nexport function matchFiles(globPattern: string): string[] {\n return glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n}\n\nexport function exists(globPattern: string): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return prev && fs.existsSync(match);\n }, true);\n}\n\nexport function matchesContent(\n globPattern: string,\n contentPattern: RegExp,\n): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return !!(\n prev &&\n fs\n .readFileSync(match)\n .toString()\n .match(contentPattern)\n );\n }, true);\n}\n"]}
1
+ {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../lib/Helper/File.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uBAAyB;AACzB,2BAA6B;AAE7B,IAAM,cAAc,GAAG,CAAC,iBAAiB,EAAE,aAAa,EAAE,YAAY,CAAC,CA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;QACjD,OAAO,IAAI,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC;AAVD,wBAUC;AAED,SAAgB,cAAc,CAC5B,WAAmB,EACnB,cAAsB;IAEtB,IAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;QACrC,MAAM,EAAE,cAAc;KACvB,CAAC,CAAC;IACH,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,OAAO,KAAK,CAAC;KACd;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,UAAC,IAAa,EAAE,KAAa;QACjD,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;IAC7E,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC;AAbD,wCAaC","sourcesContent":["import * as fs from 'fs';\nimport * as glob from 'glob';\n\nconst IGNORE_PATTERN = ['node_modules/**', 'ios/Pods/**', '**/Pods/**'];\n\nexport function patchMatchingFile(\n globPattern: string,\n func: any,\n ...args: any[]\n): Promise<void> {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n let rv = Promise.resolve();\n matches.forEach((match: string) => {\n const contents = fs.readFileSync(match, {\n encoding: 'utf-8',\n });\n rv = rv\n .then(() => func(contents, match, ...args))\n .then((newContents) => {\n if (\n newContents !== null &&\n newContents !== undefined &&\n contents !== newContents\n ) {\n fs.writeFileSync(match, newContents);\n }\n });\n });\n return rv;\n}\n\nexport function matchFiles(globPattern: string): string[] {\n return glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n}\n\nexport function exists(globPattern: string): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return prev && fs.existsSync(match);\n }, true);\n}\n\nexport function matchesContent(\n globPattern: string,\n contentPattern: RegExp,\n): boolean {\n const matches = glob.sync(globPattern, {\n ignore: IGNORE_PATTERN,\n });\n if (matches.length === 0) {\n return false;\n }\n return matches.reduce((prev: boolean, match: string) => {\n return !!(prev && fs.readFileSync(match).toString().match(contentPattern));\n }, true);\n}\n"]}
@@ -7,7 +7,7 @@ function prepareMessage(msg) {
7
7
  return msg;
8
8
  }
9
9
  if (msg instanceof Error) {
10
- return "" + (msg.stack || '');
10
+ return "".concat(msg.stack || '');
11
11
  }
12
12
  return JSON.stringify(msg, null, '\t');
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../lib/Helper/Logging.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAE1B,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,CAAC;KACZ;IACD,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,OAAO,MAAG,GAAG,CAAC,KAAK,IAAI,EAAE,CAAE,CAAC;KAC7B;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,CAAC,CAAC,GAAW;IAC3B,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAHD,cAGC;AAED,SAAgB,EAAE;IAChB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AACf,CAAC;AAFD,gBAEC;AAED,SAAgB,KAAK,CAAC,GAAW;IAC/B,OAAO,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC;AAED,SAAgB,GAAG,CAAC,GAAW;IAC7B,OAAO,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,GAAG,CAAC,GAAW;IAC7B,OAAO,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,MAAM,CAAC,GAAW;IAChC,OAAO,CAAC,CAAC,eAAK,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAFD,wBAEC;AAED,SAAgB,KAAK,CAAC,GAAQ;IAC5B,OAAO,CAAC,CAAC,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,sBAEC","sourcesContent":["import Chalk from 'chalk';\n\nfunction prepareMessage(msg: unknown): string {\n if (typeof msg === 'string') {\n return msg;\n }\n if (msg instanceof Error) {\n return `${msg.stack || ''}`;\n }\n return JSON.stringify(msg, null, '\\t');\n}\n\nexport function l(msg: string): void {\n // eslint-disable-next-line no-console\n console.log(msg);\n}\n\nexport function nl(): void {\n return l('');\n}\n\nexport function green(msg: string): void {\n return l(Chalk.green(prepareMessage(msg)));\n}\n\nexport function red(msg: string): void {\n return l(Chalk.red(prepareMessage(msg)));\n}\n\nexport function dim(msg: string): void {\n return l(Chalk.dim(prepareMessage(msg)));\n}\n\nexport function yellow(msg: string): void {\n return l(Chalk.yellow(prepareMessage(msg)));\n}\n\nexport function debug(msg: any): void {\n return l(Chalk.italic.yellow(prepareMessage(msg)));\n}\n"]}
1
+ {"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../../lib/Helper/Logging.ts"],"names":[],"mappings":";;;AAAA,+BAA0B;AAE1B,SAAS,cAAc,CAAC,GAAY;IAClC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,OAAO,GAAG,CAAC;KACZ;IACD,IAAI,GAAG,YAAY,KAAK,EAAE;QACxB,OAAO,UAAG,GAAG,CAAC,KAAK,IAAI,EAAE,CAAE,CAAC;KAC7B;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,CAAC,CAAC,GAAW;IAC3B,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACnB,CAAC;AAHD,cAGC;AAED,SAAgB,EAAE;IAChB,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;AACf,CAAC;AAFD,gBAEC;AAED,SAAgB,KAAK,CAAC,GAAW;IAC/B,OAAO,CAAC,CAAC,eAAK,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,sBAEC;AAED,SAAgB,GAAG,CAAC,GAAW;IAC7B,OAAO,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,GAAG,CAAC,GAAW;IAC7B,OAAO,CAAC,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3C,CAAC;AAFD,kBAEC;AAED,SAAgB,MAAM,CAAC,GAAW;IAChC,OAAO,CAAC,CAAC,eAAK,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAFD,wBAEC;AAED,SAAgB,KAAK,CAAC,GAAQ;IAC5B,OAAO,CAAC,CAAC,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAFD,sBAEC","sourcesContent":["import Chalk from 'chalk';\n\nfunction prepareMessage(msg: unknown): string {\n if (typeof msg === 'string') {\n return msg;\n }\n if (msg instanceof Error) {\n return `${msg.stack || ''}`;\n }\n return JSON.stringify(msg, null, '\\t');\n}\n\nexport function l(msg: string): void {\n // eslint-disable-next-line no-console\n console.log(msg);\n}\n\nexport function nl(): void {\n return l('');\n}\n\nexport function green(msg: string): void {\n return l(Chalk.green(prepareMessage(msg)));\n}\n\nexport function red(msg: string): void {\n return l(Chalk.red(prepareMessage(msg)));\n}\n\nexport function dim(msg: string): void {\n return l(Chalk.dim(prepareMessage(msg)));\n}\n\nexport function yellow(msg: string): void {\n return l(Chalk.yellow(prepareMessage(msg)));\n}\n\nexport function debug(msg: any): void {\n return l(Chalk.italic.yellow(prepareMessage(msg)));\n}\n"]}
@@ -8,6 +8,7 @@ function mergeConfigFile(sourcePath, templatePath) {
8
8
  var templateFile = fs.readFileSync(templatePath, 'utf8');
9
9
  var sourceFile = fs.readFileSync(sourcePath, 'utf8');
10
10
  var newText = templateFile.replace('// ORIGINAL CONFIG', sourceFile);
11
+ // eslint-disable-next-line @typescript-eslint/no-implied-eval
11
12
  Function(newText); // check if the file is valid javascript
12
13
  fs.writeFileSync(sourcePath, newText);
13
14
  return true;
@@ -1 +1 @@
1
- {"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../lib/Helper/MergeConfig.ts"],"names":[],"mappings":";;;AAAA,uBAAyB;AAEzB,0BAA0B;AAC1B,SAAgB,eAAe,CAC7B,UAAkB,EAClB,YAAoB;IAEpB,IAAI;QACF,IAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAC3D,IAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACvD,IAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;QACvE,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,wCAAwC;QAC3D,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAdD,0CAcC","sourcesContent":["import * as fs from 'fs';\n\n// merges the config files\nexport function mergeConfigFile(\n sourcePath: string,\n templatePath: string,\n): boolean {\n try {\n const templateFile = fs.readFileSync(templatePath, 'utf8');\n const sourceFile = fs.readFileSync(sourcePath, 'utf8');\n const newText = templateFile.replace('// ORIGINAL CONFIG', sourceFile);\n Function(newText); // check if the file is valid javascript\n fs.writeFileSync(sourcePath, newText);\n return true;\n } catch (error) {\n return false;\n }\n}\n"]}
1
+ {"version":3,"file":"MergeConfig.js","sourceRoot":"","sources":["../../../lib/Helper/MergeConfig.ts"],"names":[],"mappings":";;;AAAA,uBAAyB;AAEzB,0BAA0B;AAC1B,SAAgB,eAAe,CAC7B,UAAkB,EAClB,YAAoB;IAEpB,IAAI;QACF,IAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;QAC3D,IAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACvD,IAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;QACvE,8DAA8D;QAC9D,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,wCAAwC;QAC3D,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AAfD,0CAeC","sourcesContent":["import * as fs from 'fs';\n\n// merges the config files\nexport function mergeConfigFile(\n sourcePath: string,\n templatePath: string,\n): boolean {\n try {\n const templateFile = fs.readFileSync(templatePath, 'utf8');\n const sourceFile = fs.readFileSync(sourcePath, 'utf8');\n const newText = templateFile.replace('// ORIGINAL CONFIG', sourceFile);\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n Function(newText); // check if the file is valid javascript\n fs.writeFileSync(sourcePath, newText);\n return true;\n } catch (error) {\n return false;\n }\n}\n"]}
@@ -8,17 +8,17 @@ function checkPackageVersion(appPackage, packageName, acceptableVersions, canBeL
8
8
  var depsVersion = _.get(appPackage, ['dependencies', packageName]);
9
9
  var devDepsVersion = _.get(appPackage, ['devDependencies', packageName]);
10
10
  if (!depsVersion && !devDepsVersion) {
11
- Logging_1.red("\u2717 " + packageName + " isn't in your dependencies.");
12
- Logging_1.red(' Please install it with yarn/npm.');
11
+ (0, Logging_1.red)("\u2717 ".concat(packageName, " isn't in your dependencies."));
12
+ (0, Logging_1.red)(' Please install it with yarn/npm.');
13
13
  return false;
14
14
  }
15
15
  else if (!fulfillsVersionRange(depsVersion, acceptableVersions, canBeLatest) &&
16
16
  !fulfillsVersionRange(devDepsVersion, acceptableVersions, canBeLatest)) {
17
- Logging_1.red("\u2717 Your `package.json` specifies a version of `" + packageName + "` outside of the compatible version range " + acceptableVersions + ".\n");
17
+ (0, Logging_1.red)("\u2717 Your `package.json` specifies a version of `".concat(packageName, "` outside of the compatible version range ").concat(acceptableVersions, ".\n"));
18
18
  return false;
19
19
  }
20
20
  else {
21
- Logging_1.green("\u2713 A compatible version of `" + packageName + "` is specified in `package.json`.");
21
+ (0, Logging_1.green)("\u2713 A compatible version of `".concat(packageName, "` is specified in `package.json`."));
22
22
  return true;
23
23
  }
24
24
  }
@@ -28,19 +28,19 @@ function fulfillsVersionRange(version, acceptableVersions, canBeLatest) {
28
28
  return canBeLatest;
29
29
  }
30
30
  var cleanedUserVersion, isRange;
31
- if (semver_1.valid(version)) {
32
- cleanedUserVersion = semver_1.valid(version);
31
+ if ((0, semver_1.valid)(version)) {
32
+ cleanedUserVersion = (0, semver_1.valid)(version);
33
33
  isRange = false;
34
34
  }
35
- else if (semver_1.validRange(version)) {
36
- cleanedUserVersion = semver_1.validRange(version);
35
+ else if ((0, semver_1.validRange)(version)) {
36
+ cleanedUserVersion = (0, semver_1.validRange)(version);
37
37
  isRange = true;
38
38
  }
39
39
  return (
40
40
  // If the given version is a bogus format, this will still be undefined and we'll automatically reject it
41
41
  !!cleanedUserVersion &&
42
42
  (isRange
43
- ? semver_1.subset(cleanedUserVersion, acceptableVersions)
44
- : semver_1.satisfies(cleanedUserVersion, acceptableVersions)));
43
+ ? (0, semver_1.subset)(cleanedUserVersion, acceptableVersions)
44
+ : (0, semver_1.satisfies)(cleanedUserVersion, acceptableVersions)));
45
45
  }
46
46
  //# sourceMappingURL=Package.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Package.js","sourceRoot":"","sources":["../../../lib/Helper/Package.ts"],"names":[],"mappings":";;;AAAA,0BAA4B;AAC5B,iCAA8D;AAE9D,qCAAuC;AAEvC,SAAgB,mBAAmB,CACjC,UAAmB,EACnB,WAAmB,EACnB,kBAA0B,EAC1B,WAAoB;IAEpB,IAAM,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IACrE,IAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC;IAE3E,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,EAAE;QACnC,aAAG,CAAC,YAAK,WAAW,iCAA8B,CAAC,CAAC;QACpD,aAAG,CAAC,oCAAoC,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC;KACd;SAAM,IACL,CAAC,oBAAoB,CAAC,WAAW,EAAE,kBAAkB,EAAE,WAAW,CAAC;QACnE,CAAC,oBAAoB,CAAC,cAAc,EAAE,kBAAkB,EAAE,WAAW,CAAC,EACtE;QACA,aAAG,CACD,wDAAoD,WAAW,kDAA8C,kBAAkB,QAAK,CACrI,CAAC;QACF,OAAO,KAAK,CAAC;KACd;SAAM;QACL,eAAK,CACH,qCAA+B,WAAW,sCAAsC,CACjF,CAAC;QACF,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AA3BD,kDA2BC;AAED,SAAS,oBAAoB,CAC3B,OAAe,EACf,kBAA0B,EAC1B,WAAoB;IAEpB,IAAI,OAAO,KAAK,QAAQ,EAAE;QACxB,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,kBAAkB,EAAE,OAAO,CAAC;IAEhC,IAAI,cAAK,CAAC,OAAO,CAAC,EAAE;QAClB,kBAAkB,GAAG,cAAK,CAAC,OAAO,CAAC,CAAC;QACpC,OAAO,GAAG,KAAK,CAAC;KACjB;SAAM,IAAI,mBAAU,CAAC,OAAO,CAAC,EAAE;QAC9B,kBAAkB,GAAG,mBAAU,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,GAAG,IAAI,CAAC;KAChB;IAED,OAAO;IACL,yGAAyG;IACzG,CAAC,CAAC,kBAAkB;QACpB,CAAC,OAAO;YACN,CAAC,CAAC,eAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;YAChD,CAAC,CAAC,kBAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CACvD,CAAC;AACJ,CAAC","sourcesContent":["import * as _ from 'lodash';\nimport { satisfies, subset, valid, validRange } from 'semver';\n\nimport { green, red } from './Logging';\n\nexport function checkPackageVersion(\n appPackage: unknown,\n packageName: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n): boolean {\n const depsVersion = _.get(appPackage, ['dependencies', packageName]);\n const devDepsVersion = _.get(appPackage, ['devDependencies', packageName]);\n\n if (!depsVersion && !devDepsVersion) {\n red(`✗ ${packageName} isn't in your dependencies.`);\n red(' Please install it with yarn/npm.');\n return false;\n } else if (\n !fulfillsVersionRange(depsVersion, acceptableVersions, canBeLatest) &&\n !fulfillsVersionRange(devDepsVersion, acceptableVersions, canBeLatest)\n ) {\n red(\n `✗ Your \\`package.json\\` specifies a version of \\`${packageName}\\` outside of the compatible version range ${acceptableVersions}.\\n`,\n );\n return false;\n } else {\n green(\n `✓ A compatible version of \\`${packageName}\\` is specified in \\`package.json\\`.`,\n );\n return true;\n }\n}\n\nfunction fulfillsVersionRange(\n version: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n): boolean {\n if (version === 'latest') {\n return canBeLatest;\n }\n\n let cleanedUserVersion, isRange;\n\n if (valid(version)) {\n cleanedUserVersion = valid(version);\n isRange = false;\n } else if (validRange(version)) {\n cleanedUserVersion = validRange(version);\n isRange = true;\n }\n\n return (\n // If the given version is a bogus format, this will still be undefined and we'll automatically reject it\n !!cleanedUserVersion &&\n (isRange\n ? subset(cleanedUserVersion, acceptableVersions)\n : satisfies(cleanedUserVersion, acceptableVersions))\n );\n}\n"]}
1
+ {"version":3,"file":"Package.js","sourceRoot":"","sources":["../../../lib/Helper/Package.ts"],"names":[],"mappings":";;;AAAA,0BAA4B;AAC5B,iCAA8D;AAE9D,qCAAuC;AAEvC,SAAgB,mBAAmB,CACjC,UAAmB,EACnB,WAAmB,EACnB,kBAA0B,EAC1B,WAAoB;IAEpB,IAAM,WAAW,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IACrE,IAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC;IAE3E,IAAI,CAAC,WAAW,IAAI,CAAC,cAAc,EAAE;QACnC,IAAA,aAAG,EAAC,iBAAK,WAAW,iCAA8B,CAAC,CAAC;QACpD,IAAA,aAAG,EAAC,oCAAoC,CAAC,CAAC;QAC1C,OAAO,KAAK,CAAC;KACd;SAAM,IACL,CAAC,oBAAoB,CAAC,WAAW,EAAE,kBAAkB,EAAE,WAAW,CAAC;QACnE,CAAC,oBAAoB,CAAC,cAAc,EAAE,kBAAkB,EAAE,WAAW,CAAC,EACtE;QACA,IAAA,aAAG,EACD,6DAAoD,WAAW,uDAA8C,kBAAkB,QAAK,CACrI,CAAC;QACF,OAAO,KAAK,CAAC;KACd;SAAM;QACL,IAAA,eAAK,EACH,0CAA+B,WAAW,sCAAsC,CACjF,CAAC;QACF,OAAO,IAAI,CAAC;KACb;AACH,CAAC;AA3BD,kDA2BC;AAED,SAAS,oBAAoB,CAC3B,OAAe,EACf,kBAA0B,EAC1B,WAAoB;IAEpB,IAAI,OAAO,KAAK,QAAQ,EAAE;QACxB,OAAO,WAAW,CAAC;KACpB;IAED,IAAI,kBAAkB,EAAE,OAAO,CAAC;IAEhC,IAAI,IAAA,cAAK,EAAC,OAAO,CAAC,EAAE;QAClB,kBAAkB,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,CAAC;QACpC,OAAO,GAAG,KAAK,CAAC;KACjB;SAAM,IAAI,IAAA,mBAAU,EAAC,OAAO,CAAC,EAAE;QAC9B,kBAAkB,GAAG,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;QACzC,OAAO,GAAG,IAAI,CAAC;KAChB;IAED,OAAO;IACL,yGAAyG;IACzG,CAAC,CAAC,kBAAkB;QACpB,CAAC,OAAO;YACN,CAAC,CAAC,IAAA,eAAM,EAAC,kBAAkB,EAAE,kBAAkB,CAAC;YAChD,CAAC,CAAC,IAAA,kBAAS,EAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CACvD,CAAC;AACJ,CAAC","sourcesContent":["import * as _ from 'lodash';\nimport { satisfies, subset, valid, validRange } from 'semver';\n\nimport { green, red } from './Logging';\n\nexport function checkPackageVersion(\n appPackage: unknown,\n packageName: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n): boolean {\n const depsVersion = _.get(appPackage, ['dependencies', packageName]);\n const devDepsVersion = _.get(appPackage, ['devDependencies', packageName]);\n\n if (!depsVersion && !devDepsVersion) {\n red(`✗ ${packageName} isn't in your dependencies.`);\n red(' Please install it with yarn/npm.');\n return false;\n } else if (\n !fulfillsVersionRange(depsVersion, acceptableVersions, canBeLatest) &&\n !fulfillsVersionRange(devDepsVersion, acceptableVersions, canBeLatest)\n ) {\n red(\n `✗ Your \\`package.json\\` specifies a version of \\`${packageName}\\` outside of the compatible version range ${acceptableVersions}.\\n`,\n );\n return false;\n } else {\n green(\n `✓ A compatible version of \\`${packageName}\\` is specified in \\`package.json\\`.`,\n );\n return true;\n }\n}\n\nfunction fulfillsVersionRange(\n version: string,\n acceptableVersions: string,\n canBeLatest: boolean,\n): boolean {\n if (version === 'latest') {\n return canBeLatest;\n }\n\n let cleanedUserVersion, isRange;\n\n if (valid(version)) {\n cleanedUserVersion = valid(version);\n isRange = false;\n } else if (validRange(version)) {\n cleanedUserVersion = validRange(version);\n isRange = true;\n }\n\n return (\n // If the given version is a bogus format, this will still be undefined and we'll automatically reject it\n !!cleanedUserVersion &&\n (isRange\n ? subset(cleanedUserVersion, acceptableVersions)\n : satisfies(cleanedUserVersion, acceptableVersions))\n );\n}\n"]}
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -56,7 +56,7 @@ function getPackageMangerChoice() {
56
56
  return null;
57
57
  }
58
58
  exports.getPackageMangerChoice = getPackageMangerChoice;
59
- var Npm = /** @class */ (function () {
59
+ var Npm = exports.Npm = /** @class */ (function () {
60
60
  function Npm() {
61
61
  }
62
62
  Npm.prototype.installPackage = function (packageName) {
@@ -76,8 +76,7 @@ var Npm = /** @class */ (function () {
76
76
  Npm.INSTALL_COMMAND = 'npm install';
77
77
  return Npm;
78
78
  }());
79
- exports.Npm = Npm;
80
- var Yarn = /** @class */ (function () {
79
+ var Yarn = exports.Yarn = /** @class */ (function () {
81
80
  function Yarn() {
82
81
  }
83
82
  Yarn.prototype.installPackage = function (packageName) {
@@ -97,8 +96,7 @@ var Yarn = /** @class */ (function () {
97
96
  Yarn.INSTALL_COMMAND = 'yarn add';
98
97
  return Yarn;
99
98
  }());
100
- exports.Yarn = Yarn;
101
- var Pnpm = /** @class */ (function () {
99
+ var Pnpm = exports.Pnpm = /** @class */ (function () {
102
100
  function Pnpm() {
103
101
  }
104
102
  Pnpm.prototype.installPackage = function (packageName) {
@@ -118,15 +116,14 @@ var Pnpm = /** @class */ (function () {
118
116
  Pnpm.INSTALL_COMMAND = 'pnpm add';
119
117
  return Pnpm;
120
118
  }());
121
- exports.Pnpm = Pnpm;
122
119
  function installPackage(command, packageName, label) {
123
120
  return __awaiter(this, void 0, void 0, function () {
124
121
  return __generator(this, function (_a) {
125
122
  switch (_a.label) {
126
- case 0: return [4 /*yield*/, util_1.promisify(child_process_1.exec)(command + " " + packageName)];
123
+ case 0: return [4 /*yield*/, (0, util_1.promisify)(child_process_1.exec)("".concat(command, " ").concat(packageName))];
127
124
  case 1:
128
125
  _a.sent();
129
- Logging_1.green("\u2713 Added `" + packageName + "` using `" + label + "`.");
126
+ (0, Logging_1.green)("\u2713 Added `".concat(packageName, "` using `").concat(label, "`."));
130
127
  return [2 /*return*/];
131
128
  }
132
129
  });
@@ -1 +1 @@
1
- {"version":3,"file":"PackageManager.js","sourceRoot":"","sources":["../../../lib/Helper/PackageManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+C;AAC/C,+CAAqC;AACrC,uBAAyB;AACzB,2BAA6B;AAC7B,6BAAiC;AAEjC,qCAAkC;AAElC,SAAgB,sBAAsB;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE;QAC3D,OAAO,IAAI,IAAI,EAAE,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;IANa,cAAS,GAAG,gBAAgB,CAAC;IAC7B,UAAK,GAAG,MAAM,CAAC;IACf,oBAAe,GAAG,UAAU,CAAC;IAK7C,WAAC;CAAA,AARD,IAQC;AARY,oBAAI;AAUjB,SAAe,cAAc,CAC3B,OAAe,EACf,WAAmB,EACnB,KAAa;;;;wBAEb,qBAAM,gBAAS,CAAC,oBAAI,CAAC,CAAI,OAAO,SAAI,WAAa,CAAC,EAAA;;oBAAlD,SAAkD,CAAC;oBACnD,eAAK,CAAC,mBAAa,WAAW,iBAAc,KAAK,OAAK,CAAC,CAAC;oBACxD,sBAAO;;;;CACR","sourcesContent":["/* eslint-disable @typescript-eslint/typedef */\nimport { exec } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { promisify } from 'util';\n\nimport { green } from './Logging';\n\nexport function getPackageMangerChoice(): PackageManager | null {\n if (fs.existsSync(path.join(process.cwd(), Yarn.LOCK_FILE))) {\n return new Yarn();\n }\n if (fs.existsSync(path.join(process.cwd(), Pnpm.LOCK_FILE))) {\n return new Pnpm();\n }\n if (fs.existsSync(path.join(process.cwd(), Npm.LOCK_FILE))) {\n return new Npm();\n }\n return null;\n}\n\nexport interface PackageManager {\n installPackage(packageName: string): Promise<void>;\n}\n\nexport class Npm implements PackageManager {\n public static LOCK_FILE = 'package-lock.json';\n public static LABEL = 'npm';\n public static INSTALL_COMMAND = 'npm install';\n\n public async installPackage(packageName: string): Promise<void> {\n await installPackage(Npm.INSTALL_COMMAND, packageName, Npm.LABEL);\n }\n}\n\nexport class Yarn implements PackageManager {\n public static LOCK_FILE = 'yarn.lock';\n public static LABEL = 'yarn';\n public static INSTALL_COMMAND = 'yarn add';\n\n public async installPackage(packageName: string): Promise<void> {\n await installPackage(Yarn.INSTALL_COMMAND, packageName, Yarn.LABEL);\n }\n}\n\nexport class Pnpm implements PackageManager {\n public static LOCK_FILE = 'pnpm-lock.yaml';\n public static LABEL = 'pnpm';\n public static INSTALL_COMMAND = 'pnpm add';\n\n public async installPackage(packageName: string): Promise<void> {\n await installPackage(Pnpm.INSTALL_COMMAND, packageName, Pnpm.LABEL);\n }\n}\n\nasync function installPackage(\n command: string,\n packageName: string,\n label: string,\n): Promise<void> {\n await promisify(exec)(`${command} ${packageName}`);\n green(`✓ Added \\`${packageName}\\` using \\`${label}\\`.`);\n return;\n}\n"]}
1
+ {"version":3,"file":"PackageManager.js","sourceRoot":"","sources":["../../../lib/Helper/PackageManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA+C;AAC/C,+CAAqC;AACrC,uBAAyB;AACzB,2BAA6B;AAC7B,6BAAiC;AAEjC,qCAAkC;AAElC,SAAgB,sBAAsB;IACpC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE;QAC3D,OAAO,IAAI,IAAI,EAAE,CAAC;KACnB;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE;QAC3D,OAAO,IAAI,IAAI,EAAE,CAAC;KACnB;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE;QAC1D,OAAO,IAAI,GAAG,EAAE,CAAC;KAClB;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAXD,wDAWC;AAMD;IAAA;IAQA,CAAC;IAHc,4BAAc,GAA3B,UAA4B,WAAmB;;;;4BAC7C,qBAAM,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,EAAA;;wBAAjE,SAAiE,CAAC;;;;;KACnE;IANa,aAAS,GAAG,mBAAmB,CAAC;IAChC,SAAK,GAAG,KAAK,CAAC;IACd,mBAAe,GAAG,aAAa,CAAC;IAKhD,UAAC;CAAA,AARD,IAQC;AAED;IAAA;IAQA,CAAC;IAHc,6BAAc,GAA3B,UAA4B,WAAmB;;;;4BAC7C,qBAAM,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,EAAA;;wBAAnE,SAAmE,CAAC;;;;;KACrE;IANa,cAAS,GAAG,WAAW,CAAC;IACxB,UAAK,GAAG,MAAM,CAAC;IACf,oBAAe,GAAG,UAAU,CAAC;IAK7C,WAAC;CAAA,AARD,IAQC;AAED;IAAA;IAQA,CAAC;IAHc,6BAAc,GAA3B,UAA4B,WAAmB;;;;4BAC7C,qBAAM,cAAc,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,EAAA;;wBAAnE,SAAmE,CAAC;;;;;KACrE;IANa,cAAS,GAAG,gBAAgB,CAAC;IAC7B,UAAK,GAAG,MAAM,CAAC;IACf,oBAAe,GAAG,UAAU,CAAC;IAK7C,WAAC;CAAA,AARD,IAQC;AAED,SAAe,cAAc,CAC3B,OAAe,EACf,WAAmB,EACnB,KAAa;;;;wBAEb,qBAAM,IAAA,gBAAS,EAAC,oBAAI,CAAC,CAAC,UAAG,OAAO,cAAI,WAAW,CAAE,CAAC,EAAA;;oBAAlD,SAAkD,CAAC;oBACnD,IAAA,eAAK,EAAC,wBAAa,WAAW,sBAAc,KAAK,OAAK,CAAC,CAAC;oBACxD,sBAAO;;;;CACR","sourcesContent":["/* eslint-disable @typescript-eslint/typedef */\nimport { exec } from 'child_process';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport { promisify } from 'util';\n\nimport { green } from './Logging';\n\nexport function getPackageMangerChoice(): PackageManager | null {\n if (fs.existsSync(path.join(process.cwd(), Yarn.LOCK_FILE))) {\n return new Yarn();\n }\n if (fs.existsSync(path.join(process.cwd(), Pnpm.LOCK_FILE))) {\n return new Pnpm();\n }\n if (fs.existsSync(path.join(process.cwd(), Npm.LOCK_FILE))) {\n return new Npm();\n }\n return null;\n}\n\nexport interface PackageManager {\n installPackage(packageName: string): Promise<void>;\n}\n\nexport class Npm implements PackageManager {\n public static LOCK_FILE = 'package-lock.json';\n public static LABEL = 'npm';\n public static INSTALL_COMMAND = 'npm install';\n\n public async installPackage(packageName: string): Promise<void> {\n await installPackage(Npm.INSTALL_COMMAND, packageName, Npm.LABEL);\n }\n}\n\nexport class Yarn implements PackageManager {\n public static LOCK_FILE = 'yarn.lock';\n public static LABEL = 'yarn';\n public static INSTALL_COMMAND = 'yarn add';\n\n public async installPackage(packageName: string): Promise<void> {\n await installPackage(Yarn.INSTALL_COMMAND, packageName, Yarn.LABEL);\n }\n}\n\nexport class Pnpm implements PackageManager {\n public static LOCK_FILE = 'pnpm-lock.yaml';\n public static LABEL = 'pnpm';\n public static INSTALL_COMMAND = 'pnpm add';\n\n public async installPackage(packageName: string): Promise<void> {\n await installPackage(Pnpm.INSTALL_COMMAND, packageName, Pnpm.LABEL);\n }\n}\n\nasync function installPackage(\n command: string,\n packageName: string,\n label: string,\n): Promise<void> {\n await promisify(exec)(`${command} ${packageName}`);\n green(`✓ Added \\`${packageName}\\` using \\`${label}\\`.`);\n return;\n}\n"]}
@@ -1,9 +1,9 @@
1
- import { Answers } from 'inquirer';
2
- import { Args } from '../Constants';
1
+ import type { Answers } from 'inquirer';
2
+ import type { Args } from '../Constants';
3
3
  export interface SentryCliProps {
4
4
  [s: string]: string;
5
5
  }
6
- declare type SentryCliConfig = Record<string, SentryCliProps>;
6
+ type SentryCliConfig = Record<string, SentryCliProps>;
7
7
  export declare class SentryCli {
8
8
  protected _argv: Args;
9
9
  private _resolve;
@@ -41,10 +41,10 @@ var SentryCli = /** @class */ (function () {
41
41
  key = key.replace(/\//g, '.');
42
42
  if (value === undefined || value === null) {
43
43
  // comment that property out since it has no value
44
- rv.push("#" + key + "=");
44
+ rv.push("#".concat(key, "="));
45
45
  }
46
46
  else {
47
- rv.push(key + "=" + value);
47
+ rv.push("".concat(key, "=").concat(value));
48
48
  }
49
49
  }
50
50
  }
@@ -57,7 +57,7 @@ var SentryCli = /** @class */ (function () {
57
57
  // eslint-disable-next-line no-prototype-builtins
58
58
  if (config.hasOwnProperty(sectionName)) {
59
59
  var props = this.dumpProperties(config[sectionName]);
60
- var section = "[" + sectionName + "]\n" + props;
60
+ var section = "[".concat(sectionName, "]\n").concat(props);
61
61
  dumpedSections.push(section);
62
62
  }
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../lib/Helper/SentryCli.ts"],"names":[],"mappings":";;;AACA,0BAA4B;AAC5B,2BAA6B;AAU7B;IAIE,mBAAsB,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;QAHjC,sDAAsD;QAC9C,aAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAEC,CAAC;IAE9B,sCAAkB,GAAzB,UAA0B,OAAiC;QACzD,IAAI,CAAC,QAAQ,GAAG,OAAc,CAAC;IACjC,CAAC;IAEM,8CAA0B,GAAjC,UAAkC,OAAgB;QAChD,IAAM,KAAK,GAAmB,EAAE,CAAC;QACjC,KAAK,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;QACvC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,CAAC;QACzE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAC;QACxE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;QAChE,IAAI;YACF,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE;gBAC1D,KAAK,EAA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,GAAG,MAAI,WAAW,WAAM,KAAO,CAAC;gBAC7C,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC9B;SACF;QACD,OAAO,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IACH,gBAAC;AAAD,CAAC,AA7DD,IA6DC;AA7DY,8BAAS","sourcesContent":["import { Answers } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport { Args } from '../Constants';\n\nexport interface SentryCliProps {\n [s: string]: string;\n}\n\ntype SentryCliConfig = Record<string, SentryCliProps>;\n\nexport class SentryCli {\n // eslint-disable-next-line @typescript-eslint/typedef\n private _resolve = require.resolve;\n\n constructor(protected _argv: Args) {}\n\n public setResolveFunction(resolve: (path: string) => string): void {\n this._resolve = resolve as any;\n }\n\n public convertAnswersToProperties(answers: Answers): SentryCliProps {\n const props: SentryCliProps = {};\n props['defaults/url'] = this._argv.url;\n props['defaults/org'] = _.get(answers, 'config.organization.slug', null);\n props['defaults/project'] = _.get(answers, 'config.project.slug', null);\n props['auth/token'] = _.get(answers, 'config.auth.token', null);\n try {\n const cliPath = this._resolve('@sentry/cli/bin/sentry-cli', {\n paths: [process.cwd()],\n });\n props['cli/executable'] = path\n .relative(process.cwd(), cliPath)\n .replace(/\\\\/g, '\\\\\\\\');\n } catch (e) {\n // we do nothing and leave everyting as it is\n }\n return props;\n }\n\n /** Create the contents of a `sentry.properties` file */\n public dumpProperties(props: SentryCliProps): string {\n const rv = [];\n for (let key in props) {\n // eslint-disable-next-line no-prototype-builtins\n if (props.hasOwnProperty(key)) {\n const value = props[key];\n key = key.replace(/\\//g, '.');\n if (value === undefined || value === null) {\n // comment that property out since it has no value\n rv.push(`#${key}=`);\n } else {\n rv.push(`${key}=${value}`);\n }\n }\n }\n // eslint-disable-next-line prefer-template\n return rv.join('\\n') + '\\n';\n }\n\n public dumpConfig(config: SentryCliConfig): string {\n const dumpedSections: string[] = [];\n for (const sectionName in config) {\n // eslint-disable-next-line no-prototype-builtins\n if (config.hasOwnProperty(sectionName)) {\n const props = this.dumpProperties(config[sectionName]);\n const section = `[${sectionName}]\\n${props}`;\n dumpedSections.push(section);\n }\n }\n return dumpedSections.join('\\n');\n }\n}\n"]}
1
+ {"version":3,"file":"SentryCli.js","sourceRoot":"","sources":["../../../lib/Helper/SentryCli.ts"],"names":[],"mappings":";;;AACA,0BAA4B;AAC5B,2BAA6B;AAU7B;IAIE,mBAA6B,KAAW;QAAX,UAAK,GAAL,KAAK,CAAM;QAHxC,sDAAsD;QAC9C,aAAQ,GAAG,OAAO,CAAC,OAAO,CAAC;IAEQ,CAAC;IAErC,sCAAkB,GAAzB,UAA0B,OAAiC;QACzD,IAAI,CAAC,QAAQ,GAAG,OAAc,CAAC;IACjC,CAAC;IAEM,8CAA0B,GAAjC,UAAkC,OAAgB;QAChD,IAAM,KAAK,GAAmB,EAAE,CAAC;QACjC,KAAK,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;QACvC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,0BAA0B,EAAE,IAAI,CAAC,CAAC;QACzE,KAAK,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,qBAAqB,EAAE,IAAI,CAAC,CAAC;QACxE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,IAAI,CAAC,CAAC;QAChE,IAAI;YACF,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,4BAA4B,EAAE;gBAC1D,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;aACvB,CAAC,CAAC;YACH,KAAK,CAAC,gBAAgB,CAAC,GAAG,IAAI;iBAC3B,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,CAAC;iBAChC,OAAO,CAAC,KAAK,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gBAAC;AAAD,CAAC,AA7DD,IA6DC;AA7DY,8BAAS","sourcesContent":["import type { Answers } from 'inquirer';\nimport * as _ from 'lodash';\nimport * as path from 'path';\n\nimport type { Args } from '../Constants';\n\nexport interface SentryCliProps {\n [s: string]: string;\n}\n\ntype SentryCliConfig = Record<string, SentryCliProps>;\n\nexport class SentryCli {\n // eslint-disable-next-line @typescript-eslint/typedef\n private _resolve = require.resolve;\n\n public constructor(protected _argv: Args) {}\n\n public setResolveFunction(resolve: (path: string) => string): void {\n this._resolve = resolve as any;\n }\n\n public convertAnswersToProperties(answers: Answers): SentryCliProps {\n const props: SentryCliProps = {};\n props['defaults/url'] = this._argv.url;\n props['defaults/org'] = _.get(answers, 'config.organization.slug', null);\n props['defaults/project'] = _.get(answers, 'config.project.slug', null);\n props['auth/token'] = _.get(answers, 'config.auth.token', null);\n try {\n const cliPath = this._resolve('@sentry/cli/bin/sentry-cli', {\n paths: [process.cwd()],\n });\n props['cli/executable'] = path\n .relative(process.cwd(), cliPath)\n .replace(/\\\\/g, '\\\\\\\\');\n } catch (e) {\n // we do nothing and leave everyting as it is\n }\n return props;\n }\n\n /** Create the contents of a `sentry.properties` file */\n public dumpProperties(props: SentryCliProps): string {\n const rv = [];\n for (let key in props) {\n // eslint-disable-next-line no-prototype-builtins\n if (props.hasOwnProperty(key)) {\n const value = props[key];\n key = key.replace(/\\//g, '.');\n if (value === undefined || value === null) {\n // comment that property out since it has no value\n rv.push(`#${key}=`);\n } else {\n rv.push(`${key}=${value}`);\n }\n }\n }\n // eslint-disable-next-line prefer-template\n return rv.join('\\n') + '\\n';\n }\n\n public dumpConfig(config: SentryCliConfig): string {\n const dumpedSections: string[] = [];\n for (const sectionName in config) {\n // eslint-disable-next-line no-prototype-builtins\n if (config.hasOwnProperty(sectionName)) {\n const props = this.dumpProperties(config[sectionName]);\n const section = `[${sectionName}]\\n${props}`;\n dumpedSections.push(section);\n }\n }\n return dumpedSections.join('\\n');\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
- import { Answers } from 'inquirer';
2
- import { Args } from '../Constants';
3
- import { IStep } from '../Steps/BaseStep';
4
- import { BaseIntegration } from '../Steps/Integrations/BaseIntegration';
1
+ import type { Answers } from 'inquirer';
2
+ import type { Args } from '../Constants';
3
+ import type { IStep } from '../Steps/BaseStep';
4
+ import type { BaseIntegration } from '../Steps/Integrations/BaseIntegration';
5
5
  export declare function getCurrentIntegration(answers: Answers): BaseIntegration;
6
6
  export declare function startWizard<M extends IStep>(argv: Args, ...steps: Array<{
7
7
  new (debug: Args): M;
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  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;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -55,11 +55,11 @@ var Logging_1 = require("./Logging");
55
55
  function sanitizeAndValidateArgs(argv) {
56
56
  if (!argv.url) {
57
57
  argv.url = Constants_1.DEFAULT_URL;
58
- Logging_1.dim("no URL provided, fallback to " + argv.url);
58
+ (0, Logging_1.dim)("no URL provided, fallback to ".concat(argv.url));
59
59
  }
60
60
  if (argv.quiet === undefined) {
61
61
  argv.quiet = true;
62
- Logging_1.dim('will activate quiet mode for you');
62
+ (0, Logging_1.dim)('will activate quiet mode for you');
63
63
  }
64
64
  var baseUrl = argv.url;
65
65
  baseUrl += baseUrl.endsWith('/') ? '' : '/';
@@ -93,10 +93,10 @@ function startWizard(argv) {
93
93
  _a.trys.push([0, 2, , 3]);
94
94
  sanitizeAndValidateArgs(argv);
95
95
  if (argv.debug) {
96
- Logging_1.debug(argv);
96
+ (0, Logging_1.debug)(argv);
97
97
  }
98
98
  if (argv.quiet) {
99
- Logging_1.dim("Quiet mode On, DAMA, don't ask me anything");
99
+ (0, Logging_1.dim)("Quiet mode On, DAMA, don't ask me anything");
100
100
  }
101
101
  return [4 /*yield*/, steps
102
102
  .map(function (step) { return new step(argv); })
@@ -118,12 +118,12 @@ function startWizard(argv) {
118
118
  case 2:
119
119
  e_1 = _a.sent();
120
120
  BottomBar_1.BottomBar.hide();
121
- Logging_1.nl();
122
- Logging_1.red('Sentry Wizard failed with:');
123
- Logging_1.red(argv.debug ? e_1 : e_1.message);
124
- Logging_1.nl();
125
- Logging_1.red('Protip: Add --debug to see whats going on');
126
- Logging_1.red('OR use --help to see your options');
121
+ (0, Logging_1.nl)();
122
+ (0, Logging_1.red)('Sentry Wizard failed with:');
123
+ (0, Logging_1.red)(argv.debug ? e_1 : e_1.message);
124
+ (0, Logging_1.nl)();
125
+ (0, Logging_1.red)('Protip: Add --debug to see whats going on');
126
+ (0, Logging_1.red)('OR use --help to see your options');
127
127
  process.exit(1);
128
128
  return [3 /*break*/, 3];
129
129
  case 3: return [2 /*return*/];