MCPcopy Create free account
hub / github.com/angular/dev-infra / syncPnpm

Function syncPnpm

ng-dev/misc/sync-module-bazel/sync-module-bazel.ts:167–187  ·  view source on GitHub ↗
(content: string, version: string)

Source from the content-addressed store, hash-verified

165
166/** Synchronizes the PNPM version and integrity in MODULE.bazel. */
167export 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. */
190export async function syncTypeScript(content: string, version: string): Promise<string> {

Callers 1

handlerFunction · 0.90

Calls 2

getNpmPackageIntegrityFunction · 0.85

Tested by

no test coverage detected