@sentry/wizard 3.25.0 → 3.25.2

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 (61) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/bin.ts +10 -2
  3. package/dist/bin.js +12 -3
  4. package/dist/bin.js.map +1 -1
  5. package/dist/lib/Helper/Env.js +1 -0
  6. package/dist/lib/Helper/Env.js.map +1 -1
  7. package/dist/lib/Setup.d.ts +6 -0
  8. package/dist/lib/Setup.js +6 -0
  9. package/dist/lib/Setup.js.map +1 -1
  10. package/dist/lib/Steps/ChooseIntegration.js +0 -29
  11. package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
  12. package/dist/package.json +2 -1
  13. package/dist/src/remix/codemods/handle-error.js +35 -33
  14. package/dist/src/remix/codemods/handle-error.js.map +1 -1
  15. package/dist/src/remix/templates.d.ts +1 -1
  16. package/dist/src/remix/templates.js +1 -1
  17. package/dist/src/remix/templates.js.map +1 -1
  18. package/dist/src/run.d.ts +16 -0
  19. package/dist/src/run.js +195 -0
  20. package/dist/src/run.js.map +1 -0
  21. package/dist/src/utils/clack-utils.js +1 -1
  22. package/dist/src/utils/clack-utils.js.map +1 -1
  23. package/dist/src/utils/package-json.d.ts +1 -0
  24. package/dist/src/utils/package-json.js.map +1 -1
  25. package/lib/Helper/Env.ts +1 -0
  26. package/lib/Setup.ts +6 -0
  27. package/lib/Steps/ChooseIntegration.ts +0 -29
  28. package/package.json +2 -1
  29. package/src/remix/codemods/handle-error.ts +57 -37
  30. package/src/remix/templates.ts +3 -3
  31. package/src/run.ts +142 -0
  32. package/src/utils/clack-utils.ts +1 -1
  33. package/src/utils/package-json.ts +1 -0
  34. package/dist/lib/Steps/Integrations/Android.d.ts +0 -9
  35. package/dist/lib/Steps/Integrations/Android.js +0 -86
  36. package/dist/lib/Steps/Integrations/Android.js.map +0 -1
  37. package/dist/lib/Steps/Integrations/Apple.d.ts +0 -10
  38. package/dist/lib/Steps/Integrations/Apple.js +0 -92
  39. package/dist/lib/Steps/Integrations/Apple.js.map +0 -1
  40. package/dist/lib/Steps/Integrations/NextJsShim.d.ts +0 -13
  41. package/dist/lib/Steps/Integrations/NextJsShim.js +0 -99
  42. package/dist/lib/Steps/Integrations/NextJsShim.js.map +0 -1
  43. package/dist/lib/Steps/Integrations/ReactNative.d.ts +0 -10
  44. package/dist/lib/Steps/Integrations/ReactNative.js +0 -93
  45. package/dist/lib/Steps/Integrations/ReactNative.js.map +0 -1
  46. package/dist/lib/Steps/Integrations/Remix.d.ts +0 -12
  47. package/dist/lib/Steps/Integrations/Remix.js +0 -98
  48. package/dist/lib/Steps/Integrations/Remix.js.map +0 -1
  49. package/dist/lib/Steps/Integrations/SourceMapsShim.d.ts +0 -13
  50. package/dist/lib/Steps/Integrations/SourceMapsShim.js +0 -94
  51. package/dist/lib/Steps/Integrations/SourceMapsShim.js.map +0 -1
  52. package/dist/lib/Steps/Integrations/SvelteKitShim.d.ts +0 -13
  53. package/dist/lib/Steps/Integrations/SvelteKitShim.js +0 -99
  54. package/dist/lib/Steps/Integrations/SvelteKitShim.js.map +0 -1
  55. package/lib/Steps/Integrations/Android.ts +0 -23
  56. package/lib/Steps/Integrations/Apple.ts +0 -27
  57. package/lib/Steps/Integrations/NextJsShim.ts +0 -33
  58. package/lib/Steps/Integrations/ReactNative.ts +0 -28
  59. package/lib/Steps/Integrations/Remix.ts +0 -32
  60. package/lib/Steps/Integrations/SourceMapsShim.ts +0 -28
  61. package/lib/Steps/Integrations/SvelteKitShim.ts +0 -33
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/wizard",
3
- "version": "3.25.0",
3
+ "version": "3.25.2",
4
4
  "homepage": "https://github.com/getsentry/sentry-wizard",
5
5
  "repository": "https://github.com/getsentry/sentry-wizard",
6
6
  "description": "Sentry wizard helping you to configure your project",
@@ -50,6 +50,7 @@
50
50
  "@types/node": "^10.11.0",
51
51
  "@types/rimraf": "^3.0.2",
52
52
  "@types/semver": "^7.3.7",
53
+ "@types/yargs": "^16.0.9",
53
54
  "@typescript-eslint/eslint-plugin": "^5.13.0",
54
55
  "@typescript-eslint/parser": "^5.13.0",
55
56
  "eslint": "^8.18.0",
@@ -22,14 +22,29 @@ export function instrumentHandleError(
22
22
  ): boolean {
23
23
  const originalEntryServerModAST = originalEntryServerMod.$ast as Program;
24
24
 
25
- const handleErrorFunction = originalEntryServerModAST.body.find(
26
- (node) =>
27
- node.type === 'ExportNamedDeclaration' &&
28
- node.declaration?.type === 'FunctionDeclaration' &&
29
- node.declaration.id?.name === 'handleError',
25
+ const handleErrorFunctionExport = originalEntryServerModAST.body.find(
26
+ (node) => {
27
+ return (
28
+ node.type === 'ExportNamedDeclaration' &&
29
+ node.declaration?.type === 'FunctionDeclaration' &&
30
+ node.declaration.id?.name === 'handleError'
31
+ );
32
+ },
30
33
  );
31
34
 
32
- if (!handleErrorFunction) {
35
+ const handleErrorFunctionVariableDeclarationExport =
36
+ originalEntryServerModAST.body.find(
37
+ (node) =>
38
+ node.type === 'ExportNamedDeclaration' &&
39
+ node.declaration?.type === 'VariableDeclaration' &&
40
+ // @ts-expect-error - id should always have a name in this case
41
+ node.declaration.declarations[0].id.name === 'handleError',
42
+ );
43
+
44
+ if (
45
+ !handleErrorFunctionExport &&
46
+ !handleErrorFunctionVariableDeclarationExport
47
+ ) {
33
48
  clack.log.warn(
34
49
  `Could not find function ${chalk.cyan('handleError')} in ${chalk.cyan(
35
50
  serverEntryFilename,
@@ -48,50 +63,55 @@ export function instrumentHandleError(
48
63
  recast.types.builders.exportNamedDeclaration(implementation),
49
64
  );
50
65
  } else if (
51
- hasSentryContent(
52
- generateCode(handleErrorFunction).code,
53
- originalEntryServerMod.$code,
54
- 'captureRemixServerException',
55
- )
66
+ (handleErrorFunctionExport &&
67
+ ['wrapHandleErrorWithSentry', 'sentryHandleError'].some((util) =>
68
+ hasSentryContent(
69
+ generateCode(handleErrorFunctionExport).code,
70
+ originalEntryServerMod.$code,
71
+ util,
72
+ ),
73
+ )) ||
74
+ (handleErrorFunctionVariableDeclarationExport &&
75
+ ['wrapHandleErrorWithSentry', 'sentryHandleError'].some((util) =>
76
+ hasSentryContent(
77
+ generateCode(handleErrorFunctionVariableDeclarationExport).code,
78
+ originalEntryServerMod.$code,
79
+ util,
80
+ ),
81
+ ))
56
82
  ) {
57
83
  return false;
58
- } else {
84
+ } else if (handleErrorFunctionExport) {
59
85
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
60
86
  const implementation = recast.parse(HANDLE_ERROR_TEMPLATE_V2).program
61
87
  .body[0];
62
88
 
63
- // @ts-expect-error - string works here because the AST is proxified by magicast
89
+ // If the current handleError function has a body, we need to merge the new implementation with the existing one
64
90
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
65
- handleErrorFunction.declaration.body.body.unshift(
91
+ implementation.declarations[0].init.arguments[0].body.body.unshift(
92
+ // @ts-expect-error - declaration works here because the AST is proxified by magicast
66
93
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
67
- recast.parse(HANDLE_ERROR_TEMPLATE_V2).program.body[0].body.body[0],
94
+ ...handleErrorFunctionExport.declaration.body.body,
68
95
  );
69
96
 
70
- // First parameter is the error
71
- //
72
- // @ts-expect-error - string works here because the AST is proxified by magicast
97
+ // @ts-expect-error - declaration works here because the AST is proxified by magicast
98
+ handleErrorFunctionExport.declaration = implementation;
99
+ } else if (handleErrorFunctionVariableDeclarationExport) {
73
100
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
74
- handleErrorFunction.declaration.params[0] = implementation.params[0];
101
+ const implementation = recast.parse(HANDLE_ERROR_TEMPLATE_V2).program
102
+ .body[0];
75
103
 
76
- // Second parameter is the request inside an object
77
- // Merging the object properties to make sure it includes request
78
- //
79
- // @ts-expect-error - string works here because the AST is proxified by magicast
80
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
81
- if (handleErrorFunction.declaration.params?.[1]?.properties) {
82
- // @ts-expect-error - string works here because the AST is proxified by magicast
83
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
84
- handleErrorFunction.declaration.params[1].properties.push(
85
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
86
- implementation.params[1].properties[0],
87
- );
88
- } else {
89
- // Create second parameter if it doesn't exist
90
- //
91
- // @ts-expect-error - string works here because the AST is proxified by magicast
104
+ // If the current handleError function has a body, we need to merge the new implementation with the existing one
105
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
106
+ implementation.declarations[0].init.arguments[0].body.body.unshift(
107
+ // @ts-expect-error - declaration works here because the AST is proxified by magicast
92
108
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
93
- handleErrorFunction.declaration.params[1] = implementation.params[1];
94
- }
109
+ ...handleErrorFunctionVariableDeclarationExport.declaration
110
+ .declarations[0].init.body.body,
111
+ );
112
+
113
+ // @ts-expect-error - declaration works here because the AST is proxified by magicast
114
+ handleErrorFunctionVariableDeclarationExport.declaration = implementation;
95
115
  }
96
116
 
97
117
  return true;
@@ -5,7 +5,7 @@ export const ERROR_BOUNDARY_TEMPLATE_V2 = `const ErrorBoundary = () => {
5
5
  };
6
6
  `;
7
7
 
8
- export const HANDLE_ERROR_TEMPLATE_V2 = `function handleError(error, { request }) {
9
- Sentry.captureRemixServerException(error, 'remix.server', request, true);
10
- }
8
+ export const HANDLE_ERROR_TEMPLATE_V2 = `const handleError = Sentry.wrapHandleErrorWithSentry((error, { request }) => {
9
+ // Custom handleError implementation
10
+ });
11
11
  `;
package/src/run.ts ADDED
@@ -0,0 +1,142 @@
1
+ // @ts-ignore - clack is ESM and TS complains about that. It works though
2
+ import * as clack from '@clack/prompts';
3
+ import { abortIfCancelled } from './utils/clack-utils';
4
+ import { runReactNativeWizard } from './react-native/react-native-wizard';
5
+
6
+ import { run as legacyRun } from '../lib/Setup';
7
+ import { WizardOptions } from './utils/types';
8
+ import { runAndroidWizard } from './android/android-wizard';
9
+ import { runAppleWizard } from './apple/apple-wizard';
10
+ import { runNextjsWizard } from './nextjs/nextjs-wizard';
11
+ import { runRemixWizard } from './remix/remix-wizard';
12
+ import { runSvelteKitWizard } from './sveltekit/sveltekit-wizard';
13
+ import { runSourcemapsWizard } from './sourcemaps/sourcemaps-wizard';
14
+ import { readEnvironment } from '../lib/Helper/Env';
15
+ import { Platform } from '../lib/Constants';
16
+ import { PackageDotJson } from './utils/package-json';
17
+
18
+ type WizardIntegration =
19
+ | 'reactNative'
20
+ | 'ios'
21
+ | 'android'
22
+ | 'cordova'
23
+ | 'electron'
24
+ | 'nextjs'
25
+ | 'remix'
26
+ | 'sveltekit'
27
+ | 'sourcemaps';
28
+
29
+ type Args = {
30
+ integration?: WizardIntegration;
31
+
32
+ uninstall: boolean;
33
+ signup: boolean;
34
+ skipConnect: boolean;
35
+ debug: boolean;
36
+ quiet: boolean;
37
+ disableTelemetry: boolean;
38
+ promoCode?: string;
39
+
40
+ url?: string;
41
+ platform?: Platform[];
42
+ };
43
+
44
+ export async function run(argv: Args) {
45
+ const finalArgs = {
46
+ ...argv,
47
+ ...readEnvironment(),
48
+ };
49
+
50
+ let integration = finalArgs.integration;
51
+ if (!integration) {
52
+ clack.intro(`Sentry Wizard ${tryGetWizardVersion()}`);
53
+
54
+ integration = await abortIfCancelled(
55
+ clack.select({
56
+ message: 'What do you want to set up?',
57
+ options: [
58
+ { value: 'reactNative', label: 'React Native' },
59
+ { value: 'ios', label: 'iOS' },
60
+ { value: 'android', label: 'Android' },
61
+ { value: 'cordova', label: 'Cordova' },
62
+ { value: 'electron', label: 'Electron' },
63
+ { value: 'nextjs', label: 'NextJS' },
64
+ { value: 'remix', label: 'Remix' },
65
+ { value: 'sveltekit', label: 'SvelteKit' },
66
+ { value: 'sourcemaps', label: 'Configure Source Maps Upload' },
67
+ ],
68
+ }),
69
+ );
70
+
71
+ if (!integration) {
72
+ clack.log.error('No integration selected. Exiting.');
73
+ return;
74
+ }
75
+
76
+ clack.outro(`Starting ${integration} setup`);
77
+ }
78
+
79
+ const wizardOptions: WizardOptions = {
80
+ telemetryEnabled: !argv.disableTelemetry,
81
+ promoCode: argv.promoCode,
82
+ url: argv.url,
83
+ };
84
+
85
+ switch (integration) {
86
+ case 'reactNative':
87
+ await runReactNativeWizard({
88
+ ...wizardOptions,
89
+ uninstall: argv.uninstall,
90
+ });
91
+ break;
92
+
93
+ case 'ios':
94
+ await runAppleWizard(wizardOptions);
95
+ break;
96
+
97
+ case 'android':
98
+ await runAndroidWizard(wizardOptions);
99
+ break;
100
+
101
+ case 'nextjs':
102
+ await runNextjsWizard(wizardOptions);
103
+ break;
104
+
105
+ case 'remix':
106
+ await runRemixWizard(wizardOptions);
107
+ break;
108
+
109
+ case 'sveltekit':
110
+ await runSvelteKitWizard(wizardOptions);
111
+ break;
112
+
113
+ case 'sourcemaps':
114
+ await runSourcemapsWizard(wizardOptions);
115
+ break;
116
+
117
+ case 'cordova':
118
+ argv.integration = 'cordova';
119
+ void legacyRun(argv);
120
+ break;
121
+
122
+ case 'electron':
123
+ argv.integration = 'electron';
124
+ void legacyRun(argv);
125
+ break;
126
+
127
+ default:
128
+ clack.log.error(`No setup wizard selected!`);
129
+ }
130
+ }
131
+
132
+ /**
133
+ * TODO: replace with rollup replace whenever we switch to rollup
134
+ */
135
+ function tryGetWizardVersion(): string {
136
+ try {
137
+ const wizardPkgJson = require('../package.json') as PackageDotJson;
138
+ return wizardPkgJson.version ?? '';
139
+ } catch {
140
+ return '';
141
+ }
142
+ }
@@ -875,7 +875,7 @@ async function askForSelfHosted(urlFromArgs?: string): Promise<{
875
875
  }
876
876
  } catch {
877
877
  clack.log.error(
878
- 'Please enter a valid URL. (It should look something like "https://sentry.mydomain.com/")',
878
+ `Please enter a valid URL. (It should look something like "https://sentry.mydomain.com/", got ${url})`,
879
879
  );
880
880
  }
881
881
  }
@@ -1,4 +1,5 @@
1
1
  export type PackageDotJson = {
2
+ version?: string;
2
3
  scripts?: Record<string, string | undefined>;
3
4
  dependencies?: Record<string, string>;
4
5
  devDependencies?: Record<string, string>;
@@ -1,9 +0,0 @@
1
- import { Answers } from 'inquirer';
2
- import { BaseIntegration } from './BaseIntegration';
3
- import { Args } from '../../Constants';
4
- export declare class Android extends BaseIntegration {
5
- protected _argv: Args;
6
- constructor(_argv: Args);
7
- emit(_answers: Answers): Promise<Answers>;
8
- shouldConfigure(_answers: Answers): Promise<Answers>;
9
- }
@@ -1,86 +0,0 @@
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.Android = void 0;
55
- var BaseIntegration_1 = require("./BaseIntegration");
56
- var android_wizard_1 = require("../../../src/android/android-wizard");
57
- var Android = /** @class */ (function (_super) {
58
- __extends(Android, _super);
59
- function Android(_argv) {
60
- var _this = _super.call(this, _argv) || this;
61
- _this._argv = _argv;
62
- return _this;
63
- }
64
- Android.prototype.emit = function (_answers) {
65
- return __awaiter(this, void 0, void 0, function () {
66
- return __generator(this, function (_a) {
67
- switch (_a.label) {
68
- case 0: return [4 /*yield*/, (0, android_wizard_1.runAndroidWizard)({
69
- promoCode: this._argv.promoCode,
70
- url: this._argv.url,
71
- telemetryEnabled: !this._argv.disableTelemetry,
72
- })];
73
- case 1:
74
- _a.sent();
75
- return [2 /*return*/, {}];
76
- }
77
- });
78
- });
79
- };
80
- Android.prototype.shouldConfigure = function (_answers) {
81
- return this._shouldConfigure;
82
- };
83
- return Android;
84
- }(BaseIntegration_1.BaseIntegration));
85
- exports.Android = Android;
86
- //# sourceMappingURL=Android.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Android.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/Android.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qDAAoD;AAEpD,sEAAuE;AAEvE;IAA6B,2BAAe;IAC1C,iBAA6B,KAAW;QAAxC,YACE,kBAAM,KAAK,CAAC,SACb;QAF4B,WAAK,GAAL,KAAK,CAAM;;IAExC,CAAC;IAEY,sBAAI,GAAjB,UAAkB,QAAiB;;;;4BACjC,qBAAM,IAAA,iCAAgB,EAAC;4BACrB,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;yBAC/C,CAAC,EAAA;;wBAJF,SAIE,CAAC;wBACH,sBAAO,EAAE,EAAC;;;;KACX;IAEM,iCAAe,GAAtB,UAAuB,QAAiB;QACtC,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IACH,cAAC;AAAD,CAAC,AAjBD,CAA6B,iCAAe,GAiB3C;AAjBY,0BAAO","sourcesContent":["import { Answers } from 'inquirer';\nimport { BaseIntegration } from './BaseIntegration';\nimport { Args } from '../../Constants';\nimport { runAndroidWizard } from '../../../src/android/android-wizard';\n\nexport class Android extends BaseIntegration {\n public constructor(protected _argv: Args) {\n super(_argv);\n }\n\n public async emit(_answers: Answers): Promise<Answers> {\n await runAndroidWizard({\n promoCode: this._argv.promoCode,\n url: this._argv.url,\n telemetryEnabled: !this._argv.disableTelemetry,\n });\n return {};\n }\n\n public shouldConfigure(_answers: Answers): Promise<Answers> {\n return this._shouldConfigure;\n }\n}\n"]}
@@ -1,10 +0,0 @@
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
- }
@@ -1,92 +0,0 @@
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
@@ -1 +0,0 @@
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"]}
@@ -1,13 +0,0 @@
1
- import type { Answers } from 'inquirer';
2
- import type { Args } from '../../Constants';
3
- import { BaseIntegration } from './BaseIntegration';
4
- /**
5
- * This class just redirects to the new `nextjs-wizard.ts` flow
6
- * for anyone calling the wizard without the '-i nextjs' flag.
7
- */
8
- export declare class NextJsShim extends BaseIntegration {
9
- protected _argv: Args;
10
- constructor(_argv: Args);
11
- emit(_answers: Answers): Promise<Answers>;
12
- shouldConfigure(_answers: Answers): Promise<Answers>;
13
- }
@@ -1,99 +0,0 @@
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.NextJsShim = void 0;
55
- var nextjs_wizard_1 = require("../../../src/nextjs/nextjs-wizard");
56
- var BaseIntegration_1 = require("./BaseIntegration");
57
- /**
58
- * This class just redirects to the new `nextjs-wizard.ts` flow
59
- * for anyone calling the wizard without the '-i nextjs' flag.
60
- */
61
- var NextJsShim = /** @class */ (function (_super) {
62
- __extends(NextJsShim, _super);
63
- function NextJsShim(_argv) {
64
- var _this = _super.call(this, _argv) || this;
65
- _this._argv = _argv;
66
- return _this;
67
- }
68
- NextJsShim.prototype.emit = function (_answers) {
69
- return __awaiter(this, void 0, void 0, function () {
70
- return __generator(this, function (_a) {
71
- switch (_a.label) {
72
- case 0: return [4 /*yield*/, (0, nextjs_wizard_1.runNextjsWizard)({
73
- promoCode: this._argv.promoCode,
74
- url: this._argv.url,
75
- telemetryEnabled: !this._argv.disableTelemetry,
76
- })];
77
- case 1:
78
- _a.sent();
79
- return [2 /*return*/, {}];
80
- }
81
- });
82
- });
83
- };
84
- NextJsShim.prototype.shouldConfigure = function (_answers) {
85
- return __awaiter(this, void 0, void 0, function () {
86
- return __generator(this, function (_a) {
87
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
88
- if (this._shouldConfigure) {
89
- return [2 /*return*/, this._shouldConfigure];
90
- }
91
- // eslint-disable-next-line @typescript-eslint/unbound-method
92
- return [2 /*return*/, this.shouldConfigure];
93
- });
94
- });
95
- };
96
- return NextJsShim;
97
- }(BaseIntegration_1.BaseIntegration));
98
- exports.NextJsShim = NextJsShim;
99
- //# sourceMappingURL=NextJsShim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextJsShim.js","sourceRoot":"","sources":["../../../../lib/Steps/Integrations/NextJsShim.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,mEAAoE;AAGpE,qDAAoD;AAEpD;;;GAGG;AACH;IAAgC,8BAAe;IAC7C,oBAA6B,KAAW;QAAxC,YACE,kBAAM,KAAK,CAAC,SACb;QAF4B,WAAK,GAAL,KAAK,CAAM;;IAExC,CAAC;IAEY,yBAAI,GAAjB,UAAkB,QAAiB;;;;4BACjC,qBAAM,IAAA,+BAAe,EAAC;4BACpB,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;yBAC/C,CAAC,EAAA;;wBAJF,SAIE,CAAC;wBACH,sBAAO,EAAE,EAAC;;;;KACX;IAEY,oCAAe,GAA5B,UAA6B,QAAiB;;;gBAC5C,kEAAkE;gBAClE,IAAI,IAAI,CAAC,gBAAgB,EAAE;oBACzB,sBAAO,IAAI,CAAC,gBAAgB,EAAC;iBAC9B;gBACD,6DAA6D;gBAC7D,sBAAO,IAAI,CAAC,eAAe,EAAC;;;KAC7B;IACH,iBAAC;AAAD,CAAC,AAtBD,CAAgC,iCAAe,GAsB9C;AAtBY,gCAAU","sourcesContent":["import type { Answers } from 'inquirer';\nimport { runNextjsWizard } from '../../../src/nextjs/nextjs-wizard';\n\nimport type { Args } from '../../Constants';\nimport { BaseIntegration } from './BaseIntegration';\n\n/**\n * This class just redirects to the new `nextjs-wizard.ts` flow\n * for anyone calling the wizard without the '-i nextjs' flag.\n */\nexport class NextJsShim extends BaseIntegration {\n public constructor(protected _argv: Args) {\n super(_argv);\n }\n\n public async emit(_answers: Answers): Promise<Answers> {\n await runNextjsWizard({\n promoCode: this._argv.promoCode,\n url: this._argv.url,\n telemetryEnabled: !this._argv.disableTelemetry,\n });\n return {};\n }\n\n public async shouldConfigure(_answers: Answers): Promise<Answers> {\n // eslint-disable-next-line @typescript-eslint/no-misused-promises\n if (this._shouldConfigure) {\n return this._shouldConfigure;\n }\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return this.shouldConfigure;\n }\n}\n"]}
@@ -1,10 +0,0 @@
1
- import { Answers } from 'inquirer';
2
- import { type Args } from '../../Constants';
3
- import { BaseIntegration } from './BaseIntegration';
4
- export declare class ReactNative 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
- }