blockcn

Updating

See what changed in a copied install, pull a newer registry item, and keep your own edits.

blockcn is copied into your repo. Nothing is published to npm, and these steps do not create a git tag. Each item has a version in the registry (meta.version, starting at 0.1.0). shadcn build writes that version into every installed file:

// blockcn editor-core@0.1.0

CSS files get a block comment with the same text. The comment sits under a "use client" directive when the file has one. Compare that line with the changelog section for the item (editor-core 0.1.0: …) to see what you have.

Pinned URLs

Latest is https://blockcn.com/r/<item>.json. The same build also writes https://blockcn.com/r/v0.1.0/<item>.json. A pinned URL depends on the pinned URLs of the items it needs, so adding v0.1.0/math.json does not follow a newer editor-core.

See the diff

npx shadcn@latest add https://blockcn.com/r/math.json --diff

shadcn diff is the same check; current shadcn asks you to use add --diff.

Pull an update

npx shadcn@latest add https://blockcn.com/r/math.json --overwrite

--overwrite replaces that item's files with the registry copy. Run it per item. Add --diff first when you want to read the change before replacing.

Keep local edits

Put your own code in files the registry does not ship, and pass them in as props:

KeepWhy it survives an overwrite
src/components/block-editor.tsx (your wrapper)Not part of any item.
messages on <Editor>Wording lives in your component, not in messages.ts.
--blockcn-* in your own stylesheetTheme tokens override editor.css. See Theming.
src/lib/utils.tsYours. Items import cn from it and do not replace the file.

These are replaced by --overwrite for the item that owns them: src/editor-core/**, src/components/editor/** (including the components/editor/ui primitives), and src/lib/** files that item lists (export, media upload, KaTeX loader). Edit those only when you mean to maintain a fork. After an overwrite, re-apply any fork edits from your diff.

On this page