Skip to content

TS Updates#162

Merged
christroutner merged 8 commits into
masterfrom
stage
Nov 25, 2019
Merged

TS Updates#162
christroutner merged 8 commits into
masterfrom
stage

Conversation

@christroutner
Copy link
Copy Markdown

This PR includes two merged PRs for updates to TypeScript, contributed by @jcramer

jcramer and others added 7 commits November 21, 2019 09:53
These @types are needed if a TS project is rebuilding bitbox-sdk from source.  This would be the case even if .d.ts files were published instead of .ts files since the .d.ts file would still have references to these dependent types.

Also, on a separate note. Maybe something to consider in a future release is to publish `.d.ts` files instead of the `.ts` files.  I'm currently planning on doing this for `slpjs` soon, but right now I'm struggling with some strange issue preventing me from doing so.
This patch fixes the issue I get when I run `tsc` in a ts project that depends on recent versions of bitbox-sdk:

  node_modules/bitbox-sdk/lib/Crypto.ts:1:1
    1 import * as randomBytes from "randombytes"
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.
The default typescript tsconfig.json file generated from `tsc --init` has this property set to true.  If there are no build errors or other failures resulting from this update, then it would probably be easier for other users to update this.
fix randomBytes import for same reason as Crypto.ts
SpicyPete
SpicyPete previously approved these changes Nov 21, 2019
Copy link
Copy Markdown

@SpicyPete SpicyPete left a comment

Choose a reason for hiding this comment

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

Seems like fine updates to me.
Type files are small and should be direct dependencies if used in project exports, so this looks good.

SpendBCH
SpendBCH previously approved these changes Nov 22, 2019
fix(typescript): Updates to TS types
@christroutner christroutner dismissed stale reviews from SpendBCH and SpicyPete via f86ffab November 25, 2019 20:53
@christroutner christroutner merged commit 1a975b3 into master Nov 25, 2019
@cgcardona
Copy link
Copy Markdown

🎉 This PR is included in version 8.8.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants