Add support for Node.js platform on JS / TS templates (#390)
This commit is contained in:
Родитель
0fcf91c920
Коммит
1d95d550ce
|
@ -2,6 +2,8 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
- Add support for Node.js platform on Javascript / Typescript templates. ([bug 1728982](https://bugzilla.mozilla.org/show_bug.cgi?id=1728982))
|
||||
|
||||
## 4.0.0 (2021-08-20)
|
||||
|
||||
- Add support for Text metric type ([#374](https://github.com/mozilla/glean_parser/pull/374))
|
||||
|
|
|
@ -11,7 +11,7 @@ Outputter to generate Javascript code for metrics.
|
|||
import enum
|
||||
import json
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Optional, Union, Callable # noqa
|
||||
from typing import Any, Dict, Optional, Callable
|
||||
|
||||
from . import metrics
|
||||
from . import util
|
||||
|
@ -123,9 +123,10 @@ def output(
|
|||
options = {}
|
||||
|
||||
platform = options.get("platform", "webext")
|
||||
if platform not in ["qt", "webext"]:
|
||||
accepted_platforms = ["qt", "webext", "node"]
|
||||
if platform not in accepted_platforms:
|
||||
raise ValueError(
|
||||
f"Unknown platform: {platform}. Accepted platforms are qt and webext."
|
||||
f"Unknown platform: {platform}. Accepted platforms are: {accepted_platforms}." # noqa
|
||||
)
|
||||
version = options.get("version")
|
||||
if platform == "qt" and version is None:
|
||||
|
|
Загрузка…
Ссылка в новой задаче