Skip to content

feat(api): generate JSON schema during development builds - #4459

Open
JimiC wants to merge 1 commit into
vscode-icons:masterfrom
JimiC:generate_api_json_schema
Open

JimiC wants to merge 1 commit into
vscode-icons:masterfrom
JimiC:generate_api_json_schema

Conversation

@JimiC

@JimiC JimiC commented Oct 27, 2026

Copy link
Copy Markdown
Member

Changes proposed:

  • Add

Generate the API schema from the TypeScript ApiIconSchema type and write it to schemas/api/v1/schema.json.

Generate the API schema from the TypeScript ApiIconSchema type and write it to schemas/api/v1/schema.json.
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (24a6445) to head (b95b3ce).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #4459   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           72        72           
  Lines         7696      7767   +71     
  Branches       365       370    +5     
=========================================
+ Hits          7696      7767   +71     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@robertohuertasm robertohuertasm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @JimiC, thanks for this! 🙌

I checked out the branch locally. npm test passes, but npm run build:dev fails when it generates the schema. It also fails after a clean npm ci:

Unhandled Error: Error: Type check error

The underlying diagnostics are:

src/types/vscode.ts: Cannot find name 'Thenable'.

ts-json-schema-generator bundles its own typescript@^5.9.3 (pinned in the lockfile), which can't resolve Thenable with our tsconfig (we're on TS 6). CI doesn't catch this because it only runs npm test, where the generator is stubbed.

Suggestions:

  1. Fix: pass skipTypeCheck: true to createGenerator. tsc already type-checks the project in compile:dev right before, so nothing is lost. I tried it locally and it produces the expected schema.
  2. Guard (optional, could be a follow-up): add a CI step that runs npm run build:dev and then git diff --exit-code schemas/. That way, CI fails if the generation breaks again or if ApiIconSchema changes without regenerating the schema.

Let me know what you think!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants