Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,19 @@
"@tscircuit/core": "*",
"@tscircuit/math-utils": "*"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
},
"react": {
"optional": true
},
"@tscircuit/core": {
"optional": true
},
"@tscircuit/math-utils": {
"optional": true
}
Comment on lines +24 to +36

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 👍 / 👎.

},
"dependencies": {}
}
Loading