Skip to content

Commit

Permalink
docs: improve readmes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjavi committed Aug 9, 2023
1 parent d890136 commit ec4e077
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 56 deletions.
12 changes: 3 additions & 9 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Create a report to help us improve StoryLite
about: Create a report to help us improve this project
title: ''
labels: needs triage
assignees: ''
Expand All @@ -12,16 +12,10 @@ A clear and concise description of what the bug is.

**Reproduction**

Please, try to reproduce your issue with [Stackblitz](https://stackblitz.com/) or similar. Your issue will get much
higher priority since it can be triaged efficiently.
Please, try to reproduce your issue with [Stackblitz](https://stackblitz.com/) or similar.
Your issue will get much higher priority since it can be triaged efficiently.

Alternatively, create a repository reproducing the issue.
Or describe steps to reproduce and copy+paste the output from:

```sh
pnpm storylite serve
pnpm storylite build
```

**Environment**

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature request
about: Suggest an idea for StoryLite
about: Suggest an idea for this project
title: ''
labels: needs triage
assignees: ''
Expand Down
3 changes: 3 additions & 0 deletions .github/actions/check-quality/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ runs:
- shell: bash
run: pnpm prettier-check

- shell: bash
run: pnpm type-check

- shell: bash
run: pnpm lint

Expand Down
75 changes: 30 additions & 45 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Thanks for your interest to contribute to StoryLite. Please take a moment and re

## Repository

StoryLite is a monorepo using turbo and pnpm workspaces. We use Node v18. The package manager used to install and link
dependencies must be [pnpm v8](https://pnpm.io/). It can be installed as:
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.

It can be installed as:

```sh
npm install -g pnpm@8
Expand All @@ -19,48 +21,44 @@ pnpm install

## Developing

The main `@storylite/storylite` package can be found in `packages/storylite`. You can quickly test and debug your
changes in `@storylite/storylite` by running `packages/example` (it's a playground project so feel free to add more
stories using other frontend frameworks there):
The main `@storylite/storylite` package can be found in `packages/storylite`.

You can quickly test and debug your changes in `@storylite/storylite` by running `packages/example`
(it's a playground project with demos in many frameworks to try out storylite):

```sh
cd packages/example
pnpm storylite serve
pnpm storylite build
pnpm dev
```

## Tests
This starts a Vite dev server on `http://localhost:7707`, with the React examples.

Please, cover all your changes with tests.
## Preview

Before creating a PR you should make sure all tests are still passing:
To preview the static StoryLite site generated by the example React project, run:

```sh
# On the root project dir
pnpm typecheck
pnpm lint

# On the directory of individual packages
pnpm build
pnpm test
pnpm preview
```

<!--
There are unit tests and end-to-end tests powered by Playwright in `e2e/` folder. If you are adding a new feature, you
will be almost always asked to add a new e2e test. You can add it to one of the existing suites / test applications or
create new one.
-->
This starts a static web server on `http://localhost:8080`, with the static assets generated
by Vite.

## Documentation
## Tests

Please, cover all your changes with `Jest` tests, and then run `pnpm test` or `pnpm test:coverage`.

If applicable, your changes should be also documented on `packages/docs`.
The doc site can be started as:
Before creating a PR you should also make sure all quality checks are still passing by simply running:

```sh
cd packages/docs
pnpm start
pnpm quality-check-all
```

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.
Expand All @@ -80,21 +78,8 @@ Then you should add a summary of the changes in the following format:
- 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.

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.

## Creating a new package

If you need to create a new package under `packages`, it also needs to be added to:

- `pnpm-workspace.yaml#packages`

The package should have a `package.json` file with at least the following fields:

- `name` (e.g. `@storylite/my-package`)
- `version` (e.g. `0.0.0`)
- `"private": true` if it's not meant to be published to npm
This will create an `.changeset/*.md` file that gets merged with your PR and attached to the release
by admins later.

Then run `pnpm install` to install the dependencies and update the lockfile.
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.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"prettier-fix": "prettier --write .",
"pretty": "pnpm run format",
"preview": "pnpm build && npx -y http-server ./packages/examples/react/dist",
"publint": "turbo publint-check",
"publint-check": "turbo publint-check",
"quality-check-all": "pnpm prettier-check && pnpm lint && pnpm publint && pnpm type-check && pnpm build && pnpm test",
"test": "jest --passWithNoTests",
"test:ci": "jest --ci --passWithNoTests --coverage",
"test:coverage": "jest --passWithNoTests --coverage",
Expand Down

0 comments on commit ec4e077

Please sign in to comment.