Skip to content

[WIP] Add CI step to generate placeholder for index.d.ts file#4

Closed
Copilot wants to merge 1 commit intomainfrom
copilot/update-ci-workflow-to-generate-placeholder
Closed

[WIP] Add CI step to generate placeholder for index.d.ts file#4
Copilot wants to merge 1 commit intomainfrom
copilot/update-ci-workflow-to-generate-placeholder

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original prompt

Problem

The CI build is failing with the following error:

Type error: Cannot find module '@shared/contracts/index' or its corresponding type declarations.
./src/types/dashboard.ts:19:8

This occurs because:

  1. The file shared/contracts/index.d.ts is auto-generated and gitignored (line 146 in .gitignore)
  2. The Next.js build in CI tries to import from @shared/contracts/index
  3. The file doesn't exist in the repository since it's generated locally

Solution

Add a step in the CI workflow to generate a stub/placeholder for shared/contracts/index.d.ts before running the build. This will satisfy TypeScript's module resolution without requiring the backend to be running.

Changes needed:

  1. Update .github/workflows/ci.yml: Add a step in the frontend-build job to create the placeholder file before building
  2. Create the placeholder file with minimal type definitions that match what's being imported

The placeholder should include:

export interface components {
  schemas: Record<string, any>;
}

export interface paths {
  [key: string]: any;
}

export interface operations {
  [key: string]: any;
}

This step should be added in the workflow after installing dependencies but before running the build command.

Files to modify:

  • .github/workflows/ci.yml - Add the placeholder generation step in the frontend-build job (around line 107, after npm ci and before npm run build)

Reference commit: 057b91f8f53a97240ecc649991d24252f3df561c
Reference job: https://github.com/cliff-de-tech/Post-Bot/actions/runs/21345543972/job/61432274796

This pull request was created from Copilot chat.


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

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