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

plugin-management: make a library? #2197

Open
7 tasks
illume opened this issue Jul 25, 2024 · 2 comments
Open
7 tasks

plugin-management: make a library? #2197

illume opened this issue Jul 25, 2024 · 2 comments
Labels
app frontend Issues related to the frontend headlamp-plugin Related to the headlamp-plugin NPM package.

Comments

@illume
Copy link
Collaborator

illume commented Jul 25, 2024

The plugin-management code is used by the app and headlamp-plugin. However, the previous solution for code sharing didn't work.

So plugin-management was copied into the app/. Temporarily. It was also converted to typescript.

I suggest it is turned into a new package @headlamp-k8s/plugin-management, which can be used by headlamp-plugin and the app/. Probably it should stay in ts.

Acceptance criteria

  • PluginManager.list fails if there is no plugins folder headlamp-k8s/plugins@72af907
  • PluginManager.list todo headlamp-k8s/plugins@64ad979
  • there is a @headlamp-k8s/plugin-management library released that can be used by app/ and headlamp-plugin
  • there is documentation on how to make changes to it in development (using npm link or npm pack or whatever)
  • there are docs on how to publish it
  • installing/removing plugins works in the app
  • tests pass (unit tests, and also headlamp-plugin e2e tests)

@yolossn For after the release... What do you think of this proposal?

@illume illume added frontend Issues related to the frontend app headlamp-plugin Related to the headlamp-plugin NPM package. labels Jul 25, 2024
@yolossn
Copy link
Contributor

yolossn commented Jul 25, 2024

Yes, it makes sense to create a new package to avoid code duplication.

@illume illume changed the title rfc: plugin-management: make a library? plugin-management: make a library? Jul 25, 2024
@sniok
Copy link
Contributor

sniok commented Jul 25, 2024

This is definitely a good idea.

Probably a little out of the scope of this issue but we have a lot of inter-component dependencies, sometimes we copy, sometimes we use "../". I think we should take an even bigger step and use monorepo tools and separate all reusable parts into packages. This would make our life a lot easier.

Some other cases I can think of:

  • headlamp-plugin uses code from frontend, we can extract it into "@headlamp-k8s/headlamp-common" that will have common components and lib
  • app uses frontend
  • example-plugins use headlamp-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app frontend Issues related to the frontend headlamp-plugin Related to the headlamp-plugin NPM package.
Projects
None yet
Development

No branches or pull requests

3 participants