-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from nobrainr/feat/api-surface
Feat/api surface
- Loading branch information
Showing
13 changed files
with
5,649 additions
and
276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Javascript Node CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-javascript/ for more details | ||
# | ||
version: 2 | ||
jobs: | ||
test-job: | ||
docker: | ||
- image: circleci/node:8-browsers | ||
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
- run: npm install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
# run tests! | ||
- run: | ||
name: Run Tests | ||
command: npm test | ||
|
||
publish-job: | ||
docker: | ||
- image: circleci/node:9 | ||
working_directory: ~/repo | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
- run: | ||
name: Build | ||
command: npm run build:prod | ||
- run: | ||
name: Publish Package | ||
command: cd dist && npm run semantic-release | ||
|
||
workflows: | ||
version: 2 | ||
test: | ||
jobs: | ||
- test-job | ||
- publish-job: | ||
requires: | ||
- test-job | ||
filters: | ||
branches: | ||
only: | ||
- master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
node_modules | ||
node_modules | ||
**/coverage/**/* | ||
.DS_STORE | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# axios-morphism | ||
|
||
## Getting started | ||
|
||
### Installation | ||
|
||
```sh | ||
|
||
npm install --save axios-morphism | ||
|
||
``` | ||
|
||
### Example | ||
|
||
```typescript | ||
import { apply, AxiosMorphismConfiguration } from './axios-morphism'; | ||
|
||
const peopleSchema = { name: 'name', firstName: 'firstName' }; | ||
|
||
const configuration: AxiosMorphismConfiguration = { | ||
url: 'https://api.com', | ||
interceptors: { | ||
responses: [{ matcher: '/people/:id', schema: peopleSchema }] | ||
} | ||
}; | ||
|
||
apply(client, configuration); | ||
await client.get(`https://api.com/people/1`); | ||
|
||
▶ | ||
// { | ||
// name: 'Smith', | ||
// firstName: 'John' | ||
// } | ||
``` | ||
|
||
## License | ||
|
||
MIT © [Yann Renaudin][twitter-account] | ||
|
||
[twitter-account]: https://twitter.com/renaudin_yann |
Oops, something went wrong.