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

feat: add hybrid cjs-esm support #53

Merged
merged 8 commits into from
Jun 1, 2024
Merged

Conversation

Nesopie
Copy link
Contributor

@Nesopie Nesopie commented Apr 12, 2024

  • We discussed this in the stream but are you happy with the way tests are being done right now? Currently they're being run from the source itself. This prevents build files from getting into the bundle but I can revert to testing both of them individually as well.

  • TODO: Have to change the other commands as well apart from build and test

@Nesopie Nesopie marked this pull request as draft April 13, 2024 03:40
@Nesopie
Copy link
Contributor Author

Nesopie commented Apr 16, 2024

I've tested out the other commands and they work fine too, @junderw can you have a look?

@Nesopie Nesopie marked this pull request as ready for review April 17, 2024 12:04
@junderw
Copy link
Member

junderw commented Apr 17, 2024

Could you convert the existing travis CI config to Github Actions CI so I can run the tests and lints on this? Thanks.

@Nesopie
Copy link
Contributor Author

Nesopie commented Apr 18, 2024

Hey! The devDependency I used to run ts files, i.e. tsx is not supported on lower versions of node so tests start failing on those versions (passes on lts) in the CI.

I've tried instead to run tests on two different builds without tsx but that requires you to change the way imports are done on both the files (which can't be done as they're built from the same source so you can't get two different outputs).

One suggestion would be to just test on one build and stick with that, however I'd like your opinion on this before I move ahead

@junderw
Copy link
Member

junderw commented May 20, 2024

Testing one build should be fine

chore: rm log

chore: run ci on all pushes

fix: ci
@@ -96,19 +105,19 @@ fixtures.bech32.valid.forEach((f: Fixture): void => {
testValidFixture(f, bech32Lib.bech32);
});

fixtures.bech32.invalid.forEach((f: InvalidFixture): void => {
((fixtures.bech32.invalid as unknown) as InvalidFixture[]).forEach((f: InvalidFixture): void => {
Copy link
Member

Choose a reason for hiding this comment

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

I think TypeScript has a method of importing JSON files and automatically discerning the type at compile time... could you look into that?

@junderw junderw merged commit 082859c into bitcoinjs:master Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants