@allior/wmake-cli
v1.0.5
Published
WMake CLI: build widgets, base64 encode assets, generate fields
Downloads
882
Readme
@allior/wmake-cli
CLI for streamiby / wmake: widget build, base64 encoding, field generation.
Installation
npm add -g @allior/wmake-cli
# or from the monorepo:
cd cli && npm install && npm run buildCommands
wmake-cli widget
Builds the widget into text files (html.txt, js.txt, css.txt, fields.txt, data.txt) in the build/ directory.
wmake-cli widget
wmake-cli widget --full # full bundle without CDN (legacy build style)
wmake-cli widget --archive # create a widget.zip archive in dist/
wmake-cli widget --no-ini # skip widget.ini generation
wmake-cli widget --html custom.html --js bundle.js # custom filenamesAvailable options:
-b, --bundle: Build a full bundle without CDN deps.-s, --se-dir <dir>: Directory containing StreamElements files.--no-wmake-versions: Do not include wmake versions in fields.--no-test-alerts: Do not include test alerts in fields.--no-test-messages: Do not include test messages in fields.--html <name>: Output HTML filename (default:html.txt).--css <name>: Output CSS filename (default:css.txt).--js <name>: Output JS filename (default:js.txt).--data <name>: Output data filename (default:data.txt).--fields <name>: Output fields filename (default:fields.txt).--no-ini: Do not generatewidget.ini.--minify: Minify HTML/JS/CSS output.--obfuscate: Obfuscate JS output.--out-dir <dir>: Directory for.txtfiles (default:build).--zip-dir <dir>: Directory for the.ziparchive (default:dist).--output <type>: Output format:files,zip, orboth(default:files).
wmake-cli base64
Converts images, videos, and SVG to base64 for use in the browser.
wmake-cli base64 <path> # file or directory
wmake-cli base64 ./assets -o out # output to file or directory
wmake-cli base64 ./img -b # output with extra infoAvailable options:
-o, --output <path>: Output file or directory.-b, --bundle: Include extra info (metadata and Data URL wrapper).
wmake-cli generate-fields
Merges fields.json with dynamic WMake versions and testing tools. This command is helpful when you want to update the source fields.json before building.
wmake-cli generate-fieldswmake-cli fields-ts
Generates fields.json from a TypeScript module. The module must export an array of field objects as its default export.
wmake-cli fields-ts ./src/fields.ts
wmake-cli fields-ts ./src/fields.ts custom-fields.jsonwmake-cli extract-test-data
Test data lives in streamelements/src/assets as TS objects; this command is kept for compatibility.
Development
npm install
npm run build # compile
npm run dev # run via bun (src/bin.ts)
npm start # run compiled dist/bin.js