[DAEMON-311] Improve appcd plugin management
|Fix Version/s||Appc Daemon 4.0.0|
DescriptionAppc Daemon needs a better way to install and manage appcd plugins.
appcdplugins are installed via the
appcd-default-pluginspackage. When the
appcd-default-pluginspackage is installed (via
appcd), it will attempt to download and install the packages in an npm script. However, npm runs scripts as "nobody" which generally does not have access to the user's home directory on macOS and Linux and thus no plugins are installed. Plugins cannot be marked as traditional dependencies since we need to support multiple major versions installed side-by-side. Whenever the Appc Daemon is started, it will attempt to reconcile and install the default plugins. This solves the permission issue, but now requires you to start the daemon while online to download the plugins.
Proposal1. Migrate plugin install logic from
appcd-core. 2. Add a
appcd pmcommand that would allow users to install the default plugins, setup local dev plugins, install 3rd party plugins, uninstall plugins, and view installed plugins. Subcommands include
view. 3. Add a file to
appcdcontaining the prescribed default plugin list based on the list currently in
appcd-default-plugins. a. We could elect to lockdown plugin versions instead of using semver ranges. b. We could check online to download an updated list so that we don't have to ship a new
appcdwhenever we want to update plugins. 4. Add a
appcd setupcommand that leverages the plugin command's logic (from #1) to reconcile and install the default appcd plugins defined in the list (from \#2). Note that
appcd setupis generic in nature and can be used to configure specific behavior such as telemetry opt-in and proxy settings. 5. After
appcdis installed, an npm script would print a message instructing the user to run
"appcd setup". Note that no appcd plugins would be installed at install time via an npm script. 6. Remove
appcd-default-plugins. At runtime, instead of attempting to reconcile and install the default plugins, print the "
Run: appcd setup" message.
- Chris Barber 2020-04-14 PR: https://github.com/appcelerator/appc-daemon/pull/468