Uibuilder touching uibuilder/package.json

Uibuilder appears to touch uibuilder/package.json each time I restart node-red. Is this necessary? I run a daily incremental backup and because the date has changed it is backed up every day, which is pointless.

Hi Colin,

It does this because it uses package.json to maintain the additional metadata needed for the library/package manager. To enable you to be able to install packages offline, it checks for package changes on startup and updates the metadata accordingly.

While it would be possible to test for changes and only update the json file if actual changes were found, depending on what packages were installed, this might still change fairly often and it is quite a processing overhead that I never thought would be needed.

It generally isn't a large file though and is easily compressed as well so the additional backup space should not be significant.

Do I even need to back it up at all? It seems it is regenerated if I remove it, in which case I can exclude it from the backup.

The only possible problem with not backing it up is that if you do a clean install, you won't get any front-end libraries because that package.json is where the info is kept.

So your backup wouldn't actually be complete.

Perhaps I need to look at that code again.

You've now got me wondering whether I actually need the extra metadata to be retained if it is reproduced anyway when Node-RED restarts. Maybe having it just in memory would be enough?

My recommendation for now would be not to worry about it backing up each time assuming that your backup process is otherwise efficient, the size is going to be small anyway. In the meantime, I'll have another look at the process and see if I can simplify it.

It isn't the space. I send myself an email when the backup happens telling me which files have been added, modified, or deleted, which I glance at briefly just to make sure there is nothing unexpected going on, so I try to minimise what appears there. It isn't a big deal though so don't worry about it.

Added to my backlog anyway, I'll see if the process can be improved. Thanks for raising it.