diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index a7045873..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,103 +0,0 @@ -name: Dart CI - -on: - # Run on PRs and pushes to the default branch. - push: - branches: [ main ] - pull_request: - branches: [ main ] - schedule: - # Run nightly. - - cron: "0 0 * * 0" - -env: - PUB_ENVIRONMENT: bot.github - -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, 3.4] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - 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 of several SDK releases. - test: - needs: analyze - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - sdk: [dev, 3.4] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: ${{ matrix.sdk }} - - name: Install dependencies - run: dart pub get - - name: Run Chrome tests - js - run: dart test --platform chrome - - name: Run Chrome tests - wasm - run: dart test --platform chrome --compiler dart2wasm - - # Ensure the generation script runs. - generation: - needs: analyze - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - sdk: [dev] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: ${{ matrix.sdk }} - - name: Install Dart dependencies - run: dart pub get - - name: Install Node dependencies - run: npm install - working-directory: tool/generator - - name: Run the generator - run: dart tool/update_bindings.dart - - name: Analyze code - run: dart analyze --fatal-infos - - # Test the contributed `dart fix` fixes. - dart-fix: - needs: analyze - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - sdk: [main] - steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - - uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 - with: - sdk: ${{ matrix.sdk }} - - name: Install Dart dependencies - run: dart pub get - - name: Test the declarative fixes - run: dart fix --compare-to-golden - working-directory: test_fixes diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml new file mode 100644 index 00000000..03caf814 --- /dev/null +++ b/.github/workflows/dart.yml @@ -0,0 +1,463 @@ +# Created with package:mono_repo v6.6.2 +name: Dart CI +on: + push: + branches: + - main + - master + pull_request: + schedule: + - cron: "0 0 * * 0" +defaults: + run: + shell: bash +env: + PUB_ENVIRONMENT: bot.github +permissions: read-all + +jobs: + job_001: + name: mono_repo self validate + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:stable" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: stable + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: mono_repo self validate + run: dart pub global activate mono_repo 6.6.2 + - name: mono_repo self validate + run: dart pub global run mono_repo generate --validate + job_002: + name: "analyze_and_format; Dart 3.4.0; PKG: web; `dart analyze --fatal-infos .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + job_003: + name: "analyze_and_format; Dart 3.4.0; PKG: web; `dart format --output=none --set-exit-if-changed .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:format" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart format --output=none --set-exit-if-changed ." + run: "dart format --output=none --set-exit-if-changed ." + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + job_004: + name: "analyze_and_format; Dart dev; PKGS: web, web_generator; `dart analyze --fatal-infos .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + job_005: + name: "analyze_and_format; Dart dev; PKGS: web, web_generator; `dart format --output=none --set-exit-if-changed .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:format" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart format --output=none --set-exit-if-changed ." + run: "dart format --output=none --set-exit-if-changed ." + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart format --output=none --set-exit-if-changed ." + run: "dart format --output=none --set-exit-if-changed ." + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + job_006: + name: "unit_test; Dart 3.4.0; PKG: web; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:test_1" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_007: + name: "unit_test; Dart 3.4.0; PKG: web; `dart test --test-randomize-ordering-seed=random -p chrome`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web;commands:test_0" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:3.4.0 + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: "3.4.0" + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome" + run: "dart test --test-randomize-ordering-seed=random -p chrome" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_008: + name: "unit_test; Dart dev; PKGS: web, web_generator; `dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:test_1" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + run: "dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm" + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_009: + name: "unit_test; Dart dev; PKGS: web, web_generator; `dart test --test-randomize-ordering-seed=random -p chrome`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator;commands:test_0" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web-web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart test --test-randomize-ordering-seed=random -p chrome" + run: "dart test --test-randomize-ordering-seed=random -p chrome" + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart test --test-randomize-ordering-seed=random -p chrome" + run: "dart test --test-randomize-ordering-seed=random -p chrome" + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + job_010: + name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart analyze --fatal-infos .`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator;commands:analyze" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: "web_generator; dart analyze --fatal-infos ." + run: dart analyze --fatal-infos . + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + - job_006 + - job_007 + - job_008 + - job_009 + job_011: + name: "generate_and_analyze; Dart dev; PKG: web_generator; `dart bin/update_bindings.dart`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator;commands:command_1" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:dev;packages:web_generator + os:ubuntu-latest;pub-cache-hosted;sdk:dev + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: dev + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_generator_pub_upgrade + name: web_generator; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web_generator + - name: web_generator; dart bin/update_bindings.dart + run: dart bin/update_bindings.dart + if: "always() && steps.web_generator_pub_upgrade.conclusion == 'success'" + working-directory: web_generator + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + - job_006 + - job_007 + - job_008 + - job_009 + job_012: + name: "dart_fixes; Dart main; PKG: web; `dart fix --compare-to-golden test_fixes`" + runs-on: ubuntu-latest + steps: + - name: Cache Pub hosted dependencies + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 + with: + path: "~/.pub-cache/hosted" + key: "os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:web;commands:command_0" + restore-keys: | + os:ubuntu-latest;pub-cache-hosted;sdk:main;packages:web + os:ubuntu-latest;pub-cache-hosted;sdk:main + os:ubuntu-latest;pub-cache-hosted + os:ubuntu-latest + - name: Setup Dart SDK + uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672 + with: + sdk: main + - id: checkout + name: Checkout repository + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - id: web_pub_upgrade + name: web; dart pub upgrade + run: dart pub upgrade + if: "always() && steps.checkout.conclusion == 'success'" + working-directory: web + - name: "web; dart fix --compare-to-golden test_fixes" + run: dart fix --compare-to-golden test_fixes + if: "always() && steps.web_pub_upgrade.conclusion == 'success'" + working-directory: web + needs: + - job_001 + - job_002 + - job_003 + - job_004 + - job_005 + - job_006 + - job_007 + - job_008 + - job_009 + - job_010 + - job_011 diff --git a/.gitignore b/.gitignore index dcebbe2b..e4377b96 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ doc/api/ pubspec.lock -tool/generator/*.js -tool/generator/*.js.* -tool/generator/node_modules/ +web_generator/lib/src/*.js +web_generator/lib/src/*.js.* +web_generator/lib/src/node_modules/ diff --git a/README.md b/README.md deleted file mode 100644 index f846ecd4..00000000 --- a/README.md +++ /dev/null @@ -1,76 +0,0 @@ -[![Dart CI](https://github.com/dart-lang/web/actions/workflows/build.yml/badge.svg)](https://github.com/dart-lang/web/actions/workflows/build.yml) -[![pub package](https://img.shields.io/pub/v/web.svg)](https://pub.dev/packages/web) -[![package publisher](https://img.shields.io/pub/publisher/web.svg)](https://pub.dev/packages/web/publisher) - -Lightweight browser API bindings built around -[JS interop](https://dart.dev/interop/js-interop). - -## What's this? - -This package exposes browser APIs. It's generated from the Web IDL definitions -and uses recent Dart language features for zero-overhead bindings. - -This package is intended to replace -[`dart:html`](https://api.dart.dev/stable/dart-html/dart-html-library.html) and -similar Dart SDK libraries. It will support access to browser APIs from Dart -code compiled to either JavaScript or WebAssembly. - -## Usage - -```dart -import 'package:web/web.dart'; - -void main() { - final div = document.querySelector('div')!; - div.text = 'Text set at ${DateTime.now()}'; -} -``` - -## Migrating to package:web - -`package:web` is replacing `dart:html` and other web libraries as Dart's -long-term web interop solution. To learn how to migrate from `dart:html` -APIs to `package:web`, see our -[migration guide](https://dart.dev/go/package-web). - -## Generation conventions - -The generator scripts use a number of conventions to consistently handle Web IDL -definitions: - -### Interfaces - -- Interfaces are emitted as extension types that wrap and implement `JSObject`. -- Interface inheritance is maintained using `implements` between extension - types. -- Members of partial interfaces, partial mixins, and mixins are added to the - interfaces that include them, and therefore do not have separate declarations. - -### Types - -- Generic types include the generic in the case of `JSArray` and `JSPromise`. -- Enums are typedef'd to `String`. -- Callbacks and callback interfaces are typedef'd to `JSFunction`. -- In general, we prefer the Dart primitive over the JS type equivalent wherever - possible. For example, APIs use `String` instead of `JSString`. -- If a type appears in a generic position and it was typedef'd to a Dart - primitive type, it is replaced with the JS type equivalent to respect the type - bound of `JSAny?`. -- Union types are computed by picking the least upper bound of the types in the - JS type hierarchy, where every interface is equivalent to `JSObject`. -- Dictionary and typedef types are only emitted if they're used by another API. - -### Compatibility - -- The generator uses the - [MDN compatibility data](https://github.com/mdn/browser-compat-data) to - determine what members, interfaces, and namespaces to emit. Currently, we only - emit code that is standards track and is not experimental to reduce the number - of breaking changes. - -## Generation and updating the package - -Most of the APIs in this package are generated from public assets. See -[tool/README.md](https://github.com/dart-lang/web/tree/main/tool) for -information on the spec and IDL versions the package was generated from, and for -the process for updating the package. diff --git a/README.md b/README.md new file mode 120000 index 00000000..84abb5c6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +web/README.md \ No newline at end of file diff --git a/analysis_options.yaml b/analysis_options.yaml index a4687c44..b86d28fb 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -7,7 +7,7 @@ analyzer: strict-inference: true strict-raw-types: true exclude: - - test_fixes/** + - web/test_fixes/** errors: # 43 instances in generated code. diff --git a/mono_repo.yaml b/mono_repo.yaml new file mode 100644 index 00000000..5b9a450d --- /dev/null +++ b/mono_repo.yaml @@ -0,0 +1,11 @@ +# See https://github.com/google/mono_repo.dart for details on this file +self_validate: analyze_and_format + +github: + cron: "0 0 * * 0" + +merge_stages: + - analyze_and_format + - unit_test + - dart_fixes + - generate_and_analyze diff --git a/third_party/mdn/README.md b/third_party/mdn/README.md index 14eb1eb0..5cae374f 100644 --- a/third_party/mdn/README.md +++ b/third_party/mdn/README.md @@ -10,5 +10,5 @@ See [LICENSE](./LICENSE) for the license this content is under. ## Process -See [the script](../../tool/scrape_mdn.dart) which collects the documentation -information. +See [the script](../web_generator/bin/scrape_mdn.dart) which collects the +documentation information. diff --git a/tool/README.md b/tool/README.md deleted file mode 100644 index 75e90fc3..00000000 --- a/tool/README.md +++ /dev/null @@ -1,52 +0,0 @@ -## Updating the package - -The Dart code in this package is generated from Web IDL definitions and MDN API -documentation. - -### Regenerating the package - -To regenerate the package from the current IDL versions, run: - -```shell -dart tool/update_bindings.dart -``` - -### Updating the dartdoc info from MDN - -package:web's dartdoc comments come from the -[MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web) project. In order -to update to the latest version of the documentation, run: - -```shell -dart tool/scrape_mdn.dart -``` - -That will collect the MDN documentation into `third_party/mdn/mdn.json`; changes -to that file should be committed to git. You'll need to run -`tool/update_bindings.dart` to produce Dart code using the updated documentation. - -### Updating to use the latest Web IDL versions - -To re-generate the package from newer IDL versions, you can either run: - -```shell -dart tool/update_bindings.dart --update -``` - -or, edit manually edit `tool/generator/package.json` to use specific IDL -versions, and re-run `tool/update_bindings.dart`. - -## Web IDL versions - -Based on: - - -| Item | Version | -| --- | --: | -| `@webref/css` | [6.12.15](https://www.npmjs.com/package/@webref/css/v/6.12.15) | -| `@webref/elements` | [2.3.0](https://www.npmjs.com/package/@webref/elements/v/2.3.0) | -| `@webref/idl` | [3.49.0](https://www.npmjs.com/package/@webref/idl/v/3.49.0) | - - -For instructions on re-generating the DOM bindings, see the -[generator docs](generator/README.md). diff --git a/tool/ci.sh b/tool/ci.sh new file mode 100755 index 00000000..ef15b46c --- /dev/null +++ b/tool/ci.sh @@ -0,0 +1,123 @@ +#!/bin/bash +# Created with package:mono_repo v6.6.2 + +# 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 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 + command flutter pub "$@" + else + command dart pub "$@" + fi +} + +function format() { + command dart format "$@" +} + +# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter") +# 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 + command flutter analyze "$@" + else + command dart analyze "$@" + fi +} + +if [[ -z ${PKGS} ]]; then + echo -e '\033[31mPKGS environment variable must be set! - TERMINATING JOB\033[0m' + exit 64 +fi + +if [[ "$#" == "0" ]]; then + echo -e '\033[31mAt least one task argument must be provided! - TERMINATING JOB\033[0m' + exit 64 +fi + +SUCCESS_COUNT=0 +declare -a FAILURES + +for PKG in ${PKGS}; do + echo -e "\033[1mPKG: ${PKG}\033[22m" + EXIT_CODE=0 + pushd "${PKG}" >/dev/null || EXIT_CODE=$? + + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo -e "\033[31mPKG: '${PKG}' does not exist - TERMINATING JOB\033[0m" + exit 64 + fi + + dart pub upgrade || EXIT_CODE=$? + + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo -e "\033[31mPKG: ${PKG}; 'dart pub upgrade' - FAILED (${EXIT_CODE})\033[0m" + FAILURES+=("${PKG}; 'dart pub upgrade'") + else + for TASK in "$@"; do + EXIT_CODE=0 + echo + echo -e "\033[1mPKG: ${PKG}; TASK: ${TASK}\033[22m" + case ${TASK} in + analyze) + echo 'dart analyze --fatal-infos .' + dart analyze --fatal-infos . || EXIT_CODE=$? + ;; + command_0) + echo 'dart fix --compare-to-golden test_fixes' + dart fix --compare-to-golden test_fixes || EXIT_CODE=$? + ;; + command_1) + echo 'dart bin/update_bindings.dart' + dart bin/update_bindings.dart || EXIT_CODE=$? + ;; + format) + echo 'dart format --output=none --set-exit-if-changed .' + dart format --output=none --set-exit-if-changed . || EXIT_CODE=$? + ;; + test_0) + echo 'dart test --test-randomize-ordering-seed=random -p chrome' + dart test --test-randomize-ordering-seed=random -p chrome || EXIT_CODE=$? + ;; + test_1) + echo 'dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm' + dart test --test-randomize-ordering-seed=random -p chrome -c dart2wasm || EXIT_CODE=$? + ;; + *) + echo -e "\033[31mUnknown TASK '${TASK}' - TERMINATING JOB\033[0m" + exit 64 + ;; + esac + + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo -e "\033[31mPKG: ${PKG}; TASK: ${TASK} - FAILED (${EXIT_CODE})\033[0m" + FAILURES+=("${PKG}; TASK: ${TASK}") + else + echo -e "\033[32mPKG: ${PKG}; TASK: ${TASK} - SUCCEEDED\033[0m" + SUCCESS_COUNT=$((SUCCESS_COUNT + 1)) + fi + + done + fi + + echo + echo -e "\033[32mSUCCESS COUNT: ${SUCCESS_COUNT}\033[0m" + + if [ ${#FAILURES[@]} -ne 0 ]; then + echo -e "\033[31mFAILURES: ${#FAILURES[@]}\033[0m" + for i in "${FAILURES[@]}"; do + echo -e "\033[31m $i\033[0m" + done + fi + + popd >/dev/null || exit 70 + echo +done + +if [ ${#FAILURES[@]} -ne 0 ]; then + exit 1 +fi diff --git a/tool/generator/README.md b/tool/generator/README.md deleted file mode 100644 index ed1d7326..00000000 --- a/tool/generator/README.md +++ /dev/null @@ -1,19 +0,0 @@ -The bindings generator for `package:web`. - -This tool is written in Dart, compiled to JavaScript, and run on Node. - -## Generating the bindings - -Run: - -``` -dart tool/update_bindings.dart -``` - -## Update to the latest Web IDL versions and regenerate - -Run: - -``` -dart tool/update_bindings.dart --update -``` diff --git a/CHANGELOG.md b/web/CHANGELOG.md similarity index 99% rename from CHANGELOG.md rename to web/CHANGELOG.md index 2634ab36..78374285 100644 --- a/CHANGELOG.md +++ b/web/CHANGELOG.md @@ -51,7 +51,7 @@ - Add support for `dart fix` migrations from `dart:html` classes to `package:web` classes. - Contribute a markdown file for the renamed classes from `dart:html` to - `package:web` (see [renames.md](tool/renames.md)). + `package:web` (see [renames.md](renames.md)). - Migrate classes to use interop extension types that implement `JSObject`. - Add generics to APIs that use `JSArray` and `JSPromise`. Typedefs of a Dart primitive type are instead replaced with their JS type equivalent if they diff --git a/web/LICENSE b/web/LICENSE new file mode 100644 index 00000000..32e050b7 --- /dev/null +++ b/web/LICENSE @@ -0,0 +1,26 @@ +Copyright 2023, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/web/README.md b/web/README.md new file mode 100644 index 00000000..8e144f51 --- /dev/null +++ b/web/README.md @@ -0,0 +1,41 @@ +[![Dart CI](https://github.com/dart-lang/web/actions/workflows/build.yml/badge.svg)](https://github.com/dart-lang/web/actions/workflows/build.yml) +[![pub package](https://img.shields.io/pub/v/web.svg)](https://pub.dev/packages/web) +[![package publisher](https://img.shields.io/pub/publisher/web.svg)](https://pub.dev/packages/web/publisher) + +Lightweight browser API bindings built around +[JS interop](https://dart.dev/interop/js-interop). + +## What's this? + +This package exposes browser APIs. It's generated from the Web IDL definitions +and uses recent Dart language features for zero-overhead bindings. + +This package is intended to replace +[`dart:html`](https://api.dart.dev/stable/dart-html/dart-html-library.html) and +similar Dart SDK libraries. It will support access to browser APIs from Dart +code compiled to either JavaScript or WebAssembly. + +## Usage + +```dart +import 'package:web/web.dart'; + +void main() { + final div = document.querySelector('div')!; + div.text = 'Text set at ${DateTime.now()}'; +} +``` + +## Migrating to package:web + +`package:web` is replacing `dart:html` and other web libraries as Dart's +long-term web interop solution. To learn how to migrate from `dart:html` +APIs to `package:web`, see our +[migration guide](https://dart.dev/go/package-web). + +## Generation + +This package is generated by `web_generator`. See the +[`README`](https://github.com/dart-lang/web/tree/main/web_generator) for more +details on the conventions used to generate this package and how to run the +different tools to generate bindings and update various package dependencies. diff --git a/example/example.dart b/web/example/example.dart similarity index 100% rename from example/example.dart rename to web/example/example.dart diff --git a/example/index.html b/web/example/index.html similarity index 100% rename from example/index.html rename to web/example/index.html diff --git a/lib/fix_data.yaml b/web/lib/fix_data.yaml similarity index 100% rename from lib/fix_data.yaml rename to web/lib/fix_data.yaml diff --git a/lib/helpers.dart b/web/lib/helpers.dart similarity index 100% rename from lib/helpers.dart rename to web/lib/helpers.dart diff --git a/lib/src/dom.dart b/web/lib/src/dom.dart similarity index 100% rename from lib/src/dom.dart rename to web/lib/src/dom.dart diff --git a/lib/src/dom/accelerometer.dart b/web/lib/src/dom/accelerometer.dart similarity index 100% rename from lib/src/dom/accelerometer.dart rename to web/lib/src/dom/accelerometer.dart diff --git a/lib/src/dom/angle_instanced_arrays.dart b/web/lib/src/dom/angle_instanced_arrays.dart similarity index 100% rename from lib/src/dom/angle_instanced_arrays.dart rename to web/lib/src/dom/angle_instanced_arrays.dart diff --git a/lib/src/dom/attribution_reporting_api.dart b/web/lib/src/dom/attribution_reporting_api.dart similarity index 100% rename from lib/src/dom/attribution_reporting_api.dart rename to web/lib/src/dom/attribution_reporting_api.dart diff --git a/lib/src/dom/background_sync.dart b/web/lib/src/dom/background_sync.dart similarity index 100% rename from lib/src/dom/background_sync.dart rename to web/lib/src/dom/background_sync.dart diff --git a/lib/src/dom/battery_status.dart b/web/lib/src/dom/battery_status.dart similarity index 100% rename from lib/src/dom/battery_status.dart rename to web/lib/src/dom/battery_status.dart diff --git a/lib/src/dom/clipboard_apis.dart b/web/lib/src/dom/clipboard_apis.dart similarity index 100% rename from lib/src/dom/clipboard_apis.dart rename to web/lib/src/dom/clipboard_apis.dart diff --git a/lib/src/dom/compression.dart b/web/lib/src/dom/compression.dart similarity index 100% rename from lib/src/dom/compression.dart rename to web/lib/src/dom/compression.dart diff --git a/lib/src/dom/console.dart b/web/lib/src/dom/console.dart similarity index 100% rename from lib/src/dom/console.dart rename to web/lib/src/dom/console.dart diff --git a/lib/src/dom/cookie_store.dart b/web/lib/src/dom/cookie_store.dart similarity index 100% rename from lib/src/dom/cookie_store.dart rename to web/lib/src/dom/cookie_store.dart diff --git a/lib/src/dom/credential_management.dart b/web/lib/src/dom/credential_management.dart similarity index 100% rename from lib/src/dom/credential_management.dart rename to web/lib/src/dom/credential_management.dart diff --git a/lib/src/dom/csp.dart b/web/lib/src/dom/csp.dart similarity index 100% rename from lib/src/dom/csp.dart rename to web/lib/src/dom/csp.dart diff --git a/lib/src/dom/css_animations.dart b/web/lib/src/dom/css_animations.dart similarity index 100% rename from lib/src/dom/css_animations.dart rename to web/lib/src/dom/css_animations.dart diff --git a/lib/src/dom/css_animations_2.dart b/web/lib/src/dom/css_animations_2.dart similarity index 100% rename from lib/src/dom/css_animations_2.dart rename to web/lib/src/dom/css_animations_2.dart diff --git a/lib/src/dom/css_cascade.dart b/web/lib/src/dom/css_cascade.dart similarity index 100% rename from lib/src/dom/css_cascade.dart rename to web/lib/src/dom/css_cascade.dart diff --git a/lib/src/dom/css_cascade_6.dart b/web/lib/src/dom/css_cascade_6.dart similarity index 100% rename from lib/src/dom/css_cascade_6.dart rename to web/lib/src/dom/css_cascade_6.dart diff --git a/lib/src/dom/css_conditional.dart b/web/lib/src/dom/css_conditional.dart similarity index 100% rename from lib/src/dom/css_conditional.dart rename to web/lib/src/dom/css_conditional.dart diff --git a/lib/src/dom/css_conditional_5.dart b/web/lib/src/dom/css_conditional_5.dart similarity index 100% rename from lib/src/dom/css_conditional_5.dart rename to web/lib/src/dom/css_conditional_5.dart diff --git a/lib/src/dom/css_contain.dart b/web/lib/src/dom/css_contain.dart similarity index 100% rename from lib/src/dom/css_contain.dart rename to web/lib/src/dom/css_contain.dart diff --git a/lib/src/dom/css_counter_styles.dart b/web/lib/src/dom/css_counter_styles.dart similarity index 100% rename from lib/src/dom/css_counter_styles.dart rename to web/lib/src/dom/css_counter_styles.dart diff --git a/lib/src/dom/css_font_loading.dart b/web/lib/src/dom/css_font_loading.dart similarity index 100% rename from lib/src/dom/css_font_loading.dart rename to web/lib/src/dom/css_font_loading.dart diff --git a/lib/src/dom/css_fonts.dart b/web/lib/src/dom/css_fonts.dart similarity index 100% rename from lib/src/dom/css_fonts.dart rename to web/lib/src/dom/css_fonts.dart diff --git a/lib/src/dom/css_highlight_api.dart b/web/lib/src/dom/css_highlight_api.dart similarity index 100% rename from lib/src/dom/css_highlight_api.dart rename to web/lib/src/dom/css_highlight_api.dart diff --git a/lib/src/dom/css_masking.dart b/web/lib/src/dom/css_masking.dart similarity index 100% rename from lib/src/dom/css_masking.dart rename to web/lib/src/dom/css_masking.dart diff --git a/lib/src/dom/css_paint_api.dart b/web/lib/src/dom/css_paint_api.dart similarity index 100% rename from lib/src/dom/css_paint_api.dart rename to web/lib/src/dom/css_paint_api.dart diff --git a/lib/src/dom/css_properties_values_api.dart b/web/lib/src/dom/css_properties_values_api.dart similarity index 100% rename from lib/src/dom/css_properties_values_api.dart rename to web/lib/src/dom/css_properties_values_api.dart diff --git a/lib/src/dom/css_transitions.dart b/web/lib/src/dom/css_transitions.dart similarity index 100% rename from lib/src/dom/css_transitions.dart rename to web/lib/src/dom/css_transitions.dart diff --git a/lib/src/dom/css_transitions_2.dart b/web/lib/src/dom/css_transitions_2.dart similarity index 100% rename from lib/src/dom/css_transitions_2.dart rename to web/lib/src/dom/css_transitions_2.dart diff --git a/lib/src/dom/css_typed_om.dart b/web/lib/src/dom/css_typed_om.dart similarity index 100% rename from lib/src/dom/css_typed_om.dart rename to web/lib/src/dom/css_typed_om.dart diff --git a/lib/src/dom/css_view_transitions.dart b/web/lib/src/dom/css_view_transitions.dart similarity index 100% rename from lib/src/dom/css_view_transitions.dart rename to web/lib/src/dom/css_view_transitions.dart diff --git a/lib/src/dom/css_view_transitions_2.dart b/web/lib/src/dom/css_view_transitions_2.dart similarity index 100% rename from lib/src/dom/css_view_transitions_2.dart rename to web/lib/src/dom/css_view_transitions_2.dart diff --git a/lib/src/dom/cssom.dart b/web/lib/src/dom/cssom.dart similarity index 100% rename from lib/src/dom/cssom.dart rename to web/lib/src/dom/cssom.dart diff --git a/lib/src/dom/cssom_view.dart b/web/lib/src/dom/cssom_view.dart similarity index 100% rename from lib/src/dom/cssom_view.dart rename to web/lib/src/dom/cssom_view.dart diff --git a/lib/src/dom/digital_identities.dart b/web/lib/src/dom/digital_identities.dart similarity index 100% rename from lib/src/dom/digital_identities.dart rename to web/lib/src/dom/digital_identities.dart diff --git a/lib/src/dom/dom.dart b/web/lib/src/dom/dom.dart similarity index 100% rename from lib/src/dom/dom.dart rename to web/lib/src/dom/dom.dart diff --git a/lib/src/dom/dom_parsing.dart b/web/lib/src/dom/dom_parsing.dart similarity index 100% rename from lib/src/dom/dom_parsing.dart rename to web/lib/src/dom/dom_parsing.dart diff --git a/lib/src/dom/encoding.dart b/web/lib/src/dom/encoding.dart similarity index 100% rename from lib/src/dom/encoding.dart rename to web/lib/src/dom/encoding.dart diff --git a/lib/src/dom/encrypted_media.dart b/web/lib/src/dom/encrypted_media.dart similarity index 100% rename from lib/src/dom/encrypted_media.dart rename to web/lib/src/dom/encrypted_media.dart diff --git a/lib/src/dom/entries_api.dart b/web/lib/src/dom/entries_api.dart similarity index 100% rename from lib/src/dom/entries_api.dart rename to web/lib/src/dom/entries_api.dart diff --git a/lib/src/dom/event_timing.dart b/web/lib/src/dom/event_timing.dart similarity index 100% rename from lib/src/dom/event_timing.dart rename to web/lib/src/dom/event_timing.dart diff --git a/lib/src/dom/ext_blend_minmax.dart b/web/lib/src/dom/ext_blend_minmax.dart similarity index 100% rename from lib/src/dom/ext_blend_minmax.dart rename to web/lib/src/dom/ext_blend_minmax.dart diff --git a/lib/src/dom/ext_color_buffer_float.dart b/web/lib/src/dom/ext_color_buffer_float.dart similarity index 100% rename from lib/src/dom/ext_color_buffer_float.dart rename to web/lib/src/dom/ext_color_buffer_float.dart diff --git a/lib/src/dom/ext_color_buffer_half_float.dart b/web/lib/src/dom/ext_color_buffer_half_float.dart similarity index 100% rename from lib/src/dom/ext_color_buffer_half_float.dart rename to web/lib/src/dom/ext_color_buffer_half_float.dart diff --git a/lib/src/dom/ext_disjoint_timer_query.dart b/web/lib/src/dom/ext_disjoint_timer_query.dart similarity index 100% rename from lib/src/dom/ext_disjoint_timer_query.dart rename to web/lib/src/dom/ext_disjoint_timer_query.dart diff --git a/lib/src/dom/ext_disjoint_timer_query_webgl2.dart b/web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart similarity index 100% rename from lib/src/dom/ext_disjoint_timer_query_webgl2.dart rename to web/lib/src/dom/ext_disjoint_timer_query_webgl2.dart diff --git a/lib/src/dom/ext_float_blend.dart b/web/lib/src/dom/ext_float_blend.dart similarity index 100% rename from lib/src/dom/ext_float_blend.dart rename to web/lib/src/dom/ext_float_blend.dart diff --git a/lib/src/dom/ext_frag_depth.dart b/web/lib/src/dom/ext_frag_depth.dart similarity index 100% rename from lib/src/dom/ext_frag_depth.dart rename to web/lib/src/dom/ext_frag_depth.dart diff --git a/lib/src/dom/ext_shader_texture_lod.dart b/web/lib/src/dom/ext_shader_texture_lod.dart similarity index 100% rename from lib/src/dom/ext_shader_texture_lod.dart rename to web/lib/src/dom/ext_shader_texture_lod.dart diff --git a/lib/src/dom/ext_srgb.dart b/web/lib/src/dom/ext_srgb.dart similarity index 100% rename from lib/src/dom/ext_srgb.dart rename to web/lib/src/dom/ext_srgb.dart diff --git a/lib/src/dom/ext_texture_compression_bptc.dart b/web/lib/src/dom/ext_texture_compression_bptc.dart similarity index 100% rename from lib/src/dom/ext_texture_compression_bptc.dart rename to web/lib/src/dom/ext_texture_compression_bptc.dart diff --git a/lib/src/dom/ext_texture_compression_rgtc.dart b/web/lib/src/dom/ext_texture_compression_rgtc.dart similarity index 100% rename from lib/src/dom/ext_texture_compression_rgtc.dart rename to web/lib/src/dom/ext_texture_compression_rgtc.dart diff --git a/lib/src/dom/ext_texture_filter_anisotropic.dart b/web/lib/src/dom/ext_texture_filter_anisotropic.dart similarity index 100% rename from lib/src/dom/ext_texture_filter_anisotropic.dart rename to web/lib/src/dom/ext_texture_filter_anisotropic.dart diff --git a/lib/src/dom/ext_texture_norm16.dart b/web/lib/src/dom/ext_texture_norm16.dart similarity index 100% rename from lib/src/dom/ext_texture_norm16.dart rename to web/lib/src/dom/ext_texture_norm16.dart diff --git a/lib/src/dom/fedcm.dart b/web/lib/src/dom/fedcm.dart similarity index 100% rename from lib/src/dom/fedcm.dart rename to web/lib/src/dom/fedcm.dart diff --git a/lib/src/dom/fetch.dart b/web/lib/src/dom/fetch.dart similarity index 100% rename from lib/src/dom/fetch.dart rename to web/lib/src/dom/fetch.dart diff --git a/lib/src/dom/fido.dart b/web/lib/src/dom/fido.dart similarity index 100% rename from lib/src/dom/fido.dart rename to web/lib/src/dom/fido.dart diff --git a/lib/src/dom/fileapi.dart b/web/lib/src/dom/fileapi.dart similarity index 100% rename from lib/src/dom/fileapi.dart rename to web/lib/src/dom/fileapi.dart diff --git a/lib/src/dom/filter_effects.dart b/web/lib/src/dom/filter_effects.dart similarity index 100% rename from lib/src/dom/filter_effects.dart rename to web/lib/src/dom/filter_effects.dart diff --git a/lib/src/dom/fs.dart b/web/lib/src/dom/fs.dart similarity index 100% rename from lib/src/dom/fs.dart rename to web/lib/src/dom/fs.dart diff --git a/lib/src/dom/fullscreen.dart b/web/lib/src/dom/fullscreen.dart similarity index 100% rename from lib/src/dom/fullscreen.dart rename to web/lib/src/dom/fullscreen.dart diff --git a/lib/src/dom/gamepad.dart b/web/lib/src/dom/gamepad.dart similarity index 100% rename from lib/src/dom/gamepad.dart rename to web/lib/src/dom/gamepad.dart diff --git a/lib/src/dom/generic_sensor.dart b/web/lib/src/dom/generic_sensor.dart similarity index 100% rename from lib/src/dom/generic_sensor.dart rename to web/lib/src/dom/generic_sensor.dart diff --git a/lib/src/dom/geolocation.dart b/web/lib/src/dom/geolocation.dart similarity index 100% rename from lib/src/dom/geolocation.dart rename to web/lib/src/dom/geolocation.dart diff --git a/lib/src/dom/geometry.dart b/web/lib/src/dom/geometry.dart similarity index 100% rename from lib/src/dom/geometry.dart rename to web/lib/src/dom/geometry.dart diff --git a/lib/src/dom/gyroscope.dart b/web/lib/src/dom/gyroscope.dart similarity index 100% rename from lib/src/dom/gyroscope.dart rename to web/lib/src/dom/gyroscope.dart diff --git a/lib/src/dom/hr_time.dart b/web/lib/src/dom/hr_time.dart similarity index 100% rename from lib/src/dom/hr_time.dart rename to web/lib/src/dom/hr_time.dart diff --git a/lib/src/dom/html.dart b/web/lib/src/dom/html.dart similarity index 100% rename from lib/src/dom/html.dart rename to web/lib/src/dom/html.dart diff --git a/lib/src/dom/image_capture.dart b/web/lib/src/dom/image_capture.dart similarity index 100% rename from lib/src/dom/image_capture.dart rename to web/lib/src/dom/image_capture.dart diff --git a/lib/src/dom/indexeddb.dart b/web/lib/src/dom/indexeddb.dart similarity index 100% rename from lib/src/dom/indexeddb.dart rename to web/lib/src/dom/indexeddb.dart diff --git a/lib/src/dom/intersection_observer.dart b/web/lib/src/dom/intersection_observer.dart similarity index 100% rename from lib/src/dom/intersection_observer.dart rename to web/lib/src/dom/intersection_observer.dart diff --git a/lib/src/dom/khr_parallel_shader_compile.dart b/web/lib/src/dom/khr_parallel_shader_compile.dart similarity index 100% rename from lib/src/dom/khr_parallel_shader_compile.dart rename to web/lib/src/dom/khr_parallel_shader_compile.dart diff --git a/lib/src/dom/largest_contentful_paint.dart b/web/lib/src/dom/largest_contentful_paint.dart similarity index 100% rename from lib/src/dom/largest_contentful_paint.dart rename to web/lib/src/dom/largest_contentful_paint.dart diff --git a/lib/src/dom/mathml_core.dart b/web/lib/src/dom/mathml_core.dart similarity index 100% rename from lib/src/dom/mathml_core.dart rename to web/lib/src/dom/mathml_core.dart diff --git a/lib/src/dom/media_capabilities.dart b/web/lib/src/dom/media_capabilities.dart similarity index 100% rename from lib/src/dom/media_capabilities.dart rename to web/lib/src/dom/media_capabilities.dart diff --git a/lib/src/dom/media_playback_quality.dart b/web/lib/src/dom/media_playback_quality.dart similarity index 100% rename from lib/src/dom/media_playback_quality.dart rename to web/lib/src/dom/media_playback_quality.dart diff --git a/lib/src/dom/media_source.dart b/web/lib/src/dom/media_source.dart similarity index 100% rename from lib/src/dom/media_source.dart rename to web/lib/src/dom/media_source.dart diff --git a/lib/src/dom/mediacapture_fromelement.dart b/web/lib/src/dom/mediacapture_fromelement.dart similarity index 100% rename from lib/src/dom/mediacapture_fromelement.dart rename to web/lib/src/dom/mediacapture_fromelement.dart diff --git a/lib/src/dom/mediacapture_streams.dart b/web/lib/src/dom/mediacapture_streams.dart similarity index 100% rename from lib/src/dom/mediacapture_streams.dart rename to web/lib/src/dom/mediacapture_streams.dart diff --git a/lib/src/dom/mediacapture_transform.dart b/web/lib/src/dom/mediacapture_transform.dart similarity index 100% rename from lib/src/dom/mediacapture_transform.dart rename to web/lib/src/dom/mediacapture_transform.dart diff --git a/lib/src/dom/mediasession.dart b/web/lib/src/dom/mediasession.dart similarity index 100% rename from lib/src/dom/mediasession.dart rename to web/lib/src/dom/mediasession.dart diff --git a/lib/src/dom/mediastream_recording.dart b/web/lib/src/dom/mediastream_recording.dart similarity index 100% rename from lib/src/dom/mediastream_recording.dart rename to web/lib/src/dom/mediastream_recording.dart diff --git a/lib/src/dom/mst_content_hint.dart b/web/lib/src/dom/mst_content_hint.dart similarity index 100% rename from lib/src/dom/mst_content_hint.dart rename to web/lib/src/dom/mst_content_hint.dart diff --git a/lib/src/dom/navigation_timing.dart b/web/lib/src/dom/navigation_timing.dart similarity index 100% rename from lib/src/dom/navigation_timing.dart rename to web/lib/src/dom/navigation_timing.dart diff --git a/lib/src/dom/netinfo.dart b/web/lib/src/dom/netinfo.dart similarity index 100% rename from lib/src/dom/netinfo.dart rename to web/lib/src/dom/netinfo.dart diff --git a/lib/src/dom/notifications.dart b/web/lib/src/dom/notifications.dart similarity index 100% rename from lib/src/dom/notifications.dart rename to web/lib/src/dom/notifications.dart diff --git a/lib/src/dom/oes_draw_buffers_indexed.dart b/web/lib/src/dom/oes_draw_buffers_indexed.dart similarity index 100% rename from lib/src/dom/oes_draw_buffers_indexed.dart rename to web/lib/src/dom/oes_draw_buffers_indexed.dart diff --git a/lib/src/dom/oes_element_index_uint.dart b/web/lib/src/dom/oes_element_index_uint.dart similarity index 100% rename from lib/src/dom/oes_element_index_uint.dart rename to web/lib/src/dom/oes_element_index_uint.dart diff --git a/lib/src/dom/oes_fbo_render_mipmap.dart b/web/lib/src/dom/oes_fbo_render_mipmap.dart similarity index 100% rename from lib/src/dom/oes_fbo_render_mipmap.dart rename to web/lib/src/dom/oes_fbo_render_mipmap.dart diff --git a/lib/src/dom/oes_standard_derivatives.dart b/web/lib/src/dom/oes_standard_derivatives.dart similarity index 100% rename from lib/src/dom/oes_standard_derivatives.dart rename to web/lib/src/dom/oes_standard_derivatives.dart diff --git a/lib/src/dom/oes_texture_float.dart b/web/lib/src/dom/oes_texture_float.dart similarity index 100% rename from lib/src/dom/oes_texture_float.dart rename to web/lib/src/dom/oes_texture_float.dart diff --git a/lib/src/dom/oes_texture_float_linear.dart b/web/lib/src/dom/oes_texture_float_linear.dart similarity index 100% rename from lib/src/dom/oes_texture_float_linear.dart rename to web/lib/src/dom/oes_texture_float_linear.dart diff --git a/lib/src/dom/oes_texture_half_float.dart b/web/lib/src/dom/oes_texture_half_float.dart similarity index 100% rename from lib/src/dom/oes_texture_half_float.dart rename to web/lib/src/dom/oes_texture_half_float.dart diff --git a/lib/src/dom/oes_texture_half_float_linear.dart b/web/lib/src/dom/oes_texture_half_float_linear.dart similarity index 100% rename from lib/src/dom/oes_texture_half_float_linear.dart rename to web/lib/src/dom/oes_texture_half_float_linear.dart diff --git a/lib/src/dom/oes_vertex_array_object.dart b/web/lib/src/dom/oes_vertex_array_object.dart similarity index 100% rename from lib/src/dom/oes_vertex_array_object.dart rename to web/lib/src/dom/oes_vertex_array_object.dart diff --git a/lib/src/dom/orientation_event.dart b/web/lib/src/dom/orientation_event.dart similarity index 100% rename from lib/src/dom/orientation_event.dart rename to web/lib/src/dom/orientation_event.dart diff --git a/lib/src/dom/orientation_sensor.dart b/web/lib/src/dom/orientation_sensor.dart similarity index 100% rename from lib/src/dom/orientation_sensor.dart rename to web/lib/src/dom/orientation_sensor.dart diff --git a/lib/src/dom/ovr_multiview2.dart b/web/lib/src/dom/ovr_multiview2.dart similarity index 100% rename from lib/src/dom/ovr_multiview2.dart rename to web/lib/src/dom/ovr_multiview2.dart diff --git a/lib/src/dom/paint_timing.dart b/web/lib/src/dom/paint_timing.dart similarity index 100% rename from lib/src/dom/paint_timing.dart rename to web/lib/src/dom/paint_timing.dart diff --git a/lib/src/dom/payment_request.dart b/web/lib/src/dom/payment_request.dart similarity index 100% rename from lib/src/dom/payment_request.dart rename to web/lib/src/dom/payment_request.dart diff --git a/lib/src/dom/performance_timeline.dart b/web/lib/src/dom/performance_timeline.dart similarity index 100% rename from lib/src/dom/performance_timeline.dart rename to web/lib/src/dom/performance_timeline.dart diff --git a/lib/src/dom/permissions.dart b/web/lib/src/dom/permissions.dart similarity index 100% rename from lib/src/dom/permissions.dart rename to web/lib/src/dom/permissions.dart diff --git a/lib/src/dom/picture_in_picture.dart b/web/lib/src/dom/picture_in_picture.dart similarity index 100% rename from lib/src/dom/picture_in_picture.dart rename to web/lib/src/dom/picture_in_picture.dart diff --git a/lib/src/dom/pointerevents.dart b/web/lib/src/dom/pointerevents.dart similarity index 100% rename from lib/src/dom/pointerevents.dart rename to web/lib/src/dom/pointerevents.dart diff --git a/lib/src/dom/pointerlock.dart b/web/lib/src/dom/pointerlock.dart similarity index 100% rename from lib/src/dom/pointerlock.dart rename to web/lib/src/dom/pointerlock.dart diff --git a/lib/src/dom/private_network_access.dart b/web/lib/src/dom/private_network_access.dart similarity index 100% rename from lib/src/dom/private_network_access.dart rename to web/lib/src/dom/private_network_access.dart diff --git a/lib/src/dom/push_api.dart b/web/lib/src/dom/push_api.dart similarity index 100% rename from lib/src/dom/push_api.dart rename to web/lib/src/dom/push_api.dart diff --git a/lib/src/dom/referrer_policy.dart b/web/lib/src/dom/referrer_policy.dart similarity index 100% rename from lib/src/dom/referrer_policy.dart rename to web/lib/src/dom/referrer_policy.dart diff --git a/lib/src/dom/remote_playback.dart b/web/lib/src/dom/remote_playback.dart similarity index 100% rename from lib/src/dom/remote_playback.dart rename to web/lib/src/dom/remote_playback.dart diff --git a/lib/src/dom/reporting.dart b/web/lib/src/dom/reporting.dart similarity index 100% rename from lib/src/dom/reporting.dart rename to web/lib/src/dom/reporting.dart diff --git a/lib/src/dom/requestidlecallback.dart b/web/lib/src/dom/requestidlecallback.dart similarity index 100% rename from lib/src/dom/requestidlecallback.dart rename to web/lib/src/dom/requestidlecallback.dart diff --git a/lib/src/dom/resize_observer.dart b/web/lib/src/dom/resize_observer.dart similarity index 100% rename from lib/src/dom/resize_observer.dart rename to web/lib/src/dom/resize_observer.dart diff --git a/lib/src/dom/resource_timing.dart b/web/lib/src/dom/resource_timing.dart similarity index 100% rename from lib/src/dom/resource_timing.dart rename to web/lib/src/dom/resource_timing.dart diff --git a/lib/src/dom/saa_non_cookie_storage.dart b/web/lib/src/dom/saa_non_cookie_storage.dart similarity index 100% rename from lib/src/dom/saa_non_cookie_storage.dart rename to web/lib/src/dom/saa_non_cookie_storage.dart diff --git a/lib/src/dom/sanitizer_api.dart b/web/lib/src/dom/sanitizer_api.dart similarity index 100% rename from lib/src/dom/sanitizer_api.dart rename to web/lib/src/dom/sanitizer_api.dart diff --git a/lib/src/dom/scheduling_apis.dart b/web/lib/src/dom/scheduling_apis.dart similarity index 100% rename from lib/src/dom/scheduling_apis.dart rename to web/lib/src/dom/scheduling_apis.dart diff --git a/lib/src/dom/screen_capture.dart b/web/lib/src/dom/screen_capture.dart similarity index 100% rename from lib/src/dom/screen_capture.dart rename to web/lib/src/dom/screen_capture.dart diff --git a/lib/src/dom/screen_orientation.dart b/web/lib/src/dom/screen_orientation.dart similarity index 100% rename from lib/src/dom/screen_orientation.dart rename to web/lib/src/dom/screen_orientation.dart diff --git a/lib/src/dom/screen_wake_lock.dart b/web/lib/src/dom/screen_wake_lock.dart similarity index 100% rename from lib/src/dom/screen_wake_lock.dart rename to web/lib/src/dom/screen_wake_lock.dart diff --git a/lib/src/dom/secure_payment_confirmation.dart b/web/lib/src/dom/secure_payment_confirmation.dart similarity index 100% rename from lib/src/dom/secure_payment_confirmation.dart rename to web/lib/src/dom/secure_payment_confirmation.dart diff --git a/lib/src/dom/selection_api.dart b/web/lib/src/dom/selection_api.dart similarity index 100% rename from lib/src/dom/selection_api.dart rename to web/lib/src/dom/selection_api.dart diff --git a/lib/src/dom/server_timing.dart b/web/lib/src/dom/server_timing.dart similarity index 100% rename from lib/src/dom/server_timing.dart rename to web/lib/src/dom/server_timing.dart diff --git a/lib/src/dom/service_workers.dart b/web/lib/src/dom/service_workers.dart similarity index 100% rename from lib/src/dom/service_workers.dart rename to web/lib/src/dom/service_workers.dart diff --git a/lib/src/dom/speech_api.dart b/web/lib/src/dom/speech_api.dart similarity index 100% rename from lib/src/dom/speech_api.dart rename to web/lib/src/dom/speech_api.dart diff --git a/lib/src/dom/storage.dart b/web/lib/src/dom/storage.dart similarity index 100% rename from lib/src/dom/storage.dart rename to web/lib/src/dom/storage.dart diff --git a/lib/src/dom/streams.dart b/web/lib/src/dom/streams.dart similarity index 100% rename from lib/src/dom/streams.dart rename to web/lib/src/dom/streams.dart diff --git a/lib/src/dom/svg.dart b/web/lib/src/dom/svg.dart similarity index 100% rename from lib/src/dom/svg.dart rename to web/lib/src/dom/svg.dart diff --git a/lib/src/dom/svg_animations.dart b/web/lib/src/dom/svg_animations.dart similarity index 100% rename from lib/src/dom/svg_animations.dart rename to web/lib/src/dom/svg_animations.dart diff --git a/lib/src/dom/touch_events.dart b/web/lib/src/dom/touch_events.dart similarity index 100% rename from lib/src/dom/touch_events.dart rename to web/lib/src/dom/touch_events.dart diff --git a/lib/src/dom/trust_token_api.dart b/web/lib/src/dom/trust_token_api.dart similarity index 100% rename from lib/src/dom/trust_token_api.dart rename to web/lib/src/dom/trust_token_api.dart diff --git a/lib/src/dom/trusted_types.dart b/web/lib/src/dom/trusted_types.dart similarity index 100% rename from lib/src/dom/trusted_types.dart rename to web/lib/src/dom/trusted_types.dart diff --git a/lib/src/dom/uievents.dart b/web/lib/src/dom/uievents.dart similarity index 100% rename from lib/src/dom/uievents.dart rename to web/lib/src/dom/uievents.dart diff --git a/lib/src/dom/url.dart b/web/lib/src/dom/url.dart similarity index 100% rename from lib/src/dom/url.dart rename to web/lib/src/dom/url.dart diff --git a/lib/src/dom/user_timing.dart b/web/lib/src/dom/user_timing.dart similarity index 100% rename from lib/src/dom/user_timing.dart rename to web/lib/src/dom/user_timing.dart diff --git a/lib/src/dom/vibration.dart b/web/lib/src/dom/vibration.dart similarity index 100% rename from lib/src/dom/vibration.dart rename to web/lib/src/dom/vibration.dart diff --git a/lib/src/dom/video_rvfc.dart b/web/lib/src/dom/video_rvfc.dart similarity index 100% rename from lib/src/dom/video_rvfc.dart rename to web/lib/src/dom/video_rvfc.dart diff --git a/lib/src/dom/wasm_js_api.dart b/web/lib/src/dom/wasm_js_api.dart similarity index 100% rename from lib/src/dom/wasm_js_api.dart rename to web/lib/src/dom/wasm_js_api.dart diff --git a/lib/src/dom/web_animations.dart b/web/lib/src/dom/web_animations.dart similarity index 100% rename from lib/src/dom/web_animations.dart rename to web/lib/src/dom/web_animations.dart diff --git a/lib/src/dom/web_animations_2.dart b/web/lib/src/dom/web_animations_2.dart similarity index 100% rename from lib/src/dom/web_animations_2.dart rename to web/lib/src/dom/web_animations_2.dart diff --git a/lib/src/dom/web_bluetooth.dart b/web/lib/src/dom/web_bluetooth.dart similarity index 100% rename from lib/src/dom/web_bluetooth.dart rename to web/lib/src/dom/web_bluetooth.dart diff --git a/lib/src/dom/web_locks.dart b/web/lib/src/dom/web_locks.dart similarity index 100% rename from lib/src/dom/web_locks.dart rename to web/lib/src/dom/web_locks.dart diff --git a/lib/src/dom/web_otp.dart b/web/lib/src/dom/web_otp.dart similarity index 100% rename from lib/src/dom/web_otp.dart rename to web/lib/src/dom/web_otp.dart diff --git a/lib/src/dom/web_share.dart b/web/lib/src/dom/web_share.dart similarity index 100% rename from lib/src/dom/web_share.dart rename to web/lib/src/dom/web_share.dart diff --git a/lib/src/dom/webaudio.dart b/web/lib/src/dom/webaudio.dart similarity index 100% rename from lib/src/dom/webaudio.dart rename to web/lib/src/dom/webaudio.dart diff --git a/lib/src/dom/webauthn.dart b/web/lib/src/dom/webauthn.dart similarity index 100% rename from lib/src/dom/webauthn.dart rename to web/lib/src/dom/webauthn.dart diff --git a/lib/src/dom/webcodecs.dart b/web/lib/src/dom/webcodecs.dart similarity index 100% rename from lib/src/dom/webcodecs.dart rename to web/lib/src/dom/webcodecs.dart diff --git a/lib/src/dom/webcodecs_av1_codec_registration.dart b/web/lib/src/dom/webcodecs_av1_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_av1_codec_registration.dart rename to web/lib/src/dom/webcodecs_av1_codec_registration.dart diff --git a/lib/src/dom/webcodecs_avc_codec_registration.dart b/web/lib/src/dom/webcodecs_avc_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_avc_codec_registration.dart rename to web/lib/src/dom/webcodecs_avc_codec_registration.dart diff --git a/lib/src/dom/webcodecs_hevc_codec_registration.dart b/web/lib/src/dom/webcodecs_hevc_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_hevc_codec_registration.dart rename to web/lib/src/dom/webcodecs_hevc_codec_registration.dart diff --git a/lib/src/dom/webcodecs_vp9_codec_registration.dart b/web/lib/src/dom/webcodecs_vp9_codec_registration.dart similarity index 100% rename from lib/src/dom/webcodecs_vp9_codec_registration.dart rename to web/lib/src/dom/webcodecs_vp9_codec_registration.dart diff --git a/lib/src/dom/webcryptoapi.dart b/web/lib/src/dom/webcryptoapi.dart similarity index 100% rename from lib/src/dom/webcryptoapi.dart rename to web/lib/src/dom/webcryptoapi.dart diff --git a/lib/src/dom/webgl1.dart b/web/lib/src/dom/webgl1.dart similarity index 100% rename from lib/src/dom/webgl1.dart rename to web/lib/src/dom/webgl1.dart diff --git a/lib/src/dom/webgl2.dart b/web/lib/src/dom/webgl2.dart similarity index 100% rename from lib/src/dom/webgl2.dart rename to web/lib/src/dom/webgl2.dart diff --git a/lib/src/dom/webgl_color_buffer_float.dart b/web/lib/src/dom/webgl_color_buffer_float.dart similarity index 100% rename from lib/src/dom/webgl_color_buffer_float.dart rename to web/lib/src/dom/webgl_color_buffer_float.dart diff --git a/lib/src/dom/webgl_compressed_texture_astc.dart b/web/lib/src/dom/webgl_compressed_texture_astc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_astc.dart rename to web/lib/src/dom/webgl_compressed_texture_astc.dart diff --git a/lib/src/dom/webgl_compressed_texture_etc.dart b/web/lib/src/dom/webgl_compressed_texture_etc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_etc.dart rename to web/lib/src/dom/webgl_compressed_texture_etc.dart diff --git a/lib/src/dom/webgl_compressed_texture_etc1.dart b/web/lib/src/dom/webgl_compressed_texture_etc1.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_etc1.dart rename to web/lib/src/dom/webgl_compressed_texture_etc1.dart diff --git a/lib/src/dom/webgl_compressed_texture_pvrtc.dart b/web/lib/src/dom/webgl_compressed_texture_pvrtc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_pvrtc.dart rename to web/lib/src/dom/webgl_compressed_texture_pvrtc.dart diff --git a/lib/src/dom/webgl_compressed_texture_s3tc.dart b/web/lib/src/dom/webgl_compressed_texture_s3tc.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_s3tc.dart rename to web/lib/src/dom/webgl_compressed_texture_s3tc.dart diff --git a/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart b/web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart similarity index 100% rename from lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart rename to web/lib/src/dom/webgl_compressed_texture_s3tc_srgb.dart diff --git a/lib/src/dom/webgl_debug_renderer_info.dart b/web/lib/src/dom/webgl_debug_renderer_info.dart similarity index 100% rename from lib/src/dom/webgl_debug_renderer_info.dart rename to web/lib/src/dom/webgl_debug_renderer_info.dart diff --git a/lib/src/dom/webgl_debug_shaders.dart b/web/lib/src/dom/webgl_debug_shaders.dart similarity index 100% rename from lib/src/dom/webgl_debug_shaders.dart rename to web/lib/src/dom/webgl_debug_shaders.dart diff --git a/lib/src/dom/webgl_depth_texture.dart b/web/lib/src/dom/webgl_depth_texture.dart similarity index 100% rename from lib/src/dom/webgl_depth_texture.dart rename to web/lib/src/dom/webgl_depth_texture.dart diff --git a/lib/src/dom/webgl_draw_buffers.dart b/web/lib/src/dom/webgl_draw_buffers.dart similarity index 100% rename from lib/src/dom/webgl_draw_buffers.dart rename to web/lib/src/dom/webgl_draw_buffers.dart diff --git a/lib/src/dom/webgl_lose_context.dart b/web/lib/src/dom/webgl_lose_context.dart similarity index 100% rename from lib/src/dom/webgl_lose_context.dart rename to web/lib/src/dom/webgl_lose_context.dart diff --git a/lib/src/dom/webgl_multi_draw.dart b/web/lib/src/dom/webgl_multi_draw.dart similarity index 100% rename from lib/src/dom/webgl_multi_draw.dart rename to web/lib/src/dom/webgl_multi_draw.dart diff --git a/lib/src/dom/webgpu.dart b/web/lib/src/dom/webgpu.dart similarity index 100% rename from lib/src/dom/webgpu.dart rename to web/lib/src/dom/webgpu.dart diff --git a/lib/src/dom/webidl.dart b/web/lib/src/dom/webidl.dart similarity index 100% rename from lib/src/dom/webidl.dart rename to web/lib/src/dom/webidl.dart diff --git a/lib/src/dom/webmidi.dart b/web/lib/src/dom/webmidi.dart similarity index 100% rename from lib/src/dom/webmidi.dart rename to web/lib/src/dom/webmidi.dart diff --git a/lib/src/dom/webrtc.dart b/web/lib/src/dom/webrtc.dart similarity index 100% rename from lib/src/dom/webrtc.dart rename to web/lib/src/dom/webrtc.dart diff --git a/lib/src/dom/webrtc_encoded_transform.dart b/web/lib/src/dom/webrtc_encoded_transform.dart similarity index 100% rename from lib/src/dom/webrtc_encoded_transform.dart rename to web/lib/src/dom/webrtc_encoded_transform.dart diff --git a/lib/src/dom/webrtc_identity.dart b/web/lib/src/dom/webrtc_identity.dart similarity index 100% rename from lib/src/dom/webrtc_identity.dart rename to web/lib/src/dom/webrtc_identity.dart diff --git a/lib/src/dom/webrtc_priority.dart b/web/lib/src/dom/webrtc_priority.dart similarity index 100% rename from lib/src/dom/webrtc_priority.dart rename to web/lib/src/dom/webrtc_priority.dart diff --git a/lib/src/dom/websockets.dart b/web/lib/src/dom/websockets.dart similarity index 100% rename from lib/src/dom/websockets.dart rename to web/lib/src/dom/websockets.dart diff --git a/lib/src/dom/webtransport.dart b/web/lib/src/dom/webtransport.dart similarity index 100% rename from lib/src/dom/webtransport.dart rename to web/lib/src/dom/webtransport.dart diff --git a/lib/src/dom/webvtt.dart b/web/lib/src/dom/webvtt.dart similarity index 100% rename from lib/src/dom/webvtt.dart rename to web/lib/src/dom/webvtt.dart diff --git a/lib/src/dom/webxr.dart b/web/lib/src/dom/webxr.dart similarity index 100% rename from lib/src/dom/webxr.dart rename to web/lib/src/dom/webxr.dart diff --git a/lib/src/dom/webxr_hand_input.dart b/web/lib/src/dom/webxr_hand_input.dart similarity index 100% rename from lib/src/dom/webxr_hand_input.dart rename to web/lib/src/dom/webxr_hand_input.dart diff --git a/lib/src/dom/xhr.dart b/web/lib/src/dom/xhr.dart similarity index 100% rename from lib/src/dom/xhr.dart rename to web/lib/src/dom/xhr.dart diff --git a/lib/src/helpers.dart b/web/lib/src/helpers.dart similarity index 100% rename from lib/src/helpers.dart rename to web/lib/src/helpers.dart diff --git a/lib/src/helpers/enums.dart b/web/lib/src/helpers/enums.dart similarity index 100% rename from lib/src/helpers/enums.dart rename to web/lib/src/helpers/enums.dart diff --git a/lib/src/helpers/events/events.dart b/web/lib/src/helpers/events/events.dart similarity index 100% rename from lib/src/helpers/events/events.dart rename to web/lib/src/helpers/events/events.dart diff --git a/lib/src/helpers/events/providers.dart b/web/lib/src/helpers/events/providers.dart similarity index 100% rename from lib/src/helpers/events/providers.dart rename to web/lib/src/helpers/events/providers.dart diff --git a/lib/src/helpers/events/streams.dart b/web/lib/src/helpers/events/streams.dart similarity index 100% rename from lib/src/helpers/events/streams.dart rename to web/lib/src/helpers/events/streams.dart diff --git a/lib/src/helpers/extensions.dart b/web/lib/src/helpers/extensions.dart similarity index 100% rename from lib/src/helpers/extensions.dart rename to web/lib/src/helpers/extensions.dart diff --git a/lib/src/helpers/http.dart b/web/lib/src/helpers/http.dart similarity index 100% rename from lib/src/helpers/http.dart rename to web/lib/src/helpers/http.dart diff --git a/lib/src/helpers/lists.dart b/web/lib/src/helpers/lists.dart similarity index 100% rename from lib/src/helpers/lists.dart rename to web/lib/src/helpers/lists.dart diff --git a/lib/src/helpers/renames.dart b/web/lib/src/helpers/renames.dart similarity index 100% rename from lib/src/helpers/renames.dart rename to web/lib/src/helpers/renames.dart diff --git a/lib/web.dart b/web/lib/web.dart similarity index 100% rename from lib/web.dart rename to web/lib/web.dart diff --git a/web/mono_pkg.yaml b/web/mono_pkg.yaml new file mode 100644 index 00000000..18963f16 --- /dev/null +++ b/web/mono_pkg.yaml @@ -0,0 +1,14 @@ +sdk: + - dev + - pubspec + +stages: +- analyze_and_format: + - analyze: --fatal-infos . + - format: +- unit_test: + - test: --test-randomize-ordering-seed=random -p chrome + - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm +- dart_fixes: + - command: dart fix --compare-to-golden test_fixes + sdk: main diff --git a/web/pubspec.yaml b/web/pubspec.yaml new file mode 100644 index 00000000..3a1a44ec --- /dev/null +++ b/web/pubspec.yaml @@ -0,0 +1,12 @@ +name: web +version: 1.1.0-wip +description: Lightweight browser API bindings built around JS interop. +repository: https://github.com/dart-lang/web + +environment: + sdk: ^3.4.0 + +dev_dependencies: + dart_flutter_team_lints: ^3.0.0 + path: ^1.8.3 + test: ^1.24.4 diff --git a/tool/renames.md b/web/renames.md similarity index 100% rename from tool/renames.md rename to web/renames.md diff --git a/test/dart_fix_test.dart b/web/test/dart_fix_test.dart similarity index 100% rename from test/dart_fix_test.dart rename to web/test/dart_fix_test.dart diff --git a/test/element_constructor_test.dart b/web/test/element_constructor_test.dart similarity index 100% rename from test/element_constructor_test.dart rename to web/test/element_constructor_test.dart diff --git a/test/helpers_test.dart b/web/test/helpers_test.dart similarity index 100% rename from test/helpers_test.dart rename to web/test/helpers_test.dart diff --git a/test/smoke_test.dart b/web/test/smoke_test.dart similarity index 100% rename from test/smoke_test.dart rename to web/test/smoke_test.dart diff --git a/test_fixes/README.md b/web/test_fixes/README.md similarity index 100% rename from test_fixes/README.md rename to web/test_fixes/README.md diff --git a/test_fixes/analysis_options.yaml b/web/test_fixes/analysis_options.yaml similarity index 100% rename from test_fixes/analysis_options.yaml rename to web/test_fixes/analysis_options.yaml diff --git a/test_fixes/renames.dart b/web/test_fixes/renames.dart similarity index 100% rename from test_fixes/renames.dart rename to web/test_fixes/renames.dart diff --git a/test_fixes/renames.dart.expect b/web/test_fixes/renames.dart.expect similarity index 100% rename from test_fixes/renames.dart.expect rename to web/test_fixes/renames.dart.expect diff --git a/web_generator/CHANGELOG.md b/web_generator/CHANGELOG.md new file mode 100644 index 00000000..d9c47969 --- /dev/null +++ b/web_generator/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0-wip + +- Initial separation of `web_generator` from `web`. \ No newline at end of file diff --git a/web_generator/LICENSE b/web_generator/LICENSE new file mode 100644 index 00000000..a69ac38d --- /dev/null +++ b/web_generator/LICENSE @@ -0,0 +1,26 @@ +Copyright 2024, the Dart project authors. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google LLC nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/web_generator/README.md b/web_generator/README.md new file mode 100644 index 00000000..0a90c095 --- /dev/null +++ b/web_generator/README.md @@ -0,0 +1,88 @@ +## What's this? + +This package contains tools to generate +[`web`](https://github.com/dart-lang/web/tree/main/web) from Web IDL definitions +and MDN API documentation. + +### Regenerating the package + +The tool to generate bindings is written in Dart, compiled to JavaScript, and +run on Node. + +To regenerate `web` bindings from the current IDL versions, run: + +```shell +dart bin/update_bindings.dart +``` + +## Update to the latest Web IDL versions and regenerate + +To re-generate the package from newer IDL versions, you can either run: + +```shell +dart bin/update_bindings.dart --update +``` + +or, manually edit `lib/src/package.json` to use specific IDL versions, and +re-run `update_bindings.dart`. + +### Updating the dartdoc info from MDN + +package:web's dartdoc comments come from the +[MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web) project. In order +to update to the latest version of the documentation, run: + +```shell +dart bin/scrape_mdn.dart +``` + +That will collect the MDN documentation into `third_party/mdn/mdn.json`; changes +to that file should be committed to git. You'll need to run +`update_bindings.dart` to produce Dart code using the updated documentation. + +## Generation conventions + +The generator scripts use a number of conventions to consistently handle Web IDL +definitions: + +### Interfaces + +- Interfaces are emitted as extension types that wrap and implement `JSObject`. +- Interface inheritance is maintained using `implements` between extension + types. +- Members of partial interfaces, partial mixins, and mixins are added to the + interfaces that include them, and therefore do not have separate declarations. + +### Types + +- Generic types include the generic in the case of `JSArray` and `JSPromise`. +- Enums are typedef'd to `String`. +- Callbacks and callback interfaces are typedef'd to `JSFunction`. +- In general, we prefer the Dart primitive over the JS type equivalent wherever + possible. For example, APIs use `String` instead of `JSString`. +- If a type appears in a generic position and it was typedef'd to a Dart + primitive type, it is replaced with the JS type equivalent to respect the type + bound of `JSAny?`. +- Union types are computed by picking the least upper bound of the types in the + JS type hierarchy, where every interface is equivalent to `JSObject`. +- Dictionary and typedef types are only emitted if they're used by another API. + +### Compatibility + +- The generator uses the + [MDN compatibility data](https://github.com/mdn/browser-compat-data) to + determine what members, interfaces, and namespaces to emit. Currently, we only + emit code that is standards track and is not experimental to reduce the number + of breaking changes. + +## Web IDL versions + +Based on: + + +| Item | Version | +| --- | --: | +| `@webref/css` | [6.12.15](https://www.npmjs.com/package/@webref/css/v/6.12.15) | +| `@webref/elements` | [2.3.0](https://www.npmjs.com/package/@webref/elements/v/2.3.0) | +| `@webref/idl` | [3.49.0](https://www.npmjs.com/package/@webref/idl/v/3.49.0) | + diff --git a/tool/scrape_mdn.dart b/web_generator/bin/scrape_mdn.dart similarity index 97% rename from tool/scrape_mdn.dart rename to web_generator/bin/scrape_mdn.dart index b0ab8058..fc64321d 100644 --- a/tool/scrape_mdn.dart +++ b/web_generator/bin/scrape_mdn.dart @@ -14,7 +14,8 @@ Future main(List args) async { final offline = args.length == 1 && args.first == '--offline'; // clone the repo - final repoDir = Directory(p.join('.dart_tool', 'mdn_content')); + final repoDir = + Directory(Platform.script.resolve('../.dart_tool/mdn_content').path); if (!repoDir.existsSync()) { await _run( 'git', @@ -77,7 +78,8 @@ Future main(List args) async { const encoder = JsonEncoder.withIndent(' '); - final file = File('third_party/mdn/mdn.json'); + final file = + File(Platform.script.resolve('../../third_party/mdn/mdn.json').path); final json = { '__meta__': { 'source': '[MDN Web Docs]($mdnUrl)', diff --git a/tool/update_bindings.dart b/web_generator/bin/update_bindings.dart similarity index 94% rename from tool/update_bindings.dart rename to web_generator/bin/update_bindings.dart index b540b96e..0735b5b7 100644 --- a/tool/update_bindings.dart +++ b/web_generator/bin/update_bindings.dart @@ -64,7 +64,8 @@ $_usage'''); } // Determine the set of previously generated files. - final domDir = Directory(p.join('lib', 'src', 'dom')); + final domDir = + Directory(Platform.script.resolve('../../web/lib/src/dom').path); final existingFiles = domDir.listSync(recursive: true).whereType().where((file) { if (!file.path.endsWith('.dart')) return false; @@ -79,7 +80,7 @@ $_usage'''); // Run app with `node`. await _runProc( 'node', - ['main.mjs', '../../lib/src'], + ['main.mjs', Platform.script.resolve('../../web/lib/src').path], workingDirectory: _bindingsGeneratorPath, ); @@ -93,7 +94,7 @@ $_usage'''); // Update readme. final readmeFile = File( - p.normalize(p.join(_bindingsGeneratorPath, '..', 'README.md')), + p.normalize(Platform.script.resolve('../README.md').path), ); final sourceContent = readmeFile.readAsStringSync(); @@ -133,13 +134,13 @@ String _packageLockVersion(String package) { return webRefIdl['version'] as String; } -final _bindingsGeneratorPath = p.join('tool', 'generator'); +final _bindingsGeneratorPath = Platform.script.resolve('../lib/src').path; const _webRefCss = '@webref/css'; const _webRefElements = '@webref/elements'; const _webRefIdl = '@webref/idl'; -const _thisScript = 'tool/update_bindings.dart'; +const _thisScript = 'bin/update_bindings.dart'; const _startComment = ''; @@ -169,7 +170,7 @@ Future _runProc( Future _generateJsTypeSupertypes() async { // Use a file that uses `dart:js_interop` for analysis. final contextCollection = AnalysisContextCollection(includedPaths: [ - p.fromUri(Platform.script.resolve('../lib/src/dom.dart')) + p.fromUri(Platform.script.resolve('../../web/lib/src/dom.dart')) ]); final dartJsInterop = (await contextCollection.contexts.single.currentSession .getLibraryByUri('dart:js_interop') as LibraryElementResult) diff --git a/tool/generator/banned_names.dart b/web_generator/lib/src/banned_names.dart similarity index 100% rename from tool/generator/banned_names.dart rename to web_generator/lib/src/banned_names.dart diff --git a/tool/generator/bcd.dart b/web_generator/lib/src/bcd.dart similarity index 100% rename from tool/generator/bcd.dart rename to web_generator/lib/src/bcd.dart diff --git a/tool/generator/dart_main.dart b/web_generator/lib/src/dart_main.dart similarity index 100% rename from tool/generator/dart_main.dart rename to web_generator/lib/src/dart_main.dart diff --git a/tool/generator/doc_provider.dart b/web_generator/lib/src/doc_provider.dart similarity index 96% rename from tool/generator/doc_provider.dart rename to web_generator/lib/src/doc_provider.dart index 3513ecde..05df73f2 100644 --- a/tool/generator/doc_provider.dart +++ b/web_generator/lib/src/doc_provider.dart @@ -14,7 +14,7 @@ import 'formatting.dart'; class DocProvider { static DocProvider create() { final content = fs.readFileSync( - p.join('..', '..', 'third_party', 'mdn', 'mdn.json').toJS, + p.join('..', '..', '..', 'third_party', 'mdn', 'mdn.json').toJS, JSReadFileOptions(encoding: 'utf8'.toJS), ) as JSString; diff --git a/tool/generator/filesystem_api.dart b/web_generator/lib/src/filesystem_api.dart similarity index 100% rename from tool/generator/filesystem_api.dart rename to web_generator/lib/src/filesystem_api.dart diff --git a/tool/generator/formatting.dart b/web_generator/lib/src/formatting.dart similarity index 100% rename from tool/generator/formatting.dart rename to web_generator/lib/src/formatting.dart diff --git a/tool/generator/generate_bindings.dart b/web_generator/lib/src/generate_bindings.dart similarity index 100% rename from tool/generator/generate_bindings.dart rename to web_generator/lib/src/generate_bindings.dart diff --git a/tool/generator/js_type_supertypes.dart b/web_generator/lib/src/js_type_supertypes.dart similarity index 93% rename from tool/generator/js_type_supertypes.dart rename to web_generator/lib/src/js_type_supertypes.dart index 121e8589..9878f768 100644 --- a/tool/generator/js_type_supertypes.dart +++ b/web_generator/lib/src/js_type_supertypes.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// Updated by tool/update_bindings.dart. Do not modify by hand. +// Updated by bin/update_bindings.dart. Do not modify by hand. const Map jsTypeSupertypes = { 'JSAny': null, diff --git a/tool/generator/main.mjs b/web_generator/lib/src/main.mjs similarity index 100% rename from tool/generator/main.mjs rename to web_generator/lib/src/main.mjs diff --git a/tool/generator/package-lock.json b/web_generator/lib/src/package-lock.json similarity index 100% rename from tool/generator/package-lock.json rename to web_generator/lib/src/package-lock.json diff --git a/tool/generator/package.json b/web_generator/lib/src/package.json similarity index 100% rename from tool/generator/package.json rename to web_generator/lib/src/package.json diff --git a/tool/generator/singletons.dart b/web_generator/lib/src/singletons.dart similarity index 100% rename from tool/generator/singletons.dart rename to web_generator/lib/src/singletons.dart diff --git a/tool/generator/translator.dart b/web_generator/lib/src/translator.dart similarity index 100% rename from tool/generator/translator.dart rename to web_generator/lib/src/translator.dart diff --git a/tool/generator/type_aliases.dart b/web_generator/lib/src/type_aliases.dart similarity index 100% rename from tool/generator/type_aliases.dart rename to web_generator/lib/src/type_aliases.dart diff --git a/tool/generator/type_union.dart b/web_generator/lib/src/type_union.dart similarity index 100% rename from tool/generator/type_union.dart rename to web_generator/lib/src/type_union.dart diff --git a/tool/generator/util.dart b/web_generator/lib/src/util.dart similarity index 90% rename from tool/generator/util.dart rename to web_generator/lib/src/util.dart index c464df96..3b2dd0ad 100644 --- a/tool/generator/util.dart +++ b/web_generator/lib/src/util.dart @@ -10,12 +10,6 @@ import 'filesystem_api.dart'; @JS('Object.entries') external JSArray objectEntries(JSObject o); -// TODO(srujzs): Remove once this is in dart:js_interop. -extension JSArrayExtension on JSArray { - external T operator [](int i); - external int get length; -} - void ensureDirectoryExists(String dir) { if (!fs.existsSync(dir.toJS).toDart) { fs.mkdirSync(dir.toJS, JSMkdirOptions(recursive: true.toJS)); diff --git a/tool/generator/webidl_api.dart b/web_generator/lib/src/webidl_api.dart similarity index 100% rename from tool/generator/webidl_api.dart rename to web_generator/lib/src/webidl_api.dart diff --git a/tool/generator/webref_css_api.dart b/web_generator/lib/src/webref_css_api.dart similarity index 100% rename from tool/generator/webref_css_api.dart rename to web_generator/lib/src/webref_css_api.dart diff --git a/tool/generator/webref_elements_api.dart b/web_generator/lib/src/webref_elements_api.dart similarity index 100% rename from tool/generator/webref_elements_api.dart rename to web_generator/lib/src/webref_elements_api.dart diff --git a/tool/generator/webref_idl_api.dart b/web_generator/lib/src/webref_idl_api.dart similarity index 100% rename from tool/generator/webref_idl_api.dart rename to web_generator/lib/src/webref_idl_api.dart diff --git a/web_generator/mono_pkg.yaml b/web_generator/mono_pkg.yaml new file mode 100644 index 00000000..0570b3a2 --- /dev/null +++ b/web_generator/mono_pkg.yaml @@ -0,0 +1,13 @@ +sdk: +- dev + +stages: +- analyze_and_format: + - analyze: --fatal-infos . + - format: +- unit_test: + - test: --test-randomize-ordering-seed=random -p chrome + - test: --test-randomize-ordering-seed=random -p chrome -c dart2wasm +- generate_and_analyze: + - command: dart bin/update_bindings.dart + - analyze: --fatal-infos . diff --git a/pubspec.yaml b/web_generator/pubspec.yaml similarity index 64% rename from pubspec.yaml rename to web_generator/pubspec.yaml index a2526d10..66fb95da 100644 --- a/pubspec.yaml +++ b/web_generator/pubspec.yaml @@ -1,12 +1,13 @@ -name: web -version: 1.1.0-wip -description: Lightweight browser API bindings built around JS interop. +name: web_generator +publish_to: none # internal only for now +version: 1.0.0-wip +description: Generator scripts for package:web. repository: https://github.com/dart-lang/web environment: - sdk: ^3.4.0 + sdk: ^3.6.0-0 -dev_dependencies: +dependencies: analyzer: ^6.3.0 args: ^2.4.0 build_runner: ^2.4.6 diff --git a/test/generate_docs_test.dart b/web_generator/test/generate_docs_test.dart similarity index 98% rename from test/generate_docs_test.dart rename to web_generator/test/generate_docs_test.dart index 00674a3a..0e7c043e 100644 --- a/test/generate_docs_test.dart +++ b/web_generator/test/generate_docs_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; -import '../tool/generator/formatting.dart'; +import 'package:web_generator/src/formatting.dart'; void main() { group('formatDocs', () { diff --git a/test/scrape_mdn_test.dart b/web_generator/test/scrape_mdn_test.dart similarity index 99% rename from test/scrape_mdn_test.dart rename to web_generator/test/scrape_mdn_test.dart index 2c495c30..ba93a9d8 100644 --- a/test/scrape_mdn_test.dart +++ b/web_generator/test/scrape_mdn_test.dart @@ -7,7 +7,7 @@ library; import 'package:test/test.dart'; -import '../tool/scrape_mdn.dart'; +import '../bin/scrape_mdn.dart'; void main() { group('convertMdnToMarkdown', () { diff --git a/test/type_union_test.dart b/web_generator/test/type_union_test.dart similarity index 96% rename from test/type_union_test.dart rename to web_generator/test/type_union_test.dart index a29032d6..464cbacc 100644 --- a/test/type_union_test.dart +++ b/web_generator/test/type_union_test.dart @@ -4,7 +4,7 @@ import 'package:test/test.dart'; -import '../tool/generator/type_union.dart'; +import 'package:web_generator/src/type_union.dart'; void main() { test('Non-JS types', () {