Skip to content

Comments

fix(publish): ignore unnecessary files when publishing to npm#3024

Merged
VerteDinde merged 1 commit intoelectron:mainfrom
erikian:fix/ignore-unnecessary-files-npm-publish
Oct 31, 2022
Merged

fix(publish): ignore unnecessary files when publishing to npm#3024
VerteDinde merged 1 commit intoelectron:mainfrom
erikian:fix/ignore-unnecessary-files-npm-publish

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.

2 participants