Repository navigation
v2.1.0
Parity with the tooling used by the most-starred TypeScript library monorepos, plus a security fix for the release workflow.
Security
- The release workflow could run code from a fork with write access (#11). It triggered on
workflow_runfor CI runs on a branch namedmain. GitHub matches that name against the branch the run came from, so a fork's PR from its ownmainbranch qualified. Templates v1.1.0 through v2.0.0 then checked out the fork's commit and ran its install scripts in jobs holding write tokens, and in the publish job, npm publishing credentials. Release now runs only as the last job of CI, on pushes tomain. v1.0.0 also fired for fork PRs, but it checked outmain, so it never ran fork code.
Added
- Published packages support Node.js 24 and later (#9). The tests run on Node 24 and 26, on Linux, macOS and Windows. Development stays on the pinned Node 26.12.1.
- Preview packages for every PR (#14). pkg.pr.new publishes each package per commit and comments the install commands. It's off until the
PKG_PR_NEWrepository variable is set, and fork PRs never run it. - Workflow security audit (#12). zizmor checks every workflow on every PR and fails on any finding.
- Unused code checks (#13). knip fails on unused files, exports and dependencies, and on undeclared dependencies.
- Repository health files (#10): issue forms, a PR template,
SECURITY.md(private vulnerability reporting) and.editorconfig.
Changed
- npm publishing is gated by the
NPM_PUBLISHrepository variable. Packages are no longer marked"private": true, because previews skip private packages. - The npm trusted publisher names
ci.yml, notrelease.yml: npm checks the calling workflow. - CI on a PR cancels the PR's older run when a new push arrives.
Changes for existing projects
- Security (projects from v1.0.0 to v2.0.0): in
release.yml, replace theworkflow_runtrigger withworkflow_call:and remove theref: ${{ github.event.workflow_run.head_sha ... }}lines. Gateselect-modeongithub.ref == 'refs/heads/main'. Inci.yml, add thereleasejob:needson every other job,if: github.event_name == 'push' && github.ref == 'refs/heads/main', the three write permissions, anduses: ./.github/workflows/release.yml. If you have a trusted publisher on npmjs.com, change its workflow file toci.yml. - If you publish to npm today, set the repository variable
NPM_PUBLISHtotruewhen you take step 1'srelease.yml. The pack job now requires it, and without it releases stop. - Node 24 support:
- Set
engines.nodeto>=24in Node packages. - In the root
tsconfig.json, extend@tsconfig/node24. - Use
@types/node24.x in packages, and add the two Renovate@types/noderules. - Replace
rm -rf distandchmod +xwith thenode -eforms. - Add the
compatjob.
- Set
- zizmor: add the
workflowsjob withZIZMOR_VERSION, andcustomManagers:githubActionsVersionsto the Renovateextends. Makereleaseneedworkflows. - knip: add
knip6.43.0, thecheck:unusedscript, the CI step andknip.json. Then fix what it reports, or add entries for false positives. - Previews (optional): install the pkg.pr.new GitHub App and set
PKG_PR_NEWtotrue. Addpkg-pr-new0.0.91 and thepreviewjob. Keep"private": trueonly on packages that must never be previewed or published. Leave previews off in private repositories, because previews are public. - Health files: copy
.github/ISSUE_TEMPLATE/,.github/PULL_REQUEST_TEMPLATE.md,SECURITY.mdand.editorconfig. Then turn on Settings → Advanced Security → Private vulnerability reporting, and set the reply time inSECURITY.md.