@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 +30 -34
- package/dist/assets/index-kNlMQeXD.js +9 -0
- package/dist/index.html +1 -1
- package/dist-cli/block-server.js +2 -2
- package/dist-cli/data-sources.js +1 -1
- package/dist-cli/main.js +2 -2
- package/dist-cli/serve-ui.js +1 -1
- package/dist-cli/worker-manifest.js +2 -2
- package/docs/bindings.md +2 -2
- package/package.json +3 -3
- package/dist/assets/index-t9D9Nr_n.js +0 -9
package/README.md
CHANGED
|
@@ -1,50 +1,46 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Custom blocks dev shell
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
block with
|
|
6
|
-
|
|
7
|
-
|
|
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
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
install, the CLI fetches the latest
|
|
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]
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `--block-base-port <port
|
|
29
|
-
|
|
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
|
-
##
|
|
37
|
+
## Documentation
|
|
32
38
|
|
|
33
|
-
|
|
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)
|
|
37
|
-
|
|
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)
|
|
40
|
-
`src/data/*.json
|
|
41
|
-
|
|
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.
|