Installation
Getting Started
- bun
- pnpm
- npm
- yarn
To install stayte, go to your project folder and add the following line to your package.json
file:
{
...
"trustedDependencies": [
"stayte"
],
}
And then run:
bun add stayte zod
Create or add a .npmrc
file in the root of your project and add the following line:
enable-pre-post-scripts=true
side-effects-cache=false
Then run:
pnpm add stayte zod
Npm doesn't support the patching mechanism
So it's not supported yet...
Yarn install documentation is not available yet...
Note: For now you need to install zod manually because stayte doesn't include it in its bundle and it's a requirement to use the library (in the future, stayte will be able to be used without zod)
Now you can use stayte in your project by importing it:
import { ... } from "stayte";
Next.js
If you are using next.js, a patch will be automatically applied to your project, you don't need to do anything. If you want to check the patch, you can find every patch here.
Statye actually only work in dynamic rendering mode, so if you are using static rendering, unexpected behavior will appear.
Note: Stayte is only available since next.js 14.2.13 and above. if you are using an older version, leave a message in the issues and I will try to update the patch.
Sometimes, your package manager don't directly apply the patch, in this case, just run the command to install the dependencies and the patch will be applied automatically.