Provide JavaScript/TypeScript config files when packaging extensions.

Review Request #13663 — Created March 24, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

Review Board's extension packaging support now uses the new static media
extension packaging classes introduced in Djblets 5. These gives us the
ability to hook into the build process to generate configuration files
for building modern JavaScript/TypeScript codebases.

When building an extension, the following files are now created if they
don't already exist:

  • babel.config.json
  • rollup.config.mjs
  • tsconfig.json

These all provide basic defaults suitable for the extension, and are set
to inherit the versions of these files packaged with Review Board.

On top of this, the JavaScript/TypeScript codebases from the installed
Djblets and Review Board packages are included as NPM workspaces, offering
@beanbag/djblets and @beanbag/reviewboard ESM module imports. This is
primarily useful for TypeScript definitions.

Currently, the configuration and workspace links are only generated when
first building an extension. In the future, we'll want to generate them
when creating an extension in the first place.

Successfully built rbintegrations against this, and verified that the
files and workspaces were present.

Commits

Files