@monocle.sh/studio 0.2.2 → 0.2.3

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.
@@ -5,7 +5,11 @@ var static_default = defineConfig({
5
5
  immutable: true,
6
6
  maxAge: "1y",
7
7
  cacheControl: true,
8
- etag: true
8
+ etag: true,
9
+ headers: (path) => {
10
+ if (!path.endsWith(".html")) return {};
11
+ return { "Cache-Control": "no-cache, must-revalidate" };
12
+ }
9
13
  });
10
14
  //#endregion
11
15
  export { static_default as default };
@@ -24,12 +24,14 @@ router.delete("/mcp", [() => import("../controllers/mcp_controller.js"), "handle
24
24
  * Static assets (js, css, etc.) are handled by @adonisjs/static middleware.
25
25
  */
26
26
  const uiDistPath = join(fileURLToPath(import.meta.url), "..", "..", "..", "ui", "dist");
27
+ const HTML_NO_CACHE_HEADERS = { "Cache-Control": "no-cache, must-revalidate" };
27
28
  router.get("*", ({ request, response }) => {
28
29
  const url = request.url();
29
30
  if (url.startsWith("/v1/") || url.startsWith("/api/")) return response.notFound("Not found");
30
31
  const indexPath = join(uiDistPath, "index.html");
31
32
  if (!existsSync(indexPath)) return response.ok("<html><body style=\"background:#222;color:#fff;font-family:monospace;display:flex;align-items:center;justify-content:center;height:100vh\"><div style=\"text-align:center\"><h2>Monocle DevTools</h2><p>UI not built yet. Run: cd packages/devtools/ui && pnpm build</p></div></body></html>");
32
33
  response.header("content-type", "text/html");
34
+ Object.entries(HTML_NO_CACHE_HEADERS).forEach(([key, value]) => response.header(key, value));
33
35
  response.stream(createReadStream(indexPath));
34
36
  });
35
37
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monocle.sh/studio",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Monocle DevTools - local development observability tool",
5
5
  "keywords": [
6
6
  "devtools",