Skip to content

Conversation

willdurand
Copy link
Member

@willdurand willdurand commented Jun 3, 2022

We started to convert our libraries to ES Modules. This PR does that for
this package, which is written with TypeScript and obviously ESM isn't a
first class citizen there (yet?).

This is needed for converting addons-linter to ES Modules. Actually,
it is more of a nice to have but not required. That being said, converting
this package will allow us to keep up with the dependency updates.

@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.05 ⚠️

Comparison is base (5fbc283) 97.48% compared to head (46faad9) 97.43%.

❗ Current head 46faad9 differs from pull request most recent head e048960. Consider uploading reports for the commit e048960 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #244      +/-   ##
==========================================
- Coverage   97.48%   97.43%   -0.05%     
==========================================
  Files          11       11              
  Lines         437      429       -8     
  Branches       97       96       -1     
==========================================
- Hits          426      418       -8     
  Misses         11       11              
Impacted Files Coverage Δ
src/constants.ts 100.00% <ø> (ø)
src/io/constants.ts 100.00% <ø> (ø)
src/io/utils.ts 100.00% <ø> (ø)
src/test-helpers.ts 97.05% <ø> (ø)
src/io/base.ts 97.72% <100.00%> (ø)
src/io/crx.ts 100.00% <100.00%> (ø)
src/io/directory.ts 100.00% <100.00%> (ø)
src/io/xpi.ts 96.03% <100.00%> (-0.08%) ⬇️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@willdurand willdurand requested a review from rpl June 3, 2022 11:33
Copy link
Member

@rpl rpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just one questions related to the values sets in tsconfig.json, compared to what we have been setting in mozilla/sign-addon#1077.

@willdurand willdurand requested a review from rpl June 3, 2022 15:56
Copy link
Member

@rpl rpl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I was wondering: should we make sure we converted the other packages that depends from this one (e.g. addons-linter is one for sure, but I recall there was at least one or two more) before merging this and releasing a version of this package that is ESM-only?

If the way this is used in the other packages can be also just use the dynamic import, we may release the ESM-version of this package independently from the order we will do the same on the other ones, but I wanted to ask you explicitly in case we'll need to merge this and release a new version on npm after we have done the same kind of conversion on the dependents.

@willdurand willdurand marked this pull request as draft June 3, 2022 18:57
@willdurand
Copy link
Member Author

As discussed on Slack, I am going to wait a bit and therefore mark this PR as a draft. I think ESM does not necessarily work well with pure TypeScript projects at the moment and this lib is used in one of them... I'll look into that next week or so.

@diox
Copy link
Member

diox commented Apr 12, 2023

@willdurand with TypeScript 5 out, is is time to revisit this ?

@willdurand
Copy link
Member Author

Yeah, I think the problem came from customs back then. If TS5 better supports ESM, we should be good.

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.

3 participants