NAME
bb-package - Tools for packaging Backbase catalog items
SYNOPSIS
bb-package [--help] [-v|--version]
bb-package cxp-statics-dir [--help] [--portal-version <version>] [-o|--output <path>]
[-f|--format <format>] [package-zip]
bb-package cxp-statics [--help] [--portal-version <version>] [-o|--output <zip-file>]
[-f|--format <format>] [package-zip]
bb-package project [--help] [-o|--output <file-path>] [--prebuilt <paths>]
[-x --exclude <node glob>] [--exclude-defaults] [--ignore-files <paths>]
[--disable-default-ignore] [-b|--build-plugins <file|node_modules>] [-f|--format <format>] [sources...]
OPTIONS
Option | Description |
---|---|
-v, --version | output the version number |
--help | Output usage information |
COMMANDS
NAME
bb-package cxp-statics-dir
SYNOPSIS
bb-package cxp-statics-dir [--help] [--portal-version <version>] [-o|--output <path>]
[-f|--format <format>] [package-zip]
DESCRIPTION
Turn a provision package into a cxp statics structured folder.
For example, a provision package containing a widget and a feature will be turned into something like:
features/[BBHOST]/my-feature/model.xml features/[BBHOST]/my-feature/scripts/my-feature.js widgets/[BBHOST]/my-widget/assets/icon.png widgets/[BBHOST]/my-widget/index.html widgets/[BBHOST]/my-widget/model.xml widgets/[BBHOST]/my-widget/scripts/my-widget.js
OPTIONS
Option | Description |
---|---|
--portal-version <version> | Portal version (5 or 6) |
-o, --output <path> | Destination output path. |
-f, --format <format> | Output format (supported options: json) |
--help | Output usage information |
EXAMPLES
Create package:
$ bb-package cxp-statics-dir package.zip -o cxp-statics
NAME
bb-package cxp-statics - Create a statics folder suitable for CDN provisioning
SYNOPSIS
bb-package cxp-statics [--help] [--portal-version <version>] [-o|--output <zip-file>]
[-f|--format <format>] [package-zip]
DESCRIPTION
Turns a provision package into a cxp statics folder structure (zipped).
For example, a provision package containing a widget and a feature will be turned into something like:
features/[BBHOST]/my-feature/model.xml features/[BBHOST]/my-feature/scripts/my-feature.js widgets/[BBHOST]/my-widget/assets/icon.png widgets/[BBHOST]/my-widget/index.html widgets/[BBHOST]/my-widget/model.xml widgets/[BBHOST]/my-widget/scripts/my-widget.js
OPTIONS
Option | Description |
---|---|
--portal-version <version> | Portal version (5 or 6) |
-o, --output <zip-file> | Destination output path. |
-f, --format <format> | Output format (supported options: json) |
--help | Output usage information |
EXAMPLES
Create package:
$ bb-package cxp-statics package.zip -o cxp-statics.zip
NAME
bb-package project - Create a provisioning package from unbuilt sources
SYNOPSIS
bb-package project [--help] [-o|--output <file-path>] [--prebuilt <paths>]
[-x --exclude <node glob>] [--exclude-defaults] [--ignore-files <paths>]
[--disable-default-ignore] [-b|--build-plugins <file|node_modules>] [-f|--format <format>] [sources...]
DESCRIPTION
Create a provisioning package from unbuilt sources (which get built) and pre-built sources, that can be deployed to CXP with bb-import.
The prebuilt paths are the paths which simply contain items which don't need to be built with webpack (or are dependencies, and have already been built).
Any paths given will be merged with the default set of paths to search:
- node_modules
- bower_components
- target/backbase
- target/vendor
OPTIONS
Option | Description |
---|---|
-o, --output <file-path> | Destination output path. |
--prebuilt <paths> | Comma separated paths to prebuilt items (items that don't require a webpack build). These will be merged with the defaults (see DESCRIPTION) |
-x --exclude <node glob> | Comma separated paths/globs to ignore. Make sure to wrap globs in single quotes to avoid shell expansion |
--exclude-defaults | Exclude prebuilt defaults |
--ignore-files <paths> | Comma separated files to exclude from item packages. Can be node globs, and defaults to '/bower_components/,/node_modules/,/target/'. |
--disable-default-ignore | Disable default excluding of bower_component, etc |
-b, --build-plugins <file|node_modules> | Comma separated path/node modules to use for building |
-f, --format <format> | Output format (supported options: json) |
--help | Output usage information |
BUILD
The build process:
- Sources are found by globbing for model.xml files.
- Sources are built with webpack using the model.xml as the entry file.
- If there is a 'path' property in the model that will be used as the entry point.
- Otherwise the default entry points are used (scripts/index.js or styles/index.css).
- Themes must be named 'theme-'.
- A temporary directory is created to build into.
- You can set an environment variable of BB_BUILD_DIR and it will be used to build into instead of a temporary directory.
- There can be only 1 entry point and 1 generated file per item (CSS for theme, JS for other items)
- There is a whitelist of files that will be copied into the package. They are:
- model.xml
- config.xml
- icon.png
- index.html
- index.hbs
- options.json
- .npmrc
- assets/**
- templates/**
- locale/**
- media/**
Building CSS:
Only themes have a CSS file generated, and all other items (widgets, UI components, etc) only have javascript generated. Therefore, to use CSS in non-theme items, the CSS must be imported into the javascript. The CSS will then be loaded onto the page via javascript.
Any assets referenced by CSS in themes will be automatically copied into the styles/ directory of the built theme, relative to the generated CSS file. All references to assets suchs as images or fonts in the CSS will be updated to the new location (relative to the CSS).
Because there is no CSS file generated for widgets & UIs, there cannot be any references to assets such as images or fonts in the CSS of widgets and UI components.
Therefore, all assets suchs as images & fonts can only exist in themes, not in widgets or UI components.
EXAMPLES
Package the current directory:
$ bb-package project
Package a separate directory and create my-project.zip:
$ bb-package project ./statics --output my-project.zip
Specify custom paths for pre-built items, and excluded directories:
$ bb-package project ./statics --prebuilt target/bower_components,node_modules \
--exclude='theme/node_modules,collection-excludeme-*'
Exclude prebuilt defaults:
$ bb-package project ./statics --prebuilt target/bower_components,node_modules \
--exclude-defaults
Use 'dist' as the build directory instead of a temp dir:
$ BB_BUILD_DIR=dist bb-package project
Don't package README files in packages:
$ bb-package project --ignore-files '**/README.md'
Disable the default ignored files (eg: allow bower_components):
$ bb-package project --disable-default-ignore
ENVIRONMENT VARIABLES
The directory to output the built items to (by default is a temp dir)
BB_BUILD_DIR=dist
ENVIRONMENT VARIABLES
Set the amount of log output
LOG_LEVEL=silly|verbose|info|warn|error
Set whether or not to use colors in output
COLOR=false|true