Skip to content

[pubspec_parse] Add hooks field to Pubspec - #2568

Merged
kevmoo merged 3 commits into
dart-lang:mainfrom
spydon:pubspec-parse-hooks
Oct 19, 2026
Merged

kevmoo merged 3 commits into
dart-lang:mainfrom
spydon:pubspec-parse-hooks

Conversation

@spydon

@spydon spydon commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Adds the hooks field to Pubspec as Map<String, dynamic>? hooks, see https://dart.dev/tools/pub/pubspec#hooks.

The field holds hook configuration such as user_defines for native build and link hooks. It is exposed as a raw map, mirroring the flutter section, since its contents are defined by the hooks packages rather than by pub. It is included in Pubspec.toJson and covered by parsing, error, lenient, and round-trip tests.

Follow-up to #2565. Each new field is in its own PR to keep them easy to review.

@spydon
spydon requested a review from a team August 29, 2026 16:07

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request adds support for the hooks field in the Pubspec class. This includes adding the hooks field to the Pubspec model, updating the generated JSON serialization and deserialization logic, updating the changelog and package version to 1.7.0-wip, and adding comprehensive unit tests to verify parsing and serialization of the new field. There are no review comments, and I have no additional feedback to provide.

spydon and others added 2 commits August 29, 2026 18:15
# Conflicts:
#	pkgs/pubspec_parse/CHANGELOG.md
#	pkgs/pubspec_parse/lib/src/pubspec.dart
#	pkgs/pubspec_parse/lib/src/pubspec.g.dart
#	pkgs/pubspec_parse/test/parse_test.dart
#	pkgs/pubspec_parse/test/tojson_test.dart
@kevmoo
kevmoo merged commit 85e0375 into dart-lang:main Oct 19, 2026
22 checks passed
copybara-service Bot pushed a commit to dart-lang/sdk that referenced this pull request Oct 20, 2026
tools (https://github.com/dart-lang/tools/compare/f6c7a2d..4d7715a):
  4d7715ac  Mon Oct 19 16:09:30 2026 -0700  Kevin Moore  Replace `@dart-lang/dart-bat` with `@dart-lang/dart-ecosystem-team` in `CODEOWNERS` (dart-lang/tools#2697)
  a22c558c  Tue Oct 20 06:56:10 2026 +0900  YeungKC  [markdown] Check the first character before inline syntax regexes (dart-lang/tools#2695)
  c57bde49  Mon Oct 19 14:40:39 2026 -0700  dart-ecosystem-bot[bot]  [boring] Update BoringSSL to 64188f17 (dart-lang/tools#2692)
  7a4ea6f8  Tue Oct 20 00:09:47 2026 +0300  Hasan Armoush  [pubspec_parse] Expose version constraint on PathDependency (dart-lang/tools#2581)
  85e03753  Mon Oct 19 22:41:32 2026 +0200  Lukas Klingsbo  [pubspec_parse] Add hooks field to Pubspec (dart-lang/tools#2568)
  13139ec6  Mon Oct 19 22:28:47 2026 +0200  Lukas Klingsbo  [pubspec_parse] Add false_secrets field to Pubspec (dart-lang/tools#2567)
  462d92bf  Mon Oct 19 21:56:25 2026 +0200  Lukas Klingsbo  [pubspec_parse] Add platforms field to Pubspec (dart-lang/tools#2566)

TEST=ci

Change-Id: I106b05a08a7395f72e01a86a952abd41f4630831
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/566840
Commit-Queue: Kevin Moore <kevmoo@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
@kevmoo

kevmoo commented Oct 21, 2026

Copy link
Copy Markdown
Member

Thanks for this and #2565, #2566, and #2567! All four are now published in pubspec_parse 1.7.0.

@spydon

spydon commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for this and #2565, #2566, and #2567! All four are now published in pubspec_parse 1.7.0.

Awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants