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

Implement addFile(…) and addDirectory(…) Transformer APIs #208

Closed

Conversation

ExE-Boss
Copy link
Contributor

@ExE-Boss ExE-Boss commented Apr 22, 2020

Part of #160


I implemented addFile(…) and addDirectory(…) to match addSource(…), except with an optional impl path argument.

This also fixes the bug where:

const transformer = new WebIDL2JS();

transformer.addSource("path/to/Attr.webidl", "path/to/Attr-impl.js");
// ... add the rest, one file at a time. The client is responsible for directory iteration.

await transformer.generate("outputDir");

Would result in outputDir/Attr.js requiring path/to/Attr‑impl.js/Attr.js instead of path/to/Attr‑impl.js, because the wrapper generation code currently assumes that the impl path argument is always a directory.

This doesn’t yet implement addFromGlob or a way to feed in dynamically generated partial interface definitions (#188).


This will also make it possible to implement jsdom/jsdom#2835 without renaming Window.js (jsdom/jsdom#2837) by utilising the above mention impl path name fix.

@domenic
Copy link
Member

domenic commented Apr 22, 2020

Can you discuss your proposal in #160 first?

@domenic
Copy link
Member

domenic commented Apr 29, 2020

Let's close this until we have an agreed-upon design for the API in #160.

@domenic domenic closed this Apr 29, 2020
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.

None yet

2 participants