@k8stack/react-rest-client
v1.1.0
Published
This is a rest-client based on `@k8stack/react.lib`(for creating React libraries, based on [Rslib](https://lib.rsbuild.dev/)).
Readme
react.lib.rest-client
This is a rest-client based on @k8stack/react.lib(for creating React libraries, based on Rslib).
It provides a simple and efficient way to caching and managing REST API requests in your React applications (via TanStack-Query) and checking incoming DTO (via Zod).
It includes:
- TypeScript,
- ESLint,
- Prettier,
- Vitest.
It also uses semantic-release for automated versioning and publishing.
Requirements
Getting Started
Setting up GitHub Token (GH_TOKEN)
- GitHub Personal Access Token
- Click
Generate new token - Generate a new token with the following permissions:
- Actions - read and write
- Commit statuses - read and write
- Contents - read and write
- Deployments - read and write
- Issues - read and write
- Copy the token and add it to your repository's secrets:
- Go to your repository settings
- Navigate to Secrets and variables > Actions
- Create a new secret named `GH_TOKEN
Setting up NPM Token (NPM_TOKEN)
- Go to npmjs.com
- Navigate to your profile settings
- Select "Access Tokens"
- Create a new access token (Publish)
- Copy the token and add it to your repository's secrets:
- Go to your repository settings
- Navigate to Secrets and variables > Actions
- Create a new secret named
NPM_TOKEN
Scripts (used in dev workflow)
setup- install dependencies and required node- and pnpm-versiondev- start development server for the example app and watch for changes on the library and example applint- run ESLint on the librarytest- run tests using Vitest- ~~
publish~~ - don't run this manually, it's handled by semantic-release (it publish the library to npm and GitHub Packages and creates a release on GitHub)
Release Process
This template uses semantic-release for automated versioning and publishing.
The release process is triggered automatically when changes are pushed to the main branch.
Commit messages should follow the Conventional Commits specification:
fix: ...- patch releasefeat: ...- minor releaseBREAKING CHANGE: ...at the footer - major release
