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

[package] Remove test files when published #785

Merged
merged 1 commit into from
Feb 20, 2023

Conversation

Drarig29
Copy link
Contributor

What and why?

I noticed we were not excluding the test files when creating the .tgz file to publish on NPM. So they end up in the node_modules when datadog-ci is installed somewhere.

You can explore the files here.

How?

Sadly, Yarn 1 (that we're using in this project) doesn't fully support .npmignore or blocklist rules in the files property of package.json.

So I had to use rimraf in the prepack script.

  • Before:
    • yarn prepack && du -sh dist: 3.2 MB
  • After:
    • yarn prepack && du -sh dist: 1.8 MB

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

@Drarig29 Drarig29 requested a review from a team as a code owner February 17, 2023 17:18
Copy link
Contributor

@lefebvree lefebvree left a comment

Choose a reason for hiding this comment

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

Nice find!

@Drarig29 Drarig29 merged commit 95b9924 into master Feb 20, 2023
@Drarig29 Drarig29 deleted the corentin.girard/remove-test-files-in-tgz branch February 20, 2023 12:38
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