Skip to content

Commit 0cd3988

Browse files
committed
init
0 parents  commit 0cd3988

25 files changed

Lines changed: 5375 additions & 0 deletions

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": true,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Use Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
- name: Run CI
29+
run: npm run ci
30+
deploy:
31+
runs-on: ubuntu-latest
32+
needs: ci
33+
if: github.ref == 'refs/heads/main'
34+
steps:
35+
- uses: actions/checkout@v4
36+
37+
- name: Use Node.js
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: '20'
41+
42+
- name: Install dependencies
43+
run: npm install
44+
45+
- name: Run CI
46+
run: npm run ci
47+
48+
- name: Set up .npmrc
49+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
50+
env:
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
53+
- name: Publish
54+
run: npm run local-release
55+
env:
56+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
data

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/*.test.ts
2+
src/test-util.ts

.prettierrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "all",
5+
"printWidth": 80,
6+
"tabWidth": 2
7+
}

CONTRIBUTING.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Contributing to pg-bg-job-queue
2+
3+
Thank you for your interest in contributing to **pg-bg-job-queue**! Your help is greatly appreciated. This guide will help you get started with contributing, from setting up your environment to submitting your first pull request.
4+
5+
## Table of Contents
6+
7+
- [Getting Started](#getting-started)
8+
- [Development Workflow](#development-workflow)
9+
- [Coding Standards](#coding-standards)
10+
- [Testing](#testing)
11+
- [Submitting Changes](#submitting-changes)
12+
- [Reporting Issues](#reporting-issues)
13+
- [Code of Conduct](#code-of-conduct)
14+
15+
---
16+
17+
## Getting Started
18+
19+
1. **Fork the repository** on GitHub and clone your fork locally:
20+
```bash
21+
git clone https://github.com/your-username/pg-bg-job-queue.git
22+
cd pg-bg-job-queue
23+
```
24+
2. **Install dependencies**:
25+
```bash
26+
npm install
27+
```
28+
3. **Set up your environment**:
29+
- Copy `.env.example` to `.env` and update the variables as needed (e.g., `DATABASE_URL`).
30+
- Make sure you have a PostgreSQL instance running and accessible.
31+
32+
## Development Workflow
33+
34+
- Create a new branch for your feature or bugfix:
35+
```bash
36+
git checkout -b feature/your-feature-name
37+
# or
38+
git checkout -b fix/your-bugfix
39+
```
40+
- Make your changes, following the coding standards below.
41+
- Add or update tests as needed.
42+
- Run the test suite to ensure everything works:
43+
```bash
44+
npm test
45+
```
46+
- Commit your changes with a clear, descriptive message.
47+
- Push your branch and open a pull request (PR) against the `main` branch.
48+
49+
## Coding Standards
50+
51+
- Use **TypeScript** for all code.
52+
- Follow the existing code style. We use [Prettier](https://prettier.io/) for formatting.
53+
- Run `npm run format` before submitting your PR.
54+
- Write clear, concise comments and documentation.
55+
- Avoid using the `any` type; prefer strict typing.
56+
- Group related code (components, hooks, utils) together for easier maintenance.
57+
58+
## Testing
59+
60+
- All new features and bug fixes should include relevant tests.
61+
- First run `docker-compose up` to start the PostgreSQL container which will be used for testing.
62+
- Run the test suite with:
63+
```bash
64+
npm run test
65+
```
66+
- Add tests in the `src/` directory, following the existing test structure.
67+
- Tests should be deterministic and not depend on external state.
68+
69+
## Submitting Changes
70+
71+
- Ensure your branch is up to date with `main` before opening a PR.
72+
- Provide a clear description of your changes in the PR.
73+
- Reference any related issues (e.g., `Closes #123`).
74+
- Be responsive to feedback and make requested changes promptly.
75+
- PRs should pass all CI checks before merging.
76+
77+
## Reporting Issues
78+
79+
If you find a bug or have a feature request:
80+
81+
- Search [existing issues](https://github.com/your-username/pg-bg-job-queue/issues) to avoid duplicates.
82+
- Open a new issue with a clear title and detailed description.
83+
- Include steps to reproduce, expected behavior, and relevant logs or screenshots.
84+
85+
## Code of Conduct
86+
87+
- Be respectful and inclusive in all interactions.
88+
- Provide constructive feedback and be open to feedback on your contributions.
89+
- See [Contributor Covenant](https://www.contributor-covenant.org/) for general guidelines.
90+
91+
---
92+
93+
Thank you for helping make **pg-bg-job-queue** better!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Nico Prananta 2024
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)