Skip to content

Commit 0692991

Browse files
committed
feat: example uiLib selection, docs dep-conflict guard, playground dep pruning
Each example now declares a single BlockNote UI library via the uiLib field in .bnexample.json (mantine default); the generator no longer injects all UI packages into every example. genDocs fails loudly when two docs-embedded examples declare incompatible ranges of the same package, and the yjs13 versioning example drops its direct lib0 dependency to resolve the one live conflict. Playground's unused third-party dependency mirrors are removed (katex and @react-pdf/math stay: its build-mode vite aliases resolve them from playground's node_modules).
1 parent ab2a59d commit 0692991

117 files changed

Lines changed: 356 additions & 1217 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/skills/create-example/SKILL.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Contains all of the example's configuration. Here's an annotated example (from `
4545
"Slash Menu",
4646
"Appearance & Styling"
4747
],
48-
<!-- NPM dependencies the source files rely on. -->
48+
<!-- NPM dependencies the source files rely on. Only list packages the example actually imports — the generated `package.json` already includes `@blocknote/core`, `@blocknote/react`, the UI library (see `uiLib`), `react`, and `react-dom`. -->
4949
"dependencies": {
5050
"@mui/icons-material": "^5.16.1",
5151
"@mui/material": "^5.16.1"
@@ -54,6 +54,11 @@ Contains all of the example's configuration. Here's an annotated example (from `
5454
"pro": true
5555
```
5656

57+
Two constraints on dependencies:
58+
59+
- `"uiLib"` (optional; `"mantine"` | `"ariakit"` | `"shadcn"`, default `"mantine"`) selects which single BlockNote UI package the generated `package.json` depends on. The mantine variant also carries `@mantine/core`/`@mantine/hooks` (peer dependencies of `@blocknote/mantine`). Do not add UI packages to `"dependencies"` manually; set `uiLib` instead.
60+
- Examples with `"docs": true` are all compiled into the docs site's single dependency context, so `vp run gen` fails if two docs-embedded examples declare incompatible version ranges of the same package (e.g. `lib0` for yjs 13 vs 14). Reconcile the ranges or set `"docs": false` on one of them.
61+
5762
`README.md`
5863

5964
A Markdown description of the example. Made of four parts:

docs/lib/source/examples.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ export function getPageImage(page: InferPageType<typeof source>) {
1717
};
1818
}
1919

20-
async function getLLMText(page: InferPageType<typeof source>) {
20+
/**
21+
* Consumed via the `import * as examples` namespace in
22+
* app/llms-full.txt/route.ts (`source.getLLMText(...)`), which static
23+
* analysis can miss — keep this exported.
24+
*
25+
* @public
26+
*/
27+
export async function getLLMText(page: InferPageType<typeof source>) {
2128
const processed = await page.data.getText("processed");
2229

2330
return `# ${page.data.title}

examples/01-basic/01-minimal/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"type": "module",
55
"private": true,
6-
"version": "0.12.4",
6+
"version": "0.0.0",
77
"scripts": {
88
"start": "vite",
99
"dev": "vite",
1010
"build:prod": "tsc && vite build",
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@blocknote/ariakit": "latest",
1514
"@blocknote/core": "latest",
16-
"@blocknote/mantine": "latest",
1715
"@blocknote/react": "latest",
18-
"@blocknote/shadcn": "latest",
16+
"@blocknote/mantine": "latest",
1917
"@mantine/core": "^9.0.2",
2018
"@mantine/hooks": "^9.0.2",
2119
"react": "^19.2.3",

examples/01-basic/02-block-objects/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"type": "module",
55
"private": true,
6-
"version": "0.12.4",
6+
"version": "0.0.0",
77
"scripts": {
88
"start": "vite",
99
"dev": "vite",
1010
"build:prod": "tsc && vite build",
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@blocknote/ariakit": "latest",
1514
"@blocknote/core": "latest",
16-
"@blocknote/mantine": "latest",
1715
"@blocknote/react": "latest",
18-
"@blocknote/shadcn": "latest",
16+
"@blocknote/mantine": "latest",
1917
"@mantine/core": "^9.0.2",
2018
"@mantine/hooks": "^9.0.2",
2119
"react": "^19.2.3",

examples/01-basic/03-multi-column/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"type": "module",
55
"private": true,
6-
"version": "0.12.4",
6+
"version": "0.0.0",
77
"scripts": {
88
"start": "vite",
99
"dev": "vite",
1010
"build:prod": "tsc && vite build",
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@blocknote/ariakit": "latest",
1514
"@blocknote/core": "latest",
16-
"@blocknote/mantine": "latest",
1715
"@blocknote/react": "latest",
18-
"@blocknote/shadcn": "latest",
16+
"@blocknote/mantine": "latest",
1917
"@mantine/core": "^9.0.2",
2018
"@mantine/hooks": "^9.0.2",
2119
"react": "^19.2.3",

examples/01-basic/04-default-blocks/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"type": "module",
55
"private": true,
6-
"version": "0.12.4",
6+
"version": "0.0.0",
77
"scripts": {
88
"start": "vite",
99
"dev": "vite",
1010
"build:prod": "tsc && vite build",
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@blocknote/ariakit": "latest",
1514
"@blocknote/core": "latest",
16-
"@blocknote/mantine": "latest",
1715
"@blocknote/react": "latest",
18-
"@blocknote/shadcn": "latest",
16+
"@blocknote/mantine": "latest",
1917
"@mantine/core": "^9.0.2",
2018
"@mantine/hooks": "^9.0.2",
2119
"react": "^19.2.3",

examples/01-basic/05-removing-default-blocks/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"type": "module",
55
"private": true,
6-
"version": "0.12.4",
6+
"version": "0.0.0",
77
"scripts": {
88
"start": "vite",
99
"dev": "vite",
1010
"build:prod": "tsc && vite build",
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@blocknote/ariakit": "latest",
1514
"@blocknote/core": "latest",
16-
"@blocknote/mantine": "latest",
1715
"@blocknote/react": "latest",
18-
"@blocknote/shadcn": "latest",
16+
"@blocknote/mantine": "latest",
1917
"@mantine/core": "^9.0.2",
2018
"@mantine/hooks": "^9.0.2",
2119
"react": "^19.2.3",

examples/01-basic/06-block-manipulation/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"type": "module",
55
"private": true,
6-
"version": "0.12.4",
6+
"version": "0.0.0",
77
"scripts": {
88
"start": "vite",
99
"dev": "vite",
1010
"build:prod": "tsc && vite build",
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@blocknote/ariakit": "latest",
1514
"@blocknote/core": "latest",
16-
"@blocknote/mantine": "latest",
1715
"@blocknote/react": "latest",
18-
"@blocknote/shadcn": "latest",
16+
"@blocknote/mantine": "latest",
1917
"@mantine/core": "^9.0.2",
2018
"@mantine/hooks": "^9.0.2",
2119
"react": "^19.2.3",

examples/01-basic/07-selection-blocks/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,17 @@
33
"description": "AUTO-GENERATED FILE, DO NOT EDIT DIRECTLY",
44
"type": "module",
55
"private": true,
6-
"version": "0.12.4",
6+
"version": "0.0.0",
77
"scripts": {
88
"start": "vite",
99
"dev": "vite",
1010
"build:prod": "tsc && vite build",
1111
"preview": "vite preview"
1212
},
1313
"dependencies": {
14-
"@blocknote/ariakit": "latest",
1514
"@blocknote/core": "latest",
16-
"@blocknote/mantine": "latest",
1715
"@blocknote/react": "latest",
18-
"@blocknote/shadcn": "latest",
16+
"@blocknote/mantine": "latest",
1917
"@mantine/core": "^9.0.2",
2018
"@mantine/hooks": "^9.0.2",
2119
"react": "^19.2.3",

examples/01-basic/08-ariakit/.bnexample.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22
"playground": true,
33
"docs": true,
44
"author": "matthewlipski",
5-
"tags": ["Basic"]
5+
"tags": ["Basic"],
6+
"uiLib": "ariakit"
67
}

0 commit comments

Comments
 (0)