Skip to content
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
74 changes: 74 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Bug Report
description: Report a bug in timekeeper-countdown
title: "[Bug]: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for reporting a bug! Please fill out the form below.

- type: textarea
id: description
attributes:
label: Bug Description
description: A clear and concise description of the bug.
placeholder: Describe the bug...
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Reproduction Steps
description: Steps to reproduce the behavior.
placeholder: |
1. Create a countdown with...
2. Call start()...
3. After 5 seconds...
4. See error...
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected Behavior
description: What you expected to happen.
validations:
required: true

- type: dropdown
id: package
attributes:
label: Affected Package
options:
- "@timekeeper-countdown/core"
- "@timekeeper-countdown/react"
- Both
validations:
required: true

- type: textarea
id: system-info
attributes:
label: System Information
description: Paste relevant environment details.
placeholder: |
- Package version:
- Node.js version:
- OS:
- Browser (if applicable):
render: text

- type: checkboxes
id: validations
attributes:
label: Validations
options:
- label: I have read the [Code of Conduct](https://github.com/eagle-head/timekeeper-countdown/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: I have searched for [existing issues](https://github.com/eagle-head/timekeeper-countdown/issues)
required: true
- label: I have tested with the latest version
required: true
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Questions & Help
url: https://github.com/eagle-head/timekeeper-countdown/discussions
about: Ask questions and get help from the community.
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Feature Request
description: Suggest a new feature or improvement
title: "[Feature]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a feature! Please fill out the form below.

- type: textarea
id: motivation
attributes:
label: Problem or Motivation
description: What problem does this feature solve? Why is it needed?
placeholder: I'm always frustrated when...
validations:
required: true

- type: textarea
id: solution
attributes:
label: Proposed Solution
description: Describe the solution you'd like to see.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Any alternative solutions or workarounds you've considered?

- type: dropdown
id: package
attributes:
label: Related Package
options:
- "@timekeeper-countdown/core"
- "@timekeeper-countdown/react"
- New adapter
- Documentation
validations:
required: true

- type: checkboxes
id: validations
attributes:
label: Validations
options:
- label: I have read the [Code of Conduct](https://github.com/eagle-head/timekeeper-countdown/blob/main/CODE_OF_CONDUCT.md)
required: true
- label: I have searched for [existing issues](https://github.com/eagle-head/timekeeper-countdown/issues)
required: true
35 changes: 35 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Description

<!-- What does this PR do? Why is it needed? -->

Fixes #<!-- issue number -->

## Type of Change

<!-- Check the one that applies -->

- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
- [ ] Refactoring (no functional changes)
- [ ] Chore (dependencies, CI, build, etc.)

## How to Test

<!-- Describe how reviewers can test your changes -->

1.
2.
3.

## Checklist

- [ ] My code follows the project's code style
- [ ] I have added/updated tests for my changes
- [ ] `npm run lint` passes
- [ ] `npm run typecheck` passes
- [ ] `npm run test` passes
- [ ] I have followed the [commit convention](.github/commit-convention.md)
- [ ] I have added a changeset (`npm run changeset`) if this is a user-facing change
- [ ] I have updated documentation if needed
110 changes: 110 additions & 0 deletions .github/commit-convention.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Commit Convention

This project follows [Conventional Commits](https://www.conventionalcommits.org/).

## Format

```
<type>(<scope>): <subject>

<body>

<footer>
```

Only `<type>` and `<subject>` are required. Scope, body, and footer are optional.

## Types

| Type | Description |
| ---------- | ------------------------------------ |
| `feat` | New feature |
| `fix` | Bug fix |
| `docs` | Documentation only |
| `style` | Code style changes (no logic change) |
| `refactor` | Code refactoring (no feature or fix) |
| `perf` | Performance improvement |
| `test` | Adding or updating tests |
| `chore` | Maintenance, dependencies, tooling |
| `ci` | CI/CD configuration |
| `build` | Build system changes |

## Scopes

Scopes are optional. Use them when the change is specific to a package:

| Scope | When to use |
| ------- | ---------------------------------------- |
| `core` | Changes to `@timekeeper-countdown/core` |
| `react` | Changes to `@timekeeper-countdown/react` |
| `docs` | Changes to the documentation site |
| `deps` | Dependency updates |

Omit the scope when the change spans multiple packages or is project-wide.

## Rules

- Use **imperative mood**: "add feature" not "added feature"
- **Do not capitalize** the first letter of the subject
- **No period** at the end of the subject
- Subject line: **max 50 characters**
- Body: wrap at **72 characters** per line
- Separate subject from body with a **blank line**

## Breaking Changes

Indicate breaking changes with `!` before the colon:

```
feat(core)!: remove deprecated startFrom option
```

Or use the `BREAKING CHANGE:` footer:

```
feat(core): change snapshot format

BREAKING CHANGE: snapshot.remaining is now in milliseconds instead of seconds
```

## Examples

```
feat(react): add onComplete callback to useCountdown
```

```
fix(core): correct elapsed time calculation after resume
```

```
docs: update getting started guide
```

```
test(core): add edge case tests for pause/resume cycle
```

```
refactor(core): extract tick logic into separate function
```

```
chore(deps): bump vitest to v2
```

```
ci: add Node 20 to test matrix
```

```
perf(core): reduce unnecessary snapshot allocations
```

```
style: apply prettier formatting to config files
```

```
build: update tsup config for tree-shaking
```
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
- run: npm run format:check

typecheck:
name: Type Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build --workspace @timekeeper-countdown/core
- run: npm run typecheck

test:
name: Test (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm run test

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
Loading