@notionhq/custom-blocks-dev-shell 0.1.50 → 0.1.52

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
@@ -50,3 +50,7 @@ These docs ship with the package and are available from `node_modules`:
50
50
  - [`docs/data-sources.md`](./docs/data-sources.md): Define local data sources
51
51
  in `data/*.json`. The page covers value shapes, validation, and files
52
52
  generated from worker schemas.
53
+
54
+ Apps SDK projects are also supported. The shell runs the project build and reads
55
+ `dist/manifest.json` for projects depending on `@notionhq/apps`. Browser bundles
56
+ still use Vite from the project root. Workers SDK manifest extraction is unchanged.
@@ -31,7 +31,9 @@ function looksLikeWorkerDir(dir) {
31
31
  try {
32
32
  const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
33
33
  return Boolean(pkg.dependencies?.["@notionhq/workers"] ??
34
- pkg.devDependencies?.["@notionhq/workers"]);
34
+ pkg.devDependencies?.["@notionhq/workers"] ??
35
+ pkg.dependencies?.["@notionhq/apps"] ??
36
+ pkg.devDependencies?.["@notionhq/apps"]);
35
37
  }
36
38
  catch {
37
39
  return false;
@@ -83,6 +85,25 @@ async function extractWorkerManifest(workerDir, options = {}) {
83
85
  if (options.build !== false) {
84
86
  execSync("npm run build", { cwd: root, stdio: "inherit" });
85
87
  }
88
+ const pkg = JSON.parse(readFileSync(resolve(root, "package.json"), "utf8"));
89
+ if (pkg.dependencies?.["@notionhq/apps"] ||
90
+ pkg.devDependencies?.["@notionhq/apps"]) {
91
+ const raw = JSON.parse(readFileSync(resolve(root, "dist/manifest.json"), "utf8"));
92
+ if (!isManifestShape(raw)) {
93
+ throw new Error("Apps manifest has no capabilities array");
94
+ }
95
+ return {
96
+ ...raw,
97
+ databases: raw.databases ?? [],
98
+ pacers: raw.pacers ?? [],
99
+ capabilities: raw.capabilities.map(capability => ({
100
+ ...capability,
101
+ _tag: "type" in capability && typeof capability.type === "string"
102
+ ? capability.type
103
+ : capability._tag,
104
+ })),
105
+ };
106
+ }
86
107
  const entry = resolve(root, "dist/index.js");
87
108
  if (!existsSync(entry)) {
88
109
  throw new Error(`Built worker entry not found at ${entry}. The worker's build must emit dist/index.js.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notionhq/custom-blocks-dev-shell",
3
- "version": "0.1.50",
3
+ "version": "0.1.52",
4
4
  "description": "Local preview shell for Notion custom block workers.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -34,8 +34,8 @@
34
34
  "typescript": "^6.0.3",
35
35
  "vite": "^8.0.10",
36
36
  "vitest": "^4.1.11",
37
- "@notionhq/custom-blocks-host": "0.1.2",
38
- "@notionhq/custom-blocks-protocol": "0.1.0"
37
+ "@notionhq/custom-blocks-protocol": "0.1.0",
38
+ "@notionhq/custom-blocks-host": "0.1.3"
39
39
  },
40
40
  "scripts": {
41
41
  "dev": "vite",