MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / renamePeerDepBlock

Function renamePeerDepBlock

scripts/publish-packages.ts:151–171  ·  view source on GitHub ↗
(block: DependencyBlock | undefined)

Source from the content-addressed store, hash-verified

149 * unchanged.
150 */
151 const renamePeerDepBlock = (block: DependencyBlock | undefined): DependencyBlock | undefined => {
152 if (!block) return block;
153 const next: DependencyBlock = {};
154 let mutated = false;
155 for (const [key, value] of Object.entries(block)) {
156 if (publishable.has(key)) {
157 next[key] = value.startsWith("workspace:")
158 ? (publishableVersions.get(key) ?? value)
159 : value;
160 if (next[key] !== value) mutated = true;
161 } else if (isInternalScope(key)) {
162 // Workspace-only `@executor-js/*` peer that we don't publish —
163 // strip it so the packed tarball doesn't reference an
164 // npm package that doesn't exist.
165 mutated = true;
166 } else {
167 next[key] = value;
168 }
169 }
170 return mutated ? next : block;
171 };
172
173 /**
174 * Strips `peerDependenciesMeta` entries that target an

Callers 1

applyWorkspaceVersionsFunction · 0.85

Calls 2

isInternalScopeFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected