Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 2.43 KB

addons.md

File metadata and controls

36 lines (20 loc) · 2.43 KB

ZombieBox Addons

ZombieBox functionality can be extended with Addons. Currrently there are two types of addons: Platforms and Extensions.

Platforms add an implementation of hardware layer abstraction for a specific set of devices. Their core are implementations of IDevice, IVideo, IInfo and IInput interfaces, scripts that build application into platform-specific artifact (e.g. binary package).

Extensions typically add new functionality to client-side runtime code base (e.g. widgets, utilities). Extensions can also generate new code based on existing code base.

Both Platforms and Extensions can add CLI commands, add client-side code, include additional files into build and influence project configuration.

Installing addons

Addons are loaded from application package.json file. To add an addon, simply install it with npm:

npm install zombiebox-platform-foo
npm install zombiebox-extension-bar

By convention, Platform package name are prefixed with zombiebox-platform- and Extension's with zombiebox-extension-. ZombieBox scans for project dependencies prefixed with zombiebox- and treats them as addons.

See npm for list of publicly available platforms and extensions.

Using addons

Each addons implements AbstractAddon and its subclasses (AbstractPlatform or AbstractExtension) which dictate three basic properties: Name, source directory and config.

Addon name should be a unique identifier. For convention npm package name is typically named same as addon name with appropriate prefix.

Source directory is the location of client-side files to be included into build. Its root will be aliases as addon name.

Addon config can both change global project configuration and introduce its own configuration under platforms or extensions fields. See configuration for more details.

Developing addons

Each addon must have a CommonJS module providing a class inheriting from AbstractAddon (AbstractPlatform, AbstractExtension) referenced in its package.json as main and implementing its abstract methods.