From 52063752102caa90b7cf3f2dbedd5f51fb2b6350 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Sat, 11 Jan 2025 20:34:26 -0800 Subject: [PATCH] File I'm at it... --- .github/workflows/bazel_worker.yaml | 4 +- .github/workflows/benchmark_harness.yaml | 4 +- .github/workflows/boolean_selector.yaml | 4 +- .github/workflows/browser_launcher.yaml | 4 +- .../{cli_config.yml => cli_config.yaml} | 10 +- .github/workflows/cli_util.yaml | 4 +- .github/workflows/code_builder.yaml | 4 +- .../workflows/{coverage.yml => coverage.yaml} | 4 +- .github/workflows/csslib.yaml | 4 +- ...discovery.yml => extension_discovery.yaml} | 4 +- .github/workflows/{file.yml => file.yaml} | 34 +++---- .github/workflows/file_testing.yaml | 54 +++++++++++ .github/workflows/{graphs.yml => graphs.yaml} | 4 +- .github/workflows/html.yaml | 4 +- .github/workflows/io.yaml | 4 +- .github/workflows/json_rpc_2.yaml | 4 +- .github/workflows/{mime.yml => mime.yaml} | 4 +- .github/workflows/{oauth2.yml => oauth2.yaml} | 4 +- .github/workflows/package_config.yaml | 4 +- ..._trace.yml => source_map_stack_trace.yaml} | 4 +- .github/workflows/source_span.yaml | 4 +- .github/workflows/string_scanner.yaml | 75 +++++++++++++++ ...d_analytics.yml => unified_analytics.yaml} | 4 +- README.md | 5 +- tool/.dart_tool/package_config.json | 83 +++++++++++++++++ tool/pubspec.lock | 93 +++++++++++++++++++ tool/pubspec.yaml | 8 ++ tool/readme_update.dart | 62 +++++++++++++ 28 files changed, 431 insertions(+), 69 deletions(-) rename .github/workflows/{cli_config.yml => cli_config.yaml} (93%) rename .github/workflows/{coverage.yml => coverage.yaml} (97%) rename .github/workflows/{extension_discovery.yml => extension_discovery.yaml} (91%) rename .github/workflows/{file.yml => file.yaml} (52%) create mode 100644 .github/workflows/file_testing.yaml rename .github/workflows/{graphs.yml => graphs.yaml} (91%) rename .github/workflows/{mime.yml => mime.yaml} (92%) rename .github/workflows/{oauth2.yml => oauth2.yaml} (96%) rename .github/workflows/{source_map_stack_trace.yml => source_map_stack_trace.yaml} (95%) create mode 100644 .github/workflows/string_scanner.yaml rename .github/workflows/{unified_analytics.yml => unified_analytics.yaml} (90%) create mode 100644 tool/.dart_tool/package_config.json create mode 100644 tool/pubspec.lock create mode 100644 tool/pubspec.yaml create mode 100644 tool/readme_update.dart diff --git a/.github/workflows/bazel_worker.yaml b/.github/workflows/bazel_worker.yaml index b448219d1..44467933f 100644 --- a/.github/workflows/bazel_worker.yaml +++ b/.github/workflows/bazel_worker.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/bazel_worker.yml' + - '.github/workflows/bazel_worker.yaml' - 'pkgs/bazel_worker/**' pull_request: branches: [ main ] paths: - - '.github/workflows/bazel_worker.yml' + - '.github/workflows/bazel_worker.yaml' - 'pkgs/bazel_worker/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/benchmark_harness.yaml b/.github/workflows/benchmark_harness.yaml index 8e0cc8a7e..04a58299b 100644 --- a/.github/workflows/benchmark_harness.yaml +++ b/.github/workflows/benchmark_harness.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/benchmark_harness.yml' + - '.github/workflows/benchmark_harness.yaml' - 'pkgs/benchmark_harness/**' pull_request: branches: [ main ] paths: - - '.github/workflows/benchmark_harness.yml' + - '.github/workflows/benchmark_harness.yaml' - 'pkgs/benchmark_harness/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/boolean_selector.yaml b/.github/workflows/boolean_selector.yaml index 3e35050c1..4a74aed2c 100644 --- a/.github/workflows/boolean_selector.yaml +++ b/.github/workflows/boolean_selector.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/boolean_selector.yml' + - '.github/workflows/boolean_selector.yaml' - 'pkgs/boolean_selector/**' pull_request: branches: [ main ] paths: - - '.github/workflows/boolean_selector.yml' + - '.github/workflows/boolean_selector.yaml' - 'pkgs/boolean_selector/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/browser_launcher.yaml b/.github/workflows/browser_launcher.yaml index 41bf8da3e..699cac624 100644 --- a/.github/workflows/browser_launcher.yaml +++ b/.github/workflows/browser_launcher.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/browser_launcher.yml' + - '.github/workflows/browser_launcher.yaml' - 'pkgs/browser_launcher/**' pull_request: branches: [ main ] paths: - - '.github/workflows/browser_launcher.yml' + - '.github/workflows/browser_launcher.yaml' - 'pkgs/browser_launcher/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/cli_config.yml b/.github/workflows/cli_config.yaml similarity index 93% rename from .github/workflows/cli_config.yml rename to .github/workflows/cli_config.yaml index 0ef152423..980df5cf1 100644 --- a/.github/workflows/cli_config.yml +++ b/.github/workflows/cli_config.yaml @@ -14,12 +14,13 @@ on: schedule: - cron: "0 0 * * 0" # weekly +defaults: + run: + working-directory: pkgs/cli_config/ + jobs: build_linux: runs-on: ubuntu-latest - defaults: - run: - working-directory: pkgs/cli_config strategy: matrix: sdk: [stable, dev] # {pkgs.versions} @@ -58,9 +59,6 @@ jobs: build_windows: runs-on: windows-latest - defaults: - run: - working-directory: pkgs/cli_config strategy: matrix: sdk: [stable, dev] # {pkgs.versions} diff --git a/.github/workflows/cli_util.yaml b/.github/workflows/cli_util.yaml index 1c9fec01b..69aae5eba 100644 --- a/.github/workflows/cli_util.yaml +++ b/.github/workflows/cli_util.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/cli_util.yml' + - '.github/workflows/cli_util.yaml' - 'pkgs/cli_util/**' pull_request: branches: [ main ] paths: - - '.github/workflows/cli_util.yml' + - '.github/workflows/cli_util.yaml' - 'pkgs/cli_util/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/code_builder.yaml b/.github/workflows/code_builder.yaml index 2b2ad1679..a0d3ec298 100644 --- a/.github/workflows/code_builder.yaml +++ b/.github/workflows/code_builder.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/code_builder.yml' + - '.github/workflows/code_builder.yaml' - 'pkgs/code_builder/**' pull_request: branches: [ main ] paths: - - '.github/workflows/code_builder.yml' + - '.github/workflows/code_builder.yaml' - 'pkgs/code_builder/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yaml similarity index 97% rename from .github/workflows/coverage.yml rename to .github/workflows/coverage.yaml index dd3f03f67..2252b9497 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/coverage.yml' + - '.github/workflows/coverage.yaml' - 'pkgs/coverage/**' pull_request: branches: [ main ] paths: - - '.github/workflows/coverage.yml' + - '.github/workflows/coverage.yaml' - 'pkgs/coverage/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/csslib.yaml b/.github/workflows/csslib.yaml index c3702932c..3ce2cd98d 100644 --- a/.github/workflows/csslib.yaml +++ b/.github/workflows/csslib.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/csslib.yml' + - '.github/workflows/csslib.yaml' - 'pkgs/csslib/**' pull_request: branches: [ main ] paths: - - '.github/workflows/csslib.yml' + - '.github/workflows/csslib.yaml' - 'pkgs/csslib/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/extension_discovery.yml b/.github/workflows/extension_discovery.yaml similarity index 91% rename from .github/workflows/extension_discovery.yml rename to .github/workflows/extension_discovery.yaml index dd129a7ba..6a6d5d7dd 100644 --- a/.github/workflows/extension_discovery.yml +++ b/.github/workflows/extension_discovery.yaml @@ -4,12 +4,12 @@ permissions: read-all on: pull_request: paths: - - '.github/workflows/unified_analytics.yml' + - '.github/workflows/extension_discovery.yaml' - 'pkgs/extension_discovery/**' push: branches: [ main ] paths: - - '.github/workflows/extension_discovery.yml' + - '.github/workflows/extension_discovery.yaml' - 'pkgs/extension_discovery/**' schedule: - cron: '0 0 * * 0' # weekly diff --git a/.github/workflows/file.yml b/.github/workflows/file.yaml similarity index 52% rename from .github/workflows/file.yml rename to .github/workflows/file.yaml index e8c3bff78..3254f2e3a 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yaml @@ -6,24 +6,25 @@ on: push: branches: [ main ] paths: - - '.github/workflows/file.yml' + - '.github/workflows/file.yaml' - 'pkgs/file/**' - 'pkgs/file_testing/**' pull_request: branches: [ main ] paths: - - '.github/workflows/file.yml' + - '.github/workflows/file.yaml' - 'pkgs/file/**' - 'pkgs/file_testing/**' schedule: - cron: "0 0 * * 0" +defaults: + run: + working-directory: pkgs/file/ + jobs: correctness: runs-on: ubuntu-latest - strategy: - matrix: - package: [file, file_testing] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 @@ -31,17 +32,9 @@ jobs: with: sdk: dev - - name: Install ${{ matrix.package }} dependencies - working-directory: pkgs/${{ matrix.package }} - run: dart pub get - - - name: Verify formatting in ${{ matrix.package }} - working-directory: pkgs/${{ matrix.package }} - run: dart format --output=none --set-exit-if-changed . - - - name: Analyze package ${{ matrix.package }} source - working-directory: pkgs/${{ matrix.package }} - run: dart analyze --fatal-infos + - run: dart pub get + - run: dart format --output=none --set-exit-if-changed . + - run: dart analyze --fatal-infos test: runs-on: ${{ matrix.os }} @@ -57,10 +50,5 @@ jobs: with: sdk: ${{ matrix.sdk }} - - name: Install ${{ matrix.package }} dependencies - working-directory: pkgs/${{ matrix.package }} - run: dart pub get - - - name: Run ${{ matrix.package }} Tests - working-directory: pkgs/${{ matrix.package }} - run: dart pub run test -j1 + - run: dart pub get + - run: dart pub run test -j1 diff --git a/.github/workflows/file_testing.yaml b/.github/workflows/file_testing.yaml new file mode 100644 index 000000000..1e4cc5d73 --- /dev/null +++ b/.github/workflows/file_testing.yaml @@ -0,0 +1,54 @@ +name: package:file_testing +permissions: read-all + +on: + # Run on PRs and pushes to the default branch. + push: + branches: [ main ] + paths: + - '.github/workflows/file_testing.yaml' + - 'pkgs/file/**' + - 'pkgs/file_testing/**' + pull_request: + branches: [ main ] + paths: + - '.github/workflows/file_testing.yaml' + - 'pkgs/file/**' + - 'pkgs/file_testing/**' + schedule: + - cron: "0 0 * * 0" + +defaults: + run: + working-directory: pkgs/file_testing/ + +jobs: + correctness: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 + with: + sdk: dev + + - run: dart pub get + - run: dart format --output=none --set-exit-if-changed . + - run: dart analyze --fatal-infos + + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + package: [file] + os: [ubuntu-latest, macos-latest, windows-latest] + sdk: [stable, dev] + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 + with: + sdk: ${{ matrix.sdk }} + + - run: dart pub get + + - run: dart pub run test -j1 diff --git a/.github/workflows/graphs.yml b/.github/workflows/graphs.yaml similarity index 91% rename from .github/workflows/graphs.yml rename to .github/workflows/graphs.yaml index c86ebb187..a3b3733b2 100644 --- a/.github/workflows/graphs.yml +++ b/.github/workflows/graphs.yaml @@ -6,12 +6,12 @@ on: # Run CI on all PRs (against any branch) and on pushes to the main branch. pull_request: paths: - - '.github/workflows/graphs.yml' + - '.github/workflows/graphs.yaml' - 'pkgs/graphs/**' push: branches: [ main ] paths: - - '.github/workflows/graphs.yml' + - '.github/workflows/graphs.yaml' - 'pkgs/graphs/**' schedule: - cron: '0 0 * * 0' # weekly diff --git a/.github/workflows/html.yaml b/.github/workflows/html.yaml index e4eb9fab8..e777b79c0 100644 --- a/.github/workflows/html.yaml +++ b/.github/workflows/html.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/html.yml' + - '.github/workflows/html.yaml' - 'pkgs/html/**' pull_request: branches: [ main ] paths: - - '.github/workflows/html.yml' + - '.github/workflows/html.yaml' - 'pkgs/html/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/io.yaml b/.github/workflows/io.yaml index 0c719a6bf..7733cd655 100644 --- a/.github/workflows/io.yaml +++ b/.github/workflows/io.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/io.yml' + - '.github/workflows/io.yaml' - 'pkgs/io/**' pull_request: branches: [ main ] paths: - - '.github/workflows/io.yml' + - '.github/workflows/io.yaml' - 'pkgs/io/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/json_rpc_2.yaml b/.github/workflows/json_rpc_2.yaml index c5b0883f8..276a4d729 100644 --- a/.github/workflows/json_rpc_2.yaml +++ b/.github/workflows/json_rpc_2.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/json_rpc_2.yml' + - '.github/workflows/json_rpc_2.yaml' - 'pkgs/json_rpc_2/**' pull_request: branches: [ main ] paths: - - '.github/workflows/json_rpc_2.yml' + - '.github/workflows/json_rpc_2.yaml' - 'pkgs/json_rpc_2/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/mime.yml b/.github/workflows/mime.yaml similarity index 92% rename from .github/workflows/mime.yml rename to .github/workflows/mime.yaml index b7a6473fc..9e49f0efe 100644 --- a/.github/workflows/mime.yml +++ b/.github/workflows/mime.yaml @@ -7,12 +7,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/mime.yml' + - '.github/workflows/mime.yaml' - 'pkgs/mime/**' pull_request: branches: [ main ] paths: - - '.github/workflows/mime.yml' + - '.github/workflows/mime.yaml' - 'pkgs/mime/**' jobs: diff --git a/.github/workflows/oauth2.yml b/.github/workflows/oauth2.yaml similarity index 96% rename from .github/workflows/oauth2.yml rename to .github/workflows/oauth2.yaml index 50b22f49c..6de86b557 100644 --- a/.github/workflows/oauth2.yml +++ b/.github/workflows/oauth2.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/oauth2.yml' + - '.github/workflows/oauth2.yaml' - 'pkgs/oauth2/**' pull_request: branches: [ main ] paths: - - '.github/workflows/oauth2.yml' + - '.github/workflows/oauth2.yaml' - 'pkgs/oauth2/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/package_config.yaml b/.github/workflows/package_config.yaml index 416ea1a11..2d028b9ec 100644 --- a/.github/workflows/package_config.yaml +++ b/.github/workflows/package_config.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/package_config.yml' + - '.github/workflows/package_config.yaml' - 'pkgs/package_config/**' pull_request: branches: [ main ] paths: - - '.github/workflows/package_config.yml' + - '.github/workflows/package_config.yaml' - 'pkgs/package_config/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/source_map_stack_trace.yml b/.github/workflows/source_map_stack_trace.yaml similarity index 95% rename from .github/workflows/source_map_stack_trace.yml rename to .github/workflows/source_map_stack_trace.yaml index a0c88d5a0..59cfab1d5 100644 --- a/.github/workflows/source_map_stack_trace.yml +++ b/.github/workflows/source_map_stack_trace.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/source_map_stack_trace.yml' + - '.github/workflows/source_map_stack_trace.yaml' - 'pkgs/source_map_stack_trace/**' pull_request: branches: [ main ] paths: - - '.github/workflows/source_map_stack_trace.yml' + - '.github/workflows/source_map_stack_trace.yaml' - 'pkgs/source_map_stack_trace/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/source_span.yaml b/.github/workflows/source_span.yaml index 2c2ba0548..422d55e98 100644 --- a/.github/workflows/source_span.yaml +++ b/.github/workflows/source_span.yaml @@ -5,12 +5,12 @@ on: push: branches: [ main ] paths: - - '.github/workflows/source_span.yml' + - '.github/workflows/source_span.yaml' - 'pkgs/source_span/**' pull_request: branches: [ main ] paths: - - '.github/workflows/source_span.yml' + - '.github/workflows/source_span.yaml' - 'pkgs/source_span/**' schedule: - cron: "0 0 * * 0" diff --git a/.github/workflows/string_scanner.yaml b/.github/workflows/string_scanner.yaml new file mode 100644 index 000000000..665883a69 --- /dev/null +++ b/.github/workflows/string_scanner.yaml @@ -0,0 +1,75 @@ +name: package:string_scanner + +on: + # Run on PRs and pushes to the default branch. + push: + branches: [ main ] + paths: + - '.github/workflows/string_scanner.yaml' + - 'pkgs/string_scanner/**' + pull_request: + branches: [ main ] + paths: + - '.github/workflows/string_scanner.yaml' + - 'pkgs/string_scanner/**' + schedule: + - cron: "0 0 * * 0" + +env: + PUB_ENVIRONMENT: bot.github + + +defaults: + run: + working-directory: pkgs/string_scanner/ + +jobs: + # Check code formatting and static analysis on a single OS (linux) + # against Dart dev. + analyze: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sdk: [dev] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 + with: + sdk: ${{ matrix.sdk }} + - id: install + name: Install dependencies + run: dart pub get + - name: Check formatting + run: dart format --output=none --set-exit-if-changed . + if: always() && steps.install.outcome == 'success' + - name: Analyze code + run: dart analyze --fatal-infos + if: always() && steps.install.outcome == 'success' + + # Run tests on a matrix consisting of two dimensions: + # 1. OS: ubuntu-latest, (macos-latest, windows-latest) + # 2. release channel: dev + test: + needs: analyze + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # Add macos-latest and/or windows-latest if relevant for this package. + os: [ubuntu-latest] + sdk: [3.1, dev] + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 + with: + sdk: ${{ matrix.sdk }} + - id: install + name: Install dependencies + run: dart pub get + - name: Run VM tests + run: dart test --platform vm + if: always() && steps.install.outcome == 'success' + - name: Run Chrome tests + run: dart test --platform chrome + if: always() && steps.install.outcome == 'success' diff --git a/.github/workflows/unified_analytics.yml b/.github/workflows/unified_analytics.yaml similarity index 90% rename from .github/workflows/unified_analytics.yml rename to .github/workflows/unified_analytics.yaml index f3b3bf4ac..aa30852d8 100644 --- a/.github/workflows/unified_analytics.yml +++ b/.github/workflows/unified_analytics.yaml @@ -4,12 +4,12 @@ permissions: read-all on: pull_request: paths: - - '.github/workflows/unified_analytics.yml' + - '.github/workflows/unified_analytics.yaml' - 'pkgs/unified_analytics/**' push: branches: [ main ] paths: - - '.github/workflows/unified_analytics.yml' + - '.github/workflows/unified_analytics.yaml' - 'pkgs/unified_analytics/**' schedule: - cron: '0 0 * * 0' # weekly diff --git a/README.md b/README.md index 01702e89d..64871f878 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ don't naturally belong to other topic monorepos (like | [file_testing](pkgs/file_testing/) | Testing utilities for package:file. | [![package issues](https://img.shields.io/badge/package:file_testing-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Afile_testing) | [![pub package](https://img.shields.io/pub/v/file_testing.svg)](https://pub.dev/packages/file_testing) | | [graphs](pkgs/graphs/) | Graph algorithms that operate on graphs in any representation. | [![package issues](https://img.shields.io/badge/package:graphs-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Agraphs) | [![pub package](https://img.shields.io/pub/v/graphs.svg)](https://pub.dev/packages/graphs) | | [html](pkgs/html/) | APIs for parsing and manipulating HTML content outside the browser. | [![package issues](https://img.shields.io/badge/package:html-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ahtml) | [![pub package](https://img.shields.io/pub/v/html.svg)](https://pub.dev/packages/html) | -| [io](pkgs/io/) | Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values. | [![pub package](https://img.shields.io/pub/v/io.svg)](https://pub.dev/packages/io) | +| [io](pkgs/io/) | Utilities for the Dart VM Runtime including support for ANSI colors, file copying, and standard exit code values. | [![package issues](https://img.shields.io/badge/package:io-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aio) | [![pub package](https://img.shields.io/pub/v/io.svg)](https://pub.dev/packages/io) | | [json_rpc_2](pkgs/json_rpc_2/) | Utilities to write a client or server using the JSON-RPC 2.0 spec. | [![package issues](https://img.shields.io/badge/package:json_rpc_2-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ajson_rpc_2) | [![pub package](https://img.shields.io/pub/v/json_rpc_2.svg)](https://pub.dev/packages/json_rpc_2) | | [mime](pkgs/mime/) | Utilities for handling media (MIME) types, including determining a type from a file extension and file contents. | [![package issues](https://img.shields.io/badge/package:mime-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Amime) | [![pub package](https://img.shields.io/pub/v/mime.svg)](https://pub.dev/packages/mime) | | [oauth2](pkgs/oauth2/) | A client library for authenticating with a remote service via OAuth2 on behalf of a user, and making authorized HTTP requests with the user's OAuth2 credentials. | [![package issues](https://img.shields.io/badge/package:oauth2-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aoauth2) | [![pub package](https://img.shields.io/pub/v/oauth2.svg)](https://pub.dev/packages/oauth2) | @@ -44,11 +44,12 @@ don't naturally belong to other topic monorepos (like | [stack_trace](pkgs/stack_trace/) | A package for manipulating stack traces and printing them readably. | [![package issues](https://img.shields.io/badge/package:stack_trace-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Astack_trace) | [![pub package](https://img.shields.io/pub/v/stack_trace.svg)](https://pub.dev/packages/stack_trace) | | [stream_channel](pkgs/stream_channel/) | An abstraction for two-way communication channels based on the Dart Stream class. | [![package issues](https://img.shields.io/badge/package:stream_channel-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Astream_channel) | [![pub package](https://img.shields.io/pub/v/stream_channel.svg)](https://pub.dev/packages/stream_channel) | | [stream_transform](pkgs/stream_transform/) | A collection of utilities to transform and manipulate streams. | [![package issues](https://img.shields.io/badge/package:stream_transform-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Astream_transform) | [![pub package](https://img.shields.io/pub/v/stream_transform.svg)](https://pub.dev/packages/stream_transform) | +| [string_scanner](pkgs/string_scanner/) | A class for parsing strings using a sequence of patterns. | [![package issues](https://img.shields.io/badge/package:string_scanner-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Astring_scanner) | [![pub package](https://img.shields.io/pub/v/string_scanner.svg)](https://pub.dev/packages/string_scanner) | | [term_glyph](pkgs/term_glyph/) | Useful Unicode glyphs and ASCII substitutes. | [![package issues](https://img.shields.io/badge/package:term_glyph-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aterm_glyph) | [![pub package](https://img.shields.io/pub/v/term_glyph.svg)](https://pub.dev/packages/term_glyph) | | [test_reflective_loader](pkgs/test_reflective_loader/) | Support for discovering tests and test suites using reflection. | [![package issues](https://img.shields.io/badge/package:test_reflective_loader-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Atest_reflective_loader) | [![pub package](https://img.shields.io/pub/v/test_reflective_loader.svg)](https://pub.dev/packages/test_reflective_loader) | | [timing](pkgs/timing/) | A simple package for tracking the performance of synchronous and asynchronous actions. | [![package issues](https://img.shields.io/badge/package:timing-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Atiming) | [![pub package](https://img.shields.io/pub/v/timing.svg)](https://pub.dev/packages/timing) | | [unified_analytics](pkgs/unified_analytics/) | A package for logging analytics for all Dart and Flutter related tooling to Google Analytics. | [![package issues](https://img.shields.io/badge/package:unified_analytics-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Aunified_analytics) | [![pub package](https://img.shields.io/pub/v/unified_analytics.svg)](https://pub.dev/packages/unified_analytics) | -| [watcher](pkgs/watcher/) | Monitor directories and send notifications when the contents change. | [![package issues](https://img.shields.io/badge/package:watcher-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Awatcher) | [![pub package](https://img.shields.io/pub/v/watcher.svg)](https://pub.dev/packages/watcher) | +| [watcher](pkgs/watcher/) | A file system watcher. It monitors changes to contents of directories and sends notifications when files have been added, removed, or modified. | [![package issues](https://img.shields.io/badge/package:watcher-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Awatcher) | [![pub package](https://img.shields.io/pub/v/watcher.svg)](https://pub.dev/packages/watcher) | | [yaml](pkgs/yaml/) | A parser for YAML, a human-friendly data serialization standard | [![package issues](https://img.shields.io/badge/package:yaml-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ayaml) | [![pub package](https://img.shields.io/pub/v/yaml.svg)](https://pub.dev/packages/yaml) | | [yaml_edit](pkgs/yaml_edit/) | A library for YAML manipulation with comment and whitespace preservation. | [![package issues](https://img.shields.io/badge/package:yaml_edit-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Ayaml_edit) | [![pub package](https://img.shields.io/pub/v/yaml_edit.svg)](https://pub.dev/packages/yaml_edit) | diff --git a/tool/.dart_tool/package_config.json b/tool/.dart_tool/package_config.json new file mode 100644 index 000000000..7516b1677 --- /dev/null +++ b/tool/.dart_tool/package_config.json @@ -0,0 +1,83 @@ +{ + "configVersion": 2, + "packages": [ + { + "name": "checked_yaml", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/checked_yaml-2.0.3", + "packageUri": "lib/", + "languageVersion": "2.19" + }, + { + "name": "collection", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/collection-1.19.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "json_annotation", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/json_annotation-4.9.0", + "packageUri": "lib/", + "languageVersion": "3.0" + }, + { + "name": "meta", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/meta-1.16.0", + "packageUri": "lib/", + "languageVersion": "2.12" + }, + { + "name": "path", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/path-1.9.1", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "pub_semver", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/pub_semver-2.1.5", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "pubspec_parse", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/pubspec_parse-1.5.0", + "packageUri": "lib/", + "languageVersion": "3.6" + }, + { + "name": "source_span", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/source_span-1.10.1", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "string_scanner", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/string_scanner-1.4.1", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "term_glyph", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/term_glyph-1.2.2", + "packageUri": "lib/", + "languageVersion": "3.1" + }, + { + "name": "yaml", + "rootUri": "file:///Users/kevmoo/.pub-cache/hosted/pub.dev/yaml-3.1.3", + "packageUri": "lib/", + "languageVersion": "3.4" + }, + { + "name": "silly", + "rootUri": "../", + "packageUri": "lib/", + "languageVersion": "3.6" + } + ], + "generated": "2025-01-12T04:02:55.191523Z", + "generator": "pub", + "generatorVersion": "3.7.0-312.0.dev", + "flutterRoot": "file:///Users/kevmoo/github/flutter", + "flutterVersion": "3.28.0-2.0.pre.38691", + "pubCache": "file:///Users/kevmoo/.pub-cache" +} diff --git a/tool/pubspec.lock b/tool/pubspec.lock new file mode 100644 index 000000000..1e61ce113 --- /dev/null +++ b/tool/pubspec.lock @@ -0,0 +1,93 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + collection: + dependency: transitive + description: + name: collection + sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" + url: "https://pub.dev" + source: hosted + version: "1.19.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + meta: + dependency: transitive + description: + name: meta + sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + url: "https://pub.dev" + source: hosted + version: "1.16.0" + path: + dependency: transitive + description: + name: path + sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "7b3cfbf654f3edd0c6298ecd5be782ce997ddf0e00531b9464b55245185bbbbd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + pubspec_parse: + dependency: "direct main" + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" + url: "https://pub.dev" + source: hosted + version: "1.10.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" + url: "https://pub.dev" + source: hosted + version: "1.4.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" + url: "https://pub.dev" + source: hosted + version: "1.2.2" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.6.0 <4.0.0" diff --git a/tool/pubspec.yaml b/tool/pubspec.yaml new file mode 100644 index 000000000..405917061 --- /dev/null +++ b/tool/pubspec.yaml @@ -0,0 +1,8 @@ +name: silly +environment: + sdk: ^3.6.0 + +dependencies: + path: ^1.9.1 + pubspec_parse: ^1.5.0 + yaml: ^3.1.3 diff --git a/tool/readme_update.dart b/tool/readme_update.dart new file mode 100644 index 000000000..2d6ccd2a4 --- /dev/null +++ b/tool/readme_update.dart @@ -0,0 +1,62 @@ +import 'dart:collection'; +import 'dart:io'; + +import 'package:path/path.dart' as p; +import 'package:pubspec_parse/pubspec_parse.dart'; +import 'package:yaml/yaml.dart'; + +Future main(List args) async { + // assume we're being run from the root of the `tools` directory + final descriptions = SplayTreeMap(); + + // * Enumerate all packages in `pkgs/` + for (var directory in Directory(p.join(Directory.current.path, 'pkgs')) + .listSync() + .whereType()) { + final pubspecFile = File(p.join(directory.path, 'pubspec.yaml')); + final pubspec = Pubspec.parse(pubspecFile.readAsStringSync(), + sourceUrl: pubspecFile.uri); + + assert(p.basename(directory.path) == pubspec.name); + + // * Grab the `description` field from their pubspec files + descriptions[pubspec.name] = pubspec.description!; + } + + // * Ensure all packages have a file in `.github/workflows` + for (var entry in descriptions.entries) { + final workflowFile = File(p.join('.github/workflows', '${entry.key}.yaml')); + + final workflowYaml = + loadYaml(workflowFile.readAsStringSync(), sourceUrl: workflowFile.uri) + as YamlMap; + + final workflowName = workflowYaml['name'] as String; + // * Ensure each has a name `package:[pkg name]` + assert(workflowName == 'package:${entry.key}'); + } + + // * Print out the readme table! + + print(''' +| Package | Description | Issues | Version | +| --- | --- | --- | --- |'''); + + for (var entry in descriptions.entries) { + final pkgName = entry.key; + final name = '[$pkgName](pkgs/$pkgName/)'; + + /* + [![package issues](https://img.shields.io/badge/package:bazel_worker-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Abazel_worker) + [![pub package](https://img.shields.io/pub/v/bazel_worker.svg)](https://pub.dev/packages/bazel_worker) | + + */ + + final issues = + '[![package issues](https://img.shields.io/badge/package:$pkgName-4774bc)](https://github.com/dart-lang/tools/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3A$pkgName)'; + final version = + '[![pub package](https://img.shields.io/pub/v/$pkgName.svg)](https://pub.dev/packages/$pkgName)'; + + print(['', name, entry.value, issues, version, ''].join(' | ').trim()); + } +}