-
Notifications
You must be signed in to change notification settings - Fork 71
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
Support typescript #108
Support typescript #108
Conversation
The intention is to emit types but keep JS files? Why not converting every files to TS? |
The library files themselves are written in JS, not TS. Are you suggesting to rewrite the library files in native TS? In addition to being a huge effort, it shouldn't be necessary, since the final types are emitted. But I may be missing something and I'm open to any suggestions. Thanks. |
But you don't benefit from type checking when types are separated like that. It's only useful for the consumer right? |
Yes it's only useful for the consumer. Ideally the entire library would be typescript, I think. |
Yes would be better. Maybe can try this tool or similar to do the boring work and then replacing with better types little by little https://github.com/airbnb/ts-migrate |
There is a bounty for that task https://bounties.monero.social/posts/80/1-200m-typescript-support-of-monero-javascript-library |
Rebased on master. I think a good next step is to start renaming .js files to .ts and add typing information to the method signatures. |
Maybe worth a try https://github.com/Bartmr/convert-js-to-ts |
Hey @woodser are you planning on renaming the project to monero-typescript, when this project is done? :D |
I was considering that, or maybe monero-ts? :) |
monero-ts is a great choice! |
Hi, I'm also working on a file conversion from javascript to typescript. Maybe I can give you a hand to complete the job. |
Hey thanks for the offer @everoddandeven. Fortunately this migration is mostly done; all tests are passing in typescript. I just need to finish final cleanup. |
🚀 🚀 🚀 🚀 |
update classes and data models to typescript add .babelrc, tsconfig.ts, and other ts config improve stack traces from source maps replace biginteger.js with BigInt test and distribute commonjs update typedocs and other documentation
update classes and data models to typescript add .babelrc, tsconfig.ts, and other ts config improve stack traces from source maps replace biginteger.js with BigInt test and distribute commonjs update typedocs and other documentation
Congratulations, @woodser ! |
Thanks, but still need to get the documentation links working before I can release. :) |
Ok, now it's released and published. :D |
Supersedes #93
To test this PR:
./bin/build_dist.sh
npm run test -- --grep "Sample code demonstration"
which runs TestSampleCode.ts