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

chore: port sell contract to .ts #68

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

chore: port sell contract to .ts #68

wants to merge 3 commits into from

Conversation

dckc
Copy link
Member

@dckc dckc commented Feb 13, 2025

DRAFT

  • get the test to run
  • try out the whole dapp

dckc added 3 commits February 13, 2025 14:38
feat: Convert JSDoc types to TypeScript in sell-concert-tickets.contract.ts
refactor: Add Typescript type for Inventory and improve type annotations
refactor: Convert JSDoc typedef to TypeScript type definition
feat: Add comment to convert JSDoc types to TypeScript
refactor: Convert JSDoc types to TypeScript in sell-concert-tickets contract
importing from the contract isn't working
@dckc
Copy link
Member Author

dckc commented Feb 13, 2025

I'm struggling to get the test to run:

~/projects/dapp-agoric-basics/contract$ yarn test test/test-sell-concert-tickets-contract.js 
yarn run v1.22.22
$ ava --verbose test/test-sell-concert-tickets-contract.js

  Uncaught exception in test/test-sell-concert-tickets-contract.js

  TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/connolly/projects/dapp-agoric-basics/contract/src/sell-concert-tickets.contract.ts

  ✘ test/test-sell-concert-tickets-contract.js exited with a non-zero exit code: 1

@dckc dckc requested a review from kriskowal February 13, 2025 20:52
@mhofman
Copy link
Member

mhofman commented Feb 13, 2025

What version of Node are you using. I think we have some rough edges because Node's .ts support was adding in 22.6 and unflagged in 23.6, but we only support up to Node 20 currently (which requires a flag). So I think we need to tell ava to use the ts-blank-space loader. Example: https://github.com/Agoric/agoric-sdk/blob/9db2909eafccc0d8df19258508ec58966e3eb3f8/packages/boot/package.json#L88

@dckc
Copy link
Member Author

dckc commented Feb 13, 2025

I'm using node 20.
I've seen conflicts between node 22 and @agoric/zoe.

So I think we need to tell ava to use the ts-blank-space loader.

Right. thanks for the pointer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants