Skip to content
This repository was archived by the owner on Nov 23, 2024. It is now read-only.

Commit 3fcf4cb

Browse files
markeriksonmsutkowskiRob ClayburnphryneasLenz Weber
authored
Merge next into main (#214)
Co-authored-by: Matt Sutkowski <[email protected]> Co-authored-by: Rob Clayburn <[email protected]> Co-authored-by: Lenz Weber <[email protected]> Co-authored-by: Lenz Weber <[email protected]> Co-authored-by: kahirokunn <[email protected]> Co-authored-by: DmitryScaletta <[email protected]> Co-authored-by: Guillaume FORTAINE <[email protected]> Co-authored-by: triou <[email protected]> Co-authored-by: Rob Clayburn <[email protected]> Co-authored-by: Shrugsy <[email protected]>
1 parent f373492 commit 3fcf4cb

File tree

96 files changed

+6742
-3590
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+6742
-3590
lines changed

.github/workflows/main.yml

+62-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
node: ['12.x', '14.x']
10+
node: ['12.x']
1111
os: [ubuntu-latest] #, windows-latest, macOS-latest
1212

1313
steps:
@@ -21,12 +21,71 @@ jobs:
2121

2222
- name: Install deps and build (with cache)
2323
uses: bahmutov/npm-install@v1
24+
with:
25+
install-command: yarn --frozen-lockfile --ignore-scripts
2426

2527
- name: Lint
2628
run: yarn lint
2729

2830
- name: Test
2931
run: yarn test --ci --coverage --maxWorkers=2
3032

31-
- name: Build
32-
run: yarn build
33+
- name: Pack (including Prepare)
34+
run: npm pack
35+
36+
- uses: actions/upload-artifact@v2
37+
with:
38+
name: package
39+
path: rtk-incubator-rtk-query*.tgz
40+
41+
test:
42+
name: Test Types with TypeScript ${{ matrix.ts }}
43+
44+
needs: [build]
45+
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
node: ['12.x']
50+
ts: ['3.9', '4.0', '4.1', '4.2', 'next']
51+
steps:
52+
- name: Checkout repo
53+
uses: actions/checkout@v2
54+
55+
- name: Use node ${{ matrix.node }}
56+
uses: actions/setup-node@v1
57+
with:
58+
node-version: ${{ matrix.node }}
59+
60+
- name: Install deps and build (with cache)
61+
uses: bahmutov/npm-install@v1
62+
with:
63+
install-command: yarn --frozen-lockfile --ignore-scripts
64+
65+
- name: Install TypeScript ${{ matrix.ts }}
66+
run: npm install typescript@${{ matrix.ts }} --ignore-scripts
67+
68+
- uses: actions/download-artifact@v2
69+
with:
70+
name: package
71+
72+
- name: Unpack build artifact to dist
73+
run: tar -xzvf rtk-incubator-rtk-query-*.tgz --strip-components=1 package/dist
74+
75+
- name: Remap @redux/toolkit from src to dist
76+
run: |
77+
sed -i -re 's|(@rtk-incubator/rtk-query.*)\./src|\1./|' ./test/tsconfig.json
78+
79+
- name: '@ts-ignore @ts-expect-error messages in pre-3.9 in the tests'
80+
if: ${{ matrix.ts < 3.9 }}
81+
run: |
82+
sed -i 's/@ts-expect-error/@ts-ignore/' test/*.ts*
83+
84+
- name: "@ts-ignore stuff that didn't exist pre-4.1 in the tests"
85+
if: ${{ matrix.ts < 4.1 }}
86+
run: sed -i -e 's/@pre41-ts-ignore/@ts-ignore/' -e '/pre41-remove-start/,/pre41-remove-end/d' test/*.ts*
87+
88+
- name: Test types
89+
run: |
90+
./node_modules/.bin/tsc --version
91+
./node_modules/.bin/tsc --skipLibCheck -p test

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
node_modules
44
dist
55
typesversions
6-
.cache
6+
.cache
7+
.yarn
8+
.yarnrc

.prettierrc

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
{
2-
"endOfLine": "auto"
2+
"endOfLine": "auto",
3+
"printWidth": 120,
4+
"semi": true,
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"overrides": [
8+
{
9+
"files": "*.ts",
10+
"options": {
11+
"parser": "babel-ts"
12+
}
13+
}
14+
]
315
}

docs/api/ApiProvider.md

+2-13
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,9 @@ hide_title: true
77

88
# `ApiProvider`
99

10-
Can be used as a `Provider` if you **do not already have a Redux store**.
10+
[summary](docblock://react-hooks/ApiProvider.tsx?token=ApiProvider)
1111

12-
```ts title="Basic usage - wrap your App with ApiProvider"
13-
import * as React from 'react';
14-
import { ApiProvider } from '@rtk-incubator/rtk-query';
15-
16-
function App() {
17-
return (
18-
<ApiProvider api={api}>
19-
<Pokemon />
20-
</ApiProvider>
21-
);
22-
}
23-
```
12+
[examples](docblock://react-hooks/ApiProvider.tsx?token=ApiProvider)
2413

2514
:::danger
2615
Using this together with an existing redux store will cause them to conflict with each other. If you are already using Redux, please use follow the instructions as shown in the [Getting Started guide](../introduction/getting-started).

0 commit comments

Comments
 (0)