Skip to content

Commit cd5b5f1

Browse files
docs: npm install @tumaet/apollon is the whole install command (#825)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 512affe commit cd5b5f1

10 files changed

Lines changed: 54 additions & 30 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@tumaet/apollon": patch
3+
---
4+
5+
Correct the install guidance on the npm README: `npm install @tumaet/apollon` is all npm 7+, pnpm 8+, and Bun need (they auto-install the required peers); the explicit peer list is only for Yarn, which never installs peers. Also clarify that the PNG/PDF renderers are optional dependencies that install automatically, not "optional peers" the consumer must add.

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ This monorepo contains every piece of the Apollon platform:
5757
## Use the library
5858

5959
```sh
60-
npm install @tumaet/apollon react react-dom @xyflow/react yjs y-protocols
60+
npm install @tumaet/apollon
6161
```
6262

63-
`react`, `react-dom`, `@xyflow/react`, `yjs`, and `y-protocols` are required
64-
peer dependencies — the editor renders on the host's single React and Yjs
65-
instance instead of bundling its own. See the
66-
[library README](./library/README.md) for the full API and per-framework guides.
63+
npm 7+, pnpm 8+, and Bun pull in the required peer dependencies automatically
64+
(`react`, `react-dom`, `@xyflow/react`, `yjs`, `y-protocols`) — the editor
65+
renders on the host's single React and Yjs instance instead of bundling its
66+
own. Yarn never installs peers, so list them in the install command there. See
67+
the [library README](./library/README.md) for the full API and per-framework
68+
guides.
6769

6870
## Run the stack locally
6971

docs/library/api/export.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ const { blob, clamped } = await svgToPng(svg, clip, {
7777
const pdfBlob = await svgToPdf(svg, clip, { title: "diagram" })
7878
```
7979

80-
`@resvg/resvg-wasm`, `jspdf` and `svg2pdf.js` are optional dependencies the
81-
consumer installs (`npm install @resvg/resvg-wasm jspdf svg2pdf.js`); they load
80+
`@resvg/resvg-wasm`, `jspdf` and `svg2pdf.js` are optional dependencies of
81+
`@tumaet/apollon`, so a normal install brings them in automatically (install
82+
them explicitly only under `--omit=optional`); they load
8283
lazily, so importing the editor never pulls them in. Over-budget diagrams come
8384
back with `clamped: true` and a reduced `appliedScale`; an over-budget PNG throws
8485
`RasterTooLargeError`. Inter ships Regular + Bold only, so italics render upright

docs/library/embedding/angular.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ description: Embed Apollon in an Angular host with the imperative ApollonEditor
77
# Angular
88

99
Angular never imports React itself — the editor renders its own React tree
10-
inside the container — but React is a peer the editor uses internally, so you
11-
install it alongside Apollon:
12-
`npm install @tumaet/apollon react react-dom @xyflow/react yjs y-protocols`.
10+
inside the container — but React is a peer the editor uses internally.
11+
`npm install @tumaet/apollon` brings the peers in automatically on npm 7+,
12+
pnpm 8+, and Bun; with Yarn list them explicitly
13+
(`npm install @tumaet/apollon react react-dom @xyflow/react yjs y-protocols`).
1314

1415
```ts no-check
1516
import {

docs/library/embedding/install.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ Apollon renders on React 19 (`react` / `react-dom` `^19`). On React 18 the
1111
install fails with an `ERESOLVE` peer error — upgrade your host to React 19 first.
1212
:::
1313

14+
```sh
15+
npm install @tumaet/apollon
16+
```
17+
18+
npm 7+, pnpm 8+, and Bun install the five required peers automatically, so the
19+
one-liner is all most setups need. Yarn never installs peers; the per-host
20+
commands below list them explicitly (use them with Yarn, or whenever you want
21+
to pin the peer versions yourself).
22+
1423
## React hosts
1524

1625
You already have `react` and `react-dom` — add the remaining peers:
@@ -55,16 +64,20 @@ import "@tumaet/apollon/style.css"
5564
| `yjs` | `^13.6.0` | the document model, undo/redo, and live collaboration |
5665
| `y-protocols` | `^1.0.6` | collaboration sync/awareness |
5766

58-
npm 7+ auto-installs missing peers; **pnpm and yarn users add them explicitly**.
67+
npm 7+, pnpm 8+, and Bun auto-install missing required peers; **Yarn never
68+
does** — add them explicitly there.
5969
Apollon externalizes every runtime dependency, so a host that already uses React
6070
or Yjs shares a single instance with the editor instead of a private, possibly
6171
mismatched copy — no duplicate payload, and no "Invalid hook call" or
6272
cross-instance-document errors.
6373

6474
## Optional: PNG / PDF export
6575

66-
SVG and JSON export are built in. For PNG and PDF, install the optional renderers
67-
and import them from `@tumaet/apollon/export`:
76+
SVG and JSON export are built in. The PNG/PDF renderers (`@resvg/resvg-wasm`,
77+
`jspdf`, `svg2pdf.js`) ship as **optional dependencies** of `@tumaet/apollon`,
78+
so a normal install brings them in automatically; import them from
79+
`@tumaet/apollon/export`. Add them explicitly only if you install with
80+
`--omit=optional` (or an optional install was skipped):
6881

6982
```sh
7083
npm install @resvg/resvg-wasm jspdf svg2pdf.js

docs/library/quickstart.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ The `react` / `react-dom` peers are `^19`. On React 18 the install fails with an
1818
:::
1919

2020
```sh
21-
npm install @tumaet/apollon react react-dom @xyflow/react yjs y-protocols
21+
npm install @tumaet/apollon
2222
```
2323

24-
Apollon externalizes its dependencies, so you install them as peers: `react`,
25-
`react-dom`, `@xyflow/react`, `yjs`, and `y-protocols`. Most package managers add
26-
them automatically — see [Install](/library/embedding/install).
24+
Apollon externalizes its dependencies as peers (`react`, `react-dom`,
25+
`@xyflow/react`, `yjs`, `y-protocols`). npm 7+, pnpm 8+, and Bun install them
26+
automatically; Yarn never installs peers, so list them explicitly there — see
27+
[Install](/library/embedding/install).
2728

2829
:::danger The editor MUST have an explicit height
2930
Apollon renders onto a React Flow canvas, which sizes itself to its parent. If

docs/library/upgrading.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ npm install @tumaet/apollon \
5555
yjs y-protocols
5656
```
5757

58-
npm 7+ auto-installs missing peers; **pnpm and yarn users must add them
58+
npm 7+, pnpm 8+, and Bun auto-install missing peers; **Yarn users must add them
5959
explicitly**. See [Install](/library/embedding/install) for why they're external.
6060

6161
## React 19 is required

docs/src/pages/index.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,7 @@ function Hero() {
113113
</Link>
114114
</div>
115115
<div className={styles.install}>
116-
<CodeBlock language="bash">
117-
npm install @tumaet/apollon react react-dom @xyflow/react yjs
118-
y-protocols
119-
</CodeBlock>
116+
<CodeBlock language="bash">npm install @tumaet/apollon</CodeBlock>
120117
</div>
121118
</div>
122119
</header>

docs/user/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ versioned and reviewed like any other source.
5454
you need UML modeling inside an existing application.
5555

5656
```sh
57-
npm install @tumaet/apollon react react-dom @xyflow/react yjs y-protocols
57+
npm install @tumaet/apollon
5858
```
5959

6060
| You want to... | Use this |

library/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ Apollon is the modeling editor behind [Artemis](https://artemis.tum.de/), TUM's
4141
## Install
4242

4343
```sh
44-
npm install @tumaet/apollon \
45-
react react-dom \
46-
@xyflow/react \
47-
yjs y-protocols
44+
npm install @tumaet/apollon
45+
```
46+
47+
npm 7+, pnpm 8+, and Bun resolve the required peer dependencies automatically.
48+
Yarn never installs peers — list them explicitly there:
49+
50+
```sh
51+
npm install @tumaet/apollon react react-dom @xyflow/react yjs y-protocols
4852
```
4953

5054
```ts
@@ -54,7 +58,7 @@ import "@tumaet/apollon/style.css"
5458

5559
Apollon ships **one** build with every runtime dependency left external — the React family (`react`, `react-dom`, `@xyflow/react`), the CRDT singletons (`yjs`, `y-protocols`), and Apollon's own UI deps (`@base-ui/react`, `lucide-react`, `@dnd-kit`, `zustand`, `@chenglou/pretext`), which arrive transitively when you install the package. Your bundler resolves and de-duplicates each one against your app's `node_modules`, and your bundle analyzer / SBOM tooling sees them as the real packages they are — never a copy inlined invisibly into one chunk. This works from any framework with a bundler (Angular, Vue, Svelte, React).
5660

57-
These are the peers you install explicitly:
61+
The required peers, and what each powers:
5862

5963
| Peer | Range | Powers |
6064
| --------------- | --------- | ----------------------------------------------------- |
@@ -64,7 +68,7 @@ These are the peers you install explicitly:
6468
| `yjs` | `^13.6.0` | the document model, undo/redo, and live collaboration |
6569
| `y-protocols` | `^1.0.6` | collaboration sync/awareness |
6670

67-
Most package managers install missing peers automatically; the explicit command above is listed for clarity. Keeping these external means a host that already uses React or Yjs shares a single instance with the editor instead of loading a private, possibly mismatched copy — no duplicate payload, and no "Invalid hook call" or cross-instance-document errors.
71+
Keeping these external means a host that already uses React or Yjs shares a single instance with the editor instead of loading a private, possibly mismatched copy — no duplicate payload, and no "Invalid hook call" or cross-instance-document errors.
6872

6973
### Non-React hosts (Angular, Vue, Svelte, vanilla)
7074

@@ -234,7 +238,7 @@ Any Yjs-compatible transport works: `y-websocket`, `y-webrtc`, BroadcastChannel,
234238
- **SVG**: `await editor.exportAsSVG(options)` resolves to `{ svg, clip }`. `svgMode: "web"` (the default) keeps CSS variables for theme-adaptive output; `"compat"` inlines them for PDF and Inkscape.
235239
- **JSON**: `editor.model` returns the `UMLModel`, and assigning it back is round-trip safe. Use `importDiagram(json)` to normalize older v2/v3 models first.
236240
- **Headless**: `ApollonEditor.exportModelAsSvg(model, options)` renders a model without a mounted editor.
237-
- **PNG / PDF**: not built in, but the library ships `svgToPng` / `svgToPdf` renderers under [`@tumaet/apollon/export`](https://ls1intum.github.io/Apollon/library/api/export) (PNG via `@resvg/resvg-wasm`, PDF via `svg2pdf.js` + `jspdf`, installed as optional peers). The standalone server in this repo renders server-side instead, with `@napi-rs/canvas` (PNG) and `pdfmake` (PDF).
241+
- **PNG / PDF**: not built in, but the library ships `svgToPng` / `svgToPdf` renderers under [`@tumaet/apollon/export`](https://ls1intum.github.io/Apollon/library/api/export) (PNG via `@resvg/resvg-wasm`, PDF via `svg2pdf.js` + `jspdf`optional dependencies that install automatically with the package). The standalone server in this repo renders server-side instead, with `@napi-rs/canvas` (PNG) and `pdfmake` (PDF).
238242

239243
See [Export](https://ls1intum.github.io/Apollon/library/api/export) for the full `ExportOptions`.
240244

0 commit comments

Comments
 (0)