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

Create Plugin: Clean up unused publicPath.ts when updating #1035

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

jackw
Copy link
Collaborator

@jackw jackw commented Aug 5, 2024

What this PR does / why we need it:
This PR adds the ability to remove files from a plugin during update. In this PR we use it to delete the publicPath.ts file that is no longer used by webpack to build plugins.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

📦 Published PR as canary version: Canary Versions

✨ Test out this PR locally via:

npm install @grafana/create-plugin@5.0.1-canary.1035.a9f09cb.0
# or 
yarn add @grafana/create-plugin@5.0.1-canary.1035.a9f09cb.0

@jackw jackw added patch Increment the patch version when merged release Create a release when this pr is merged labels Aug 5, 2024
@jackw jackw self-assigned this Aug 5, 2024
@jackw jackw requested a review from a team as a code owner August 5, 2024 07:57
@jackw jackw requested review from leventebalogh and removed request for a team August 5, 2024 07:57
Copy link

github-actions bot commented Aug 5, 2024

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged but will not trigger a new release. To trigger a new release add the release label before merging.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

@@ -86,6 +86,8 @@ export const MIGRATION_CONFIG = {
export const UDPATE_CONFIG = {
// Files that should be overriden between configuration version updates.
filesToOverride: ['.config/', '.cprc.json'],
// Files that are no longer needed for the project and can be removed.
filesToRemove: ['./config/webpack/publicPath.ts'],
Copy link
Collaborator

Choose a reason for hiding this comment

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

As a conversation starter: shouldn't we compare what's not existing amongst the new template files for the .config/ folder and what's present in the CWD, and delete the difference instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I did consider trashing the .config directory and recreating it from the templates (which I believe would have the same outcome as you're suggesting). For now felt it was easier to reuse what we have from the migrate script.

@jackw jackw removed the release Create a release when this pr is merged label Aug 6, 2024
@jackw jackw merged commit 55818ed into main Aug 6, 2024
14 checks passed
@jackw jackw deleted the jackw/cleanup-publicpath branch August 6, 2024 07:22
@grafana-plugins-platform-bot
Copy link

🚀 PR was released in @grafana/create-plugin@5.1.0 🚀

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot added the released This issue/pull request has been released. label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged released This issue/pull request has been released.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants