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
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ Changesets can be published with:
npm run release:changesets
```

The GitHub release workflow publishes with npm provenance enabled. The local
`npm run publish:package` command does not force provenance, because npm only
supports automatic provenance generation in supported CI providers.

## Packaging Notes

- The package publishes built files from `dist/`.
Expand Down
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@
<img src="public/img/typescript-type-guard-logo.png" alt="typescript-type-guards logo" />
</p>

<p align="center">
<a href="https://www.npmjs.com/package/@coderrob/typescript-type-guards">
<img src="https://img.shields.io/npm/v/%40coderrob%2Ftypescript-type-guards?logo=npm&logoColor=white" alt="npm version" />
</a>
<a href="https://www.npmjs.com/package/@coderrob/typescript-type-guards">
<img src="https://img.shields.io/npm/dm/%40coderrob%2Ftypescript-type-guards?logo=npm&logoColor=white" alt="npm downloads" />
</a>
<a href="https://github.com/Coderrob/typescript-type-guards/actions/workflows/ci.yml">
<img src="https://img.shields.io/github/actions/workflow/status/Coderrob/typescript-type-guards/ci.yml?branch=main&label=ci" alt="CI status" />
</a>
<img src="https://img.shields.io/badge/coverage-100%25-brightgreen" alt="Coverage 100%" />
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The coverage badge is hard-coded to "100%", but the repo enforces a 95% per-file threshold (see scripts/check-file-coverage.mjs). A static value is likely to become inaccurate; consider switching to a dynamically generated coverage badge (e.g., from a coverage reporting service) or removing the percentage if it isn't sourced from CI output.

Suggested change
<img src="https://img.shields.io/badge/coverage-100%25-brightgreen" alt="Coverage 100%" />
<img src="https://img.shields.io/badge/coverage-documented-lightgrey" alt="Coverage" />

Copilot uses AI. Check for mistakes.
<a href="LICENSE">
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The license badge links to a relative "LICENSE" path. This works on GitHub, but it typically resolves to a non-existent URL when the README is rendered on npm. Consider linking to the canonical GitHub URL for the license file (or the npm package metadata license page) so the badge is reliable outside GitHub.

Suggested change
<a href="LICENSE">
<a href="https://github.com/Coderrob/typescript-type-guards/blob/main/LICENSE">

Copilot uses AI. Check for mistakes.
<img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="Apache 2.0 license" />
</a>
<img src="https://img.shields.io/badge/node-20%20%7C%2022%20%7C%2024-339933?logo=node.js&logoColor=white" alt="Node.js 20, 22, and 24" />
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Node.js support badge lists 20/22/24, but the CI workflow currently only tests Node 20 and 22 (.github/workflows/ci.yml matrix). Either add Node 24 to the CI matrix or adjust the badge to match what is actually exercised in CI to avoid misleading consumers.

Suggested change
<img src="https://img.shields.io/badge/node-20%20%7C%2022%20%7C%2024-339933?logo=node.js&logoColor=white" alt="Node.js 20, 22, and 24" />
<img src="https://img.shields.io/badge/node-20%20%7C%2022-339933?logo=node.js&logoColor=white" alt="Node.js 20 and 22" />

Copilot uses AI. Check for mistakes.
</p>

Reusable TypeScript type guards for narrowing `unknown` values in application and library code.

## Installation
Expand Down Expand Up @@ -157,6 +174,6 @@ npm run test:coverage

- `npm run changeset` creates a release note entry for a package change.
- `npm run release:version` applies pending changesets and updates the changelog.
- `npm run release:changesets` runs the full verification stack, coverage, and then publishes through Changesets.
- `npm run release:changesets` runs the full verification stack, coverage, and then publishes through Changesets. In GitHub Actions, this release path also publishes with provenance.
- `npm run publish:package` performs a direct npm publish with a dry-run pack check first.
- `.github/workflows/release.yml` is a manual `workflow_dispatch` workflow for optional release publishing.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"package:quality": "npm run check:publint && npm run check:types:package",
"prepack": "npm run clean && npm run build && npm run test:package && npm run typecheck",
"prepublishOnly": "npm run verify && npm run test:coverage",
"publish:package": "npm pack --dry-run && npm publish --access public --provenance",
"publish:package": "npm pack --dry-run && npm publish --access public",
"release:changesets": "npm run verify && npm run test:coverage && changeset publish",
"release:version": "changeset version",
"test": "vitest run --root . src/__tests__/runtime.test.ts --pool=threads --fileParallelism=false",
Expand Down