Skip to content

feat(inspector): track trusted publisher and staged publish as supply chain signals - #208

Merged
antfu merged 2 commits into
antfu:mainfrom
sxzz:feat/supply-chain-signals
Sep 16, 2026
Merged

antfu merged 2 commits into
antfu:mainfrom
sxzz:feat/supply-chain-signals

Conversation

@sxzz

@sxzz sxzz commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

NpmMeta.provenance was a 'trustedPublisher' | boolean union, which could only ever express one signal at a time. npm now exposes three independent ones, so this splits them apart and surfaces them together as a supply chain score — how many of provenance / trustedPublisher / staged a package carries.

Changes

  • Types: provenance?: boolean + new trustedPublisher?: boolean and staged?: boolean, populated from fast-npm-meta.
  • Badge (ProvenanceBadge.vue → SupplyChainBadge.vue): colored by score — 3 a green seal, 2 teal, 1 blue, 0 an amber warning. The tooltip spells out which signals are present, e.g. This package is signed with provenance by a trusted publisher (staged publish). The show/hide setting now keys off the score, so the "Absent" mode no longer shows a green check on a package that has a signal but no provenance.
  • Grid: the Provenance tab becomes Supply Chain (/grid/supply-chain), grouped by score — All 3 Signals / 2 of 3 Signals / 1 of 3 Signals / No Signals, each with a tooltip naming the three signals. Old /grid/provenance links fall back to the Depth grouping.
  • Dependency composition bar (PercentageProvenance.vue → PercentageSupplyChain.vue): SIGNED/UNSIGNED becomes the same four buckets (3/3 … 0/3).
  • Scoring and the signal names live in one place, app/utils/supply-chain.ts, shared by all three.
  • Dropped a stray :provenance attribute on DisplayPackageName, which has no such prop.

Note

The showProvenanceBadge setting is renamed to showSupplyChainBadge. A value stored under the old key is ignored and the setting falls back to its default (present); no migration is included.

Verification

pnpm test (134 passed), pnpm lint and pnpm typecheck clean.

… chain signals

`NpmMeta.provenance` used to be a `'trustedPublisher' | boolean` union. Split it
into three independent booleans (`provenance`, `trustedPublisher`, `staged`) and
surface them everywhere as one "supply chain score" — how many of the three a
package carries.

- badge: 3 signals is a green seal, 2 teal, 1 blue, 0 an amber warning; the
  tooltip spells out which ones are present
- grid: the Provenance tab becomes Supply Chain, grouped by score
  (All 3 Signals / 2 of 3 / 1 of 3 / No Signals)
- dependency composition bar: SIGNED/UNSIGNED becomes the same four buckets
- `showProvenanceBadge` setting is renamed to `showSupplyChainBadge`; a stored
  value for the old key is ignored and falls back to the default
@sxzz
sxzz force-pushed the feat/supply-chain-signals branch from 4c34b28 to 1754700 Compare September 16, 2026 06:31
@pkg-pr-new

pkg-pr-new Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/node-modules-inspector@208
npm i https://pkg.pr.new/node-modules-tools@208

commit: 08f9f79

@antfu
antfu merged commit 052a1b0 into antfu:main Sep 16, 2026
11 checks passed
@sxzz
sxzz deleted the feat/supply-chain-signals branch September 16, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants