Skip to content

Commit

Permalink
fix(tanstack): fix paths value in tsconfig and check for tanstack sta…
Browse files Browse the repository at this point in the history
…rt in devDeps also (#6590)

* fix(docs): tanstack start guide fix the paths value in tsconfig

* fix(tanstack): check for @tanstack/start in devDependencies as well

* chore: changeset

* fix(shadcn): tanstack detection

---------

Co-authored-by: shadcn <[email protected]>
  • Loading branch information
prateekkumarweb and shadcn authored Feb 7, 2025
1 parent 5234c46 commit 16d4d38
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-plants-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"shadcn": patch
---

fix tanstack check
2 changes: 1 addition & 1 deletion apps/www/content/docs/installation/tanstack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ Add the following code to the `tsconfig.json` file to resolve paths.
"strictNullChecks": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
"@/*": ["./app/*"]
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/shadcn/src/utils/get-project-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ export async function getProjectInfo(cwd: string): Promise<ProjectInfo | null> {
// TanStack Start.
if (
configFiles.find((file) => file.startsWith("app.config."))?.length &&
Object.keys(packageJson?.dependencies ?? {}).find((dep) =>
dep.startsWith("@tanstack/start")
)
[
...Object.keys(packageJson?.dependencies ?? {}),
...Object.keys(packageJson?.devDependencies ?? {}),
].find((dep) => dep.startsWith("@tanstack/start"))
) {
type.framework = FRAMEWORKS["tanstack-start"]
return type
Expand Down

0 comments on commit 16d4d38

Please sign in to comment.