docs icon indicating copy to clipboard operation
docs copied to clipboard

Adjust docs for typegen for API 10.1.3+

Open jacogr opened this issue 2 years ago • 0 comments

Lots of comments here - https://github.com/polkadot-js/api/issues/5540

There are basically 3 options -

  1. node --loader ts-node/esm node_modules/.bin/polkadot-types-from-defs --package ...
  2. ts-node --esm --skip-project node_modules/.bin/polkadot-types-from-defs --package ... (Some caveats with resolutions)

For both the above you would need "type": "module" added to your package.json

There is also a (distant) 3rd option, using the @polkadot/dev-ts loader - would probably focus on the options above, since this one "works for polkadot-js", but not sure if it doesn't work in specific repos we want to deal with support (especially those with no PRs to close holes). Having said that, it has been tested as a drop-in replacement for some 3rd part typegen repos and works there. This one doesn't need a type: module changes in the package, it always "just does ESM".

jacogr avatar Mar 16 '23 19:03 jacogr