Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm pack includes the file listed in the main key even when publishConfig.main overrides that file and it is not included in files #7518

Closed
2 of 4 tasks
kael-shipman opened this issue Jan 12, 2024 · 3 comments

Comments

@kael-shipman
Copy link

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

8.14.1

Which area(s) of pnpm are affected? (leave empty if unsure)

CLI

Link to the code that reproduces this issue or a replay of the bug

https://github.com/wymp/ts-simple-interfaces/tree/v0.7.2

Reproduction steps

  1. Check out the above commit
  2. Run pnpm i && cd libs/ts-simple-db-mysql/ && pnpm pack --pack-destination /tmp
  3. Run cd /tmp && tar -xf wymp-* && cd package && ls
  4. Note that src/index.ts is present. Note that package.json does NOT list src under the files key, and the main key is now properly replaced with the correct dist/index.js.
  5. To confirm that it is indeed the main key causing the problem, go back into ts-simple-db-mysql and change the main key in package.json to read dist/index.js, then perform steps 2 and 3 again. Note there is no longer a src/index.ts file in the pack.

Describe the Bug

When you list a file in the main key of package.json which you then replace during publish using publishConfig.main, the file that's listed in the original main key is included in the package, even though it's not supposed to be.

Expected Behavior

The src/index.ts file should not be included in the package.

Which Node.js version are you using?

20.11.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

Ubuntu 22.04.3 LTS

@await-ovo
Copy link
Member

Looks duplicated with #4195, and i think it should be fixed ~

@kael-shipman
Copy link
Author

Ah! Indeed, thanks for the reference. Closing this one. (Although I don't see any indication that the issue is fixed, but that can be discussed over there.)

@kael-shipman kael-shipman closed this as not planned Won't fix, can't repro, duplicate, stale Jan 17, 2024
@await-ovo
Copy link
Member

Sorry, I double-checked and it hasn't been fixed yet, I'll send a PR later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants