@backbase/collection

Utilities for dealing with a backbase collection of components.

Stats

StarsIssuesVersionUpdatedCreatedSize
@backbase/collection
1.0.0-alpha.135 years ago6 years agoMinified + gzip package size for @backbase/collection in KB

Readme

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

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.