https://github.com/thunderbird/webext-schemas-generator
Script to generate the content of webext-schemas
https://github.com/thunderbird/webext-schemas-generator
Last synced: 12 months ago
JSON representation
Script to generate the content of webext-schemas
- Host: GitHub
- URL: https://github.com/thunderbird/webext-schemas-generator
- Owner: thunderbird
- License: mpl-2.0
- Created: 2024-08-07T09:21:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-06T16:37:27.000Z (about 1 year ago)
- Last Synced: 2025-06-06T17:25:15.734Z (about 1 year ago)
- Language: JavaScript
- Size: 142 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Overview
========
This script processes Mozilla WebExtension API schema files by retrieving them either
from [`hg.mozilla.org`](https://hg.mozilla.org) or from a local checkout of the Mozilla
Mercurial code repository.
Schemas for APIs not supported by Thunderbird are excluded. The remaining schema files
are then processed as follows:
- `$import` keys are resolved by inlining the referenced entities.
- Entries not compatible with the requested manifest version are removed.
- URL placeholders in the form `$(url:key)[title]` within descriptions are replaced with
proper `` tags.
- Firefox schema files are enriched using [browser-compat-data](https://github.com/mdn/browser-compat-data).
- Thunderbird schema files are augmented with the `api_documentation_url` property.
- Thunderbird annotation files are merged into the final schema output.
For convenience, the Thunderbird team provides the processed output in the [webext-schemas](https://github.com/thunderbird/webext-schemas) repository.
Install needed packages
=======================
```
npm install
```
Usage
=====
```
node get_thunderbird_schema_files.js
```
Options
=======
```
--manifest_version=number - The requested manifest version of the schema
files. Allowed values are "2" and "3".
--output=path - Path of a folder to store the processed schema
files. All existing files in that folder will be
deleted.
--release=name - The name of the Thunderbird release to get the
schema files for. The files will be downloaded
from hg.mozilla.org. Examples: "central", "beta"
or "esr115". Either --release or --source has to
be specified.
--source=path - Path to a local checkout of a mozilla repository
with a matching /comm directory. Either --release
or --source has to be specified.
```