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
Following the recent changes in PR #384 which introduced the # prefix as the default path alias for TanStack Start projects, I’ve noticed a common point of confusion that leads to a broken project structure.
When a user adds shadcn components using the CLI, if the components.json is pre-configured with #/components but the tsconfig.json does not yet have a matching path alias, the shadcn CLI interprets # as a literal directory name. This results in the creation of a physical ./# folder at the project root (e.g., ./#/components/ui/...), which is clearly not the intended behavior.
The Issue
To ensure a seamless developer experience and prevent this "literal folder" issue, I believe the configuration needs to be synchronized more explicitly.
Proposed Suggestion
I suggest we provide or enforce one of the following two approaches during the setup or in the documentation:
Ensure#/*mappingintsconfig.json: If we move forward with the # alias as the new standard, the TanStack CLI should ensure (or guide the user to add) the following mapping in tsconfig.json:
This ensures that # is recognized as a path alias and files are correctly placed inside the src directory.
Maintain@asthedefaultincomponents.json: Alternatively, keeping @ as the default alias for shadcn components (mapping to @/*: ["./src/*"]) would maintain consistency with the existing shadcn/ui ecosystem and prevent the accidental creation of the ./# folder for users migrating from other frameworks.
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
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Hi TanStack team,
Following the recent changes in PR #384 which introduced the # prefix as the default path alias for TanStack Start projects, I’ve noticed a common point of confusion that leads to a broken project structure.
When a user adds shadcn components using the CLI, if the
components.jsonis pre-configured with#/componentsbut thetsconfig.jsondoes not yet have a matching path alias, the shadcn CLI interprets#as a literal directory name. This results in the creation of a physical./#folder at the project root (e.g.,./#/components/ui/...), which is clearly not the intended behavior.The Issue
To ensure a seamless developer experience and prevent this "literal folder" issue, I believe the configuration needs to be synchronized more explicitly.
Proposed Suggestion
I suggest we provide or enforce one of the following two approaches during the setup or in the documentation:
#/*mapping intsconfig.json: If we move forward with the # alias as the new standard, the TanStack CLI should ensure (or guide the user to add) the following mapping intsconfig.json:This ensures that
#is recognized as a path alias and files are correctly placed inside thesrcdirectory.@as the default incomponents.json: Alternatively, keeping @ as the default alias for shadcn components (mapping to@/*: ["./src/*"]) would maintain consistency with the existing shadcn/ui ecosystem and prevent the accidental creation of the./#folder for users migrating from other frameworks.Beta Was this translation helpful? Give feedback.
All reactions