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
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
cache: pnpm
cache-dependency-path: pnpm-lock.yaml

- run: npm ci
- run: pnpm install --frozen-lockfile

- name: Typecheck
run: npm run typecheck
run: pnpm run typecheck

- name: Lint
run: npm run lint
run: pnpm run lint

- name: Format check
run: npm run format:check
run: pnpm run format:check

- name: Test
run: npm run test:coverage
run: pnpm run test:coverage

- name: Build
run: npm run build
run: pnpm run build

- name: Upload coverage
if: matrix.node == 22
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,18 @@ jobs:
steps:
- uses: actions/checkout@v6

- uses: pnpm/action-setup@v4

- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false

- run: npm ci

- name: Typecheck
run: npm run typecheck
- run: pnpm install --frozen-lockfile

- name: Lint
run: npm run lint

- name: Test
run: npm run test:run
- name: Verify release contract
run: pnpm run release:check

- name: Verify tag matches package.json version
run: |
Expand All @@ -41,8 +37,7 @@ jobs:
exit 1
fi

- name: Build
run: npm run build

- name: Publish to npm
run: npm publish --access public
# Tag checkouts use a detached HEAD, so pnpm's branch check cannot apply;
# the explicit tag/package-version check above remains authoritative.
run: pnpm publish --access public --provenance --no-git-checks
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ All notable changes to this project will be documented in this file.
- `once` option (default: `true`) — run effect only once or on every predicate match
- `onSkip` option — callback when predicate returns false
- Full TypeScript generics, no `any` or type assertions
- Release verification via `npm run release:check`
- Release verification via `pnpm run release:check`
- Predictable React 18 Strict Mode behavior per mount lifecycle
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -753,12 +753,25 @@ public documentation for package usage.
- In React Strict Mode, behavior is still scoped per mount lifecycle. A real remount is treated as a fresh hook instance.
- Public imports are exposed from the package root. Subpath imports are not required for the documented API.

## Development

```bash
pnpm install --frozen-lockfile
pnpm run typecheck
pnpm run lint
pnpm run format:check
pnpm run test:run
pnpm run test:coverage
pnpm run build
pnpm pack --pack-destination /tmp/react-effect-when-pack
```

## Publish Checklist

Before publishing a new version, make sure this command passes:
Before publishing a new version, make sure the combined release check passes:

```bash
npm run release:check
pnpm run release:check
```

## License
Expand Down
Loading
Loading