-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add script to migrate features to BCD tags #1622
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Vinyl! The BCD path works great for me.
I think we want to rename the file from migrate.ts to migrate-to-bcd.ts.
The script doesn't handle renames or removals. How hard would it be to implement that? See #1605 that renamed growable-sharedarraybuffer to resizable-buffers, for example. If I run migrate, I end up with
"tags": [
"web-features:snapshot:ecmascript-2024",
"web-features:growable-sharedarraybuffer",
"web-features:resizable-buffers"
],
Desired would be:
"tags": [
"web-features:snapshot:ecmascript-2024",
"web-features:resizable-buffers"
],
Thanks, that works great for me! The tags are added to the bottom of the JSON in BCD. Should we run "npm run fix" in BCD in the script somehow to fix that? |
We could do that, but I think that it'd be better to do so outside of the script -- for example, during a GitHub Actions workflow. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way would be fine with me.
Approving but waiting for another owner to review this PR before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @queengooborg. Some questions and suggestions in line comments.
This is for consistency with the collector.
@queengooborg can you resolve the conflicts here? |
This PR is a continuation off of #473, which adds a script that migrates the data for the BCD features that are included in each feature to tags within BCD. To run, simply run
node --loader=ts-node/esm scripts/migrate-to-bcd.ts ../browser-compat-data
ornpx tsx scripts/migrate-to-bcd.ts ../browser-compat-data
.The key difference between this PR and the original is that the BCD path has been replaced to use a relative path by default, which expects the BCD folder to be right next to the
web-features
folder -- but more importantly, the path can be overridden with theBCD_PATH
environment variable.Closes #473.