Internal helpers called by Bajo and other classes. It should remains hidden and not to be imported by any program.

Methods

(async, static) exports.bootOrder()

Setup plugins boot orders by reading plugin's .bootorder file if provided.

(async, static) exports.bootPlugins()

Iterate through all plugins loaded and do:

  1. build configs
  2. ensure names & aliases uniqueness
  3. ensure dependencies are met
  4. collect hooks
  5. run plugins

(async, static) exports.buildBaseConfig()

Building bajo base config. Mostly dealing with directory setups:

  • determine base directory
  • check whether data directory is valid. If not exist, create one inside app dir
  • ensure data config directory is there
  • ensure tmp dir is there
  • read the list of plugins from .plugins file

(async, static) exports.buildConfigs()

Build configurations

(async, static) exports.buildExtConfig()

Bajo extra config:

  • reading config file
  • merge config with arguments & environments values
  • Set environment (dev or prod)

(async, static) exports.buildPlugins()

Building all plugins:

  • load from app's pluginPkgs
  • iterate through the list and build related plugins
  • making sure main plugin is there. If not, create from template
  • attach these plugins to the app instance

(async, static) exports.checkDependencies()

Ensure dependencies are met

(async, static) exports.checkNameAliases()

Ensure for names and aliases to be unique and no clashes with other plugins

(async, static) exports.collectConfigHandlers()

Collect all config handlers, including the one provided by plugins

(async, static) exports.collectHooks()

Collect and build hooks and push them to the bajo's hook system

(async, static) exports.exitHandler()

Attach plugins exit handlers and make sure the app shutdowns gracefully

(async, static) exports.run()

Finally, run all plugins

(async, static) exports.runAsApplet()

If app is in applet mode, this little helper should take care plugin's applet boot process

Fires:

Type Definitions

TAppLib

Type:
  • Object
Properties
NameTypeDescription
_Object

Access to lodash.

fsObject

Access to fs-extra.

fastGlobObject

Access to fast-glob.

sprintfObject

Access to sprintf.

anekaObject

Access to aneka.

outmatchObject

Access to outmatch.

dayjsObject

Access to dayjs with utc & customParseFormat plugin already applied.

freezeObject
findDeepObject
See