Skip to content

Commit

Permalink
fix(docs): improve the contribution guidelines (#2552)
Browse files Browse the repository at this point in the history
* ci(coverage): improve c8 configs

* docs: improve Contribute.md

* ci: exclude dirs from c8 coverage

* ci: adapt c8 limits

* ci: adapt Codecov limits

* docs: fix typo
  • Loading branch information
wellwelwel committed Apr 8, 2024
1 parent 0f08c7c commit 8a818ce
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 3 deletions.
12 changes: 12 additions & 0 deletions .nycrc
@@ -0,0 +1,12 @@
{
"all": true,
"include": ["index.js", "promise.js", "lib/**/*.js"],
"exclude": ["mysqldata/**", "node_modules/**", "test/**"],
"reporter": ["text", "lcov", "cobertura"],
"statements": 88,
"branches": 84,
"functions": 78,
"lines": 88,
"checkCoverage": true,
"clean": true
}
51 changes: 50 additions & 1 deletion Contributing.md
Expand Up @@ -16,6 +16,8 @@ Contributions are always welcomed. You can help **MySQL2** community in various
- Performance improvements
- Add Features

---

## Security Issues

Please contact project maintainers privately before opening a security issue on Github. It will allow us to fix the issue before attackers know about it.
Expand All @@ -24,18 +26,22 @@ Please contact project maintainers privately before opening a security issue on

- Andrey Sidorov, sidorares@yandex.ru

---

## New Features

It's better to discuss an API before actually start implementing it. You can open an issue on Github. We can discuss design of API and implementation ideas.

---

## Development

We assume you already have these tools installed on your system:

- MySQL Server
- Node.JS

As **MySQL2** is purely JS based you can develop it on Linux, Mac or Windows. Please follow these steps
As **MySQL2** is purely JS based, you can develop it on Linux, Mac or Windows. Please follow these steps

```bash
# clone node-mysql2
Expand All @@ -47,6 +53,40 @@ cd /path/to/node-mysql2
npm install
```

---

### Commits and Pull Request Titles

To ensure a clean commit history pattern, please use the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) format.

Prefixes that will trigger a new release version:

- `fix:` for patches, e.g., bug fixes that result in a patch version release.
- `feat:` for new features, e.g., additions that result in a minor version release.

Examples:

- `fix: message`
- `feat: message`
- `docs: message`
- `fix(module): message`
- `feat(module): message`
- etc.

---

### Including Tests

#### Fixes

Where possible, provide an error test case that your fix covers.

#### Features

Please ensure test cases to cover your features.

---

### Running Tests

Running tests requires MySQL server and an empty database. You can run `bash` command given below to create `test` database
Expand Down Expand Up @@ -77,3 +117,12 @@ FILTER='test-timestamp' npm run test
# or
FILTER='timeout' npm run test
```

> [!Tip]
> You can also run a single test by performing `node ./test/path-to-test-file`.
For testing **coverage**:

```bash
npm run coverage-test
```
2 changes: 1 addition & 1 deletion codecov.yml
Expand Up @@ -2,5 +2,5 @@ coverage:
status:
project:
default:
target: 90%
target: 89%
threshold: 2%
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
"test": "poku --debug --include=\"test/esm,test/unit,test/integration\"",
"test:bun": "poku --debug --platform=\"bun\" --include=\"test/esm,test/unit,test/integration\"",
"test:tsc-build": "cd \"test/tsc-build\" && npx tsc -p \"tsconfig.json\"",
"coverage-test": "c8 -r cobertura -r lcov -r text npm run test",
"coverage-test": "c8 npm run test",
"benchmark": "node ./benchmarks/benchmark.js",
"prettier": "prettier --single-quote --trailing-comma none --write \"{lib,test}/**/*.js\"",
"prettier:docs": "prettier --single-quote --trailing-comma none --write README.md",
Expand Down

0 comments on commit 8a818ce

Please sign in to comment.