@octanejs/mcp-server 0.2.5 → 0.2.6
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/package.json +1 -1
- package/skills/setup-ssr.md +7 -3
- package/src/bridge.js +1 -0
- package/src/bridge.test.js +10 -35
- package/src/index.js +13 -4
- package/src/index.test.js +5 -0
package/package.json
CHANGED
package/skills/setup-ssr.md
CHANGED
|
@@ -66,9 +66,13 @@ hydration-stable; the client adopts server DOM instead of rebuilding it.
|
|
|
66
66
|
self-contained SSR server at `dist/server/entry.js` (exports
|
|
67
67
|
`handler`/`nodeHandler`; preview with `octane-preview`);
|
|
68
68
|
`server.render: 'buffered'` switches it to the await-everything `prerender`.
|
|
69
|
-
A deploy adapter
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
A deploy adapter prepares the output for a host: `adapter: vercel()` from
|
|
70
|
+
`@octanejs/adapter-vercel` emits Vercel's Build Output API, while
|
|
71
|
+
`adapter: cloudflare()` from `@octanejs/adapter-cloudflare` emits a module
|
|
72
|
+
Worker at `dist/server/worker.js` for Workers Static Assets. Cloudflare apps
|
|
73
|
+
keep a user-owned `wrangler.jsonc` pointing `main` at that Worker and
|
|
74
|
+
`assets.directory` at `dist/client`, with `nodejs_compat` enabled. Leave
|
|
75
|
+
`assets.not_found_handling` unset or `"none"` so navigation misses reach SSR.
|
|
72
76
|
2. **Custom server**: write `entry-server.ts` exporting a function that calls
|
|
73
77
|
`prerender()` (or `renderToString()`, or a streaming renderer) and splices
|
|
74
78
|
the result into your HTML template, and `entry-client.ts` calling
|
package/src/bridge.js
CHANGED
|
@@ -22,6 +22,7 @@ export const KNOWN_BINDINGS = {
|
|
|
22
22
|
'styled-components': '@octanejs/styled-components',
|
|
23
23
|
'react-router': '@octanejs/remix-router',
|
|
24
24
|
'react-router-dom': '@octanejs/remix-router',
|
|
25
|
+
nuqs: '@octanejs/nuqs',
|
|
25
26
|
'@lexical/react': '@octanejs/lexical',
|
|
26
27
|
'@tiptap/react': '@octanejs/tiptap',
|
|
27
28
|
'lucide-react': '@octanejs/lucide',
|
package/src/bridge.test.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
|
-
import { mkdir, mkdtemp,
|
|
2
|
+
import { mkdir, mkdtemp, readFile, writeFile } from 'node:fs/promises';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { tmpdir } from 'node:os';
|
|
5
5
|
import { join } from 'node:path';
|
|
6
|
+
import { getBindingPackages } from '../../../scripts/workspace-packages.mjs';
|
|
6
7
|
import {
|
|
7
8
|
bridgeReport,
|
|
8
9
|
bridgeReportFromSource,
|
|
@@ -261,40 +262,14 @@ describe('KNOWN_BINDINGS', () => {
|
|
|
261
262
|
expect(upstreamPackages.every((name) => KNOWN_BINDINGS[name] === '@octanejs/visx')).toBe(true);
|
|
262
263
|
});
|
|
263
264
|
|
|
264
|
-
it('covers every published @octanejs binding (derived from workspace manifests)',
|
|
265
|
-
//
|
|
266
|
-
//
|
|
267
|
-
|
|
268
|
-
// core runtime, build/deploy infrastructure, this MCP server) are
|
|
269
|
-
// excluded by name.
|
|
270
|
-
const NON_BINDINGS = new Set([
|
|
271
|
-
'octane',
|
|
272
|
-
'@octanejs/app-core',
|
|
273
|
-
'@octanejs/rspack-plugin',
|
|
274
|
-
'@octanejs/rsbuild-plugin',
|
|
275
|
-
'@octanejs/vite-plugin',
|
|
276
|
-
'@octanejs/adapter-vercel',
|
|
277
|
-
'@octanejs/mcp-server',
|
|
278
|
-
]);
|
|
279
|
-
const packagesRoot = fileURLToPath(new URL('../..', import.meta.url));
|
|
280
|
-
const bindings = [];
|
|
281
|
-
const bindingDirectories = [];
|
|
282
|
-
for (const entry of await readdir(packagesRoot, { withFileTypes: true })) {
|
|
283
|
-
if (!entry.isDirectory()) continue;
|
|
284
|
-
let manifest;
|
|
285
|
-
try {
|
|
286
|
-
manifest = JSON.parse(
|
|
287
|
-
await readFile(join(packagesRoot, entry.name, 'package.json'), 'utf8'),
|
|
288
|
-
);
|
|
289
|
-
} catch {
|
|
290
|
-
continue; // not a package dir
|
|
291
|
-
}
|
|
292
|
-
if (manifest.private || NON_BINDINGS.has(manifest.name)) continue;
|
|
293
|
-
bindings.push(manifest.name);
|
|
294
|
-
bindingDirectories.push(entry.name);
|
|
295
|
-
}
|
|
265
|
+
it('covers every published @octanejs binding (derived from workspace manifests)', () => {
|
|
266
|
+
// Use the same role classification as the generated package inventory so
|
|
267
|
+
// metaframeworks and infrastructure cannot drift into the binding catalog.
|
|
268
|
+
const bindings = getBindingPackages();
|
|
296
269
|
expect(bindings.length).toBeGreaterThan(0);
|
|
297
|
-
expect(new Set(Object.values(KNOWN_BINDINGS))).toEqual(
|
|
298
|
-
|
|
270
|
+
expect(new Set(Object.values(KNOWN_BINDINGS))).toEqual(
|
|
271
|
+
new Set(bindings.map(({ name }) => name)),
|
|
272
|
+
);
|
|
273
|
+
expect(KNOWN_BINDING_PACKAGE_DIRS).toEqual(new Set(bindings.map(({ dir }) => dir)));
|
|
299
274
|
});
|
|
300
275
|
});
|
package/src/index.js
CHANGED
|
@@ -54,10 +54,14 @@ export const BENCHMARK_SUITES = [
|
|
|
54
54
|
'react-hosted-islands',
|
|
55
55
|
'ssr-throughput',
|
|
56
56
|
'streaming-ssr',
|
|
57
|
+
'ssr-http',
|
|
58
|
+
'ssr-workerd',
|
|
59
|
+
'tanstack-start',
|
|
57
60
|
'dbmon-deopt',
|
|
58
61
|
'js-framework-deopt',
|
|
59
62
|
'async-waterfall',
|
|
60
63
|
'async-composition',
|
|
64
|
+
'lynx-list',
|
|
61
65
|
'codegen-size',
|
|
62
66
|
'bundle-size',
|
|
63
67
|
'three-renderer',
|
|
@@ -94,7 +98,7 @@ export function areaForPath(path) {
|
|
|
94
98
|
if (path.startsWith('packages/rspack-plugin-octane/')) return 'rspack-plugin';
|
|
95
99
|
if (path.startsWith('packages/rsbuild-plugin-octane/')) return 'rsbuild-plugin';
|
|
96
100
|
if (path.startsWith('packages/vite-plugin-octane/')) return 'vite-plugin';
|
|
97
|
-
if (
|
|
101
|
+
if (/^packages\/adapter-[^/]+\//.test(path)) return 'deploy-adapter';
|
|
98
102
|
if (path.startsWith('packages/octane-evals/')) return 'evals';
|
|
99
103
|
if (path.startsWith('packages/octane-mcp-server/')) return 'mcp-server';
|
|
100
104
|
const packageMatch = path.match(/^packages\/([^/]+)\//);
|
|
@@ -166,9 +170,14 @@ export function validationFor(paths, taskKind) {
|
|
|
166
170
|
);
|
|
167
171
|
}
|
|
168
172
|
if (areas.has('deploy-adapter')) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
173
|
+
for (const path of paths) {
|
|
174
|
+
const match = path.match(/^packages\/(adapter-[^/]+)\//);
|
|
175
|
+
if (match) {
|
|
176
|
+
commands.add(
|
|
177
|
+
`./node_modules/.bin/vitest run packages/${match[1]}/tests --project ${match[1]}`,
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
172
181
|
}
|
|
173
182
|
if (
|
|
174
183
|
areas.has('metaframework-core') ||
|
package/src/index.test.js
CHANGED
|
@@ -30,6 +30,7 @@ describe('@octanejs/mcp-server helpers', () => {
|
|
|
30
30
|
expect(areaForPath('packages/radix/src/index.ts')).toBe('ecosystem-binding');
|
|
31
31
|
expect(areaForPath('packages/octane-mcp-server/src/index.js')).toBe('mcp-server');
|
|
32
32
|
expect(areaForPath('packages/adapter-vercel/src/index.ts')).toBe('deploy-adapter');
|
|
33
|
+
expect(areaForPath('packages/adapter-cloudflare/src/index.js')).toBe('deploy-adapter');
|
|
33
34
|
expect(areaForPath('packages/octane-evals/tools/run.mjs')).toBe('evals');
|
|
34
35
|
expect(areaForPath('website/src/pages/index.tsrx')).toBe('website');
|
|
35
36
|
expect(areaForPath('benchmarks/news/run.mjs')).toBe('benchmark');
|
|
@@ -40,6 +41,7 @@ describe('@octanejs/mcp-server helpers', () => {
|
|
|
40
41
|
const commands = validationFor(
|
|
41
42
|
[
|
|
42
43
|
'packages/adapter-vercel/src/index.ts',
|
|
44
|
+
'packages/adapter-cloudflare/src/index.js',
|
|
43
45
|
'packages/octane-evals/tools/run.mjs',
|
|
44
46
|
'website/src/pages/index.tsrx',
|
|
45
47
|
],
|
|
@@ -49,6 +51,9 @@ describe('@octanejs/mcp-server helpers', () => {
|
|
|
49
51
|
expect(commands).toContain(
|
|
50
52
|
'./node_modules/.bin/vitest run packages/adapter-vercel/tests --project adapter-vercel',
|
|
51
53
|
);
|
|
54
|
+
expect(commands).toContain(
|
|
55
|
+
'./node_modules/.bin/vitest run packages/adapter-cloudflare/tests --project adapter-cloudflare',
|
|
56
|
+
);
|
|
52
57
|
expect(commands).toContain(
|
|
53
58
|
'./node_modules/.bin/vitest run packages/octane-evals/tests --project octane-evals',
|
|
54
59
|
);
|