@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/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Workers local shell</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-kNlMQeXD.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-DpKdfNws.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/dist-cli/block-server.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Per-block Vite server plumbing shared by the repo dev script
|
|
3
|
-
* (`scripts/dev.ts`) and the published dev
|
|
3
|
+
* (`scripts/dev.ts`) and the published dev shell CLI (`cli/main.ts`).
|
|
4
4
|
*/
|
|
5
5
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { relative, resolve } from "node:path";
|
|
7
7
|
/** First port handed to per-block Vite servers; blocks count up from here. */
|
|
8
8
|
export const BLOCK_BASE_PORT = 9876;
|
|
9
|
-
/** Port the dev
|
|
9
|
+
/** Port the dev shell UI is served on. */
|
|
10
10
|
export const SHELL_PORT = 9873;
|
|
11
11
|
/** The registry for a worker's blocks, assuming sequential port assignment. */
|
|
12
12
|
export function buildBlockRegistry(blocks, basePort = BLOCK_BASE_PORT) {
|
package/dist-cli/data-sources.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Load a worker's dev
|
|
2
|
+
* Load a worker's dev shell data sources from `<dataDir>/*.json` — one source
|
|
3
3
|
* per file, hand-authored. Every file is validated here, before it reaches
|
|
4
4
|
* the shell, so a malformed source fails spin-up naming the file and the
|
|
5
5
|
* problem instead of breaking the UI.
|
package/dist-cli/main.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Entry point for the published dev
|
|
2
|
+
* Entry point for the published dev shell CLI (`npx`-run from a worker
|
|
3
3
|
* project). Mirrors the repo's `scripts/dev.ts`: build the
|
|
4
4
|
* worker, extract its manifest, serve one Vite dev server per custom block
|
|
5
|
-
* (using the worker's own Vite install), and serve the prebuilt dev
|
|
5
|
+
* (using the worker's own Vite install), and serve the prebuilt dev shell UI
|
|
6
6
|
* with the block registry injected at runtime.
|
|
7
7
|
*/
|
|
8
8
|
import { spawn } from "node:child_process";
|
package/dist-cli/serve-ui.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Dependency-free static server for the prebuilt dev
|
|
2
|
+
* Dependency-free static server for the prebuilt dev shell UI (`dist/`).
|
|
3
3
|
*
|
|
4
4
|
* The published UI is a plain Vite build, so the block registry can't ride in
|
|
5
5
|
* through build-time `import.meta.env` vars the way it does under
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* The worker manifest is otherwise in-memory only (tied to `worker.ts` + cloud
|
|
8
8
|
* build), so we materialize it under the worker's git-ignored `.dev-shell/` dir
|
|
9
|
-
* (clearly a dev
|
|
9
|
+
* (clearly a dev shell artifact, not something the author maintains).
|
|
10
10
|
* Regenerated on every spin-up.
|
|
11
11
|
*/
|
|
12
12
|
import { execSync } from "node:child_process";
|
|
@@ -107,7 +107,7 @@ async function extractWorkerManifest(workerDir, options = {}) {
|
|
|
107
107
|
}
|
|
108
108
|
/**
|
|
109
109
|
* Extract the worker manifest and write it to `.dev-shell/worker_manifest.json`
|
|
110
|
-
* inside the worker (a git-ignored dev
|
|
110
|
+
* inside the worker (a git-ignored dev shell artifact directory). Returns the parsed
|
|
111
111
|
* manifest and the path written.
|
|
112
112
|
*/
|
|
113
113
|
export async function generateWorkerManifest(workerDir, options = {}) {
|
package/docs/bindings.md
CHANGED
|
@@ -31,8 +31,8 @@ failed to initialize recovers the same way — fix its bindings and save.
|
|
|
31
31
|
Bindings last for the page load, per block: refresh the shell and every block
|
|
32
32
|
returns to unbound.
|
|
33
33
|
|
|
34
|
-
The shell reads `src/data/*.json` once at spin-up. To pick up file edits,
|
|
35
|
-
restart the dev
|
|
34
|
+
The dev shell reads `src/data/*.json` once at spin-up. To pick up file edits,
|
|
35
|
+
restart the dev shell. A browser refresh is not enough.
|
|
36
36
|
|
|
37
37
|
## Data view
|
|
38
38
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@notionhq/custom-blocks-dev-shell",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "Local preview shell for Notion custom block workers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"dev": "vite",
|
|
46
|
-
"build": "vite build && tsc --project tsconfig.
|
|
46
|
+
"build": "vite build && tsc --project cli/tsconfig.build.json",
|
|
47
47
|
"test": "vitest run",
|
|
48
|
-
"typecheck": "tsc --
|
|
48
|
+
"typecheck": "tsc --project tsconfig.json && tsc --project cli/tsconfig.json"
|
|
49
49
|
}
|
|
50
50
|
}
|