Skip to content

refactor(studio): split API and web workspaces#5120

Merged
tlgimenes merged 2 commits into
mainfrom
codex/origin-main
Jul 24, 2026
Merged

refactor(studio): split API and web workspaces#5120
tlgimenes merged 2 commits into
mainfrom
codex/origin-main

Conversation

@tlgimenes

@tlgimenes tlgimenes commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

  • split the former full-stack apps/mesh workspace into the Hono backend at apps/api and the Vite/React application at apps/web
  • consolidate internal contracts, SDK utilities, and async primitives into the private @decocms/shared package while keeping browser-only SDK code inside apps/web
  • update development, build, deployment, CI, test, and worktree tooling for the new workspace boundaries
  • standardize READMEs for all 14 direct app and package workspaces and enforce the format with check:readmes

Architectural boundaries

  • apps/web does not import server implementation from apps/api
  • apps/api does not import application code from apps/web
  • @decocms/shared remains private, isomorphic, and free of application/runtime ownership
  • web-only React hooks and transports remain local to apps/web/src/sdk

Validation

  • bun run check
  • bun run fmt:check
  • bun run lint
  • bun run knip
  • bun run --cwd=apps/docs build (322 pages)
  • bun run --cwd=packages/harness test (363 tests)
  • workspace README validator (14 workspaces)

Full Playwright E2E was not rerun because it requires the external Postgres, NATS, and browser service stack.


Summary by cubic

Split the former full‑stack apps/mesh into apps/api (Hono backend/CLI) and apps/web (Vite/React), introduced a private @decocms/shared package for isomorphic contracts and utils, and overhauled CI/release/tests/docs to enforce the new boundaries. One build (bun run build:studio) now stages the web bundle into the API dist; the release publishes decocms to npm and pushes separate API and web images from the same tarball.

  • Refactors

    • Moved server code to apps/api and web UI to apps/web; enforced boundaries with ban-cross-tree-imports and ban-web-server-imports.
    • Consolidated shared contracts, SDK utilities, and async primitives into packages/shared with imports via @decocms/shared/*; removed publish workflows for @decocms/mesh-sdk and @decocms/std.
    • Replaced the legacy release with “Release Studio”: build:studio produces one tarball used to publish npm (decocms from apps/api) and build/push GHCR images for API (apps/api/Dockerfile) and web (apps/web/Dockerfile); release notes/docs reference bunx decocms.
    • CI and guards now target apps/api/** and apps/web/**; release‑tagging watches apps/api/package.json, root package.json, and scripts/build-studio.ts, and computes deploy scope (web/server/both) from changed files.
    • Tests: unit tests run via the root bun run test; the Playwright E2E suite lives in packages/e2e and its config starts apps/api and apps/web as separate webServer entries; multi‑pod, storage‑integration, resilience, and sandbox workflows follow the new layout.
    • Docs/tooling: added apps/api/README.md; refreshed README.md, AGENTS.md, TESTING.md, CONTRIBUTING.md. Worktrees/hooks now copy .env, auth-config.json, and config.json under apps/api. .gitignore and Playwright artifact paths point to apps/web.
  • Migration

    • Local dev: bun run --cwd=apps/web dev (web) and bun run --cwd=apps/api dev:server (API). Build both with bun run build:studio. Run DB migrations with bun run --cwd=apps/api migrate.
    • Config moves: .env, auth-config.json, and config.json live under apps/api/.
    • Imports: replace @decocms/std and app‑local SDK paths with @decocms/shared/* (e.g. @decocms/shared/std).
    • E2E: run from packages/e2e; config starts API and web separately.
    • Deploy: API image builds from apps/api/Dockerfile; web image from apps/web/Dockerfile. The container’s SQLite path stays /app/data/mesh.db for seamless upgrades.

Written for commit 6dfb733. Summary will update on new commits.

Review in cubic

@tlgimenes
tlgimenes force-pushed the codex/origin-main branch 8 times, most recently from 791276d to 02cdd8b Compare July 24, 2026 12:17
@tlgimenes
tlgimenes enabled auto-merge (squash) July 24, 2026 12:19
@tlgimenes
tlgimenes force-pushed the codex/origin-main branch from 02cdd8b to 6dfb733 Compare July 24, 2026 12:52
@tlgimenes
tlgimenes merged commit 1898663 into main Jul 24, 2026
18 of 19 checks passed
@tlgimenes
tlgimenes deleted the codex/origin-main branch July 24, 2026 12:59
guitavano added a commit that referenced this pull request Jul 24, 2026
Resolve conflicts from #5120 (split apps/mesh → apps/api + apps/web),
which moved apps/mesh/src/web/* to apps/web/src/* and changed the path
alias from `@/web/*` to `@/*`:

- array-field.tsx / tile-board.tsx: import-block conflicts — keep the new
  `@/i18n/use-t.ts` alias plus our createPortal / SORTABLE_DROP_ANIMATION
  imports.
- Move new file to apps/web/src/lib/dnd-drop-animation.ts and update all
  five importers from `@/web/lib/...` to `@/lib/...`.

tsc (apps/web) and biome format clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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