Skip to content

Commit

Permalink
fix: Workaround to run ESM-enabled ts-node scripts with Node.js 20
Browse files Browse the repository at this point in the history
  • Loading branch information
wottpal committed Oct 29, 2023
1 parent bb0f92a commit 3f4179e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tricky-clouds-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@inkathon/contracts': patch
---

Add workaround to run ESM-enabled ts-node scripts with Node.js 20. Related: https://github.com/TypeStrong/ts-node/issues/1997
5 changes: 3 additions & 2 deletions contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
"postinstall": "bash postinstall.sh",
"test": "bash test-all.sh",
"build": "bash build-all.sh",
"node": "substrate-contracts-node --dev --port 9944 --base-path ./.node-data",
"script": "ts-node --cwd=scripts",
"node": "substrate-contracts-node --dev --base-path ./.node-data",
"script:cwd": "node --no-warnings=ExperimentalWarning --loader ts-node/esm",
"script": "f() { node --no-warnings=ExperimentalWarning --loader ts-node/esm ./scripts/$1; }; f \"$@\"",
"deploy": "pnpm run script deploy",
"contracts-ui": "open https://contracts-ui.substrate.io/?rpc=ws://127.0.0.1:9944",
"explorer-ui": "open https://polkadot.js.org/apps/#/explorer?rpc=ws://127.0.0.1:9944",
Expand Down

1 comment on commit 3f4179e

@vercel
Copy link

@vercel vercel bot commented on 3f4179e Oct 29, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.