fix(sites): keep framework start commands out of the console - #3156
fix(sites): keep framework start commands out of the console#3156HarshMN2345 wants to merge 3 commits into
Conversation
The create-site flows read startCommand off a framework adapter and offered it as a prefilled value and a placeholder. The API never returns that field - FrameworkAdapter does not declare it - so the reads always resolved to undefined, and the cast that made them typecheck was the only thing hiding it. Had the field ever been returned, the console would have put an internal runtime command in front of every user creating a site. Drop the field from the create flows entirely and let the server pick its own default. In site settings the input stays, but it moves under a collapsed Advanced section, loses the Reset-to-default button that had nothing to reset to, and takes a generic placeholder.
Console (appwrite/console)Project ID: Tip Our Discord community has grown to 24K developers, and counting |
Greptile SummaryThe PR removes unsupported framework start-command defaults from site creation and moves the stored command into an advanced settings section.
Confidence Score: 4/5The PR is not yet safe to merge because adapter transitions after a framework change can restore and submit the previous framework's incompatible start command. The attempted fix clears the command on the initial framework change, but the later adapter-change branch restores site.startCommand solely by matching the original adapter key, leaving the previously reported stale-command failure reachable. Files Needing Attention: src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte Important Files Changed
Prompt To Fix All With AI### Issue 1
src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte:114
**Old start command gets restored**
When an SSR site is changed to another framework and its adapter is then changed away from and back to SSR, this branch restores `site.startCommand` solely because the adapter key matches the original adapter. The subsequent update submits the old framework's command for the newly selected framework, causing deployments to use an incompatible entrypoint.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (3): Last reviewed commit: "Clear the start command when the framewo..." | Re-trigger Greptile |
A start command names an entrypoint belonging to one framework. Carrying it across a switch submits it against a runtime that has no such entrypoint, and a switch to static leaves a command the form no longer shows. Reset it alongside the other framework-derived fields, and send it only for the ssr adapter, matching the fallbackFile line beside it.
| fallback = isOriginalAdapter | ||
| ? (site?.fallbackFile ?? data.fallbackFile) | ||
| : data.fallbackFile; | ||
| startCommand = isOriginalAdapter ? (site?.startCommand ?? '') : ''; |
There was a problem hiding this comment.
Old start command gets restored
When an SSR site is changed to another framework and its adapter is then changed away from and back to SSR, this branch restores site.startCommand solely because the adapter key matches the original adapter. The subsequent update submits the old framework's command for the newly selected framework, causing deployments to use an incompatible entrypoint.
Knowledge Base Used: Functions and Sites
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/routes/(console)/project-[region]-[project]/sites/site-[site]/settings/updateBuildSettings.svelte
Line: 114
Comment:
**Old start command gets restored**
When an SSR site is changed to another framework and its adapter is then changed away from and back to SSR, this branch restores `site.startCommand` solely because the adapter key matches the original adapter. The subsequent update submits the old framework's command for the newly selected framework, causing deployments to use an incompatible entrypoint.
**Knowledge Base Used:** [Functions and Sites](https://app.greptile.com/appwrite/-/custom-context/knowledge-base/appwrite/console/-/docs/project-functions-sites.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
What
Removes the start command field from the new-site flows, moves it under a collapsed Advanced section in site settings, and stops the console from ever rendering an Appwrite-internal command.
The bug
src/lib/stores/sites.tsdeclared:Every create-site flow cast the adapter to that type, then used
adapter.startCommandboth to prefill the input and as its placeholder. The API never returns that field —FrameworkAdapterdoes not declare astartCommandrule — so the reads always resolved toundefined, and the cast was the only thing keeping it typechecking. Had the field ever been sent, the console would have shown an internal runtime command (bash helpers/next-js/server.sh) to every user creating a site, inviting them to copy a value that changes without notice.Changes
Create-site flows — field removed entirely;
startCommandis no longer sent on create, so the server applies its own default:create-site/configuration.svelte(shared by the repository and manual flows)create-site/manual/+page.sveltecreate-site/repositories/repository-[repository]/+page.sveltecreate-site/deploy/+page.svelte— also drops the?start=URL parameter andshouldShowStartCommandSite settings (
site-[site]/settings/updateBuildSettings.svelte) — the input stays for SSR sites but:Accordion title="Advanced"Enter start commandplaceholderCleanup —
FrameworkAdapterWithStartCommandis gone, so nothing casts its way around the SDK type any more.Only the site's own stored
startCommandis still read anywhere, and only to pass it through on unrelated updates.Verification
npm run check— 0 errors, 87 warnings (all pre-existing, none in changed files). Prettier clean.