Skip to content

Commit 3db8ce4

Browse files
authored
Add prettier and changeset process (#272)
* chore: add modern git hooks and prettier config - Initialize husky for git hooks - Add .prettierrc config - Update pre-commit to run lint-staged and tests - Remove old husky script from package.json * chore: remove husky and lint-staged * feat: add changesets for releases - Add @changesets/cli for versioning and changelog - Add release workflow that publishes to npm on main merge - Add PR check requiring a changeset - Add npm scripts for release workflow - CI runs on push and pull_request * fix: correct branch name
1 parent add9187 commit 3db8ce4

7 files changed

Lines changed: 1123 additions & 979 deletions

File tree

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

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,15 @@ jobs:
3434
cache: 'npm'
3535
- run: npm install
3636
- run: npm run build
37+
38+
changeset:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- name: Check for changeset
43+
run: |
44+
if [ ! -f ".changeset/"* ]; then
45+
echo "::warning::No changeset found. Consider adding one using 'npx changeset'"
46+
else
47+
echo "Changeset found ✓"
48+
fi

.github/workflows/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write
10+
contents: read
11+
12+
jobs:
13+
release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 22
20+
cache: 'npm'
21+
- run: npm install
22+
- run: npm run release
23+
- name: Publish to npm
24+
run: npm run publish:changesets
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.prettierrc

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

0 commit comments

Comments
 (0)