(block: DependencyBlock | undefined)
| 117 | const isInternalScope = (key: string): boolean => key.startsWith(`${PACKAGE_SCOPE}/`); |
| 118 | |
| 119 | const renameDepBlock = (block: DependencyBlock | undefined): DependencyBlock | undefined => { |
| 120 | if (!block) return block; |
| 121 | const next: DependencyBlock = {}; |
| 122 | let mutated = false; |
| 123 | for (const [key, value] of Object.entries(block)) { |
| 124 | if (publishable.has(key) && value.startsWith("workspace:")) { |
| 125 | next[key] = publishableVersions.get(key) ?? value; |
| 126 | mutated = true; |
| 127 | } else if (isInternalScope(key) && !publishable.has(key)) { |
| 128 | // Workspace-only `@executor-js/*` regular dep that we don't |
| 129 | // publish (e.g. `@executor-js/api`). Strip it: it's not in the |
| 130 | // shipped runtime entries (those imports live in |
| 131 | // `src/api/*` / `src/react/*` which don't make it into the |
| 132 | // packed dist), and leaving it in would 404 at install time. |
| 133 | mutated = true; |
| 134 | } else { |
| 135 | next[key] = value; |
| 136 | } |
| 137 | } |
| 138 | return mutated ? next : block; |
| 139 | }; |
| 140 | |
| 141 | /** |
| 142 | * Peer-deps variant of `renameDepBlock`: resolve workspace specifiers for |
no test coverage detected