Skip to content

Conversation

seveibar
Copy link
Contributor

@seveibar seveibar commented Oct 5, 2025

Summary

  • add peerDependenciesMeta entries so all peer dependencies are marked optional

Testing

  • bunx tsc --noEmit
  • bun run format (fails: Script not found "format")

https://chatgpt.com/codex/tasks/task_b_68e20bdec7e0832e86de86ee3baad9c4

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment on lines +24 to +36
"peerDependenciesMeta": {
"typescript": {
"optional": true
},
"react": {
"optional": true
},
"@tscircuit/core": {
"optional": true
},
"@tscircuit/math-utils": {
"optional": true
}

Choose a reason for hiding this comment

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

P1 Badge Making required peers optional breaks module loading

The new peerDependenciesMeta marks react, @tscircuit/core, @tscircuit/math-utils, and typescript as optional, but lib/index.ts unconditionally imports all four modules at the top of the file (import GlobalReact from "react", etc.). After this change a consumer can install @tscircuit/import-snippet without those packages and npm/yarn will not warn, yet the library will immediately throw Cannot find module when it is imported because the default dependency map references those modules. This regresses installation safety for any user who does not already include the peers. Either remove the optional flag or lazy-load/guard the imports.

Useful? React with 👍 / 👎.

@seveibar seveibar merged commit 0371e6c into main Oct 5, 2025
1 of 3 checks passed
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.

1 participant