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

chore: update .npmignore to only publish relevant files #1377

Merged
merged 3 commits into from
Feb 6, 2024

Conversation

Florent-Bouisset
Copy link
Collaborator

When publishing the rx-player package to npm, a lots of files are published, such as src folder or even some configuration files like .eslintrc.js.
Publishing such files seems to be irrelevant: this files are not used by an application because when an application is importing the library with import RxPlayer from "rx-player", the files that are actually imported are listed in the property exports property of the package.json.

Publishing unneeded files increase the weight of the package installed on the machine of a developper through npm install. It's also impact the "Unpacked Size" on the npm page of the repo: https://www.npmjs.com/package/rx-player/v/4.0.0-rc.1?activeTab=code

It's currently 22MB large. Even if this metric doesn't express the real size of the bundle that an end user will have to download, application developers can have a wrong interpretation of this metric and may think that the RxPlayer library is
heavier than it really is, therefore it can eventually discourage them to use it because of it's weight.

The files that are required by an application using RxPlayer are built artefacts that reside in folder /dist.
Having a package.json is also required.
Other files are not necessary but provide useful informations and should be included in the package, this files are:

  • LICENSE
  • VERSION
  • CHANGELOG.md
  • README.md

This change means it's no longer possible to inspected source code with the code published to npm, it will not be possible either to run script such as test or lint on the installed package.
However, the source code can still be freely consulted on this repository, and we considered that it's our responsibility as maintainer to publish versions that are passing tests. Therefore applications should not have to test on their side that the library is passing tests.

@Florent-Bouisset Florent-Bouisset force-pushed the chore/remove-uneeded-files-in-package branch from 32a39a9 to b852d77 Compare February 6, 2024 10:29
.npmignore Outdated

/FILES.md
/CONTRIBUTING.md
/MAINTAINERS.md
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one makes sense I think when published

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean MAINTAINERS ? or the 3 files ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just MAINTAINERS.md

"require": "./experimental/inline-mpd-parser.commonjs.js",
"import": "./experimental/inline-mpd-parser.js",
"default": "./experimental/inline-mpd-parser.js"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:O you're right!

@peaBerberian peaBerberian changed the base branch from dev to stable February 6, 2024 10:56
@peaBerberian
Copy link
Collaborator

I changed the destination branch to go to stable, however there's now a lot of commit to remove

@Florent-Bouisset Florent-Bouisset changed the base branch from stable to dev February 6, 2024 10:57
@Florent-Bouisset Florent-Bouisset changed the base branch from dev to stable February 6, 2024 10:57
@Florent-Bouisset
Copy link
Collaborator Author

I changed the destination branch to go to stable, however there's now a lot of commit to remove

Ok will rebase, I thought I targeted stable as a mistake and therefore change it to dev again 😄

@Florent-Bouisset Florent-Bouisset force-pushed the chore/remove-uneeded-files-in-package branch from b852d77 to 7c783c0 Compare February 6, 2024 11:07
@peaBerberian peaBerberian merged commit 94e2070 into stable Feb 6, 2024
4 checks passed
@peaBerberian peaBerberian added this to the 4.0.0-rc.2 milestone Feb 6, 2024
@peaBerberian peaBerberian mentioned this pull request Feb 21, 2024
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