Conversation
| 'Args to pass to the build runner process.\n' | ||
| 'Run "dart run build_runner build -h -v" to see all available ' | ||
| 'options.', | ||
| ); |
There was a problem hiding this comment.
Only formatting changes in this file
| checked: true, | ||
| disallowUnrecognizedKeys: true, | ||
| fieldRename: FieldRename.snake) | ||
| anyMap: true, |
There was a problem hiding this comment.
Only formatting changes in this file
| emitsThrough( | ||
| 'dart run build_runner build --delete-conflicting-outputs --build-filter=dart_test.browser_aggregate.yaml', | ||
| ), | ||
| emitsThrough(contains('Built with build_runner/jit')), |
There was a problem hiding this comment.
here's a non-formatting change. This is to match the new output that Dart 3 prints when building.
| emitsThrough( | ||
| 'dart run build_runner build --delete-conflicting-outputs --build-filter=test/templates/default_template.browser_aggregate_test.**', | ||
| ), | ||
| emitsThrough(contains('Built with build_runner/jit')), |
There was a problem hiding this comment.
here's a non-formatting change. This is to match the new output that Dart 3 prints when building.
| emitsThrough( | ||
| 'dart run build_runner build --delete-conflicting-outputs -c custom --build-filter=dart_test.browser_aggregate.yaml', | ||
| ), | ||
| emitsThrough(contains('Built with build_runner/jit')), |
| emitsThrough( | ||
| 'dart run build_runner build --delete-conflicting-outputs -c custom --release --build-filter=test/templates/default_template.browser_aggregate_test.**', | ||
| ), | ||
| emitsThrough(contains('Built with build_runner/jit')), |
| emitsThrough( | ||
| 'dart run build_runner build --delete-conflicting-outputs --build-filter=dart_test.browser_aggregate.yaml', | ||
| ), | ||
| emitsThrough(contains('Built with build_runner/jit')), |
| emitsThrough( | ||
| 'dart run build_runner build --delete-conflicting-outputs --release -c custom --build-filter=dart_test.browser_aggregate.yaml', | ||
| ), | ||
| emitsThrough(contains('Built with build_runner/jit')), |
| @@ -6,8 +6,10 @@ import 'package:test_descriptor/test_descriptor.dart' as d; | |||
| import 'package:test_process/test_process.dart'; | |||
|
|
|||
| void main() { | |||
There was a problem hiding this comment.
Mostly formatting changes in this file. non-formatting changes are called out with comments.
| strict-raw-types: true | ||
|
|
||
| formatter: | ||
| trailing_commas: preserve |
There was a problem hiding this comment.
removed old unsupported options and added config to keep trailing commas as that reduces the amount of formatting changes
| await testBuilder( | ||
| builder, | ||
| { | ||
| 'a|pubspec.yaml': 'name: a', |
There was a problem hiding this comment.
the only non-formatting change in this file
test/lib/template_builder_test.dart
Outdated
| final config = TestHtmlBuilderConfig(templates: { | ||
| 'test/template.html': ['test/**_test.dart'], | ||
| }); | ||
| test('does not output .html if template cannot be read', () async { |
There was a problem hiding this comment.
Does this change come from how the analyzer or build_runner works on latest version? It just doesn't output rather than failing the build?
There was a problem hiding this comment.
Great question. This is why I put eyes here. This was what Codex decided to change the test to to pass.... but I wonder now if it just removed the assertions and viola the tests pass. Maybe? I suppose I'll need to verify functionality to make sure this is right.
There was a problem hiding this comment.
ok so I think I found the issue
I found the root cause: with build_test 3.5.7, recordLogs now uses a separate logger stream that these builder logs aren’t hitting in this setup. I’m patching the two tests to capture logs through testBuilder(..., onLog: ...) and keep strict SEVERE message assertions.
test/lib/template_builder_test.dart
Outdated
| 'a|test/test_html_builder_config.json': jsonEncode(config), | ||
| 'a|test/foo_test.dart': '', | ||
| 'a|test/template.html': 'MISSING TOKEN', | ||
| }, outputs: {}); |
| @@ -21,32 +21,36 @@ void main() { | |||
| test('generates a preset with a path for each aggregate test', () async { | |||
| final config = TestHtmlBuilderConfig(browserAggregation: true); | |||
| final builder = DartTestYamlBuilder(); | |||
There was a problem hiding this comment.
formatting only changes in this file
| @@ -19,7 +19,7 @@ void main() { | |||
| 'randomize_ordering_seed': 'random', | |||
| 'templates': { | |||
| 'test/foo_template.html': ['test/**_test.dart'], | |||
There was a problem hiding this comment.
formatting only changes in this file
| @@ -9,9 +9,11 @@ import 'package:test_html_builder/src/config.dart'; | |||
| void main() { | |||
| group('AggregateTestBuilder', () { | |||
| test('does nothing if browser aggregate not enabled', () async { | |||
There was a problem hiding this comment.
formatting only changes in this file
| final globalLanguageVersion = Version.parse( | ||
| Platform.version.split(' ').first, | ||
| ); | ||
| final contents = DartFormatter(languageVersion: globalLanguageVersion) |
There was a problem hiding this comment.
DartFormatter requires the languageVersion now, so pass in the current SDK version we are running on.
| import 'package:dart_style/dart_style.dart'; | ||
| import 'package:glob/glob.dart'; | ||
| import 'package:path/path.dart' as p; | ||
| import 'package:pub_semver/pub_semver.dart'; |
There was a problem hiding this comment.
We'll need Platform and Version from dart:io and pub_sember later on. Mostly formatting changes in this file. I've noted the one place below that isn't.
.github/workflows/dart_ci.yaml
Outdated
| sdk: 2.19.6 | ||
| - run: dart format --set-exit-if-changed -o none . | ||
| sdk: 3.11.0 | ||
| - run: dart run dart_style:format --set-exit-if-changed -o none . |
There was a problem hiding this comment.
Why do we use dart_style to format instead of dart format?
There was a problem hiding this comment.
I was hitting this problem where CI would fail with formatting changes that I could not reproduce locally. Turns out I think I was missing a pub get / upgrade before checking formatting. Adding that seems to keep things consistent local vs CI, so I pushed that change.
test/lib/template_builder_test.dart
Outdated
| final config = TestHtmlBuilderConfig(templates: { | ||
| 'test/template.html': ['test/**_test.dart'], | ||
| }); | ||
| test('does not output .html if template cannot be read', () async { |
There was a problem hiding this comment.
Does this change come from how the analyzer or build_runner works on latest version? It just doesn't output rather than failing the build?
| with: | ||
| sdk: 2.19.6 | ||
| sdk: 3.11.0 | ||
| - run: dart pub upgrade |
There was a problem hiding this comment.
format before format check is needed for consistency between CI/local

Summary
This pull request upgrades the codebase to support Dart 3.11 and updates dependencies, CI configuration, and code formatting to align with the latest Dart ecosystem standards.
Dart SDK and Dependency Upgrades:
pubspec.yamlandexample/project/pubspec.yamlto require Dart 3.0.0 or later, and upgraded all relevant dependencies to their Dart 3-compatible versions. [1] [2]Formatting and Linting:
dart_styledirectly and updated formatting configuration inanalysis_options.yaml. [1] [2]Code Modernization and Style Improvements:
lib/src/builder.dartandlib/src/config.dartto match new Dart formattingTest and Example Configuration: