From adf6e717df42e96eae9cea77e473a96cbfde1100 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Thu, 12 Dec 2024 03:00:16 +0800 Subject: [PATCH] Update versions and constraints for Dart 3.6 (#6268) --- examples/analysis/pubspec.yaml | 2 +- examples/analysis_alt/pubspec.yaml | 2 +- examples/analysis_options.yaml | 1 + examples/async_await/pubspec.yaml | 2 +- examples/build_runner_usage/pubspec.yaml | 4 +- examples/cli/pubspec.yaml | 2 +- examples/concurrency/pubspec.yaml | 2 +- examples/create_libraries/pubspec.yaml | 2 +- examples/extension_methods/pubspec.yaml | 2 +- examples/fetch_data/pubspec.yaml | 2 +- examples/futures/pubspec.yaml | 2 +- examples/html/pubspec.yaml | 2 +- examples/iterables/pubspec.yaml | 2 +- examples/language/pubspec.yaml | 2 +- examples/misc/pubspec.yaml | 2 +- examples/non_promotion/pubspec.yaml | 2 +- examples/pubspec.yaml | 3 +- examples/type_system/pubspec.yaml | 2 +- examples/util/pubspec.yaml | 2 +- examples/vector_victor/pubspec.yaml | 2 +- pubspec.yaml | 4 +- src/_data/site.yml | 2 +- src/content/effective-dart/documentation.md | 2 +- src/content/tools/build_runner.md | 2 +- src/content/tools/pub/dependencies.md | 2 +- src/content/tools/pub/packages.md | 6 +-- src/content/tools/webdev.md | 2 +- src/content/tutorials/server/cmdline.md | 4 +- tool/config/site_variable_scanner.yaml | 3 +- .../lib/src/commands/analyze_dart.dart | 47 ++++++------------- tool/dart_site/pubspec.yaml | 6 +-- tool/get-dart/archive/pubspec.yaml | 4 +- tool/get-dart/dart_sdk_archive/pubspec.yaml | 8 ++-- tool/get-dart/pubspec.yaml | 3 +- tool/get-dart/sdk_builds/pubspec.yaml | 2 +- 35 files changed, 63 insertions(+), 76 deletions(-) diff --git a/examples/analysis/pubspec.yaml b/examples/analysis/pubspec.yaml index 2ba9bd1f81..872fcd2eee 100644 --- a/examples/analysis/pubspec.yaml +++ b/examples/analysis/pubspec.yaml @@ -3,7 +3,7 @@ description: dart.dev example code. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: examples_util: {path: ../util} diff --git a/examples/analysis_alt/pubspec.yaml b/examples/analysis_alt/pubspec.yaml index 4986e3b6d3..42ca4573d9 100644 --- a/examples/analysis_alt/pubspec.yaml +++ b/examples/analysis_alt/pubspec.yaml @@ -3,4 +3,4 @@ description: dart.dev example code. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 diff --git a/examples/analysis_options.yaml b/examples/analysis_options.yaml index 2773ca43db..9032a094cc 100644 --- a/examples/analysis_options.yaml +++ b/examples/analysis_options.yaml @@ -28,3 +28,4 @@ linter: - unnecessary_library_directive - unnecessary_null_aware_operator_on_extension_on_nullable - use_enums + - use_truncating_division diff --git a/examples/async_await/pubspec.yaml b/examples/async_await/pubspec.yaml index d2bf1d7905..d37ad55fd9 100644 --- a/examples/async_await/pubspec.yaml +++ b/examples/async_await/pubspec.yaml @@ -3,7 +3,7 @@ description: dart.dev example code. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: examples_util: {path: ../util} diff --git a/examples/build_runner_usage/pubspec.yaml b/examples/build_runner_usage/pubspec.yaml index 926eb66490..7ece9c0850 100644 --- a/examples/build_runner_usage/pubspec.yaml +++ b/examples/build_runner_usage/pubspec.yaml @@ -3,9 +3,9 @@ description: dart.dev build_runner example code. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dev_dependencies: args: ^2.5.0 - build_runner: ^2.4.12 + build_runner: ^2.4.13 build_test: ^2.2.2 diff --git a/examples/cli/pubspec.yaml b/examples/cli/pubspec.yaml index 7de784625f..65b3888014 100644 --- a/examples/cli/pubspec.yaml +++ b/examples/cli/pubspec.yaml @@ -3,7 +3,7 @@ description: Examples for CLI tutorials on dart.dev resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: args: ^2.5.0 diff --git a/examples/concurrency/pubspec.yaml b/examples/concurrency/pubspec.yaml index 28361c8c86..68dec19db8 100644 --- a/examples/concurrency/pubspec.yaml +++ b/examples/concurrency/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: http: any diff --git a/examples/create_libraries/pubspec.yaml b/examples/create_libraries/pubspec.yaml index 41cbedfbea..be4f5d01ca 100644 --- a/examples/create_libraries/pubspec.yaml +++ b/examples/create_libraries/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dev_dependencies: test: ^1.25.8 diff --git a/examples/extension_methods/pubspec.yaml b/examples/extension_methods/pubspec.yaml index 32de04ef12..027319999a 100644 --- a/examples/extension_methods/pubspec.yaml +++ b/examples/extension_methods/pubspec.yaml @@ -4,7 +4,7 @@ version: 1.0.0 resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dev_dependencies: test: ^1.25.8 diff --git a/examples/fetch_data/pubspec.yaml b/examples/fetch_data/pubspec.yaml index d177ba83a1..421de093c5 100644 --- a/examples/fetch_data/pubspec.yaml +++ b/examples/fetch_data/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: http: ^1.2.2 diff --git a/examples/futures/pubspec.yaml b/examples/futures/pubspec.yaml index 19e5d94c64..0188006662 100644 --- a/examples/futures/pubspec.yaml +++ b/examples/futures/pubspec.yaml @@ -5,7 +5,7 @@ publish_to: none resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: examples_util: {path: ../util} diff --git a/examples/html/pubspec.yaml b/examples/html/pubspec.yaml index 1271da4170..1f665528c8 100644 --- a/examples/html/pubspec.yaml +++ b/examples/html/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dev_dependencies: test: ^1.25.8 diff --git a/examples/iterables/pubspec.yaml b/examples/iterables/pubspec.yaml index d606af2dc3..f693fab929 100644 --- a/examples/iterables/pubspec.yaml +++ b/examples/iterables/pubspec.yaml @@ -3,7 +3,7 @@ description: dart.dev example code. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dev_dependencies: examples_util: {path: ../util} diff --git a/examples/language/pubspec.yaml b/examples/language/pubspec.yaml index 6f8ea3651f..f367d92378 100644 --- a/examples/language/pubspec.yaml +++ b/examples/language/pubspec.yaml @@ -3,7 +3,7 @@ description: dart.dev example code. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: examples_util: { path: ../util } diff --git a/examples/misc/pubspec.yaml b/examples/misc/pubspec.yaml index c7f2104140..c27ffea177 100644 --- a/examples/misc/pubspec.yaml +++ b/examples/misc/pubspec.yaml @@ -3,7 +3,7 @@ description: dart.dev example code. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: args: ^2.5.0 diff --git a/examples/non_promotion/pubspec.yaml b/examples/non_promotion/pubspec.yaml index 6c84fef9ee..6994fdb3f9 100644 --- a/examples/non_promotion/pubspec.yaml +++ b/examples/non_promotion/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.1 resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: mockito: ^5.4.4 diff --git a/examples/pubspec.yaml b/examples/pubspec.yaml index 45732f8052..e5eff83499 100644 --- a/examples/pubspec.yaml +++ b/examples/pubspec.yaml @@ -1,8 +1,9 @@ name: examples_workspace publish_to: none +resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 workspace: - analysis diff --git a/examples/type_system/pubspec.yaml b/examples/type_system/pubspec.yaml index 9c0c54c9b6..2cec7e7cf1 100644 --- a/examples/type_system/pubspec.yaml +++ b/examples/type_system/pubspec.yaml @@ -3,7 +3,7 @@ description: dart.dev type system examples. resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: examples_util: {path: ../util} diff --git a/examples/util/pubspec.yaml b/examples/util/pubspec.yaml index 351e6149f9..bf3bc17d75 100644 --- a/examples/util/pubspec.yaml +++ b/examples/util/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.0.2 resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: test: ^1.25.8 diff --git a/examples/vector_victor/pubspec.yaml b/examples/vector_victor/pubspec.yaml index 642891b033..ee70122dc0 100644 --- a/examples/vector_victor/pubspec.yaml +++ b/examples/vector_victor/pubspec.yaml @@ -5,7 +5,7 @@ version: 1.0.0 resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 # dependencies: # path: ^1.8.0 diff --git a/pubspec.yaml b/pubspec.yaml index bba13a86f9..b7b38f13d2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,10 +3,12 @@ publish_to: none homepage: https://dart.dev environment: - sdk: ^3.5.3 + sdk: ^3.6.0 workspace: - tool/dart_site + - examples + - tool/get-dart dev_dependencies: dart_site: diff --git a/src/_data/site.yml b/src/_data/site.yml index 7b962dc8f9..9872ff5173 100644 --- a/src/_data/site.yml +++ b/src/_data/site.yml @@ -40,4 +40,4 @@ show_banner: true # in the `firebase.json` redirect rule.) og_image_vers: "?2" -sdkVersion: 3.5.4 +sdkVersion: 3.6.0 diff --git a/src/content/effective-dart/documentation.md b/src/content/effective-dart/documentation.md index b7d0e8d29c..1432e85a0b 100644 --- a/src/content/effective-dart/documentation.md +++ b/src/content/effective-dart/documentation.md @@ -101,7 +101,7 @@ up. ### PREFER writing doc comments for public APIs -{% render 'linter-rule-mention.md', rules:'package_api_docs, public_member_api_docs' %} +{% render 'linter-rule-mention.md', rules:'public_member_api_docs' %} You don't have to document every single library, top-level variable, type, and member, but you should document most of them. diff --git a/src/content/tools/build_runner.md b/src/content/tools/build_runner.md index c98fb9994a..85a250e4a7 100644 --- a/src/content/tools/build_runner.md +++ b/src/content/tools/build_runner.md @@ -38,7 +38,7 @@ to your app's pubspec: ```yaml dev_dependencies: # ··· - build_runner: ^2.4.12 + build_runner: ^2.4.13 build_test: ^2.2.2 ``` diff --git a/src/content/tools/pub/dependencies.md b/src/content/tools/pub/dependencies.md index e6c7812b78..fea5a532a5 100644 --- a/src/content/tools/pub/dependencies.md +++ b/src/content/tools/pub/dependencies.md @@ -472,7 +472,7 @@ resemble the following: ```yaml dev_dependencies: - build_runner: ^2.4.12 + build_runner: ^2.4.13 lints: ^2.1.1 test: ^1.25.8 ``` diff --git a/src/content/tools/pub/packages.md b/src/content/tools/pub/packages.md index 6019984918..bc5c5a49e9 100644 --- a/src/content/tools/pub/packages.md +++ b/src/content/tools/pub/packages.md @@ -44,14 +44,14 @@ name: my_app ``` Here is an example of a pubspec that declares dependencies on -two packages (`js` and `intl`) that are hosted on the pub.dev site: +two packages (`intl` and `path`) that are hosted on the pub.dev site: ```yaml name: my_app dependencies: - js: ^0.6.0 - intl: ^0.17.0 + intl: ^0.20.0 + path: ^1.9.1 ``` To update the `pubspec.yaml` file, without manual editing, diff --git a/src/content/tools/webdev.md b/src/content/tools/webdev.md index d8964888d3..c7629af444 100644 --- a/src/content/tools/webdev.md +++ b/src/content/tools/webdev.md @@ -44,7 +44,7 @@ your app's `pubspec.yaml` file: ```yaml dev_dependencies: # ··· - build_runner: ^2.4.12 + build_runner: ^2.4.13 build_test: ^2.2.2 build_web_compilers: ^4.0.11 ``` diff --git a/src/content/tutorials/server/cmdline.md b/src/content/tutorials/server/cmdline.md index db8ae40035..6ce6cca8cd 100644 --- a/src/content/tutorials/server/cmdline.md +++ b/src/content/tutorials/server/cmdline.md @@ -190,7 +190,7 @@ $ dart run bin/dcat.dart -n pubspec.yaml 4 # repository: https://github.com/my_org/my_repo 5 6 environment: -7 sdk: ^3.5.4 +7 sdk: ^3.6.0 8 9 # Add regular dependencies here. 10 dependencies: @@ -198,7 +198,7 @@ $ dart run bin/dcat.dart -n pubspec.yaml 12 # path: ^1.8.0 13 14 dev_dependencies: -15 lints: ^4.0.0 +15 lints: ^5.0.0 16 test: ^1.24.0 ``` diff --git a/tool/config/site_variable_scanner.yaml b/tool/config/site_variable_scanner.yaml index d5aa392c70..ed7ca86eac 100644 --- a/tool/config/site_variable_scanner.yaml +++ b/tool/config/site_variable_scanner.yaml @@ -21,8 +21,9 @@ yaml_variable_scanner: - ^site\.url$ - ^site\.branch$ - ^site\.show_banner$ + - ^site\.sdkVersion$ - ^site\.og_image_vers$ - + # File path for check file contents # # (Glob Syntax) diff --git a/tool/dart_site/lib/src/commands/analyze_dart.dart b/tool/dart_site/lib/src/commands/analyze_dart.dart index 9937229f44..ccaf178944 100644 --- a/tool/dart_site/lib/src/commands/analyze_dart.dart +++ b/tool/dart_site/lib/src/commands/analyze_dart.dart @@ -5,7 +5,6 @@ import 'dart:io'; import 'package:args/command_runner.dart'; -import 'package:path/path.dart' as path; import '../utils.dart'; @@ -35,44 +34,26 @@ final class AnalyzeDartCommand extends Command { int analyzeDart({ bool verboseLogging = false, }) { - final directoriesToAnalyze = [ - path.join('tool', 'dart_site'), - path.join('examples'), - path.join('tool', 'get-dart'), - ]; - if (!verboseLogging) { print('Analyzing code...'); } - for (final directory in directoriesToAnalyze) { - if (verboseLogging) { - print("Analyzing code in '$directory' directory..."); - } - - if (runPubGetIfNecessary(directory) case final pubGetResult - when pubGetResult != 0) { - return pubGetResult; - } - - final dartAnalyzeOutput = Process.runSync( - Platform.executable, - const ['analyze', '.'], - workingDirectory: directory, - ); + final dartAnalyzeOutput = Process.runSync( + Platform.executable, + const ['analyze'], + ); - if (dartAnalyzeOutput.exitCode != 0) { - final normalOutput = dartAnalyzeOutput.stdout.toString(); - final errorOutput = dartAnalyzeOutput.stderr.toString(); + if (dartAnalyzeOutput.exitCode != 0) { + final normalOutput = dartAnalyzeOutput.stdout.toString(); + final errorOutput = dartAnalyzeOutput.stderr.toString(); - stderr.write(normalOutput); - stderr.write(errorOutput); - stderr.writeln("Error: Analysis on '$directory' directory failed."); - return 1; - } else { - if (verboseLogging) { - print("Successfully analyzed code in '$directory' directory!"); - } + stderr.write(normalOutput); + stderr.write(errorOutput); + stderr.writeln('Error: Analysis failed.'); + return 1; + } else { + if (verboseLogging) { + print('Successfully analyzed Dart code!'); } } diff --git a/tool/dart_site/pubspec.yaml b/tool/dart_site/pubspec.yaml index 29e8ef2edf..4c0a868bb7 100644 --- a/tool/dart_site/pubspec.yaml +++ b/tool/dart_site/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: args: ^2.5.0 @@ -12,8 +12,8 @@ dependencies: path: ../../site-shared/pkgs/excerpter fbh_front_matter: ^0.0.1 html_unescape: ^2.0.0 - intl: ^0.19.0 - io: ^1.0.4 + intl: ^0.20.0 + io: ^1.0.5 linkcheck: ^3.0.0 markdown: ^7.2.2 path: ^1.9.0 diff --git a/tool/get-dart/archive/pubspec.yaml b/tool/get-dart/archive/pubspec.yaml index 03163b71d6..99597a7063 100644 --- a/tool/get-dart/archive/pubspec.yaml +++ b/tool/get-dart/archive/pubspec.yaml @@ -4,12 +4,12 @@ publish_to: none resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: dart_sdk_archive: path: ../dart_sdk_archive dev_dependencies: - build_runner: ^2.4.12 + build_runner: ^2.4.13 build_web_compilers: ^4.0.11 diff --git a/tool/get-dart/dart_sdk_archive/pubspec.yaml b/tool/get-dart/dart_sdk_archive/pubspec.yaml index 83e905c0cb..4491468db5 100644 --- a/tool/get-dart/dart_sdk_archive/pubspec.yaml +++ b/tool/get-dart/dart_sdk_archive/pubspec.yaml @@ -4,19 +4,19 @@ publish_to: none resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: http: ^1.2.2 - intl: ^0.19.0 + intl: ^0.20.0 path: ^1.9.0 pub_semver: ^2.1.4 sdk_builds: path: ../sdk_builds - web: ^1.0.0 + web: ^1.1.0 dev_dependencies: - build_runner: ^2.4.12 + build_runner: ^2.4.13 build_web_compilers: ^4.0.11 dart_style: ^2.3.7 grinder: ^0.9.5 diff --git a/tool/get-dart/pubspec.yaml b/tool/get-dart/pubspec.yaml index 15b7aa1fe1..18c8b341b4 100644 --- a/tool/get-dart/pubspec.yaml +++ b/tool/get-dart/pubspec.yaml @@ -1,8 +1,9 @@ name: get_dart publish_to: none +resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 workspace: - archive diff --git a/tool/get-dart/sdk_builds/pubspec.yaml b/tool/get-dart/sdk_builds/pubspec.yaml index 9bdbe94e56..1fc87eff03 100644 --- a/tool/get-dart/sdk_builds/pubspec.yaml +++ b/tool/get-dart/sdk_builds/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: none resolution: workspace environment: - sdk: ^3.5.3 + sdk: ^3.6.0 dependencies: googleapis: ^13.2.0