Skip to content

Upgrade @webref/elements to 2.0.0 #1320

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

Merged
merged 3 commits into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 36 additions & 4 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7214,6 +7214,7 @@ interface HTMLMediaElement extends HTMLElement {
readonly played: TimeRanges;
/** Gets or sets a value indicating what data should be preloaded, if any. */
preload: "none" | "metadata" | "auto" | "";
preservesPitch: boolean;
readonly readyState: number;
readonly remote: RemotePlayback;
/** Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked. */
Expand Down Expand Up @@ -7580,16 +7581,25 @@ declare var HTMLParagraphElement: {
new(): HTMLParagraphElement;
};

/** 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. */
/**
* 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.
* @deprecated
*/
interface HTMLParamElement extends HTMLElement {
/** Sets or retrieves the name of an input parameter for an element. */
/**
* Sets or retrieves the name of an input parameter for an element.
* @deprecated
*/
name: string;
/**
* Sets or retrieves the content type of the resource designated by the value attribute.
* @deprecated
*/
type: string;
/** Sets or retrieves the value of an input parameter for an element. */
/**
* Sets or retrieves the value of an input parameter for an element.
* @deprecated
*/
value: string;
/**
* Sets or retrieves the data type of the value attribute.
Expand All @@ -7602,6 +7612,7 @@ interface HTMLParamElement extends HTMLElement {
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}

/** @deprecated */
declare var HTMLParamElement: {
prototype: HTMLParamElement;
new(): HTMLParamElement;
Expand Down Expand Up @@ -17502,7 +17513,6 @@ interface HTMLElementTagNameMap {
"option": HTMLOptionElement;
"output": HTMLOutputElement;
"p": HTMLParagraphElement;
"param": HTMLParamElement;
"picture": HTMLPictureElement;
"pre": HTMLPreElement;
"progress": HTMLProgressElement;
Expand Down Expand Up @@ -17544,12 +17554,34 @@ interface HTMLElementTagNameMap {
}

interface HTMLElementDeprecatedTagNameMap {
"acronym": HTMLElement;
"applet": HTMLUnknownElement;
"basefont": HTMLElement;
"bgsound": HTMLUnknownElement;
"big": HTMLElement;
"blink": HTMLUnknownElement;
"center": HTMLElement;
"dir": HTMLDirectoryElement;
"font": HTMLFontElement;
"frame": HTMLFrameElement;
"frameset": HTMLFrameSetElement;
"isindex": HTMLUnknownElement;
"keygen": HTMLUnknownElement;
"listing": HTMLPreElement;
"marquee": HTMLMarqueeElement;
"menuitem": HTMLElement;
"multicol": HTMLUnknownElement;
"nextid": HTMLUnknownElement;
"nobr": HTMLElement;
"noembed": HTMLElement;
"noframes": HTMLElement;
"param": HTMLParamElement;
"plaintext": HTMLElement;
"rb": HTMLElement;
"rtc": HTMLElement;
"spacer": HTMLUnknownElement;
"strike": HTMLElement;
"tt": HTMLElement;
"xmp": HTMLPreElement;
}

Expand Down
84 changes: 42 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,30 @@
"license": "Apache-2.0",
"type": "module",
"devDependencies": {
"@mdn/browser-compat-data": "^4.1.15",
"@mdn/browser-compat-data": "^4.1.18",
"@octokit/rest": "^18.12.0",
"@types/jsdom": "^16.2.14",
"@types/node": "^17.0.23",
"@types/prettier": "^2.4.4",
"@types/node": "^17.0.30",
"@types/prettier": "^2.6.0",
"@types/webidl2": "^23.13.6",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"@webref/css": "^3.1.0",
"@webref/elements": "^1.0.4",
"@webref/idl": "^3.6.1",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"@webref/css": "^4.0.1",
"@webref/elements": "^2.0.0",
"@webref/idl": "^3.8.0",
"bcd-idl-mapper": "^1.4.2",
"cpx2": "^4.2.0",
"danger": "^11.0.2",
"eslint": "^8.13.0",
"danger": "^11.0.5",
"eslint": "^8.14.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.0.0",
"jsdom": "^19.0.0",
"jsonc-parser": "^3.0.0",
"node-fetch": "^3.2.3",
"node-fetch": "^3.2.4",
"prettier": "^2.6.2",
"print-diff": "^1.0.0",
"styleless-innertext": "^1.1.3",
"typescript": "^4.6.3",
"typescript": "^4.6.4",
"webidl2": "^24.2.1"
}
}
18 changes: 10 additions & 8 deletions src/build/webref/elements.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { listAll } from "@webref/elements";
import { listAll, Element as WebrefElement } from "@webref/elements";
import { Interface, WebIdl } from "../types.js";
import { addToArrayMap } from "../utils/map.js";

async function getInterfaceToElementMap(): Promise<{
html: Map<string, string[]>;
svg: Map<string, string[]>;
html: Map<string, WebrefElement[]>;
svg: Map<string, WebrefElement[]>;
}> {
const all = await listAll();
const html = new Map<string, string[]>();
const svg = new Map<string, string[]>();
const html = new Map<string, WebrefElement[]>();
const svg = new Map<string, WebrefElement[]>();
for (const item of Object.values(all)) {
const { elements } = item;
for (const element of elements) {
if (!element.interface) {
continue;
}
const targetMap = element.interface.startsWith("SVG") ? svg : html;
addToArrayMap(targetMap, element.interface, element.name);
addToArrayMap(targetMap, element.interface, element);
}
}
return { html, svg };
Expand All @@ -28,15 +28,17 @@ export async function getInterfaceElementMergeData(): Promise<WebIdl> {
for (const [key, elements] of html) {
data.interfaces!.interface[key] = {
element: elements.map((el) => ({
name: el,
name: el.name,
deprecated: el.obsolete,
})),
} as Interface;
}
for (const [key, elements] of svg) {
data.interfaces!.interface[key] = {
element: elements.map((el) => ({
namespace: "SVG",
name: el,
name: el.name,
deprecated: el.obsolete,
})),
} as Interface;
}
Expand Down
1 change: 1 addition & 0 deletions src/build/webref/webref-elements.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ declare module "@webref/elements" {
interface Element {
name: string;
interface?: string;
obsolete?: true;
}
interface Item {
spec: Spec;
Expand Down