-
Notifications
You must be signed in to change notification settings - Fork 63
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: make types compatible with deno #223
base: main
Are you sure you want to change the base?
Conversation
Guarantee type compatibility with even the built in `npm` support in Deno.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@dchambers is attempting to deploy a commit to the MeshJS Team on Vercel. A member of the Team first needs to authorize it. |
@@ -1,3 +1,3 @@ | |||
import CIP14 from '@emurgo/cip14-js'; | |||
|
|||
export const AssetFingerprint = CIP14; | |||
export const AssetFingerprint = CIP14.default; |
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.
This is the only code change within the PR.
@@ -71,7 +71,8 @@ export class MeshEscrowContract extends MeshTxInitiator { | |||
await this.mesh | |||
.txOut(scriptAddr, escrowAmount) | |||
.txOutInlineDatumValue( | |||
initiateEscrowDatum(walletAddress, escrowAmount), | |||
// TODO: remove dodgy cast |
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.
Given that the only genuine code change within this PR (search for "This is the only code change within the PR.") exists only to deal with a strange default export issue, the fact that we're now having to perform some explicit casts potentially indicates that types weren't always being pulled through correctly even internally?
import { csl } from '@mesh/core'; | ||
import type { Costmdls } from '@mesh/core'; | ||
import type { Budget, Era, Network, Protocol } from './types'; | ||
import { csl } from '../core/index.js'; |
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.
We probably could have achieved a basic level of Deno support (via CDNs which fix-up some ESM issues) just by no longer using the @mesh/*
alias. The need for the .js
suffixes is a result of setting moduleResolution
to Node16
, which additionally guarantees compatibility with Deno's built-in npm
support, but which also ensures that support will continue to work in the future too.
@@ -25,9 +25,9 @@ | |||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ | |||
|
|||
/* Modules */ | |||
"module": "ESNext", /* Specify what module code is generated. */ | |||
"module": "Node16", /* Specify what module code is generated. */ |
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.
This had to be changed as a consequence of changing moduleResolution
to Node16
.
Guarantee type compatibility with even the built in
npm
support in Deno.Relevant context here, though in the case of
@mesh/core
types are also not pulling through in all cases when using a CDN (viahttps://esm.sh/@meshsdk/core@1.5.17
) either: