opamp-core

Provider UI Minification Process

Provider UI minification is a small, explicit build step for the JavaScript files served by provider.

Scope

The provider runtime uses four JavaScript assets from provider/src/opamp_provider/html/:

The minification process generates a matching .mini.js file beside each source file:

Build command

The canonical minification entry point is:

It uses npx esbuild --minify --legal-comments=none and writes deterministic output files next to the source assets.

The canonical asset list is shared in:

Both provider runtime and the minification command read from that shared module so the asset set stays aligned.

Manual usage:

python3 dev-tools/main.py --repo-root . build ui-compaction

Clean-only usage:

python3 dev-tools/main.py --repo-root . build ui-compaction --clean-only

Runtime selection behavior

Provider runtime asset selection is controlled by APP_ENABLE_DEV_FEATURES.

This behavior is implemented in:

Where minification is applied

Minification is expected to run in the main packaging and quality workflows.

Security checks

scripts/security_checks.py runs provider UI compaction as the first step before tests and security scans.

It also removes APP_ENABLE_DEV_FEATURES from the check environment so the checks validate the non-dev asset-selection path.

Provider/consumer artifact build

Both wrapper scripts:

run scripts/security_checks.py, so provider UI compaction is part of the standard artifact build path.

Wheel build and publish flow

python dev-tools/main.py build release-assets refreshes the provider UI compact assets before building wheels unless --skip-ui-compaction is supplied.

Consistency expectation

Whenever a provider UI JavaScript asset is added, renamed, or removed, update the shared definitions in:

If the runtime serves a new asset route, also update the relevant provider route or asset-loading call in provider/src/opamp_provider/app.py.

Keeping the shared asset definition current prevents release builds from silently falling back from minified assets to source assets.