(content: string, version: string)
| 165 | |
| 166 | /** Synchronizes the PNPM version and integrity in MODULE.bazel. */ |
| 167 | export async function syncPnpm(content: string, version: string): Promise<string> { |
| 168 | if (!semver.valid(version)) { |
| 169 | throw new Error(`Invalid PNPM version: ${version}`); |
| 170 | } |
| 171 | if (!PNPM_VERSION_REGEXP.test(content)) { |
| 172 | return content; |
| 173 | } |
| 174 | |
| 175 | Log.info(`Resolving integrity for pnpm@${version}...`); |
| 176 | const pnpmIntegrity = await getNpmPackageIntegrity('pnpm', version); |
| 177 | |
| 178 | return updateVersionAndIntegrity( |
| 179 | content, |
| 180 | version, |
| 181 | pnpmIntegrity, |
| 182 | PNPM_VERSION_REGEXP, |
| 183 | PNPM_INTEGRITY_REGEXP, |
| 184 | 'pnpm_version', |
| 185 | 'pnpm_version_integrity', |
| 186 | ); |
| 187 | } |
| 188 | |
| 189 | /** Synchronizes the TypeScript version and integrity in MODULE.bazel. */ |
| 190 | export async function syncTypeScript(content: string, version: string): Promise<string> { |
no test coverage detected