udecode / plate

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

shadcx@latest 404 #3640

Closed linonetwo closed 2 weeks ago

linonetwo commented 2 weeks ago

Description

pnpm dlx shadcx@latest add link-element -r plate-ui      
Registry "plate-ui" not found in configuration. Using the default registry.
⠴ Checking registry.

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

The component at https://ui.shadcn.com/r/styles/default/link-element.json was not found.
It may not exist at the registry. Please make sure it is a valid component.

Because https://ui.shadcn.com/r/styles/default/link-element.json is 404

While the old pnpm dlx @udecode/plate-ui@latest add also not working

pnpm dlx @udecode/plate-ui@latest add floating-toolbar
Packages: +180
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 180, reused 179, downloaded 1, added 180, done
⠏ Checking registry.

Something went wrong. Please check the error below for more details.
If the problem persists, please open an issue on GitHub.

The component at https://ui.shadcn.com/r/styles/default/floating-toolbar.json was not found.
It may not exist at the registry. Please make sure it is a valid component.

Reproduction URL

No response

Reproduction steps

Following latest cli on https://platejs.org/docs/components/link-element

Plate version

39.0.0

Slate React version

0.103.0

Screenshots

No response

Logs

No response

Browsers

No response

Funding

Fund with Polar

zbeyens commented 2 weeks ago

You need to setup components.json. See https://platejs.org/docs/components/cli

linonetwo commented 2 weeks ago

Thanks, I see, adding this to the existing config fix it

,
  "registries": {
    "plate-ui": {
      "url": "https://platejs.org/r",
      "style": "default",
      "aliases": {
        "ui": "@/components/plate-ui"
      }
    }
  }

I have to manually modify existing config, because when try to add a new one it said

% pnpm dlx shadcx@latest init
✔ Preflight checks.
✖ Verifying framework.

We could not detect a supported framework at /Users/linonetwo/Desktop/repo/slate-write.
Visit https://ui.shadcn.com/docs/installation/manual to manually configure your project.
Once configured, you can use the cli to add components.
linonetwo commented 2 weeks ago

And the final version on my side is

{
  "$schema": "https://ui.shadcn.com/schema.json",
  "style": "default",
  "rsc": false,
  "tailwind": {
    "config": "tailwind.config.js",
    "css": "src/slate-write/editor/style.css",
    "baseColor": "slate",
    "cssVariables": false
  },
  "aliases": {
    "components": "src/slate-write/editor/components",
    "utils": "src/slate-write/editor/lib/utils"
  },
  "registries": {
    "plate-ui": {
      "url": "https://platejs.org/r",
      "style": "default",
      "aliases": {
        "ui": "src/slate-write/editor/components/plate-ui"
      }
    }
  }
}