Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/post_summaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2025 The Flutter Authors.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# A CI configuration for pub-publish to write comments on PRs.

name: Comment on the pull request

on:
workflow_run:
workflows:
- Publish
types:
- completed

jobs:
upload:
uses: dart-lang/ecosystem/.github/workflows/post_summaries.yaml@main
permissions:
pull-requests: write
29 changes: 29 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 2025 The Flutter Authors.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# A CI configuration to auto-publish pub packages.

name: Publish

on:
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, labeled, unlabeled]
push:
# Match <package-name>-v<version> publish tags
tags: [ '[A-z0-9]+-v[0-9]+.[0-9]+.[0-9]+' ]

jobs:
publish:
if: ${{ github.repository_owner == 'flutter' }}
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
with:
# See https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose#options
sdk: beta # version of dart sdk to use for publishing
use-flutter: true
write-comments: false
checkout_submodules: true
permissions:
id-token: write
pull-requests: write
71 changes: 10 additions & 61 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
# Contributing to GenUI for Flutter
# Contributing to this repository

## Guidelines
## Coding guidelines

Please follow [Flutter contributor guidelines][flutter_guidelines].

## Run Examples

To run examples:

1. Configure Firebase as described in [README.md][readme_md].
2. Run `flutter run`.

NOTE: For Google-internal projects see go/flutter-genui-internal.

## Shell scripts

To run a script in `tool/`, open the script in VSCode and press ⇧⌘B.

## Detailed documentation for contributors

See [docs/contributing.md](docs/contributing.md).
Please follow:
* [Flutter-wide contributor guidelines][flutter_guidelines].
* [A2UI-specific guidelines](docs/contributing/README.md).

## Issue triage

Expand Down Expand Up @@ -57,7 +42,7 @@ of the front-line triage include:

### Periodic second-line triage

### Bi-weekly during the planning meeting
#### Bi-weekly during the planning meeting

Check that existing issues are labeled and organized appropriately:

Expand All @@ -66,7 +51,7 @@ Check that existing issues are labeled and organized appropriately:
* Set a milestone to all [P0 and P1 issues][p0_p1_issues_without_milestone].
* Add all [projectless open issues][projectless_open_issues] to the "genui" project.

### Weekly during the planning meeting
#### Weekly during the planning meeting

Triage issues ready for second-line review:

Expand All @@ -82,40 +67,15 @@ Triage issues ready for second-line review:
At the end of a triage session, the untriaged issue list should be as close to
empty as possible.

## Versioning

We use [Semver] for package versioning, although before 1.0.0, we will be
incrementing only the minor number for breaking changes and the patch number for
non-breaking changes. After 1.0.0, we will be using standard Semver, bumping the
major number for breaking changes.

We release the following packages in lock step,
with the same version number, so when one is released, they are all released:

* `genui`
* `genui_a2a`
* `genui_firebase_ai`
* `genui_google_generative_ui`

These packages are released independently on their own schedule, with their
own version number:
## Internal information

* `genai_primitives`
* `json_schema_builder`
For Google-internal information see go/a2ui-internal.

"Releasing" consititutes manually publishing them all to [pub.dev] after the
pull request containing the version bump has passed CI. The packages must be
published by someone with permission to publish under the labs.flutter.org
owner.

Use the [release tool](tool/release/README.md) to help automate the process of
releasing a new version.
<!-- references -->

[pub.dev]: https://pub.dev
[Semver]: https://semver.org/
[for-front-line]: https://github.com/flutter/genui/issues?q=is%3Aissue%20state%3Aopen%20-label%3AP0%20%20-label%3AP1%20-label%3AP2%20%20-label%3AP3%20-label%3Afront-line-handled
[flutter_guidelines]: https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md
[readme_md]: packages/genui/README.md#configure-firebase-ai-logic
[assigned_p2_p3_issues]: https://github.com/flutter/genui/issues?q=is%3Aopen%20is%3Aissue%20label%3AP2%2CP3%20assignee%3A*
[p0_p1_issues_without_milestone]: https://github.com/flutter/genui/issues?q=is%3Aopen%20is%3Aissue%20label%3AP1%2CP0%20no%3Amilestone
[projectless_open_issues]: https://github.com/flutter/genui/issues?q=is%3Aopen%20is%3Aissue%20no%3Aproject
Expand All @@ -124,14 +84,3 @@ releasing a new version.
[P1]: https://github.com/flutter/genui/labels?q=P1
[P2]: https://github.com/flutter/genui/labels?q=P2
[P3]: https://github.com/flutter/genui/labels?q=P3

## pubspec.lock files

`pubspec.lock` files are not git ignored to make the bots faster.

If you include `pubspec.lock` file to your PR, make sure to run `flutter pub upgrade`,
when your Flutter is latest at beta channel.

## Internal information

For Google-internal information see go/a2ui-internal.
30 changes: 20 additions & 10 deletions docs/contributing/README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# GenUI specifications
# Contributing to this repository

This folder provides guidance for contributors,
targeted at both AI models and human developers.

## Index of Specifications
## Index of specifications

This directory contains the following specifications:

- [Style Guide](styleguide.md)
- [Style guide](styleguide.md)
- [Design](design.md)
- [Pull requests](pull_requests.md)
- [Publishing](publishing.md)
- [Examples](../../examples/README.md)

## Note for AI models

Expand All @@ -23,15 +27,21 @@ I have read and understood ./docs/contributing/README.md.
1. Documentation in the repository (all .md files) should be clear, consistent, concise and up-to-date.
2. Documentation should not contain details that are easy to infer from the code.
3. If code does not match the documentation, there should be TODO comments in the code to signal the discrepancy should be resolved.
4. For documentation use [sentence case for headings](https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings).

## Code reviews
## Shell scripts

Do not review pull requests when they are in draft state, unless explicitly requested by the author.
To run a script in `tool/`, open the script in VSCode and press ⇧⌘B.

## Key commands

- **Run all checks and tests:**

```bash
./tool/run_all_tests_and_fixes.sh
```
## pubspec.lock files

`pubspec.lock` files are not git ignored to make the bots faster.

If you include `pubspec.lock` file to your PR, make sure to run `flutter pub upgrade`,
when your Flutter is latest at beta channel.

<!-- references -->

[Semver]: https://semver.org/
54 changes: 54 additions & 0 deletions docs/contributing/publishing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

# Publishing

Publishing to [pub.dev](https://pub.dev) happens automatically via GitHub Actions, with the help of
[firehose rules](https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose).

There are two CI workflows that enable this automation:

1. [post_summaries.yaml](../../.github/workflows/post_summaries.yaml)
2. [publish.yaml](../../.github/workflows/publish.yaml)

## Passing the publish / validate job

In general, the job [publish / validate](https://github.com/flutter/genui/actions/runs/25936562918) checks if all pub.dev packages are ready for publishing.
Comment thread
polina-c marked this conversation as resolved.

To make sure your PR passes this validation, follow [firehose rules](https://github.com/dart-lang/ecosystem/tree/main/pkgs/firehose).

## Package categories

`pub.dev` packages in this repo fall into three categories:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The text says 'three categories' but four categories are listed below.

Suggested change
`pub.dev` packages in this repo fall into three categories:
`pub.dev` packages in this repo fall into four categories:


1. **Not intended to be published**: they have `publish_to: none` in their `pubspec.yaml`.
2. **Mono-repo packages**: they have `resolution: workspace` in their `pubspec.yaml`, and are released together, in lock-step, with the same version number.
3. **Independent packages**: they don't have `publish_to` and `resolution` fields in their `pubspec.yaml`. They are released independently.
4. **Not yet published packages**: they have `resolution: workspace` and `release: none` in their `pubspec.yaml`.

## `-dev` vs non-`-dev` (production ready) versions
Comment thread
polina-c marked this conversation as resolved.

The packages code should be always release ready. That means:

1. Use `-dev` version if **at least one** of the following statements is true:

1.1. The package is planned to be released in the future. In this case it is published with `-dev` suffix in order to reserve the package name.

1.2. The package's changes touch only pub.dev non-publishable code or docs (like tests, tools, or not-publishable docs) and it is not a mono-repo package in lock-step with another package that has publishable code.

You can publish `-dev<number>` versions, if you need it for development.

2. If your feature is partially implemented, hide the feature's code behind a false-by-default flag, and use **release-ready** version.

## Versioning

We use [Semver] for package versioning, although before 1.0.0, we will be
incrementing only the minor number for breaking changes and the patch number for
non-breaking changes. After 1.0.0, we will be using standard Semver, bumping the
major number for breaking changes.

<!-- references -->

[Semver]: https://semver.org/

## How publishing happens?

TODO(polina-c): add information, https://github.com/google/A2UI/issues/1383
17 changes: 17 additions & 0 deletions docs/contributing/pull_requests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Authoring pull requests

## Make your PR easy to review

1. Make sure your PR has meaningful title and description.
2. Make sure your PR is not too large. Smaller PRs are easier to review.
3. Separate code reorgs from feature changes.

## CI presubmit errors

You may get CI presubmit errors on pull requests for several reasons. This section explains how to fix some of the less obvious ones.

### From `publish / validate` job

In general, the job checks if all [pub.dev](https://pub.dev) packages are release ready.

See [publishing.md](publishing.md) for more details.
2 changes: 1 addition & 1 deletion packages/a2ui_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `a2ui_core` Changelog

## 0.0.1 (in progress)
## 0.0.1-dev002

- Initial version.
4 changes: 0 additions & 4 deletions packages/genai_primitives/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# `genai_primitives` Changelog

## 0.2.4 (in progress)

- **Refactor**: Update core framework to v0.9 (#546dab9be).

## 0.2.3

- **Feature**: Add methods `copyWith` and `concatenate` to `ChatMessage` (#760).
Expand Down
1 change: 1 addition & 0 deletions packages/genui/.pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
submodules/
2 changes: 1 addition & 1 deletion packages/genui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `genui` Changelog

## (WIP)
## 0.9.1

- **Feature**: Updated example/README.md.

Expand Down
4 changes: 2 additions & 2 deletions packages/genui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

name: genui
description: Generates and displays generative user interfaces (GenUI) in Flutter using AI.
version: 0.9.0
version: 0.9.1
homepage: https://github.com/flutter/genui/tree/main/packages/genui
license: BSD-3-Clause
issue_tracker: https://github.com/flutter/genui/issues

environment:
sdk: ">=3.10.0 <4.0.0"
flutter: ">=3.35.7 <4.0.0"
flutter: ">=3.35.7"

resolution: workspace

Expand Down
2 changes: 1 addition & 1 deletion packages/json_schema_builder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: json_schema_builder
description: A full-featured package used to build and validate JSON schemas in Dart.
version: 0.1.3
version: 0.1.4
homepage: https://github.com/flutter/genui/tree/main/packages/json_schema_builder
license: BSD-3-Clause
issue_tracker: https://github.com/flutter/genui/issues
Expand Down
1 change: 1 addition & 0 deletions tool/fix_copyright/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

name: fix_copyright
description: A command line app to fix copyright headers.
publish_to: none
version: 0.1.0

environment:
Expand Down
Loading