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

Published Packages Contain unwanted files #531

Open
jaikanthjay46 opened this issue Apr 18, 2022 · 3 comments · May be fixed by #532
Open

Published Packages Contain unwanted files #531

jaikanthjay46 opened this issue Apr 18, 2022 · 3 comments · May be fixed by #532

Comments

@jaikanthjay46
Copy link

The published packages contain

  • yarn.lock
  • README.md.bak

Which is not ideal. They increase the size of the package and don't add any value

@jaikanthjay46 jaikanthjay46 linked a pull request Apr 18, 2022 that will close this issue
@gbvanrenswoude
Copy link

The presence of the yarn.lock file also makes several Container Scanning tools go off.

@jaikanthjay46
Copy link
Author

Yes. That is one more reason

@tukusejssirs
Copy link

I also noticed README.md.bak, but I don’t have yarn.lock. Maybe because I don’t use yarn. 🤷‍♂️

I have found the reason why README.md.bak is there: in package.json (L27-30), there are the following scripts:

"update-readme": "sed -i.bak 's/\\/master\\.svg/\\/v'$(npm --silent run get-version)'.svg/g' README.md",
"restore-readme": "mv README.md.bak README.md",
"prepublish": "in-publish && npm run update-readme || not-in-publish",
"postpublish": "npm run restore-readme"

Basically, when someone runs npm run publish, it backs up README.md (actually, there is no such file, as the file is name Readme.md; maybe the maintainer runs this on MS Windows) and updates the SVG path. After publishing, for some reason it restores the original (backed up) README.md.

So, all we need to do to fix this issue is:

  1. either rename Readme.md to README.md or update update-readme and restore-readme scripts to use Readme.md and Readme.md.bak filenames;
  2. add files array to package.json:
{
  ...
  files: [
    "index.d.ts",
    "lib",
    "Licence",
    "package.json",
    "Readme.md"  // Or `README.md`
  ]
  ...
}

If @niftylettuce (or any other maintainer) is okay with this, I can create a PR. 😉

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 a pull request may close this issue.

3 participants