Skip to content

build(packages): ship SPEC.md and sources in the published tarball - #36

Merged
ivanbanov merged 1 commit into
mainfrom
missing-specs
Aug 12, 2026
Merged

build(packages): ship SPEC.md and sources in the published tarball#36
ivanbanov merged 1 commit into
mainfrom
missing-specs

Conversation

@ivanbanov

Copy link
Copy Markdown
Member

Why/What

A published package carried dist and README.md only. The two things you
actually want when a behavior surprises you — the SPEC.md that defines the
contract and the code that implements it — were reachable only by finding the
repo and guessing which tag matches the version you installed. Both now sit in
node_modules/<pkg>/, pinned to the exact version resolved.

Resolution is untouched: publishConfig still points main, types, and
exports at dist, so the sources are inert payload — read them, don't import
them.

Changes

  • files: ["dist", "src", "SPEC.md"] across all 10 publishable packages.
  • Same in both scaffold templates, so pnpm scaffold stamps it into new
    primitives.
  • A note in ARCHITECTURE.md recording what a tarball carries and why.
  • Changeset: patch across the 10.

Verified with pnpm pack on a package with a spec and one without (npm skips a
missing files entry, so the entry is already in place for the specs landing on
docs/util-package-specs):

package/dist/index.{js,d.ts}   package/src/*.ts
package/SPEC.md                package/README.md
package/LICENSE                package/package.json   <- pnpm copies in the root LICENSE

The packed package.json still resolves to ./dist/…. pnpm build (publint
clean), 137 tests, lint, typecheck, and format all pass.

Issues

🤖 Generated with Claude Code

The tarball carried dist and README.md only, so the two things you want when
a behavior surprises you — the spec that defines the contract and the code
that implements it — were reachable only by finding the repo and guessing
which tag matches the installed version.

Add src and SPEC.md to files across every publishable package and both
scaffold templates, so new primitives inherit it. Resolution is untouched:
publishConfig still points main, types, and exports at dist, and the sources
are inert payload.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ivanbanov
ivanbanov merged commit 359f9ac into main Aug 12, 2026
6 checks passed
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.

1 participant