Skip to content

Commit

Permalink
feat: add pnpm function in binaries (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh3112 authored Jun 27, 2023
1 parent b744694 commit 60c8db7
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,16 @@
"bug",
"code"
]
},
{
"login": "rishabh3112",
"name": "Rishabh Chawla",
"avatar_url": "https://avatars.githubusercontent.com/u/15812317?v=4",
"profile": "https://rishabhchawla.co",
"contributions": [
"bug",
"code"
]
}
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</p>

[![CircleCI](https://circleci.com/gh/tabrindle/envinfo/tree/master.svg?style=svg)](https://circleci.com/gh/tabrindle/envinfo/tree/master) [![Build Status](https://travis-ci.org/tabrindle/envinfo.svg?branch=master)](https://travis-ci.org/tabrindle/envinfo) [![npm version](https://badge.fury.io/js/envinfo.svg)](https://badge.fury.io/js/envinfo) [![npm downloads per month](https://img.shields.io/npm/dm/envinfo.svg?maxAge=86400)](https://www.npmjs.com/package/envinfo) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![All Contributors](https://img.shields.io/badge/all_contributors-10-orange.svg?style=flat-square)](#contributors)
[![All Contributors](https://img.shields.io/badge/all_contributors-11-orange.svg?style=flat-square)](#contributors)

## The problem

Expand Down Expand Up @@ -279,7 +279,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
<!-- prettier-ignore -->
| [<img src="https://avatars1.githubusercontent.com/u/2925048?v=4" width="100px;"/><br /><sub><b>Trevor Brindle</b></sub>](http://trevorbrindle.com)<br />[💬](#question-tabrindle "Answering Questions") [📝](#blog-tabrindle "Blogposts") [🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Atabrindle "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=tabrindle "Code") [📖](https://github.com/tabrindle/envinfo/commits?author=tabrindle "Documentation") [💡](#example-tabrindle "Examples") [🤔](#ideas-tabrindle "Ideas, Planning, & Feedback") [👀](#review-tabrindle "Reviewed Pull Requests") [📢](#talk-tabrindle "Talks") [⚠️](https://github.com/tabrindle/envinfo/commits?author=tabrindle "Tests") | [<img src="https://avatars0.githubusercontent.com/u/997157?v=4" width="100px;"/><br /><sub><b>Gant Laborde</b></sub>](http://gantlaborde.com/)<br />[📝](#blog-GantMan "Blogposts") [🐛](https://github.com/tabrindle/envinfo/issues?q=author%3AGantMan "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=GantMan "Code") [🤔](#ideas-GantMan "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/599352?v=4" width="100px;"/><br /><sub><b>Anton Fisher</b></sub>](http://antonfisher.com)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Aantonfisher "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=antonfisher "Code") | [<img src="https://avatars1.githubusercontent.com/u/960133?v=4" width="100px;"/><br /><sub><b>Ahmad Awais ⚡️</b></sub>](https://AhmadAwais.com/)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Aahmadawais "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=ahmadawais "Code") | [<img src="https://avatars2.githubusercontent.com/u/9251453?v=4" width="100px;"/><br /><sub><b>Hasan</b></sub>](https://github.com/LEQADA)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3ALEQADA "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=LEQADA "Code") | [<img src="https://avatars3.githubusercontent.com/u/1232725?v=4" width="100px;"/><br /><sub><b>Ernesto Ramírez</b></sub>](http://twitter.com/_ErnestoR)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3AErnestoR "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=ErnestoR "Code") | [<img src="https://avatars1.githubusercontent.com/u/3759816?v=4" width="100px;"/><br /><sub><b>Jiawen Geng</b></sub>](https://www.gengjiawen.com)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Agengjiawen "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=gengjiawen "Code") [🤔](#ideas-gengjiawen "Ideas, Planning, & Feedback") [⚠️](https://github.com/tabrindle/envinfo/commits?author=gengjiawen "Tests") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars3.githubusercontent.com/u/12520493?v=4" width="100px;"/><br /><sub><b>Zac Anger</b></sub>](https://zacanger.com)<br />[💻](https://github.com/tabrindle/envinfo/commits?author=zacanger "Code") [🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Azacanger "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/497214?v=4" width="100px;"/><br /><sub><b>Ville Immonen</b></sub>](https://twitter.com/VilleImmonen)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Afson "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=fson "Code") | [<img src="https://avatars2.githubusercontent.com/u/27246?v=4" width="100px;"/><br /><sub><b>Olmo Maldonado</b></sub>](http://ibolmo.com)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Aibolmo "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=ibolmo "Code") |
| [<img src="https://avatars3.githubusercontent.com/u/12520493?v=4" width="100px;"/><br /><sub><b>Zac Anger</b></sub>](https://zacanger.com)<br />[💻](https://github.com/tabrindle/envinfo/commits?author=zacanger "Code") [🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Azacanger "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/497214?v=4" width="100px;"/><br /><sub><b>Ville Immonen</b></sub>](https://twitter.com/VilleImmonen)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Afson "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=fson "Code") | [<img src="https://avatars2.githubusercontent.com/u/27246?v=4" width="100px;"/><br /><sub><b>Olmo Maldonado</b></sub>](http://ibolmo.com)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Aibolmo "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=ibolmo "Code") | [<img src="https://avatars.githubusercontent.com/u/15812317?v=4" width="100px;"/><br /><sub><b>Rishabh Chawla</b></sub>](https://rishabhchawla.co)<br />[🐛](https://github.com/tabrindle/envinfo/issues?q=author%3Arishabh3112 "Bug reports") [💻](https://github.com/tabrindle/envinfo/commits?author=rishabh3112 "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
2 changes: 2 additions & 0 deletions __tests__/__snapshots__/envinfo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ exports[`Running the cli interface returns expected formatted yaml value 1`] = `
Node: 10.0.0 - /usr/local/bin/node
Yarn: 10.0.0 - /usr/local/bin/yarn
npm: 10.0.0 - /usr/local/bin/npm
pnpm: 10.0.0 - /usr/local/bin/pnpm
Watchman: 10.0.0 - /usr/local/bin/watchman
"
`;
Expand All @@ -16,6 +17,7 @@ exports[`Running the cli interface returns expected unformatted yaml value 1`] =
Node: 10.0.0 - /usr/local/bin/node
Yarn: 10.0.0 - /usr/local/bin/yarn
npm: 10.0.0 - /usr/local/bin/npm
pnpm: 10.0.0 - /usr/local/bin/pnpm
Watchman: 10.0.0 - /usr/local/bin/watchman
"
`;
Expand Down
8 changes: 8 additions & 0 deletions src/helpers/binaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,12 @@ module.exports = {
utils.which('yarn').then(utils.condensePath),
]).then(v => utils.determineFound('Yarn', v[0], v[1]));
},

getpnpmInfo: () => {
utils.log('trace', 'getpnpmInfo');
return Promise.all([
utils.run('pnpm -v'),
utils.which('pnpm').then(utils.condensePath),
]).then(v => utils.determineFound('pnpm', v[0], v[1]));
},
};
22 changes: 11 additions & 11 deletions src/presets.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
defaults: {
System: ['OS', 'CPU', 'Memory', 'Container', 'Shell'],
Binaries: ['Node', 'Yarn', 'npm', 'Watchman'],
Binaries: ['Node', 'Yarn', 'npm', 'pnpm', 'Watchman'],
Managers: [
'Apt',
'Cargo',
Expand Down Expand Up @@ -82,37 +82,37 @@ module.exports = {
},
jest: {
System: ['OS', 'CPU'],
Binaries: ['Node', 'Yarn', 'npm'],
Binaries: ['Node', 'Yarn', 'npm', 'pnpm'],
npmPackages: ['jest'],
},
'react-native': {
System: ['OS', 'CPU'],
Binaries: ['Node', 'Yarn', 'npm', 'Watchman'],
Binaries: ['Node', 'Yarn', 'npm', 'pnpm', 'Watchman'],
SDKs: ['iOS SDK', 'Android SDK', 'Windows SDK'],
IDEs: ['Android Studio', 'Xcode', 'Visual Studio'],
npmPackages: ['react', 'react-native'],
npmGlobalPackages: ['react-native-cli'],
},
nyc: {
System: ['OS', 'CPU', 'Memory'],
Binaries: ['Node', 'Yarn', 'npm'],
Binaries: ['Node', 'Yarn', 'npm', 'pnpm'],
npmPackages: '/**/{*babel*,@babel/*/,*istanbul*,nyc,source-map-support,typescript,ts-node}',
},
webpack: {
System: ['OS', 'CPU'],
Binaries: ['Node', 'Yarn', 'npm'],
Binaries: ['Node', 'Yarn', 'npm', 'pnpm'],
npmPackages: '*webpack*',
npmGlobalPackages: ['webpack', 'webpack-cli'],
},
'styled-components': {
System: ['OS', 'CPU'],
Binaries: ['Node', 'Yarn', 'npm'],
Binaries: ['Node', 'Yarn', 'npm', 'pnpm'],
Browsers: ['Chrome', 'Firefox', 'Safari'],
npmPackages: '*styled-components*',
},
'create-react-app': {
System: ['OS', 'CPU'],
Binaries: ['Node', 'npm', 'Yarn'],
Binaries: ['Node', 'npm', 'Yarn', 'pnpm'],
Browsers: ['Chrome', 'Edge', 'Internet Explorer', 'Firefox', 'Safari'],
npmPackages: ['react', 'react-dom', 'react-scripts'],
npmGlobalPackages: ['create-react-app'],
Expand All @@ -123,14 +123,14 @@ module.exports = {
},
apollo: {
System: ['OS'],
Binaries: ['Node', 'npm', 'Yarn'],
Binaries: ['Node', 'npm', 'Yarn', 'pnpm'],
Browsers: ['Chrome', 'Edge', 'Firefox', 'Safari'],
npmPackages: '{*apollo*,@apollo/*}',
npmGlobalPackages: '{*apollo*,@apollo/*}',
},
'react-native-web': {
System: ['OS', 'CPU'],
Binaries: ['Node', 'npm', 'Yarn'],
Binaries: ['Node', 'npm', 'Yarn', 'pnpm'],
Browsers: ['Chrome', 'Edge', 'Internet Explorer', 'Firefox', 'Safari'],
npmPackages: ['react', 'react-native-web'],
options: {
Expand All @@ -139,13 +139,13 @@ module.exports = {
},
babel: {
System: ['OS'],
Binaries: ['Node', 'npm', 'Yarn'],
Binaries: ['Node', 'npm', 'Yarn', 'pnpm'],
Monorepos: ['Yarn Workspaces', 'Lerna'],
npmPackages: '{*babel*,@babel/*,eslint,webpack,create-react-app,react-native,lerna,jest}',
},
playwright: {
System: ['OS', 'Memory', 'Container'],
Binaries: ['Node', 'Yarn', 'npm'],
Binaries: ['Node', 'Yarn', 'npm', 'pnpm'],
Languages: ['Bash'],
npmPackages: 'playwright*',
},
Expand Down

0 comments on commit 60c8db7

Please sign in to comment.