Skip to content

Commit 5927c3b

Browse files
committed
docs(readme): Update project documentation
1 parent 12f513c commit 5927c3b

File tree

1 file changed

+74
-36
lines changed

1 file changed

+74
-36
lines changed

README.md

Lines changed: 74 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,88 @@
1212
[jsonapi.org](http://jsonapi.org/) support for loopback.
1313

1414
## Status
15-
This project is a work in progress. Consider it beta software. For EmberJS users, the component
16-
should now be basically feature complete. Please test and report any issues.
17-
The functionality that is present is pretty well tested. 140+ integration tests and counting!
18-
19-
Currently supported:
20-
- Find all records via GET
21-
- Find a record by ID via GET
22-
- Create via POST
23-
- Update a record via PATCH
24-
- Delete a record via DELETE
25-
- All errors have now been transformed into the correct JSON API format
26-
- Find related records via GET eg. /posts/1/comments (belongsTo, hasMany, hasOne)
27-
- Find relationships via GET eg. /posts/1/relationships/author (belongsTo, hasMany, hasOne)
28-
- Creating resource relationship linkages during a resource create
29-
- Updating/deleting resource relationship linkages during a resource update
30-
- [Side loading data](http://jsonapi.org/format/#fetching-includes) via `include` param
31-
32-
Not yet supported:
33-
- manipulating relationships directly via:
34-
- POST /:resource/relationships/:relatedResource
35-
- PATCH /:resource/relationships/:relatedResource
36-
- DELETE /:resource/relationships/:relatedResource
37-
38-
## Requirements
15+
16+
This project is now pretty stable and is used in production in a number of our projects.
17+
There are known issues (see below and the issue tracker) these can mostly be worked around or
18+
are pretty minor. Open an issue on the issue tracker if you need clarification on anything or
19+
need help.
20+
21+
### Known issues
22+
23+
This module doesn't do complex compound documents very well yet. This means that if you try to do complex
24+
includes in a single request you will likely run into trouble.
25+
26+
We wrote another module called [loopback-jsonapi-model-serializer](https://www.npmjs.com/package/loopback-jsonapi-model-serializer)
27+
that does JSONAPI serialization very well (but nothing else) for loopback which you can use to get
28+
around such issues for now. The long term goal is to swap out the serialization layer in
29+
`loopback-component-jsonapi` with `loopback-jsonapi-model-serializer`
30+
31+
## Tested against:
32+
33+
- Node 4, 6 and 8
3934
- JSON API v1.0
40-
- loopback ^v2.0.0
41-
- strong-remoting ^v2.22.0
35+
- loopback ^3.8.0
4236

4337
## Sample Project
4438
We have created a sample project using [EmberJS](http://emberjs.com), [Loopback](http://loopback.io) and this compoment. It's called [emberloop](https://github.com/tsteuwer/emberloop).
4539

4640
## Helping out
4741
We are VERY interested in help. Get in touch via the [issue tracker](https://github.com/digitalsadhu/loopback-component-jsonapi/issues)
42+
Please read the following about contributing:
43+
44+
### Semantic Release
45+
46+
This project uses [Semantic Release](https://github.com/semantic-release/semantic-release) to manage the release process.
47+
This means that:
48+
A. There is no semver project version in `package.json`. This is managed in CI.
49+
B. Commit messages need to follow conventions. See [here](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit) for commit message guidelines.
50+
The important things to remember are:
51+
A. If you are fixing a bug prefix your commit message with `fix(<thing being fixed goes here>):`
52+
B. If you are adding a non breaking feature, prefix your commit with `feat(<name of feature goes here>):`
53+
C. If you are making a breaking change of any kind, prefix additional information on the 3rd line of the commit message with: `BREAKING CHANGE:`
54+
See examples of this on the [Semantic Release](https://github.com/semantic-release/semantic-release) github pages.
55+
And don't hesitate to reach out on our [issue tracker](https://github.com/digitalsadhu/loopback-component-jsonapi/issues)
56+
if you want further clarification.
57+
58+
### Standard js and "prettier standard"
59+
60+
This project is follows the [Standard js](https://standardjs.com/) styleguide. Linting happens on CI and any time you run tests via `npm test`
61+
You can run the linting on its own with `npm run lint`
62+
63+
Additionally, code formatting is done whenever you run git commit. This is made possibly by [lint-staged](https://github.com/okonet/lint-staged) and [husky](https://github.com/typicode/husky) with actual formatting done by
64+
[prettier](https://github.com/prettier/prettier)
65+
66+
### Pull requests and code review
67+
68+
All code is reviewed by one or more of the project maintainers before merging. Before becoming a maintainer, contributers
69+
need to fork the master branch of this repo, make their changes and submit a pull request.
70+
71+
Once a contributor becomes a maintainer, it is preferred that they create new branches on the loopback-component-jsonapi
72+
repo and submit those as pull requests
73+
74+
### Tests
75+
76+
We take testing seriously. The project contains over 200 tests at time of writing this. In most cases we wont merge
77+
anything without tests. (Within reason of course)
78+
79+
### Project maintainers
80+
81+
We follow the principle of "Open open source" which means if you contribute even a single PR to the project, we make you
82+
a project maintainer.
83+
84+
## Debugging
85+
You can enable debug logging by setting an environment variable:
86+
`DEBUG=loopback-component-jsonapi`
87+
88+
#### example:
89+
```
90+
DEBUG=loopback-component-jsonapi node .
91+
```
92+
93+
# API Documentation
94+
95+
## Getting started
4896

49-
## Usage
5097
In your loopback project:
5198

5299
1. `npm install --save loopback-component-jsonapi`
@@ -630,12 +677,3 @@ module.exports = function (MyModel) {
630677
##### function parameters
631678
- `options` All config options set for the serialization process
632679
- `callback` Callback to call with modified serialized records
633-
634-
## Debugging
635-
You can enable debug logging by setting an environment variable:
636-
`DEBUG=loopback-component-jsonapi`
637-
638-
#### example:
639-
```
640-
DEBUG=loopback-component-jsonapi node .
641-
```

0 commit comments

Comments
 (0)