grafana/plugin-tools

Feat: Ask user to optionally include testing frameworks in `npx @grafana/create-plugin`

6nv opened this issue · 3 comments

6nv commented

Which areas does this feature request relate to

  • Create Plugin
  • Sign Plugin
  • Plugin E2E
  • Documentation

Problem

The starter plugin's dependency list is extremely heavy and takes several minutes to install. Most of the dependencies end up becoming dead weight each time I run an npm install anyway. I'm curious, as a percentage of community-built plugins, how many are actually using more than half of the frameworks included.

Solution

I'd love to see an option during the initial walk through process of npx @grafana/create-plugin to start with a "bare minimum" plugin without all these extra frameworks. It should include (this might not be an exhaustive list):

  • Grafana sdk
  • React
  • Typescript
  • Webpack

Alternatives

No response

Additional context

Screenshot 2024-02-16 at 9 05 40 AM

Example of initial walk-through process

Are you interested in contributing the solution?

  • Yes
  • No
  • I'd like to, but I don't have the time or experience

Hi @6nv - I appreciate the issues you encountered leading towards a desire for more of a minimal scaffolded plugin.

However, our intent with create-plugin is to provide everything we'd recommended for best practice plugin development out-of-the-box, including the test libraries.

Additionally, we already have more prompts than we feel is ideal, and as such are reluctant to introduce any more unless there is a very strong case to do so.

If folks want to remove these dependencies, they can of course do so. If there is more we could do to outline what we put on disk and why, or even guidance on removal - that would be our preferred route for now.

6nv commented

Thanks for your reply!

If there is more we could do to outline what we put on disk and why, or even guidance on removal - that would be our preferred route for now.

This seems like a good route forward. I would like to know what's required at minimum for a plugin to build and execute. This would hopefully allow me to shorten the duration of an npm install and reduce the overall file size during development.

Np - rather than repurpose this issue, I'll close and create a new one to explore how we can do this (i'd like to keep this issue as it stands as a record of the decision)