From c927ac8282777981abd402c90e24f0fe766fb56b Mon Sep 17 00:00:00 2001 From: hwhung Date: Thu, 7 May 2026 17:25:54 +0800 Subject: [PATCH] Use root Replit deployment config --- .replit | 4 +-- .replit-artifact/artifact.toml | 30 --------------------- readme.md | 7 ++--- setup.md | 49 +++++++--------------------------- 4 files changed, 16 insertions(+), 74 deletions(-) delete mode 100644 .replit-artifact/artifact.toml diff --git a/.replit b/.replit index 9f8d8b7..5006693 100644 --- a/.replit +++ b/.replit @@ -2,5 +2,5 @@ run = "pnpm dev" onBoot = "pnpm install --ignore-workspace" [deployment] -build = "pnpm install --ignore-workspace && pnpm run build" -run = "pnpm start" +build = ["sh", "-c", "pnpm install --ignore-workspace && pnpm build"] +run = ["sh", "-c", "PORT=${PORT:-3000} PROXY_API_KEY=${PROXY_API_KEY:-dev-proxy-key} NODE_ENV=production node --enable-source-maps dist/index.mjs"] diff --git a/.replit-artifact/artifact.toml b/.replit-artifact/artifact.toml deleted file mode 100644 index 6b408f1..0000000 --- a/.replit-artifact/artifact.toml +++ /dev/null @@ -1,30 +0,0 @@ -kind = "api" -previewPath = "/" -title = "Random Proxy Simple" -version = "1.0.0" -id = "random-proxy-simple" - -[[services]] -localPort = 3000 -name = "Random Proxy Simple" -paths = ["/"] - -[services.development] -run = "cd random-proxy-simple && pnpm dev -- --host 0.0.0.0 --port 3000 --proxy-api-key DEPLOYMENT_GENERATED_PROXY_TOKEN --openai-base-url \"$AI_INTEGRATIONS_OPENAI_BASE_URL\" --openai-api-key \"$AI_INTEGRATIONS_OPENAI_API_KEY\" --anthropic-base-url \"$AI_INTEGRATIONS_ANTHROPIC_BASE_URL\" --anthropic-api-key \"$AI_INTEGRATIONS_ANTHROPIC_API_KEY\"" - -[services.production.build] -args = ["sh", "-c", "cd random-proxy-simple && pnpm install --ignore-workspace && pnpm build"] - -[services.production.build.env] -NODE_ENV = "production" - -[services.production.run] -args = ["node", "--enable-source-maps", "random-proxy-simple/dist/index.mjs"] - -[services.production.run.env] -PORT = "3000" -PROXY_API_KEY = "DEPLOYMENT_GENERATED_PROXY_TOKEN" -NODE_ENV = "production" - -[services.production.health.startup] -path = "/api/healthz" diff --git a/readme.md b/readme.md index 8a66a8d..9466052 100644 --- a/readme.md +++ b/readme.md @@ -18,9 +18,10 @@ The `.replit` `onBoot` command installs dependencies with: pnpm install --ignore-workspace ``` -The repo also includes `.replit-artifact/artifact.toml` so Replit Publish has an explicit -production build, run command on port `3000`, `paths = ["/"]`, and `/api/healthz` startup health -check when this repo is cloned into `./random-proxy-simple`. +For publishing from a workspace that clones this repo into `./random-proxy-simple`, configure the +workspace root `.replit` `[deployment]` block to build and run `random-proxy-simple` directly. +Keep `PORT`, `PROXY_API_KEY`, and `NODE_ENV` in the production `run` command. Do not use artifact +production deployment for this proxy. ## Install diff --git a/setup.md b/setup.md index 66f8fb2..66d6eab 100644 --- a/setup.md +++ b/setup.md @@ -26,8 +26,9 @@ Do not: - run verification commands - run chat-completion smoke tests unless asked -Publishability requirement: register the cloned app as a deployable artifact in-place. Do not move -the repo into artifacts/. +Publishability requirement: do not configure production deployment through the artifact system. +Configure the workspace root .replit [deployment] section to build and run the cloned proxy +directly. Steps: @@ -47,49 +48,19 @@ skills: 5. Start/restart that workflow once. -6. Confirm ./random-proxy-simple/.replit-artifact/artifact.toml exists so Replit Publish has a -production run command. If it is missing or changed, restore this exact file content: +6. Configure the workspace root .replit [deployment] section exactly like this: - kind = "api" - previewPath = "/" - title = "Random Proxy Simple" - version = "1.0.0" - id = "random-proxy-simple" + [deployment] + build = ["sh", "-c", "cd random-proxy-simple && pnpm install --ignore-workspace && pnpm build"] + run = ["sh", "-c", "cd random-proxy-simple && PORT=3000 PROXY_API_KEY=DEPLOYMENT_GENERATED_PROXY_TOKEN NODE_ENV=production node --enable-source-maps dist/index.mjs"] - [[services]] - localPort = 3000 - name = "Random Proxy Simple" - paths = ["/"] - - [services.development] - run = "cd random-proxy-simple && pnpm dev -- --host 0.0.0.0 --port 3000 --proxy-api-key DEPLOYMENT_GENERATED_PROXY_TOKEN --openai-base-url \"$AI_INTEGRATIONS_OPENAI_BASE_URL\" --openai-api-key \"$AI_INTEGRATIONS_OPENAI_API_KEY\" --anthropic-base-url \"$AI_INTEGRATIONS_ANTHROPIC_BASE_URL\" --anthropic-api-key \"$AI_INTEGRATIONS_ANTHROPIC_API_KEY\"" - - [services.production.build] - args = ["sh", "-c", "cd random-proxy-simple && pnpm install --ignore-workspace && pnpm build"] - - [services.production.build.env] - NODE_ENV = "production" - - [services.production.run] - args = ["node", "--enable-source-maps", "random-proxy-simple/dist/index.mjs"] - - [services.production.run.env] - PORT = "3000" - PROXY_API_KEY = "DEPLOYMENT_GENERATED_PROXY_TOKEN" - NODE_ENV = "production" - - [services.production.health.startup] - path = "/api/healthz" - -7. If artifacts/mockup-sandbox/.replit-artifact/artifact.toml already exists in the Replit -workspace, keep it deployable as a static Vite artifact by using production publicDir -"artifacts/mockup-sandbox/dist" and static serving. Do not create or move this proxy repo into -artifacts/mockup-sandbox. +7. If artifacts/mockup-sandbox exists in the Replit workspace, leave it as-is. Do not create, +move, or configure this proxy repo as a mockup-sandbox artifact. 8. Do not run health, dashboard, model-list, or chat-completion verification commands. Report only: - local URL - whether setupReplitAIIntegrations wired OpenAI and Anthropic -- whether the in-place deployable artifact has a production run command +- whether the workspace root .replit [deployment] build/run commands were configured - that no verification commands were run