Skip to content

Commit

Permalink
[pigment-css] Make @pigment-css/react as peer dep
Browse files Browse the repository at this point in the history
This change helps in module resolution across different package
managers, especially pnpm, which expects the imports to be from direct
dependencies.
During sx prop transform, pigment-css plugin adds -

```js
import { sx } from '@pigment-css/react';
```

which would throw an error when using pnpm since @pigment-css/react was
not a direct dependency of the user's application.
  • Loading branch information
Brijesh Bittu committed Nov 22, 2024
1 parent a3c15aa commit 509cdaf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ First, install the Material UI wrapper package for Pigment CSS:
<codeblock storageKey="package-manager">

```bash npm
npm install @mui/material-pigment-css
npm install @mui/material-pigment-css @pigment-css/react
```

```bash pnpm
pnpm add @mui/material-pigment-css
pnpm add @mui/material-pigment-css @pigment-css/react
```

```bash yarn
yarn add @mui/material-pigment-css
yarn add @mui/material-pigment-css @pigment-css/react
```

</codeblock>
Expand Down
6 changes: 4 additions & 2 deletions packages/mui-material-pigment-css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@
},
"dependencies": {
"@babel/runtime": "^7.26.0",
"@mui/system": "workspace:*",
"@pigment-css/react": "0.0.27"
"@mui/system": "workspace:*"
},
"peerDependencies": {
"@pigment-css/react": "^0.0.27"
},
"sideEffects": false,
"publishConfig": {
Expand Down

0 comments on commit 509cdaf

Please sign in to comment.