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

refactor module exports for api-core & crypto #168

Merged
merged 5 commits into from
Apr 28, 2021

Conversation

fuxingloh
Copy link
Contributor

@fuxingloh fuxingloh commented Apr 28, 2021

What kind of PR is this?:

/kind refactor

What this PR does / why we need it:

As the modules and packages grow in size, it is becoming increasingly complex to manage imports and exports. Bundling all exports into one index.js file for small modules make senses but for large more complex modules it is harder to effectively manage conflicts.

Hence for larger modules or modules with generic exports, it is wise to use named modules at index.js.

  • jellyfish-crypto to exports Elliptic, WIF & Bech32 instead of functions
  • jellyfish-api-core to exports 'modules' with their category as the module name

Which issue(s) does this PR fixes?:

Fixes #130

Additional comments?

  • cleaned up and added missing markdown sections
  • cleaned up some JSDocs symbols and language correctness
  • refactored some ts interface to be exported
  • updated testcontainers dependencies

@netlify
Copy link

netlify bot commented Apr 28, 2021

Deploy preview for jellyfish-defi ready!

Built with commit ca1a732

https://deploy-preview-168--jellyfish-defi.netlify.app

@github-actions
Copy link

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/jellyfish/dist/jellyfish.umd.js 18.51 KB (+0.43% 🔺) 371 ms (+0.43% 🔺) 158 ms (+0.57% 🔺) 528 ms

@fuxingloh fuxingloh marked this pull request as ready for review April 28, 2021 06:15
@fuxingloh fuxingloh enabled auto-merge (squash) April 28, 2021 06:15
@codecov
Copy link

codecov bot commented Apr 28, 2021

Codecov Report

Merging #168 (ca1a732) into main (eba378d) will decrease coverage by 0.06%.
The diff coverage is 94.44%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #168      +/-   ##
==========================================
- Coverage   95.47%   95.40%   -0.07%     
==========================================
  Files          52       52              
  Lines        1106     1111       +5     
  Branches      137      136       -1     
==========================================
+ Hits         1056     1060       +4     
- Misses         48       49       +1     
  Partials        2        2              
Impacted Files Coverage Δ
...ages/jellyfish-api-core/src/category/blockchain.ts 100.00% <ø> (ø)
packages/jellyfish-api-core/src/category/mining.ts 100.00% <ø> (ø)
...ckages/jellyfish-api-core/src/category/poolpair.ts 100.00% <ø> (ø)
packages/jellyfish-api-core/src/category/rawtx.ts 100.00% <ø> (ø)
packages/jellyfish-api-core/src/category/token.ts 100.00% <ø> (ø)
packages/jellyfish-api-core/src/category/wallet.ts 100.00% <ø> (ø)
packages/jellyfish-api-jsonrpc/src/index.ts 96.77% <ø> (ø)
packages/jellyfish-crypto/src/hash.ts 100.00% <ø> (ø)
packages/jellyfish-crypto/src/bech32.ts 94.44% <80.00%> (-5.56%) ⬇️
packages/jellyfish-api-core/src/index.ts 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eba378d...ca1a732. Read the comment docs.

@fuxingloh fuxingloh merged commit 4569f64 into main Apr 28, 2021
@fuxingloh fuxingloh deleted the fuxingloh/refactor-exports branch April 28, 2021 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactor Non feature refactor change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

subpath exports for large packages
3 participants