Skip to content

feat: WorkSight MVP integration — runs on @worksight/common, uniform Vercel config, honest docs - #27

Merged
kuyacarlo merged 16 commits into
canaryfrom
feat/mvp-integration
Jul 25, 2026
Merged

feat: WorkSight MVP integration — runs on @worksight/common, uniform Vercel config, honest docs#27
kuyacarlo merged 16 commits into
canaryfrom
feat/mvp-integration

Conversation

@kuyacarlo

Copy link
Copy Markdown
Contributor

Summary

Integrates the MVP stack (#15 #16 #17 #18 #19 #20) into one verified branch. Each workstream keeps its own PR (#21#26) for review; this is the merge-ready result.

WorkSight now actually runs on the shared data classes: Nest serves @worksight/common fixtures, and the web app renders them end to end.

What made this more than a merge

Wiring the API to @worksight/common (#17) surfaced three latent defects that a green build had been hiding:

  1. nest build was emitting an empty dist. apps/api inherited noEmit: true from the root tsconfig, so the build "succeeded" while producing nothing runnable. Fixed with a proper tsconfig.build.json.
  2. @worksight/common was unloadable by Node. It emitted ESM with directory imports (export * from './data'), which Node cannot resolve. Build now runs tsc-alias --resolve-full-paths.
  3. BaseLookup.filter() returned garbage. It reconstructed subclasses with the wrong constructor arity, so every chained lookup silently produced wrong data — /users/:id 404'd for valid ids and /tasks/stats 500'd. Fixed via prototype clone.

On the deploy side (#20), apps/api/vercel.json used a legacy builds/routes block that disables Vercel's install and build steps entirely, and the Supabase anon key was hardcoded in vercel.json. Both fixed; env is dashboard-managed.

Verified on this branch

pnpm type-check                          → 7/7 tasks successful
pnpm lint                                → 7/7 tasks successful
pnpm --filter @worksight/api test        → 2 suites, 10 tests passed
pnpm --filter @worksight/{api,web,docs} build → all succeed

End-to-end smoke, API on :3199 and web on :3198:

GET /health     → {"status":"ok"}
GET /users      → 15      GET /teams      → 5
GET /tasks      → 8       GET /activities → 14
GET /tasks/stats/:id → completionRate 50, storyPoints 21/13
GET /demo (web) → HTTP 200, renders fixtures, shows "Nest API" source badge

Vercel

Three projects, uniform per-app config, matching the applied dashboard settings:

Project Root Directory Build
worksight apps/web pnpm --filter @worksight/web build
worksight-api apps/api pnpm --filter @worksight/api build
worksight-docs apps/docs pnpm --filter @worksight/docs build

Vercel loads exactly one vercel.json per project — the one at that project's Root Directory — so "centralized" means uniform configs, not one shared file.

Not built (deliberately)

No Supabase persistence for the new API routes; attendance/survey/burnout types have no endpoints; the API still has no serverless handler, so Docker remains its working deploy path; some @worksight/common fixture ids are not valid UUIDs, so strict zod parsing would reject them even though the TS shapes match.

Test plan

  • Repo-wide type-check and lint green
  • API unit tests pass
  • All three apps build
  • Live API + web smoke test through /demo
  • Confirm preview deployments on this PR

Made with Cursor

kuyacarlo and others added 15 commits July 24, 2026 02:36
Stale npm lockfile still described a Fastify API while apps/api is NestJS,
so npm ci and CI were dead. Align on pnpm, declare missing web deps, stop
Supabase env throws at import during next build, and repair flat ESLint/Turbo.

Co-authored-by: Auto (Cursor Agent) <auto@cursor.com>
Signed-off-by: kuyacarlo <106532351+kuyacarlo@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop conflicting pnpm/action-setup version pins so Corepack uses
packageManager (pnpm@10.33.0), and replace remaining npm install/build
commands in apps/*/vercel.json.

Co-authored-by: Auto (Cursor Agent) <auto@cursor.com>
Signed-off-by: kuyacarlo <106532351+kuyacarlo@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Epic #14 workstreams #15#19 with agent handoff briefs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Jest specs were included in tsc without @types/jest, failing
pnpm --filter @worksight/web type-check. Tests remain runnable
via jest scripts; app type-check is unblocked for MVP.

Co-authored-by: Cursor <cursoragent@cursor.com>
Populate employees, tasks, and survey admin/dashboard views from common
data/utils so the MVP no longer depends on duplicated inline mocks.

Co-authored-by: Cursor <cursoragent@cursor.com>
The repo had a single apps/web/vercel.json with hardcoded env plus a
legacy builds/routes block on the API, while three Vercel projects
(worksight, worksight-api, worksight-docs) each read config from their
own Root Directory. Vercel loads exactly one vercel.json per project and
never merges a root file with a nested one, so centralization here means
uniform per-app configs sharing the same workspace primitives.

- apps/web: nextjs preset, pnpm --filter build, telemetry off, no
  outputDirectory override (preset default is correct)
- apps/api: drop legacy builds/routes, which disabled Vercel's install
  and build steps entirely; output dist
- apps/docs: same shape, output .vitepress/dist
- remove committed NEXT_PUBLIC_* values incl. the Supabase anon key;
  env stays dashboard-managed per environment
- doc/DEPLOYMENT.md + README: per-project table matching the applied
  dashboard settings (Root Directory, canary, skip-unaffected), and an
  honest note that the API still lacks a serverless handler

Co-authored-by: Cursor <cursoragent@cursor.com>
Serve users/teams/tasks/activities endpoints from the shared
@worksight/common contract instead of placeholder responses, so web and
API agree on payload shapes.

- users module returns EmployeeProfile/Team fixtures; new tasks module
  returns Assignment/Activity fixtures, all typed from common
- fix api build emitting nothing (inherited noEmit) and switch to CJS
  emit resolved against the built common dist; add tsconfig.build.json
- fix common dist being unloadable ESM (directory imports) via
  tsc-alias --resolve-full-paths in the build script
- fix BaseLookup.filter() constructing subclasses with the wrong
  argument order, which broke every chained lookup/getById
- fix department stats matching against array-valued departments
- add jest specs for both services; add node/jest globals to eslint

Co-authored-by: Cursor <cursoragent@cursor.com>
Stack E2E demo (#18) on both sibling PRs so web and API share the
@worksight/common contract in one worktree.
Align package layout, run instructions, fixture-backed data, and three
Vercel projects; drop Next 14 / deploy.yml / invented API myths.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add a runnable demo (pnpm demo /docs/mvp/DEMO.md) so Nest and Next agree on
the @worksight/common contract: public /demo page, API CORS on :3001, and an
optional NEXT_PUBLIC_USE_API toggle for admin/tasks views. Fixture-backed only.

Co-authored-by: Cursor <cursoragent@cursor.com>
…integration

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	README.md
#	doc/DEPLOYMENT.md
#	docs/mvp/README.md
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worksight Ready Ready Preview, Comment Jul 25, 2026 6:53am
worksight-api Ready Ready Preview, Comment Jul 25, 2026 6:53am
worksight-docs Ready Ready Preview, Comment Jul 25, 2026 6:53am

The worksight-api preview deployment failed on the integration branch with
four TS2307 errors: nest build could not find @worksight/common.

pnpm --filter <pkg> build runs only that package's script; it does not build
the package's workspace dependencies first. Turbo's dependsOn: ["^build"]
does. Local runs passed only because common/dist already existed from an
earlier build, and apps/api/vercel.json previously used a legacy builds block
that skipped the build step entirely, so this was never exercised.

Switch all three vercel.json buildCommands to Turbo filters and update the
Vercel dashboard build commands to match. Verified from a clean slate (dist
directories deleted) that each app builds from its own Root Directory:
api 2 tasks, web 3 tasks, docs 1 task, with common built first.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kuyacarlo

Copy link
Copy Markdown
Contributor Author

CI caught a real bug — fixed in 5b37377

The worksight-api preview deployment failed on the first push with four TS2307 errors: nest build could not find @worksight/common.

Cause: pnpm --filter <pkg> build runs only that package's build script — it does not build the package's workspace dependencies first. Turbo's dependsOn: ["^build"] does. This never surfaced earlier because local runs had a stale packages/common/dist lying around, and apps/api/vercel.json previously used a legacy builds block that skipped Vercel's build step entirely.

Fix: all three vercel.json build commands now use Turbo filters, and the Vercel dashboard build commands were updated to match so they cannot drift. Verified from a clean slate (all dist/.next deleted) that each app builds from its own Root Directory, with common built first.

All six checks are now green, including Vercel – worksight-docs, which had never produced a successful deployment before this branch.

The same fix was pushed to #23 so that PR is not a footgun if merged on its own.

@kuyacarlo
kuyacarlo merged commit 0f7d17e into canary Jul 25, 2026
10 checks passed
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