appcd-default-plugins
A psuedo package that attempts to install the latest major versions of all default appcd plugins
into the user's appcd home directrory (e.g. "~/.appcelerator/appcd/plugins"
) postinstall and
optionally at runtime.
Visit https://github.com/appcelerator/appc-daemon for more information.
Report issues to GitHub issues. Official issue tracker in JIRA.
Usage
; await ;
Details
appcd-default-plugins
deploys two strategies for installing the default appcd plugins:
post-install and at runtime.
Post-install is the ideal time to install the default plugins, however if the user installs as root
(e.g. sudo), then npm
will drop permissions and the post-install script will be unable to write
to the plugins directory. In this case, the permission error is suppressed allowing the install to
complete.
appcd-default-plugins
leverages lerna and yarn to create a local workspace for the purpose of
optimizing a hoisted node_modules
directory.
Since downloading and installing a plugin and its dependencies is an expensive operation, it will only install a plugin from npm if there are no installed plugins that satisfy the plugin's specs. Likewise, it will only invoke lerna if a plugin was installed or a plugin was removed/invalidated.
The installDefaultPlugins()
function performs a number of steps to attempt to install the default
plugins:
- Determine if the plugins directory is writable.
- Locate the yarn and lerna scripts.
- Detect existing list of workspaces that were created during
postinstall
or previous appcd start. - Detect existing installed plugins.
- Invalid plugins are quarantine in a
/path/to/plugins/invalid
directory.
- Invalid plugins are quarantine in a
- Detect an global yarn links.
- Symlink any new yarn links.
- Loop over the list of default appcd plugins and figure out what needs to be installed.
- Install the missing appcd plugins.
- Assuming one or more plugins where installed or the list of workspaces has changed, then:
- Rewrite every plugin's package name in their respective
package.json
files to make lerna/yarn happy. - Write the main
package.json
andlerna.json
files. - Execute lerna bootstrap which in turn executes yarn.
- Revert the plugin package names.
- Rewrite every plugin's package name in their respective
Legal
This project is open source under the Apache Public License v2 and is developed by
Axway, Inc and the community. Please read the LICENSE
file included
in this distribution for more information.