reviewboard.extensions.packaging.static_media¶
A builder for static media files for extension packages.
New in version 7.1: This moved from the top-level reviewboard.extensions.packaging
.
- class RBStaticMediaBuildContext(*, package_id: str, css_bundles: CSSBundleConfigs, js_bundles: JSBundleConfigs, source_root_dir: Path, static_dir: Path, build_dir: Optional[Path] = None)[source]¶
Bases:
StaticMediaBuildContext
Context for performing a static media build for an extension.
This will set up some default NPM workspace paths needed for building Review Board extensions.
Changed in version 7.1: This moved from
reviewboard.extensions.packaging
.New in version 7.0.
- get_npm_workspace_dirs() NPMWorkspaceDirs [source]¶
Return NPM workspace directories and symlinks to set up.
Subclasses can override this to return additional workspaces to include. The parent class should always be called and the results included.
- Returns:
A mapping of symlink names to target locations.
- Return type:
- get_lessc_global_vars() LessCSSVariables [source]¶
Return a dictionary of LessCSS global variables and their values.
Subclasses can override this to return custom variables.
The contents in here are considered deprecated, and should generally not be used for any production extensions.
- Returns:
A dictionary mapping variable names to values.
- Return type:
- __annotations__ = {}¶
- class RBStaticMediaBuilder(*, build_context: StaticMediaBuildContext)[source]¶
Bases:
StaticMediaBuilder
Static media builder for Review Board extensions.
This will take care of building static media files. As part of this, it will set up Babel, Rollup, and TypeScript configuration files needed to compile against Review Board JavaScript/TypeScript modules.
Changed in version 7.1: This moved from
reviewboard.extensions.packaging
.New in version 7.0.
- ensure_build_files() None [source]¶
Set up the build tree and configuration files.
This will set up the NPM workspaces and a starting
package.json
file that can be used to manage the build.If there are any changes to the
package.json
in the tree, they will be reported to the user.
- __annotations__ = {}¶