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: Template dynamic public path #1023

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Conversation

jackw
Copy link
Collaborator

@jackw jackw commented Jul 23, 2024

What this PR does / why we need it:

It's become apparent that making the publicPath.ts a static file can result in developer issues due to either editing of the file or changing their plugin id which would require them to rerun the create-plugin update command so the correct fallback url public/plugins/{{pluginId}} is regenerated.

This PR offers a solution to this by making the publicPath.ts file an in-memory module that uses template literals to inject the plugin id at build time from the plugin.json file.

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@4.16.3-canary.1023.697917b.0
# or 
yarn add @grafana/create-plugin@4.16.3-canary.1023.697917b.0

@jackw jackw added create-plugin related to the create-plugin tool patch Increment the patch version when merged release Create a release when this pr is merged labels Jul 23, 2024
@jackw jackw self-assigned this Jul 23, 2024
@jackw jackw requested a review from a team as a code owner July 23, 2024 10:51
@jackw jackw requested review from oshirohugo, academo and leventebalogh and removed request for a team July 23, 2024 10:51
Copy link

github-actions bot commented Jul 23, 2024

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

✨ This PR can be merged and will trigger a new patch release.
NOTE: When merging a PR with the release label please avoid merging another PR. For further information see here.

Copy link
Member

@academo academo left a comment

Choose a reason for hiding this comment

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

This is a much better solution! nice :)

@jackw jackw merged commit 69fbd76 into main Jul 29, 2024
16 checks passed
@jackw jackw deleted the jackw/cp-template-publicpath branch July 29, 2024 07:50
@grafana-plugins-platform-bot
Copy link

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

@grafana-plugins-platform-bot grafana-plugins-platform-bot bot added the released This issue/pull request has been released. label Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-plugin related to the create-plugin tool patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants