Skip to content

Commit aa3050e

Browse files
saschanazorta
andauthored
Upgrade @webref/elements to 2.0.0 (#1320)
* 🤖 Update core dependencies * Put deprecated ones into HTMLElementDeprecatedTagNameMap * Webref Co-authored-by: orta <[email protected]>
1 parent 1ea3a36 commit aa3050e

File tree

5 files changed

+101
-66
lines changed

5 files changed

+101
-66
lines changed

baselines/dom.generated.d.ts

+36-4
Original file line numberDiff line numberDiff line change
@@ -7214,6 +7214,7 @@ interface HTMLMediaElement extends HTMLElement {
72147214
readonly played: TimeRanges;
72157215
/** Gets or sets a value indicating what data should be preloaded, if any. */
72167216
preload: "none" | "metadata" | "auto" | "";
7217+
preservesPitch: boolean;
72177218
readonly readyState: number;
72187219
readonly remote: RemotePlayback;
72197220
/** Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */
@@ -7580,16 +7581,25 @@ declare var HTMLParagraphElement: {
75807581
new(): HTMLParagraphElement;
75817582
};
75827583

7583-
/** Provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element. */
7584+
/**
7585+
* Provides special properties (beyond those of the regular HTMLElement object interface it inherits) for manipulating <param> elements, representing a pair of a key and a value that acts as a parameter for an <object> element.
7586+
* @deprecated
7587+
*/
75847588
interface HTMLParamElement extends HTMLElement {
7585-
/** Sets or retrieves the name of an input parameter for an element. */
7589+
/**
7590+
* Sets or retrieves the name of an input parameter for an element.
7591+
* @deprecated
7592+
*/
75867593
name: string;
75877594
/**
75887595
* Sets or retrieves the content type of the resource designated by the value attribute.
75897596
* @deprecated
75907597
*/
75917598
type: string;
7592-
/** Sets or retrieves the value of an input parameter for an element. */
7599+
/**
7600+
* Sets or retrieves the value of an input parameter for an element.
7601+
* @deprecated
7602+
*/
75937603
value: string;
75947604
/**
75957605
* Sets or retrieves the data type of the value attribute.
@@ -7602,6 +7612,7 @@ interface HTMLParamElement extends HTMLElement {
76027612
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
76037613
}
76047614

7615+
/** @deprecated */
76057616
declare var HTMLParamElement: {
76067617
prototype: HTMLParamElement;
76077618
new(): HTMLParamElement;
@@ -17502,7 +17513,6 @@ interface HTMLElementTagNameMap {
1750217513
"option": HTMLOptionElement;
1750317514
"output": HTMLOutputElement;
1750417515
"p": HTMLParagraphElement;
17505-
"param": HTMLParamElement;
1750617516
"picture": HTMLPictureElement;
1750717517
"pre": HTMLPreElement;
1750817518
"progress": HTMLProgressElement;
@@ -17544,12 +17554,34 @@ interface HTMLElementTagNameMap {
1754417554
}
1754517555

1754617556
interface HTMLElementDeprecatedTagNameMap {
17557+
"acronym": HTMLElement;
17558+
"applet": HTMLUnknownElement;
17559+
"basefont": HTMLElement;
17560+
"bgsound": HTMLUnknownElement;
17561+
"big": HTMLElement;
17562+
"blink": HTMLUnknownElement;
17563+
"center": HTMLElement;
1754717564
"dir": HTMLDirectoryElement;
1754817565
"font": HTMLFontElement;
1754917566
"frame": HTMLFrameElement;
1755017567
"frameset": HTMLFrameSetElement;
17568+
"isindex": HTMLUnknownElement;
17569+
"keygen": HTMLUnknownElement;
1755117570
"listing": HTMLPreElement;
1755217571
"marquee": HTMLMarqueeElement;
17572+
"menuitem": HTMLElement;
17573+
"multicol": HTMLUnknownElement;
17574+
"nextid": HTMLUnknownElement;
17575+
"nobr": HTMLElement;
17576+
"noembed": HTMLElement;
17577+
"noframes": HTMLElement;
17578+
"param": HTMLParamElement;
17579+
"plaintext": HTMLElement;
17580+
"rb": HTMLElement;
17581+
"rtc": HTMLElement;
17582+
"spacer": HTMLUnknownElement;
17583+
"strike": HTMLElement;
17584+
"tt": HTMLElement;
1755317585
"xmp": HTMLPreElement;
1755417586
}
1755517587

package-lock.json

+42-42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -39,30 +39,30 @@
3939
"license": "Apache-2.0",
4040
"type": "module",
4141
"devDependencies": {
42-
"@mdn/browser-compat-data": "^4.1.15",
42+
"@mdn/browser-compat-data": "^4.1.18",
4343
"@octokit/rest": "^18.12.0",
4444
"@types/jsdom": "^16.2.14",
45-
"@types/node": "^17.0.23",
46-
"@types/prettier": "^2.4.4",
45+
"@types/node": "^17.0.30",
46+
"@types/prettier": "^2.6.0",
4747
"@types/webidl2": "^23.13.6",
48-
"@typescript-eslint/eslint-plugin": "^5.18.0",
49-
"@typescript-eslint/parser": "^5.18.0",
50-
"@webref/css": "^3.1.0",
51-
"@webref/elements": "^1.0.4",
52-
"@webref/idl": "^3.6.1",
48+
"@typescript-eslint/eslint-plugin": "^5.21.0",
49+
"@typescript-eslint/parser": "^5.21.0",
50+
"@webref/css": "^4.0.1",
51+
"@webref/elements": "^2.0.0",
52+
"@webref/idl": "^3.8.0",
5353
"bcd-idl-mapper": "^1.4.2",
5454
"cpx2": "^4.2.0",
55-
"danger": "^11.0.2",
56-
"eslint": "^8.13.0",
55+
"danger": "^11.0.5",
56+
"eslint": "^8.14.0",
5757
"eslint-config-prettier": "^8.5.0",
5858
"eslint-plugin-prettier": "^4.0.0",
5959
"jsdom": "^19.0.0",
6060
"jsonc-parser": "^3.0.0",
61-
"node-fetch": "^3.2.3",
61+
"node-fetch": "^3.2.4",
6262
"prettier": "^2.6.2",
6363
"print-diff": "^1.0.0",
6464
"styleless-innertext": "^1.1.3",
65-
"typescript": "^4.6.3",
65+
"typescript": "^4.6.4",
6666
"webidl2": "^24.2.1"
6767
}
6868
}

src/build/webref/elements.ts

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { listAll } from "@webref/elements";
1+
import { listAll, Element as WebrefElement } from "@webref/elements";
22
import { Interface, WebIdl } from "../types.js";
33
import { addToArrayMap } from "../utils/map.js";
44

55
async function getInterfaceToElementMap(): Promise<{
6-
html: Map<string, string[]>;
7-
svg: Map<string, string[]>;
6+
html: Map<string, WebrefElement[]>;
7+
svg: Map<string, WebrefElement[]>;
88
}> {
99
const all = await listAll();
10-
const html = new Map<string, string[]>();
11-
const svg = new Map<string, string[]>();
10+
const html = new Map<string, WebrefElement[]>();
11+
const svg = new Map<string, WebrefElement[]>();
1212
for (const item of Object.values(all)) {
1313
const { elements } = item;
1414
for (const element of elements) {
1515
if (!element.interface) {
1616
continue;
1717
}
1818
const targetMap = element.interface.startsWith("SVG") ? svg : html;
19-
addToArrayMap(targetMap, element.interface, element.name);
19+
addToArrayMap(targetMap, element.interface, element);
2020
}
2121
}
2222
return { html, svg };
@@ -28,15 +28,17 @@ export async function getInterfaceElementMergeData(): Promise<WebIdl> {
2828
for (const [key, elements] of html) {
2929
data.interfaces!.interface[key] = {
3030
element: elements.map((el) => ({
31-
name: el,
31+
name: el.name,
32+
deprecated: el.obsolete,
3233
})),
3334
} as Interface;
3435
}
3536
for (const [key, elements] of svg) {
3637
data.interfaces!.interface[key] = {
3738
element: elements.map((el) => ({
3839
namespace: "SVG",
39-
name: el,
40+
name: el.name,
41+
deprecated: el.obsolete,
4042
})),
4143
} as Interface;
4244
}

src/build/webref/webref-elements.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ declare module "@webref/elements" {
66
interface Element {
77
name: string;
88
interface?: string;
9+
obsolete?: true;
910
}
1011
interface Item {
1112
spec: Spec;

0 commit comments

Comments
 (0)