mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-30 13:02:03 -04:00
16 lines
493 B
TypeScript
16 lines
493 B
TypeScript
import { type ProjectManifest, DEPENDENCIES_FIELDS } from '@pnpm/types'
|
|
|
|
export function deployHook (pkg: ProjectManifest): ProjectManifest {
|
|
pkg.dependenciesMeta = pkg.dependenciesMeta ?? {}
|
|
for (const depField of DEPENDENCIES_FIELDS) {
|
|
for (const [depName, depVersion] of Object.entries(pkg[depField] ?? {})) {
|
|
if ((depVersion as string).startsWith('workspace:')) {
|
|
pkg.dependenciesMeta[depName] = {
|
|
injected: true,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return pkg
|
|
}
|