UIBuilder, install default packages when creating a node-red projects

Hello,

I'm currently upgrading UIBuilder on my project from version 3 to 6.

There is a breaking change in version 5.0 that remove the files packageList.json and masterPackageList.json.
It was pretty useful because when creating a project, a list of default npm module was installed in the project.

To explain how I use it. When building the docker image, I also install a list of module. So when the creating a new node-red project those package where available by default.

Is there a way to keep this behavior with UIBuilder 6.0 ?

Thanks in advance

Hi Elronde, thanks for raising this and sorry for causing you an issue.

The packageList was actually integrated into UIBUILDER's package.json. I appreciate though that this might not have quite the same features.

So if you are including UIBUILDER in a Docker image, you can simply add your required modules to UIBUILDER's package.json file. However, if you do that without pre-installing the modules into the Docker image, you would need to run an npm install script from the uibRoot folder at some point before running.

Thank for your answer. I do have the module installed when node-red isn't in project mode. But when creating a project. The uibuilder package.json (which contains the modules) isn't copied inside the /<project_name>/uibuilder/package.json

Do I miss something ?

Ah, I don't use projects, had a few too many issues with them. I guess uibuilder creates a new blank package.json for a new project?

Perhaps I need to re-introduce a method that would force a set of modules into the package.json when it is created? Nobody has commented on this previously I'm afraid. But I am certainly open to suggestions and there is a bit of time before v7 gets released so I expect something could be squeezed in. :slight_smile:

Yes, it creates a blank package.json.

Reintroducing this mechanism would be really great and practical. Every project could have a default set of modules.

If you agree to introduce it for 7.0 that would be really great :slight_smile:

Your wish is my command. :slight_smile:

Added to the to-do list for v7

Initial thinking is that there will be a new but optional file in the <uibRoot>/.config/ folder, called something like projectPackage.json. It would be, I think a sub-set of a standard package.json A full package.json on 2nd thoughts so that it would be easy to copy/paste your current <uibRoot>/package.json. That will let you include a default version, description, etc if you wish along-side the dependencies.

I will attempt to also trap a new project create to run the install if I can. Otherwise, it will display a notification for the user to run that manually. Not certain whether Node-RED will have to be restarted, I will try to avoid that but it might not be possible. Will have to test.

So nice ! Thanks you ! :slight_smile:

Yes, I think that you're right about the full package.json instead of a projectPackage.json

1 Like

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