From 1faab6a22af8f4ee157dfd49aaaf1724cd888b25 Mon Sep 17 00:00:00 2001 From: justintaddei <=> Date: Wed, 26 Jun 2024 20:59:30 -0600 Subject: [PATCH] docs: add docs to help contributors --- .release-please-manifest.json | 2 +- CONTRIBUTING.md | 62 +++++++++++++++++++++++++++++++++++ README.md | 5 +++ biome.json | 2 +- package.json | 4 ++- release-please-config.json | 2 +- vitest.config.ts | 1 + 7 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 46b1b67..e18ee07 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { ".": "0.0.0" -} \ No newline at end of file +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3d91780 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,62 @@ +# Contributing to v-wave + +Thank you for your interest contributing to v-wave! As this project is maintained by just one person, your help is greatly appreciated. + +## Table of contents + +- [Contributing to v-wave](#contributing-to-v-wave) + - [Table of contents](#table-of-contents) + - [Prerequisites](#prerequisites) + - [Setup](#setup) + - [Development](#development) + - [Testing](#testing) + - [Linting and formatting](#linting-and-formatting) + - [Building](#building) + - [Raising a pull request](#raising-a-pull-request) + +## Prerequisites + +This project uses pnpm for package management. Installation instructions can be found [here](https://pnpm.io/installation). + +## Setup + +Run `pnpm install` to install dependencies and set up git commit hooks. + +**If you're using VSCode, I recommend installing the following extensions:** + +- [biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) (for displaying linting/formatting errors) +- [vitest](https://marketplace.visualstudio.com/items?itemName=vitest.explorer) (for displaying vitest test results in the editor) + + +## Development + +### Testing + +This project uses [vitest](https://vitest.dev/) for testing. +> If you're familiar with Jest, you should be able to write most tests using your existing knowledge, substituting `jest.*` functions for `vi.*`. + +Run `pnpm test` or `pnpm test:watch` to run the test suite. +Run `pnpm test:coverage` to run the test suite and generate a coverage report. + +When writing tests, place them in the same directory as the file they are testing. +Test files should follow this naming convention: `.test.ts`. + +### Linting and formatting + +Run `pnpm lint` to lint and format the project. +Run `pnpm lint:no-write` to lint the project without writing any changes. + +### Building + +Run `pnpm build` to build the project for production. +Run `pnpm dev` to build the project and watch for changes. + + +## Raising a pull request + +When you're ready to raise a pull request, please follow these steps: + +1. Ensure that commits follow [Conventional Commits](https://www.conventionalcommits.org/) and meaningful describe your changes. Your commit messages will be used to generate the changelog automatically. +2. When you commit your changes, hooks will run automatically to ensure your code follows the project's conventions. Please do not commit using `git commit --no-verify`. If you do, the CI will fail for PR and you'll need to fix any linting errors before it can be merged. + > **Note:** if the CI fails because your commit message didn't comply with [Conventional Commits](https://www.conventionalcommits.org/), you will need to modify your commit message using `git commit --amend` or `git rebase -i`. +3. Please try to provide as much context as possible in the PR description as it will help me to review your changes more quickly. diff --git a/README.md b/README.md index 1aba523..2d65dc3 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ After installing and registering the plugin, this is all you need to get started - [Local registration with Composition API:](#local-registration-with-composition-api) - [Local registration with Options API:](#local-registration-with-options-api) - [Changing the directive's name](#changing-the-directives-name) +- [Contributing](#contributing) - [License](#license) ## Installation @@ -658,6 +659,10 @@ Now you can use the plugin like so: > Keep in mind that this option can only be set globally (i.e. it cannot be set on individual directives). +## Contributing + +Contributions are welcome! Please see [CONTRIBUTING.md](https://github.com/justintaddei/v-wave/blob/master/CONTRIBUTING.md) for more details. + ## License This project is distributed under the [MIT License](https://github.com/justintaddei/v-wave/blob/master/LICENSE.md). diff --git a/biome.json b/biome.json index 57da11d..73d11af 100644 --- a/biome.json +++ b/biome.json @@ -4,7 +4,7 @@ "enabled": true, "formatWithErrors": false, "indentStyle": "space", - "lineEnding": "lf", + "lineEnding": "crlf", "lineWidth": 120 }, "organizeImports": { "enabled": true }, diff --git a/package.json b/package.json index 5032ecd..ddf3381 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,12 @@ "files": ["dist/**/*", "nuxt/**/*"], "scripts": { "build": "tsup src/index.ts --clean --dts --format esm,cjs,iife --global-name VWave", + "dev": "tsup src/index.ts --watch --dts --format esm,cjs,iife --global-name VWave", "lint": "biome check --write && tsc", "lint:no-write": "biome check && tsc", "test": "vitest run --run", - "test:watch": "vitest --coverage", + "test:watch": "vitest", + "test:coverage": "vitest run --run --coverage", "prepare": "husky" }, "devDependencies": { diff --git a/release-please-config.json b/release-please-config.json index 161d1ad..8df8757 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -10,4 +10,4 @@ } }, "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" -} \ No newline at end of file +} diff --git a/vitest.config.ts b/vitest.config.ts index f27b6c8..2a6e15d 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -6,5 +6,6 @@ export default defineConfig({ coverage: { reporter: ['text', 'html'], }, + include: ['src/**/*.test.ts'], }, })