You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(schema)!: align typedefs/linters with schema (#27428)
BREAKING CHANGE: Previously, TypeScript definitions for version fields were inconsistent with the schema. Now, definitions are aligned with the schema:
* `VersionValue` is now `string | false` (previously `string | boolean | null`).
* `version_added` is still `VersionValue` (without `true` or `null`).
* `version_removed` and `version_last` are now `string` (previously `VersionValue`).
Impact: Consumers may need to update their code handling these fields.
Copy file name to clipboardExpand all lines: docs/testing.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,18 +24,21 @@ For more information on the schema for browser data, see [`browsers-schema.md`](
24
24
25
25
## Generate statistics
26
26
27
-
To see how changes will affect the statistics of real (either `false` or a version number, as defined in [issue 3555](https://github.com/mdn/browser-compat-data/issues/3555)), true, and null values, you can run `npm run stats [folder]`. This generates a Markdown-formatted table of the percentages of real, true, and null values for the eight primary browsers that browser-compat-data is focusing on. The script also takes an optional argument regarding a specific folder (such as `api` or `javascript`), which will print statistics result for only that folder. Additionally, you can run the script with `--all` to get statistics for all browsers tracked in BCD, not just the primary eight.
27
+
To see how changes will affect the statistics of exact (formerly "real") and ranged values, you can run `npm run stats [folder]`. This generates a Markdown-formatted table of the percentages of exact and ranged values for the eight primary browsers that browser-compat-data is focusing on. The script also takes an optional argument regarding a specific folder (such as `api` or `javascript`), which will print statistics result for only that folder. Additionally, you can run the script with `--all` to get statistics for all browsers tracked in BCD, not just the primary eight.
28
+
29
+
> [!NOTE]
30
+
> Originally, this script was designed to track "real" (either `false` or a version number, as defined in [issue 3555](https://github.com/mdn/browser-compat-data/issues/3555)), ranged, true, and null values in order to track the progress of a project to eliminate "non-real" (true and null) values. Since the project was completed, the script was simplified to display just exact and ranged values.
28
31
29
32
## Traverse features
30
33
31
-
To find all the entries that are non-real, or of a specified value, you can run `npm run traverse -- [options] [folder]`.
34
+
To find all the entries that are of a specified value, you can run `npm run traverse -- [options] [folder]`.
32
35
33
-
By default, the script will traverse and print the dotted path to every feature. One or more positional arguments can limit the traversal to a specific folder (for example, `api`). Additional options can limit the features listed to features with data matching specific browser and version values (for example, `--non-real`).
36
+
By default, the script will traverse and print the dotted path to every feature. One or more positional arguments can limit the traversal to a specific folder (for example, `api`). Additional options can limit the features listed to features with data matching specific browser and version values.
34
37
35
38
Run `npm run traverse -- --help` for a complete list of options and examples.
36
39
37
40
The `-b` or `--browser` argument may be any browser in the [`browsers/` folder](https://github.com/mdn/browser-compat-data/blob/main/browsers/). This argument may be repeated to traverse multiple browsers. By default, the script will traverse all browsers.
38
41
39
-
The `-f` or `--filter` argument may be any value accepted by `version_added` or `version_removed`. This argument may be repeated to test multiple values. By default, the script will traverse all features regardless of their value. The `-n` or `--non-real` argument may be included as a convenience alias for `-f null -f true`.
42
+
The `-f` or `--filter` argument may be any value accepted by `version_added` or `version_removed`. This argument may be repeated to test multiple values. By default, the script will traverse all features regardless of their value.
40
43
41
-
Examples: to search for all Safari entries that are non-real, run `npm run traverse -- -b safari --non-real`. To search for all WebView entries that are marked as `true` in `api` and `javascript`, run `npm run traverse api,javascript -- -b webview_android -f true`. To search for all Firefox entries supported since `10` across all folders, run `npm run traverse -- -b firefox -f 10`.
44
+
Examples: to search for all Safari entries that are not supported, run `npm run traverse -- -b safari -f false`. To search for all WebView entries that are mirroring from upstream in `api` and `javascript`, run `npm run traverse api,javascript -- -b webview_android -f mirror`. To search for all Firefox entries supported since `10` across all folders, run `npm run traverse -- -b firefox -f 10`.
errorMessage+=chalk`Basic support in {bold ${browser}} was declared implemented in a later version ({bold ${parentValue}}) than the following sub-feature(s):`;
// Ensure that version_removed is not present if it's not applicable, such as when the upstream browser removed the feature in a newer release than a matching downstream browser
245
-
if(newData.version_removed===false){
244
+
if(typeofversionRemoved==='string'){
245
+
newData.version_removed=versionRemoved;
246
+
}else{
247
+
// Ensure that version_removed is not present if it's not applicable, such as when the upstream browser removed the feature in a newer release than a matching downstream browser
0 commit comments