-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,35 @@ | ||
# StoryLite Contributing Guide | ||
# Contributing Guide | ||
|
||
Thanks for your interest to contribute to StoryLite. Please take a moment and read through this guide: | ||
Thanks for your interest to contribute to this project. Please take a moment and read through this guide: | ||
|
||
## Repository | ||
|
||
StoryLite is a monorepo using turbo and pnpm workspaces. We use Node v18 in our local dev setup. | ||
The package manager used to install dependencies must be [pnpm v8](https://pnpm.io/) or greater. | ||
This project is a monorepo using turbo and pnpm workspaces. We use Node v18 or v20. | ||
The package manager used to install and link dependencies must be [pnpm v8](https://pnpm.io/). | ||
|
||
It can be installed as: | ||
|
||
```sh | ||
npm install -g pnpm@8 | ||
``` | ||
|
||
Install the dependencies after forking and cloning the repository | ||
|
||
```sh | ||
pnpm install | ||
``` | ||
|
||
## Developing | ||
|
||
The main packages are `ui` and `vite-plugin`, and can be found in `packages/*`. | ||
|
||
You can quickly build and preview your changes by running the `dev` command | ||
(it will also start the React example project): | ||
|
||
```sh | ||
pnpm dev | ||
``` | ||
|
||
This starts a Vite dev server on `http://localhost:7707`, with the React examples. | ||
|
||
## Preview | ||
|
||
To preview the static StoryLite site generated by the example React project, run: | ||
|
||
```sh | ||
pnpm preview | ||
``` | ||
|
||
This starts a static web server on `http://localhost:8080`, with the static assets generated | ||
by Vite. | ||
To get started, use the Quick Start guide found in the [README](README.md) to install dependencies | ||
and start the dev server. | ||
|
||
## Tests | ||
The different packages can be found in `packages/*`, and that's where you'll be mainly working. | ||
|
||
Please, cover all your changes with `Jest` tests, and then run `pnpm test` or `pnpm test:coverage`. | ||
## Testing | ||
|
||
Before creating a PR you should also make sure all quality checks are still passing by simply running: | ||
We use `jest` to run tests. You can run all tests with: | ||
|
||
```sh | ||
pnpm quality-check-all | ||
pnpm test | ||
``` | ||
|
||
This runs linters, type checks, tests and builds all packages. | ||
|
||
## Documentation | ||
|
||
If possible, your changes should be also documented. | ||
|
||
## Changesets | ||
|
||
StoryLite uses [changesets](https://github.com/changesets/changesets) to manage the changelog and releases. | ||
|
||
Commit to `main` that comes from a PR, should | ||
[add a changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) | ||
(or you will be asked to do so in your PR): | ||
|
||
```sh | ||
pnpm changeset | ||
``` | ||
|
||
You will be asked to select the scope and version (patch, minor, major). | ||
Then you should add a summary of the changes in the following format: | ||
|
||
- WHAT the change is | ||
- WHY the change was made | ||
- HOW a consumer should update their code to use the new changes (if applicable) | ||
|
||
This will create an `.changeset/*.md` file that gets merged with your PR and attached to the release | ||
by admins later. | ||
Tests ending with `*.test.tsx` or `*.dom.test.ts` are considered browser tests and will be run in a | ||
browser-like environment using `jsdom`. | ||
|
||
The `*.md` file will have a random name. Don't worry about it, the file name is not important, | ||
and it's not used to generate the changelog. Commit the file in your PR. | ||
Tests ending with `*.test.ts` (except `*.dom.test.ts`) are considered universal tests and will be | ||
run in both `node` and `jsdom` environments. |