Skip to content

Commit e0130e3

Browse files
authored
Merge pull request #2 from nu-xin/main
feat: add route guard and meta support + ci upgrade
2 parents 9eb5aa4 + c36c281 commit e0130e3

2 files changed

Lines changed: 24 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Run Tests & Linters
1+
name: CI
22

33
on:
44
push:
@@ -9,31 +9,15 @@ on:
99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12-
13-
strategy:
14-
matrix:
15-
node-version: [16.x]
16-
1712
steps:
18-
- uses: actions/checkout@v3
19-
- uses: pnpm/action-setup@v2
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v4
2015
with:
21-
version: 8
22-
- name: Use Node.js ${{ matrix.node-version }}
23-
uses: actions/setup-node@v3
16+
version: 9
17+
- uses: actions/setup-node@v4
2418
with:
25-
node-version: ${{ matrix.node-version }}
19+
node-version: 20
2620
cache: pnpm
27-
- name: Install Dependencies
28-
run: |
29-
pnpm install
30-
- name: Lint Sources with ESLint
31-
run: npm run lint
32-
- name: Run Test
33-
run: npm test && npm run coverage
34-
- name: Upload coverage reports to Codecov
35-
uses: codecov/codecov-action@v3
36-
env:
37-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
38-
with:
39-
files: ./coverage/coverage.txt
21+
- run: pnpm install
22+
- run: pnpm lint
23+
- run: pnpm test

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,18 @@ See [demos](/demos/) for a complete example.
7777
## Documentation
7878

7979
[API](https://native-router.github.io/react/modules.html)
80+
81+
import { Router } from '@native-router/react';
82+
83+
const routes = [
84+
{
85+
path: '/admin',
86+
children: [...]
87+
}
88+
];
89+
90+
function App() {
91+
return <Router routes={routes} />;
92+
}
93+
```
94+

0 commit comments

Comments
 (0)