Skip to content

wip: setup cli#941

Open
Ankur Goyal (ankrgyl) wants to merge 3 commits intomainfrom
setup-cli
Open

wip: setup cli#941
Ankur Goyal (ankrgyl) wants to merge 3 commits intomainfrom
setup-cli

Conversation

@ankrgyl
Copy link
Contributor

No description provided.

Comment on lines +227 to +234
const aiPatterns = [
"**/*openai*",
"**/*anthropic*",
"**/*langchain*",
"**/*ai*",
];
// This is simplified - in reality you'd use glob patterns
} catch (error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The code declares an array of glob patterns (aiPatterns) for finding AI-related files, but doesn't actually use these patterns to search for matching files. Either implement the file search functionality using these patterns (with a library like glob or fast-glob), or remove this unused code to avoid confusion. This would complete the file discovery logic that's currently incomplete.

Suggested change
const aiPatterns = [
"**/*openai*",
"**/*anthropic*",
"**/*langchain*",
"**/*ai*",
];
// This is simplified - in reality you'd use glob patterns
} catch (error) {
const aiPatterns = [
"**/*openai*",
"**/*anthropic*",
"**/*langchain*",
"**/*ai*",
];
// Use glob patterns to find AI-related files
const glob = require('glob');
const aiRelatedFiles = [];
for (const pattern of aiPatterns) {
const matches = glob.sync(pattern, { ignore: 'node_modules/**' });
aiRelatedFiles.push(...matches);
}
// Remove duplicates
const uniqueAiFiles = [...new Set(aiRelatedFiles)];
// Now uniqueAiFiles contains all AI-related files in the project
console.log(`Found ${uniqueAiFiles.length} AI-related files`);
} catch (error) {

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

banner: {
js: "#!/usr/bin/env node",
},
onSuccess: "chmod +x dist/bin/braintrust-setup.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

The chmod +x command in the onSuccess hook will not work on Windows systems. Consider using a cross-platform solution instead, such as:

  1. Using the Node.js fs module in a separate script:
// make-executable.js
const fs = require('fs');
fs.chmodSync('dist/bin/braintrust-setup.js', '755');
  1. Adding a package like cross-chmod to handle platform differences

This ensures the CLI binary will be properly executable regardless of the developer's operating system.

Suggested change
onSuccess: "chmod +x dist/bin/braintrust-setup.js",
onSuccess: "node -e \"require('fs').chmodSync('dist/bin/braintrust-setup.js', '755')\"",

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

{
entry: ["src/index.ts"],
format: ["cjs", "esm"],
dts: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

The tsup configuration has dts: false which disables TypeScript declaration file generation, but the package.json references ./dist/index.d.ts in its types field. This will cause issues for TypeScript consumers of the package. Consider changing to dts: true in the tsup.config.ts file to ensure declaration files are properly generated.

Suggested change
dts: false,
dts: true,

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@clutchski
Copy link
Collaborator

this is a cool idea! i also want to try braintrust.instrument_everything() also since it will automatically stay up to date, etc.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. If this PR is still relevant, please leave a comment, push an update, or remove the stale label. Thank you for your contributions!

@github-actions github-actions bot added the stale label Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants