Kibana 7.4.2 Plugin Development. Using external project with shared code

Hi. I am developing a plugin for kibana with react and typescript. I also have a separate node js backend that the plugin's backend communicates with.
These plugins and the backend have a common code, which I put in a separate project.
How can I make plugin-helpers pull a project with shared code as a dependency when building a plugin?
I was thinking of a private npm repository. But I don't think this is the right decision for me.

Upd. I'm also thinking about using webpack before building the plugin

A private npm repository doesn't sound like the worst approach, it depends a lot of your specific project - how many people are working on it? How are the individual artifacts deployed? Is there a CI and if yes how does it work? ....

A lightweight solution that comes to mind is to use git urls directly as dependency: https://docs.npmjs.com/cli/install

Thanks for reply.
I just added my external project with shared code as git submodule to the root of plugin. Also i edited .kibana-plugin-helpers.json to this:

{
  "styleSheetToCompile": "public/app.scss",
  "buildSourcePatterns": [
    "yarn.lock",
    "tsconfig.json",
    "package.json",
    "index.{js,ts}",
    "server/**/*",
    "public/**/*",
    "MY_SHARED_PROJECT/src/**/*"
  ]
}

But using a npm private repository would be a better solution

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.