dhoulb / multi-semantic-release

Proof of concept that wraps semantic-release to work with monorepos.
BSD Zero Clause License
203 stars 36 forks source link

fix(getPackagePaths): avoid files like ng-package.json #100

Closed Badisi closed 2 years ago

Badisi commented 2 years ago

I have an issue where not only package.json files are returned but also ng-package.json files. Those are valid configuration files used by ng-packgr.

This PR fixes this by making sure the filename (and not the end of the file path) matches 'package.json'.

antongolub commented 2 years ago

Hey @Badisi,

Nice catch. But let's simplify a bit: filter(/\/package\.json$/.test)

Badisi commented 2 years ago

But it won't work for a package.json at the root of the workspace

'/path/to/package.json' -> OK
'/path/to/package2.json' -> KO
'/path/to/test-package.json' -> KO
'package.json' -> KO (should work here)
'/package.json' -> OK
'./package.json' -> OK
antongolub commented 2 years ago

Glob returns absolute paths here, so this should not be a problem.

Badisi commented 2 years ago

Done

antongolub commented 2 years ago

lgtm. Thanks for the contribution.

antongolub commented 2 years ago

:tada: This PR is included in version 2.11.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: