Skip to content

Commit 7d67889

Browse files
committed
chore: setup changesets
1 parent 829fe9f commit 7d67889

8 files changed

Lines changed: 90 additions & 4 deletions

File tree

.changeset/config.json

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

.changeset/three-owls-reply.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@vnphanquang/githooks": major
3+
---
4+
5+
1.0.0 - Here be dragons

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ indent_size = 2
1111
trim_trailing_whitespace = true
1212
max_line_length = 100
1313

14+
[*.yaml]
15+
indent_style = space

.github/workflows/changesets.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Changesets
2+
on:
3+
push:
4+
branches:
5+
- main
6+
paths:
7+
- ".changeset/**"
8+
- ".github/workflows/changesets.yaml"
9+
workflow_dispatch:
10+
11+
env:
12+
CI: true
13+
jobs:
14+
Version:
15+
if: github.repository == 'vnphanquang/githooks' # prevents this action from running on forks
16+
permissions:
17+
contents: write # to create release (changesets/action)
18+
pull-requests: write # to create pull request (changesets/action)
19+
id-token: write # to publish to JSR
20+
timeout-minutes: 5
21+
runs-on: ubuntu-latest
22+
steps:
23+
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
29+
- name: Install Deno
30+
uses: denoland/setup-deno@v2
31+
with:
32+
deno-version: v2.x
33+
34+
- name: Run Tests
35+
run: "deno task test"
36+
37+
- name: Dry-run JSR publish
38+
run: "deno publish --dry-run"
39+
40+
- name: Create release PR
41+
uses: changesets/action@v1
42+
with:
43+
version: deno task changesets:version
44+
commit: "chore(release): changesets versioning & publication"
45+
title: "Changesets: Versioning & Publication"
46+
createGithubReleases: true
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
50+
- name: Publish to JSR
51+
if: steps.changesets.outputs.hasChangesets == 'false'
52+
run: "deno publish"

README.md

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

33
Utility for setting up git hooks. A Deno port of [husky]
44

5+
[![JSR][jsr.badge.package]][jsr.package] [![JSR][jsr.badge.score]][jsr.package]
6+
57
> [!IMPORTANT]
68
> Work in progress
79
@@ -12,3 +14,7 @@ This project is greatly inspired by [husky]; credits go to [@typicode](https://g
1214
[Yakiyo/deno_hooks](https://github.com/Yakiyo/deno_hooks) is a similar project. Please show them some love too.
1315

1416
[husky]: https://github.com/typicode/husky
17+
18+
[jsr.badge.package]: https://jsr.io/badges/@vnphanquang/githooks
19+
[jsr.badge.score]: https://jsr.io/badges/@vnphanquang/githooks/score
20+
[jsr.package]: https://jsr.io/@vnphanquang/githooks

deno.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@vnphanquang/githooks",
3-
"version": "1.0.0-next.0",
3+
"version": "1.0.0",
44
"exports": {
55
".": "./src/mod.ts",
6-
".bin": "./src/bin.ts",
6+
"./bin": "./src/bin.ts",
77
"./errors": "./src/errors.ts",
88
"./constants": "./src/constants.ts"
99
},
@@ -16,9 +16,11 @@
1616
]
1717
},
1818
"tasks": {
19-
"init": "deno run --allow-read --allow-write=\".githooks\" --allow-run=\"git\" bin.ts init",
19+
"init": "deno run --allow-read --allow-write=\".githooks\" --allow-run=\"git\" src/bin.ts init",
2020
"test": "deno test --allow-read --allow-write --allow-run --allow-net --clean --coverage",
21-
"coverage": "deno coverage --html"
21+
"coverage": "deno coverage --html",
22+
"changesets": "deno run -A npm:@changesets/cli",
23+
"changesets:version": "deno run -A npm:@changesets/cli version"
2224
},
2325
"fmt": {
2426
"useTabs": true,

deno.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "@vnphanquang/githooks",
3+
"version": "0.0.0"
4+
}

0 commit comments

Comments
 (0)