Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add docs for registry #6380

Merged
merged 9 commits into from
Jan 28, 2025
Merged

feat: add docs for registry #6380

merged 9 commits into from
Jan 28, 2025

Conversation

shadcn
Copy link
Collaborator

@shadcn shadcn commented Jan 16, 2025

No description provided.

Copy link

vercel bot commented Jan 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview Jan 16, 2025 7:08pm

@lloydrichards
Copy link

lloydrichards commented Jan 19, 2025

Been keeping an eye on registry development as it relates to #1561 so was excited to see some canary releases on this 🥳 . Since nothing has been officially been released I've been bumbling through the repository-template and created https://github.com/lloydrichards/shadcn-storybook-registry

But i've noticed some issues with the routed functions which I assumed was the preferred method to distribute, but am seeing only the public route being mentioned in the docs here.

thought: with the registry function you might need to use process.cwd() in front of the specified file path 🤔

@shadcn
Copy link
Collaborator Author

shadcn commented Jan 23, 2025

@lloydrichards interesting. I see we're resolving the path with process.cwd() https://github.com/lloydrichards/shadcn-storybook-registry/blob/04f005e80d04c2b07e3f162d50cf27c5ee44c07d/app/registry/%5Bname%5D/route.ts#L42

what's the error in the logs?

@lloydrichards
Copy link

lloydrichards commented Jan 23, 2025

what's the error in the logs?

Locally it works as expected, get the JSON and everything good. But deployed in Vercel I get back as a response:

{
"error": "Something went wrong"
}

And in the vercel logs its reads:

Error processing component request: Error: ENOENT: no such file or directory, open '/var/task/registry/button.stories.tsx'
    at async (.next/server/app/registry/[name]/route.js:1:62728)
    at async tx (.next/server/app/registry/[name]/route.js:1:62649) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/var/task/registry/button.stories.tsx'
}

I ran into a similar issue once getting SQLite running on vercel, and the solution was to do with how the folder structure works in serverless, but I'm less sure here whats happeneing.

@lloydrichards
Copy link

just stumbled on the answer while checking what the file is was called:

https://vercel.com/guides/how-can-i-use-files-in-serverless-functions

Turns out you need to include the outputFileTracingIncludes config in the next.config.ts. see commit lloydrichards/shadcn-storybook-registry@e01e8c4

This fixes the routed version 👍

@shadcn
Copy link
Collaborator Author

shadcn commented Jan 24, 2025

@lloydrichards oh yeah you're right. I've done same as well but missed that in the docs. I'll fix.

@shadcn shadcn merged commit 9643db4 into main Jan 28, 2025
6 checks passed
@shadcn shadcn deleted the shadcn/registry branch January 28, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants