Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Upgrade auto-installed packages #28

Open
aleclarson opened this issue Jul 19, 2018 · 2 comments
Open

Upgrade auto-installed packages #28

aleclarson opened this issue Jul 19, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@aleclarson
Copy link
Collaborator

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.

{
  "cush-plugin-jsx": {
    "*": "1.0.0",
    "^1.0.0": "1.0.0"
  }
}

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.

@aleclarson aleclarson added the enhancement New feature or request label Jul 19, 2018
@aleclarson
Copy link
Collaborator Author

Mentioned in "Using a plugin" (in the docs)

@aleclarson
Copy link
Collaborator Author

💡 Idea

cush plugins upgrade

Prompt with confirmation for each plugin upgrade.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant