27 lines
2.1 KiB
Markdown
27 lines
2.1 KiB
Markdown
# RFC: Discover package inventories instead of maintaining static lists
|
|
|
|
Status: proposed
|
|
|
|
## Problem
|
|
|
|
Package and gate inventories are repeated by hand. [scripts/publint-all.ts](../../../scripts/publint-all.ts) has a static list of publishable packages. The [package cookbook](../../cookbook/adding-a-package.md) tells authors to update several files. The [package README](../../../packages/README.md) carries a hand-written dependency graph. [CI](../../../.github/workflows/ci.yml) and [development docs](../../development.md) can drift from the actual `doc-sync` subcommands when new gates are added. These lists are small today, but every new package or gate creates another manual synchronization point.
|
|
|
|
Static lists are appropriate when they encode policy; they are needless friction when they duplicate manifest data that already exists in `package.json`, workspace globs, or package metadata.
|
|
|
|
## Proposal
|
|
|
|
Make package/gate inventories discoverable. Publishability should come from explicit package classification metadata, not from a static array in a script or the npm `private` flag. Module graph generation should read package manifests. `doc-sync` should be the one command that defines and prints its sub-gates, with docs linking to that command rather than restating a second list.
|
|
|
|
This pairs well with [classifying support packages](2026-06-20-classify-support-packages.md), because discovery needs to know which packages are product-publishable, support-only, private, or examples.
|
|
|
|
## Acceptance criteria
|
|
|
|
- `publint-all` discovers publishable packages from manifests plus a single classification source.
|
|
- Adding a package does not require editing a static package list for every gate.
|
|
- Docs describe the source of truth rather than repeating generated inventories.
|
|
- CI invokes the aggregate commands and lets those commands own their sub-gate lists.
|
|
|
|
## What we give up
|
|
|
|
Discovery scripts can become too clever. The implementation should stay boring: read manifests, filter on explicit fields, print the resolved list, and fail loud. The payoff is removing manual inventory drift, not inventing a build system.
|