@notionhq/custom-blocks-dev-shell 0.1.18 → 0.1.20
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/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-DJu5pDpb.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="/assets/index-CDSiId-C.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/dist-cli/block-server.js
CHANGED
|
@@ -73,10 +73,10 @@ function relativeImport(fromDir, toPath) {
|
|
|
73
73
|
* re-exports the block's own config (keeping its plugins) but pins `root` to the
|
|
74
74
|
* block and `cacheDir` to a block-specific dir, so concurrently-run block
|
|
75
75
|
* servers don't collide in the worker's shared `node_modules/.vite`. It also
|
|
76
|
-
* serves `/
|
|
77
|
-
* worker-backed blocks carry no manifest file of their own, so the wrapper
|
|
76
|
+
* serves `/manifest` from the block's slice of the worker manifest. The wrapper
|
|
78
77
|
* plays the part production infra does and answers the SDK's manifest fetch
|
|
79
|
-
* from the worker
|
|
78
|
+
* directly from the worker declaration. Returns the wrapper path for
|
|
79
|
+
* `vite --config`.
|
|
80
80
|
*/
|
|
81
81
|
export function writeBlockViteConfig(workerDir, blockDir, capability) {
|
|
82
82
|
const key = capability.key;
|
|
@@ -100,14 +100,12 @@ const resolved =
|
|
|
100
100
|
|
|
101
101
|
const manifest = ${JSON.stringify(JSON.stringify(capability.config.manifest))}
|
|
102
102
|
|
|
103
|
-
// enforce: "pre" registers this middleware ahead of the SDK vite plugin's,
|
|
104
|
-
// which would otherwise 404 the path (no manifest file exists in the block).
|
|
105
103
|
const serveWorkerManifest = {
|
|
106
104
|
name: "dev-shell:worker-block-manifest",
|
|
107
105
|
enforce: "pre",
|
|
108
106
|
configureServer(server) {
|
|
109
107
|
server.middlewares.use((req, res, next) => {
|
|
110
|
-
if (req.url?.split("?", 1)[0] !== "/
|
|
108
|
+
if (req.url?.split("?", 1)[0] !== "/manifest") {
|
|
111
109
|
next()
|
|
112
110
|
return
|
|
113
111
|
}
|