Skip to content

Commit c5c4417

Browse files
Monorepo, Rebrand to TanStack (#3708)
* rebrand * move to src * chore: fix build by re-exporting types explicitly * chore: run everything through prettier * chore: bring back linting and compilation tasks * chore: setup eslint-import-resolver-typescript it still errors with import/no-unresolved, but I think that's because TS errors as well! * chore: fix a ton of imports * chore: down to zero ts errors * chore: export types separately to make the build work * chore: down to zero eslint issues 🎉 * chore: try to get tests to work * chore: make tests work * fix: use better match sorter primitives * chore: update workflows * Update ci.yml * chore: remove match-sorter dependency * chore: enable bundle size collection * chore: update to latest react * fix(devtools): fix typings of rankItems not sure if that is correct now... * chore: fix compilation * tests: fix tests by removing weird comment that is no longer necessary after upgrading react * tests: remove incrompehensible tests I don't know what these tests are doing, but overwriting useEffect is not something that makes sense now that we useSyncExternalStore for data fetching anyways ... * fix(devtools): fix sorting of queries rankItem doesn't take keys, so we have to pass the queryHash in directly to rank it * chore: setup ci pipeline and bundlewatch * chore: build during pr pipelines * chore: remove private:true as requested by CI: Error: Package undefined in /tmp/98d7e7a6 is set to private, remove package.json#private to publish it * Revert "chore: remove private:true" This reverts commit e1b237b. * chore: turn off import/no-unresolved in tests somehow, that fails in CI, and we have typescript protection against unresolved imports anyhow * fix: turn of import/no-unresolved for all tanstack imports * fix: regex * chore: do not run legacy pipelines on PRs * chore: fix ci check names * chore: add react-17 dependencies * chore: split up ci tasks * fix: building is done via bundlesize reporting so we don't need to build during testing * chore: try to make codesandbox ci work it requires package to be public, but for installing and yarn workspaces, we need it to be private * fix: apply private: false to all workspaces * fix: paths to sandboxes * chore: fix code coverage collection * chore: change imports from react-query to tanstack/react-query * docs: update migration docs with the rebrand * chore: revert codemod changes prettier destroyed the assertions * fix(useIsMutating): we need to subscribe to the right cache this is likely a copy-paste error, and the tests only worked because we render top-down; now, the tests make sure that components are re-rendered because of the subscription itself * Update README.md * docs: devtools documentation for tanstack rebrand * fix builds * chore: cleanup Co-authored-by: Dominik Dorfmeister <[email protected]>
1 parent e0aad73 commit c5c4417

File tree

267 files changed

+112796
-7422
lines changed

Some content is hidden

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

267 files changed

+112796
-7422
lines changed

.codesandbox/ci.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"packages": ["./"],
3-
"sandboxes": ["/examples/basic", "/examples/basic-typescript"],
4-
"node": "14"
2+
"installCommand": "install:csb",
3+
"sandboxes": ["/examples/react/basic", "/examples/react/basic-typescript"],
4+
"node": "16"
55
}

.eslintrc

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"root": true,
23
"parser": "@typescript-eslint/parser",
34
"plugins": ["@typescript-eslint", "import"],
45
"extends": [
@@ -12,9 +13,23 @@
1213
"es6": true
1314
},
1415
"parserOptions": {
15-
"project": "./tsconfig.json",
16+
"project": "./tsconfig.base.json",
1617
"sourceType": "module"
1718
},
19+
"settings": {
20+
"import/parsers": {
21+
"@typescript-eslint/parser": [".ts", ".tsx"]
22+
},
23+
"import/resolver": {
24+
"node": true,
25+
"typescript": {
26+
"project": "packages/*/tsconfig.json"
27+
}
28+
},
29+
"react": {
30+
"version": "detect"
31+
}
32+
},
1833
"rules": {
1934
"react/jsx-key": ["error", { "checkFragmentShorthand": true }],
2035
"@typescript-eslint/ban-types": "off",
@@ -32,21 +47,8 @@
3247
],
3348
"no-shadow": "error",
3449
"import/no-cycle": "error",
35-
"import/no-unresolved": ["error", { "ignore": ["react-query"] }],
50+
"import/no-unresolved": ["error", { "ignore": ["^@tanstack\/"] }],
3651
"import/no-unused-modules": ["off", { "unusedExports": true }],
37-
"import/no-restricted-paths": [
38-
"error",
39-
{
40-
"zones": [
41-
{ "target": "src/core", "from": "src/broadcastQueryClient-experimental" },
42-
{ "target": "src/core", "from": "src/createAsyncStoragePersister" },
43-
{ "target": "src/core", "from": "src/createWebStoragePersister" },
44-
{ "target": "src/core", "from": "src/devtools" },
45-
{ "target": "src/core", "from": "src/persistQueryClient" },
46-
{ "target": "src/core", "from": "src/reactjs" }
47-
]
48-
}
49-
],
5052
"no-redeclare": "off"
5153
}
5254
}

.github/workflows/test-and-publish.yml renamed to .github/workflows/ci-v3.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@ name: react-query tests
33
on:
44
push:
55
branches:
6-
- 'master'
7-
- 'next'
8-
- 'alpha'
9-
- 'beta'
106
- '1.x'
117
- '2.x'
12-
pull_request:
13-
8+
- '3.x'
149
jobs:
1510
test:
1611
name: 'Node ${{ matrix.node }}, React ${{ matrix.react }}'
@@ -40,7 +35,7 @@ jobs:
4035
name: 'Publish Module to NPM'
4136
needs: test
4237
# publish only when merged in master on original repo, not on PR
43-
if: github.repository == 'tannerlinsley/react-query' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.ref == 'refs/heads/alpha' || github.ref == 'refs/heads/beta' || github.ref == 'refs/heads/1.x' || github.ref == 'refs/heads/2.x')
38+
if: github.repository == 'tannerlinsley/react-query' && (github.ref == 'refs/heads/1.x' || github.ref == 'refs/heads/2.x' || github.ref == 'refs/heads/3.x')
4439
runs-on: ubuntu-latest
4540
steps:
4641
- uses: actions/checkout@v2

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: ci
2+
concurrency:
3+
group: publish-${{ github.github.base_ref }}
4+
cancel-in-progress: true
5+
on: [push]
6+
jobs:
7+
test-and-publish:
8+
if: github.event_name != 'pull_request'
9+
name: 'Test & Publish'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: '0'
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: 16
18+
registry-url: https://registry.npmjs.org/
19+
cache: 'npm'
20+
- run: |
21+
npm i
22+
git config --global user.name 'Tanner Linsley'
23+
git config --global user.email '[email protected]'
24+
npm run cipublish
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
27+
GH_TOKEN: ${{ secrets.GH_TOKEN }}
28+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pr.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: pr
2+
on: [pull_request]
3+
jobs:
4+
test:
5+
name: 'Node ${{ matrix.node }}, React ${{ matrix.react }}'
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
node: [14, 16]
10+
react: [17, 18]
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-node@v2
14+
with:
15+
node-version: ${{ matrix.node }}
16+
- name: Install dependencies
17+
uses: bahmutov/npm-install@v1
18+
- run: npm run test:ci
19+
env:
20+
REACTJS_VERSION: ${{ matrix.react }}
21+
- run: npm run test:size
22+
if: matrix.node == '16' && matrix.react == '18'
23+
env:
24+
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v2

.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ node_modules
77
# builds
88
types
99
build
10+
*/build
1011
dist
1112
lib
1213
es
@@ -30,7 +31,13 @@ yarn-error.log*
3031
.history
3132
size-plugin.json
3233
stats-hydration.json
33-
stats-react.json
34+
stats.json
3435
stats.html
3536
.vscode/settings.json
36-
.idea/
37+
38+
*.log
39+
.DS_Store
40+
node_modules
41+
.cache
42+
dist
43+
.idea

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v16

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"trailingComma": "all"
5+
}

CONTRIBUTING.md

Lines changed: 0 additions & 112 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Tanner Linsley
3+
Copyright (c) 2021 Tanner Linsley
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)