Skip to content
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

Merged
merged 22 commits into from
Sep 9, 2024

Conversation

queengooborg
Copy link
Contributor

@queengooborg queengooborg commented Aug 20, 2024

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 or npx 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 the BCD_PATH environment variable.

Closes #473.

Copy link
Collaborator

@Elchi3 Elchi3 left a 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"
],

@Elchi3
Copy link
Collaborator

Elchi3 commented Aug 20, 2024

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?

@queengooborg
Copy link
Contributor Author

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?

Copy link
Collaborator

@Elchi3 Elchi3 left a 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.

Copy link
Collaborator

@ddbeck ddbeck left a 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.

scripts/migrate-to-bcd.ts Outdated Show resolved Hide resolved
scripts/migrate-to-bcd.ts Outdated Show resolved Hide resolved
scripts/migrate-to-bcd.ts Outdated Show resolved Hide resolved
scripts/migrate-to-bcd.ts Outdated Show resolved Hide resolved
scripts/migrate-to-bcd.ts Outdated Show resolved Hide resolved
scripts/migrate-to-bcd.ts Outdated Show resolved Hide resolved
@Elchi3
Copy link
Collaborator

Elchi3 commented Sep 5, 2024

@queengooborg can you resolve the conflicts here?

@queengooborg queengooborg requested a review from ddbeck September 8, 2024 06:50
@ddbeck ddbeck merged commit a6d0ee0 into web-platform-dx:main Sep 9, 2024
3 checks passed
@queengooborg queengooborg deleted the migrate branch September 9, 2024 06:28
@ddbeck ddbeck mentioned this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants