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

Commit

Permalink
Merge next into main (#214)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Sutkowski <msutkowski@gmail.com>
Co-authored-by: Rob Clayburn <rob@infosum.com>
Co-authored-by: Lenz Weber <mail@lenzw.de>
Co-authored-by: Lenz Weber <lenz.weber@mayflower.de>
Co-authored-by: kahirokunn <okinakahiro@gmail.com>
Co-authored-by: DmitryScaletta <DmitryScaletta@users.noreply.github.com>
Co-authored-by: Guillaume FORTAINE <guillaume+github@fortaine.com>
Co-authored-by: triou <34629112+tevariou@users.noreply.github.com>
Co-authored-by: Rob Clayburn <rob@pollen-8.co.uk>
Co-authored-by: Shrugsy <joshfraser91@gmail.com>
  • Loading branch information
11 people authored Apr 19, 2021
1 parent f373492 commit 3fcf4cb
Show file tree
Hide file tree
Showing 96 changed files with 6,742 additions and 3,590 deletions.
65 changes: 62 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['12.x', '14.x']
node: ['12.x']
os: [ubuntu-latest] #, windows-latest, macOS-latest

steps:
Expand All @@ -21,12 +21,71 @@ jobs:

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

- name: Lint
run: yarn lint

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

- name: Build
run: yarn build
- name: Pack (including Prepare)
run: npm pack

- uses: actions/upload-artifact@v2
with:
name: package
path: rtk-incubator-rtk-query*.tgz

test:
name: Test Types with TypeScript ${{ matrix.ts }}

needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ['12.x']
ts: ['3.9', '4.0', '4.1', '4.2', 'next']
steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

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

- name: Install TypeScript ${{ matrix.ts }}
run: npm install typescript@${{ matrix.ts }} --ignore-scripts

- uses: actions/download-artifact@v2
with:
name: package

- name: Unpack build artifact to dist
run: tar -xzvf rtk-incubator-rtk-query-*.tgz --strip-components=1 package/dist

- name: Remap @redux/toolkit from src to dist
run: |
sed -i -re 's|(@rtk-incubator/rtk-query.*)\./src|\1./|' ./test/tsconfig.json
- name: '@ts-ignore @ts-expect-error messages in pre-3.9 in the tests'
if: ${{ matrix.ts < 3.9 }}
run: |
sed -i 's/@ts-expect-error/@ts-ignore/' test/*.ts*
- name: "@ts-ignore stuff that didn't exist pre-4.1 in the tests"
if: ${{ matrix.ts < 4.1 }}
run: sed -i -e 's/@pre41-ts-ignore/@ts-ignore/' -e '/pre41-remove-start/,/pre41-remove-end/d' test/*.ts*

- name: Test types
run: |
./node_modules/.bin/tsc --version
./node_modules/.bin/tsc --skipLibCheck -p test
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
node_modules
dist
typesversions
.cache
.cache
.yarn
.yarnrc
14 changes: 13 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
{
"endOfLine": "auto"
"endOfLine": "auto",
"printWidth": 120,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"overrides": [
{
"files": "*.ts",
"options": {
"parser": "babel-ts"
}
}
]
}
15 changes: 2 additions & 13 deletions docs/api/ApiProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,9 @@ hide_title: true

# `ApiProvider`

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

```ts title="Basic usage - wrap your App with ApiProvider"
import * as React from 'react';
import { ApiProvider } from '@rtk-incubator/rtk-query';

function App() {
return (
<ApiProvider api={api}>
<Pokemon />
</ApiProvider>
);
}
```
[examples](docblock://react-hooks/ApiProvider.tsx?token=ApiProvider)

:::danger
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).
Expand Down
Loading

0 comments on commit 3fcf4cb

Please sign in to comment.