Skip to content

Commit e0bacbe

Browse files
authored
Merge pull request #1 from crup/feature-timer-core-v1
feat(timer): implement v1 timer hooks
2 parents b21869d + f59f3d4 commit e0bacbe

41 files changed

Lines changed: 6717 additions & 7 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.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.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
verify:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
version: 10.30.2
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 25
28+
cache: pnpm
29+
30+
- name: Install
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Typecheck
34+
run: pnpm typecheck
35+
36+
- name: Test
37+
run: pnpm test
38+
39+
- name: Build
40+
run: pnpm build
41+
42+
- name: Build docs
43+
run: pnpm docs:build
44+
45+
- name: Check README
46+
run: pnpm readme:check

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
deploy:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 10.30.2
32+
33+
- name: Setup Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 25
37+
cache: pnpm
38+
39+
- name: Install
40+
run: pnpm install --frozen-lockfile
41+
42+
- name: Build package
43+
run: pnpm build
44+
45+
- name: Build docs
46+
run: pnpm docs:build
47+
48+
- name: Configure Pages
49+
uses: actions/configure-pages@v5
50+
51+
- name: Upload Pages artifact
52+
uses: actions/upload-pages-artifact@v3
53+
with:
54+
path: docs-api
55+
56+
- name: Deploy Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

.github/workflows/prerelease.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Prerelease
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: npm dist-tag to publish
8+
required: true
9+
default: alpha
10+
type: choice
11+
options:
12+
- alpha
13+
- beta
14+
- rc
15+
version_base:
16+
description: Base version before prerelease suffix
17+
required: true
18+
default: 0.0.1
19+
20+
permissions:
21+
contents: read
22+
id-token: write
23+
24+
jobs:
25+
publish:
26+
if: github.ref_name == 'next'
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup pnpm
33+
uses: pnpm/action-setup@v4
34+
with:
35+
version: 10.30.2
36+
37+
- name: Setup Node
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: 25
41+
cache: pnpm
42+
registry-url: https://registry.npmjs.org
43+
44+
- name: Install
45+
run: pnpm install --frozen-lockfile
46+
47+
- name: Verify
48+
run: |
49+
pnpm typecheck
50+
pnpm test
51+
52+
- name: Set prerelease version
53+
run: pnpm version "${{ inputs.version_base }}-${{ inputs.tag }}.${{ github.run_number }}" --no-git-tag-version
54+
55+
- name: Build package
56+
run: |
57+
pnpm build
58+
pnpm size
59+
60+
- name: Publish prerelease
61+
run: pnpm publish --tag "${{ inputs.tag }}" --access public --no-git-checks
62+
env:
63+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
64+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
id-token: write
12+
13+
concurrency:
14+
group: release
15+
cancel-in-progress: false
16+
17+
jobs:
18+
release:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v4
26+
with:
27+
version: 10.30.2
28+
29+
- name: Setup Node
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 25
33+
cache: pnpm
34+
registry-url: https://registry.npmjs.org
35+
36+
- name: Install
37+
run: pnpm install --frozen-lockfile
38+
39+
- name: Verify
40+
run: |
41+
pnpm typecheck
42+
pnpm test
43+
pnpm build
44+
45+
- name: Create release PR or publish
46+
uses: changesets/action@v1
47+
with:
48+
publish: pnpm release
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/size.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Size
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
compare:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout head
17+
uses: actions/checkout@v4
18+
with:
19+
path: head
20+
21+
- name: Checkout main
22+
uses: actions/checkout@v4
23+
with:
24+
ref: main
25+
path: base
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v4
29+
with:
30+
version: 10.30.2
31+
32+
- name: Setup Node
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 25
36+
37+
- name: Build head
38+
working-directory: head
39+
run: |
40+
pnpm install --frozen-lockfile
41+
pnpm build
42+
pnpm size:json > ../head-size.json
43+
44+
- name: Build base
45+
working-directory: base
46+
continue-on-error: true
47+
run: |
48+
pnpm install --frozen-lockfile
49+
pnpm build
50+
pnpm size:json > ../base-size.json
51+
52+
- name: Compare size
53+
run: |
54+
if [ -f base-size.json ]; then
55+
node head/scripts/size-compare.mjs base-size.json head-size.json >> "$GITHUB_STEP_SUMMARY"
56+
else
57+
echo "Base branch does not have size tooling yet. Head size:" >> "$GITHUB_STEP_SUMMARY"
58+
cat head-size.json >> "$GITHUB_STEP_SUMMARY"
59+
fi

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ build/Release
7878
# Dependency directories
7979
node_modules/
8080
jspm_packages/
81+
.pnpm-store/
8182

8283
# Snowpack dependency directory (https://snowpack.dev/)
8384
web_modules/
@@ -127,6 +128,7 @@ out
127128
# Nuxt.js build / generate output
128129
.nuxt
129130
dist
131+
docs-api
130132

131133
# Gatsby files
132134
.cache/
@@ -187,4 +189,4 @@ psd
187189
thumb
188190
sketch
189191

190-
# End of https://www.toptal.com/developers/gitignore/api/react,macos,node
192+
# End of https://www.toptal.com/developers/gitignore/api/react,macos,node

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec commitlint --edit "$1"

CONTRIBUTING.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This project aims to stay small, deterministic, and heavily tested. Please read
88
- [API Specification](./docs/API.md)
99
- [Implementation Plan](./docs/IMPLEMENTATION.md)
1010
- [Task Plan](./docs/TASKS.md)
11+
- [Branching and Commits](./docs/BRANCHING_AND_COMMITS.md)
1112

1213
## Project Boundaries
1314

@@ -48,9 +49,32 @@ Expected commands after project setup:
4849
pnpm test
4950
pnpm typecheck
5051
pnpm build
51-
pnpm docs:check
52+
pnpm docs:build
53+
pnpm readme:check
5254
```
5355

56+
## Branches and Commit Messages
57+
58+
Use `feature/timer-core-v1` for the first implementation branch.
59+
60+
Use Conventional Commits:
61+
62+
```txt
63+
<type>(<scope>): <summary>
64+
```
65+
66+
Examples:
67+
68+
```txt
69+
feat(timer): implement lifecycle controls
70+
fix(group): preserve item state across rerenders
71+
docs(release): document alpha prerelease flow
72+
```
73+
74+
Commit messages are enforced with commitlint through Husky. Changesets still own package versioning.
75+
76+
See [Branching and Commits](./docs/BRANCHING_AND_COMMITS.md) for the full branch, alpha, beta, release-candidate, and stable release flow.
77+
5478
## API Change Rules
5579

5680
Prefer recipes over new API.

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) 2026 Rajender Joshi
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)