Skip to content

Commit dd20616

Browse files
chore: sync CONTRIBUTING.md between projects
Adds instructions on editing docs locally
1 parent a4f3956 commit dd20616

File tree

1 file changed

+57
-4
lines changed

1 file changed

+57
-4
lines changed

‎CONTRIBUTING.md

Lines changed: 57 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,63 @@ If you have been assigned to fix an issue or develop a new feature, please follo
5252
- Git stage your required changes and commit (see below commit guidelines).
5353
- Submit PR for review.
5454

55+
### Editing the docs locally and previewing the changes
56+
57+
The documentations for all 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 changes in the `TanStack/query` docs.
58+
59+
> [!NOTE]
60+
> The website fetches the doc pages from GitHub in production, and searches for them 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 for local 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.
78+
# Read more about shallow clones here:
79+
# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/#user-content-shallow-clones
80+
git clone git@github.com:TanStack/tanstack.com.git --depth=1 --single-branch --branch=main
81+
```
82+
83+
> [!NOTE]
84+
> 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/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:
109+
110+
https://github.com/fulopkovacs/form/assets/43729152/9d35a3c3-8153-4e74-9cb2-af275f7a269b
111+
55112
### Running examples
56113

57114
- 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
72129
pnpm run dev
73130
```
74131

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-
79132
#### Note on standalone execution
80133

81134
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.

0 commit comments

Comments
 (0)