-
Notifications
You must be signed in to change notification settings - Fork 8
refactor: migrate to typescript, undici, and improve contributing #42
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,17 @@ name: build | |
|
||
on: | ||
push: | ||
schedule: | ||
- cron: '15 2,10,18 * * *' | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Build with Node.js ${{ matrix.node-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [16, latest] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to keep compatibility with node 18 at least, but it is ok if we cannot. |
||
node-version: [20, 22, latest] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
@@ -23,11 +24,16 @@ jobs: | |
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 9 | ||
run_install: true | ||
|
||
- name: Linting | ||
run: pnpm eslint | ||
|
||
- name: Run tests | ||
run: npm test | ||
- name: Type-checking | ||
run: pnpm typecheck | ||
|
||
- name: Run linter | ||
run: npm run eslint | ||
- name: Tests | ||
run: pnpm test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ coverage | |
.idea | ||
*.iml | ||
.DS_Store | ||
certs | ||
dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"tabWidth": 2, | ||
"useTabs": false | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Contributing to nodejs-questdb-client | ||
|
||
Thank you for your interest in contributing to nodejs-questdb-client! This document provides guidelines and instructions for contributing to the project. | ||
|
||
## Development Setup | ||
|
||
1. Fork and clone the repository: | ||
```bash | ||
git clone https://github.com/YOUR_USERNAME/nodejs-questdb-client.git | ||
cd nodejs-questdb-client | ||
``` | ||
|
||
2. Install dependencies: | ||
```bash | ||
pnpm install | ||
``` | ||
|
||
|
||
## Running Tests | ||
|
||
The project uses Vitest for testing. Tests are located in the `test` directory. | ||
|
||
1. Run tests in watch mode during development: | ||
```bash | ||
pnpm run test | ||
``` | ||
|
||
### Test Requirements | ||
|
||
- Some tests use mock servers and certificates located in the `test/certs` directory | ||
|
||
> You can generate the certificates by running the `generateCerts.sh` script in the `scripts` directory. The script requires two arguments: the output directory and the password for the certificates. | ||
`./scripts/generateCerts.sh . questdbPwd123` | ||
|
||
|
||
## Code Style and Quality | ||
|
||
1. The project uses TypeScript. Make sure your code is properly typed. | ||
|
||
2. Format your code using Prettier | ||
|
||
3. Lint your code: | ||
```bash | ||
pnpm run lint | ||
``` | ||
|
||
4. Fix linting issues: | ||
```bash | ||
pnpm run lint --fix | ||
``` | ||
|
||
## Making Changes | ||
|
||
1. Create a new branch for your changes: | ||
```bash | ||
git checkout -b feature/your-feature-name | ||
``` | ||
|
||
2. Make your changes and commit them with clear, descriptive commit messages: | ||
```bash | ||
git add . | ||
git commit -m "feat: add new feature" | ||
``` | ||
|
||
We follow the [Conventional Commits](https://www.conventionalcommits.org/) specification for commit messages. | ||
|
||
3. Push your changes to your fork: | ||
```bash | ||
git push origin feature/your-feature-name | ||
``` | ||
|
||
4. Create a Pull Request from your fork to the main repository. | ||
|
||
## Pull Request Guidelines | ||
|
||
1. Make sure all tests pass | ||
2. Update documentation if needed | ||
3. Add tests for new features | ||
4. Keep PRs focused - one feature or bug fix per PR | ||
5. Link any related issues in the PR description | ||
|
||
## Documentation | ||
|
||
- Update the README.md if you're adding new features or changing existing ones | ||
- Add JSDoc comments for new public APIs | ||
- Include examples in the documentation when appropriate | ||
|
||
## Need Help? | ||
|
||
If you have questions or need help, you can: | ||
- Open an issue with your question | ||
- Join our community discussions (if available) | ||
|
||
## License | ||
|
||
By contributing to nodejs-questdb-client, you agree that your contributions will be licensed under the project's license. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This build was scheduled to run 3 times a day to catch possible incompatibility issues with the server.
Would be good to keep it that way.
The server moves very fast, and it is good to see early on, if we broke compatibility with the clients.