Skip to content

Commit b89c78c

Browse files
committed
feat: initialize project with npm package configuration and setup files
1 parent a665149 commit b89c78c

22 files changed

Lines changed: 1864 additions & 0 deletions

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- develop
8+
- main
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
verify:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 10.30.3
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 22
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Verify
36+
run: pnpm run verify
37+

.github/workflows/release.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Release Please
19+
id: release
20+
uses: googleapis/release-please-action@v4
21+
with:
22+
release-type: node
23+
package-name: srcset-kit
24+
25+
- name: Checkout
26+
if: ${{ steps.release.outputs.release_created }}
27+
uses: actions/checkout@v4
28+
29+
- name: Setup pnpm
30+
if: ${{ steps.release.outputs.release_created }}
31+
uses: pnpm/action-setup@v4
32+
with:
33+
version: 10.30.3
34+
35+
- name: Setup Node.js
36+
if: ${{ steps.release.outputs.release_created }}
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: 22
40+
cache: pnpm
41+
registry-url: https://registry.npmjs.org/
42+
43+
- name: Install dependencies
44+
if: ${{ steps.release.outputs.release_created }}
45+
run: pnpm install --frozen-lockfile
46+
47+
- name: Verify
48+
if: ${{ steps.release.outputs.release_created }}
49+
run: pnpm run verify
50+
51+
- name: Publish to npm
52+
if: ${{ steps.release.outputs.release_created }}
53+
run: pnpm publish --provenance --access public
54+

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.DS_Store
2+
.idea/
3+
4+
node_modules/
5+
dist/
6+
coverage/
7+
.rslib/
8+
.rstest/
9+
.rsbuild/
10+
11+
*.log
12+
npm-debug.log*
13+
pnpm-debug.log*
14+
yarn-debug.log*
15+
yarn-error.log*
16+

.husky/commit-msg

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

.husky/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm exec lint-staged
2+

.husky/pre-push

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pnpm run test && pnpm run build
2+

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
engine-strict=false
2+
fund=false
3+

.nvmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
22
2+

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
This project uses Conventional Commits and Release Please to generate releases.
6+

CONTRIBUTING.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Contributing
2+
3+
## Requirements
4+
5+
- Node.js 22 or newer for local development.
6+
- pnpm 10 or newer.
7+
8+
## Local checks
9+
10+
```sh
11+
pnpm install
12+
pnpm run verify
13+
```
14+
15+
Use focused commands while developing:
16+
17+
```sh
18+
pnpm run test
19+
pnpm run build
20+
pnpm run typecheck
21+
pnpm run format
22+
```
23+
24+
## Commits
25+
26+
This repository uses Conventional Commits. Examples:
27+
28+
```text
29+
feat: add srcset parser
30+
fix: keep descriptor whitespace valid
31+
chore(release): merge main back into develop
32+
```
33+
34+
Husky runs `commitlint` for commit messages.
35+
36+
## Branch flow
37+
38+
The repository follows a GitFlow-like process without requiring the GitFlow CLI:
39+
40+
- feature and fix pull requests target `develop`;
41+
- release pull requests merge `develop` into `main`;
42+
- Release Please creates a release pull request in `main`;
43+
- after the release pull request is merged, GitHub Release and npm publishing run automatically;
44+
- merge `main` back into `develop` after every release so `develop` receives the version, changelog, and lockfile updates.
45+
46+
When a merge commit is created manually, keep the merge message conventional, for example:
47+
48+
```text
49+
chore(release): merge main back into develop
50+
feat: merge feature/parser
51+
```
52+
53+
## Hooks
54+
55+
Husky hooks are installed by `pnpm install`.
56+
57+
- `pre-commit` formats staged files with Biome through lint-staged and keeps the formatted result in the current commit.
58+
- `commit-msg` validates Conventional Commits.
59+
- `pre-push` runs tests and the build.
60+

0 commit comments

Comments
 (0)