Skip to content

Commit

Permalink
docs: update guidelines
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed Aug 21, 2023
1 parent 4793bab commit 656997f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 65 deletions.
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement via private message on
Twitter to @itsjavidev.
Twitter to @itsjavidotcom.

All complaints will be reviewed and investigated promptly and fairly.

Expand Down
78 changes: 14 additions & 64 deletions CONTRIBUTING.md
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.

0 comments on commit 656997f

Please sign in to comment.