From 012224d40c54dfc7ff8c38cc0160fec1976ace3d Mon Sep 17 00:00:00 2001 From: hwhung Date: Thu, 7 May 2026 19:01:30 +0800 Subject: [PATCH] Add prod run script for Replit --- .replit | 2 +- package.json | 1 + readme.md | 4 ++-- replit.md | 4 ++-- setup.md | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.replit b/.replit index 8c34536..254524c 100644 --- a/.replit +++ b/.replit @@ -1,2 +1,2 @@ -run = "node build.mjs && PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} node --enable-source-maps dist/index.mjs" +run = "PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod" onBoot = "pnpm install --ignore-workspace" diff --git a/package.json b/package.json index 448f315..aeca6e0 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev": "tsx src/index.ts", "build": "tsc --noEmit && node build.mjs", "build:fast": "node build.mjs", + "prod": "node build.mjs && node --enable-source-maps dist/index.mjs", "start": "node --enable-source-maps dist/index.mjs", "typecheck": "tsc --noEmit" }, diff --git a/readme.md b/readme.md index 647c311..5c81197 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ Do not add this repo to a parent workspace. Do not move it into `artifacts/`. Do The repo includes `.replit`, so after import the Run button starts the app with: ```bash -node build.mjs && PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} node --enable-source-maps dist/index.mjs +PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod ``` The `.replit` `onBoot` command installs dependencies with: @@ -35,7 +35,7 @@ Use the available `pnpm`. This repo intentionally has no `packageManager` pin. ## Start ```bash -node build.mjs && PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} node --enable-source-maps dist/index.mjs +PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} pnpm prod ``` When Replit AI Integrations are provisioned, the app reads these variables automatically: diff --git a/replit.md b/replit.md index fb657e7..74125ee 100644 --- a/replit.md +++ b/replit.md @@ -33,7 +33,7 @@ Never use public official provider endpoints. ## Key Commands - `pnpm install --ignore-workspace` — install dependencies without joining a parent workspace -- `node build.mjs && node --enable-source-maps dist/index.mjs` — build and run API server locally on port `3000` +- `pnpm prod` — build and run API server locally on port `3000` - `pnpm run typecheck` — typecheck the server - `pnpm run build` — typecheck and build `dist/index.mjs` - `pnpm run build:fast` — build `dist/index.mjs` without typechecking @@ -41,7 +41,7 @@ Never use public official provider endpoints. ## Replit Configuration -- `.replit` `run` builds with `node build.mjs` and runs `dist/index.mjs` +- `.replit` `run` uses `pnpm prod` - `.replit` `onBoot` uses `pnpm install --ignore-workspace` - publishing from a parent workspace should configure root `.replit` deployment and create a shell web artifact diff --git a/setup.md b/setup.md index 803c2a8..de31882 100644 --- a/setup.md +++ b/setup.md @@ -44,7 +44,7 @@ skills: 4. Create the smallest persistent workflow named "Random Proxy Simple" with this exact run command: - cd random-proxy-simple && node build.mjs && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN node --enable-source-maps dist/index.mjs + cd random-proxy-simple && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN pnpm prod 5. Start/restart that workflow once.