diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 98eabe5..b10791c 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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: '' @@ -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** diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 9b4a0dc..c443717 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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: '' diff --git a/.github/actions/check-quality/action.yml b/.github/actions/check-quality/action.yml index ee46774..06c9c45 100644 --- a/.github/actions/check-quality/action.yml +++ b/.github/actions/check-quality/action.yml @@ -6,6 +6,9 @@ runs: - shell: bash run: pnpm prettier-check + - shell: bash + run: pnpm type-check + - shell: bash run: pnpm lint diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13679f4..7a312d3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 @@ -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 ``` - +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. @@ -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. diff --git a/package.json b/package.json index aa1e42c..74763a5 100644 --- a/package.json +++ b/package.json @@ -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",