From 995f44653a9d935435f7c0e0fed6eb63c263f007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hanu=C5=A1?= Date: Sun, 5 Jul 2026 00:52:07 +0200 Subject: [PATCH] fix(ts-templates): move tsx and typescript to dependencies Every ts-* template declares tsx and typescript in devDependencies, but they are required at runtime by the template's own scripts: "start:dev": "tsx src/main.ts" "build": "tsc" If a user (or an install layer above) sets NODE_ENV=production, or npm is invoked with --omit=dev, the fresh scaffold fails immediately: $ apify create tmp -t ts-empty $ cd tmp && apify run sh: tsx: not found Error: /usr/local/bin/npm exited with code 127 $ npm run build sh: tsc: not found # npx tsc then attempts to install the deprecated `tsc@2.0.4` squatter The Docker builder stage already passes --include=dev, so container image builds are unaffected. The bug only bites scaffold-then-run flows on hosts where devDependencies are skipped. Moving tsx and typescript into dependencies fixes those flows without changing image size (the runtime image uses the compiled dist/ and never installs either package). ts-start-bun runs `bun src/main.ts` directly and does not need tsx at runtime, so it is left unchanged. ts-playwright-test-runner already has both packages in dependencies. Surfaced during an evaluation of Apify surfaces for agent-driven Actor development. Co-Authored-By: Claude Opus 4.7 --- templates/ts-beeai-agent/package.json | 6 +++--- templates/ts-bootstrap-cheerio-crawler/package.json | 6 +++--- templates/ts-crawlee-cheerio/package.json | 6 +++--- templates/ts-crawlee-playwright-camoufox/package.json | 6 +++--- templates/ts-crawlee-playwright-chrome/package.json | 6 +++--- templates/ts-crawlee-puppeteer-chrome/package.json | 6 +++--- templates/ts-empty/package.json | 6 +++--- templates/ts-mastraai/package.json | 6 +++--- templates/ts-mcp-empty/package.json | 6 +++--- templates/ts-mcp-proxy/package.json | 6 +++--- templates/ts-standby/package.json | 6 +++--- templates/ts-start/package.json | 6 +++--- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/templates/ts-beeai-agent/package.json b/templates/ts-beeai-agent/package.json index 7a3de23bb..f58c3d69c 100644 --- a/templates/ts-beeai-agent/package.json +++ b/templates/ts-beeai-agent/package.json @@ -10,7 +10,9 @@ "@ai-sdk/openai": "3.0.63", "apify": "^3.7.2", "beeai-framework": "^0.1.29", - "zod": "^3.25.76" + "zod": "^3.25.76", + "tsx": "^4.22.3", + "typescript": "^6.0.3" }, "devDependencies": { "@apify/eslint-config": "^2.0.6", @@ -20,8 +22,6 @@ "eslint-config-prettier": "^10.1.8", "globals": "^17.6.0", "prettier": "^3.8.3", - "tsx": "^4.22.3", - "typescript": "^6.0.3", "typescript-eslint": "^8.60.0", "vitest": "^4.1.7" }, diff --git a/templates/ts-bootstrap-cheerio-crawler/package.json b/templates/ts-bootstrap-cheerio-crawler/package.json index 40fc941d6..6409ce4f1 100644 --- a/templates/ts-bootstrap-cheerio-crawler/package.json +++ b/templates/ts-bootstrap-cheerio-crawler/package.json @@ -8,7 +8,9 @@ }, "dependencies": { "apify": "^3.7.0", - "@crawlee/cheerio": "^3.15.3" + "@crawlee/cheerio": "^3.15.3", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -18,8 +20,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-crawlee-cheerio/package.json b/templates/ts-crawlee-cheerio/package.json index ff3b80e84..7733308cc 100644 --- a/templates/ts-crawlee-cheerio/package.json +++ b/templates/ts-crawlee-cheerio/package.json @@ -8,7 +8,9 @@ }, "dependencies": { "apify": "^3.7.0", - "@crawlee/cheerio": "^3.15.3" + "@crawlee/cheerio": "^3.15.3", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -18,8 +20,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-crawlee-playwright-camoufox/package.json b/templates/ts-crawlee-playwright-camoufox/package.json index 15032bea0..1ef4feecb 100644 --- a/templates/ts-crawlee-playwright-camoufox/package.json +++ b/templates/ts-crawlee-playwright-camoufox/package.json @@ -10,7 +10,9 @@ "apify": "^3.7.0", "camoufox-js": "^0.9.0", "@crawlee/playwright": "^3.15.3", - "playwright": "1.60.0" + "playwright": "1.60.0", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -20,8 +22,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-crawlee-playwright-chrome/package.json b/templates/ts-crawlee-playwright-chrome/package.json index 3c6b8f628..a7115df4a 100644 --- a/templates/ts-crawlee-playwright-chrome/package.json +++ b/templates/ts-crawlee-playwright-chrome/package.json @@ -9,7 +9,9 @@ "dependencies": { "apify": "^3.7.0", "@crawlee/playwright": "^3.15.3", - "playwright": "1.60.0" + "playwright": "1.60.0", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -19,8 +21,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-crawlee-puppeteer-chrome/package.json b/templates/ts-crawlee-puppeteer-chrome/package.json index a900e535e..adaf1a9c8 100644 --- a/templates/ts-crawlee-puppeteer-chrome/package.json +++ b/templates/ts-crawlee-puppeteer-chrome/package.json @@ -9,7 +9,9 @@ "dependencies": { "apify": "^3.7.0", "@crawlee/puppeteer": "^3.15.3", - "puppeteer": "24.43.1" + "puppeteer": "24.43.1", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -19,8 +21,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-empty/package.json b/templates/ts-empty/package.json index 209367b16..e5bbf9a63 100644 --- a/templates/ts-empty/package.json +++ b/templates/ts-empty/package.json @@ -8,7 +8,9 @@ }, "dependencies": { "apify": "^3.7.0", - "@crawlee/cheerio": "^3.15.3" + "@crawlee/cheerio": "^3.15.3", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -18,8 +20,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-mastraai/package.json b/templates/ts-mastraai/package.json index 35084fdf0..f152d6f34 100644 --- a/templates/ts-mastraai/package.json +++ b/templates/ts-mastraai/package.json @@ -11,7 +11,9 @@ "@mastra/core": "^1.1.0", "apify": "^3.7.0", "mastra": "^1.1.0", - "zod": "^4.3.6" + "zod": "^4.3.6", + "tsx": "^4.21.0", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -21,8 +23,6 @@ "eslint-config-prettier": "^10.1.8", "globals": "^17.2.0", "prettier": "^3.8.1", - "tsx": "^4.21.0", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-mcp-empty/package.json b/templates/ts-mcp-empty/package.json index d48535a70..1764da935 100644 --- a/templates/ts-mcp-empty/package.json +++ b/templates/ts-mcp-empty/package.json @@ -11,7 +11,9 @@ "express": "^5.1.0", "cors": "^2.8.5", "zod": "^3.25.76", - "apify": "^3.7.0" + "apify": "^3.7.0", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -23,8 +25,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-mcp-proxy/package.json b/templates/ts-mcp-proxy/package.json index 9c449c725..275699019 100644 --- a/templates/ts-mcp-proxy/package.json +++ b/templates/ts-mcp-proxy/package.json @@ -13,7 +13,9 @@ "apify": "^3.7.0", "body-parser": "^2.2.0", "express": "^5.1.0", - "zod": "^3.25.76" + "zod": "^3.25.76", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -25,8 +27,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-standby/package.json b/templates/ts-standby/package.json index 27f659ccd..847367e09 100644 --- a/templates/ts-standby/package.json +++ b/templates/ts-standby/package.json @@ -7,7 +7,9 @@ "node": ">=20.0.0" }, "dependencies": { - "apify": "^3.7.0" + "apify": "^3.7.0", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -17,8 +19,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" }, diff --git a/templates/ts-start/package.json b/templates/ts-start/package.json index 5f45eb940..35e651379 100644 --- a/templates/ts-start/package.json +++ b/templates/ts-start/package.json @@ -9,7 +9,9 @@ "dependencies": { "apify": "^3.7.0", "axios": "^1.5.0", - "cheerio": "^1.0.0-rc.12" + "cheerio": "^1.0.0-rc.12", + "tsx": "^4.20.3", + "typescript": "^6.0.0" }, "devDependencies": { "@apify/eslint-config": "^2.0.0", @@ -19,8 +21,6 @@ "eslint-config-prettier": "^10.1.5", "globals": "^17.0.0", "prettier": "^3.5.3", - "tsx": "^4.20.3", - "typescript": "^6.0.0", "typescript-eslint": "^8.58.0", "vitest": "^4.1.0" },