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
5 changes: 5 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changesets

This folder contains release notes generated by `@changesets/cli`.

Run `pnpm changeset` when a PR changes the published `react-use-hook-kit` package.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.2/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "p-iknow/react-hook-kit" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
4 changes: 4 additions & 0 deletions .changeset/initial-publication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Published the package as `react-use-hook-kit` and updated the workspace, docs, and CI release checks to use the new npm package name. The CI workflow now syncs injected workspace dependencies after building so React compatibility fixtures can resolve the freshly built package on clean installs.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @p-iknow
6 changes: 4 additions & 2 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug report
about: Report a bug in the template
about: Report a bug in react-use-hook-kit
labels: bug
---

Expand All @@ -27,4 +27,6 @@ labels: bug
- Node version:
- pnpm version:
- OS:
- Framework overlay (none/tanstack-start/next):
- React version:
- react-use-hook-kit version:
- Runtime/framework:
33 changes: 27 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
## Summary
## Description

<!-- What does this PR do? -->
<!-- Summarize the change and include related issue/context if applicable. -->

**Related Issue:** Fixes #

## Changes

<!-- List the main changes made in this PR. -->

## Motivation and Context

<!-- Explain why this change is needed. -->

## Test Plan

<!-- Describe the tests or checks you ran. -->

- [ ] Unit tests pass (`pnpm test`)
- [ ] Type checks pass (`pnpm typecheck`)
- [ ] Lint passes (`pnpm lint`)
- [ ] Format check passes (`pnpm format:check`)
- [ ] Template CI matrix passes (`both-apps`, `tanstack-only`, `next-only`)
- [ ] Package build passes (`pnpm --filter react-use-hook-kit run build`)
- [ ] Package publish checks pass (`pnpm --filter react-use-hook-kit run test:attw`, `pnpm --filter react-use-hook-kit run test:publint`)

## Type of Change

- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
- [ ] Maintenance

## Checklist

- [ ] Tokens remain as `repo`, `{{app-name}}`, `sample` (not resolved)
- [ ] I have performed a self-review.
- [ ] I have added or updated tests where needed.
- [ ] I have added a changeset for published package changes (`pnpm changeset`).
- [ ] No new dependencies added without updating `pnpm-workspace.yaml` catalog
39 changes: 39 additions & 0 deletions .github/workflows/changeset-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Changeset Check

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read

jobs:
changeset-check:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check for changeset
run: |
CHANGED=$(git diff --name-only origin/main...HEAD)

PACKAGE_CHANGED=$(echo "$CHANGED" | grep -Ec '^(packages/react-hook-kit/src/|packages/react-hook-kit/package\.json|packages/react-hook-kit/tsdown\.config\.ts)' || true)

if [ "$PACKAGE_CHANGED" -gt 0 ]; then
CHANGESET_FILES=$(echo "$CHANGED" | grep -Ec '^\.changeset/.*\.md$' || true)

if [ "$CHANGESET_FILES" -eq 0 ]; then
echo "::error::This PR changes the published react-use-hook-kit package but does not include a changeset."
echo ""
echo "Add one with:"
echo " pnpm changeset"
exit 1
fi

echo "Changeset found."
else
echo "No published package changes detected."
fi
42 changes: 34 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,59 @@ name: CI

on:
push:
branches:
- main
branches: [main]
pull_request:
types: [opened, synchronize, reopened]

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

permissions:
actions: read
contents: read

jobs:
main:
ci:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
command:
[
'pnpm lint',
'pnpm format:check',
'pnpm typecheck',
'pnpm test',
'pnpm sheriff',
'pnpm knip',
'pnpm --filter react-use-hook-kit run build',
'pnpm --filter react-use-hook-kit run test:attw',
'pnpm --filter react-use-hook-kit run test:publint',
'pnpm --filter @repo/compat-react-17 run test',
'pnpm --filter @repo/compat-react-18 run test',
'pnpm --filter @repo/compat-react-19 run test',
]
steps:
- uses: actions/checkout@v4
with:
filter: tree:0
fetch-depth: 0

- uses: pnpm/action-setup@v4
with:
version: 10

- uses: actions/setup-node@v4
with:
node-version: 24
node-version-file: '.nvmrc'
cache: 'pnpm'

- run: pnpm install --frozen-lockfile

- run: pnpm check
- run: pnpm build
- name: Build Package
run: pnpm --filter react-use-hook-kit run build

- name: Sync injected workspace dependencies
run: pnpm install --frozen-lockfile --offline

- name: Run command
run: ${{ matrix.command }}
80 changes: 80 additions & 0 deletions .github/workflows/publish-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Publish by PR Comment

on:
issue_comment:
types:
- created

jobs:
publish:
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/publish')
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write

steps:
- name: Get PR branch
id: pr
uses: actions/github-script@v7
with:
script: |
const pr = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
core.setOutput('ref', pr.data.head.ref);
core.setOutput('sha', pr.data.head.sha);

- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ steps.pr.outputs.ref }}
fetch-depth: 0
token: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build Package
run: pnpm --filter react-use-hook-kit run build

- name: Set Variables
id: vars
run: |
echo "base_version=$(node -p "require('./packages/react-hook-kit/package.json').version")" >> $GITHUB_OUTPUT

- name: Publish to npm
id: publish
run: |
VERSION=${{ steps.vars.outputs.base_version }}-pr${{ github.event.issue.number }}
echo "version=$VERSION" >> $GITHUB_OUTPUT
cd packages/react-hook-kit
npm version $VERSION --no-git-tag-version
npm publish --access public --tag pr${{ github.event.issue.number }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Comment on PR
uses: actions/github-script@v7
with:
script: |
const version = '${{ steps.publish.outputs.version }}';
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `Published \`react-use-hook-kit@${version}\` to npm.\n\nInstall with:\n\`\`\`bash\npnpm add react-use-hook-kit@${version}\n\`\`\``
});
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build Package
run: pnpm --filter react-use-hook-kit run build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
title: 'chore: version packages'
commit: 'chore: version packages'
version: pnpm changeset:version
publish: pnpm changeset:publish
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create v-prefixed git tag
if: steps.changesets.outputs.published == 'true'
run: |
VERSION=$(node -p "require('./packages/react-hook-kit/package.json').version")
if git rev-parse "v${VERSION}" >/dev/null 2>&1; then
echo "Tag v${VERSION} already exists. Skipping."
else
git tag "v${VERSION}"
git push origin "v${VERSION}"
fi
48 changes: 0 additions & 48 deletions .github/workflows/template-ci.yml

This file was deleted.

Loading
Loading