Widgetbook Cloud Builds
When you create a new commit in Git, a new version of your code is created. With Widgetbook Builds developers can host a Widgetbook for a Git commit and make it easily accessible for the whole team on Widgetbook Cloud. If set up with CI/CD, you can have a build for each commit, for each pull-request and for each branch.
Pushing a new build
To create a Widgetbook Build, follow these steps inside your Widgetbook project:
-
Run
widgetbook_generator
to generate metadata about your use-cases and componentsdart run build_runner build -d
-
Build the Widgetbook for the web
# Default target (i.e. `lib/main.dart`) flutter build web # Custom target flutter build web -t lib/main.widgetbook.dart
-
Install the Widgetbook CLI
dart pub global activate widgetbook_cli
-
Get your API key from the Widgetbook Cloud's project settings page.
-
Push the build to Widgetbook Cloud
widgetbook cloud build push --api-key PROJECT_API_KEY
The cloud push
command uses the following directories:
build/web/
to create a.zip
archive that will be uploaded to Widgetbook Cloud..dart_tool/build/generated/[your_app_name]/
to send metadata, about the generated use-cases, that will be used for Widgetbook Cloud Review.