This repository was archived by the owner on Oct 23, 2025. It is now read-only.
fix: unable to use js-api due to incorrect type exports#118
Open
phil-sisutech wants to merge 2 commits intoline:mainfrom
Open
fix: unable to use js-api due to incorrect type exports#118phil-sisutech wants to merge 2 commits intoline:mainfrom
phil-sisutech wants to merge 2 commits intoline:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refines the TypeScript build configuration and entrypoint exports to address incorrect type exports in the JS API.
- Adds
emitDeclarationOnlyto the library tsconfig. - Limits exports in
lib/main.tsto thetsrfunction only.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tsconfig.lib.json | Added emitDeclarationOnly to compiler options. |
| lib/main.ts | Removed exports of Config, Logger, and errors; now only exports tsr. |
Comments suppressed due to low confidence (1)
lib/main.ts:1
- By removing the
Config,Logger, and error exports, consumers lose access to these APIs. IfConfigis intended as a type-only export, reintroduce it usingexport type { Config }, and consider re-exportingLoggerand errors as needed.
export { tsr } from './tsr.js';
| @@ -6,6 +6,7 @@ | |||
| "lib": ["ES2023"], | |||
| "target": "ES2022", | |||
| "strict": true, | |||
There was a problem hiding this comment.
Using emitDeclarationOnly without setting declaration prevents JavaScript files from being emitted, which will break the library's runtime output. Consider using declaration: true alongside or instead of emitDeclarationOnly to generate .d.ts files while still emitting .js bundles.
Suggested change
| "strict": true, | |
| "strict": true, | |
| "declaration": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
when using the JS api, tsr throws an error due to incorrect exports of types as described here: #117