-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make pnpm install less noisy (#3799)
- Loading branch information
Showing
6 changed files
with
18 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ module.exports = { | |
hooks: { | ||
readPackage, | ||
}, | ||
} | ||
}; | ||
|
||
/** | ||
* @typedef {object} Package | ||
|
@@ -28,96 +28,43 @@ module.exports = { | |
* @returns {Package} | ||
*/ | ||
function readPackage(pkg, context) { | ||
if (pkg.name === 'any-observable') { | ||
// Error: Cannot find any-observable implementation nor global.Observable. You must install polyfill or call require("any-observable/register") with your preferred implementation, e.g. require("any-observable/register")('rxjs') on application load prior to any require("any-observable"). | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
rxjs: '*', | ||
} | ||
context.log('any-observable implicitly depends on rxjs') | ||
} | ||
|
||
if (pkg.name === 'fetch-mock') { | ||
// Cannot find module 'node-fetch' from 'server.js' | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'node-fetch': '*', | ||
} | ||
context.log('fetch-mock implicitly depends on node-fetch') | ||
}; | ||
context.log('fetch-mock implicitly depends on node-fetch'); | ||
} | ||
|
||
if (pkg.name === 'react-idle-timer') { | ||
// Cannot find module 'prop-types' from 'index.min.js' | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'prop-types': '*', | ||
} | ||
context.log('react-idle-timer implicitly depends on prop-types') | ||
} | ||
|
||
if (pkg.name === 'styled-components') { | ||
// Cannot find module 'react-is' from '../../node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/styled-components/dist/styled-components.cjs.js' | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'react-is': '*', | ||
} | ||
context.log('styled-components implicitly depends on react-is') | ||
} | ||
|
||
if (pkg.name === '@votingworks/qrcode.react') { | ||
// JSX element class does not support attributes because it does not have a 'props' property. | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'@types/react': '*', | ||
} | ||
context.log('@votingworks/qrcode.react implicitly depends on @types/react') | ||
}; | ||
context.log('react-idle-timer implicitly depends on prop-types'); | ||
} | ||
|
||
if (pkg.name === 'react-idle-timer') { | ||
// JSX element class does not support attributes because it does not have a 'props' property. | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'@types/react': '*', | ||
} | ||
context.log('react-idle-timer implicitly depends on @types/react') | ||
}; | ||
context.log('react-idle-timer implicitly depends on @types/react'); | ||
} | ||
|
||
if (pkg.name === '@typescript-eslint/utils') { | ||
// Cannot find module '@typescript-eslint/parser' | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'@typescript-eslint/parser': '*', | ||
} | ||
context.log('eslint-module-utils requires the parser named in the eslint config, @typescript-eslint/parser') | ||
} | ||
|
||
if (pkg.name === 'jest-circus') { | ||
// Cannot find module 'prettier' | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'prettier': '*', | ||
} | ||
context.log('jest-circus requires prettier to format code for inline snapshots') | ||
} | ||
|
||
if (pkg.name === '@testing-library/user-event') { | ||
// Cannot find module '@testing-library/dom' | ||
pkg.dependencies = { | ||
...pkg.dependencies, | ||
'@testing-library/dom': '*', | ||
} | ||
context.log('@testing-library/user-event requires @testing-library/dom') | ||
} | ||
|
||
if (/^\^?4\.2\./.test(pkg.dependencies['graceful-fs'])) { | ||
// Object prototype may only be an Object or null: undefined | ||
// Caused by https://github.com/isaacs/node-graceful-fs/commit/c55c1b8cb32510f92bd33d7c833364ecd3964dea | ||
// | ||
// Also avoids the issue fixed by https://github.com/isaacs/node-graceful-fs/pull/220 | ||
// where jest thinks it cannot find `ts-jest`. | ||
pkg.dependencies['graceful-fs'] = '4.2.10' | ||
context.log(`${pkg.name}@${pkg.version} may use Object.setPrototypeOf with fs.read, which is undefined in the browser, which crashes`) | ||
}; | ||
context.log( | ||
'eslint-module-utils requires the parser named in the eslint config, @typescript-eslint/parser' | ||
); | ||
} | ||
|
||
return pkg | ||
return pkg; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.