Skip to content

Commit 8b4426b

Browse files
committed
Update 13-js-api-pygments to latest compat date and SDK
1 parent 466fbcc commit 8b4426b

4 files changed

Lines changed: 183 additions & 131 deletions

File tree

13-js-api-pygments/py/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"start": "uv run pywrangler dev"
99
},
1010
"devDependencies": {
11-
"wrangler": "^4.49.0"
11+
"wrangler": "^4.110.0"
1212
}
1313
}

13-js-api-pygments/py/wrangler.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "node_modules/wrangler/config-schema.json",
33
"name": "py-rpc-server",
44
"main": "src/entry.py",
5-
"compatibility_date": "2025-11-02",
5+
"compatibility_date": "2026-06-01",
66
"compatibility_flags": [
77
"python_workers"
88
],

13-js-api-pygments/ts/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Env {
66

77
// Type definition for the Python RPC service methods
88
interface HighlighterRpcService {
9-
highlight_code(code: string, language?: string): Promise<Map<string, string>>;
9+
highlight_code(code: string, language?: string): Promise<{ [key: string]: string }>;
1010
}
1111

1212
export default {
@@ -38,9 +38,9 @@ console.log(\`Welcome, \${user.name}!\`);
3838

3939
// Build the HTML page from template
4040
const html = templateHtml
41-
.replace('{{CSS}}', result.get('css') || '')
42-
.replace('{{LANGUAGE}}', result.get('language') || 'unknown')
43-
.replace('{{HIGHLIGHTED_CODE}}', result.get('html') || '');
41+
.replace('{{CSS}}', result['css'] || '')
42+
.replace('{{LANGUAGE}}', result['language'] || 'unknown')
43+
.replace('{{HIGHLIGHTED_CODE}}', result['html'] || '');
4444

4545
return new Response(html, {
4646
headers: { 'Content-Type': 'text/html' },

0 commit comments

Comments
 (0)