fix: dual package - #781
Conversation
|
LLM review below: Thanks for putting this together. I reproduced #778 independently and agree with the root-cause analysis and core fix. Node determines the format of I reproduced the exact So the proposed package-boundary fix is correct. The ESM marker is technically redundant because it inherits the root Before resubmitting, I recommend addressing these gaps:
const { default: Service } = require("wdio-ui5-service") and: const { default: Service } = await import("wdio-ui5-service") This tests the actual conditional exports instead of loading dist/* directly.
dist/cjs/package.json Installing that tarball into a clean temporary project and running the two loading tests above would cover the real consumer path.
Also, renaming only the consuming wdio.conf.js to .cjs is not sufficient for this bug. That can fix the caller’s own module format, but it does not reclassify wdio-ui5-service/dist/cjs/*.js. With those additions, I believe this is the correct and appropriately minimal package-side solution. |
|
Thanks for reviewing. Follow my response to the recommendations:
|
|
Thanks for taking the time to respond. You’re right that some of my earlier recommendations were based on the previous After testing the current branch again, I agree that:
I did notice a few remaining points that may be worth checking:
The Node 22 jobs were subsequently cancelled, so the new tests have not yet completed successfully in PR CI. According to the tsdown documentation, the intended approach for libraries supporting Node 20 is to build on Node 22.18+ and then test the built output or tarball on Node 20. Perhaps the workflows could be adjusted accordingly.
The current build emits 30 files under:
This also causes declarations such as The build itself reports:
I tested adding:
to the shared tsdown configuration. That removed the vendored declarations and the additional duplicate errors. This appears consistent with the tsdown dependency documentation.
Unless I overlooked another workflow, It might also be helpful to add a small
Apologies if my earlier wording was unclear: I was referring primarily to the PR test workflows, not only The example changes happen to trigger CI for this PR, but a future packaging-only change to Using an unrelated
One smaller compatibility consideration: would it make sense to keep:
The Overall, I agree that the |
|
My comments:
|
Fix issue #778