|
| 1 | +/** |
| 2 | + * This configuration file provides settings specific to the PNPM package manager. |
| 3 | + * More documentation is available on the Rush website: https://rushjs.io |
| 4 | + */ |
| 5 | +{ |
| 6 | + "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/pnpm-config.schema.json", |
| 7 | + /** |
| 8 | + * If true, then `rush install` and `rush update` will use the PNPM workspaces feature |
| 9 | + * to perform the install, instead of the old model where Rush generated the symlinks |
| 10 | + * for each projects's node_modules folder. |
| 11 | + * |
| 12 | + * When using workspaces, Rush will generate a `common/temp/pnpm-workspace.yaml` file referencing |
| 13 | + * all local projects to install. Rush will also generate a `.pnpmfile.cjs` shim which implements |
| 14 | + * Rush-specific features such as preferred versions. The user's `common/config/rush/.pnpmfile.cjs` |
| 15 | + * is invoked by the shim. |
| 16 | + * |
| 17 | + * This option is strongly recommended. The default value is false. |
| 18 | + */ |
| 19 | + "useWorkspaces": false, |
| 20 | + /** |
| 21 | + * If true, then Rush will add the `--strict-peer-dependencies` command-line parameter when |
| 22 | + * invoking PNPM. This causes `rush update` to fail if there are unsatisfied peer dependencies, |
| 23 | + * which is an invalid state that can cause build failures or incompatible dependency versions. |
| 24 | + * (For historical reasons, JavaScript package managers generally do not treat this invalid |
| 25 | + * state as an error.) |
| 26 | + * |
| 27 | + * PNPM documentation: https://pnpm.io/npmrc#strict-peer-dependencies |
| 28 | + * |
| 29 | + * The default value is false to avoid legacy compatibility issues. |
| 30 | + * It is strongly recommended to set `strictPeerDependencies=true`. |
| 31 | + */ |
| 32 | + "strictPeerDependencies": true, |
| 33 | + /** |
| 34 | + * Environment variables that will be provided to PNPM. |
| 35 | + */ |
| 36 | + // "environmentVariables": { |
| 37 | + // "NODE_OPTIONS": { |
| 38 | + // "value": "--max-old-space-size=4096", |
| 39 | + // "override": false |
| 40 | + // } |
| 41 | + // }, |
| 42 | + /** |
| 43 | + * Specifies the location of the PNPM store. There are two possible values: |
| 44 | + * |
| 45 | + * - `local` - use the `pnpm-store` folder in the current configured temp folder: |
| 46 | + * `common/temp/pnpm-store` by default. |
| 47 | + * - `global` - use PNPM's global store, which has the benefit of being shared |
| 48 | + * across multiple repo folders, but the disadvantage of less isolation for builds |
| 49 | + * (for example, bugs or incompatibilities when two repos use different releases of PNPM) |
| 50 | + * |
| 51 | + * In both cases, the store path can be overridden by the environment variable `RUSH_PNPM_STORE_PATH`. |
| 52 | + * |
| 53 | + * The default value is `local`. |
| 54 | + */ |
| 55 | + // "pnpmStore": "global", |
| 56 | + /** |
| 57 | + * If true, then `rush install` will report an error if manual modifications |
| 58 | + * were made to the PNPM shrinkwrap file without running `rush update` afterwards. |
| 59 | + * |
| 60 | + * This feature protects against accidental inconsistencies that may be introduced |
| 61 | + * if the PNPM shrinkwrap file (`pnpm-lock.yaml`) is manually edited. When this |
| 62 | + * feature is enabled, `rush update` will append a hash to the file as a YAML comment, |
| 63 | + * and then `rush update` and `rush install` will validate the hash. Note that this |
| 64 | + * does not prohibit manual modifications, but merely requires `rush update` be run |
| 65 | + * afterwards, ensuring that PNPM can report or repair any potential inconsistencies. |
| 66 | + * |
| 67 | + * To temporarily disable this validation when invoking `rush install`, use the |
| 68 | + * `--bypass-policy` command-line parameter. |
| 69 | + * |
| 70 | + * The default value is false. |
| 71 | + */ |
| 72 | + // "preventManualShrinkwrapChanges": true, |
| 73 | + /** |
| 74 | + * The "globalOverrides" setting provides a simple mechanism for overriding version selections |
| 75 | + * for all dependencies of all projects in the monorepo workspace. The settings are copied |
| 76 | + * into the `pnpm.overrides` field of the `common/temp/package.json` file that is generated |
| 77 | + * by Rush during installation. |
| 78 | + * |
| 79 | + * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by |
| 80 | + * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`, |
| 81 | + * and `globalOverrides` has lowest precedence. |
| 82 | + * |
| 83 | + * PNPM documentation: https://pnpm.io/package_json#pnpmoverrides |
| 84 | + */ |
| 85 | + "globalOverrides": { |
| 86 | + // "example1": "^1.0.0", |
| 87 | + // "example2": "npm:@company/example2@^1.0.0" |
| 88 | + }, |
| 89 | + /** |
| 90 | + * The `globalPeerDependencyRules` setting provides various settings for suppressing validation errors |
| 91 | + * that are reported during installation with `strictPeerDependencies=true`. The settings are copied |
| 92 | + * into the `pnpm.peerDependencyRules` field of the `common/temp/package.json` file that is generated |
| 93 | + * by Rush during installation. |
| 94 | + * |
| 95 | + * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by |
| 96 | + * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`, |
| 97 | + * and `globalOverrides` has lowest precedence. |
| 98 | + * |
| 99 | + * https://pnpm.io/package_json#pnpmpeerdependencyrules |
| 100 | + */ |
| 101 | + "globalPeerDependencyRules": { |
| 102 | + // "ignoreMissing": ["@eslint/*"], |
| 103 | + // "allowedVersions": { "react": "17" }, |
| 104 | + "allowAny": [ |
| 105 | + "@types/node" |
| 106 | + ] |
| 107 | + }, |
| 108 | + /** |
| 109 | + * The `globalPackageExtension` setting provides a way to patch arbitrary package.json fields |
| 110 | + * for any PNPM dependency of the monorepo. The settings are copied into the `pnpm.packageExtensions` |
| 111 | + * field of the `common/temp/package.json` file that is generated by Rush during installation. |
| 112 | + * The `globalPackageExtension` setting has similar capabilities as `.pnpmfile.cjs` but without |
| 113 | + * the downsides of an executable script (nondeterminism, unreliable caching, performance concerns). |
| 114 | + * |
| 115 | + * Order of precedence: `.pnpmfile.cjs` has the highest precedence, followed by |
| 116 | + * `unsupportedPackageJsonSettings`, `globalPeerDependencyRules`, `globalPackageExtensions`, |
| 117 | + * and `globalOverrides` has lowest precedence. |
| 118 | + * |
| 119 | + * PNPM documentation: https://pnpm.io/package_json#pnpmpackageextensions |
| 120 | + */ |
| 121 | + "globalPackageExtensions": { |
| 122 | + // "fork-ts-checker-webpack-plugin": { |
| 123 | + // "dependencies": { |
| 124 | + // "@babel/core": "1" |
| 125 | + // }, |
| 126 | + // "peerDependencies": { |
| 127 | + // "eslint": ">= 6" |
| 128 | + // }, |
| 129 | + // "peerDependenciesMeta": { |
| 130 | + // "eslint": { |
| 131 | + // "optional": true |
| 132 | + // } |
| 133 | + // } |
| 134 | + // } |
| 135 | + }, |
| 136 | + /** |
| 137 | + * The `globalNeverBuiltDependencies` setting suppresses the `preinstall`, `install`, and `postinstall` |
| 138 | + * lifecycle events for the specified NPM dependencies. This is useful for scripts with poor practices |
| 139 | + * such as downloading large binaries without retries or attempting to invoke OS tools such as |
| 140 | + * a C++ compiler. (PNPM's terminology refers to these lifecycle events as "building" a package; |
| 141 | + * it has nothing to do with build system operations such as `rush build` or `rushx build`.) |
| 142 | + * The settings are copied into the `pnpm.neverBuiltDependencies` field of the `common/temp/package.json` |
| 143 | + * file that is generated by Rush during installation. |
| 144 | + * |
| 145 | + * PNPM documentation: https://pnpm.io/package_json#pnpmneverbuiltdependencies |
| 146 | + */ |
| 147 | + "globalNeverBuiltDependencies": [ |
| 148 | + // "fsevents" |
| 149 | + ], |
| 150 | + /** |
| 151 | + * The `globalAllowedDeprecatedVersions` setting suppresses installation warnings for package |
| 152 | + * versions that the NPM registry reports as being deprecated. This is useful if the |
| 153 | + * deprecated package is an indirect dependency of an external package that has not released a fix. |
| 154 | + * The settings are copied into the `pnpm.allowedDeprecatedVersions` field of the `common/temp/package.json` |
| 155 | + * file that is generated by Rush during installation. |
| 156 | + * |
| 157 | + * PNPM documentation: https://pnpm.io/package_json#pnpmalloweddeprecatedversions |
| 158 | + * |
| 159 | + * If you are working to eliminate a deprecated version, it's better to specify `allowedDeprecatedVersions` |
| 160 | + * in the package.json file for individual Rush projects. |
| 161 | + */ |
| 162 | + "globalAllowedDeprecatedVersions": { |
| 163 | + // "request": "*" |
| 164 | + }, |
| 165 | + /** |
| 166 | + * (THIS FIELD IS MACHINE GENERATED) The "globalPatchedDependencies" field is updated automatically |
| 167 | + * by the `rush-pnpm patch-commit` command. It is a dictionary, where the key is an NPM package name |
| 168 | + * and exact version, and the value is a relative path to the associated patch file. |
| 169 | + * |
| 170 | + * PNPM documentation: https://pnpm.io/package_json#pnpmpatcheddependencies |
| 171 | + */ |
| 172 | + "globalPatchedDependencies": {}, |
| 173 | + /** |
| 174 | + * (USE AT YOUR OWN RISK) This is a free-form property bag that will be copied into |
| 175 | + * the `common/temp/package.json` file that is generated by Rush during installation. |
| 176 | + * This provides a way to experiment with new PNPM features. These settings will override |
| 177 | + * any other Rush configuration associated with a given JSON field except for `.pnpmfile.cjs`. |
| 178 | + * |
| 179 | + * USAGE OF THIS SETTING IS NOT SUPPORTED BY THE RUSH MAINTAINERS AND MAY CAUSE RUSH |
| 180 | + * TO MALFUNCTION. If you encounter a missing PNPM setting that you believe should |
| 181 | + * be supported, please create a GitHub issue or PR. Note that Rush does not aim to |
| 182 | + * support every possible PNPM setting, but rather to promote a battle-tested installation |
| 183 | + * strategy that is known to provide a good experience for large teams with lots of projects. |
| 184 | + */ |
| 185 | + "unsupportedPackageJsonSettings": { |
| 186 | + // "dependencies": { |
| 187 | + // "not-a-good-practice": "*" |
| 188 | + // }, |
| 189 | + // "scripts": { |
| 190 | + // "do-something": "echo Also not a good practice" |
| 191 | + // }, |
| 192 | + // "pnpm": { "futurePnpmFeature": true } |
| 193 | + } |
| 194 | +} |
0 commit comments