Conversation
| const aiPatterns = [ | ||
| "**/*openai*", | ||
| "**/*anthropic*", | ||
| "**/*langchain*", | ||
| "**/*ai*", | ||
| ]; | ||
| // This is simplified - in reality you'd use glob patterns | ||
| } catch (error) { |
There was a problem hiding this comment.
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.
| 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
Is this helpful? React 👍 or 👎 to let us know.
| banner: { | ||
| js: "#!/usr/bin/env node", | ||
| }, | ||
| onSuccess: "chmod +x dist/bin/braintrust-setup.js", |
There was a problem hiding this comment.
The chmod +x command in the onSuccess hook will not work on Windows systems. Consider using a cross-platform solution instead, such as:
- Using the Node.js
fsmodule in a separate script:
// make-executable.js
const fs = require('fs');
fs.chmodSync('dist/bin/braintrust-setup.js', '755');- Adding a package like
cross-chmodto handle platform differences
This ensures the CLI binary will be properly executable regardless of the developer's operating system.
| onSuccess: "chmod +x dist/bin/braintrust-setup.js", | |
| onSuccess: "node -e \"require('fs').chmodSync('dist/bin/braintrust-setup.js', '755')\"", |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
| { | ||
| entry: ["src/index.ts"], | ||
| format: ["cjs", "esm"], | ||
| dts: false, |
There was a problem hiding this comment.
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.
| dts: false, | |
| dts: true, |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
|
this is a cool idea! i also want to try |
|
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! |
No description provided.