Skip to content

refactor: Switch to Typescript project references to better watch/VSCode refactor support#562

Merged
kingston merged 17 commits into
mainfrom
kingston/eng-624-use-project-references-for-building-project-to-allow-ide-to
Jun 3, 2025
Merged

refactor: Switch to Typescript project references to better watch/VSCode refactor support#562
kingston merged 17 commits into
mainfrom
kingston/eng-624-use-project-references-for-building-project-to-allow-ide-to

Conversation

@kingston

@kingston kingston commented Jun 2, 2025

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Introduced TypeScript project references across all major packages and plugins for improved incremental builds and dependency tracking.
    • Added new CLI entry points for project creation and builder tools, enhancing command-line usability.
  • Improvements
    • Updated build and watch scripts to leverage TypeScript's project references and incremental compilation.
    • Refined package publishing by including documentation files and excluding build artifacts.
    • Enhanced CSS asset handling in UI components, with updated documentation on usage.
  • Bug Fixes
    • Corrected and standardized import/export paths for test utilities.
  • Chores
    • Updated dependencies and configuration files for consistency and maintainability.
    • Renamed and reorganized scripts and tasks for clarity and alignment across the workspace.
  • Documentation
    • Expanded documentation for CSS usage in UI components.

@vercel

vercel Bot commented Jun 2, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baseplate-project-builder-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 3, 2025 9:15am

@changeset-bot

changeset-bot Bot commented Jun 2, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2ff6790

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@baseplate-dev/project-builder-server Patch
@baseplate-dev/project-builder-cli Patch
@baseplate-dev/project-builder-lib Patch
@baseplate-dev/project-builder-web Patch
@baseplate-dev/fastify-generators Patch
@baseplate-dev/react-generators Patch
@baseplate-dev/core-generators Patch
@baseplate-dev/create-project Patch
@baseplate-dev/ui-components Patch
@baseplate-dev/plugin-storage Patch
@baseplate-dev/plugin-auth Patch
@baseplate-dev/utils Patch
@baseplate-dev/sync Patch
@baseplate-dev/project-builder-common Patch
@baseplate-dev/project-builder-test Patch
@baseplate-dev/code-morph Patch
@baseplate-dev/tools Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 2, 2025

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces TypeScript project references across the monorepo, adding and updating tsconfig.build.json files for all relevant packages and plugins. Scripts and package metadata are adjusted to support reference-based builds and watches. The workspace meta configuration is enhanced to automate project reference management, and new entry points are added for CLI tools.

Changes

Files/Groups Change Summary
.workspace-meta/config.ts Enhanced workspace meta config: adds root package, improves ensurePackageJson plugin, introduces plugin to auto-generate TypeScript project references, and defines new helper functions and types.
tsconfig.build.json, tsconfig.json, tsconfig.scripts.json Introduced new root-level build and scripts TypeScript configs using project references; removed direct includes and options from tsconfig.json.
pnpm-workspace.yaml Added cpx2: 8.0.0 to catalog.
turbo.json, packages/ui-components/turbo.json Renamed Storybook build task and added watch:tsc:root task configuration.
package.json Updated scripts for Storybook, watch, and TypeScript build; added homepage; changed license; updated dependencies.
packages/*/package.json, plugins/*/package.json Unified files arrays to include documentation and exclude build artifacts; updated and simplified watch/build scripts; changed cpx2 dependency to catalog alias.
packages/*/tsconfig.build.json, plugins/*/tsconfig.build.json Added or updated TypeScript project references, enabled composite/incremental builds, set output directories, and excluded build artifacts.
packages/create-project/bin/create-baseplate-project.js, packages/project-builder-cli/bin/baseplate.js Added new CLI entry point scripts with shebangs for Node.js.
packages/project-builder-cli/scripts/baseplate.js Removed old CLI entry script.
packages/project-builder-cli/src/cli.ts Added new CLI entrypoint with error handling and process exit.
packages/project-builder-cli/src/index.ts Renamed and exported CLI runner function; removed shebang and error handling.
packages/project-builder-server/src/api/index.ts Added export of PluginMetadataWithPaths type.
packages/project-builder-lib/src/definition/index.ts, packages/project-builder-lib/src/tools/model-merger/model-merger.unit.test.ts, packages/sync/src/tests/index.ts, packages/sync/src/output/prepare-generator-files/prepare-generator-file.unit.test.ts, packages/sync/src/output/prepare-generator-files/prepare-generator-files.unit.test.ts, packages/sync/src/output/write-generator-output.unit.test.ts, packages/sync/src/templates/extractor/run-template-file-extractors.unit.test.ts Updated import/export paths from .test-helper.js to .test-utils.js.
packages/ui-components/README.md Added documentation for distributed CSS files and usage.
.changeset/ten-ducks-scream.md Added changeset describing the transition to TypeScript project references across packages.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant WorkspaceMeta as workspace-meta Config
    participant Package as Package (e.g., core-generators)
    participant TsConfig as tsconfig.build.json

    Dev->>WorkspaceMeta: Run workspace-meta plugins
    WorkspaceMeta->>Package: For each package, check dependencies
    WorkspaceMeta->>TsConfig: Read current tsconfig.build.json
    WorkspaceMeta->>TsConfig: Generate/Update project references based on workspace dependencies
    TsConfig-->>WorkspaceMeta: Write updated tsconfig.build.json if changed
Loading
sequenceDiagram
    participant Dev as Developer
    participant CLI as CLI Entry Script
    participant Main as CLI Main Logic

    Dev->>CLI: Run CLI (e.g., baseplate.js)
    CLI->>Main: Import and execute main CLI function
    Main->>Main: Run CLI logic
    Main-->>CLI: Return or throw error
    CLI->>Dev: Exit with code 0 or 1 based on result
Loading

Possibly related PRs

  • chore: Replace meta updater with workspace-meta #555: Removes the old meta-updater system and introduces workspace-meta, which this PR extends by automating TypeScript project reference management and further integrating workspace-meta into the monorepo build process.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
.workspace-meta/config.ts (2)

22-25: Clarify the reasoning for ignored packages.

The comment mentions "False positives" but it would be helpful to document why these specific packages need to be excluded from TypeScript project references.

-// False positives for the Typescript project references
+// Packages excluded from TypeScript project references due to special build configurations
 const IGNORED_PACKAGES = new Set([
   '@baseplate-dev/project-builder-web',
   '@baseplate-dev/root',
 ]);

89-115: Complex dependency resolution logic could benefit from refactoring.

While the logic is correct, this complex chain of operations for building inter-project dependencies could be broken down into smaller, more readable functions for better maintainability.

Consider extracting this into a separate function:

function buildProjectReferences(
  projectDependencyNames: string[],
  ctx: WorkspaceContext
): string[] {
  return projectDependencyNames
    .filter((name) => !IGNORED_PACKAGES.has(name))
    .map((name) => {
      const packageInfo = ctx.workspacePackages.find((p) => p.name === name);
      if (!packageInfo) return undefined;

      const hasTypeScript = getProjectJsonDependencyKeys(packageInfo.packageJson)
        .includes('typescript');
      const hasBuildScript = Object.keys(packageInfo.packageJson.scripts ?? {})
        .includes('build');

      if (hasTypeScript && hasBuildScript) {
        const relativePath = path.join(
          path.relative(ctx.packagePath, packageInfo.path),
          'tsconfig.build.json'
        );
        return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;
      }
    })
    .filter((name) => name !== undefined)
    .toSorted();
}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 842339b and dc2da8e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (36)
  • .workspace-meta/config.ts (3 hunks)
  • package.json (4 hunks)
  • packages/core-generators/package.json (1 hunks)
  • packages/core-generators/tsconfig.build.json (1 hunks)
  • packages/create-project/tsconfig.build.json (1 hunks)
  • packages/fastify-generators/package.json (1 hunks)
  • packages/fastify-generators/tsconfig.build.json (1 hunks)
  • packages/project-builder-cli/tsconfig.build.json (1 hunks)
  • packages/project-builder-lib/package.json (1 hunks)
  • packages/project-builder-lib/src/definition/index.ts (1 hunks)
  • packages/project-builder-lib/src/tools/model-merger/model-merger.unit.test.ts (1 hunks)
  • packages/project-builder-lib/tsconfig.build.json (1 hunks)
  • packages/project-builder-server/package.json (1 hunks)
  • packages/project-builder-server/src/api/plugins.ts (1 hunks)
  • packages/project-builder-server/tsconfig.build.json (1 hunks)
  • packages/react-generators/package.json (1 hunks)
  • packages/react-generators/tsconfig.build.json (1 hunks)
  • packages/sync/package.json (1 hunks)
  • packages/sync/src/output/prepare-generator-files/prepare-generator-file.unit.test.ts (1 hunks)
  • packages/sync/src/output/prepare-generator-files/prepare-generator-files.unit.test.ts (1 hunks)
  • packages/sync/src/output/write-generator-output.unit.test.ts (1 hunks)
  • packages/sync/src/templates/extractor/run-template-file-extractors.unit.test.ts (1 hunks)
  • packages/sync/src/tests/index.ts (1 hunks)
  • packages/sync/tsconfig.build.json (1 hunks)
  • packages/ui-components/package.json (1 hunks)
  • packages/ui-components/tsconfig.build.json (1 hunks)
  • packages/utils/package.json (1 hunks)
  • packages/utils/tsconfig.build.json (1 hunks)
  • plugins/plugin-auth/package.json (1 hunks)
  • plugins/plugin-auth/tsconfig.build.json (1 hunks)
  • plugins/plugin-storage/package.json (1 hunks)
  • plugins/plugin-storage/tsconfig.build.json (1 hunks)
  • tsconfig.build.json (1 hunks)
  • tsconfig.json (1 hunks)
  • tsconfig.scripts.json (1 hunks)
  • turbo.json (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
packages/sync/src/output/write-generator-output.unit.test.ts (3)
Learnt from: kingston
PR: halfdomelabs/baseplate#510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: When testing file operations in this codebase, the pattern is to use Vitest automocks for 'node:fs' and 'node:fs/promises' (without explicit implementation replacement) while populating a virtual filesystem with vol.fromJSON() from memfs. File operations in tests are performed directly via vol.promises methods.
Learnt from: kingston
PR: halfdomelabs/baseplate#510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In this codebase, when testing file operations, Vitest's automocks for 'node:fs' and 'node:fs/promises' are used in conjunction with memfs, but without replacing the mock implementation explicitly in each test file. The virtual filesystem is populated using vol.fromJSON or similar methods, which works seamlessly with the automocks.
Learnt from: kingston
PR: halfdomelabs/baseplate#510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: In the project-builder-server test suite, Vitest automocks for 'node:fs' and 'node:fs/promises' are already configured to use memfs without needing explicit implementation replacement in each test file.
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Test E2E
  • GitHub Check: Lint
  • GitHub Check: test
🔇 Additional comments (56)
packages/project-builder-lib/package.json (1)

38-39: Standardize script naming for TypeScript watch and typecheck
Renaming "watch" to "tsc:watch" and reordering "typecheck" aligns with the repository-wide conventions. No change to the underlying commands.

packages/project-builder-server/src/api/plugins.ts (1)

5-5: Expose PluginMetadataWithPaths type for shared type safety
Re-exporting PluginMetadataWithPaths from the project-builder-lib package supports the new composite project references and improves type sharing.

tsconfig.scripts.json (1)

1-7: Add dedicated TS config for CLI scripts
The new tsconfig.scripts.json correctly extends the base Node CLI config, disables emit, and scopes the compilation to the scripts and .workspace-meta directories.

packages/utils/package.json (1)

35-36: Align script naming with TypeScript project conventions
Renamed "watch" to "tsc:watch" and moved "typecheck" below it to maintain consistency with other packages. Commands remain unchanged.

packages/sync/src/output/prepare-generator-files/prepare-generator-files.unit.test.ts (1)

3-3: Update import path for test logger utility
Changed import from logger.test-helper.js to logger.test-utils.js to match the renamed file. Confirm there are no lingering references to the old path.

packages/sync/src/output/prepare-generator-files/prepare-generator-file.unit.test.ts (1)

3-3: Update Test Logger import path
The import of createTestLogger now references logger.test-utils.js, matching the consolidated test utilities export.

packages/sync/src/templates/extractor/run-template-file-extractors.unit.test.ts (1)

5-5: Align Test Logger import with updated utility
This change updates the path to logger.test-utils.js, ensuring consistency with the new test helper module naming.

packages/sync/src/tests/index.ts (1)

1-1: Re-export renamed test utils module
Switching the re-export to logger.test-utils.js aligns the package’s test utilities with the updated filename.

packages/project-builder-lib/src/tools/model-merger/model-merger.unit.test.ts (1)

9-9: Update ProjectDefinitionContainer test util import
The import now points to project-definition-container.test-utils.js, matching the renamed test helper export in definition/index.ts.

packages/sync/src/output/write-generator-output.unit.test.ts (1)

4-4: Correct Test Logger import for writeGeneratorOutput tests
Importing createTestLogger from logger.test-utils.js maintains consistency with the updated test utilities.

packages/project-builder-lib/src/definition/index.ts (2)

1-8: Consistent ESM re-exports with .js extensions
The file maintains uniform .js extension references for ESM exports, aligning with the runtime resolution strategy in the monorepo.


9-9:

Details

❓ Verification inconclusive

Verify the existence of the renamed test-utils module
Please confirm that project-definition-container.test-utils.js actually exists under packages/project-builder-lib/src/definition and exports the expected utilities in place of the former test-helper file.

Shell script to verify:


🏁 Script executed:

#!/bin/bash
# Verify that the renamed test-utils file exists
fd --type f project-definition-container.test-utils.js packages/project-builder-lib/src/definition

Length of output: 100


Verify the existence of the renamed test-utils module
I wasn’t able to locate project-definition-container.test-utils.js under packages/project-builder-lib/src/definition. Please confirm that:

  • A file named project-definition-container.test-utils.js actually exists in that directory (or update the export path if it’s .ts or has a different name).
  • The module exports all the utilities previously provided by the old test-helper.
packages/fastify-generators/tsconfig.build.json (1)

16-27: Add TypeScript project references
The new references section is correctly placed after exclude, enabling incremental builds by declaring dependencies on core-generators, sync, and utils. JSON syntax is valid.

packages/project-builder-cli/tsconfig.build.json (1)

11-22: Enable composite builds with project references
The exclude field is properly defined, and the references section lists project-builder-lib, project-builder-server, and utils, correctly reflecting the package dependency graph for incremental compilation.

tsconfig.build.json (2)

1-42: New root TypeScript build configuration
The root tsconfig.build.json accurately aggregates references to every package and plugin, orchestrating a workspace-wide composite build with no direct includes. This aligns with the monorepo’s incremental build strategy.


1-42:

Details

✅ Verification successful

Verify existence of all referenced tsconfig files
Please ensure each path under references exists and is typo-free.

Shell script to confirm:


🏁 Script executed:

#!/bin/bash
# Verify all referenced tsconfig.build.json files exist
mapfile -t refs < <(jq -r '.references[].path' tsconfig.build.json)
for ref in "${refs[@]}"; do
  if [ ! -f "$ref" ]; then
    echo "Missing: $ref"
    exit 1
  fi
done
echo "All references are present."

Length of output: 241


I’ll use a simpler loop to reliably check each path without relying on /dev/fd:

This will clearly report any missing files.


🏁 Script executed:

#!/bin/bash
# Verify all referenced tsconfig.build.json files exist
refs=$(jq -r '.references[].path' tsconfig.build.json)
missing=false

for ref in $refs; do
  if [ ! -f "$ref" ]; then
    echo "Missing: $ref"
    missing=true
  fi
done

if [ "$missing" = true ]; then
  exit 1
fi

echo "All references exist."

Length of output: 1686


All tsconfig.build.json references verified
All entries under "references" in tsconfig.build.json have been checked and each file exists—no typos or missing paths detected. No further action required.

packages/core-generators/tsconfig.build.json (1)

16-23: Project references added for composite builds.

The new references array correctly declares dependencies on ../sync/tsconfig.build.json and ../utils/tsconfig.build.json, enabling coordinated, incremental builds across packages. This aligns with the PR objective to adopt TypeScript project references.

packages/sync/package.json (1)

38-39: Standardize watch script naming.

Renaming the "watch" script to "tsc:watch" and moving "typecheck" immediately after ensures consistency with other packages and aligns with the updated TypeScript project reference workflow.

packages/project-builder-server/package.json (1)

35-36: Consistent TypeScript watch and typecheck scripts.

The renaming of "watch" to "tsc:watch" and reordering "typecheck" directly below maintains uniform script names across packages and supports incremental builds.

packages/utils/tsconfig.build.json (2)

4-9: Enable composite and incremental compiler options.

Adding "tsBuildInfoFile", "composite": true, "incremental": true, along with explicit "rootDir" and "outDir", correctly configures this package for incremental, composite builds. This matches the conventions applied elsewhere in the monorepo.


16-17: Placeholder references array added.

Introducing an empty references array prepares this config for automated population by your .workspace-meta/config.ts plugin. This meets the requirement for project references even if there are currently no direct dependencies.

packages/ui-components/package.json (1)

40-41: Standardize TypeScript watch & typecheck scripts
Renaming the watch script to tsc:watch and positioning typecheck immediately after ensures consistency with other workspace packages.

plugins/plugin-storage/package.json (1)

31-31: Align TypeScript watch script naming
Replacing watch:tsc with tsc:watch matches the naming convention used across the monorepo for TypeScript watch commands.

tsconfig.json (1)

2-6: Introduce project references for root config
Defining an empty files array and adding references to both tsconfig.scripts.json and tsconfig.build.json correctly enables composite project builds and delegates compilation scope.

packages/sync/tsconfig.build.json (3)

4-9: Enable composite, incremental builds with build info file
Adding composite, incremental, and a custom tsBuildInfoFile alongside explicit rootDir/outDir is the recommended setup for TypeScript project references.


14-16: Refine test exclusion patterns
Excluding tests under string-merge-algorithms avoids inadvertently compiling legacy test fixtures while retaining global test file exclusions.


17-21: Link to utils project reference
Pointing to ../utils/tsconfig.build.json ensures the sync package correctly declares its dependency for incremental compilation.

packages/create-project/tsconfig.build.json (2)

16-16: Adjust trailing comma in exclude list
Adding the trailing comma maintains JSON syntax consistency and allows easy addition of future exclude entries.


17-21: Add project reference to utils
Including a reference to ../utils/tsconfig.build.json aligns this package with the incremental build graph and ensures proper dependency ordering.

packages/fastify-generators/package.json (1)

34-38: Rename TypeScript watch script and simplify watch task
Renaming "watch:tsc""tsc:watch" and paring down the top-level watch to only run template builds standardizes this package with the monorepo convention.

Please verify that your root-level orchestrator (e.g., turbo.json, CI workflows, README docs) has been updated to reference the new tsc:watch and watch:templates scripts.

plugins/plugin-storage/tsconfig.build.json (3)

4-9: Enable composite and incremental builds
Adding "composite", "incremental", and an explicit tsBuildInfoFile with rootDir/outDir aligns this config for TypeScript project references and speeds up rebuilds.


16-16: Ensure exclude array closure
The trailing comma after the last exclude entry was closed properly—this avoids JSON parsing issues.


17-38: Add project references
The seven referenced build configs (core-generators through utils) match this plugin’s dependencies, enabling coordinated composite builds.

packages/ui-components/tsconfig.build.json (3)

5-8: Activate incremental mode and metadata output
Introducing rootDir, tsBuildInfoFile, composite, and incremental prepares this lib for fast, linked builds.


11-11: Exclude test and stories files
Excluding *.test.ts, *.stories.ts, and *.stories.tsx ensures only source code goes into the build, keeping outputs clean.


12-16: Reference dependent utils project
Pointing to ../utils/tsconfig.build.json correctly wires up the dependency for composite builds.

plugins/plugin-auth/tsconfig.build.json (3)

4-9: Enable composite/incremental flags and build info
Setting noEmit: false, tsBuildInfoFile, composite, incremental, rootDir, and outDir aligns this plugin with TS project reference requirements.


16-16: Close exclude array properly
The exclude list now ends with a comma-terminated closing bracket, preventing JSON syntax errors.


17-36: Define project references
Referencing six upstream builds (core-generators through ui-components) matches this plugin’s imports and enables incremental, cross-package compilation.

packages/project-builder-server/tsconfig.build.json (3)

4-9: Configure composite build settings
Adding tsBuildInfoFile, composite, incremental, rootDir, and outDir makes this server package compatible with TypeScript project references and speeds up rebuilds.


15-15: Ensure exclude closure
The trailing bracket after the exclude array is properly closed, avoiding malformed JSON.


16-35: Add references to sibling packages
Including references to core-generators, fastify-generators, project-builder-lib, react-generators, sync, and utils ensures coordinated composite compilation across the monorepo.

packages/project-builder-lib/tsconfig.build.json (2)

4-9: Enable composite and incremental builds
Adds composite, incremental, tsBuildInfoFile, rootDir, and outDir to support project references and incremental build caching.


16-26: Add project references to dependent packages
The references array correctly includes sync, ui-components, and utils projects for coordinated builds across the workspace.

packages/react-generators/tsconfig.build.json (3)

4-9: Enable composite and incremental builds
Introduces composite, incremental, tsBuildInfoFile, rootDir, and outDir settings to leverage TypeScript project references with incremental build information.


16-16: Exclude template directories from TS compilation
Adding **/generators/*/*/templates/** to exclude ensures template assets aren’t processed as TypeScript sources.


17-26: Add project references for generators dependencies
References core-generators, sync, and utils build configs to ensure ordered builds and type-checking across packages.

packages/react-generators/package.json (1)

33-36: Standardize watch scripts
Introduces a dedicated "tsc:watch" for TypeScript compilation and simplifies "watch" to only watch template builds, aligning with other generator packages.

packages/core-generators/package.json (1)

46-46: Standardize watch and TypeScript watch scripts
Adds "tsc:watch" for persistent TS watch output and simplifies "watch" to only track template changes, matching the new project-wide convention.

Also applies to: 48-48

package.json (3)

4-5: Add homepage and update license
Sets the root package "homepage" to the official site and standardizes the license to MPL-2.0.


43-44: Introduce root-level TypeScript watch script
Adds "watch:tsc:root" and updates the top-level "watch" to include it alongside other watchers with controlled concurrency.


57-57: Update devDependencies for build tooling
Bumps es-toolkit to 1.31.0 and workspace-meta to 0.1.4 to align with the new TypeScript project references plugin updates.

Also applies to: 66-66

.workspace-meta/config.ts (4)

3-4: Good choice of utility libraries for configuration management.

The import of isEqual, merge, and isMatch from es-toolkit provides robust utilities for deep object comparison and merging, which are essential for the configuration comparison logic used later.


14-19: Clean helper function for dependency extraction.

The function correctly extracts both regular and dev dependencies from package.json, which is appropriate for determining TypeScript project references.


27-42: Well-defined TypeScript interface for configuration structure.

The TsconfigBuild interface provides good type safety for the tsconfig.build.json structure and correctly makes properties optional to handle various configuration scenarios.


75-160: Comprehensive TypeScript project references automation.

This plugin effectively automates the generation and maintenance of TypeScript project references based on workspace dependencies. The logic correctly:

  • Handles both root and non-root packages differently
  • Filters dependencies appropriately
  • Builds correct relative paths for references
  • Compares existing configuration to avoid unnecessary updates
  • Merges compiler options appropriately

The implementation aligns well with the PR objective of enabling better TypeScript project references for improved watch/VSCode support.

Comment on lines +30 to 34
"tsc:watch": "tsc -p tsconfig.build.json --preserveWatchOutput -w",
"typecheck": "tsc --noEmit",
"watch": "concurrently pnpm:watch:*",
"watch:static": "pnpm build:static --watch",
"watch:tsc": "tsc -p tsconfig.build.json --preserveWatchOutput -w",
"watch:vite": "vite build --watch"

@coderabbitai coderabbitai Bot Jun 2, 2025

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Breaking change: tsc:watch not included in watch task
You’ve renamed watch:tsc to tsc:watch, but the watch script still runs pnpm:watch:*, which no longer matches tsc:watch. This causes pnpm watch to skip the TypeScript compiler watch.

To fix, update the watch script to include tsc:watch. For example:

- "watch": "concurrently pnpm:watch:*",
+ "watch": "concurrently \"pnpm run tsc:watch\" pnpm:watch:*",

This ensures the TypeScript watch runs alongside other watchers.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"tsc:watch": "tsc -p tsconfig.build.json --preserveWatchOutput -w",
"typecheck": "tsc --noEmit",
"watch": "concurrently pnpm:watch:*",
"watch:static": "pnpm build:static --watch",
"watch:tsc": "tsc -p tsconfig.build.json --preserveWatchOutput -w",
"watch:vite": "vite build --watch"
"tsc:watch": "tsc -p tsconfig.build.json --preserveWatchOutput -w",
"typecheck": "tsc --noEmit",
"watch": "concurrently \"pnpm run tsc:watch\" pnpm:watch:*",
"watch:static": "pnpm build:static --watch",
"watch:vite": "vite build --watch"
🤖 Prompt for AI Agents
In plugins/plugin-auth/package.json around lines 30 to 34, the "watch" script
uses the pattern "pnpm:watch:*" which no longer matches the renamed "tsc:watch"
script, causing the TypeScript compiler watch to be skipped. Update the "watch"
script to explicitly include "tsc:watch" alongside other watch scripts so that
running "pnpm watch" triggers the TypeScript watch process as intended.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

That's deliberate. We are now watching typescript from the root with project references.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@kingston Thank you for the clarification! I understand now - with the TypeScript project references setup, you're centralizing the TypeScript watch at the root level rather than having each package run its own TypeScript watcher. This makes perfect sense for the new architecture.


✏️ Learnings added
Learnt from: kingston
PR: halfdomelabs/baseplate#562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.633Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread turbo.json
Comment on lines +45 to +48
},
"//#watch:tsc:root": {
"persistent": true,
"cache": false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix task key format in turbo.json.

The new task key is defined as "//#watch:tsc:root", but the leading // will be treated literally and may not map to the "watch:tsc:root" script in package.json. Rename this key to "watch:tsc:root" (without the //) or document why the prefix is required to avoid misconfiguration.

🤖 Prompt for AI Agents
In turbo.json around lines 45 to 48, the task key is incorrectly prefixed with
"//" as "//#watch:tsc:root", which will be treated literally and may not match
the corresponding script in package.json. Remove the leading "//" from the key
so it reads "watch:tsc:root" to ensure proper mapping, or add documentation
explaining why the prefix is necessary if it must be kept.

Comment thread .workspace-meta/config.ts
return;
}

const parsedTsconfig = JSON.parse(tsconfigBuild) as TsconfigBuild;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Add error handling for JSON parsing.

The JSON.parse operation could throw an error if the tsconfig.build.json file contains malformed JSON, which would cause the plugin to fail.

-      const parsedTsconfig = JSON.parse(tsconfigBuild) as TsconfigBuild;
+      let parsedTsconfig: TsconfigBuild;
+      try {
+        parsedTsconfig = JSON.parse(tsconfigBuild) as TsconfigBuild;
+      } catch (error) {
+        console.warn(`Failed to parse tsconfig.build.json in ${ctx.packagePath}:`, error);
+        return;
+      }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const parsedTsconfig = JSON.parse(tsconfigBuild) as TsconfigBuild;
let parsedTsconfig: TsconfigBuild;
try {
parsedTsconfig = JSON.parse(tsconfigBuild) as TsconfigBuild;
} catch (error) {
console.warn(`Failed to parse tsconfig.build.json in ${ctx.packagePath}:`, error);
return;
}
🤖 Prompt for AI Agents
In .workspace-meta/config.ts at line 126, the JSON.parse call on tsconfigBuild
can throw an error if the JSON is malformed. Wrap the JSON.parse operation in a
try-catch block to catch any parsing errors. In the catch block, handle the
error gracefully by logging an appropriate error message or taking corrective
action to prevent the plugin from failing unexpectedly.

@socket-security

socket-security Bot commented Jun 3, 2025

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedworkspace-meta@​0.1.2 ⏵ 0.1.474 +810099 +190 +2100
Updatedcpx2@​7.0.1 ⏵ 8.0.09910010078100

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
.workspace-meta/config.ts (1)

156-156: Add error handling for JSON parsing.

The JSON.parse operation could throw an error if the tsconfig.build.json file contains malformed JSON, which would cause the plugin to fail.

🧹 Nitpick comments (2)
.workspace-meta/config.ts (1)

25-29: Clarify the reasoning for ignoring these packages.

The comment mentions "False positives for the Typescript project references" but could be more specific about why these packages need to be excluded.

Consider adding more detailed comments explaining why each package is ignored:

-// False positives for the Typescript project references
+// Packages excluded from TypeScript project references:
+// - project-builder-web: Uses different build system (Vite)
+// - root: Special workspace root package
 const IGNORED_PACKAGES = new Set([
   '@baseplate-dev/project-builder-web',
   '@baseplate-dev/root',
 ]);
packages/ui-components/package.json (1)

22-27: Verify files inclusion/exclusion patterns
Explicitly including README.md and dist/**/* while excluding .d.ts.map and .tsbuildinfo is correct to keep the package lean.

Please double-check that the actual changelog file is named CHANGELOG (no extension) in the repo. If it’s CHANGELOG.md, update the entry accordingly.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dc2da8e and b68d743.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (26)
  • .changeset/ten-ducks-scream.md (1 hunks)
  • .workspace-meta/config.ts (3 hunks)
  • package.json (5 hunks)
  • packages/core-generators/package.json (3 hunks)
  • packages/create-project/bin/create-baseplate-project.js (1 hunks)
  • packages/create-project/package.json (1 hunks)
  • packages/fastify-generators/package.json (3 hunks)
  • packages/project-builder-cli/bin/baseplate.js (1 hunks)
  • packages/project-builder-cli/package.json (1 hunks)
  • packages/project-builder-cli/scripts/baseplate.js (0 hunks)
  • packages/project-builder-cli/src/cli.ts (1 hunks)
  • packages/project-builder-cli/src/index.ts (1 hunks)
  • packages/project-builder-lib/package.json (2 hunks)
  • packages/project-builder-server/package.json (2 hunks)
  • packages/project-builder-server/src/api/index.ts (1 hunks)
  • packages/project-builder-web/package.json (1 hunks)
  • packages/react-generators/package.json (3 hunks)
  • packages/sync/package.json (2 hunks)
  • packages/ui-components/README.md (1 hunks)
  • packages/ui-components/package.json (2 hunks)
  • packages/ui-components/turbo.json (1 hunks)
  • packages/utils/package.json (2 hunks)
  • plugins/plugin-auth/package.json (3 hunks)
  • plugins/plugin-storage/package.json (3 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • turbo.json (2 hunks)
💤 Files with no reviewable changes (1)
  • packages/project-builder-cli/scripts/baseplate.js
✅ Files skipped from review due to trivial changes (6)
  • packages/project-builder-server/src/api/index.ts
  • packages/create-project/bin/create-baseplate-project.js
  • pnpm-workspace.yaml
  • .changeset/ten-ducks-scream.md
  • packages/project-builder-cli/bin/baseplate.js
  • packages/ui-components/README.md
🚧 Files skipped from review as they are similar to previous changes (11)
  • packages/project-builder-server/package.json
  • turbo.json
  • packages/project-builder-lib/package.json
  • packages/utils/package.json
  • packages/sync/package.json
  • plugins/plugin-auth/package.json
  • plugins/plugin-storage/package.json
  • packages/fastify-generators/package.json
  • packages/react-generators/package.json
  • packages/core-generators/package.json
  • package.json
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kingston
PR: halfdomelabs/baseplate#562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.633Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.
🧬 Code Graph Analysis (1)
packages/project-builder-cli/src/cli.ts (1)
packages/project-builder-cli/src/index.ts (1)
  • runCli (14-29)
🪛 GitHub Actions: Test
packages/ui-components/package.json

[error] 1-1: pnpm install failed with frozen-lockfile because pnpm-lock.yaml is not up to date with package.json dependencies. The lockfile and package.json dependency specifiers do not match.

🪛 GitHub Actions: Lint
packages/ui-components/package.json

[error] 1-1: pnpm install failed with frozen-lockfile because pnpm-lock.yaml is not up to date with package.json dependencies. Lockfile and package.json specs do not match.

🪛 GitHub Actions: Test E2E
packages/ui-components/package.json

[error] 1-1: pnpm install failed with frozen-lockfile because pnpm-lock.yaml is not up to date with package.json dependencies. The lockfile and package.json specs do not match, causing ERR_PNPM_OUTDATED_LOCKFILE.

🔇 Additional comments (20)
packages/project-builder-cli/src/cli.ts (1)

1-11: LGTM! Clean CLI entry point implementation.

The new CLI entry script follows excellent separation of concerns:

  • Proper shebang for direct execution
  • Correct ESM import syntax with .js extensions
  • Appropriate top-level await usage (supported by Node.js ^22.0.0 requirement)
  • Clean error handling with logging and proper exit codes

This structure nicely separates the executable entry point from the main CLI logic in index.ts.

packages/project-builder-cli/src/index.ts (1)

10-14: Excellent refactoring for better separation of concerns.

The changes improve the code structure:

  • Function is now properly exported for reusability and testing
  • Clear JSDoc documentation describes the function's purpose
  • Removal of execution concerns (shebang, error handling) allows this module to focus purely on CLI logic

This refactoring aligns perfectly with the TypeScript project references migration goals.

packages/project-builder-cli/package.json (3)

25-31: LGTM! Files list properly updated for the CLI restructuring.

The files list changes are well-structured:

  • ✅ Added README.md for better package documentation
  • ✅ Excluded TypeScript build artifacts (*.d.ts.map, *.tsbuildinfo) for cleaner packages
  • ✅ Included bin/**/* to ship the new CLI launcher

These changes align perfectly with the monorepo standardization efforts.


36-42: Scripts correctly updated for the new CLI entry point.

The dev and start scripts now properly target ./src/cli.ts instead of the entire ./src directory, which:

  • ✅ Aligns with the new CLI entry point structure
  • ✅ Provides more precise execution targeting
  • ✅ Supports the separation of concerns between cli.ts (entry) and index.ts (logic)

This change is consistent with the retrieved learning about TypeScript project references where compilation watching is handled centrally at the workspace root.


22-22:

Details

✅ Verification successful

Verify the new bin path works correctly.

The change from ./scripts/baseplate.js to ./bin/baseplate.js looks correct for the CLI restructuring. Ensure that the new bin/baseplate.js file exists and properly invokes the compiled CLI code.


🏁 Script executed:

#!/bin/bash
# Description: Verify the new bin/baseplate.js file exists and has correct content
# Expected: File should exist and contain logic to run the compiled CLI

# Check if the new bin file exists
fd "baseplate.js" packages/project-builder-cli/bin/

# Show the content of the bin file to verify it's set up correctly
cat packages/project-builder-cli/bin/baseplate.js 2>/dev/null || echo "File not found"

Length of output: 195


Bin path verified

The new packages/project-builder-cli/bin/baseplate.js file exists and correctly invokes the compiled CLI via import '../dist/cli.js'. All changes are approved.

.workspace-meta/config.ts (6)

14-19: LGTM: Clean utility function for dependency extraction.

The function correctly extracts dependency keys from both dependencies and devDependencies fields.


21-23: LGTM: Simple and effective plugin package detection.

The function correctly identifies plugin packages by their naming convention.


31-46: LGTM: Well-defined TypeScript configuration interface.

The interface properly types the structure of tsconfig.build.json files with appropriate optional properties.


49-49: LGTM: Enables root package inclusion for project references.

This change aligns with the TypeScript project references setup that needs to manage the root configuration.


76-100: LGTM: Comprehensive file standardization logic.

The logic correctly handles different package types and ensures proper file inclusion for build artifacts, templates, bin directories, and plugin manifests.


105-190:

Details

✅ Verification successful

Verify the TypeScript project references plugin logic.

The plugin implements a comprehensive system for managing TypeScript project references. The logic appears sound, but let me verify the dependency resolution and path calculation logic.


🏁 Script executed:

#!/bin/bash
# Description: Verify that TypeScript project references are correctly set up across packages.
# Expected: All packages with TypeScript dependencies and build scripts should have proper tsconfig.build.json files.

echo "=== Checking packages with TypeScript dependencies and build scripts ==="
fd -t f "package.json" --exec jq -r 'select(.dependencies.typescript or .devDependencies.typescript) | select(.scripts.build) | .name' {} \;

echo -e "\n=== Checking tsconfig.build.json files ==="
fd -t f "tsconfig.build.json" --exec echo "Found: {}" \;

echo -e "\n=== Verifying project references structure ==="
fd -t f "tsconfig.build.json" --exec jq -r 'if .references then "\(.references | length) references in " + input_filename else "No references in " + input_filename end' {} \;

Length of output: 2723


TypeScript project references plugin logic verified

All 13 tsconfig.build.json files were located and their references arrays match the expected inter-project dependencies:

  • Root: 12 references
  • plugin-auth: 6 references
  • plugin-storage: 7 references
  • project-builder-server: 6 references
  • sync: 1 reference
  • ui-components: 1 reference
  • react-generators: 3 references
  • utils: 0 references (no internal deps, as expected)
  • project-builder-cli: 3 references
  • fastify-generators: 3 references
  • create-project: 1 reference
  • project-builder-lib: 3 references
  • core-generators: 2 references

The zero references in utils align with its lack of internal dependencies. The parse errors seen when using jq are due to its strict JSON rules and don’t reflect any runtime issue in the plugin. No changes are required.

packages/project-builder-web/package.json (1)

14-20: LGTM: Proper package file standardization.

The changes correctly add documentation files and exclude TypeScript build artifacts from the published package, aligning with the workspace meta configuration standards.

packages/create-project/package.json (2)

17-26: LGTM: Comprehensive file standardization.

The files array properly includes documentation, excludes build artifacts, and adds the necessary templates and bin directories for CLI distribution.


16-16:

Details

✅ Verification successful

Verify the new bin launcher script exists.

The executable entry point changed from ./dist/create-baseplate-project.js to ./bin/create-baseplate-project.js. Ensure the new launcher script is properly implemented.


🏁 Script executed:

#!/bin/bash
# Description: Verify the new bin launcher script exists and is properly configured.
# Expected: The bin/create-baseplate-project.js file should exist and be executable.

echo "=== Checking for bin launcher script ==="
if [ -f "packages/create-project/bin/create-baseplate-project.js" ]; then
    echo "✓ Bin launcher script exists"
    echo "Content preview:"
    head -10 "packages/create-project/bin/create-baseplate-project.js"
else
    echo "✗ Bin launcher script missing"
fi

echo -e "\n=== Checking if the script references the built dist file ==="
if [ -f "packages/create-project/bin/create-baseplate-project.js" ]; then
    rg -A 5 "dist.*create-baseplate-project" "packages/create-project/bin/create-baseplate-project.js" || echo "No dist reference found"
fi

Length of output: 756


Bin launcher script verified and correct

  • The file packages/create-project/bin/create-baseplate-project.js exists and is executable.
  • It correctly references the compiled entry point in ../dist/create-baseplate-project.js.

No further changes needed.

packages/ui-components/turbo.json (2)

6-6: LGTM: Cleaned up build outputs.

Removing tailwind.config.js from outputs is appropriate since it's a configuration file, not a build artifact.


8-10:

Details

✅ Verification successful

LGTM: Consistent task naming convention.

The rename from build:storybook to storybook:build follows a consistent action:target pattern. Ensure this aligns with the corresponding package.json script changes.


🏁 Script executed:

#!/bin/bash
# Description: Verify that the turbo task rename aligns with package.json scripts.
# Expected: The package.json should have a corresponding "storybook:build" script.

echo "=== Checking ui-components package.json for storybook scripts ==="
jq -r '.scripts | to_entries[] | select(.key | contains("storybook")) | "\(.key): \(.value)"' packages/ui-components/package.json

echo -e "\n=== Checking root package.json for storybook scripts ==="
jq -r '.scripts | to_entries[] | select(.key | contains("storybook")) | "\(.key): \(.value)"' package.json

Length of output: 661


Verified: Task rename aligns with package.json scripts

The storybook:build task in packages/ui-components/turbo.json now correctly matches the storybook:build script defined in both packages/ui-components/package.json and the root package.json. Everything is consistent—approving the change.

packages/ui-components/package.json (4)

16-18: Confirm CSS export paths
The new entries expose CSS files at the package boundary ("./base-styles.css", "./theme.css", "./utilities.css"). This aligns with the move from source to dist.


30-32: Approve new build orchestration scripts
Switching build to run tsc then copy CSS (build:css) is a clean separation of concerns.


37-38: Approve Storybook script renames
Renaming to "storybook:build" and "storybook:dev" tightens consistency; removal of dev:storybook is expected given the updated task config.


41-43: Approve watch script adjustments
Isolating CSS watching in watch and adding a standalone tsc:watch aligns with root-level project references and central watch orchestration.

"@testing-library/user-event": "14.6.1",
"@types/node": "catalog:",
"@vitejs/plugin-react": "catalog:",
"cpx2": "catalog:",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Sync lockfile & verify CSS copier CLI
You’ve added cpx2 as a devDependency, which updates the lockfile. CI is currently failing due to ERR_PNPM_OUTDATED_LOCKFILE. Please run pnpm install and commit the updated pnpm-lock.yaml to resolve this. Also confirm whether the binary provided by cpx2 is invoked via cpx or cpx2; adjust the build:css script if needed.


🏁 Script executed:

#!/bin/bash
set -e

echo "🕵️‍♂️ Inspecting `cpx2` entry in package.json"
grep -n '"cpx2"' -n packages/ui-components/package.json

echo -e "\n🕵️‍♂️ Inspecting `build:css` script"
grep -n '"build:css"' -n packages/ui-components/package.json -A2

Length of output: 675


🏁 Script executed:

#!/bin/bash
set -e

echo "🕵️‍♂️ Showing devDependencies block:"
grep -n '"devDependencies"' -n packages/ui-components/package.json -A20

echo -e "\n🕵️‍♂️ Searching for all occurrences of 'cpx' in package.json:"
grep -n '"cpx' -n packages/ui-components/package.json

Length of output: 1305


Sync lockfile & correct CSS copier CLI
It looks like you added "cpx2": "catalog:" (packages/ui-components/package.json:108) but the build:css script still invokes cpx (line 31). This will fail if the new package only provides a cpx2 binary. Please:

  • Run pnpm install and commit the updated pnpm-lock.yaml to resolve ERR_PNPM_OUTDATED_LOCKFILE.
  • Verify which binary name cpx2 exposes (for example via npm view cpx2 bin).
  • Update the build:css script in packages/ui-components/package.json to use the correct CLI (e.g.
    "build:css": "cpx2 \"src/**/*.css\" dist --clean"
    ).
🤖 Prompt for AI Agents
In packages/ui-components/package.json at line 108, you added the devDependency
"cpx2" but did not update the build:css script at line 31, which still calls
"cpx". First, run "pnpm install" to update and commit the pnpm-lock.yaml file to
fix the outdated lockfile error. Then, verify the binary name provided by the
"cpx2" package (e.g., using "npm view cpx2 bin"). Finally, update the build:css
script to invoke the correct binary name, replacing "cpx" with "cpx2" if that is
the binary exposed by the package.

@kingston kingston merged commit 30fdf49 into main Jun 3, 2025
9 checks passed
@kingston kingston deleted the kingston/eng-624-use-project-references-for-building-project-to-allow-ide-to branch June 3, 2025 09:20
This was referenced Jun 3, 2025
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