Commit 7dd0759
docs: Update CONTRIBUTING.md with Rust setup and turbo build info. (#741)
<!--
Thank you for submitting a pull request!
We appreciate the time and effort you have invested in making these
changes. Please ensure that you provide enough information to allow
others to review your pull request.
Upon submission, your pull request will be automatically assigned with
reviewers.
If you want to learn more about contributing to this project, please
visit:
https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md.
-->
## Summary
<!-- Can you explain the reasoning behind implementing this change? What
problem or issue does this pull request resolve? -->
This pull request updates `CONTRIBUTING.md` to address setup and build
issues encountered by new contributors, resolving the problems
documented in issue #710.
**Problem:** Following the previous instructions in `CONTRIBUTING.md`
(`pnpm install` -> `pnpm build` -> `pnpm test`) leads to test failures,
specifically the `Could not resolve "./dist/vitest.config"` error.
**Reasoning & Root Causes:**
1. **Missing Prerequisite:** The project requires a specific Rust
toolchain version, **`1.81.0`**, as defined in the `rust-toolchain` file
at the root, along with the `wasm32-unknown-unknown` target for
compiling native code (WASM/NAPI). This requirement was not documented,
causing build failures during the Rust compilation steps for users who
only had a different version (like the latest stable `1.86.0`)
installed.
2. **Incomplete Build Command:** The documented `pnpm build` command
(which is an alias for `tsc --build`) only performs TypeScript
compilation. It does *not* handle the necessary Rust compilation steps
or other package-specific build scripts (like `rslib build` used by
`@lynx-js/reactlynx-testing-library`) required to generate all artifacts
needed for testing, including the missing `dist/vitest.config.js`.
3. **Correct Build Process:** The full project build needs to be
orchestrated by Turborepo using the command `pnpm exec turbo run build`.
This ensures all dependencies (including Rust components) are built in
the correct order before dependent packages attempt to use them.
**Solution Implemented in this PR:**
* The `CONTRIBUTING.md` file has been updated to:
* Clearly list Rust `1.81.0` and the `wasm32-unknown-unknown` target as
prerequisites, including the `rustup` command needed to install them.
* Revise the "Building" section to emphasize that `pnpm exec turbo run
build` is the required command for a complete build that must be run
before `pnpm test`.
* Clarify the limited scope of the root `pnpm build` (`tsc --build`)
command.
These documentation changes will help future contributors set up their
environment correctly and avoid the build/test failures initially
reported.
<!-- It would be helpful if you could provide any relevant context, such
as GitHub issues or related discussions. -->
close: #710
## Checklist
<!--- Check and mark with an "x" -->
- [ ] Tests updated (or not required). **NOT REQUIRED**
- [x] Documentation updated (or not required). **CONTRIBUTING.md
UPDATED**
cspell.jsonc: "rustup" added to **words**
---------
Signed-off-by: Chthonic <devchthonic@protonmail.com>
Signed-off-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com>
Co-authored-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com>1 parent 121ccd8 commit 7dd0759
2 files changed
+31
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
11 | 20 | | |
12 | 21 | | |
13 | 22 | | |
| |||
18 | 27 | | |
19 | 28 | | |
20 | 29 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 30 | + | |
38 | 31 | | |
39 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
40 | 35 | | |
41 | | - | |
| 36 | + | |
42 | 37 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
| |||
142 | 137 | | |
143 | 138 | | |
144 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
145 | 153 | | |
146 | 154 | | |
147 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
0 commit comments