Anything auto-installed into ~/.cush/packages using cush/utils/lazyRequire is currently never upgraded when a new version is available. Here's the plan to fix that.
Maintain ~/.cush/packages.json that maps dependencies to their installed versions.
In the example above, we know that cush-plugin-jsx-1.0.0 is installed in ~/.cush/packages. When lazyRequire('cush-plugin-jsx') is called, we'll fetch the list of available versions from NPM. If the latest version is greater than 1.0.0, we will install it, but we'll still need to keep 1.0.0 installed because lazyRequire('cush-plugin-jsx', '^1.0.0') was once called. If that call was never made, we would uninstall 1.0.0 since it's no longer needed.
In the future, we could track package versions on a per-bundle basis, which would allow us to prune unused packages more efficiently. This will require bundle sessions.
Anything auto-installed into
~/.cush/packages
usingcush/utils/lazyRequire
is currently never upgraded when a new version is available. Here's the plan to fix that.Maintain
~/.cush/packages.json
that maps dependencies to their installed versions.In the example above, we know that
cush-plugin-jsx-1.0.0
is installed in~/.cush/packages
. WhenlazyRequire('cush-plugin-jsx')
is called, we'll fetch the list of available versions from NPM. If the latest version is greater than1.0.0
, we will install it, but we'll still need to keep1.0.0
installed becauselazyRequire('cush-plugin-jsx', '^1.0.0')
was once called. If that call was never made, we would uninstall1.0.0
since it's no longer needed.In the future, we could track package versions on a per-bundle basis, which would allow us to prune unused packages more efficiently. This will require bundle sessions.