Skip to content

Conversation

@Tobbe
Copy link
Member

@Tobbe Tobbe commented Jan 2, 2026

yarn cedar build used to only build the "web" and "api" sidesworkspaces. Now it builds web, api and all packages

Output is a bit rough, but it works!

@netlify
Copy link

netlify bot commented Jan 2, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 14fc1d9
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/6958a0eb127af60008f7c9ba

@github-actions github-actions bot added this to the next-release milestone Jan 2, 2026
@nx-cloud
Copy link

nx-cloud bot commented Jan 2, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 14fc1d9

Command Status Duration Result
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 1m 50s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 3s View ↗
nx run-many -t build ✅ Succeeded 3m 25s View ↗
nx run-many -t test:types ✅ Succeeded 12s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-03 05:10:24 UTC

@nx-cloud
Copy link

nx-cloud bot commented Jan 2, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 54b0f1a

Command Status Duration Result
nx run-many -t test --minWorkers=1 --maxWorkers=4 ❌ Failed 1m 17s View ↗
nx run-many -t build ✅ Succeeded 10s View ↗
nx run-many -t test:types ✅ Succeeded 6s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-02 22:21:21 UTC

@nx-cloud
Copy link

nx-cloud bot commented Jan 2, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 54b0f1a

Command Status Duration Result
nx run-many -t test --minWorkers=1 --maxWorkers=4 ❌ Failed 1m 17s View ↗
nx run-many -t build ✅ Succeeded 7s View ↗
nx run-many -t test:types ✅ Succeeded 6s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-02 22:21:25 UTC

@nx-cloud
Copy link

nx-cloud bot commented Jan 2, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 54b0f1a

Command Status Duration Result
nx run-many -t test --minWorkers=1 --maxWorkers=4 ❌ Failed 1m 17s View ↗
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 7s View ↗
nx run-many -t build ✅ Succeeded 7s View ↗
nx run-many -t test:types ✅ Succeeded 6s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-02 22:22:23 UTC

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 2, 2026

Greptile Summary

Extended cedar build to build all workspace packages in addition to web and api. The command now defaults to ['web', 'api', 'packages/*'] and builds packages concurrently using the concurrently library. The workspaces() utility was enhanced to return package names in multiple formats (directory name, relative path, and package.json name) to support various ways users might specify packages. Optimization added to skip expensive filesystem operations when only building default workspaces.

Key changes:

  • Default workspace parameter changed from ['web', 'api'] to ['web', 'api', 'packages/*']
  • Added package building step in buildHandler that runs before api/web builds
  • Packages are built concurrently with yarn build in each package directory
  • Workspace name validation enhanced to support package names in different formats
  • Performance optimization: skips workspaces() call when only default workspaces are specified

Confidence Score: 4/5

  • This PR is safe to merge with minor concerns about edge cases in package name resolution
  • The implementation is solid with proper error handling, concurrent building, and comprehensive test coverage. Score of 4 (not 5) due to the workspace path mapping logic that assumes directory names match the last segment of scoped package names - while this works for the current codebase structure and has existence checks as a safety net, it could fail for non-standard package directory naming
  • Pay attention to packages/cli/src/commands/buildHandler.js - verify the path mapping logic works with your package naming conventions

Important Files Changed

Filename Overview
packages/cli/src/commands/build.js updated default workspaces to include packages/* and added validation logic to filter known workspaces before expensive filesystem checks
packages/cli/src/commands/buildHandler.js added package building logic with concurrency support, maps workspace names to filesystem paths with basic existence check

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as build.js
    participant Handler as buildHandler.js
    participant Project as project.js
    participant FS as File System
    participant Concurrently

    User->>CLI: cedar build [workspace..]
    CLI->>CLI: Parse workspace args
    
    alt workspace filtering needed
        CLI->>Project: workspaces({includePackages: true})
        Project->>FS: glob packages/*/package.json
        FS-->>Project: package paths
        Project->>FS: read package.json files
        FS-->>Project: package names
        Project-->>CLI: all valid workspace names
        CLI->>CLI: validate workspace args
    end
    
    CLI->>Handler: handler(options)
    Handler->>FS: read package.json workspaces
    FS-->>Handler: workspace config
    
    alt packages to build
        Handler->>FS: glob packages/*
        FS-->>Handler: all package paths
        
        alt specific packages requested
            Handler->>Handler: map workspace names to paths
            Handler->>FS: check path existence
            FS-->>Handler: path exists
        end
        
        Handler->>Concurrently: build packages in parallel
        Concurrently->>FS: yarn build (multiple packages)
        FS-->>Concurrently: build results
        Concurrently-->>Handler: completion status
    end
    
    alt api workspace included
        Handler->>Handler: verify schema & build API
    end
    
    alt web workspace included
        Handler->>Handler: build Web
    end
    
    Handler-->>User: build complete
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines 92 to 94
: restWorkspaces.map((w) => {
return path.join(cedarPaths.packages, w.split('/').at(-1))
})
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: path mapping assumes directory name matches last segment of scoped package name. for @my-org/my-package, this creates path packages/my-package, but directory could actually be named differently (e.g., just the org name or a different structure)

check if the mapped path exists before using it, or verify the package.json name matches. are package directory names guaranteed to match the last segment of the package name in your workspace setup?

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/cli/src/commands/buildHandler.js
Line: 92:94

Comment:
**logic:** path mapping assumes directory name matches last segment of scoped package name. for `@my-org/my-package`, this creates path `packages/my-package`, but directory could actually be named differently (e.g., just the org name or a different structure)

check if the mapped path exists before using it, or verify the package.json name matches. are package directory names guaranteed to match the last segment of the package name in your workspace setup?

How can I resolve this? If you propose a fix, please make it concise.

@Tobbe Tobbe changed the title feat(cli): cedar build now builds all packages feat(cli): cedar build now builds all workspaces Jan 2, 2026
@Tobbe Tobbe changed the title feat(cli): cedar build now builds all workspaces feat(cli): cedar build now also builds all packages Jan 2, 2026
@Tobbe
Copy link
Member Author

Tobbe commented Jan 3, 2026

@greptileai Please do a full review again, and update your review summary post

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@Tobbe Tobbe merged commit f1894bc into main Jan 3, 2026
41 checks passed
@Tobbe Tobbe deleted the tobbe-feat-packages-workspace-cedar-build branch January 3, 2026 05:12
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.

2 participants