diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 5f2711853..a23aee7a9 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -1,4 +1,4 @@ -# Created with package:mono_repo v6.5.7 +# Created with package:mono_repo v6.6.1 name: Dart CI on: push: @@ -36,7 +36,7 @@ jobs: name: Checkout repository uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 - name: mono_repo self validate - run: dart pub global activate mono_repo 6.5.7 + run: dart pub global activate mono_repo 6.6.1 - name: mono_repo self validate run: dart pub global run mono_repo generate --validate job_002: diff --git a/build_web_compilers/CHANGELOG.md b/build_web_compilers/CHANGELOG.md index dbe0f20fc..d09d7ef39 100644 --- a/build_web_compilers/CHANGELOG.md +++ b/build_web_compilers/CHANGELOG.md @@ -1,3 +1,8 @@ +## 4.0.7 + +- Support `dart:js_interop_unsafe`. +- Require Dart 3.1 or greater. + ## 4.0.6 - Allow version 3.3.x of the Dart SDK. diff --git a/build_web_compilers/lib/src/platforms.dart b/build_web_compilers/lib/src/platforms.dart index f96dcd425..c36a0a6b9 100644 --- a/build_web_compilers/lib/src/platforms.dart +++ b/build_web_compilers/lib/src/platforms.dart @@ -16,6 +16,7 @@ const _libraries = [ 'indexed_db', 'js', 'js_interop', + 'js_interop_unsafe', 'js_util', 'math', 'svg', diff --git a/build_web_compilers/lib/src/web_entrypoint_builder.dart b/build_web_compilers/lib/src/web_entrypoint_builder.dart index 9f5be8516..99f3a4e53 100644 --- a/build_web_compilers/lib/src/web_entrypoint_builder.dart +++ b/build_web_compilers/lib/src/web_entrypoint_builder.dart @@ -72,18 +72,12 @@ class WebEntrypointBuilder implements Builder { deprecatedOptions: _deprecatedOptions); var compilerOption = options.config[_compilerOption] as String? ?? 'dartdevc'; - WebCompiler compiler; - switch (compilerOption) { - case 'dartdevc': - compiler = WebCompiler.DartDevc; - break; - case 'dart2js': - compiler = WebCompiler.Dart2Js; - break; - default: - throw ArgumentError.value(compilerOption, _compilerOption, - 'Only `dartdevc` and `dart2js` are supported.'); - } + var compiler = switch (compilerOption) { + 'dartdevc' => WebCompiler.DartDevc, + 'dart2js' => WebCompiler.Dart2Js, + _ => throw ArgumentError.value(compilerOption, _compilerOption, + 'Only `dartdevc` and `dart2js` are supported.') + }; if (options.config[_dart2jsArgsOption] is! List) { var message = options.config[_dart2jsArgsOption] is String diff --git a/build_web_compilers/pubspec.yaml b/build_web_compilers/pubspec.yaml index dc284d204..159792ad5 100644 --- a/build_web_compilers/pubspec.yaml +++ b/build_web_compilers/pubspec.yaml @@ -1,10 +1,10 @@ name: build_web_compilers -version: 4.0.6 +version: 4.0.7 description: Builder implementations wrapping the dart2js and DDC compilers. repository: https://github.com/dart-lang/build/tree/master/build_web_compilers environment: - sdk: '>=3.0.0 <3.4.0' + sdk: '>=3.1.0 <3.4.0' dependencies: analyzer: '>=5.1.0 <7.0.0' diff --git a/tool/ci.sh b/tool/ci.sh index 2ce7d296a..3f9d41078 100755 --- a/tool/ci.sh +++ b/tool/ci.sh @@ -1,9 +1,10 @@ #!/bin/bash -# Created with package:mono_repo v6.5.7 +# Created with package:mono_repo v6.6.1 # Support built in commands on windows out of the box. + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter pub" is called instead of "dart pub". # This assumes that the Flutter SDK has been installed in a previous step. function pub() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then @@ -12,18 +13,13 @@ function pub() { command dart pub "$@" fi } -# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". -# This assumes that the Flutter SDK has been installed in a previous step. + function format() { - if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then - command flutter format "$@" - else - command dart format "$@" - fi + command dart format "$@" } + # When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") -# then "flutter" is called instead of "pub". +# then "flutter analyze" is called instead of "dart analyze". # This assumes that the Flutter SDK has been installed in a previous step. function analyze() { if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then