Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

The CI fails with error TS2307: Cannot find module '@architectural-discipline/core' because npm run build --workspaces builds packages in parallel. The CLI package starts compiling before core's type declarations exist.

Changes

  • Updated root package.json build script to enforce dependency order: core → eslint-plugin → cli → installer
  • Changed from parallel --workspaces flag to sequential --workspace commands with && chaining
- "build": "npm run build --workspaces",
+ "build": "npm run build --workspace=@architectural-discipline/core && npm run build --workspace=@architectural-discipline/eslint-plugin && npm run build --workspace=@architectural-discipline/cli && npm run build --workspace=@architectural-discipline/installer",

This fixes the Deno test job which was the only job using the root build script directly. The Node.js test jobs already build sequentially and were unaffected.

Original prompt

This section details on the original issue you should resolve

<issue_title>fix failed job</issue_title>
<issue_description>The job failed because TypeScript could not find the module @architectural-discipline/core or its corresponding type declarations, as shown by these errors in the logs:

  • error TS2307: Cannot find module '@architectural-discipline/core' or its corresponding type declarations.

This module is imported in your CLI entrypoint (src/cli.ts), and it's listed as a dependency with a wildcard ("*") version in your package.json.

Solution:

  1. Ensure @architectural-discipline/core exists in your monorepo and is built before compiling the CLI package.
  2. Add @architectural-discipline/core as a workspace dependency using the correct version or path, for example:
    {
      "dependencies": {
        "@architectural-discipline/core": "workspace:*"
      }
    }
  3. If using a monorepo, run the install command from the root:
    npm install
    
    or, if using Yarn:
    yarn install
    
  4. Confirm that a packages/core/package.json file exists and includes a build script. Build the core package first:
    npm run build --workspace=@architectural-discipline/core
    npm run build --workspace=@architectural-discipline/cli
    
    Or with Turborepo or Nx, run the affected build or build all packages.

This will ensure TypeScript resolves @architectural-discipline/core and its type definitions successfully, resolving the build error.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

… dependency

Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failed job due to missing module Fix parallel build race condition in npm workspaces Nov 14, 2025
Copilot AI requested a review from kayodebristol November 14, 2025 07:15
@kayodebristol kayodebristol marked this pull request as ready for review November 14, 2025 07:20
@kayodebristol kayodebristol merged commit 24d3a30 into main Nov 14, 2025
10 checks passed
@kayodebristol kayodebristol deleted the copilot/fix-failed-cli-job branch November 14, 2025 07:20
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.

fix failed job

2 participants