udecode / plate

A rich-text editor powered by AI
https://platejs.org
Other
12k stars 734 forks source link

Installation with Shadcn #2641

Closed EducatedAI-kaisera closed 1 year ago

EducatedAI-kaisera commented 1 year ago

Description

I can't seem to install with Shadcn components already in project. Keeps saying: "Invalid configuration found in components.json" and won't init. What I am missing to make this work?

Funding

Fund with Polar

EducatedAI-kaisera commented 1 year ago

Made some progress with renaming shadcn component.json file. I've tried using playground example, I just can't around this runtime error: Unhandled Runtime Error Error: Tooltip must be used within TooltipProvider

zbeyens commented 1 year ago

https://github.com/udecode/plate/blob/8d2cbcf88c3f08006a0cd74be72e55041101bf34/templates/plate-template/src/app/layout.tsx#L48

adeyemiadekunle commented 1 year ago

Description

I can't seem to install with Shadcn components already in project. Keeps saying: "Invalid configuration found in components.json" and won't init. What I am missing to make this work?

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified

Fund with Polar

I have same problem instal plate ui with shadcn

zbeyens commented 1 year ago

What is your components.json value? https://platejs.org/docs/components/components-json

Pavelkovo commented 1 year ago

Hi! @EducatedAI-kaisera try remove "tsx": true from components.json @zbeyens and why can cli not see components that were installed with shad cli?

zbeyens commented 1 year ago

@Pavelkovo The cli installs in plate-ui folder, while shadcn installs in ui folder. They're completely separated. A few Plate components are using shadcn components like Button, with minor changes. So you would end up having a button filed in plate-ui and one in ui, which should not be an issue.

zbeyens commented 1 year ago

Patching it, thanks for all your inputs!