WEB-76699 MDN: move generation module to the tools directory.

GitOrigin-RevId: 9beab73f45aafae904837c110233c5d5bf2960d2
This commit is contained in:
Piotr Tomiak
2026-02-05 19:08:04 +00:00
committed by intellij-monorepo-bot
parent 7af1204c62
commit ae3eee86cd
30 changed files with 0 additions and 3636 deletions
@@ -7,7 +7,6 @@
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/resources-gen" type="java-resource" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/mdn-doc-gen/work" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
-2
View File
@@ -1,2 +0,0 @@
work/
baseline-server/node_modules/
@@ -1,40 +0,0 @@
import data from "../work/browser-compat-data.json" with { type: "json" };
import { computeBaseline } from "compute-baseline";
import { Compat } from "compute-baseline/browser-compat-data";
import * as readline from 'readline';
const compat = new Compat(data);
// Create readline interface to read from stdin
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
// Process each line from stdin
rl.on('line', (line) => {
if (line.trim()) {
try {
const result = computeBaseline({
compatKeys: [line],
checkAncestors: true
}, compat);
// Output the result as a single line to stdout
console.log(JSON.stringify(result));
} catch (e) {
if ((e.message?.indexOf("is unindexable at") ?? -1) > 0) {
console.error(e.message)
} else {
console.error(e)
}
console.log("\"null\"")
}
}
});
// Handle end of input
rl.on('close', () => {
process.exit(0);
});
@@ -1,84 +0,0 @@
{
"name": "baseline-server",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "baseline-server",
"dependencies": {
"compute-baseline": "0.3.1"
},
"devDependencies": {
"@types/node": "20.10.0"
}
},
"node_modules/@js-temporal/polyfill": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/@js-temporal/polyfill/-/polyfill-0.4.4.tgz",
"integrity": "sha512-2X6bvghJ/JAoZO52lbgyAPFj8uCflhTo2g7nkFzEQdXd/D8rEeD4HtmTEpmtGCva260fcd66YNXBOYdnmHqSOg==",
"license": "ISC",
"dependencies": {
"jsbi": "^4.3.0",
"tslib": "^2.4.1"
},
"engines": {
"node": ">=12"
}
},
"node_modules/@mdn/browser-compat-data": {
"version": "6.0.12",
"resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-6.0.12.tgz",
"integrity": "sha512-lQ6p212jKeJBG+L7UYRKchTCcnQbp6yOj5swKxGLjvuW4SmbgWgd/WyA1Dxq1GGT86C7jVTEaKry36LmsBp8SQ==",
"license": "CC0-1.0",
"peer": true
},
"node_modules/@types/node": {
"version": "20.10.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz",
"integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/compare-versions": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-6.1.1.tgz",
"integrity": "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg==",
"license": "MIT"
},
"node_modules/compute-baseline": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/compute-baseline/-/compute-baseline-0.3.1.tgz",
"integrity": "sha512-fehgbBh5UG4H5AemyVXWaviTwUbcPduhaD9iHWfkIy5fv2xFou/Zfs5z0VISXJyUEDzThe84MMofNOZ/qd0K6g==",
"license": "Apache-2.0",
"dependencies": {
"@js-temporal/polyfill": "^0.4.4",
"compare-versions": "^6.1.1"
},
"peerDependencies": {
"@mdn/browser-compat-data": "^6.0.1"
}
},
"node_modules/jsbi": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/jsbi/-/jsbi-4.3.2.tgz",
"integrity": "sha512-9fqMSQbhJykSeii05nxKl4m6Eqn2P6rOlYiS+C5Dr/HPIU/7yZxu5qzbs40tgaFORiw2Amd0mirjxatXYMkIew==",
"license": "Apache-2.0"
},
"node_modules/tslib": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
"license": "0BSD"
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true,
"license": "MIT"
}
}
}
@@ -1,14 +0,0 @@
{
"name": "baseline-server",
"private": "true",
"type": "module",
"scripts": {
"start": "node index.mjs"
},
"dependencies": {
"compute-baseline": "0.3.1"
},
"devDependencies": {
"@types/node": "20.10.0"
}
}
@@ -1,84 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>intellij.bcd</groupId>
<version>1.0.0</version>
<artifactId>bcd-gen-root</artifactId>
</parent>
<artifactId>bcd-gen</artifactId>
<packaging>pom</packaging>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>compile</phase>
<configuration>
<filesets>
<fileset>
<directory>${basedir}/../../gen/com/intellij/bcd/json/</directory>
<includes>
<include>**/*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jsonschema2pojo</groupId>
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
<version>1.0.2</version>
<configuration>
<annotationStyle>JACKSON2</annotationStyle>
<includeAdditionalProperties>true</includeAdditionalProperties>
<includeHashcodeAndEquals>false</includeHashcodeAndEquals>
<includeToString>false</includeToString>
<targetVersion>1.8</targetVersion>
<targetPackage>com.intellij.bcd.json</targetPackage>
<sourceDirectory>${basedir}/../resources/bcd.json</sourceDirectory>
<sourceType>JSONSCHEMA</sourceType>
<outputDirectory>${basedir}/../../gen/</outputDirectory>
<customRuleFactory>com.intellij.polySymbols.webTypes.gen.WebTypesRuleFactory</customRuleFactory>
</configuration>
<dependencies>
<dependency>
<groupId>intellij.polySymbols</groupId>
<artifactId>web-types-ext</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson2x.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson2x.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -1,52 +0,0 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>intellij.bcd</groupId>
<artifactId>bcd-gen-root</artifactId>
<packaging>pom</packaging>
<version>1.0.0</version>
<modules>
<module>gen</module>
<module>../../../../platform/polySymbols/web-types-gen/ext</module>
</modules>
<!-- To generate POJOs for bcd run :compile target -->
<!-- bcd.json is located in resources folder -->
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jackson2x.version>2.12.0</jackson2x.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson2x.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>${jackson2x.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
@@ -1,306 +0,0 @@
{
"$schema": "http://json-schema.org/schema#",
"definitions": {
"simple_support_statement": {
"type": "object",
"properties": {
"version_added": {
"description": "A string (indicating which browser version added this feature), the value true (indicating support added in an unknown version), the value false (indicating the feature is not supported), or the value null (indicating support is unknown).",
"anyOf": [
{
"type": "string",
"pattern": "^(≤?(\\d+)(\\.\\d+)*|preview)$"
},
{
"type": "boolean",
"nullable": true
}
],
"tsType": "VersionValue"
},
"version_removed": {
"description": "A string, indicating which browser version removed this feature, or the value true, indicating that the feature was removed in an unknown version.",
"anyOf": [
{
"type": "string",
"pattern": "^(≤?(\\d+)(\\.\\d+)*|preview)$"
},
{
"type": "boolean",
"const": true
}
],
"tsType": "VersionValue"
},
"prefix": {
"type": "string",
"description": "A prefix to add to the sub-feature name (defaults to empty string). If applicable, leading and trailing '-' must be included."
},
"alternative_name": {
"type": "string",
"description": "An alternative name for the feature, for cases where a feature is implemented under an entirely different name and not just prefixed."
},
"flags": {
"type": "array",
"description": "An optional array of objects describing flags that must be configured for this browser to support this feature.",
"minItems": 1,
"items": {
"$ref": "#/definitions/flag_statement"
},
"tsType": "FlagStatement[]"
},
"impl_url": {
"anyOf": [
{
"$ref": "#/definitions/impl_url_value"
},
{
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/definitions/impl_url_value"
}
}
],
"description": "An optional changeset/commit URL for the revision which implemented the feature in the source code, or the URL to the bug tracking the implementation, for the associated browser.",
"tsType": "string | string[]",
"errorMessage": {
"pattern": "impl_url must be a link to a browser commit or bug URL. URLs must be in shortened form (ex. bugs.chromium.org -> crbug.com). Note: `npm run fix` may resolve these issues."
}
},
"partial_implementation": {
"const": true,
"description": "A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example)."
},
"notes": {
"description": "A string or array of strings containing additional information.",
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"minItems": 2,
"items": {
"type": "string"
}
}
],
"tsType": "string | string[]"
}
},
"required": ["version_added"],
"dependencies": {
"partial_implementation": {
"if": {
"properties": { "partial_implementation": { "const": true } }
},
"then": { "required": ["notes"] }
}
},
"additionalProperties": false
},
"flag_statement": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "An enum that indicates the flag type.",
"enum": ["preference", "runtime_flag"]
},
"name": {
"type": "string",
"description": "A string giving the name of the flag or preference that must be configured."
},
"value_to_set": {
"type": "string",
"description": "A string giving the value which the specified flag must be set to for this feature to work."
}
},
"additionalProperties": false,
"required": ["type", "name"]
},
"support_statement": {
"anyOf": [
{ "$ref": "#/definitions/simple_support_statement" },
{
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/definitions/simple_support_statement"
}
},
{
"type": "string",
"const": "mirror"
}
],
"tsType": "SimpleSupportStatement | SimpleSupportStatement[]"
},
"status_block": {
"type": "object",
"properties": {
"experimental": {
"type": "boolean",
"description": "A boolean value that indicates whether this functionality is intended to be an addition to the Web platform. Set to false, it means the functionality is mature, and no significant incompatible changes are expected in the future."
},
"standard_track": {
"type": "boolean",
"description": "A boolean value indicating whether the feature is part of an active specification or specification process."
},
"deprecated": {
"type": "boolean",
"description": "A boolean value that indicates whether the feature is no longer recommended. It might be removed in the future or might only be kept for compatibility purposes. Avoid using this functionality."
}
},
"required": ["experimental", "standard_track", "deprecated"],
"additionalProperties": false
},
"support_block": {
"type": "object",
"propertyNames": {
"enum": [
"chrome",
"chrome_android",
"deno",
"edge",
"firefox",
"firefox_android",
"ie",
"nodejs",
"oculus",
"opera",
"opera_android",
"safari",
"safari_ios",
"samsunginternet_android",
"webview_android"
]
},
"additionalProperties": {
"$ref": "#/definitions/support_statement"
},
"tsType": "Partial<Record<BrowserName, SupportStatement>>"
},
"spec_url_value": {
"type": "string",
"pattern": "(^https://[^#]+#.+)|(^https://registry.khronos.org/webgl/extensions/[^/]+/)"
},
"impl_url_value": {
"type": "string",
"pattern": "^https://(trac.webkit.org/changeset/|hg.mozilla.org/mozilla-central/rev/|crrev.com/|bugzil.la/|crbug.com/|webkit.org/b/)"
},
"compat_statement": {
"type": "object",
"properties": {
"description": {
"type": "string",
"description": "A string containing a human-readable description of the feature."
},
"mdn_url": {
"type": "string",
"pattern": "^https://developer\\.mozilla\\.org/docs/",
"description": "A URL that points to an MDN reference page documenting the feature. The URL should be language-agnostic."
},
"spec_url": {
"anyOf": [
{
"$ref": "#/definitions/spec_url_value"
},
{
"type": "array",
"minItems": 2,
"items": {
"$ref": "#/definitions/spec_url_value"
}
}
],
"description": "An optional URL or array of URLs, each of which is for a specific part of a specification in which this feature is defined. Each URL must contain a fragment identifier.",
"tsType": "string | string[]"
},
"source_file": {
"type": "string",
"description": "The path to the file that defines this feature in browser-compat-data, relative to the repository root. Useful for guiding potential contributors towards the correct file to edit. This is automatically generated at build time and should never manually be specified."
},
"support": {
"$ref": "#/definitions/support_block",
"description": "The data for the support of each browser, containing a `support_statement` object for each browser identifier with information about versions, prefixes, or alternate names, as well as notes."
},
"status": {
"$ref": "#/definitions/status_block",
"description": "An object containing information about the stability of the feature."
}
},
"required": ["support"],
"additionalProperties": false
},
"identifier": {
"type": "object",
"properties": {
"__compat": {
"type": "object",
"$ref": "#/definitions/compat_statement",
"required": ["status"],
"description": "A feature is described by an identifier containing the `__compat` property.\n\nIn other words, identifiers without `__compat` aren't necessarily features, but help to nest the features properly.\n\nWhen an identifier has a `__compat` block, it represents its basic support, indicating that a minimal implementation of a functionality is included.\n\nWhat it represents exactly depends of the evolution of the feature over time, both in terms of specifications and of browser support.",
"tsType": "CompatStatement"
}
},
"additionalProperties": {
"$ref": "#/definitions/identifier"
},
"errorMessage": {
"additionalProperties": "Feature names can only contain alphanumerical characters or the following symbols: _-$@"
},
"tsType": "{[key: string]: Identifier} & {__compat?: CompatStatement};"
},
"webextensions_identifier": {
"type": "object",
"properties": {
"__compat": { "$ref": "#/definitions/compat_statement" }
},
"additionalProperties": {
"$ref": "#/definitions/webextensions_identifier",
"tsType": "Identifier"
},
"errorMessage": {
"additionalProperties": "Feature names can only contain alphanumerical characters or the following symbols: _-$@"
},
"tsType": "{[key: string]: Identifier} & {__compat?: CompatStatement}"
}
},
"title": "CompatDataFile",
"type": "object",
"properties": {
"__compat": {
"$ref": "#/definitions/compat_statement"
},
"__meta": {
"type": "object"
},
"browsers": {
"type": "object"
},
"webextensions": {
"type": "object"
}
},
"additionalProperties": {
"$ref": "#/definitions/identifier"
},
"errorMessage": {
"additionalProperties": "Feature names can only contain alphanumerical characters or the following symbols: _-$@"
},
"maxProperties": 1,
"minProperties": 1
}
@@ -1,90 +0,0 @@
package com.intellij.bcd.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
/**
* CompatDataFile
* <p>
*
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"__compat",
"__meta",
"browsers",
"webextensions"
})
public class Bcd {
@JsonProperty("__compat")
private CompatStatement compat;
@JsonProperty("__meta")
private Meta meta;
@JsonProperty("browsers")
private Browsers browsers;
@JsonProperty("webextensions")
private Webextensions webextensions;
@JsonIgnore
private Map<String, Identifier> additionalProperties = new HashMap<String, Identifier>();
@JsonProperty("__compat")
public CompatStatement getCompat() {
return compat;
}
@JsonProperty("__compat")
public void setCompat(CompatStatement compat) {
this.compat = compat;
}
@JsonProperty("__meta")
public Meta getMeta() {
return meta;
}
@JsonProperty("__meta")
public void setMeta(Meta meta) {
this.meta = meta;
}
@JsonProperty("browsers")
public Browsers getBrowsers() {
return browsers;
}
@JsonProperty("browsers")
public void setBrowsers(Browsers browsers) {
this.browsers = browsers;
}
@JsonProperty("webextensions")
public Webextensions getWebextensions() {
return webextensions;
}
@JsonProperty("webextensions")
public void setWebextensions(Webextensions webextensions) {
this.webextensions = webextensions;
}
@JsonAnyGetter
public Map<String, Identifier> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Identifier value) {
this.additionalProperties.put(name, value);
}
}
@@ -1,31 +0,0 @@
package com.intellij.bcd.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
})
public class Browsers {
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
@@ -1,160 +0,0 @@
package com.intellij.bcd.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"description",
"mdn_url",
"spec_url",
"source_file",
"support",
"status"
})
public class CompatStatement {
/**
* A string containing a human-readable description of the feature.
*
*/
@JsonProperty("description")
@JsonPropertyDescription("A string containing a human-readable description of the feature.")
private String description;
/**
* A URL that points to an MDN reference page documenting the feature. The URL should be language-agnostic.
*
*/
@JsonProperty("mdn_url")
@JsonPropertyDescription("A URL that points to an MDN reference page documenting the feature. The URL should be language-agnostic.")
private String mdnUrl;
/**
* An optional URL or array of URLs, each of which is for a specific part of a specification in which this feature is defined. Each URL must contain a fragment identifier.
*
*/
@JsonProperty("spec_url")
@JsonPropertyDescription("An optional URL or array of URLs, each of which is for a specific part of a specification in which this feature is defined. Each URL must contain a fragment identifier.")
private SpecUrl specUrl;
/**
* The path to the file that defines this feature in browser-compat-data, relative to the repository root. Useful for guiding potential contributors towards the correct file to edit. This is automatically generated at build time and should never manually be specified.
*
*/
@JsonProperty("source_file")
@JsonPropertyDescription("The path to the file that defines this feature in browser-compat-data, relative to the repository root. Useful for guiding potential contributors towards the correct file to edit. This is automatically generated at build time and should never manually be specified.")
private String sourceFile;
/**
*
* (Required)
*
*/
@JsonProperty("support")
private SupportBlock support;
@JsonProperty("status")
private StatusBlock status;
/**
* A string containing a human-readable description of the feature.
*
*/
@JsonProperty("description")
public String getDescription() {
return description;
}
/**
* A string containing a human-readable description of the feature.
*
*/
@JsonProperty("description")
public void setDescription(String description) {
this.description = description;
}
/**
* A URL that points to an MDN reference page documenting the feature. The URL should be language-agnostic.
*
*/
@JsonProperty("mdn_url")
public String getMdnUrl() {
return mdnUrl;
}
/**
* A URL that points to an MDN reference page documenting the feature. The URL should be language-agnostic.
*
*/
@JsonProperty("mdn_url")
public void setMdnUrl(String mdnUrl) {
this.mdnUrl = mdnUrl;
}
/**
* An optional URL or array of URLs, each of which is for a specific part of a specification in which this feature is defined. Each URL must contain a fragment identifier.
*
*/
@JsonProperty("spec_url")
public SpecUrl getSpecUrl() {
return specUrl;
}
/**
* An optional URL or array of URLs, each of which is for a specific part of a specification in which this feature is defined. Each URL must contain a fragment identifier.
*
*/
@JsonProperty("spec_url")
public void setSpecUrl(SpecUrl specUrl) {
this.specUrl = specUrl;
}
/**
* The path to the file that defines this feature in browser-compat-data, relative to the repository root. Useful for guiding potential contributors towards the correct file to edit. This is automatically generated at build time and should never manually be specified.
*
*/
@JsonProperty("source_file")
public String getSourceFile() {
return sourceFile;
}
/**
* The path to the file that defines this feature in browser-compat-data, relative to the repository root. Useful for guiding potential contributors towards the correct file to edit. This is automatically generated at build time and should never manually be specified.
*
*/
@JsonProperty("source_file")
public void setSourceFile(String sourceFile) {
this.sourceFile = sourceFile;
}
/**
*
* (Required)
*
*/
@JsonProperty("support")
public SupportBlock getSupport() {
return support;
}
/**
*
* (Required)
*
*/
@JsonProperty("support")
public void setSupport(SupportBlock support) {
this.support = support;
}
@JsonProperty("status")
public StatusBlock getStatus() {
return status;
}
@JsonProperty("status")
public void setStatus(StatusBlock status) {
this.status = status;
}
}
@@ -1,147 +0,0 @@
package com.intellij.bcd.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"type",
"name",
"value_to_set"
})
public class FlagStatement {
/**
* An enum that indicates the flag type.
* (Required)
*
*/
@JsonProperty("type")
@JsonPropertyDescription("An enum that indicates the flag type.")
private FlagStatement.Type type;
/**
* A string giving the name of the flag or preference that must be configured.
* (Required)
*
*/
@JsonProperty("name")
@JsonPropertyDescription("A string giving the name of the flag or preference that must be configured.")
private String name;
/**
* A string giving the value which the specified flag must be set to for this feature to work.
*
*/
@JsonProperty("value_to_set")
@JsonPropertyDescription("A string giving the value which the specified flag must be set to for this feature to work.")
private String valueToSet;
/**
* An enum that indicates the flag type.
* (Required)
*
*/
@JsonProperty("type")
public FlagStatement.Type getType() {
return type;
}
/**
* An enum that indicates the flag type.
* (Required)
*
*/
@JsonProperty("type")
public void setType(FlagStatement.Type type) {
this.type = type;
}
/**
* A string giving the name of the flag or preference that must be configured.
* (Required)
*
*/
@JsonProperty("name")
public String getName() {
return name;
}
/**
* A string giving the name of the flag or preference that must be configured.
* (Required)
*
*/
@JsonProperty("name")
public void setName(String name) {
this.name = name;
}
/**
* A string giving the value which the specified flag must be set to for this feature to work.
*
*/
@JsonProperty("value_to_set")
public String getValueToSet() {
return valueToSet;
}
/**
* A string giving the value which the specified flag must be set to for this feature to work.
*
*/
@JsonProperty("value_to_set")
public void setValueToSet(String valueToSet) {
this.valueToSet = valueToSet;
}
/**
* An enum that indicates the flag type.
*
*/
public enum Type {
PREFERENCE("preference"),
RUNTIME_FLAG("runtime_flag");
private final String value;
private final static Map<String, FlagStatement.Type> CONSTANTS = new HashMap<String, FlagStatement.Type>();
static {
for (FlagStatement.Type c: values()) {
CONSTANTS.put(c.value, c);
}
}
private Type(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static FlagStatement.Type fromValue(String value) {
FlagStatement.Type constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}
@@ -1,44 +0,0 @@
package com.intellij.bcd.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"__compat"
})
public class Identifier {
@JsonProperty("__compat")
private CompatStatement compat;
@JsonIgnore
private Map<String, Identifier> additionalProperties = new HashMap<String, Identifier>();
@JsonProperty("__compat")
public CompatStatement getCompat() {
return compat;
}
@JsonProperty("__compat")
public void setCompat(CompatStatement compat) {
this.compat = compat;
}
@JsonAnyGetter
public Map<String, Identifier> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Identifier value) {
this.additionalProperties.put(name, value);
}
}
@@ -1,50 +0,0 @@
package com.intellij.bcd.json;
import java.io.IOException;
import java.util.ArrayList;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = ImplUrl.MyDeserializer.class)
public class ImplUrl
extends ArrayList<String>
{
public static class MyDeserializer
extends JsonDeserializer<ImplUrl>
{
@Override
public ImplUrl deserialize(JsonParser parser, DeserializationContext deserializationContext)
throws IOException
{
ImplUrl result = new ImplUrl();
JsonToken token = parser.currentToken();
if (token == JsonToken.START_ARRAY) {
while (parser.nextToken()!= JsonToken.END_ARRAY) {
token = parser.currentToken();
if (token == JsonToken.VALUE_STRING) {
result.add(parser.readValueAs(String.class));
} else {
deserializationContext.handleUnexpectedToken(String.class, parser);
}
}
} else {
if (token == JsonToken.VALUE_STRING) {
result.add(parser.readValueAs(String.class));
} else {
deserializationContext.handleUnexpectedToken(String.class, parser);
}
}
return result;
}
}
}
@@ -1,31 +0,0 @@
package com.intellij.bcd.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
})
public class Meta {
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
@@ -1,50 +0,0 @@
package com.intellij.bcd.json;
import java.io.IOException;
import java.util.ArrayList;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = Notes.MyDeserializer.class)
public class Notes
extends ArrayList<String>
{
public static class MyDeserializer
extends JsonDeserializer<Notes>
{
@Override
public Notes deserialize(JsonParser parser, DeserializationContext deserializationContext)
throws IOException
{
Notes result = new Notes();
JsonToken token = parser.currentToken();
if (token == JsonToken.START_ARRAY) {
while (parser.nextToken()!= JsonToken.END_ARRAY) {
token = parser.currentToken();
if (token == JsonToken.VALUE_STRING) {
result.add(parser.readValueAs(String.class));
} else {
deserializationContext.handleUnexpectedToken(String.class, parser);
}
}
} else {
if (token == JsonToken.VALUE_STRING) {
result.add(parser.readValueAs(String.class));
} else {
deserializationContext.handleUnexpectedToken(String.class, parser);
}
}
return result;
}
}
}
@@ -1,228 +0,0 @@
package com.intellij.bcd.json;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"version_added",
"version_removed",
"prefix",
"alternative_name",
"flags",
"impl_url",
"partial_implementation",
"notes"
})
public class SimpleSupportStatement {
/**
* A string (indicating which browser version added this feature), the value true (indicating support added in an unknown version), the value false (indicating the feature is not supported), or the value null (indicating support is unknown).
* (Required)
*
*/
@JsonProperty("version_added")
@JsonPropertyDescription("A string (indicating which browser version added this feature), the value true (indicating support added in an unknown version), the value false (indicating the feature is not supported), or the value null (indicating support is unknown).")
private VersionAdded versionAdded;
/**
* A string, indicating which browser version removed this feature, or the value true, indicating that the feature was removed in an unknown version.
*
*/
@JsonProperty("version_removed")
@JsonPropertyDescription("A string, indicating which browser version removed this feature, or the value true, indicating that the feature was removed in an unknown version.")
private VersionRemoved versionRemoved;
/**
* A prefix to add to the sub-feature name (defaults to empty string). If applicable, leading and trailing '-' must be included.
*
*/
@JsonProperty("prefix")
@JsonPropertyDescription("A prefix to add to the sub-feature name (defaults to empty string). If applicable, leading and trailing '-' must be included.")
private String prefix;
/**
* An alternative name for the feature, for cases where a feature is implemented under an entirely different name and not just prefixed.
*
*/
@JsonProperty("alternative_name")
@JsonPropertyDescription("An alternative name for the feature, for cases where a feature is implemented under an entirely different name and not just prefixed.")
private String alternativeName;
/**
* An optional array of objects describing flags that must be configured for this browser to support this feature.
*
*/
@JsonProperty("flags")
@JsonPropertyDescription("An optional array of objects describing flags that must be configured for this browser to support this feature.")
private List<FlagStatement> flags = new ArrayList<FlagStatement>();
/**
* An optional changeset/commit URL for the revision which implemented the feature in the source code, or the URL to the bug tracking the implementation, for the associated browser.
*
*/
@JsonProperty("impl_url")
@JsonPropertyDescription("An optional changeset/commit URL for the revision which implemented the feature in the source code, or the URL to the bug tracking the implementation, for the associated browser.")
private ImplUrl implUrl;
/**
* A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example).
*
*/
@JsonProperty("partial_implementation")
@JsonPropertyDescription("A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example).")
private Object partialImplementation;
/**
* A string or array of strings containing additional information.
*
*/
@JsonProperty("notes")
@JsonPropertyDescription("A string or array of strings containing additional information.")
private Notes notes;
/**
* A string (indicating which browser version added this feature), the value true (indicating support added in an unknown version), the value false (indicating the feature is not supported), or the value null (indicating support is unknown).
* (Required)
*
*/
@JsonProperty("version_added")
public VersionAdded getVersionAdded() {
return versionAdded;
}
/**
* A string (indicating which browser version added this feature), the value true (indicating support added in an unknown version), the value false (indicating the feature is not supported), or the value null (indicating support is unknown).
* (Required)
*
*/
@JsonProperty("version_added")
public void setVersionAdded(VersionAdded versionAdded) {
this.versionAdded = versionAdded;
}
/**
* A string, indicating which browser version removed this feature, or the value true, indicating that the feature was removed in an unknown version.
*
*/
@JsonProperty("version_removed")
public VersionRemoved getVersionRemoved() {
return versionRemoved;
}
/**
* A string, indicating which browser version removed this feature, or the value true, indicating that the feature was removed in an unknown version.
*
*/
@JsonProperty("version_removed")
public void setVersionRemoved(VersionRemoved versionRemoved) {
this.versionRemoved = versionRemoved;
}
/**
* A prefix to add to the sub-feature name (defaults to empty string). If applicable, leading and trailing '-' must be included.
*
*/
@JsonProperty("prefix")
public String getPrefix() {
return prefix;
}
/**
* A prefix to add to the sub-feature name (defaults to empty string). If applicable, leading and trailing '-' must be included.
*
*/
@JsonProperty("prefix")
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
* An alternative name for the feature, for cases where a feature is implemented under an entirely different name and not just prefixed.
*
*/
@JsonProperty("alternative_name")
public String getAlternativeName() {
return alternativeName;
}
/**
* An alternative name for the feature, for cases where a feature is implemented under an entirely different name and not just prefixed.
*
*/
@JsonProperty("alternative_name")
public void setAlternativeName(String alternativeName) {
this.alternativeName = alternativeName;
}
/**
* An optional array of objects describing flags that must be configured for this browser to support this feature.
*
*/
@JsonProperty("flags")
public List<FlagStatement> getFlags() {
return flags;
}
/**
* An optional array of objects describing flags that must be configured for this browser to support this feature.
*
*/
@JsonProperty("flags")
public void setFlags(List<FlagStatement> flags) {
this.flags = flags;
}
/**
* An optional changeset/commit URL for the revision which implemented the feature in the source code, or the URL to the bug tracking the implementation, for the associated browser.
*
*/
@JsonProperty("impl_url")
public ImplUrl getImplUrl() {
return implUrl;
}
/**
* An optional changeset/commit URL for the revision which implemented the feature in the source code, or the URL to the bug tracking the implementation, for the associated browser.
*
*/
@JsonProperty("impl_url")
public void setImplUrl(ImplUrl implUrl) {
this.implUrl = implUrl;
}
/**
* A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example).
*
*/
@JsonProperty("partial_implementation")
public Object getPartialImplementation() {
return partialImplementation;
}
/**
* A boolean value indicating whether or not the implementation of the sub-feature deviates from the specification in a way that may cause compatibility problems. It defaults to false (no interoperability problems expected). If set to true, it is recommended that you add a note explaining how it diverges from the standard (such as that it implements an old version of the standard, for example).
*
*/
@JsonProperty("partial_implementation")
public void setPartialImplementation(Object partialImplementation) {
this.partialImplementation = partialImplementation;
}
/**
* A string or array of strings containing additional information.
*
*/
@JsonProperty("notes")
public Notes getNotes() {
return notes;
}
/**
* A string or array of strings containing additional information.
*
*/
@JsonProperty("notes")
public void setNotes(Notes notes) {
this.notes = notes;
}
}
@@ -1,50 +0,0 @@
package com.intellij.bcd.json;
import java.io.IOException;
import java.util.ArrayList;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = SpecUrl.MyDeserializer.class)
public class SpecUrl
extends ArrayList<String>
{
public static class MyDeserializer
extends JsonDeserializer<SpecUrl>
{
@Override
public SpecUrl deserialize(JsonParser parser, DeserializationContext deserializationContext)
throws IOException
{
SpecUrl result = new SpecUrl();
JsonToken token = parser.currentToken();
if (token == JsonToken.START_ARRAY) {
while (parser.nextToken()!= JsonToken.END_ARRAY) {
token = parser.currentToken();
if (token == JsonToken.VALUE_STRING) {
result.add(parser.readValueAs(String.class));
} else {
deserializationContext.handleUnexpectedToken(String.class, parser);
}
}
} else {
if (token == JsonToken.VALUE_STRING) {
result.add(parser.readValueAs(String.class));
} else {
deserializationContext.handleUnexpectedToken(String.class, parser);
}
}
return result;
}
}
}
@@ -1,102 +0,0 @@
package com.intellij.bcd.json;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"experimental",
"standard_track",
"deprecated"
})
public class StatusBlock {
/**
* A boolean value that indicates whether this functionality is intended to be an addition to the Web platform. Set to false, it means the functionality is mature, and no significant incompatible changes are expected in the future.
* (Required)
*
*/
@JsonProperty("experimental")
@JsonPropertyDescription("A boolean value that indicates whether this functionality is intended to be an addition to the Web platform. Set to false, it means the functionality is mature, and no significant incompatible changes are expected in the future.")
private Boolean experimental;
/**
* A boolean value indicating whether the feature is part of an active specification or specification process.
* (Required)
*
*/
@JsonProperty("standard_track")
@JsonPropertyDescription("A boolean value indicating whether the feature is part of an active specification or specification process.")
private Boolean standardTrack;
/**
* A boolean value that indicates whether the feature is no longer recommended. It might be removed in the future or might only be kept for compatibility purposes. Avoid using this functionality.
* (Required)
*
*/
@JsonProperty("deprecated")
@JsonPropertyDescription("A boolean value that indicates whether the feature is no longer recommended. It might be removed in the future or might only be kept for compatibility purposes. Avoid using this functionality.")
private Boolean deprecated;
/**
* A boolean value that indicates whether this functionality is intended to be an addition to the Web platform. Set to false, it means the functionality is mature, and no significant incompatible changes are expected in the future.
* (Required)
*
*/
@JsonProperty("experimental")
public Boolean getExperimental() {
return experimental;
}
/**
* A boolean value that indicates whether this functionality is intended to be an addition to the Web platform. Set to false, it means the functionality is mature, and no significant incompatible changes are expected in the future.
* (Required)
*
*/
@JsonProperty("experimental")
public void setExperimental(Boolean experimental) {
this.experimental = experimental;
}
/**
* A boolean value indicating whether the feature is part of an active specification or specification process.
* (Required)
*
*/
@JsonProperty("standard_track")
public Boolean getStandardTrack() {
return standardTrack;
}
/**
* A boolean value indicating whether the feature is part of an active specification or specification process.
* (Required)
*
*/
@JsonProperty("standard_track")
public void setStandardTrack(Boolean standardTrack) {
this.standardTrack = standardTrack;
}
/**
* A boolean value that indicates whether the feature is no longer recommended. It might be removed in the future or might only be kept for compatibility purposes. Avoid using this functionality.
* (Required)
*
*/
@JsonProperty("deprecated")
public Boolean getDeprecated() {
return deprecated;
}
/**
* A boolean value that indicates whether the feature is no longer recommended. It might be removed in the future or might only be kept for compatibility purposes. Avoid using this functionality.
* (Required)
*
*/
@JsonProperty("deprecated")
public void setDeprecated(Boolean deprecated) {
this.deprecated = deprecated;
}
}
@@ -1,31 +0,0 @@
package com.intellij.bcd.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
})
public class SupportBlock {
@JsonIgnore
private Map<String, SupportStatement> additionalProperties = new HashMap<String, SupportStatement>();
@JsonAnyGetter
public Map<String, SupportStatement> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, SupportStatement value) {
this.additionalProperties.put(name, value);
}
}
@@ -1,66 +0,0 @@
package com.intellij.bcd.json;
import java.io.IOException;
import java.util.List;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = SupportStatement.MyDeserializer.class)
public class SupportStatement {
/**
* Type: {@code SimpleSupportStatement | List<SimpleSupportStatement> | String}
*
*/
private Object value;
/**
* Type: {@code SimpleSupportStatement | List<SimpleSupportStatement> | String}
*
*/
public Object getValue() {
return value;
}
/**
* Type: {@code SimpleSupportStatement | List<SimpleSupportStatement> | String}
*
*/
public void setValue(Object value) {
this.value = value;
}
public static class MyDeserializer
extends JsonDeserializer<SupportStatement>
{
@Override
public SupportStatement deserialize(JsonParser parser, DeserializationContext deserializationContext)
throws IOException
{
SupportStatement result = new SupportStatement();
JsonToken token = parser.currentToken();
if (token == JsonToken.START_OBJECT) {
result.value = parser.readValueAs(SimpleSupportStatement.class);
} else {
if (token == JsonToken.START_ARRAY) {
result.value = parser.getCodec().readValue(parser, deserializationContext.getTypeFactory().constructParametricType(List.class, SimpleSupportStatement.class));
} else {
if (token == JsonToken.VALUE_STRING) {
result.value = parser.readValueAs(String.class);
} else {
deserializationContext.handleUnexpectedToken(Object.class, parser);
}
}
}
return result;
}
}
}
@@ -1,61 +0,0 @@
package com.intellij.bcd.json;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = VersionAdded.MyDeserializer.class)
public class VersionAdded {
/**
* Type: {@code String | Boolean}
*
*/
private Object value;
/**
* Type: {@code String | Boolean}
*
*/
public Object getValue() {
return value;
}
/**
* Type: {@code String | Boolean}
*
*/
public void setValue(Object value) {
this.value = value;
}
public static class MyDeserializer
extends JsonDeserializer<VersionAdded>
{
@Override
public VersionAdded deserialize(JsonParser parser, DeserializationContext deserializationContext)
throws IOException
{
VersionAdded result = new VersionAdded();
JsonToken token = parser.currentToken();
if (token == JsonToken.VALUE_STRING) {
result.value = parser.readValueAs(String.class);
} else {
if ((token == JsonToken.VALUE_TRUE)||(token == JsonToken.VALUE_FALSE)) {
result.value = parser.readValueAs(Boolean.class);
} else {
deserializationContext.handleUnexpectedToken(Object.class, parser);
}
}
return result;
}
}
}
@@ -1,61 +0,0 @@
package com.intellij.bcd.json;
import java.io.IOException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = VersionRemoved.MyDeserializer.class)
public class VersionRemoved {
/**
* Type: {@code String | Boolean}
*
*/
private Object value;
/**
* Type: {@code String | Boolean}
*
*/
public Object getValue() {
return value;
}
/**
* Type: {@code String | Boolean}
*
*/
public void setValue(Object value) {
this.value = value;
}
public static class MyDeserializer
extends JsonDeserializer<VersionRemoved>
{
@Override
public VersionRemoved deserialize(JsonParser parser, DeserializationContext deserializationContext)
throws IOException
{
VersionRemoved result = new VersionRemoved();
JsonToken token = parser.currentToken();
if (token == JsonToken.VALUE_STRING) {
result.value = parser.readValueAs(String.class);
} else {
if ((token == JsonToken.VALUE_TRUE)||(token == JsonToken.VALUE_FALSE)) {
result.value = parser.readValueAs(Boolean.class);
} else {
deserializationContext.handleUnexpectedToken(Object.class, parser);
}
}
return result;
}
}
}
@@ -1,31 +0,0 @@
package com.intellij.bcd.json;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
})
public class Webextensions {
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
@JsonAnyGetter
public Map<String, Object> getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
}
@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/gen" isTestSource="false" generated="true" />
<excludeFolder url="file://$MODULE_DIR$/work" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="intellij.platform.util" />
<orderEntry type="module" module-name="intellij.platform.core" />
<orderEntry type="library" name="gson" level="project" />
<orderEntry type="module" module-name="intellij.xml.psi" />
<orderEntry type="module" module-name="intellij.xml.psi.impl" />
<orderEntry type="module" module-name="intellij.relaxng" />
<orderEntry type="module" module-name="intellij.platform.testFramework" scope="TEST" />
<orderEntry type="module" module-name="intellij.xml.impl" />
<orderEntry type="library" name="jackson-databind" level="project" />
<orderEntry type="library" name="jackson" level="project" />
<orderEntry type="library" name="jackson-module-kotlin" level="project" />
<orderEntry type="module" module-name="intellij.xml.langInjection" />
<orderEntry type="module" module-name="intellij.platform.codeStyle" />
<orderEntry type="module" module-name="intellij.xml.parser" />
<orderEntry type="module" module-name="intellij.platform.indexing" />
<orderEntry type="module" module-name="intellij.platform.analysis.impl" />
<orderEntry type="module" module-name="intellij.javascript.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.angular.backend" scope="TEST" />
<orderEntry type="module" module-name="intellij.vuejs.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.xml.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.javascript.web.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.css.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.html.tools.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.react.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.astro.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.angular.tests" scope="TEST" />
<orderEntry type="module" module-name="intellij.platform.projectModel" scope="TEST" />
<orderEntry type="module" module-name="intellij.javascript.analysis.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.javascript.psi.impl" scope="TEST" />
<orderEntry type="module" module-name="intellij.idea.ultimate.tests.main" scope="TEST" />
</component>
</module>
@@ -1,113 +0,0 @@
import com.google.gson.GsonBuilder
import com.google.gson.JsonObject
import com.intellij.lang.javascript.JSStringUtil
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.util.io.FileUtil
import java.io.BufferedReader
import java.io.BufferedWriter
import java.io.File
import java.io.IOException
object BaseLineService {
private val logger = com.intellij.openapi.diagnostic.Logger.getInstance(BaseLineService::class.java)
private var process: Process? = null
private var writer: BufferedWriter? = null
private var reader: BufferedReader? = null
private val gson = GsonBuilder().create()
@Synchronized
fun start() {
if (process != null) {
return
}
try {
val baselineServerPath = FileUtil.toSystemDependentName(
"${PathManager.getCommunityHomePath()}/xml/xml-psi-impl/mdn-doc-gen/baseline-server"
)
val processBuilder = ProcessBuilder("node", "index.mjs")
processBuilder.directory(File(baselineServerPath))
processBuilder.redirectError(ProcessBuilder.Redirect.INHERIT)
process = processBuilder.start()
writer = process!!.outputStream.bufferedWriter()
reader = process!!.inputStream.bufferedReader()
// Add shutdown hook to ensure process is terminated when JVM exits
Runtime.getRuntime().addShutdownHook(Thread {
stop()
})
}
catch (e: Exception) {
logger.error("Failed to start BaseLineService", e)
stop()
throw e
}
}
@Synchronized
fun stop() {
try {
try {
writer?.close()
}
catch (_: IOException) {
}
try {
reader?.close()
}
catch (_: IOException) {
}
process?.let {
if (it.isAlive) {
it.destroy()
it.waitFor(5, java.util.concurrent.TimeUnit.SECONDS)
if (it.isAlive) {
it.destroyForcibly()
}
}
}
}
catch (e: Exception) {
logger.error("Error stopping BaseLineService", e)
}
finally {
writer = null
reader = null
process = null
logger.info("BaseLineService stopped")
}
}
@Synchronized
fun computeBaseline(compatKey: String): JsonObject? {
if (process == null || writer == null || reader == null) {
start()
}
try {
// Write the compatKey to stdin
writer!!.write(compatKey)
writer!!.newLine()
writer!!.flush()
// Read the response from stdout
val response = reader!!.readLine() ?: return null
// Parse the JSON response
val json = JSStringUtil.unquoteAndUnescapeString(response)
if (json == "null")
return null
return gson.fromJson(json, JsonObject::class.java)
}
catch (e: Exception) {
logger.error("Error computing baseline for key: $compatKey", e)
if (e is IOException) {
stop()
start()
}
return null
}
}
}
@@ -1,32 +0,0 @@
import com.fasterxml.jackson.databind.DeserializationFeature
import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.type.TypeFactory
import com.intellij.bcd.json.Bcd
import com.intellij.bcd.json.Identifier
import java.io.File
import java.io.InputStream
fun readBcd(path: String): Bcd =
File(path).inputStream().readBcd()
fun Bcd.resolve(path: String): Identifier =
tryResolve(path) ?: throw RuntimeException("Failed to resolve $path")
fun Bcd.tryResolve(path: String): Identifier? {
val segments = path.split('.', '/')
if (segments.isEmpty()) return null
var result = this.additionalProperties[segments[0]]
?: return null
for (segment in segments.subList(1, segments.size)) {
result = result.additionalProperties[segment]
?: return null
}
return result
}
private val objectMapper = ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
.setTypeFactory(TypeFactory.defaultInstance().withClassLoader(Bcd::class.java.classLoader))
private fun InputStream.readBcd(): Bcd =
objectMapper.readValue(this, Bcd::class.java)
File diff suppressed because it is too large Load Diff
@@ -1,44 +0,0 @@
import com.intellij.codeInsight.XmlDocumentationTest
import com.intellij.html.HtmlDocumentationTest
import com.intellij.htmltools.codeInsight.daemon.HtmlHighlightingTest
import com.intellij.lang.javascript.JSDocumentationTest
import com.intellij.lang.javascript.typescript.TypeScriptDocumentationTest
import com.intellij.lang.javascript.typescript.service.TypeScriptServiceDocumentationTest
import com.intellij.polySymbols.js.css.PolySymbolsCssCodeCompletionTest
import com.intellij.polySymbols.js.html.PolySymbolsHtmlDocumentationTest
import com.intellij.polySymbols.js.html.PolySymbolsHtmlLookupDocumentationTest
import com.intellij.react.ReactDocumentationTest
import com.intellij.react.tsc.ReactDocumentationWithServiceTest
import css.CssDocumentationTest
import org.angular2.codeInsight.Angular2DocumentationTest
import org.angular2.codeInsight.deprecated.Angular2AttributesTest
import org.angular2.resharper.Angular2HtmlCodeCompletionTest
import org.jetbrains.astro.codeInsight.AstroDocumentationTest
import org.jetbrains.vuejs.lang.VueCompletionTest
import org.jetbrains.vuejs.lang.VueDocumentationTest
import org.junit.runner.RunWith
import org.junit.runners.Suite
@RunWith(Suite::class)
@Suite.SuiteClasses(
HtmlDocumentationTest::class,
XmlDocumentationTest::class,
HtmlHighlightingTest::class,
PolySymbolsHtmlDocumentationTest::class,
PolySymbolsHtmlLookupDocumentationTest::class,
PolySymbolsCssCodeCompletionTest::class,
CssDocumentationTest::class,
JSDocumentationTest::class,
TypeScriptDocumentationTest::class,
TypeScriptServiceDocumentationTest::class,
ReactDocumentationTest::class,
ReactDocumentationWithServiceTest::class,
Angular2DocumentationTest::class,
Angular2AttributesTest::class,
Angular2HtmlCodeCompletionTest::class,
VueDocumentationTest::class,
VueCompletionTest::class,
AstroDocumentationTest::class,
/* Additionally, run `Compile Rider Backend` and the `BlazorDocumentationTest` */
)
class MdnDocUpdateTestSuite
@@ -1,39 +0,0 @@
#!/bin/bash
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )";
cd "$DIR/../baseline-server"
npm install
mkdir -p "$DIR/../work"
cd "$DIR/../work"
rm -f browser-compat-data.json
wget "https://unpkg.com/@mdn/browser-compat-data/data.json" -O browser-compat-data.json
if [ ! -d "mdn-content" ]; then
git clone https://github.com/mdn/content.git mdn-content
fi
cd "mdn-content"
git pull
yarn install
cd ..
if [ ! -d "yari" ]; then
git clone https://github.com/mdn/yari.git yari
fi
cd "yari"
git reset --hard
git pull
rm -Rf cloud-function
yarn install
export CONTENT_ROOT="$DIR/../work/mdn-content/files"
yarn build:prepare
yarn build
echo "Done!"