We use pnpm for installing dependencies and running scripts.
The main branch is locked for the push action. For proposing changes, use the standard pull request approach. It's recommended to discuss fixes or new functionality in the Issues first.
Just run:
pnpm install
pnpm buildSix demo apps are available:
create-react-app— a rich demo covering different caching strategies.next— a Next.js demo for testing SSR scenarios.next-appDir— the same Next.js demo using theappdirectory.preact— a Preact demo.vite— a Vite demo.webpack-based— a demo using raw webpack.
Build the SDK before building or starting an example app. From the repository root, run:
pnpm buildBuild an example with pnpm --filter <package-name> build, or start it with
pnpm --filter <package-name> dev.
For example:
pnpm --filter vite-example devThe code style is controlled by ESLint and Prettier. Run to check that the code style is ok:
pnpm lintYou aren't required to run the check manually, the CI will do it. Run the following command to fix style issues (not all issues can be fixed automatically):
pnpm lint:fixTests are located in __tests__ folder and run by vitest in jsdom environment.
To run tests you can use IDE instruments or just run:
pnpm testTo run tests once with a coverage report:
pnpm test:coverageTo check the distributive TypeScript declarations, build the project and run:
pnpm test:dtsThe API reference is generated from the source with TypeDoc. Regenerate it into the (git-ignored) docs/ folder with:
pnpm docsReleases are managed with changesets.
When you make a change that should be released, add a changeset to your pull request:
pnpm changesetThis prompts you to select the bump type (major, minor, or patch) and to write a summary that becomes the changelog entry. Commit the generated file in .changeset/ along with your changes.
When PRs with changesets are merged to main, the release workflow opens (or updates) a "Version Packages" pull request that bumps the version and updates the changelog. Merging that pull request builds the package and publishes it to NPM.