Skip to content

Commit

Permalink
refactor: switch from npm workspaces to pnpm
Browse files Browse the repository at this point in the history
RELEASE_ALL

* chore(pnpm): update lockfile

* chore(pnpm): add pnpm

* chore(pnpm): get rid of private:true

which was only needed for yarn workspaces; also, remove the csb workaround, because it didn't work with private:true

* chore(pnpm): switch to workspace:* dependencies

because pnpm will replace them automatically during publish

* chore(pnpm): use ^ dependencies for examples

we will always get the latest version as there is no lockfile for them

* chore(pnpm): update publish script to use pnpm

this also means we don't need to update package.json at all because we use workspace dependencies now

* chore(pnpm): devtools need react-error-boundary

* chore(pnpm): replace lerna with pnpm

* chore(pnpm): use pnpm to install in CI

* chore(pnpm): fix install in ci

* chore(pnpm): fix yml syntax

* chore(pnpm): add jest-dom to react-query

* chore(pnpm): add jest-dom to types

* chore(pnpm): explicitly add jest-dom typings

* chore(pnpm): revert jest-com changes

* chore(pnpm): ok prettier, whatever

* chore(pnpm): go to pnpm v7

* chore(pnpm): use stricter node version

* chore(pnpm): oh boy

* chore(pnpm): remove engines

because codesandbox-ci has a different version

* chore(pnpm): restore updating version in publish script

* chore(pnpm): filter pnpm scripts and installs down to ./packages

so that we exclude examples

* chore(pnpm): remove filtering from installs

as it doesn't install top-level dependencies; also, --frozen-lockfile is the default for CI environments
  • Loading branch information
TkDodo authored Sep 28, 2022
1 parent 4645881 commit dce2815
Show file tree
Hide file tree
Showing 43 changed files with 20,290 additions and 71,015 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
fetch-depth: '0'
version: 7
- uses: actions/setup-node@v2
with:
node-version: 16.14.2
registry-url: https://registry.npmjs.org/
cache: 'npm'
cache: 'pnpm'
- run: |
npm i
pnpm install
git config --global user.name 'Tanner Linsley'
git config --global user.email '[email protected]'
npm run cipublish
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ jobs:
react: [17, 18]
steps:
- uses: actions/checkout@v2
- uses: pnpm/[email protected]
with:
version: 7
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: Install dependencies
uses: bahmutov/npm-install@v1
with:
install-command: npm install
run: pnpm install
- run: |
npm run test:ci
npm run test:size
pnpm run test:ci
pnpm run test:size
if: matrix.react == '18'
env:
REACTJS_VERSION: ${{ matrix.react }}
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
- run: npm run test:jest
- run: pnpm run test:jest
if: matrix.react == '17'
env:
REACTJS_VERSION: ${{ matrix.react }}
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ If you are here to suggest a feature, first create an issue if it does not alrea
If you have been assigned to fix an issue or develop a new feature, please follow these steps to get started:

- Fork this repository
- Install dependencies by running `$ npm install`
- Install dependencies by running `$ pnpm install`
- We use [pnpm](https://pnpm.io/) v7 for package management
- We use [nvm](https://github.com/nvm-sh/nvm) to manage node versions - please make sure to use the version mentioned in `.nvmrc`.
- Link `TanStack/query` locally - we recommend using [yalc](https://github.com/wclr/yalc)
- Implement your changes and tests to files in the `src/` directory and corresponding test files
Expand Down
5 changes: 2 additions & 3 deletions examples/react/auto-refetching/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-refetch-interval",
"private": true,
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,8 +9,8 @@
"next": "12.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"scripts": {
"dev": "next",
Expand Down
5 changes: 2 additions & 3 deletions examples/react/basic-graphql-request/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-basic-graphql-request",
"private": true,
"version": "0.0.1",
"main": "src/index.jsx",
"scripts": {
Expand All @@ -13,8 +12,8 @@
"graphql-request": "^3.1.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"devDependencies": {
"@vitejs/plugin-react": "^2.0.0",
Expand Down
9 changes: 4 additions & 5 deletions examples/react/basic-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-basic-typescript",
"private": true,
"version": "0.0.1",
"scripts": {
"start": "rescripts start",
Expand All @@ -13,10 +12,10 @@
"broadcast-channel": "^3.4.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1",
"@tanstack/react-query-persist-client": "4.7.1",
"@tanstack/query-sync-storage-persister": "4.7.1",
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1",
"@tanstack/react-query-persist-client": "^4.7.1",
"@tanstack/query-sync-storage-persister": "^4.7.1",
"react-scripts": "3.0.1",
"stop-runaway-react-effects": "^1.2.0",
"styled-components": "^4.3.2",
Expand Down
5 changes: 2 additions & 3 deletions examples/react/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "@tanstack/query-example-react-basic",
"version": "0.0.1",
"private": true,
"main": "src/index.jsx",
"scripts": {
"dev": "vite",
Expand All @@ -12,8 +11,8 @@
"axios": "^0.21.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"devDependencies": {
"@vitejs/plugin-react": "^2.0.0",
Expand Down
40 changes: 0 additions & 40 deletions examples/react/custom-hooks/package.json

This file was deleted.

5 changes: 2 additions & 3 deletions examples/react/default-query-function/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-default-query-function",
"private": true,
"version": "0.0.1",
"main": "src/index.jsx",
"scripts": {
Expand All @@ -12,8 +11,8 @@
"axios": "^0.26.1",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"devDependencies": {
"@vitejs/plugin-react": "^2.0.0",
Expand Down
21 changes: 0 additions & 21 deletions examples/react/focus-refetching/package.json

This file was deleted.

5 changes: 2 additions & 3 deletions examples/react/load-more-infinite-scroll/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-load-more-infinite-scroll",
"private": true,
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand All @@ -11,8 +10,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-intersection-observer": "^8.33.1",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"scripts": {
"dev": "next",
Expand Down
5 changes: 2 additions & 3 deletions examples/react/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-nextjs",
"private": true,
"version": "1.0.0",
"scripts": {
"dev": "next",
Expand All @@ -13,8 +12,8 @@
"next": "12.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1",
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1",
"resolve-from": "^5.0.0",
"web-streams-polyfill": "^3.0.3"
},
Expand Down
9 changes: 4 additions & 5 deletions examples/react/offline/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-offline",
"private": true,
"version": "0.0.1",
"main": "src/index.jsx",
"scripts": {
Expand All @@ -15,10 +14,10 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-hot-toast": "^2.2.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1",
"@tanstack/react-query-persist-client": "4.7.1",
"@tanstack/query-sync-storage-persister": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1",
"@tanstack/react-query-persist-client": "^4.7.1",
"@tanstack/query-sync-storage-persister": "^4.7.1"
},
"devDependencies": {
"@vitejs/plugin-react": "^2.0.0",
Expand Down
5 changes: 2 additions & 3 deletions examples/react/optimistic-updates-typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-optimistic-updates-typescript",
"private": true,
"version": "1.0.0",
"main": "pages/index.tsx",
"license": "MIT",
Expand All @@ -12,8 +11,8 @@
"next": "12.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1",
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1",
"typescript": "^4.1.2"
},
"scripts": {
Expand Down
21 changes: 0 additions & 21 deletions examples/react/optimistic-updates/package.json

This file was deleted.

5 changes: 2 additions & 3 deletions examples/react/pagination/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-pagination",
"private": true,
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,8 +9,8 @@
"next": "12.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"scripts": {
"dev": "next",
Expand Down
5 changes: 2 additions & 3 deletions examples/react/playground/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-playground",
"private": true,
"version": "0.0.1",
"main": "src/index.jsx",
"scripts": {
Expand All @@ -11,8 +10,8 @@
"dependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"devDependencies": {
"@vitejs/plugin-react": "^2.0.0",
Expand Down
5 changes: 2 additions & 3 deletions examples/react/prefetching/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-prefetching",
"private": true,
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
Expand All @@ -10,8 +9,8 @@
"next": "12.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1"
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1"
},
"scripts": {
"dev": "next",
Expand Down
5 changes: 2 additions & 3 deletions examples/react/react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@tanstack/query-example-react-react-native",
"private": true,
"version": "0.0.1",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
Expand All @@ -27,8 +26,8 @@
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-web": "0.17.1",
"@tanstack/react-query": "4.7.1",
"@tanstack/react-query-devtools": "4.7.1",
"@tanstack/react-query": "^4.7.1",
"@tanstack/react-query-devtools": "^4.7.1",
"expo-constants": "~12.1.3",
"react-native-paper": "4.9.2",
"react-native-screens": "~3.8.0",
Expand Down
Loading

0 comments on commit dce2815

Please sign in to comment.