Skip to content

fix(core): resolve native TS7 runtime via exports and cover adapter#163

Merged
tazo90 merged 1 commit into
mainfrom
fix/native-ts7-adapter-coverage
Jul 3, 2026
Merged

fix(core): resolve native TS7 runtime via exports and cover adapter#163
tazo90 merged 1 commit into
mainfrom
fix/native-ts7-adapter-coverage

Conversation

@tazo90

@tazo90 tazo90 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #162 (native TS7 support). The Coverage gate failed on main because the new
native-typescript-adapter.ts (~1300 LOC) shipped with 3.62% branch coverage, dragging the openapi-core scope below its 73% branch threshold.

Changes

  • typescript-runtime.ts: Remove the dead "unsupported-native" member of TypeScriptVersionSupport and its unreachable message branch (never returned by getTypeScriptVersionSupport).
  • typescript-runtime.ts: Resolve the TS7 native runtime through the package's public exports map (typescript/unstable/sync, typescript/unstable/ast) instead of hardcoded dist/... paths, so internal layout changes in TS7 RCs no longer break resolution.
  • native-typescript-adapter.test.ts (new, 27 tests): Cover evaluateNode, inferResponsesForExports, resolveTypeByName / typeToOpenApiSchema, resolveModule, and project lifecycle via a fake TS7 runtime. Lifts openapi-core branch coverage from 68.12% to 73.49% (threshold 73%).
  • getting-started.md: Document the schemaType guard tightening introduced in feat: native ts7 support and multipart improvement #162 (TS checker fallback is skipped when schemaType does not include "typescript").

Verification

  • pnpm exec turbo run lint typecheck --filter=@workspace/openapi-core: 0 warnings, 0 errors.
  • COVERAGE_SCOPE=openapi-core vitest run --coverage: All files 82.89 / 73.49 / 92.44 / 84.33 (branches 73.49% >= 73 threshold), 840/840 tests pass.
  • Existing TS7-mock tests ( ypescript-runtime, ypescript-project, ypescript-response-inference) still pass against the new exports-based resolution.

Type of change

  • fix: Bug fix (non-breaking change which fixes an issue)

Checklist

  • pnpm check passes
  • Tested locally (pnpm test and coverage gate)
  • Documentation updated

- Remove dead "unsupported-native" TypeScriptVersionSupport branch
  (never returned by getTypeScriptVersionSupport)
- Resolve TS7 native modules via package exports
  (typescript/unstable/sync, typescript/unstable/ast)
  instead of hardcoded dist paths
- Add 27 unit tests for NativeTypeScriptAdapter covering
  evaluateNode, inferResponsesForExports, resolveTypeByName,
  resolveModule and project lifecycle
- Lifts openapi-core branch coverage from 68.12% to 73.49%
  (threshold 73%)
- Document schemaType guard behavior in getting-started.md
@tazo90
tazo90 merged commit 63ccdce into main Jul 3, 2026
25 checks passed
@tazo90
tazo90 deleted the fix/native-ts7-adapter-coverage branch July 3, 2026 19:31
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