Skip to content

chore: add npm overrides to create-plugin templates#2662

Open
Ukochka wants to merge 5 commits into
mainfrom
chore/bump-template-deps
Open

chore: add npm overrides to create-plugin templates#2662
Ukochka wants to merge 5 commits into
mainfrom
chore/bump-template-deps

Conversation

@Ukochka
Copy link
Copy Markdown
Contributor

@Ukochka Ukochka commented May 27, 2026

Added npm overrides to fix transitive dependency vulnerabilities.
This affects grafana-plugin-examples, which is generated from this template.

Fixes https://github.com/grafana/grafana-catalog-team/issues/921

@Ukochka Ukochka self-assigned this May 27, 2026
Copilot AI review requested due to automatic review settings May 27, 2026 13:25
@Ukochka Ukochka requested a review from a team as a code owner May 27, 2026 13:25
@Ukochka Ukochka added the chore Other changes that don't modify src or test files label May 27, 2026
@Ukochka Ukochka requested review from eledobleefe and joshhunt and removed request for a team May 27, 2026 13:25
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

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

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the @grafana/create-plugin templates to mitigate known transitive dependency vulnerabilities in generated plugins, and refreshes Go template module settings.

Changes:

  • Adds an overrides block to the common template package.json to pin vulnerable transitive dependencies.
  • Updates backend template Go version directive and bumps several golang.org/x/* indirect dependencies in go.mod templates.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
packages/create-plugin/templates/common/_package.json Adds npm overrides to pin vulnerable transitive dependencies in generated frontend projects.
packages/create-plugin/templates/backend/go.mod Updates Go toolchain/version directive and bumps several indirect golang.org/x/* module versions.
packages/create-plugin/templates/backend-app/go.mod Same as backend/go.mod for the backend-app template.

Comment thread packages/create-plugin/templates/common/_package.json
Comment thread packages/create-plugin/templates/backend/go.mod Outdated
Comment thread packages/create-plugin/templates/backend-app/go.mod Outdated
@tolzhabayev tolzhabayev moved this from 📬 Triage to 🔬 In review in Grafana Catalog Team May 28, 2026
@Ukochka Ukochka added javascript Pull requests that update Javascript code no-changelog Don't include in changelog and version calculations labels May 28, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment thread packages/create-plugin/templates/backend-app/go.mod Outdated
Comment thread packages/create-plugin/templates/backend/go.mod Outdated
Comment thread packages/create-plugin/templates/backend/go.mod Outdated
Comment thread packages/create-plugin/templates/backend-app/go.mod Outdated
Comment on lines +88 to +98
"overrides": {
"immutable": "5.1.5",
"serialize-javascript": "7.0.5",
"js-cookie": "3.0.7",
"dompurify": "3.4.6",
"fast-uri": "3.1.2",
"@protobufjs/utf8": "1.1.1",
"qs": "6.15.2",
"@grafana/ui": {
"uuid": "11.1.1"
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not convinced we should be doing this.

These overrides will update the versions of these dependencies across the dependency graph which could cause bugs which are hard to track down in the packages that depend on them.

The overrides property is NPM only. Yarn relies on resolutions whilst PNPM relies on overrides in its pnpm-workspace.yaml file. I think this will create a maintenance burden on us keeping all these in sync.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Could you suggest another way of moving plugin-examples to SLO? These overrides will work on plugin-examples, because we use npm there, in other cases it will be just ignored, or am I mistaken?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I would try to fix them at the source so any current consumers also benefit. I imagine most of these are due to our grafana packages pinning dependencies.

@Ukochka Ukochka requested a review from jackw May 29, 2026 07:22
@jackw jackw changed the title Add npm overrides to create-plugin templates chore: add npm overrides to create-plugin templates May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Other changes that don't modify src or test files javascript Pull requests that update Javascript code no-changelog Don't include in changelog and version calculations

Projects

Status: 🔬 In review

Development

Successfully merging this pull request may close these issues.

5 participants