mdn / browser-compat-data

This repository contains compatibility data for Web technologies as displayed on MDN
https://developer.mozilla.org
Creative Commons Zero v1.0 Universal
4.85k stars 1.94k forks source link

Add a CLI tool for adding new features #12060

Open Elchi3 opened 2 years ago

Elchi3 commented 2 years ago

(This came up in yesterday's Open Web Docs Steering Committee call)

It would be nice if BCD offers a tool to generate skeleton data for new features.

For example, I need to add api.XRSession.frameRate. Right now, I would need to copy paste from existing data. It would be nice if I could do something like npm run add-feature api.XRSession.frameRate and it would add an all-false entry.

In later versions, this could be enhanced and maybe take an IDL file to create BCD structures from it, etc.

@foolip mentioned there is prior art, let's try to get that into here for everyone then :)

foolip commented 2 years ago

@jpmedley @vinyldarkscratch do either of you have bits of code that handle the problem of deciding which file to put a new feature in? I think that's the hard part here, actually inserting a feature with a bunch of default values is easy.

jpmedley commented 2 years ago

I built my own IDL parser because Google's was out of date with current IDL standards and bugs weren't being addressed fast enough.

What I do is maybe more complicated than what you want. I have a IDL FileProcessor() https://github.com/jpmedley/mdn-helper/blob/main/fileprocessor.js That emits an InterfaceData() https://github.com/jpmedley/mdn-helper/blob/main/interfacedata.js object. (They're not in the same module because IDL files in Chrome may contain multiple structures.) I then pass that to a BCDBuilder() https://github.com/jpmedley/mdn-helper/blob/main/bcdbuilder.js object, which writes a BCD dummy file. My system doesn't have access to data to fill it, so it still has to be edited by hand. Joe Medley | Technical Writer, Chrome DevRel | @.** | 816-678-7195 If an API's not documented it doesn't exist.*

On Fri, Aug 20, 2021 at 2:13 AM Philip Jägenstedt @.***> wrote:

@jpmedley https://github.com/jpmedley @vinyldarkscratch https://github.com/vinyldarkscratch do either of you have bits of code that handle the problem of deciding which file to put a new feature in? I think that's the hard part here, actually inserting a feature with a bunch of default values is easy.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mdn/browser-compat-data/issues/12060#issuecomment-902554649, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6S7C3C5PUUNCD2PXB4FHDT5YMDHANCNFSM5CN3GPSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

queengooborg commented 2 weeks ago

Would it be safe to consider this a duplicate of #7934?