Skip to content

fix: add overrides to ensure build outputs to build/dist/index.js#25

Merged
rothnic merged 4 commits intofix/limit-tools-for-opencodefrom
copilot/sub-pr-23
Nov 19, 2025
Merged

fix: add overrides to ensure build outputs to build/dist/index.js#25
rothnic merged 4 commits intofix/limit-tools-for-opencodefrom
copilot/sub-pr-23

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 19, 2025

CI was failing because the generated tsconfig.json had outDir: "./build" which would output to build/build/index.js, but the project expects build/dist/index.js.

Changes

  • src/overrides/tsconfig.patch.json: Restored override to change outDir from "./build" to "./dist"
  • src/overrides/package-main.patch.json: Added override to update main field to "dist/index.js"
  • src/overrides/package-start.patch.json: Added override to update start script to use dist/index.js
  • src/overrides/package-build.patch.json: Added override to update build script chmod to target dist/index.js
  • src/overrides/fix-schemas.json: Fixed empty file causing validation errors

How It Works

  1. openapi-mcp-generator creates build/ with tsconfig.json having outDir: "./build"
  2. First apply-overrides in generation phase patches tsconfig.json to outDir: "./dist"
  3. Postgenerate hook runs apply-overrides again to patch package.json paths
  4. TypeScript compiles to build/dist/index.js
  5. Root package.json "dev" script correctly references build/dist/index.js

Verification

  • npm run generate completes successfully
  • ✅ Output file build/dist/index.js is created (473KB, executable)
  • ✅ All paths consistent across package.json, CI workflows, and documentation
  • ✅ Scripts properly reuse npm commands (no repetition)

💡 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.

Copilot AI and others added 2 commits November 19, 2025 05:34
…ld/index.js)

Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>
Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>
Copilot AI changed the title [WIP] Add JSON Schema documentation and ESLint configuration fix: correct CI workflow build artifact path validation Nov 19, 2025
Copilot AI requested a review from rothnic November 19, 2025 05:37
@rothnic
Copy link
Copy Markdown
Owner

rothnic commented Nov 19, 2025

@copilot build/dist/index.js is the correct path. Please check again to make sure that the ci/cd workflows are running the npm run generate command which should generate the mcp server (build/) then apply the transformations/overrides and eventually have build/dist/index.js. Please check all paths referenced in docs and ci/cd workflows for consistency and make sure we are reusing the package.json defined scripts in a way that we don't repeat ourselves. Please run the build commands yourself so you can see what happens when running npm run generate.

…/index.js output

Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 19, 2025

@copilot build/dist/index.js is the correct path. Please check again to make sure that the ci/cd workflows are running the npm run generate command which should generate the mcp server (build/) then a...

You were absolutely right - build/dist/index.js is the correct path. I've restored the tsconfig.patch.json override and added package.json overrides to ensure the build process outputs to build/dist/index.js. The full npm run generate workflow now:

  1. Generates code with openapi-mcp-generator (creates tsconfig with outDir: "./build")
  2. Applies overrides to change tsconfig to outDir: "./dist" and updates package.json paths
  3. Builds TypeScript to build/dist/index.js

All paths are now consistent across:

  • ✅ Root package.json "dev" script → build/dist/index.js
  • ✅ CI workflows → check for build/dist/index.js
  • ✅ Documentation → references build/dist/index.js
  • ✅ Scripts use npm run commands (no repetition)

Commit: 65b808b

Copilot AI changed the title fix: correct CI workflow build artifact path validation fix: add overrides to ensure build outputs to build/dist/index.js Nov 19, 2025
@rothnic rothnic marked this pull request as ready for review November 19, 2025 16:38
@rothnic rothnic merged commit 27c3bdc into fix/limit-tools-for-opencode Nov 19, 2025
rothnic added a commit that referenced this pull request Nov 19, 2025
…mprovements (#23)

* chore: update ls-lint configuration to ignore .opencode and allow eslint config

* docs: add JSON Schema guide for API/MCP workflows

* docs: add generated tools list and agent/testing guides

* fix: correct CI workflow paths from generator/ to src/generator/ (#24)

* Initial plan

* fix: update CI workflow paths from generator/ to src/generator/

Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>

* fix: add overrides to ensure build outputs to build/dist/index.js (#25)

* Initial plan

* fix: update CI workflow to check correct build output path (build/build/index.js)

Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>

* fix: add empty JSON object to fix-schemas.json to fix validation

Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>

* fix: restore tsconfig and package.json overrides to ensure build/dist/index.js output

Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>

---------

Co-authored-by: Nick Roth <nroth@dealnews.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rothnic <452052+rothnic@users.noreply.github.com>
@rothnic rothnic deleted the copilot/sub-pr-23 branch November 19, 2025 18:27
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