chore(ui): use compiled exports by default#8626
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
👋 Codeowner Review RequestThe following codeowners have been identified for the changed files: Team reviewers: @nodejs/web-infra @nodejs/nodejs-website Please review the changes when you have a chance. Thank you! 🙏 |
❌ 5 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Pull request overview
This PR updates @node-core/ui-components to prefer compiled (dist) entrypoints by default (matching what’s published to npm), and adjusts publishing to run the compile step explicitly.
Changes:
- Swap
package.jsonexports/importsconditions sodefaultresolves todistand add anuncompiledcondition forsrc. - Update
packages/ui-components/tsconfig.jsonto resolve using theuncompiledcondition. - Update the publish workflow to run
pnpm run compile(and remove the package-levelreleasescript).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| packages/ui-components/tsconfig.json | Changes TS module resolution conditions to prefer uncompiled. |
| packages/ui-components/package.json | Makes compiled dist the default for both exports and internal imports, adds uncompiled condition targets, removes release script. |
| .github/workflows/publish-packages.yml | Runs compile (instead of release) prior to pnpm publish when available. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "./*": { | ||
| "rolldown": [ | ||
| "default": [ | ||
| "./dist/*", | ||
| "./dist/*.js", | ||
| "./dist/*/index.js" | ||
| ], |
There was a problem hiding this comment.
Switching the exports default condition to ./dist/* will make workspace consumers (e.g. apps/site) resolve @node-core/ui-components/... to dist, but dist/ is not present in the repo and this package does not currently participate in the Turbo build/dev pipeline. As-is, local dev/CI builds that import @node-core/ui-components/... are likely to fail unless pnpm run compile is executed beforehand. Consider either ensuring compile runs automatically before consumers build/dev (e.g. add a build script + Turbo task outputs for dist/** and make dependent tasks depend on it), or keep the workspace-default pointing at src and only use dist as default for published artifacts via conditions/publish config.
| "default": [ | ||
| "./dist/*", | ||
| "./dist/*.js", | ||
| "./dist/*/index.js" |
There was a problem hiding this comment.
imports["#ui/*"].default now points to ./dist/*, but a lot of source files (and Storybook preview) import #ui/... while running directly from src (without a preceding compile step). Since dist/ isn't present by default, Storybook/tests/dev in this repo are likely to break unless you either (1) run compile before those tasks, or (2) configure the relevant runners/bundlers to resolve the uncompiled condition (e.g. Node --conditions=uncompiled, and webpack/Storybook resolve.conditionNames including uncompiled).
| "./dist/*/index.js" | |
| "./dist/*/index.js", | |
| "./src/*", | |
| "./src/*.tsx", | |
| "./src/*/index.tsx", | |
| "./src/*.ts", | |
| "./src/*/index.ts" |
ovflowd
left a comment
There was a problem hiding this comment.
Might not make sense to you, but I've done this after several testing, the other order, things break, hard.
|
(as you noticed yourself) |
|
I see. Had just run |
I can explain via Slack, why I had to make this way if it helps 🫠 |
It makes little sense to me why the version not published to npm is the default. It should be the other way around.