-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add typescript support #7
Conversation
Also, @Jer1605 any suggestions to make that code more TS-friendly? I've only converted the typing from the JS implementation, but I'm sure that a native TypeScript implementation would look quite different :) |
@@ -5,11 +5,13 @@ | |||
"types": "./types/wit.d.ts", | |||
"scripts": { | |||
"build": "npx @bytecodealliance/jco componentize src/index.js --wit wit -o example-js-component.wasm -n data-collection -d all", | |||
"build-typescript": "npx tsc & npx @bytecodealliance/jco componentize src/typescript/index.js --wit wit -o example-js-component.wasm -n data-collection -d all", |
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.
just for that i think its own repo is a good idea :D
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.
yeah I had to create another folder because tsc
by default compiles index.ts into index.js (overwriting the existing JS file). And then the build script needs the additional tsc
step to generate the .js file, so it can't be 100% identical either.
I'd also agree this is enough to justify splitting to its own repo 👍
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.
@alexcasalboni, I'd definitely recommend splitting TypeScript into its own repo. Mixing JS and TS adds extra build steps and potential conflicts (like overwriting issues), plus not everyone uses TS. Keeping them separate makes things cleaner, easier to maintain, and avoids unnecessary complexity. Sounds like a win-win ;)
Closing, in favor of edgee-cloud/example-ts-component#1 |
Not sure if this fits here or if we should have its own repo 🤔
Thoughts?