|
119 | 119 | */ |
120 | 120 | "preventManualShrinkwrapChanges": true, |
121 | 121 |
|
| 122 | + /** |
| 123 | + * When a project uses `workspace:` to depend on another Rush project, PNPM normally installs |
| 124 | + * it by creating a symlink under `node_modules`. This generally works well, but in certain |
| 125 | + * cases such as differing `peerDependencies` versions, symlinking may cause trouble |
| 126 | + * such as incorrectly satisfied versions. For such cases, the dependency can be declared |
| 127 | + * as "injected", causing PNPM to copy its built output into `node_modules` like a real |
| 128 | + * install from a registry. Details here: https://rushjs.io/pages/advanced/injected_deps/ |
| 129 | + * |
| 130 | + * When using Rush subspaces, these sorts of versioning problems are much more likely if |
| 131 | + * `workspace:` refers to a project from a different subspace. This is because the symlink |
| 132 | + * would point to a separate `node_modules` tree installed by a different PNPM lockfile. |
| 133 | + * A comprehensive solution is to enable `alwaysInjectDependenciesFromOtherSubspaces`, |
| 134 | + * which automatically treats all projects from other subspaces as injected dependencies |
| 135 | + * without having to manually configure them. |
| 136 | + * |
| 137 | + * NOTE: Use carefully -- excessive file copying can slow down the `rush install` and |
| 138 | + * `pnpm-sync` operations if too many dependencies become injected. |
| 139 | + * |
| 140 | + * The default value is false. |
| 141 | + */ |
| 142 | + // "alwaysInjectDependenciesFromOtherSubspaces": false, |
| 143 | + |
| 144 | + /** |
| 145 | + * Defines the policies to be checked for the `pnpm-lock.yaml` file. |
| 146 | + */ |
| 147 | + "pnpmLockfilePolicies": { |
| 148 | + /** |
| 149 | + * This policy will cause "rush update" to report an error if `pnpm-lock.yaml` contains |
| 150 | + * any SHA1 integrity hashes. |
| 151 | + * |
| 152 | + * For each NPM dependency, `pnpm-lock.yaml` normally stores an `integrity` hash. Although |
| 153 | + * its main purpose is to detect corrupted or truncated network requests, this hash can also |
| 154 | + * serve as a security fingerprint to protect against attacks that would substitute a |
| 155 | + * malicious tarball, for example if a misconfigured .npmrc caused a machine to accidentally |
| 156 | + * download a matching package name+version from npmjs.com instead of the private NPM registry. |
| 157 | + * NPM originally used a SHA1 hash; this was insecure because an attacker can too easily craft |
| 158 | + * a tarball with a matching fingerprint. For this reason, NPM later deprecated SHA1 and |
| 159 | + * instead adopted a cryptographically strong SHA512 hash. Nonetheless, SHA1 hashes can |
| 160 | + * occasionally reappear during "rush update", for example due to missing metadata fallbacks |
| 161 | + * (https://github.com/orgs/pnpm/discussions/6194) or an incompletely migrated private registry. |
| 162 | + * The `disallowInsecureSha1` policy prevents this, avoiding potential security/compliance alerts. |
| 163 | + */ |
| 164 | + // "disallowInsecureSha1": { |
| 165 | + // /** |
| 166 | + // * Enables the "disallowInsecureSha1" policy. The default value is false. |
| 167 | + // */ |
| 168 | + // "enabled": true, |
| 169 | + // |
| 170 | + // /** |
| 171 | + // * In rare cases, a private NPM registry may continue to serve SHA1 hashes for very old |
| 172 | + // * package versions, perhaps due to a caching issue or database migration glitch. To avoid |
| 173 | + // * having to disable the "disallowInsecureSha1" policy for the entire monorepo, the problematic |
| 174 | + // * package versions can be individually ignored. The "exemptPackageVersions" key is the |
| 175 | + // * package name, and the array value lists exact version numbers to be ignored. |
| 176 | + // */ |
| 177 | + // "exemptPackageVersions": { |
| 178 | + // "example1": ["1.0.0"], |
| 179 | + // "example2": ["2.0.0", "2.0.1"] |
| 180 | + // } |
| 181 | + // } |
| 182 | + }, |
| 183 | + |
122 | 184 | /** |
123 | 185 | * The "globalOverrides" setting provides a simple mechanism for overriding version selections |
124 | 186 | * for all dependencies of all projects in the monorepo workspace. The settings are copied |
|
0 commit comments