@notionhq/custom-blocks-dev-shell 0.1.28 → 0.1.29
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/dist-cli/block-server.js
CHANGED
|
@@ -38,7 +38,7 @@ export function parseViteChange(line) {
|
|
|
38
38
|
* followed by the page reload that supersedes it, or one update per touched
|
|
39
39
|
* module — so changes buffer briefly and print once with the final outcome.
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
const CHANGE_LOG_BUFFER_MS = 150;
|
|
42
42
|
/** Wrap a change-notice printer so each burst of change lines logs once. */
|
|
43
43
|
export function makeChangeLogger(print, schedule = flush => void setTimeout(flush, CHANGE_LOG_BUFFER_MS)) {
|
|
44
44
|
let pending;
|
|
@@ -13,13 +13,13 @@ import { execSync } from "node:child_process";
|
|
|
13
13
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
14
|
import { dirname, resolve } from "node:path";
|
|
15
15
|
import { pathToFileURL } from "node:url";
|
|
16
|
-
|
|
16
|
+
const WORKER_MANIFEST_FILENAME = "worker_manifest.json";
|
|
17
17
|
/**
|
|
18
18
|
* Heuristic for the no-flag fallback: does `dir` look like a worker project?
|
|
19
19
|
* True if it carries a worker deploy binding (`worker.json`/`workers.json`) or
|
|
20
20
|
* depends on `@notionhq/workers`.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
function looksLikeWorkerDir(dir) {
|
|
23
23
|
if (existsSync(resolve(dir, "worker.json")) ||
|
|
24
24
|
existsSync(resolve(dir, "workers.json"))) {
|
|
25
25
|
return true;
|
|
@@ -75,7 +75,7 @@ function isManifestShape(value) {
|
|
|
75
75
|
* importing TypeScript source, so what the dev shell sees matches what a deploy
|
|
76
76
|
* would produce.
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
async function extractWorkerManifest(workerDir, options = {}) {
|
|
79
79
|
const root = resolve(workerDir);
|
|
80
80
|
if (!existsSync(resolve(root, "package.json"))) {
|
|
81
81
|
throw new Error(`No package.json found in worker directory: ${root}`);
|