Skip to content

chore: add .npmignore so lib is published - #175

Merged
Tony133 merged 1 commit into
mainfrom
chore/add-npmignore
Dec 2, 2026
Merged

Tony133 merged 1 commit into
mainfrom
chore/add-npmignore

Conversation

@Tony133

@Tony133 Tony133 commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Proposal:

The files field was removed from package.json in 2602024 so that the whole repository is published to npm. Without files and without a .npmignore, npm falls back to .gitignore, which lists lib: the next release would ship without the build output and the package would not load (main points to ./lib).

What:

Adds a .npmignore, following the approach used by Eomm in fastify/fastify-type-provider-zod#34. It is a copy of .gitignore without the lib entry, so the build output is published.

package.json is not changed.

The same approach was released as @fastify/type-provider-zod@1.0.4, which contains the full repository plus dist.

How to verify:

npm install --ignore-scripts
npm run release:build
npm pack --dry-run

The file list must include lib/ together with the rest of the repository files (19 files in total). .gitignore, .npmignore and .npmrc are not published: npm excludes them by default.

@Tony133
Tony133 force-pushed the chore/add-npmignore branch from e2b57a3 to d4621eb Compare December 1, 2026 18:45
@Tony133
Tony133 merged commit 3a01505 into main Dec 2, 2026
22 checks passed
@Tony133
Tony133 deleted the chore/add-npmignore branch December 2, 2026 10:22
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