From 24f7cdad0e9de7770a260cedd5c92b9b84b17d34 Mon Sep 17 00:00:00 2001 From: Bashamega Date: Thu, 3 Apr 2025 14:12:04 +0200 Subject: [PATCH 1/2] feat create a generate command --- .github/workflows/update-core-deps.yml | 2 +- README.md | 4 ++-- package.json | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update-core-deps.yml b/.github/workflows/update-core-deps.yml index ac8a9b5cf..30fc1b40f 100644 --- a/.github/workflows/update-core-deps.yml +++ b/.github/workflows/update-core-deps.yml @@ -27,7 +27,7 @@ jobs: # Example: https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1463 - run: npm i - id: build - run: npm run build && npm run baseline-accept + run: npm run generate continue-on-error: true - if: ${{ steps.build.outcome == 'failure' }} run: node deploy/onUpdateFailure.js diff --git a/README.md b/README.md index 4578dbc4a..dbd9e9229 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,13 @@ In order to make the tests pass, please update the baseline as well in any pull It's possible that the automated algorithm decided that it's not well supported by browsers and thus removed it. Say we want to add a new interface named `Foo`. Check if there is a document about that interface in [MDN](https://developer.mozilla.org/). If there is, see the browser compatibility section and check whether it's supported by two or more browser engines. (Note that Chromium-based browsers use the same browser engine and thus support from them counts as a single support.) -If all the conditions are fulfilled, it could be that the type is incorrectly removed by `inputfiles/removedTypes.jsonc`. Try finding and removing the relevant item there and run `npm run build && npm run baseline-accept`. +If all the conditions are fulfilled, it could be that the type is incorrectly removed by `inputfiles/removedTypes.jsonc`. Try finding and removing the relevant item there and run `npm run generate`. If conditions are not fulfilled but you think MDN is wrong, please file an issue at https://github.com/mdn/browser-compat-data/issues/. The type will be automatically added in a few weeks when MDN fixes their data. ### When the type exists but is wrong -It's possible that the type is too specific or too general. First you need to check whether `inputfiles/overridingTypes.jsonc` or `inputfiles/addedTypes.jsonc` have a relevant item, which can be fixed if exists. If they don't, add one in `overridingTypes.jsonc`. Run `npm run build && npm run baseline-accept` to make sure the resulting changes are what you want. +It's possible that the type is too specific or too general. First you need to check whether `inputfiles/overridingTypes.jsonc` or `inputfiles/addedTypes.jsonc` have a relevant item, which can be fixed if exists. If they don't, add one in `overridingTypes.jsonc`. Run `npm run generate` to make sure the resulting changes are what you want. If you are familiar with Web IDL, you may also want to check whether the upstream IDL itself can be made more specific. Doing so will reduce the need for manual overrides in this repository and thus can be more helpful. diff --git a/package.json b/package.json index 93f41712d..a4f3e2b71 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "changelog": "tsc && node ./lib/changelog.js", "ts-changelog": "node ./deploy/versionChangelog.js", "migrate": "node ./deploy/migrate.js", - "version": "npm i && tsc && node ./lib/version.js" + "version": "npm i && tsc && node ./lib/version.js", + "generate": "npm run generate" }, "author": { "name": "Kagami Sascha Rosylight", From a8ad8dec18396cc42e57a03e06f90e36a3e810d6 Mon Sep 17 00:00:00 2001 From: Adam Basha <110662505+Bashamega@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:13:27 +0200 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a4f3e2b71..61d823b17 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "ts-changelog": "node ./deploy/versionChangelog.js", "migrate": "node ./deploy/migrate.js", "version": "npm i && tsc && node ./lib/version.js", - "generate": "npm run generate" + "generate": "npm run build && npm run baseline-accept" }, "author": { "name": "Kagami Sascha Rosylight",