2026-06-07 14:50:13 -06:00
2026-04-28 15:32:23 -06:00
2026-04-28 15:32:23 -06:00
2026-04-30 22:09:30 -06:00
2026-06-07 14:50:13 -06:00

Bridgeable Build

Shared production build CLI for Bridgeable Components source libraries.

The source library should contain author-owned files only:

assets/
components/
sections/
styles/
tokens/
bridgeable.config.json

Build tooling, dependency versions, Vite configuration, manifest generation, and artifact packing live here instead of inside each client component repository.

Commands

Validate a source library:

bridgeable-build validate --source .

Build a production dist directory:

bridgeable-build build --source . --out ./dist

Pack an existing dist directory:

bridgeable-build pack --dist ./dist --out ./bridgeable-components.zip

Build and pack in one CI-style command:

bridgeable-build publish \
  --source . \
  --out ./dist \
  --artifact ./bridgeable-components.zip

Build Contract

The CLI preserves the current Bridgeable Components production contract:

  • styles/global.css is bundled as the shared global stylesheet.
  • *.component.json files under components/ and sections/ are discovered automatically.
  • Section CSS and JS are emitted as standalone hashed assets.
  • Component CSS is expected to be imported by global CSS or section CSS.
  • Component JS is emitted only when it self-registers with window.initBlock.
  • Static image, font, and video assets are emitted as hashed files and added to manifest.json.
  • *.twig and *.component.json files are copied into the output.
  • Storybook-only files, fixture data, docs, build config, node_modules, .git, and previous build output are excluded.
  • Vite emits manifest.json, which the WordPress Bridgeable Components plugin uses to resolve hashed asset filenames.

Static asset manifest keys use the original logical path from the source library. For example, assets/logo/logo.svg resolves to a hashed file such as assets/logo/logo.[hash].svg in production.

S
Description
No description provided
Readme 71 KiB
Languages
JavaScript 100%