-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
def741d
to
54f6337
Compare
There was a problem hiding this 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.
6263872
to
7433096
Compare
7605205
to
91e0a50
Compare
9fc37a7
to
0fce2b9
Compare
|
||
describe('StreamableValue type', () => { | ||
it('should not contain types marked with @internal after compilation', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is now not possible to do since we don't have separate dist builds, and it would result in a compile error otherwise
@@ -77,4 +77,4 @@ jobs: | |||
run: pnpm install --frozen-lockfile | |||
|
|||
- name: Run TypeScript type check | |||
run: pnpm run type-check | |||
run: pnpm run type-check:full |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
full does it with examples, normal tsconfig does without so it's faster
@@ -42,11 +42,12 @@ | |||
"scripts": { | |||
"test:e2e:all": "vitest run src/e2e/*.test.ts", | |||
"test:file": "vitest run", | |||
"type-check": "tsc --noEmit" | |||
"type-check": "tsc --build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where will the js files go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've added a clean
step before running the actual build, so this ensures that before publishes we always have only the correct stuff. Due to microsoft/TypeScript#40431, typescript doesn't yet support noEmit with references. What I could do is instead have a separate dist folder?
with this change you'll have to run build after type-check
6050e32
to
1b69fb9
Compare
This adds project references to the AI SDK codebase.
Improvements
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:
to
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)