4.2.1 • Published 4 years ago

appcd-default-plugins v4.2.1

Weekly downloads
6
License
Apache-2.0
Repository
github
Last release
4 years ago

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

import { installDefaultPlugins } from 'appcd-default-plugins';

await installDefaultPlugins('/path/to/plugins/dir');

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:

  1. Determine if the plugins directory is writable.
  2. Locate the yarn and lerna scripts.
  3. Detect existing list of workspaces that were created during postinstall or previous appcd start.
  4. Detect existing installed plugins.
    • Invalid plugins are quarantine in a /path/to/plugins/invalid directory.
  5. Detect an global yarn links.
    • Symlink any new yarn links.
  6. Loop over the list of default appcd plugins and figure out what needs to be installed.
  7. Install the missing appcd plugins.
  8. 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 and lerna.json files.
    • Execute lerna bootstrap which in turn executes yarn.
    • Revert the plugin package names.

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.

4.2.1

4 years ago

4.2.0

4 years ago

4.1.0

5 years ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.1.0-0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

1.0.0-30

6 years ago

1.0.0-29

6 years ago

1.0.0-28

6 years ago

1.0.0-27

6 years ago

1.0.0-26

6 years ago

1.0.0-25

6 years ago

1.0.0-24

6 years ago

1.0.0-23

6 years ago

1.0.0-22

6 years ago

1.0.0-21

6 years ago

1.0.0-20

6 years ago

1.0.0-19

6 years ago

1.0.0-18

6 years ago

1.0.0-17

6 years ago

1.0.0-16

6 years ago

1.0.0-15

6 years ago

1.0.0-14

6 years ago

1.0.0-13

6 years ago

1.0.0-12

6 years ago

1.0.0-11

6 years ago

1.0.0-10

6 years ago

1.0.0-9

6 years ago

1.0.0-8

6 years ago

1.0.0-7

6 years ago

1.0.0-6

6 years ago

1.0.0-5

6 years ago

1.0.0-4

6 years ago

1.0.0-3

6 years ago

1.0.0-2

6 years ago

1.0.0-1

6 years ago

0.0.0

6 years ago