Expose a consistent API for both ESM and CJS #555
Conversation
b5ed36b
to
1b2cc54
Compare
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.
@willdurand this looks good (well, it is basically the same test we landed in the web-ext repo :-P), follows just a couple of nits
In particular I'm wondering if it would be a good idea to use tmp-promise and avoid copy and paste the TempDir class from the web-ext repo just for one functional test, what do you think?
(As an additional side note, we have to also rebase this pull request to fix the conflicts with the package-lock.json file, I guess that we may have merged some renovatebot pull request in the meantime).
I updated this patch. |
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.
@willdurand this looks good to me, there are a couple of nits, but the actual reason why I haven't just accepted this version is that it looks that we should move shelljs and tmp (and I guess also the packages related to the typescript type definitions) from the dependencies to the devDependencies (and also update the package-lock.json to reflect that change).
Thanks for the review! |
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.
@willdurand lgtm, r+wc (I think that we can move also the two @types/shell and @types/tmp dependencies to devDependencies, right?)
Fixes #517
This will require a new major version as the default import has changed (and it might not work with web-ext, see below), but the API should be more consistent now. I also ported some "test-util" code from
web-ext
.Patch for web-ext: