Skip to content

Commit 6e823a2

Browse files
fix(deps): resolve dependabot security vulnerabilities
1 parent bc1ddd3 commit 6e823a2

14 files changed

Lines changed: 331 additions & 636 deletions

File tree

‎examples/components/node-mcp-server/package.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
"dependencies": {
1818
"@bytecodealliance/jco-std": "^0.5.0",
1919
"@bytecodealliance/preview2-shim": "0.27.1",
20-
"@modelcontextprotocol/server": "2.0.0",
21-
"zod": "4.5.4"
20+
"@modelcontextprotocol/server": "2.3.0",
21+
"zod": "4.6.7"
2222
},
2323
"devDependencies": {
2424
"@bytecodealliance/jco": "workspace:*",
25-
"@modelcontextprotocol/client": "2.2.0"
25+
"@modelcontextprotocol/client": "2.3.0"
2626
},
2727
"engines": {
2828
"node": ">=24"

‎examples/components/node-sveltekit-server/README.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ process.
1515
## How it works
1616

1717
The standard SvelteKit Node deployment flow starts when Vite builds the
18-
application with `@sveltejs/adapter-node`. The adapter produces
18+
application with `@sveltejs/adapter-node`, configured through the SvelteKit 3
19+
plugin in [`vite.config.js`](./vite.config.js). The adapter produces
1920
`build/handler.js`, containing SvelteKit's SSR server, form-action routing, and
2021
static asset middleware. Normally, an application imports that handler, passes
2122
it to a `node:http` server, and starts listening.
@@ -120,7 +121,8 @@ HTTP callbacks.
120121

121122
jco-std's `AsyncLocalStorage` support is intentionally synchronous, while
122123
SvelteKit uses async request-local storage. The component-only bundle config
123-
selects SvelteKit's existing serialized-request fallback. It also bypasses
124+
selects SvelteKit's existing serialized-request fallback and disables optional
125+
Node diagnostics that use the unsupported `process.getBuiltinModule`. It also bypasses
124126
`String.prototype.normalize` for generated ASCII asset names because that
125127
method is not currently available in StarlingMonkey.
126128

@@ -140,7 +142,7 @@ resulting Wasm. The future runtime's host capabilities are not attached during
140142
that build-time execution.
141143

142144
Loading `node:http` initializes host-backed Node state, and the Node adapter
143-
reads `process.env` and indexes its generated client directory. The wrapper
145+
reads `process.env` and locates its generated client directory. The wrapper
144146
therefore dynamically imports [`src/runtime.ts`](./src/runtime.ts), which loads
145147
`node:http` and the adapter entry point, inside `start` after the component
146148
embedder has supplied HTTP, process, filesystem, and TTY capabilities.

‎examples/components/node-sveltekit-server/package.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
},
2929
"devDependencies": {
3030
"@bytecodealliance/jco": "workspace:*",
31-
"@sveltejs/adapter-node": "5.5.7",
32-
"@sveltejs/kit": "2.70.3",
31+
"@sveltejs/adapter-node": "6.0.0",
32+
"@sveltejs/kit": "3.1.0",
3333
"@types/node": "^24.3.0",
3434
"puppeteer": "catalog:",
35-
"svelte": "5.57.0",
35+
"svelte": "5.57.2",
3636
"svelte-check": "4.7.6",
3737
"typescript": "6.0.3",
38-
"vite": "8.3.0"
38+
"vite": "8.3.3"
3939
},
4040
"engines": {
4141
"node": ">=24"

‎examples/components/node-sveltekit-server/scripts/bundle-config.mjs‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ export default {
55
transform(code, id) {
66
const normalizedId = id.replaceAll('\\', '/');
77

8-
if (normalizedId.endsWith('/build/env.js')) {
9-
return code.replace(
10-
'path.dirname(fileURLToPath(import.meta.url))',
11-
"path.resolve(process.cwd(), 'build')",
12-
);
8+
if (normalizedId.endsWith('/build/adapter-node.js')) {
9+
return code
10+
.replace("import { dirname } from 'node:path';", "import { resolve } from 'node:path';")
11+
.replace('dirname(fileURLToPath(import.meta.url))', "resolve(process.cwd(), 'build')");
1312
}
1413

1514
if (normalizedId.includes('/build/server/')) {
@@ -19,9 +18,19 @@ export default {
1918
// requests and carries the same context without it.
2019
.replaceAll('!!globalThis.process?.versions?.webcontainer', 'true')
2120
.replaceAll(
22-
"import('node:async_hooks')",
21+
/import\((['"])node:async_hooks\1\)/g,
2322
"Promise.reject(new Error('AsyncLocalStorage is unavailable in this component'))",
24-
);
23+
)
24+
// jco-std throws for getBuiltinModule. Let SvelteKit's
25+
// optional Node diagnostics use their non-Node fallback.
26+
.replaceAll('globalThis.process?.getBuiltinModule', 'undefined')
27+
// Vite retains an unused Node metadata read. Resolving
28+
// import.meta after snapshotting traps in StarlingMonkey.
29+
.replaceAll('import.meta.dirname;', '')
30+
// StarlingMonkey lacks this Unicode property escape in
31+
// dynamic regexes. Keep the equivalent range and u flag
32+
// so valid surrogate pairs remain intact when escaping HTML.
33+
.replaceAll(String.raw`\\p{Surrogate}`, String.raw`[\\uD800-\\uDFFF]`);
2534

2635
// StarlingMonkey does not currently implement
2736
// String.prototype.normalize. SvelteKit's static asset server

‎examples/components/node-sveltekit-server/svelte.config.js‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎examples/components/node-sveltekit-server/test/e2e.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ for (const target of targets) {
159159
assert.equal(invalid.status, 400);
160160
assert.match(await invalid.text(), /Give this task a short, useful name\./);
161161

162+
const escaped = await submit(url, 'add', { title: 'Escape <script>alert("x")</script> & 🌍' });
163+
assert.equal(escaped.status, 200);
164+
const escapedHtml = await escaped.text();
165+
assert.ok(escapedHtml.includes('Escape &lt;script>alert("x")&lt;/script> &amp; 🌍'));
166+
assert.ok(!escapedHtml.includes('<script>alert("x")</script>'));
167+
162168
const missing = await fetch(new URL('/missing', url));
163169

164170
assert.equal(missing.status, 404);

‎examples/components/node-sveltekit-server/tsconfig.json‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2-
"extends": "./.svelte-kit/tsconfig.json",
2+
"extends": "$app/tsconfig",
3+
"include": ["src", "test", "*.js"],
4+
"exclude": ["node_modules", "build", "dist"],
35
"compilerOptions": {
46
"allowImportingTsExtensions": true,
57
"esModuleInterop": true,
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import adapter from '@sveltejs/adapter-node';
12
import { sveltekit } from '@sveltejs/kit/vite';
23
import { defineConfig } from 'vite';
34

45
export default defineConfig({
5-
plugins: [sveltekit()],
6+
plugins: [sveltekit({ adapter: adapter({ out: 'build' }) })],
67
});

‎packages/jco-std/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@
756756
"hono": "^4.13.11",
757757
"rolldown": "^1.0.0-beta.46",
758758
"typescript": "catalog:",
759-
"vitest": "^4.1.11",
759+
"vitest": "^4.1.12",
760760
"which": "^5.0.0"
761761
},
762762
"peerDependencies": {

‎packages/jco-transpile/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
"typescript": "catalog:",
8787
"typescript-compiler-api": "npm:typescript@6.0.3",
8888
"vite": "^7.3.7",
89-
"vitest": "^4.1.11",
89+
"vitest": "^4.1.12",
9090
"which": "catalog:"
9191
}
9292
}

0 commit comments

Comments
 (0)