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

fix: exclude unused files from publish process #1141

Closed
wants to merge 3 commits into from
Closed

fix: exclude unused files from publish process #1141

wants to merge 3 commits into from

Conversation

falsepopsky
Copy link

@falsepopsky falsepopsky commented Aug 6, 2023

Issue

This pull request addresses the issue of including unused files in the publish process.
ex: tsconfig.json and tsconfig-prod.json

Solution

With this pull request, when adding the src and docs folders to the files section in package.json, the build process will automatically exclude other unused files. Note that readme and license files are always included (for documentation purposes please refer to this link).

Before

filesbefore

After

  1. run npm pack
  2. To visually identify which files are packaged, you have two options:
    • Check the log for added files.
    • Extract the tarball to see the files.

after

Additional Comments:

  • I had to add the suffix /dist to imports requiring @typescript-eslint/types because it was being inferred as any, leading to lint errors.

@Fdawgs
Copy link
Contributor

Fdawgs commented Aug 10, 2023

Could save a few more bytes by using an .npmignore file instead, as package.json (and in turn the files key and its contents) are published.

brettz9 added a commit to brettz9/eslint-plugin-jsdoc that referenced this pull request Aug 16, 2023
brettz9 added a commit that referenced this pull request Aug 16, 2023
@brettz9
Copy link
Collaborator

brettz9 commented Aug 16, 2023

Thanks for the PR. I submitted another one which makes some fixes to tsconfig. However, that raises another question. While #1130 is seeking for the bundling of types, I'm not sure we want to add to the package size to do so, especially since an ESLint config file may have a different import approach then the rest of the package containing it.

I'm also wondering whether we should exclude /docs.

@falsepopsky falsepopsky deleted the fix/build-files branch August 16, 2023 22:47
@github-actions
Copy link

🎉 This issue has been resolved in version 46.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants