typebulb 0.11.2 → 0.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # typebulb
2
2
 
3
- Run single-file markdown apps that run in many contexts:
3
+ **Typebulb** runs apps in markdown files called **bulbs**. To run bulbs:
4
4
 
5
- 1. Localhost in your browser and optionally in `nodejs`, which can talk via a secure bridge.
6
- 2. Embedded in agent messages when viewed with `npx typebulb agent:claude`.
7
- 3. Published on [typebulb.com](https://typebulb.com) or edited in its online IDE. See [FAQ](https://typebulb.com/faq).
5
+ * `npx typebulb`. When you want a quick local app or tool where the overhead of an entire npm project is overkill *(trivial for your LLM to convert to when you actually need to)*. Can be entirely client code, or both client and nodejs code that talk via a secure bridge.
6
+ * `npx typebulb agent:claude`. When you want to view Claude Code conversations with embedded bulbs in the agent messages.
7
+ * **[typebulb.com](https://typebulb.com)**. When you want to share tools, visualizations, experiments etc. See [FAQ](https://typebulb.com/faq).
8
8
 
9
- `typebulb` serves the first two cases, by compiling and serving hot-reloadable bulbs locally.
9
+ The `typebulb` CLI enables the first two cases, by compiling and serving hot-reloadable bulbs locally.
10
10
 
11
11
  A `.bulb.md` file bundles code, styles, data, and config in one file.
12
12
 
@@ -94,8 +94,8 @@ button {
94
94
  {
95
95
  "description": "A button that increments a counter.",
96
96
  "dependencies": {
97
- "react": "^19.2.3",
98
- "react-dom": "^19.2.3"
97
+ "react": "^19.2.7",
98
+ "react-dom": "^19.2.7"
99
99
  }
100
100
  }
101
101
  ```
@@ -251,12 +251,16 @@ The agent viewer turns that block into a live, sandboxed app, with a *breakout
251
251
 
252
252
  **Sizing is the viewer's job, not yours.** The agent viewer renders each embed *inline* by default — fit to the conversation column, with height capped so a tall bulb doesn't run away — plus a per-embed toggle to *spread* it to the full transcript width and height. Don't fight the layout from inside the bulb: no need to set a width, reserve height, or guess how much room you'll get.
253
253
 
254
- **One layout rule the bulb must get right: vertical space on the root is `padding`, not `margin`.** The embed auto-sizes by reporting `document.body.scrollHeight`, and a vertical margin on the root element *collapses* (a body's first/last child margin escapes through to the viewport) so it isn't captured in that measurement the host then sizes the frame a margin short and you get a stray scrollbar. The page-style `margin: 32px auto` common on a standalone wrapper is exactly this trap. Keep the horizontal `auto` for centering, but move the vertical part to padding:
254
+ **Prefer `padding` over `margin` for vertical space on the root.** The viewer measures an embed by `document.body.scrollHeight`, and the runtime makes `body` a block formatting context so a root child's vertical margin (yours, or a UA default like `<h1>`'s) is contained rather than escaping the measurement so you no longer have to get this exactly right. It's still cleaner to keep the horizontal `auto` for centering and move the vertical space to padding:
255
255
 
256
256
  ```css
257
257
  .wrap { margin: 0 auto; padding: 24px 16px; } /* not: margin: 24px auto */
258
258
  ```
259
259
 
260
+ **Fixing a broken embed?** Re-emit it under the *same* `name:` — the viewer folds the old version into a stub and keeps your fix as the live one. (A rename is treated as a new bulb.)
261
+
262
+ **A broken embed reads back.** Emit it and move on; embeds usually just work. If the user says one broke, the viewer has already forwarded its compile/runtime error to `typebulb logs claude`, name-tagged (`[embed <name>]`) — pull it from there and fix, instead of asking the user to copy-paste.
263
+
260
264
  ## Tips for Agents
261
265
 
262
266
  - **`config.json` `description`** is the bulb's SEO meta description — keep it to one or two plain sentences (~150–160 chars), or it gets truncated.