Skip to content

Commit a41e003

Browse files
frankieyanclaude
andauthored
ci: Publish to npm registry alongside GH packages registry (#19)
* ci: Publish to npm registry alongside GH packages registry * Remove usage of NPM_TOKEN * Remove unreleased section from changelog * feat(ci): Support Node.js 22 and 24 LTS versions Update engines field to explicitly target LTS versions only: - ^22.22.0: Node 22 LTS (current Active LTS) - >=24.13.0: Node 24 LTS and future versions This excludes Node 23 (non-LTS "Current" release). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore: Include CHANGELOG.md in published package Add CHANGELOG.md to the files array so users can see the version history when they install the package. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: Add badges and simplify README introduction - Add npm version, license, and Node.js version badges - Rewrite opening paragraphs for clarity and conciseness Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * docs: Add attribution to esplint and react-compiler-marker Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 8013795 commit a41e003

4 files changed

Lines changed: 19 additions & 8 deletions

File tree

.github/workflows/publish.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
permissions:
77
contents: read
88
packages: write
9+
id-token: write
910

1011
jobs:
1112
publish:
@@ -38,3 +39,12 @@ jobs:
3839
run: npm publish
3940
env:
4041
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Prepare Node.js environment for npm registry
44+
uses: actions/setup-node@v6
45+
with:
46+
node-version-file: .node-version
47+
registry-url: https://registry.npmjs.org/
48+
49+
- name: Publish package to npm registry
50+
run: npm publish --access public --provenance

CHANGELOG.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ This file documents all notable changes, following the [Keep a Changelog](https:
2222
### Features
2323

2424
* Port React Compiler tracker from todoist-web ([#6](https://github.com/Doist/react-compiler-tracker/issues/6)) ([8e8ec3b](https://github.com/Doist/react-compiler-tracker/commit/8e8ec3be05a9738aca7215d98f9d2e83ef59378c))
25-
26-
## [Unreleased]
27-
28-
-

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# React Compiler Tracker
22

3-
While it's safe to opt out of using memoization hooks such as `useCallback` and `useMemo` in code optimized by the [React Compiler](https://react.dev/learn/react-compiler), it is easy to introduce violations that cause the compiler to bail out, leading to performance issues when values are not memoized.
3+
[![npm version](https://img.shields.io/npm/v/@doist/react-compiler-tracker)](https://www.npmjs.com/package/@doist/react-compiler-tracker)
4+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5+
[![Node.js](https://img.shields.io/node/v/@doist/react-compiler-tracker)](https://nodejs.org/)
46

5-
Designed to run as a part of Git hooks and CI, this tool helps prevent this and progressively adopt the React Compiler by tracking and warning against newly introduced compilation errors. It maintains a `.react-compiler-tracker.json` record file to track known compiler errors per file.
7+
The [React Compiler](https://react.dev/learn/react-compiler) automatically memoizes your components, eliminating the need for `useCallback` and `useMemo`. However, certain code patterns cause the compiler to bail out. When this happens, your components lose automatic optimization, potentially causing performance regressions.
8+
9+
Inspired by [esplint](https://github.com/hjylewis/esplint) and [react-compiler-marker](https://github.com/blazejkustra/react-compiler-marker), this tool tracks compiler errors in a `.react-compiler-tracker.json` file and integrates with Git hooks and CI to prevent new violations from being introduced.
610

711
## Prerequisites
812

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,13 @@
3535
},
3636
"homepage": "https://github.com/Doist/react-compiler-tracker#readme",
3737
"engines": {
38-
"node": ">=22"
38+
"node": "^22.22.0 || >=24.13.0"
3939
},
4040
"files": [
4141
"dist",
4242
"README.md",
43-
"LICENSE"
43+
"LICENSE",
44+
"CHANGELOG.md"
4445
],
4546
"lint-staged": {
4647
"*.{js,ts,mjs,mts,json,md}": "biome check --write --no-errors-on-unmatched"

0 commit comments

Comments
 (0)