Skip to content

Conversation

phil-sisutech
Copy link

when using the JS api, tsr throws an error due to incorrect exports of types as described here: #117

@potato4d potato4d requested a review from Copilot July 17, 2025 05:58
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refines the TypeScript build configuration and entrypoint exports to address incorrect type exports in the JS API.

  • Adds emitDeclarationOnly to the library tsconfig.
  • Limits exports in lib/main.ts to the tsr function 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. If Config is intended as a type-only export, reintroduce it using export type { Config }, and consider re-exporting Logger and errors as needed.
export { tsr } from './tsr.js';

@@ -6,6 +6,7 @@
"lib": ["ES2023"],
"target": "ES2022",
"strict": true,
Copy link
Preview

Copilot AI Jul 17, 2025

Choose a reason for hiding this comment

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

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,

Copilot uses AI. Check for mistakes.

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