Skip to content

feat: consolidate templates in monorepo and publish flet pre-releases to pub.dev - #6331

Merged
FeodorFitsner merged 8 commits into
mainfrom
pin-everything
Mar 19, 2026
Merged

feat: consolidate templates in monorepo and publish flet pre-releases to pub.dev#6331
FeodorFitsner merged 8 commits into
mainfrom
pin-everything

Conversation

@FeodorFitsner

Copy link
Copy Markdown
Contributor

Summary

Closes #6306

  • Move templates into monorepo: flet-build-template and flet-app-templates repos consolidated into sdk/python/templates/build/ and sdk/python/templates/app/
  • Publish pre-release flet Flutter package to pub.dev: CI now publishes flet to pub.dev on every main branch push (with +buildnum version), not just tagged releases
  • Distribute templates as zip artifacts: CI packages templates into flet-build-template.zip and flet-app-templates.zip, uploaded to GitHub Releases (both dev and tagged)
  • Update CLI to fetch zips: flet build and flet create download template zips from GitHub Releases instead of cloning external repos; local dev fallback detects source checkout and uses path dependencies
  • Fix dependency merge: pyproject pubspec dependency sections use shallow replace (dict.update) instead of deep merge to avoid invalid multi-source Dart dependencies
  • Various CI fixes: missing template files (.gitignore negation), bash curly brace escaping, zip structure, dry-run publish removal

Test plan

  • flet create test_app from source checkout uses local templates
  • flet build apk from source checkout uses local templates with path dependency override
  • CI build_flet_package computes PUB_VER correctly
  • CI build_templates produces valid zip artifacts with patched flet version
  • Dev GitHub Release includes template zips
  • Installed flet from PyPI resolves correct zip from GitHub Release

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

FeodorFitsner and others added 8 commits March 19, 2026 13:45
… to pub.dev (#6306)

Move flet-build-template and flet-app-templates into sdk/python/templates/,
distribute them as zip artifacts on GitHub Releases, and enable pre-release
publishing of the flet Flutter package to pub.dev on every main branch commit.

- Add build and app templates from external repos (0.83.0 branch)
- Set flet dependency to local path for local development
- Add PUB_VER (e.g. 0.82.3+7887) to version script for pub.dev
- Patch pubspec and publish flet to pub.dev on main branch commits
- New build_templates CI job: patches flet version, zips, uploads artifacts
- Include template zips in release and dev_release GH artifacts
- CLI defaults to zip URL from GH release instead of git repo checkout
- Local dev fallback: detect source checkout and use local templates with
  path dependency override
- Update patch_pubspec_version.py: support --exact flag and dependency_overrides
- Exclude templates/ from pre-commit hooks (cookiecutter/Jinja syntax)
- Update docs, CONTRIBUTING.md, and prepare-flet-release skill

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Import copy and deep-copy the pyproject pubspec before modifying it. Instead of deep-merging dependency sections (which can produce invalid mixed sources like path+git), explicitly transfer "dependencies", "dependency_overrides", and "dev_dependencies" from pyproject into the existing pubspec via pubspec.setdefault(...).update(...). Then merge the remaining pyproject fields and save the pubspec. This prevents invalid combined dependency sources while preserving other pyproject settings.
Remove the 'Publish to pub.dev (Dry Run)' step from .github/workflows/ci.yml. The removed step previously ran `dart pub publish --dry-run` in packages/flet. The workflow now only keeps the actual publish step (triggered on tags or the main branch).
The parent sdk/python/.gitignore had rules for `lib/` and `*.manifest`
that were hiding template files from git. Add templates/.gitignore with
negations to un-ignore these patterns within the templates directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Curly braces inside double quotes are literal in bash — the backslash
escaping caused the path to not be found.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cookiecutter expects cookiecutter.json at the zip root (or reachable
via the directory param). Zipping the parent dir added an extra nesting
level that would break template resolution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extend the stdout protocol between the script and CLI to include the
view type, so `flet run` automatically starts the window hidden when
the script uses `view=AppView.FLET_APP_HIDDEN` without requiring the
`--hidden` flag.

@sourcery-ai sourcery-ai Bot left a comment

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.

Sorry @FeodorFitsner, your pull request is larger than the review limit of 150000 diff characters

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 19, 2026

Copy link
Copy Markdown

Deploying flet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b7532b
Status: ✅  Deploy successful!
Preview URL: https://b04f563d.flet-docs.pages.dev
Branch Preview URL: https://pin-everything.flet-docs.pages.dev

View logs

@FeodorFitsner FeodorFitsner added this to the 0.83.0 milestone Mar 19, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying flet-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5b7532b
Status: ✅  Deploy successful!
Preview URL: https://729c0673.flet-examples.pages.dev
Branch Preview URL: https://pin-everything.flet-examples.pages.dev

View logs

@FeodorFitsner
FeodorFitsner merged commit efae74a into main Mar 19, 2026
73 of 131 checks passed
@FeodorFitsner
FeodorFitsner deleted the pin-everything branch March 19, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Automatically retrieve the highest available version of flet-build-template

1 participant