You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the monorepo support in shadcn-ui is cool to see, but I’ve got some concerns about how apps/web uses path aliases with @workspace/ui.
right now, the setup has two workspaces: apps/web and packages/ui (named @workspace/ui).
the apps/webpackage.json lists @workspace/ui as a dependency, and pnpm i installs it into node_modules. standard monorepo stuff, works fine.
this alias makes typescript resolve @workspace/ui/* imports directly to packages/ui/src/* on the file system, skipping the node_modules version and package.jsonexports.
the main risk is unintentional usage since it skips the exports field in @workspace/ui and lets you import anything from packages/ui/src without actually installing it. plus, people starting a new project might see this and think it’s a best practice they need to copy for every package, which could spread messy setups.
why use a path alias like this instead of relying on node_modules resolution?
what’s the goal here? Is it solving a specific issue I’m missing?
thoughts? trying to figure out if this is intentional or something to tweak while monorepo support is still experimental.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
the monorepo support in shadcn-ui is cool to see, but I’ve got some concerns about how
apps/web
uses path aliases with@workspace/ui
.right now, the setup has two workspaces:
apps/web
andpackages/ui
(named@workspace/ui
).the
apps/web
package.json
lists@workspace/ui
as a dependency, andpnpm i
installs it intonode_modules
. standard monorepo stuff, works fine.the issue is in
apps/web
’stsconfig.json
:this alias makes typescript resolve
@workspace/ui/*
imports directly topackages/ui/src/*
on the file system, skipping thenode_modules
version andpackage.json
exports
.the main risk is unintentional usage since it skips the exports field in
@workspace/ui
and lets you import anything frompackages/ui/src
without actually installing it. plus, people starting a new project might see this and think it’s a best practice they need to copy for every package, which could spread messy setups.why use a path alias like this instead of relying on
node_modules
resolution?what’s the goal here? Is it solving a specific issue I’m missing?
thoughts? trying to figure out if this is intentional or something to tweak while monorepo support is still experimental.
Beta Was this translation helpful? Give feedback.
All reactions