File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -245,15 +245,19 @@ function extractBumpTypes(
245245}
246246
247247/**
248- * Writes name-keyed bump types back to the packageKey-keyed bumps map.
248+ * Writes bump types back to the packageKey-keyed bumps map.
249+ * Keys can be either package names or packageKeys (path::ecosystem).
250+ * A packageKey matches exactly one package; a name may match multiple.
249251 */
250252function reapplyBumpTypes (
251253 bumps : Map < string , VersionBump > ,
252254 bumpTypes : Map < string , BumpType > ,
253255 packages : ResolvedPackageConfig [ ] ,
254256) : void {
255- for ( const [ name , bumpType ] of bumpTypes ) {
256- const matchingPkgs = packages . filter ( ( p ) => p . name === name ) ;
257+ for ( const [ key , bumpType ] of bumpTypes ) {
258+ const matchingPkgs = key . includes ( "::" )
259+ ? packages . filter ( ( p ) => packageKey ( p ) === key )
260+ : packages . filter ( ( p ) => p . name === key ) ;
257261 for ( const pkg of matchingPkgs ) {
258262 const pkgKey = packageKey ( pkg ) ;
259263 const existing = bumps . get ( pkgKey ) ;
Original file line number Diff line number Diff line change @@ -260,9 +260,7 @@ describe("registerAddCommand", () => {
260260 await parent . parseAsync ( [ "node" , "test" , "add" ] ) ;
261261
262262 const firstCall = mockEnquirerPrompt . mock . calls [ 0 ] [ 0 ] ;
263- expect ( firstCall . initial ) . toEqual (
264- packages . map ( ( pkg ) => `${ pkg . path } ::js` ) ,
265- ) ;
263+ expect ( firstCall . initial ) . toEqual ( packages . map ( ( pkg ) => `${ pkg . path } ::js` ) ) ;
266264 expect ( firstCall . choices ) . not . toContainEqual (
267265 expect . objectContaining ( { enabled : true } ) ,
268266 ) ;
You can’t perform that action at this time.
0 commit comments