File tree Expand file tree Collapse file tree
packages/autorest.testmodeler/src/core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ "use strict" ;
2+
3+ /**
4+ * When using the PNPM package manager, you can use pnpmfile.js to workaround
5+ * dependencies that have mistakes in their package.json file. (This feature is
6+ * functionally similar to Yarn's "resolutions".)
7+ *
8+ * For details, see the PNPM documentation:
9+ * https://pnpm.js.org/docs/en/hooks.html
10+ *
11+ * IMPORTANT: SINCE THIS FILE CONTAINS EXECUTABLE CODE, MODIFYING IT IS LIKELY TO INVALIDATE
12+ * ANY CACHED DEPENDENCY ANALYSIS. After any modification to pnpmfile.js, it's recommended to run
13+ * "rush update --full" so that PNPM will recalculate all version selections.
14+ */
15+ module . exports = {
16+ hooks : {
17+ readPackage,
18+ } ,
19+ } ;
20+
21+ const fixups = {
22+ braces : {
23+ applyTo : [ "micromatch" ] ,
24+ with : "3.0.2" ,
25+ }
26+ } ;
27+
28+ function readPackage ( packageJson , context ) {
29+ for ( const dep of Object . keys ( fixups ) ) {
30+ const to = fixups [ dep ] ;
31+ if ( to . applyTo . includes ( packageJson . name ) ) {
32+ context . log (
33+ `Fixed up dependencies for ${ packageJson . name } => ${ dep } :${ to . with } `
34+ ) ;
35+ packageJson . dependencies [ dep ] = to . with
36+ }
37+ }
38+
39+ return packageJson ;
40+ }
You can’t perform that action at this time.
0 commit comments