Skip to content

Commit

Permalink
feat: Add readme and license
Browse files Browse the repository at this point in the history
  • Loading branch information
HazAT committed Nov 8, 2017
1 parent 4ababb9 commit 5d384c3
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
21 changes: 21 additions & 0 deletions 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.
7 changes: 7 additions & 0 deletions README.md
@@ -0,0 +1,7 @@
<p align="center">
<a href="https://sentry.io" target="_blank" align="center">
<img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
</a>
<br/>
<h1>Sentry Wizard - Helping you to setup your project with Sentry</h1>
</p>
3 changes: 2 additions & 1 deletion index.ts
Expand Up @@ -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);
3 changes: 3 additions & 0 deletions lib/Helper.ts
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/steps/OpenSentry.ts
Expand Up @@ -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`);
}
}
}
25 changes: 13 additions & 12 deletions lib/steps/configure/GenericJavascript.ts
Expand Up @@ -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(
`<script src="https://cdn.ravenjs.com/3.19.1/raven.min.js" crossorigin="anonymous"></script>`
);
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(
`<script src="https://cdn.ravenjs.com/3.19.1/raven.min.js" crossorigin="anonymous"></script>`
);
nl();
green(`Raven.config('${dsn}').install();`);
nl();
green('See https://docs.sentry.io/clients/javascript/ for more details');
return {};
}
}
4 changes: 2 additions & 2 deletions 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"
},
Expand Down

0 comments on commit 5d384c3

Please sign in to comment.