You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Main | [](https://bundlejs.com/?q=https://esm.sh/@tanstack/react-query/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.0/jsx-runtime?target=es2022%22,%22react@%5E19.1.0?target=es2022%22%5D%7D%7D) |
73
+
| This PR | [](https://bundlejs.com/?q=https://esm.sh/pr/@tanstack/react-query@${{ env.COMMIT_SHA }}/es2022/react-query.mjs&config=%7B%22esbuild%22:%7B%22external%22:%5B%22react@%5E19.1.0/jsx-runtime?target=es2022%22,%22react@%5E19.1.0?target=es2022%22%5D%7D%7D) |
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+90-4Lines changed: 90 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,6 +52,63 @@ If you have been assigned to fix an issue or develop a new feature, please follo
52
52
- Git stage your required changes and commit (see below commit guidelines).
53
53
- Submit PR for review.
54
54
55
+
### Editing the docs locally and previewing the changes
56
+
57
+
The documentations forall the TanStack projects are hosted on [tanstack.com](https://tanstack.com), which is a TanStack Start application (https://github.com/TanStack/tanstack.com). You need to run this app locally to preview your changesin the `TanStack/query` docs.
58
+
59
+
> [!NOTE]
60
+
> The website fetches the doc pages from GitHub in production, and searches forthem at `../query/docs`in development. Your local clone of `TanStack/query` needs to be in the same directory as the local clone of `TansStack/tanstack.com`.
61
+
62
+
You can follow these steps to set up the docs forlocal development:
63
+
64
+
1. Make a new directory called `tanstack`.
65
+
66
+
```sh
67
+
mkdir tanstack
68
+
```
69
+
70
+
2. Enter that directory and clone the [`TanStack/query`](https://github.com/TanStack/query) and [`TanStack/tanstack.com`](https://github.com/TanStack/tanstack.com) repos.
71
+
72
+
```sh
73
+
cd tanstack
74
+
git clone git@github.com:TanStack/query.git
75
+
# We probably don't need all the branches and commit history
76
+
# from the `tanstack.com` repo, so let's just create a shallow
77
+
# clone of the latest version of the `main` branch.
> Your `tanstack` directory should look like this:
85
+
>
86
+
>```
87
+
> tanstack/
88
+
>|
89
+
> +-- query/ (<-- this directory cannot be called anything else!)
90
+
>|
91
+
> +-- tanstack.com/
92
+
>```
93
+
94
+
3. Enter the `tanstack/tanstack.com` directory, install the dependencies and run the app in dev mode:
95
+
96
+
```sh
97
+
cd tanstack.com
98
+
pnpm i
99
+
# The app will run on https://localhost:3000 by default
100
+
pnpm dev
101
+
```
102
+
103
+
4. Now you can visit http://localhost:3000/query/latest/docs/framework/react/overview in the browser and see the changes you make in`tanstack/query/docs` there.
104
+
105
+
> [!WARNING]
106
+
> You will need to update the `docs/config.json` file (in `TanStack/query`) if you add a new documentation page!
107
+
108
+
You can see the whole process in the screen capture below:
- Make sure you've installed the dependencies in the repo's root directory.
@@ -72,10 +129,6 @@ If you have been assigned to fix an issue or develop a new feature, please follo
72
129
pnpm run dev
73
130
```
74
131
75
-
#### Note on `examples/react-native`
76
-
77
-
React Native example requires Expo to work. Please follow the instructions from example's README.md file to learn more.
78
-
79
132
#### Note on standalone execution
80
133
81
134
If you want to run an example without installing dependencies for the whole repo, just follow instructions from the example's README.md file. It will be then run against the latest TanStack Query release.
@@ -183,3 +236,36 @@ Use an appropriate commit type. Be especially careful with breaking changes.
183
236
## Releases
184
237
185
238
For each new commit added to `main` with `git push` or by merging a pull request or merging from another branch, a GitHub action is triggered and runs the `semantic-release`command to make a release if there are codebase changes since the last release that affect the package functionalities.
239
+
240
+
## 🧪 Test
241
+
242
+
TanStack Query uses [Nx](https://nx.dev/) as its monorepo tool.
243
+
To run tests in a local environment, you should use `nx` commands from the root directory.
244
+
245
+
### ✅ Run all tests
246
+
247
+
To run tests for**all packages**, run:
248
+
249
+
```bash
250
+
npm run test
251
+
```
252
+
253
+
### ✅ Run tests for a specific package
254
+
255
+
To run tests for a specific package, use the following command:
256
+
257
+
```bash
258
+
npx nx run @tanstack/{package-name}:test:lib
259
+
```
260
+
261
+
For example:
262
+
263
+
```bash
264
+
npx nx run @tanstack/react-query:test:lib
265
+
```
266
+
267
+
### ⚠️ Caution
268
+
269
+
Do not run `pnpm run test:lib` inside individual package folders.
270
+
This can cause test failures due to dependencies between packages.
271
+
Always run tests from the **root folder** using `nx` commands.
0 commit comments