Skip to content

fix: publish all of lib with a files field instead of .npmignore - #61

Merged
Kinatzo merged 1 commit into
promaster-sdk:masterfrom
NebiyatS:fix-npm-package-files
Nov 6, 2026
Merged

Kinatzo merged 1 commit into
promaster-sdk:masterfrom
NebiyatS:fix-npm-package-files

Conversation

@NebiyatS

@NebiyatS NebiyatS commented Nov 5, 2026

Copy link
Copy Markdown

The npm packages @promaster-sdk/api-server@4.0.1 and 4.0.2 contain only 4 files:

package/LICENSE
package/README.md
package/lib/index.js
package/package.json

lib/index.js does export * from "./publish/index.js" (and client-rest, client-graphql, file-types), but those folders are not in the package. There are no .d.ts files either. Installing 4.0.1 or 4.0.2 therefore fails at runtime and in tsc, for example Cannot find module '@promaster-sdk/api-server/lib/publish/middleware'. latest currently points to 4.0.2. 4.0.0 is fine (143 files).

The git tags and the Docker image (dividab/promaster-public-api:v4.0.2) are not affected. The Dockerfile builds from source and copies the whole lib/, which is why the image works.

Cause

.npmignore is:

*
*/**
!lib/**/*
!package.json

With this file, pnpm pack / pnpm publish keeps only lib/index.js and drops every subfolder of lib/. npm pack handles the same file correctly, and so do pnpm 10 and 11.

Fix

  1. package.json gets "files": ["lib"], .npmignore is deleted, and the changelog has a line.
  2. Before every publish, check the tarball: pnpm pack && tar tzf *.tgz. It should list lib/publish/..., lib/server/... and the others.
  3. Release 4.0.3 from the fixed packaging, and npm deprecate 4.0.1 and 4.0.2 with a message pointing to 4.0.3.

@Kinatzo
Kinatzo merged commit bba2a62 into promaster-sdk:master Nov 6, 2026
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