Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add instructions for re-generating the package #195

Merged
merged 3 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ definitions:
the number of breaking changes. This is currently WIP and some members may be
added or removed.

## Generation
## Generation and updating the package

Most of the APIs in this package are generated from public assets. See the
[tool directory](https://github.com/dart-lang/web/tree/main/tool) in the source
repository to learn more.
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.
39 changes: 39 additions & 0 deletions tool/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
## Updating the package

This Dart code in this package is generated from Web IDL definitions and MDN API
documentation.

### Regenerating the package

To regenerate the Dart code from the current IDL versions, run:

```shell
dart tool/update_bindings.dart
```

### Updating the dartdoc info from MDN

The 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 this documentation, run:

```shell
dart tool/scrape_mdn.dart
```

That will collect the MDN documentation into `third_party/mdn/mdn.json`. Running
the above command will update the mdn.json file; those changes 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:
Expand Down