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

Manually rename gitignore to prevent yarn and npm pack from removing them #126

Merged
merged 1 commit into from
Oct 28, 2022

Conversation

academo
Copy link
Member

@academo academo commented Oct 28, 2022

What this PR does / why we need it:

It makes sure that generated plugins contain a .gitignore file.

Npm and yarn will not include .gitignore files when packing packages and this means the release version of create-plugin will not generate this file. The suggested fixes of creating a .npmignore and .yarnignore files to prevent this behaviour don't work.

This PR implements a simple exception to include the gitignore file without the dot prefix and rename it when the plugin is generated.

More details of this behaviour npm/npm#3763 (comment)

Which issue(s) this PR fixes:

Fixes # #116

Special notes for your reviewer:

If you want to test this PR you should first run yarn build and then yarn pack and inspect the packed file to reproduce the error (note the lack of .gitignore in the package).

@academo academo self-assigned this Oct 28, 2022
@academo academo added the bug label Oct 28, 2022
@academo academo added this to the v1.0.0 milestone Oct 28, 2022
Copy link
Collaborator

@jackw jackw left a comment

Choose a reason for hiding this comment

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

Awesome work! 🚀

@academo academo merged commit 894a597 into main Oct 28, 2022
@academo academo deleted the academo/fix-gitignore-not-generated branch October 28, 2022 08:54
@grafanabot
Copy link
Contributor

🚀 PR was released in @grafana/create-plugin@0.4.1, @grafana/sign-plugin@0.0.1 🚀

@grafanabot grafanabot added the released This issue/pull request has been released. label Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants