-
Notifications
You must be signed in to change notification settings - Fork 1
fix bt eval with monorepo and without extensions in imports #15
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
Closed
+258
−35
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
50d729b
fix bt eval with monorepo and without extensions in imports
ibolmo 97a67d5
fix lint
ibolmo f8437d6
prevent leaking eval args to eval runs
ibolmo f95e2a4
skip monorepo if node < 22
ibolmo cad84f7
add pnpm workspace
ibolmo 1d7c52f
fix lint
ibolmo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "runner": "./run-node-ts", | ||
| "files": ["tests/basic.eval.ts"], | ||
| "min_node_version": 22 | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "name": "bt-eval-ts-esm-monorepo", | ||
| "private": true, | ||
| "type": "module", | ||
| "workspaces": [ | ||
| "packages/*" | ||
| ], | ||
| "dependencies": { | ||
| "@repo/lib": "workspace:*", | ||
| "braintrust": "^2.2.0" | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
tests/evals/js/eval-ts-esm-monorepo/packages/lib/package.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "name": "@repo/lib", | ||
| "version": "0.0.1", | ||
| "type": "module", | ||
| "exports": { | ||
| ".": "./src/index.ts" | ||
| } | ||
| } |
8 changes: 8 additions & 0 deletions
8
tests/evals/js/eval-ts-esm-monorepo/packages/lib/src/helper.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| // Extensionless import — this is the pattern that breaks without the fix. | ||
| // Node's ESM resolver requires explicit extensions, so `./utils` (without .ts) | ||
| // fails unless a resolve hook adds the extension. | ||
| import { greet } from "./utils"; | ||
|
|
||
| export function greetAll(names: string[]): string[] { | ||
| return names.map(greet); | ||
| } |
2 changes: 2 additions & 0 deletions
2
tests/evals/js/eval-ts-esm-monorepo/packages/lib/src/index.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| export { greet } from "./utils.ts"; | ||
| export { greetAll } from "./helper.ts"; |
3 changes: 3 additions & 0 deletions
3
tests/evals/js/eval-ts-esm-monorepo/packages/lib/src/utils.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| export function greet(name: string): string { | ||
| return `Hello ${name}`; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
what is this
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'll split the PR. in the process of repro'ing #3 i found #1 and #2. this comment is part of the fix for #3.
https://github.com/braintrustdata/bt/pull/15/changes/BASE..1d7c52f75723f5035ce730754fa957114e3058f7#diff-ebfbecea6fc2203656d02c9898c507bee6517b02460e25c98d5b240a8ecdf57cR9
this is the line that repros the user's problem
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.
customer will try again on monday so we have time to get this right