Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: typescript project references #5518

Open
wants to merge 2 commits into
base: v5
Choose a base branch
from
Open

Conversation

samdenty
Copy link
Member

@samdenty samdenty commented Apr 2, 2025

This adds project references to the AI SDK codebase.

Improvements

  • Clone codebase, install and start getting intellisense without first running build prior
  • Use find all references to see everywhere something is being used
  • Go to definition now goes to source files
  • Rename symbol across all examples, tests etc.
  • Faster full typecheck 17sec -> 1sec

Possibly breaking changes

Typescript requires the source folders to match output folders, so we would require a bunch of difference tsconfigs with circular dependencies which aren't supported.

So this PR changes the packages with multiple dist folders to instead from:

dist/index.js
anthropic/dist/index.js
...

to

dist/index.js
dist/anthropic/index.js
...

This could be a breaking change if people are depending on the filepath in the package. But if they're importing the package directly, it'll use the import map that i've updated to now use the new format (so should continue working)

Copy link
Collaborator

@lgrammel lgrammel left a comment

Choose a reason for hiding this comment

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

Let's chat on how to best move forward w/ this. Too risky to land on main given the impact and breakages.

@samdenty samdenty marked this pull request as ready for review April 3, 2025 16:54
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