Skip to content

Commit 855f2c0

Browse files
revert(vtex): roll back to kubernetes-bun deploy (#429)
Reverts the Workers migration (#424#427). The runtime cache fix from decocms/studio#3299/#3300 didn't restore acceptable tools/list latency (~5s/call still observed after 1.6.2). Going back to the working kubernetes-bun pipeline; vtex stays on @decocms/runtime 1.3.1 with the serve()-style entrypoint. Restores: deploy.json entry, wrangler.toml deleted, deploy-vtex.yml workflow deleted, server/main.ts back to bun serve(), package.json back to deco-cli/openapi-ts deps, tsconfig/app.json restored. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 79826a4 commit 855f2c0

10 files changed

Lines changed: 992 additions & 183 deletions

File tree

.github/workflows/deploy-vtex.yml

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

bun.lock

Lines changed: 95 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,15 @@
287287
"shared/**"
288288
]
289289
},
290+
"vtex": {
291+
"site": "vtex",
292+
"entrypoint": "./dist/server/main.js",
293+
"platformName": "kubernetes-bun",
294+
"watch": [
295+
"vtex/**",
296+
"shared/**"
297+
]
298+
},
290299
"perplexity": {
291300
"site": "perplexity",
292301
"entrypoint": "./dist/server/main.js",

vtex/app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"friendlyName": "VTEX Commerce APIs",
55
"connection": {
66
"type": "HTTP",
7-
"url": "https://vtex-mcp.decocms.com/mcp",
7+
"url": "https://sites-vtex.decocache.com/mcp",
88
"configSchema": {
99
"type": "object",
1010
"properties": {

vtex/bun.lock

Lines changed: 703 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vtex/package.json

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,32 @@
55
"private": true,
66
"type": "module",
77
"scripts": {
8-
"dev": "bunx wrangler dev",
8+
"dev": "bun run --hot server/main.ts",
9+
"configure": "deco configure",
10+
"gen": "deco gen --output=shared/deco.gen.ts",
11+
"deploy": "npm run build && deco deploy ./dist/server",
912
"check": "tsc --noEmit",
10-
"test": "bun test",
11-
"build": "bunx wrangler deploy --dry-run --outdir=dist",
12-
"deploy": "bunx wrangler deploy"
13+
"build:server": "NODE_ENV=production bun build server/main.ts --target=bun --outfile=dist/server/main.js",
14+
"build": "bun run build:server",
15+
"openapi": "openapi-ts",
16+
"generate": "bun run download-schemas && bun run openapi",
17+
"download-schemas": "bun run scripts/download-schemas.ts",
18+
"test": "bun test"
1319
},
1420
"dependencies": {
15-
"@decocms/bindings": "^1.4.0",
16-
"@decocms/runtime": "^1.6.2",
17-
"@modelcontextprotocol/sdk": "^1.27.1",
21+
"@decocms/bindings": "^1.3.1",
22+
"@decocms/runtime": "1.3.1",
1823
"zod": "^4.0.0"
1924
},
2025
"devDependencies": {
21-
"@cloudflare/workers-types": "^4.20251014.0",
26+
"@cloudflare/workers-types": "^4.20260206.0",
2227
"@decocms/mcps-shared": "1.0.0",
2328
"@hey-api/client-fetch": "^0.8.0",
29+
"@hey-api/openapi-ts": "0.92.4",
30+
"@modelcontextprotocol/sdk": "1.20.2",
2431
"@types/bun": "^1.2.14",
25-
"@types/node": "^22.0.0",
26-
"typescript": "^5.7.2",
27-
"wrangler": "^4.28.0"
32+
"deco-cli": "^0.28.0",
33+
"typescript": "^5.7.2"
2834
},
2935
"engines": {
3036
"node": ">=22.0.0"

vtex/server/main.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
/**
2-
* VTEX Commerce MCP — Cloudflare Workers entrypoint
2+
* VTEX Commerce MCP
33
*
44
* MCP for VTEX Commerce APIs - Catalog, Orders, and Logistics/Inventory.
5-
* Auth is per-connection static config (accountName/appKey/appToken) supplied
6-
* via the configSchema in app.json — no OAuth.
75
*/
6+
import { serve } from "@decocms/mcps-shared/serve";
87
import { withRuntime } from "@decocms/runtime";
98
import { tools } from "./tools/index.ts";
109
import { type Env, StateSchema } from "./types/env.ts";
10+
import packageJson from "../package.json" with { type: "json" };
11+
12+
console.log(`VTEX Commerce MCP v${packageJson.version}`);
1113

1214
export type { Env };
1315
export { StateSchema };
@@ -19,6 +21,4 @@ const runtime = withRuntime<Env, typeof StateSchema>({
1921
tools,
2022
});
2123

22-
export default {
23-
fetch: runtime.fetch,
24-
};
24+
serve(runtime.fetch);

0 commit comments

Comments
 (0)