From 7fd4bd80ed5ba8a2dbfa6b8bd9a348da358a8126 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wi=C4=99cek?= Date: Sat, 18 Jan 2025 10:20:25 +0100 Subject: [PATCH] docs: enhance README with detailed command and debugging sections --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7e6600909..c9e94a64b 100644 --- a/README.md +++ b/README.md @@ -106,17 +106,61 @@ const res = isMyDataValid(data) ## Local Development -* `npm run start` - run benchmarks for all modules +### Commands + +#### Benchmarks + +* `npm run start` - run benchmarks for all modules using Node.js +* `npm run start:bun` - run benchmarks for all modules using bun * `npm run start run zod myzod valita` - run benchmarks only for a few selected modules + +#### Tests + +* `npm run test` - run build process and tests for all modules +* `npm run test:build` - run build process for all modules + +#### Docs + * `npm run docs:serve` - result viewer -* `npm run test` - run tests on all modules +* `npm run docs:build` - build docs +* `npm run docs:watch` - watch docs for changes and rebuild + +#### Linting + +* `npm run lint` - lint all files +* `npm run lint:fix` - lint all files and fix errors + +#### Misc -## Adding a new node version +* `npm run download-packages-popularity` - download popularity data from npmjs.com -* update node version matrix in `.github/workflows/pr.yml` and `.github/workflows/release.yml` +### Debugging + +#### Node.js + +* Use [nvm](https://github.com/nvm-sh/nvm) to switch to a specific Node.js version +* `nvm use x` - switch to Node.js x.x +* `nvm use 18` - switch to Node.js 18.x +* `nvm use 20` - switch to Node.js 20.x + +#### Bun + +* Use `curl -fsSl https://bun.sh/install | bash -s "bun-v1.0.x"` to switch to a specific bun version +* `curl -fsSl https://bun.sh/install | bash -s "bun-v1.1.43"` - switch to bun 1.1.43 + +## Adding new runtime version + +### Node.js runtime + +* update Node.js version matrix in `.github/workflows/pr.yml` and `.github/workflows/release.yml` * update `NODE_VERSIONS` in `docs/dist/app.tsx` and run `npm run docs:build` * optionally set `NODE_VERSION_FOR_PREVIEW` in `benchmarks/helpers/main.ts` +### Bun runtime + +* update bun version matrix in `.github/workflows/pr.yml` and `.github/workflows/release.yml` +* update `BUN_VERSIONS` in `docs/dist/app.tsx` and run `npm run docs:build` + ## Test cases * **Safe Parsing**