Skip to content

[WIP] Fix ag-grid documentation style import issue#239

Merged
hotlong merged 2 commits intomainfrom
copilot/fix-aggrid-docs-style-import-again
Jan 27, 2026
Merged

[WIP] Fix ag-grid documentation style import issue#239
hotlong merged 2 commits intomainfrom
copilot/fix-aggrid-docs-style-import-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 27, 2026

Build Orchestration Fix for Vercel Deployment

Problem Analysis

  • Vercel build fails because TypeScript cannot find @object-ui/* module declarations
  • The packages don't have their dist folders built when examples/crm-app tries to use them
  • Root-level build script builds packages in correct order, but Vercel runs the individual package build script

Solution Plan

  • Add prebuild script to examples/crm-app/package.json to build workspace dependencies first
  • Ensure the prebuild builds packages in correct dependency order
  • Test the build locally to verify it works
  • Verify the fix resolves the TypeScript module resolution errors

Changes Made

  • Added prebuild script to examples/crm-app/package.json that builds all workspace dependencies in the correct order:
    1. @object-ui/types (no dependencies)
    2. @object-ui/core (depends on types)
    3. @object-ui/react (depends on core)
    4. @object-ui/components (depends on core, react, types)
    5. @object-ui/fields (depends on components, core, types)
    6. @object-ui/layout (depends on components, core, react, types)
    7. @object-ui/plugin-dashboard (depends on components, core, react, types)

Verification

  • Build tested locally and completed successfully
  • All packages built their dist folders with TypeScript declarations
  • TypeScript compilation now finds all module declarations
  • Final app build produces production-ready output in dist folder
Original prompt

20:25:16.111 Running build in Washington, D.C., USA (East) – iad1
20:25:16.112 Build machine configuration: 4 cores, 8 GB
20:25:16.272 Cloning github.com/objectstack-ai/objectui (Branch: copilot/fix-aggrid-docs-style-import, Commit: 773ef19)
20:25:16.273 Previous build caches not available.
20:25:16.704 Cloning completed: 431.000ms
20:25:17.453 Running "vercel build"
20:25:18.386 Vercel CLI 50.4.10
20:25:18.997 Detected pnpm-lock.yaml 9 which may be generated by pnpm@9.x or pnpm@10.x
20:25:18.997 Using pnpm@10.x based on project creation date
20:25:18.997 To use pnpm@9.x, manually opt in using corepack (https://vercel.com/docs/deployments/configure-a-build#corepack)
20:25:19.029 Installing dependencies...
20:25:19.650 Scope: all 27 workspace projects
20:25:19.834 ../.. | Progress: resolved 1, reused 0, downloaded 0, added 0
20:25:19.974 ../.. | +1154 ++++++++++++++++++++++++++++
20:25:20.835 ../.. | Progress: resolved 1154, reused 0, downloaded 47, added 14
20:25:21.836 ../.. | Progress: resolved 1154, reused 0, downloaded 176, added 72
20:25:22.843 ../.. | Progress: resolved 1154, reused 0, downloaded 246, added 106
20:25:23.843 ../.. | Progress: resolved 1154, reused 0, downloaded 329, added 151
20:25:24.845 ../.. | Progress: resolved 1154, reused 0, downloaded 490, added 221
20:25:25.845 ../.. | Progress: resolved 1154, reused 0, downloaded 587, added 260
20:25:26.848 ../.. | Progress: resolved 1154, reused 0, downloaded 744, added 346
20:25:27.847 ../.. | Progress: resolved 1154, reused 0, downloaded 970, added 464
20:25:28.847 ../.. | Progress: resolved 1154, reused 0, downloaded 1117, added 516
20:25:29.848 ../.. | Progress: resolved 1154, reused 0, downloaded 1153, added 671
20:25:30.849 ../.. | Progress: resolved 1154, reused 0, downloaded 1153, added 986
20:25:31.471 ../.. | Progress: resolved 1154, reused 0, downloaded 1153, added 1154, done
20:25:33.005
20:25:33.005 dependencies:
20:25:33.006 + @object-ui/components 0.3.1 <- ../../packages/components
20:25:33.006 + @object-ui/core 0.3.1 <- ../../packages/core
20:25:33.006 + @object-ui/fields 0.3.1 <- ../../packages/fields
20:25:33.006 + @object-ui/layout 0.1.1 <- ../../packages/layout
20:25:33.006 + @object-ui/plugin-dashboard 0.1.1 <- ../../packages/plugin-dashboard
20:25:33.006 + @object-ui/react 0.3.1 <- ../../packages/react
20:25:33.006 + @object-ui/types 0.3.1 <- ../../packages/types
20:25:33.006 + clsx 2.1.1
20:25:33.006 + lucide-react 0.563.0
20:25:33.007 + react 19.2.3
20:25:33.007 + react-dom 19.2.3
20:25:33.007 + react-router-dom 7.13.0
20:25:33.007 + tailwind-merge 3.4.0
20:25:33.007
20:25:33.007 devDependencies:
20:25:33.007 + @types/react 19.2.9
20:25:33.007 + @types/react-dom 19.2.3
20:25:33.007 + @vitejs/plugin-react 4.7.0
20:25:33.007 + autoprefixer 10.4.23
20:25:33.007 + postcss 8.5.6
20:25:33.007 + tailwindcss 4.1.18
20:25:33.007 + typescript 5.9.3
20:25:33.007 + vite 5.4.21
20:25:33.007
20:25:33.152 ../../apps/site postinstall$ fumadocs-mdx
20:25:33.735 ../../apps/site postinstall: [MDX] generated files in 20.882794999999987ms
20:25:33.741 ../../apps/site postinstall: Done
20:25:33.744 ╭ Warning ─────────────────────────────────────────────────────────────────────╮
20:25:33.744 │ │
20:25:33.744 │ Ignored build scripts: @vscode/vsce-sign@2.0.9, esbuild@0.21.5, │
20:25:33.744 │ esbuild@0.27.2, keytar@7.9.0, sharp@0.34.5. │
20:25:33.744 │ Run "pnpm approve-builds" to pick which dependencies should be allowed │
20:25:33.744 │ to run scripts. │
20:25:33.744 │ │
20:25:33.745 ╰──────────────────────────────────────────────────────────────────────────────╯
20:25:33.754 Done in 14.6s using pnpm v10.28.0
20:25:33.835 Running "pnpm run build"
20:25:34.135
20:25:34.135 > @examples/crm-app@0.1.0 build /vercel/path0/examples/crm-app
20:25:34.135 > tsc && vite build
20:25:34.135
20:25:35.802 src/App.tsx(2,63): error TS2307: Cannot find module '@object-ui/components' or its corresponding type declarations.
20:25:35.803 src/App.tsx(3,56): error TS2307: Cannot find module '@object-ui/react' or its corresponding type declarations.
20:25:35.803 src/App.tsx(4,32): error TS2307: Cannot find module '@object-ui/fields' or its corresponding type declarations.
20:25:35.803 src/App.tsx(5,32): error ...


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link
Copy Markdown

vercel bot commented Jan 27, 2026

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

Project Deployment Review Updated (UTC)
objectui-crm-app Ready Ready Preview, Comment Jan 27, 2026 0:40am
objectui-site Ready Ready Preview, Comment Jan 27, 2026 0:40am

Request Review

…rm-app

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
@hotlong hotlong marked this pull request as ready for review January 27, 2026 12:32
Copilot AI review requested due to automatic review settings January 27, 2026 12:32
@hotlong hotlong merged commit 33c776a into main Jan 27, 2026
4 of 6 checks passed
Copilot AI requested a review from hotlong January 27, 2026 12:33
Copilot stopped work on behalf of hotlong due to an error January 27, 2026 12:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Vercel build failures caused by TypeScript not finding @object-ui/* module declarations. The issue occurs because Vercel runs the individual package build script without first building the workspace dependencies that need to exist in their dist folders.

Changes:

  • Added a prebuild script to examples/crm-app/package.json that sequentially builds all workspace dependencies in topological order before the main build runs

"type": "module",
"scripts": {
"dev": "vite",
"prebuild": "pnpm --filter @object-ui/types build && pnpm --filter @object-ui/core build && pnpm --filter @object-ui/react build && pnpm --filter @object-ui/components build && pnpm --filter @object-ui/fields build && pnpm --filter @object-ui/layout build && pnpm --filter @object-ui/plugin-dashboard build",
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This long sequential build command is difficult to maintain and error-prone. Consider these more maintainable alternatives:

  1. Use PNPM's built-in topological ordering: pnpm -r --filter='./packages/*' build will automatically build packages in the correct dependency order.

  2. Leverage Turbo (already installed at the root): Create a turbo.json configuration to manage build orchestration across the monorepo.

  3. Use PNPM's --filter with ellipsis syntax: pnpm --filter='@examples/crm-app^...' build will build all dependencies of crm-app.

The current approach requires manual updates whenever dependencies change and is inconsistent with the root package.json's build script (line 19 in root package.json) which uses -r for recursive topological builds.

Suggested change
"prebuild": "pnpm --filter @object-ui/types build && pnpm --filter @object-ui/core build && pnpm --filter @object-ui/react build && pnpm --filter @object-ui/components build && pnpm --filter @object-ui/fields build && pnpm --filter @object-ui/layout build && pnpm --filter @object-ui/plugin-dashboard build",
"prebuild": "pnpm --filter='@examples/crm-app^...' build",

Copilot uses AI. Check for mistakes.
"type": "module",
"scripts": {
"dev": "vite",
"prebuild": "pnpm --filter @object-ui/types build && pnpm --filter @object-ui/core build && pnpm --filter @object-ui/react build && pnpm --filter @object-ui/components build && pnpm --filter @object-ui/fields build && pnpm --filter @object-ui/layout build && pnpm --filter @object-ui/plugin-dashboard build",
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the custom coding guideline Rule #2 (Documentation Driven Development), this change should be documented. While this is an infrastructure fix for Vercel deployment, consider adding documentation about:

  1. How to build the monorepo for deployment
  2. The dependency order requirements
  3. Known deployment platform gotchas (like Vercel not auto-building workspace dependencies)

This could be added to CONTRIBUTING.md under a "Deployment" or "Building for Production" section, or in a README.md in the examples/crm-app directory.

Copilot generated this review using guidance from repository custom instructions.
"type": "module",
"scripts": {
"dev": "vite",
"prebuild": "pnpm --filter @object-ui/types build && pnpm --filter @object-ui/core build && pnpm --filter @object-ui/react build && pnpm --filter @object-ui/components build && pnpm --filter @object-ui/fields build && pnpm --filter @object-ui/layout build && pnpm --filter @object-ui/plugin-dashboard build",
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR title mentions "ag-grid documentation style import issue" but the actual change is about fixing Vercel build orchestration for workspace dependencies. The change doesn't reference ag-grid at all. Please update the PR title to accurately reflect the changes, such as "Fix Vercel build by adding prebuild script for workspace dependencies".

Copilot uses AI. Check for mistakes.
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.

3 participants