Contributions are always welcome, no matter how large or small!
Node: Check that Node is installed with version >= 24. You can check this with node -v.
pnpm: Make sure that pnpm is available. You can use corepack enable to automatically setup pnpm.
Rust: ReactLynx utilizes SWC plugins, necessitating the Rust toolchain for building.
- Ensure you have
rustupinstalled.
To setup the project, run:
rustup toolchain install
pnpm installFull Build (Required for Tests)
pnpm turbo buildBuild with Watching (TypeScript Only)
pnpm turbo watch buildpnpm eslint .- You can run eslint's auto-fix via:
pnpm eslint --fix .Tests for all packages via vitest:
pnpm testWhen working on an issue, you will most likely want to focus on a particular packages. Using --project will only run tests for that specific package.
pnpm run test --project websocketYou may also run tests of multiple projects together.
pnpm run test --project 'webpack/*'Pass the name of test suite to pnpm test to run a subset of tests by name:
pnpm run test serverMore options
You can also usedescribe.only or test.only to select suites and tests.
- test('run with webpack-dev-server', async () => {
+ test.only('run with webpack-dev-server', async () => {Quick way to debug tests in VS Code is via JavaScript Debug Terminal.
Open a new JavaScript Debug Terminal and run pnpm vitest.
This works with any code ran in Node, so will work with most JS testing frameworks.
See Debugging Vitest for more details.
You can combine debug with --project or .only to debug a subset of tests. If you plan to stay long in the debugger (which you'll likely do!), you may increase the test timeout by setting --testTimeout.
To overwrite any test fixtures when fixing a bug or anything, add the --update
pnpm run test --project websocket --updateTo test the code coverage, use --coverage:
pnpm run test --coverageEach package should have its own API reference documentation. It is generated by the comments of the public APIs using API Extractor.
To update the API reference, just run:
turbo api-extractor -- --localThis will update the <projectFolder>/etc which describe all the public APIs.
You should always commit the change to git.
We use dprint for automatic code formatting to maintain a consistent style. Please ensure your code is formatted prior to submitting.
Just run:
pnpm dprint fmtWe use 🦋 Changesets to manage versioning and changelogs. Usually, you need to generate changeset(s) for your changes.
Just run:
pnpm changesetThen select the correct packages with desired versions. See Adding a changeset for details.
Then commit the generated .md file in .changeset/ and submit a PR on GitHub.