Skip to content

Commit 33c1bf8

Browse files
Docs (#9)
* docs: add nuxt docs * docs: add introduction, installation, configuration, usage and nuxt example * docs: add api docs * docs: update configuration and usage * ci: add nodejs ci * ci: fix setup node version * chore(eslint): add .eslintignore * chore(scripts): add "lint" script * chore(scripts): add "test-watch" script * ci(docs): update deploy action * ci: fix docs and publish * ci: fix docs working directory * docs: fix url * docs: fix base url * ci: fix docs action * docs: fix pages position * chore(script): add `--coverage` flag to `test` script * ci(publish): add step to upload coverage to codecov * chore(scripts): remove "prepare" script * fix(model): add null check in `isValidId` (robsontenorio#115) When an entity is being saved, nulls are considered as existing entities, so it tries to update and not insert. * feat(model): handle 'data' wrapped responses for create and update (robsontenorio#109) Laravel allows data wrapping for all responses, so create and update requests should support this if it is done. * feat(model): add support to nested keys for relations (robsontenorio#127) * feat(utils): add utilities `getProp` and `setProp` * feat(model): add support to nested keys for relations * test(model): test support of nested keys for relations * test(utils): test utilities * chore: update readme * chore: bump node-fetch from 2.6.0 to 2.6.1 (robsontenorio#124) Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. - [Release notes](https://github.com/bitinn/node-fetch/releases) - [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md) - [Commits](node-fetch/node-fetch@v2.6.0...v2.6.1) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: update configuration and api options * docs: update api docs * docs(model options): update docs * docs(query builder methods): update docs * docs(model options): add `primaryKey` default value * docs(model options): fix typo * docs(example): rename file of nuxt example * docs: remove usage section * docs: add building query section * chore: update package.json * chore: update README.md * docs: fix typo * docs: add "including relationships" * docs: add helpers * docs(operations): fix typo * docs(api): update query builder methods * docs: fix response of section "including relationships" * docs: add "appending attributes" * docs: add "selecting fields" and update other docs * fix(utils): accept array of strings in param `propName` of `setProp` * test(utils): add tests for `setProp` * fix(utils): fix `getProp` * fix(utils): accept array of strings in param `propName` of `getProp` * test(utils): add tests for `getProp` * refactor(utils): update jsdocs of `getProp` and `setProp` * refactor(test): remove semicolon * docs: add "paginating" and add missing colons. * docs: add api reference to "selecting fields" section * docs: update "paginating" section * docs: add "applying parameters" * docs: add "calling a custom resource" * docs: add api reference of `params` and `custom` * docs: add "composing without request" * docs: remove unnecessary responses * docs: update "calling a custom resource" * docs: fix crud order * docs: fix create request * docs: update example of delete operation * docs: add "mixing everything up" * docs: fix append example * docs: add "performing operations" * docs: update `select` and `custom` * docs: update model options * docs: update configuration * docs: add vue example * docs: update "needless parent request"
1 parent 91f598e commit 33c1bf8

33 files changed

+12188
-866
lines changed

Diff for: .eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
build
3+
coverage

Diff for: .github/workflows/nodejs.yml

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches: [ master, dev ]
9+
10+
pull_request:
11+
branches: [ master, dev ]
12+
13+
jobs:
14+
test:
15+
name: Build & Test
16+
17+
runs-on: ${{ matrix.os }}
18+
19+
strategy:
20+
matrix:
21+
os: [ ubuntu-latest ]
22+
node-version: [ 12.x, 14.x ]
23+
fail-fast: true
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
29+
- name: Use Node.js ${{ matrix.node-version }}
30+
uses: actions/setup-node@v2-beta
31+
with:
32+
node-version: ${{ matrix.node-version }}
33+
34+
- name: Cache node_modules
35+
id: cache-modules
36+
uses: actions/cache@v2
37+
with:
38+
path: node_modules
39+
key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }}
40+
41+
- name: Install Dependencies
42+
if: steps.cache-modules.outputs.cache-hit != 'true'
43+
run: yarn install
44+
45+
- name: Lint
46+
run: yarn lint
47+
48+
- name: Test
49+
run: yarn test
50+
51+
publish:
52+
name: Publish
53+
54+
needs: test
55+
56+
runs-on: ${{ matrix.os }}
57+
58+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
59+
60+
strategy:
61+
matrix:
62+
os: [ ubuntu-latest ]
63+
fail-fast: true
64+
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v2
68+
69+
- name: Cache node_modules
70+
id: cache-modules
71+
uses: actions/cache@v2
72+
with:
73+
path: node_modules
74+
key: 12.x-${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }}
75+
76+
- name: Install Dependencies
77+
if: steps.cache-modules.outputs.cache-hit != 'true'
78+
run: yarn install
79+
80+
- name: Test
81+
run: yarn test
82+
83+
- name: Upload Coverage to Codecov
84+
uses: codecov/codecov-action@v1
85+
with:
86+
directory: ./coverage
87+
88+
- name: Publish to NPM
89+
uses: mikeal/merge-release@master
90+
env:
91+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
92+
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
93+
94+
docs:
95+
name: Documentation
96+
97+
needs: test
98+
99+
runs-on: ${{ matrix.os }}
100+
101+
if: github.ref == 'refs/heads/master'
102+
103+
strategy:
104+
matrix:
105+
os: [ ubuntu-latest ]
106+
node-version: [ 12.x ]
107+
fail-fast: true
108+
109+
steps:
110+
- name: Checkout
111+
uses: actions/checkout@v2
112+
113+
- name: Use Node.js ${{ matrix.node-version }}
114+
uses: actions/setup-node@v2-beta
115+
with:
116+
node-version: ${{ matrix.node-version }}
117+
118+
- name: Cache node_modules
119+
id: cache-modules-docs
120+
uses: actions/cache@v2
121+
with:
122+
path: ./docs/node_modules
123+
key: ${{ matrix.node-version }}-${{ runner.OS }}-build-${{ hashFiles('yarn.lock') }}
124+
125+
- name: Install Dependencies
126+
if: steps.cache.outputs.cache-hit != 'true'
127+
working-directory: ./docs
128+
run: yarn install
129+
130+
- name: Generate
131+
working-directory: ./docs
132+
run: yarn generate
133+
134+
- name: Deploy
135+
uses: peaceiris/actions-gh-pages@v3
136+
with:
137+
github_token: ${{ secrets.GITHUB_TOKEN }}
138+
publish_dir: ./docs/dist

0 commit comments

Comments
 (0)