From 2575ab400ddf654ca15bf390590d8791875fbf92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C4=99dryga=C5=82?= Date: Tue, 14 Jul 2026 14:40:38 +0200 Subject: [PATCH 01/15] runner: migrate example installs to pnpm --- runner/config/frameworks.json | 32 +++++++------- runner/containers/angular/Dockerfile | 11 ----- runner/containers/angular/package.json | 40 ------------------ runner/containers/astro/Dockerfile | 11 ----- runner/containers/astro/package.json | 25 ----------- runner/containers/next-shadcn/Dockerfile | 11 ----- runner/containers/next-shadcn/package.json | 40 ------------------ runner/containers/next/Dockerfile | 11 ----- runner/containers/next/package.json | 35 ---------------- runner/containers/nuxt/Dockerfile | 11 ----- runner/containers/nuxt/package.json | 21 ---------- runner/containers/remix/Dockerfile | 11 ----- runner/containers/remix/package.json | 49 ---------------------- runner/pipeline/import-docs.mjs | 16 +++---- runner/pipeline/import.mjs | 4 +- runner/pipeline/wrap-docs-example.mjs | 4 ++ runner/scripts/prepare-container.mjs | 48 ++++++++++++++------- runner/workers/api/src/index.ts | 8 ++-- 18 files changed, 68 insertions(+), 320 deletions(-) delete mode 100644 runner/containers/angular/Dockerfile delete mode 100644 runner/containers/angular/package.json delete mode 100644 runner/containers/astro/Dockerfile delete mode 100644 runner/containers/astro/package.json delete mode 100644 runner/containers/next-shadcn/Dockerfile delete mode 100644 runner/containers/next-shadcn/package.json delete mode 100644 runner/containers/next/Dockerfile delete mode 100644 runner/containers/next/package.json delete mode 100644 runner/containers/nuxt/Dockerfile delete mode 100644 runner/containers/nuxt/package.json delete mode 100644 runner/containers/remix/Dockerfile delete mode 100644 runner/containers/remix/package.json diff --git a/runner/config/frameworks.json b/runner/config/frameworks.json index c3d2d39a..56b25785 100644 --- a/runner/config/frameworks.json +++ b/runner/config/frameworks.json @@ -14,7 +14,7 @@ "buildCommand": "tsc && vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "javascript": { "tier": 1, @@ -28,7 +28,7 @@ "buildCommand": "vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "typescript": { "tier": 1, @@ -42,7 +42,7 @@ "buildCommand": "tsc && vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "react": { "tier": 1, @@ -56,7 +56,7 @@ "buildCommand": "tsc -b && vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "react-js": { "tier": 1, @@ -71,7 +71,7 @@ "buildCommand": "vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "ant-design": { "tier": 1, @@ -86,7 +86,7 @@ "buildCommand": "vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "mui": { "tier": 1, @@ -101,7 +101,7 @@ "buildCommand": "tsc -b && vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "base-web": { "tier": 1, @@ -116,7 +116,7 @@ "buildCommand": "tsc -b && vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "vue": { "tier": 1, @@ -130,7 +130,7 @@ "buildCommand": "vite build", "outputDir": "dist", "port": null, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "angular": { "tier": 2, @@ -139,12 +139,12 @@ "htWrappers": ["@handsontable/angular-wrapper"], "entry": "src/main.ts", "htmlEntry": "src/index.html", - "devCommand": "npm run start -- --host 0.0.0.0 --disable-host-check --port 3000", + "devCommand": "pnpm run start -- --host 0.0.0.0 --disable-host-check --port 3000", "buildCommand": "ng build", "outputDir": "dist", "outputGlob": "dist/*/browser", "port": 3000, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "next.js": { "tier": 2, @@ -157,7 +157,7 @@ "outputDir": "out", "staticExport": true, "port": 3000, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "next-shadcn.js": { "tier": 2, @@ -170,7 +170,7 @@ "outputDir": "out", "staticExport": true, "port": 3000, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "astro": { "tier": 2, @@ -182,7 +182,7 @@ "buildCommand": "astro build", "outputDir": "dist", "port": 4321, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "nuxt": { "tier": 2, @@ -194,7 +194,7 @@ "buildCommand": "nuxt generate", "outputDir": ".output/public", "port": 3000, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" }, "remix": { "tier": 2, @@ -207,7 +207,7 @@ "outputDir": "build/client", "spaMode": true, "port": 5173, - "installCommand": "npm install" + "installCommand": "pnpm install --frozen-lockfile" } } } diff --git a/runner/containers/angular/Dockerfile b/runner/containers/angular/Dockerfile deleted file mode 100644 index cdb44163..00000000 --- a/runner/containers/angular/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by scripts/prepare-container.mjs — do not edit by hand. -# Tier-2 base image with dependencies baked for a fast warm dev server. -# Per-session source files are written into /app at runtime by the Worker. -FROM docker.io/cloudflare/sandbox:0.12.3 - -WORKDIR /app - -COPY package.json ./ -RUN npm install --legacy-peer-deps --no-audit --no-fund --loglevel=error - -EXPOSE 4200 diff --git a/runner/containers/angular/package.json b/runner/containers/angular/package.json deleted file mode 100644 index 19662e85..00000000 --- a/runner/containers/angular/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "sandbox", - "version": "0.0.0", - "scripts": { - "ng": "ng", - "start": "ng serve --disable-host-check --port 3000", - "build": "ng build", - "watch": "ng build --watch --configuration development", - "test": "ng test" - }, - "private": true, - "dependencies": { - "@angular/animations": "^21.1.0", - "@angular/common": "^21.1.0", - "@angular/compiler": "^21.1.0", - "@angular/core": "^21.1.0", - "@angular/forms": "^21.1.0", - "@angular/platform-browser": "^21.1.0", - "@angular/platform-browser-dynamic": "^21.1.0", - "@angular/router": "^21.1.0", - "@handsontable/angular-wrapper": "latest", - "handsontable": "latest", - "rxjs": "~7.8.0", - "tslib": "^2.6.2", - "zone.js": "~0.15.0" - }, - "devDependencies": { - "@angular-devkit/build-angular": "^21.1.0", - "@angular/cli": "^21.1.0", - "@angular/compiler-cli": "^21.1.0", - "@types/jasmine": "3.6.9", - "@types/node": "12.20.7", - "typescript": "~5.9.0" - }, - "config": { - "codesandbox": { - "templateId": "chnr97" - } - } -} diff --git a/runner/containers/astro/Dockerfile b/runner/containers/astro/Dockerfile deleted file mode 100644 index cdd36e95..00000000 --- a/runner/containers/astro/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by scripts/prepare-container.mjs — do not edit by hand. -# Tier-2 base image with dependencies baked for a fast warm dev server. -# Per-session source files are written into /app at runtime by the Worker. -FROM docker.io/cloudflare/sandbox:0.12.3 - -WORKDIR /app - -COPY package.json ./ -RUN npm install --no-audit --no-fund --loglevel=error - -EXPOSE 4321 diff --git a/runner/containers/astro/package.json b/runner/containers/astro/package.json deleted file mode 100644 index 2a5f49b7..00000000 --- a/runner/containers/astro/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@example/basics", - "type": "module", - "version": "0.0.1", - "private": true, - "scripts": { - "dev": "astro dev --port 8080", - "start": "astro dev", - "build": "astro build", - "preview": "astro preview", - "astro": "astro" - }, - "dependencies": { - "astro": "^4.16.19", - "handsontable": "18.0.0" - }, - "config": { - "codesandbox": { - "templateId": "438vfj" - }, - "stackblitz": { - "template": "node" - } - } -} diff --git a/runner/containers/next-shadcn/Dockerfile b/runner/containers/next-shadcn/Dockerfile deleted file mode 100644 index 09994b26..00000000 --- a/runner/containers/next-shadcn/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by scripts/prepare-container.mjs — do not edit by hand. -# Tier-2 base image with dependencies baked for a fast warm dev server. -# Per-session source files are written into /app at runtime by the Worker. -FROM docker.io/cloudflare/sandbox:0.12.3 - -WORKDIR /app - -COPY package.json ./ -RUN npm install --no-audit --no-fund --loglevel=error - -EXPOSE 3001 diff --git a/runner/containers/next-shadcn/package.json b/runner/containers/next-shadcn/package.json deleted file mode 100644 index e0bb2fb7..00000000 --- a/runner/containers/next-shadcn/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "my-app", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "lint": "eslint" - }, - "dependencies": { - "@handsontable/react-wrapper": "17.0.1", - "handsontable": "17.0.1", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "lucide-react": "^0.563.0", - "next": "16.1.6", - "radix-ui": "^1.4.3", - "react": "19.2.3", - "react-dom": "19.2.3", - "tailwind-merge": "^3.4.0", - "tailwindcss": "^4", - "@tailwindcss/postcss": "^4", - "tw-animate-css": "^1.4.0" - }, - "devDependencies": { - "@types/node": "^20", - "@types/react": "^19", - "@types/react-dom": "^19", - "eslint": "^9", - "eslint-config-next": "16.1.6", - "shadcn": "^3.8.4", - "typescript": "^5" - }, - "config": { - "codesandbox": { - "templateId": "8y5qy5" - } - } -} diff --git a/runner/containers/next/Dockerfile b/runner/containers/next/Dockerfile deleted file mode 100644 index 09994b26..00000000 --- a/runner/containers/next/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by scripts/prepare-container.mjs — do not edit by hand. -# Tier-2 base image with dependencies baked for a fast warm dev server. -# Per-session source files are written into /app at runtime by the Worker. -FROM docker.io/cloudflare/sandbox:0.12.3 - -WORKDIR /app - -COPY package.json ./ -RUN npm install --no-audit --no-fund --loglevel=error - -EXPOSE 3001 diff --git a/runner/containers/next/package.json b/runner/containers/next/package.json deleted file mode 100644 index bbf73327..00000000 --- a/runner/containers/next/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "nextjs", - "version": "0.1.0", - "private": true, - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "lint": "next lint" - }, - "dependencies": { - "@handsontable/react-wrapper": "17.0.1", - "handsontable": "17.0.1", - "@types/node": "20.6.2", - "@types/react": "18.2.22", - "@types/react-dom": "18.2.7", - "autoprefixer": "10.4.15", - "eslint": "8.49.0", - "eslint-config-next": "13.5.1", - "next": "13.5.1", - "postcss": "8.4.30", - "react": "18.2.0", - "react-dom": "18.2.0", - "tailwindcss": "3.3.3", - "typescript": "5.2.2" - }, - "config": { - "codesandbox": { - "templateId": "5l26fv" - }, - "stackblitz": { - "template": "node" - } - } -} diff --git a/runner/containers/nuxt/Dockerfile b/runner/containers/nuxt/Dockerfile deleted file mode 100644 index 09994b26..00000000 --- a/runner/containers/nuxt/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by scripts/prepare-container.mjs — do not edit by hand. -# Tier-2 base image with dependencies baked for a fast warm dev server. -# Per-session source files are written into /app at runtime by the Worker. -FROM docker.io/cloudflare/sandbox:0.12.3 - -WORKDIR /app - -COPY package.json ./ -RUN npm install --no-audit --no-fund --loglevel=error - -EXPOSE 3001 diff --git a/runner/containers/nuxt/package.json b/runner/containers/nuxt/package.json deleted file mode 100644 index d894549f..00000000 --- a/runner/containers/nuxt/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "private": true, - "type": "module", - "scripts": { - "build": "nuxt build", - "dev": "HOST=0.0.0.0 PORT=8080 nuxt dev", - "generate": "nuxt generate", - "preview": "nuxt preview", - "postinstall": "nuxt prepare" - }, - "dependencies": { - "@handsontable/vue3": "18.0.0", - "handsontable": "18.0.0", - "nuxt": "^3.21.8" - }, - "config": { - "codesandbox": { - "templateId": "nj3gp2" - } - } -} diff --git a/runner/containers/remix/Dockerfile b/runner/containers/remix/Dockerfile deleted file mode 100644 index 6acedfdd..00000000 --- a/runner/containers/remix/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Generated by scripts/prepare-container.mjs — do not edit by hand. -# Tier-2 base image with dependencies baked for a fast warm dev server. -# Per-session source files are written into /app at runtime by the Worker. -FROM docker.io/cloudflare/sandbox:0.12.3 - -WORKDIR /app - -COPY package.json ./ -RUN npm install --no-audit --no-fund --loglevel=error - -EXPOSE 5173 diff --git a/runner/containers/remix/package.json b/runner/containers/remix/package.json deleted file mode 100644 index 2f078e98..00000000 --- a/runner/containers/remix/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "private": true, - "sideEffects": false, - "type": "module", - "scripts": { - "build": "remix vite:build", - "dev": "remix vite:dev", - "lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .", - "start": "remix-serve ./build/server/index.js", - "typecheck": "tsc" - }, - "dependencies": { - "@remix-run/node": "^2.17.5", - "@remix-run/react": "^2.17.5", - "@remix-run/serve": "^2.17.5", - "isbot": "^4.1.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "@handsontable/react-wrapper": "^17.1.0", - "handsontable": "^17.1.0" - }, - "devDependencies": { - "@remix-run/dev": "*", - "@types/react": "^18.2.20", - "@types/react-dom": "^18.2.7", - "@typescript-eslint/eslint-plugin": "^6.7.4", - "@typescript-eslint/parser": "^6.7.4", - "eslint": "^8.38.0", - "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-import": "^2.28.1", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.6.0", - "typescript": "^5.1.6", - "vite": "^5.4.21", - "vite-tsconfig-paths": "^4.2.1" - }, - "engines": { - "node": ">=18.0.0" - }, - "config": { - "codesandbox": { - "templateId": "m4k8vw" - }, - "stackblitz": { - "template": "node" - } - } -} diff --git a/runner/pipeline/import-docs.mjs b/runner/pipeline/import-docs.mjs index 6a8d27bc..592e1db5 100644 --- a/runner/pipeline/import-docs.mjs +++ b/runner/pipeline/import-docs.mjs @@ -99,14 +99,14 @@ const RUNNER = { sandpackTemplate: "vanilla", sandpackEnvironment: "parcel", container: null, htWrappers: [], entry: "/src/main.js", htmlEntry: "/index.html", devCommand: null, buildCommand: "vite build", outputDir: "dist", outputGlob: null, - staticExport: false, spaMode: false, port: null, installCommand: "npm install", + staticExport: false, spaMode: false, port: null, installCommand: "pnpm install", }, typescript: { framework: "typescript", displayName: "TypeScript", tier: 1, engine: "sandpack", sandpackTemplate: "vanilla-ts", sandpackEnvironment: "parcel", container: null, htWrappers: [], entry: "/src/main.ts", htmlEntry: "/index.html", devCommand: null, buildCommand: "vite build", outputDir: "dist", outputGlob: null, - staticExport: false, spaMode: false, port: null, installCommand: "npm install", + staticExport: false, spaMode: false, port: null, installCommand: "pnpm install", }, react: { framework: "react", displayName: "React (TS)", tier: 1, engine: "sandpack", @@ -114,7 +114,7 @@ const RUNNER = { container: null, htWrappers: ["@handsontable/react-wrapper"], entry: "/src/main.tsx", htmlEntry: "/index.html", devCommand: null, buildCommand: "vite build", outputDir: "dist", outputGlob: null, - staticExport: false, spaMode: false, port: null, installCommand: "npm install", + staticExport: false, spaMode: false, port: null, installCommand: "pnpm install", }, "react-js": { framework: "react-js", displayName: "React (JS)", tier: 1, engine: "sandpack", @@ -122,7 +122,7 @@ const RUNNER = { container: null, htWrappers: ["@handsontable/react-wrapper"], entry: "/src/main.jsx", htmlEntry: "/index.html", devCommand: null, buildCommand: "vite build", outputDir: "dist", outputGlob: null, - staticExport: false, spaMode: false, port: null, installCommand: "npm install", + staticExport: false, spaMode: false, port: null, installCommand: "pnpm install", }, // Vue 3 docs examples use `