Skip to content

fix(cli,admin): runtime robots.txt + sitemap.xml, no sync meta when realtime is off, api index edit, /_x locale - #530

Merged
sebyx07 merged 1 commit into
mainfrom
fix/22.2.2-runtime-seo-sync-generator-i18n
Sep 25, 2026
Merged

sebyx07 merged 1 commit into
mainfrom
fix/22.2.2-runtime-seo-sync-generator-i18n

Conversation

@sebyx07

@sebyx07 sebyx07 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Four bugs reported by an app team, for 22.2.2. Each has tests that were written first and failed before the fix.

1. robots.txt and sitemap.xml from a running web role

Only the static export wrote these files. A ROLE=web container answered 404 for both, and an app cannot add a non-page GET route.

  • New siteSeo() (packages/cli/src/site-seo.ts, exported from @ultimat3/cli) builds both from the route table:
    • public site/ routes only (no policy)
    • a page whose meta has robots: { index: false } is left out
    • dynamic routes are expanded through prerender() (the static export passes the pages it emitted instead)
    • buildRobots stays fail-closed: production allows the crawl and names the absolute sitemap, anything else is Disallow: /
  • seoRoutes() mounts GET /robots.txt and GET /sitemap.xml in x dev and runRole. URLs are absolute against APP_URL (the origin the runtime already names for OAuth and sync), else SITE_ORIGIN, else the request's own origin. Responses are public, max-age=3600.
  • The scaffolded apps/web/prerender.ts now writes siteSeo()'s files, so the export and the process serve the same bytes.
  • Known limit, documented in wiki/SEO.md: past 50,000 URLs the web role serves the index but not the /sitemap-N.xml parts.

2. No ultimate-sync meta when realtime is off

pageSync(..., realtime) returns no head, routes or scripts when realtime.enabled is false. With no meta the page runtime never dials. Split deployments where web and sync run separately are unchanged: the node is still reachable through the ingress.

3. x g task corrupted apps/web/api/index.ts

listOf found the key line by searching backwards from the character after [. When a list is already one entry per line, that character is the newline, so the search landed on the first item's line. The rewrite then nested a second jobs: [ and left the old ] behind. Reproduced with the real generator on a copy of examples/dummy: four x g task runs are enough for the list to wrap. After the fix the same run produces one clean list. Lists are also now searched only inside defineApi({.

4. /_x showed ⟦dev.panel.*⟧

The framework catalog is registered under en only, on purpose. The dev shell (<html lang="en">) translated through the app's ambient locale, so an app defaulting to es-co got raw keys. The shell now reads the catalog under FRAMEWORK_CATALOG_LOCALE.

bun run verify: 14/20 passed, 6 skipped. coverage-gate --package cli|admin passes.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features
    • Added robots.txt and sitemap.xml generation for static exports and web deployments. Sitemaps include eligible public pages and prerendered dynamic pages; larger sitemaps use an index. Robots rules vary by environment.
  • Bug Fixes
    • Disabled realtime now omits sync-related page output.
    • Generated job and task lists remain correctly formatted as entries are added.
    • Development dashboard tabs and questions display in English when the app uses another fallback locale.

…ealtime is off, api index edit, /_x locale

- cli: the web role (x dev, runRole) serves GET /robots.txt and GET /sitemap.xml from the new
  siteSeo() — public site/ routes, meta noindex excluded, prerender() expanded, absolute against
  APP_URL, else SITE_ORIGIN, else the request origin; production allows, anything else disallows.
  The scaffolded prerender.ts writes the same siteSeo() answer, so export and process agree.
- cli: realtime.enabled false -> no ultimate-sync meta, no sync-worker/page-boot routes or scripts.
- cli: x g job/task no longer nests a second `jobs: [` into a list already one entry per line
  (reproduced on examples/dummy after the list wraps); lists are searched inside defineApi({ only.
- admin: /_x renders its tabs and questions in the framework locale, not the app's ambient one
  (an es-co app read ⟦dev.panel.mail.title⟧).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository: developerz-ai/ultimate/.coderabbit.yml

Review profile: ASSERTIVE

Plan: Essentials

Run ID: 124077da-db3c-40f8-81cc-ef665b1b61fb

📥 Commits

Reviewing files that changed from the base of the PR and between 9aae14c and 725fd66.

📒 Files selected for processing (18)
  • CHANGELOG.md
  • packages/admin/src/dev/server.test.ts
  • packages/admin/src/dev/server.ts
  • packages/cli/src/api-registration.test.ts
  • packages/cli/src/api-registration.ts
  • packages/cli/src/cmd-dev.ts
  • packages/cli/src/cmd-new.test.ts
  • packages/cli/src/dev-route-table.ts
  • packages/cli/src/index.ts
  • packages/cli/src/page-sync.test.ts
  • packages/cli/src/page-sync.ts
  • packages/cli/src/seo-routes.test.ts
  • packages/cli/src/seo-routes.ts
  • packages/cli/src/serve-boot.ts
  • packages/cli/src/site-seo.ts
  • packages/cli/src/templates/scaffold-entries.ts
  • wiki/Realtime.md
  • wiki/SEO.md
 _______________________________________________
< Get your code reviewed, or the bunny gets it. >
 -----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@sebyx07
sebyx07 merged commit 3b0cf59 into main Sep 25, 2026
8 of 9 checks passed
@sebyx07
sebyx07 deleted the fix/22.2.2-runtime-seo-sync-generator-i18n branch September 25, 2026 02:33
This was referenced Sep 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant