File tree Expand file tree Collapse file tree 8 files changed +35
-12
lines changed
Expand file tree Collapse file tree 8 files changed +35
-12
lines changed Original file line number Diff line number Diff line change 1616[ ![ deps dev] ( https://david-dm.org/getsentry/sentry-wizard/dev-status.svg )] ( https://david-dm.org/getsentry/sentry-wizard?type=dev&view=list )
1717[ ![ deps peer] ( https://david-dm.org/getsentry/sentry-wizard/peer-status.svg )] ( https://david-dm.org/getsentry/sentry-wizard?type=peer&view=list )
1818
19+ # Usage
20+
21+ Install it with ` npm ` or ` yarn `
22+
23+ ```
24+ npm install @sentry/wizard
25+ ```
26+
27+ Call ` sentry-wizard ` in your project and follow the instructions.
1928
2029# Options
2130```
Original file line number Diff line number Diff line change 1+ // Key value should be the same here
12export enum ProjectType {
2- reactNative = 'react-native ' ,
3+ reactNative = 'reactNative ' ,
34 browser = 'browser' ,
45 node = 'node'
56}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ function prepareMessage(msg: any) {
88 return msg ;
99 }
1010 if ( msg instanceof Error ) {
11- return `${ msg . name } : ${ msg . message } ${ msg . stack || '' } ` ;
11+ return `${ msg . stack || '' } ` ;
1212 }
1313 return JSON . stringify ( msg , null , '\t' ) ;
1414}
Original file line number Diff line number Diff line change 11import { Answers } from 'inquirer' ;
2+ import * as _ from 'lodash' ;
23import { dim } from '../Helper' ;
34import { BaseStep } from './Step' ;
45
56let wizardPackage : any = { } ;
6- let projectPackage : any = { } ;
7+ let sentryCliPackage : any = { } ;
78
89try {
9- // If we run directly in setup-wizard
10- projectPackage = require ( '../../package.json' ) ;
11- } catch {
12- projectPackage = require ( `${ process . cwd ( ) } /package.json` ) ;
1310 wizardPackage = require ( `${ process . cwd ( ) } /node_modules/@sentry/wizard/package.json` ) ;
11+ } catch {
12+ // We don't need to have this
13+ }
14+
15+ try {
16+ sentryCliPackage = require ( `${ process . cwd ( ) } /node_modules/sentry-cli-binary/package.json` ) ;
17+ } catch {
18+ // We don't need to have this
1419}
1520
1621export class Initial extends BaseStep {
1722 public async emit ( answers : Answers ) {
1823 dim ( 'Running Sentry Setup Wizard...' ) ;
1924 // TODO: get sentry cli version
20- const sentryCliVersion = 'TODO' ;
21- dim ( `version: ${ wizardPackage . version } | sentry-cli version: ${ sentryCliVersion } ` ) ;
25+ dim (
26+ `version: ${ _ . get ( wizardPackage , 'version' , 'DEV' ) } | sentry-cli version: ${ _ . get (
27+ sentryCliPackage ,
28+ 'version' ,
29+ 'DEV'
30+ ) } `
31+ ) ;
2232 return { } ;
2333 }
2434}
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export class OpenSentry extends BaseStep {
2727
2828 return { hash : data . hash } ;
2929 } catch ( e ) {
30+ e . message = `Could not connect to wizard @ ${ baseUrl } try --url \n${ e . message } ` ;
3031 throw e ;
3132 }
3233 }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export class Welcome extends BaseStep {
88 if ( Welcome . didShow ) {
99 return { } ;
1010 }
11- green ( 'Sentry Setup Wizard will help to configure your project' ) ;
11+ green ( 'Sentry Wizard will you help to configure your project' ) ;
1212 dim ( 'Thank you for using Sentry :)' ) ;
1313 Welcome . didShow = true ;
1414 return { } ;
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ export class ReactNative extends BaseStep {
6464 // rm 0.49 introduced an App.js for both platforms
6565 await patchMatchingFile ( 'App.js' , this . patchAppJs . bind ( this ) ) ;
6666 await this . addSentryProperties ( platform , sentryCliProperties ) ;
67- green ( `Successfully setup ${ platform } ` ) ;
67+ green ( `Successfully setup ${ platform } for react-native ` ) ;
6868 } catch ( e ) {
6969 red ( e ) ;
7070 }
@@ -86,7 +86,7 @@ export class ReactNative extends BaseStep {
8686 ) ;
8787 await patchMatchingFile ( '**/AppDelegate.m' , this . unpatchAppDelegate . bind ( this ) ) ;
8888 await patchMatchingFile ( '**/app/build.gradle' , this . unpatchBuildGradle . bind ( this ) ) ;
89- green ( `Successfully removed Sentry` ) ;
89+ green ( `Successfully removed Sentry from your react-native project ` ) ;
9090 return { } ;
9191 }
9292
Original file line number Diff line number Diff line change 11{
22 "name" : " @sentry/wizard" ,
33 "version" : " 0.1.0" ,
4+ "homepage" : " https://github.com/getsentry/sentry-wizard" ,
5+ "repository" : " https://github.com/getsentry/sentry-wizard" ,
46 "description" : " Sentry wizard helping you to configure your project" ,
57 "bin" : {
68 "sentry-wizard" : " ./dist/index.js"
You can’t perform that action at this time.
0 commit comments