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(publish): ignore unnecessary files when publishing to npm #3024

Merged

Conversation

erikian
Copy link
Member

@erikian erikian commented Oct 30, 2022

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

Currently, a large number of source/development files (.ts/.map/etc.) from most packages is being published to npm.

image

The plugin-webpack package is even publishing its entire test folder with a test app, including its node_modules:

image

This PR addresses the problem by writing a .npmignore file to each package folder before publishing, and then removing the file afterwards. .ts (except .d.ts type definitions), tsconfig.json, .map and .tsbuildinfo files, as well as any /test folders, are now ignored.

Since the .gitignore in the project root has .npmignore, I thought writing and then deleting the files would be an acceptable approach (not to mention easier to review), but actually adding the .npmignore files to Git would be trivial if necessary.

@VerteDinde VerteDinde self-requested a review October 30, 2022 21:25
@VerteDinde VerteDinde merged commit ab8ea66 into electron:main Oct 31, 2022
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.

None yet

2 participants