From 67f64b06782ba37dafa1358c772b5f11297ef43a Mon Sep 17 00:00:00 2001 From: Romuald Brillout Date: Sun, 16 Jun 2024 12:33:22 +0200 Subject: [PATCH] add CONTRIBUTING.md --- CONTRIBUTING.md | 57 +++++++++++++++++++++++++++++++++++ README.md | 8 ++--- packages/vike-react/README.md | 7 ++--- 3 files changed, 63 insertions(+), 9 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..cbc138f0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,57 @@ +Contributions welcome! + +### Install + +```shell +git clone git@github.com:vikejs/vike-react +cd vike-react/ +pnpm install +``` + +> [!NOTE] +> See [System requirements](#system-requirements) for how to install `pnpm`. + +### Build + +```shell +# Build all packages/* +pnpm build +``` + +### Develop + +To develop (watch & re-build upon file changes): + +```shell +cd packages/vike-react # or any other packages/* +pnpm dev +``` + +In a second shell: + +```shell +cd examples/full/ # or any other examples/* +pnpm dev +``` + +That's it. You can now view and test your modifications. + +> [!Warning] +> After changing the source code of `vike-react(-*)`, make sure to **always clear Vite's client cache** with `$ rm -rf examples/full/node_modules/.vite/`. Otherwise you'll get a version mismatch between the server (using the latest build) and the client (using the previous cached build). + +> [!Warning] +> When switching Git branches, make sure to **run `pnpm reset`** at the monorepo root: it will re-install and re-build everything. It's required when swtiching to a branch that, for example, requires another Vike version. + +
+ +## System requirements + +- Node.js `>=16.0.0` +- pnpm `>=9.0.0` + +> [!NOTE] +> To install [pnpm](https://pnpm.io) run: +> ```shell +> npm install -g pnpm +> ``` +> (Or see [pnpm.io > Installation](https://pnpm.io/installation#using-npm) for alternative methods.) diff --git a/README.md b/README.md index c13f6622..54d72655 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ -[](https://vike.dev) +[Vike extensions](https://vike.dev/extensions) for [React](https://react.dev). -# `vike-react*` - -[Vike extensions](https://vike.dev/extensions) for [React](https://react.dev): - `vike-react` ([React](https://react.dev) integration) - Docs: [`vike.dev/vike-react`](https://vike.dev/vike-react) - Version history: [CHANGELOG.md](packages/vike-react/CHANGELOG.md) @@ -11,3 +8,6 @@ - Docs: [`README.md`](packages/vike-react-query#readme) - Version history: [CHANGELOG.md](packages/vike-react-query/CHANGELOG.md) - Source code: [/packages/vike-react-query](packages/vike-react-query) + +> [!NOTE] +> The source code is [small, simple, and highly polished](https://vike.dev/vike-react#under-the-hood). Contributing is easy and very much welcome, see [CONTRIBUTING.md](CONTRIBUTING.md) to get started. diff --git a/packages/vike-react/README.md b/packages/vike-react/README.md index 2e2cb8e7..1535bca0 100644 --- a/packages/vike-react/README.md +++ b/packages/vike-react/README.md @@ -1,5 +1,2 @@ -Source code of `vike-react`. - -See also: -- Docs at [`vike.dev`](https://vike.dev) and [`vike.dev/vike-react`](https://vike.dev/vike-react) -- [CHANGELOG.md](https://github.com/vikejs/vike-react/blob/main/packages/vike-react/CHANGELOG.md) +Docs: [`vike.dev/vike-react`](https://vike.dev/vike-react). +Source code: [GitHub > vikejs/vike-react](https://github.com/vikejs/vike-react).