API Docs for: 0.6.1
Show:

RSAddonConfig Class

Methods

_readYcbAppConfig

() Object private

Initializes the special multi-file YCB library for all the application files. By default, we try to load application.json, then mix any other relative config file specified in the master section under the applicationConfigFiles array, which is optional.

Returns:

Object: libycb object

_readYcbDimensions

() Array private

Read the application's dimensions.json file for YCB processing. If not available, fall back to the framework's default dimensions.json.

Returns:

Array: contents of the dimensions.json file

createMultipartYCB

(
  • paths
)
YCB

Creates a YCB configuration bundle using contents from multiple files. The appropriate dimensions.json file will be mixed in, and doesn't need to be part of the list of files. This method is tolerant to errors, and will fallback to {} if a file does not exists or fails to load.

Parameters:

  • paths Array

    list of files to load

Returns:

YCB: return a YCB library object

findResourceVersionByConvention

(
  • source
  • mojitType
)
Object | | Null

Using AOP, this is called after the ResourceStore's version.

Parameters:

  • source Object

    metadata about where the resource is located

  • mojitType String

    name of mojit to which the resource likely belongs

Returns:

Object | | Null: for config file resources, returns metadata signifying that

getAppConfigYCB

() YCB

Returns the YCB library object for the application config.

Returns:

YCB: YCB library object for the application config

getDimensions

() Object

Returns the YCB dimensions for the application.

Returns:

Object: the YCB dimensions structure for the app

initializer

(
  • config
)
Nothing

This methods is part of Y.Plugin.Base. See documentation for that for details.

Parameters:

  • config Object

    Configuration object as per Y.Plugin.Base

Returns:

Nothing:

parseResourceVersion

(
  • source
  • type
  • subtype
  • mojitType
)
Object | | Null

Using AOP, this is called before the ResourceStore's version.

Parameters:

  • source Object

    metadata about where the resource is located

  • type String

    type of the resource

  • subtype String

    subtype of the resource

  • mojitType String

    name of mojit to which the resource likely belongs

Returns:

Object | | Null: for config file resources, returns the resource metadata

readConfigJSON

(
  • fullPath
)
User-defined

Reads a JSON file. In mojito, this should generally only be used for package.json files, and all other mojito config files should instead be read using readConfigSimple() or readConfigYCB().

Parameters:

  • fullPath String

    path to JSON file

Returns:

User-defined: contents of file as an object

readConfigSimple

(
  • fullPath
)
User-defined

Reads and parses a JSON or YAML structured file.

Parameters:

  • fullPath String

    path to JSON or YAML file

Returns:

User-defined: contents of file as an object

readConfigYCB

(
  • ctx
  • fullPath
)
Object

Reads a configuration file that is in YCB format.

Parameters:

  • ctx Object

    runtime context

  • fullPath String

    path to the YCB file

Returns:

Object: the contextualized configuration