Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): Add semantic-release in Travis #33

Merged
merged 7 commits into from
Jun 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
language: node_js
node_js:
- "node"
- "10"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You said node is set to 10, do we need to add 9

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

node is set to the latest version. So for now it's 10 but when 11 comes out, it'll be that. The specific ones I call out are those that have long-term support (LTS) which are the evens

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't know that about the LTS.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why add 10 if node is already at 10?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because once newer versions come out, node will no longer be 10. It's how I caught the issue with Node 10 so quickly. node became 10 when it was released and broke the build. My thinking is that it'd be good to make sure that the SDK can always run on the latest version of Node

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So node will auto catch 11 when it comes out? Or 12?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whatever the latest version is. So 11, then 12, etc...

- "8"
- "6"

# Cache dependencies in $HOME/.yarn-cache across builds
cache: yarn
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this no longer needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue I fixed with #32 had to do with the node_modules installed for Node 6/8 not working with Node 10. So we can no longer share dependencies across builds as a result because different dependencies get installed depending on Node version. I think it's safer this way...

# Run the the validate script
# Temporarily also run the build script to make sure it works
# (will move this to the release step once that's implemented)
script: yarn run validate --ci && yarn run build
script: yarn run validate

# We of course run a build first to generate the build targets
before_deploy: yarn run build

# Using semantic-release, deploy a new version of the library
# We're running multiple node jobs so travis-deploy-once ensures
# that it only tries to deploy once.
deploy:
provider: script
script: npx travis-deploy-once "npx semantic-release"
71 changes: 68 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,54 @@
# Eventbrite JavaScript SDK

> NOTE: This library is still in alpha and under initial development.
[![version](https://img.shields.io/npm/v/eventbrite.svg)](http://npm.im/eventbrite)
[![downloads](https://img.shields.io/npm/dt/eventbrite.svg)](http://npm-stat.com/charts.html?package=eventbrite&from=2018-05-01)
[![module formats: esm, cjs, & umd](https://img.shields.io/badge/module%20formats-esm%2C%20cjs%2C%20umd-green.svg)](https://unkpg.com/eventbrite/)
![npm type definitions](https://img.shields.io/npm/types/eventbrite.svg)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
[![license](https://img.shields.io/github/license/eventbrite/eventbrite-sdk-javascript.svg)](LICENSE)

[![Maintenance Status](https://img.shields.io/badge/status-maintained-brightgreen.svg)](https://github.com/eventbrite/eventbrite-sdk-javascript/pulse)
[![Build Status](https://travis-ci.org/eventbrite/eventbrite-sdk-javascript.svg?branch=master)](https://travis-ci.org/eventbrite/eventbrite-sdk-javascript)
[![Dependencies status](https://img.shields.io/david/eventbrite/eventbrite-sdk-javascript.svg)](https://david-dm.org/eventbrite/eventbrite-sdk-javascript)
[![Dev Dependencies status](https://img.shields.io/david/dev/eventbrite/eventbrite-sdk-javascript.svg)](https://david-dm.org/eventbrite/eventbrite-sdk-javascript?type=dev)

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

[![Watch on GitHub](https://img.shields.io/github/watchers/eventbrite/eventbrite-sdk-javascript.svg?style=social)](https://github.com/eventbrite/eventbrite-sdk-javascript/watchers)
[![Star on GitHub](https://img.shields.io/github/stars/eventbrite/eventbrite-sdk-javascript.svg?style=social)](https://github.com/eventbrite/eventbrite-sdk-javascript/stargazers)
[![Tweet](https://img.shields.io/twitter/url/https/github.com/eventbrite/eventbrite-sdk-javascript.svg?style=social)](https://twitter.com/intent/tweet?text=Check%20out%20the%20official%20Eventbrite%20API%20JavaScript%20DSK%20by%20%40evbeng!%20%0A%20https%3A%2F%2Fgithub.com%2Feventbrite%2Feventbrite-sdk-javascript%2F)

The official JavaScript SDK for the [Eventbrite v3 API](https://www.eventbrite.com/developer/v3/).

> NOTE: This library is still in **beta** as we flesh out the API of the SDK.

## ToC
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to look into generating the ToC, may be out of scope for this just a consideration.

https://github.com/ekalinin/github-markdown-toc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe...


* [Installation](#installation)
* [Quick Usage](#quick-usage)
* [API Docs](docs/)
* [Target Environments](#target-environments)
* [Contributing](CONTRIBUTING.md)
* [Project philosophy](#project-philosophy)
* [License](LICENSE)

## Installation

Coming soon...
Install via [Yarn](https://yarnpkg.com/lang/en/docs/managing-dependencies/):

```sh
yarn add eventbrite
```

Install via [NPM](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):

## Usage
```sh
npm install --save eventbrite
```

## Quick Usage

```js
const eventbrite = require('eventbrite');
Expand All @@ -22,6 +64,27 @@ sdk.request('/users/me').then(res => {

Read more on [getting a token](https://www.eventbrite.com/developer/v3/api_overview/authentication/#ebapi-getting-a-token).

## API Docs

[Eventbrite v3 API JavaScript SDK Documentation](docs/)

## Target Environments

The SDK works in both the browser and Node environments. As a result, we provide multiple build targets for you to consume depending on your environment:

### Libraries

* [**ESM**](https://unpkg.com/eventbrite/lib/esm/) - (EMCAScript modules) Everything transpiled to ES5 except for ES2015 `import`/`export` statements enabling [_tree shaking_](https://webpack.js.org/guides/tree-shaking/)
* [**CJS**](https://unpkg.com/eventbrite/lib/cjs/) - (CommonJS) Standard format for most bundling systems including Node fully transpiled to ES5
* [**UMD**](https://unpkg.com/eventbrite/lib/umd/) - (Universal module definition) Combination of EJS & AMD (asynchronous module definition) fully transpiled to ES5

### Bundled distributions

If you don't have or cannot use a module system in your web app, the bundle distributions come as a single file with all of the dependencies included:

* [`eventbrite.min.js`](https://unpkg.com/eventbrite/dist/eventbrite.min.js) - Minified and fully transpiled `<script>` include
* [`eventbrite.js`](https://unpkg.com/eventbrite/dist/eventbrite.js) - Unminified and fully transpiled `<script>` include

## Contributing

Contributions are welcome! See [Contributing Guidelines](CONTRIBUTING.md) for more details.
Expand All @@ -30,6 +93,8 @@ Contributions are welcome! See [Contributing Guidelines](CONTRIBUTING.md) for mo

We take the stability of this SDK **very** seriously. `eventbrite` follows the [SemVer](http://semver.org/) standard for versioning.

All updates must pass the [CI build](https://travis-ci.org/eventbrite/eventbrite-sdk-javascript/).

## License

The library is available as open source under the terms of the [MIT License](LICENSE).
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Eventbrite JavaScript SDK Documentation
# Eventbrite v3 API JavaScript SDK Documentation

This SDK interface closely mirors the [Eventbrite v3 REST API](https://www.eventbrite.com/developer/v3/) endpoints that it wraps. The SDK provides many conveniences for making requests and processing responses to make it easier to use in the JavaScript environment.

## ToC

* [Including the package](#including-the-package)
* [Configuring a SDK object](#configuring-a-sdk-object)
* [`request()`](./request)
* [`request()`](./request.md)

## Including the package

Expand Down
3 changes: 2 additions & 1 deletion src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ const _catchStatusError = (res: Response): Promise<any> =>
});

/**
* Fetch wrapper that parses v3 errors received by the API
* Low-level method that makes fetch requests, returning the response formatted as JSON.
* It parses errors from API v3 and throws exceptions with those errors
*/
export default (url: string, options?: RequestInit): Promise<{}> =>
_fetchJSON(url, options).catch(_catchStatusError);