Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): improve the contribution guidelines #2552

Merged
merged 6 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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, [email protected]

---

## 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ coverage:
status:
project:
default:
target: 90%
target: 89%
threshold: 2%
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
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
Loading