-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix generating TypeScript type definitions #236
Conversation
Also happy new year to you! (In a couple of hours I suppose). |
package.json
Outdated
@@ -27,7 +27,6 @@ | |||
"test:firefox:http2:ponyfill": "npm run test:firefox:http2:ponyfill --workspace main", | |||
"oldtest": "npm run oldtest --workspace main", | |||
"oldtesthttp2": "npm run oldtesthttp2 --workspace main", | |||
"types": "tsc --build", |
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.
Does this generate a problem? The version release today, does it still have problem with types?
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 checked the version of today (1.0.8
) and #233 still persists due to the path to ./dist/lib/index.d.ts
that is failing.
A potential solution could be pointing "types": "./dist/main/lib/index.d.ts"
, but I believe having both projects compiled under dist
was not intentional.
Below is a screenshot of both modules (1.0.8
) after being installed via NPM (@fails-components/webtransport
and @fails-components/webtransport-transport-http3-quiche
), you can see both projects have the same output under dist
folder, whereas they should only contain their own output (which this PR addresses):

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.
Ok, the screenshots match my development environment.
Yes, it was not intentional.
But I had to trouble with the crossreferencing of the two packages in types.
Does a run of tsc --build
at workspace level run fine with your changes?
transports/http3-quiche/package.json
Outdated
@@ -20,7 +20,8 @@ | |||
"rebuild-debug": "node build.js rebuild-debug -D", | |||
"build-debug": "node build.js build-debug", | |||
"prebuild": "node build.js prebuild", | |||
"lint": "eslint lib" | |||
"lint": "eslint lib", | |||
"prepublishOnly": "tsc" |
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.
Please look also at the github action for the actual publishing...
Thanks for the review, I've just updated bringing back the |
Ok, I will then hit the CI/CD jobs to see if they run, and maybe merge it later. I will probably wait for a release (or do the types not work at all?) until another issue pops up. |
Hi @martenrichter,
I've made some changes to
tsconfig.json
and changed to generate type definitions only before publishing (prepublishOnly
)I'm still getting used to the codebase, let me know if I'm missing something.
Before
After
All the best and happy new year ✨