Skip to content
New issue

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

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

Already on GitHub? # to your account

update package.json with files array #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hilleer
Copy link

@hilleer hilleer commented Jul 25, 2024

Use files property in package.json to explicit show what files are included (in contradiction to .npmignore where you specifically exclude "some" files).

This way one avoids accidentally publishing non-compiled code like src/ folder etc:

Screenshot 2024-07-25 at 09 03 00

Note that a bunch of files are always considered when publishing and does not have to be listed in the list accordingly to the docs:

Screenshot 2024-07-25 at 09 01 49

exclude publishing files like src/ etc
@swarthy
Copy link
Owner

swarthy commented Oct 12, 2024

Hi! The src folder is included in the package intentionally, because it is convenient for debugging errors occurring inside the library. Why it is necessary to remove it?

@hilleer
Copy link
Author

hilleer commented Oct 14, 2024

Hi! The src folder is included in the package intentionally, because it is convenient for debugging errors occurring inside the library. Why it is necessary to remove it?

You can close it if that is the intention 👍 I thought it was a mistake and potential gain for reducing the size of the published library slightly. Is there any use of the source code for users of the library?

@CatchMe2
Copy link

Hi, I'm facing some TypeScript issues due to the included src folder. I have an ESM package with verbatimModuleSyntax option enabled in tsconfig.json. Type-check is reporting:

node_modules/redis-semaphore/src/errors/LostLockError.ts:1:1 - error TS1287: A top-level 'export' modifier cannot be used on value declarations in a CommonJS module when 'verbatimModuleSyntax' is enabled.

1 export default class LostLockError extends Error {}
  ~~~~~~

Removing src folder from node_modules resolves the issue. How about excluding src from the package?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants