Repository navigation
[material_ui] Set-up tool/gen_defaults sub-directory - #12469
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new gen_defaults tool under packages/material_ui/tool/gen_defaults to generate Material component theme data defaults from token data. It includes the generator script, base template classes, configuration files, and tests. Feedback suggests improving the robustness of the path resolution in materialLib by resolving paths relative to Platform.script instead of relying on the current working directory.
3eac18f to
ebedb7f
Compare
|
@stuartmorgan-g do you mind checking if this directory structure looks good to you? Thanks! |
Work towards flutter/flutter#186906 Adds the initial `gen_defaults` sub-directory with the initial `TokenTemplate` and generator. This is simply the initial scaffold, we will need to add additional helper functions as necessary as we begin adding the actual templates. - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] page, which explains my responsibilities. - [x] I read and followed the [relevant style guides] and ran [the auto-formatter]. - [x] I signed the [CLA]. - [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]` - [x] I [linked to at least one issue that this PR fixes] in the description above. - [x] I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1]. - [x] I updated/added any relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1]. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. <!-- Links --> [Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style [the auto-formatter]: https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [the version and CHANGELOG instructions]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates [semantic versioning]: https://dart.dev/tools/pub/versioning#semantic-versions [repository CHANGELOG style]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style [test exemption]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests
eba20f2 to
467afa4
Compare
|
Added versioning exemption since these files are all in the |
It shouldn't have a changelog entry, since tool/ is only for package developers. Our tooling already knowns not to flag it, so what I'm pretty sure is happening is that the |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
Having everything encapsulated in the tool/ directory LGTM! (I didn't review the Dart code itself.)
| @@ -0,0 +1,2 @@ | |||
| # The tool/ directory is for package developer use only and should not be published. | |||
| tool/ | |||
There was a problem hiding this comment.
According to the docs, having .pubignore will cause .gitignore to be ignored, so I believe you'll need to duplicate the .gitignore contents into this file to avoid issues the next time the package is published.
There was a problem hiding this comment.
Ah, I did not know that! I moved the .pubignore under material_ui/tool/ instead, that way we don't have to keep the contents of it and material_ui's .gitignore file in-sync. I did a test run with dart pub publish --dry-run to confirm that the tool directory is excluded.
Work towards flutter/flutter#186906, flutter/flutter#191088 **Ports over flutter#11762 which landed on the `m3e_migration` feature branch.** Since CI was not set up to run on that branch, I've pushed up a few more changes after the ported commits to get all the repo checks/tests to pass. ### Original PR description Adds the initial gen_defaults sub-directory with the initial TokenTemplate and generator. This is simply the initial scaffold, we will need to add additional helper functions as necessary as we begin adding the actual templates. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
…r#191886) flutter/packages@740f093...bd3cbc1 2026-08-26 engine-flutter-autoroll@skia.org Roll Flutter from 9a82789 to 15d8908 (37 revisions) (flutter/packages#12619) 2026-08-26 stuartmorgan@google.com [google_maps_flutter] Convert simple object controllers to Swift (flutter/packages#12618) 2026-08-26 21270878+elliette@users.noreply.github.com [material_ui] `gen_defaults` should follow new versioning strategy (flutter/packages#12627) 2026-08-25 10687576+bparrishMines@users.noreply.github.com [material_ui] Fixes analysis_options migration from calling `flutter pub get` on pacakage (flutter/packages#12626) 2026-08-25 jason-simmons@users.noreply.github.com [material_ui] Declare Flutter SDK dependencies in the pubspec.yaml for tool/gen_defaults (flutter/packages#12623) 2026-08-25 21270878+elliette@users.noreply.github.com [material_ui] Set-up `tool/gen_defaults` sub-directory (flutter/packages#12469) 2026-08-25 stuartmorgan@google.com [google_maps_flutter] Convert top-level classes to Swift in `_sdk*` packages (flutter/packages#12307) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Work towards flutter/flutter#186906, flutter/flutter#191088 **Ports over flutter#11762 which landed on the `m3e_migration` feature branch.** Since CI was not set up to run on that branch, I've pushed up a few more changes after the ported commits to get all the repo checks/tests to pass. ### Original PR description Adds the initial gen_defaults sub-directory with the initial TokenTemplate and generator. This is simply the initial scaffold, we will need to add additional helper functions as necessary as we begin adding the actual templates. ## Pre-Review Checklist **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Work towards flutter/flutter#186906, flutter/flutter#191088
Ports over #11762 which landed on the
m3e_migrationfeature branch.Since CI was not set up to run on that branch, I've pushed up a few more changes after the ported commits to get all the repo checks/tests to pass.
Original PR description
Adds the initial gen_defaults sub-directory with the initial TokenTemplate and generator. This is simply the initial scaffold, we will need to add additional helper functions as necessary as we begin adding the actual templates.
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2