From 5d384c3accb5a84d6f593d024e85ba87ff53b079 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Wed, 8 Nov 2017 10:57:13 -0800 Subject: [PATCH] feat: Add readme and license --- LICENSE | 21 ++++++++++++++++++++ README.md | 7 +++++++ index.ts | 3 ++- lib/Helper.ts | 3 +++ lib/steps/OpenSentry.ts | 2 +- lib/steps/configure/GenericJavascript.ts | 25 ++++++++++++------------ package.json | 4 ++-- 7 files changed, 49 insertions(+), 16 deletions(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..16d368cb --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2017 Sentry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 00000000..e750c221 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +

+ + + +
+

Sentry Wizard - Helping you to setup your project with Sentry

+

diff --git a/index.ts b/index.ts index ec9d2350..5ad62779 100644 --- a/index.ts +++ b/index.ts @@ -9,7 +9,8 @@ const argv = require('yargs') }) .option('url', { alias: 'u', - default: 'https://sentry.io/' + default: 'https://sentry.io/', + describe: 'The url to your Sentry installation' }).argv; run(argv as IArgs); diff --git a/lib/Helper.ts b/lib/Helper.ts index bd71fcf4..52344ede 100644 --- a/lib/Helper.ts +++ b/lib/Helper.ts @@ -7,6 +7,9 @@ function prepareMessage(msg: any) { if (typeof msg === 'string') { return msg; } + if (msg instanceof Error) { + return `${msg.name}: ${msg.message}`; + } return JSON.stringify(msg); } diff --git a/lib/steps/OpenSentry.ts b/lib/steps/OpenSentry.ts index 7ac05d75..57b8598c 100644 --- a/lib/steps/OpenSentry.ts +++ b/lib/steps/OpenSentry.ts @@ -27,7 +27,7 @@ export class OpenSentry extends BaseStep { return { hash: data.hash }; } catch (e) { - throw new Error(`Could not connect to wizard @ ${baseUrl}`); + throw new Error(`Could not connect to wizard @ ${baseUrl} try --url`); } } } diff --git a/lib/steps/configure/GenericJavascript.ts b/lib/steps/configure/GenericJavascript.ts index 66270826..f3e36e0a 100644 --- a/lib/steps/configure/GenericJavascript.ts +++ b/lib/steps/configure/GenericJavascript.ts @@ -4,19 +4,20 @@ import { green, l, nl } from '../../Helper'; import { BaseStep } from '../Step'; export class GenericJavascript extends BaseStep { - public emit(answers: Answers) { + public async emit(answers: Answers) { const dsn = _.get(answers, 'selectedProject.keys.0.dsn.public', null); - if (dsn) { - nl(); - l('Put these lines in to your code to run Sentry'); - green( - `` - ); - nl(); - green(`Raven.config('${dsn}').install();`); - nl(); - green('See https://docs.sentry.io/clients/javascript/ for more details'); + if (!dsn) { + return {}; } - return Promise.resolve({}); + nl(); + l('Put these lines in to your code to run Sentry'); + green( + `` + ); + nl(); + green(`Raven.config('${dsn}').install();`); + nl(); + green('See https://docs.sentry.io/clients/javascript/ for more details'); + return {}; } } diff --git a/package.json b/package.json index 43fe70f5..ab9bfbcb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "@sentry/setup-wizard", + "name": "@sentry/wizard", "version": "0.1.0", - "description": "Sentry Setup wizard helping you to configure your project", + "description": "Sentry wizard helping you to configure your project", "bin": { "setup-wizard": "./dist/index.js" },