@notionhq/custom-blocks-dev-shell 0.1.29 → 0.1.31

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,50 +1,46 @@
1
- # Notion custom blocks dev shell
1
+ # Custom blocks dev shell
2
2
 
3
- A local dev shell for Notion custom block workers. It builds your worker,
4
- reads the manifest declared by your `worker.customBlock(...)` calls, serves each
5
- block with your project's own Vite, and renders them in a mock Notion host with
6
- sample data sources you can bind against. Use it to exercise a block locally
7
- before `ntn workers deploy`.
3
+ The dev shell runs custom blocks in a local mock Notion host. It provides sample
4
+ data that blocks can use. It builds the worker, finds its custom block
5
+ declarations, and serves each block with the worker's Vite server. Use it before
6
+ `ntn workers deploy`.
7
+
8
+ Three groups use this dev shell:
9
+
10
+ - Custom block authors use it to build and preview custom blocks.
11
+ - Custom block SDK authors use it to develop and test the SDK.
12
+ - The verification harness uses it to check SDK and host behavior.
8
13
 
9
14
  ## Usage
10
15
 
11
- From anywhere inside your worker project, with the Notion CLI (v0.20.0+):
16
+ From your worker project, with Notion CLI `0.20.0` or later:
12
17
 
13
18
  ```bash
14
19
  ntn customblocks dev
15
20
  ```
16
21
 
17
- Then open http://localhost:9873.
22
+ Then open `http://localhost:9873`.
18
23
 
19
- Add this package to the worker's `devDependencies` to pin its version and make
20
- the reference docs below readable from the worker's `node_modules`; without an
21
- install, the CLI fetches the latest release on each run instead.
24
+ Install `@notionhq/custom-blocks-dev-shell` in the worker's `devDependencies`
25
+ to pin its version. This also makes the reference docs available in
26
+ `node_modules`. If you do not install it, the CLI fetches the latest version
27
+ each time.
22
28
 
23
- Options:
29
+ ### Options
24
30
 
25
- - `[path]` point at a worker directory explicitly instead of detecting one
26
- from the current directory.
27
- - `--port <port>` — serve the shell UI somewhere other than 9873.
28
- - `--block-base-port <port>` first port handed to the per-block dev servers
29
- (default 9876; blocks count up from there).
31
+ - `[path]`: Select a worker directory instead of using the current directory.
32
+ - `--port <port>`: Use a different port for the dev shell. The default is
33
+ `9873`.
34
+ - `--block-base-port <port>`: Set the first port for block servers. The default
35
+ is `9876`. Each next block uses the next port.
30
36
 
31
- ## Reference
37
+ ## Documentation
32
38
 
33
- One page per topic, shipped in this package's `docs/` so they're readable
34
- from `node_modules`:
39
+ These docs ship with the package and are available from `node_modules`:
35
40
 
36
- - [`docs/bindings.md`](./docs/bindings.md) connecting blocks to data
37
- sources: auto-mapping and compatibility rules, initialization, and live
41
+ - [`docs/bindings.md`](./docs/bindings.md): Connect blocks to data sources.
42
+ The page covers automatic mapping, compatibility, initialization, and live
38
43
  rebinding.
39
- - [`docs/data-sources.md`](./docs/data-sources.md) local data sources: the
40
- `src/data/*.json` file format, value shapes per property type, validation,
41
- and how missing sources are materialized from the worker's declared
42
- schemas.
43
-
44
- ## Requirements
45
-
46
- - Node.js >= 20.19 for the shell itself. Use Node.js >= 22 for the standard
47
- Notion worker projects.
48
- - The worker's dependencies installed (use its declared package manager; the
49
- standard projects use `pnpm install`), including `vite` and a build script
50
- that emits `dist/index.js`.
44
+ - [`docs/data-sources.md`](./docs/data-sources.md): Define local data sources
45
+ in `src/data/*.json`. The page covers value shapes, validation, and files
46
+ generated from worker schemas.