@backbase/collection

1.0.0-alpha.13 • Public • Published

Backbase Collection Utils

Warning: This library is still in alpha.

Usage

.listDependencies(sourcesDir)

Returns a full list of dependencies of the collection, ordered by the dependency tree with the top most dependencies first.

Currently only supports bower dependencies. The bower dependencies need to be installed, and are retrievied from bower list.

Returns array in format:

[
    {
        name: <item name>
        srcDir: <path to item>
        version: <version of item>
        dependencies: {
            <item name>: {
                name: <item name>
                srcDir: <path to item>
                version: <version of item>
                dependencies: {
                    ...
                }
            },
            ...
        }
    },
    ...
]

.listSources(sourcesDir)

Returns a full list of CXP sources found in sourcesDir, excluding anything in bower_components or node_modules.

Folders are determined to be CXP sources if they contain a model.xml.

Returns array in format

[
    {
        name: <item name>
        srcDir: <path to item>
        version: <version of item>,
        type: <template|container|feature|widget>
    },
    ...
]

The array is ordered by templates, containers, features, then widgets.

.listItem(sourceDir)

Returns a single item loaded from the sourceDir.

Throws an error if folder desn't have model.xm.

Developing

Because of some weird bug with babel I haven't figured out yet, to run the coverage you need to delete the .babelrc file. You can get the coverage like this:

mv .babelrc .babelrc.bak && make coverage && mv .babelrc.bak .babelrc

Readme

Keywords

none

Package Sidebar

Install

npm i @backbase/collection

Weekly Downloads

3

Version

1.0.0-alpha.13

License

none

Last publish

Collaborators

  • backbase-admin
  • bb-cli