catalyst-core 1.0.1 → 1.0.2-canary.1
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/errors/registry.js +8 -0
- package/dist/errors-index.json +7 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.jsx +1 -1
- package/dist/scripts/build.js +3 -1
- package/dist/scripts/preflight.js +81 -1
- package/dist/scripts/serve.js +8 -1
- package/dist/server/renderer/document/Body.d.ts +0 -11
- package/dist/server/renderer/document/Body.jsx +0 -10
- package/dist/server/renderer/document/Head.d.ts +0 -13
- package/dist/server/renderer/document/Head.jsx +0 -12
- package/dist/vite/vite.config.client.js +1 -1
- package/dist/vite/vite.config.js +24 -6
- package/dist/web-router/components/MetaTag.jsx +6 -13
- package/dist/web-router/components/MetaTag.test.jsx +40 -33
- package/dist/web-router/components/RouterDataProvider.d.ts +25 -1
- package/dist/web-router/components/RouterDataProvider.jsx +35 -1
- package/dist/web-router/components/RouterDataProvider.test.jsx +44 -0
- package/dist/web-router/context.d.ts +15 -1
- package/dist/web-router/context.jsx +11 -0
- package/dist/webmcp/WebMcpProvider.jsx +234 -0
- package/dist/webmcp/declarative.js +207 -0
- package/dist/webmcp/declarative.test.js +122 -0
- package/dist/webmcp/errors.js +59 -0
- package/dist/webmcp/errors.test.js +47 -0
- package/dist/webmcp/index.js +40 -0
- package/dist/webmcp/native.js +37 -0
- package/dist/webmcp/native.test.js +41 -0
- package/dist/webmcp/pageInfo.js +119 -0
- package/dist/webmcp/pageInfo.test.js +85 -0
- package/dist/webmcp/registry.dom.test.js +175 -0
- package/dist/webmcp/registry.js +540 -0
- package/dist/webmcp/registry.test.js +228 -0
- package/dist/webmcp/routeContext.js +11 -0
- package/dist/webmcp/shim-entry.js +8 -0
- package/dist/webmcp/shim.js +149 -0
- package/dist/webmcp/useTool.js +121 -0
- package/package.json +3 -6
- package/test/scripts/preflight.test.ts +100 -2
- package/test/server/manifestCache.test.ts +13 -0
- package/vitest.config.ts +4 -0
|
@@ -68,4 +68,17 @@ describe("manifestCache (production load path)", () => {
|
|
|
68
68
|
expect(mod.getManifest()).toBeNull()
|
|
69
69
|
warn.mockRestore()
|
|
70
70
|
})
|
|
71
|
+
|
|
72
|
+
it("catches and warns when manifest JSON is malformed", async () => {
|
|
73
|
+
const warn = vi.spyOn(console, "warn").mockImplementation(() => {})
|
|
74
|
+
const vite = path.join(tmp, "build", ".vite")
|
|
75
|
+
fs.writeFileSync(path.join(vite, "manifest.json"), "invalid json{")
|
|
76
|
+
const mod = await import("../../src/server/manifestCache.js")
|
|
77
|
+
expect(mod.getManifest()).toBeNull()
|
|
78
|
+
expect(warn).toHaveBeenCalledWith(
|
|
79
|
+
"Could not load build manifests:",
|
|
80
|
+
expect.any(String),
|
|
81
|
+
)
|
|
82
|
+
warn.mockRestore()
|
|
83
|
+
})
|
|
71
84
|
})
|
package/vitest.config.ts
CHANGED
|
@@ -76,6 +76,10 @@ export default defineConfig({
|
|
|
76
76
|
include: [
|
|
77
77
|
"test/**/*.test.ts",
|
|
78
78
|
"src/web-router/**/*.server.test.{js,jsx}",
|
|
79
|
+
// WebMCP's registry/declarative helpers are pure logic
|
|
80
|
+
// (no DOM, no React rendering) -- same rationale as the
|
|
81
|
+
// rest of this project.
|
|
82
|
+
"src/webmcp/**/*.test.js",
|
|
79
83
|
],
|
|
80
84
|
},
|
|
81
85
|
},
|