Thinkmill / manypkg

☔️ An umbrella for your monorepo
MIT License
884 stars 48 forks source link

Add --default-branch cli switch for INCORRECT_REPOSITORY_FIELD check #67

Closed jesstelford closed 4 years ago

jesstelford commented 4 years ago

My repositories use main as the default branch, which causes manypkg check to incorrectly error with:

$ yarn manypkg check
...
☔️ error @example/button has a repository field of "https://github.com/example/repo/tree/main/button" when it should be "https://github.com/example/repo/tree/master/button"
error Command failed with exit code 1.

With this new cli swich, I can successfully execute:

$ yarn manypkg check --default-branch=main
...
✨  Done in 0.15s.
changeset-bot[bot] commented 4 years ago

🦋 Changeset is good to go

Latest commit: 6e71054a4fb8094702cfbdc700052fc234fa0388

We got this.

This PR includes changesets to release 1 package | Name | Type | | ------------ | ----- | | @manypkg/cli | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

jesstelford commented 4 years ago

Done - turned out fairly easy other than the TypeScript type trickery needed to add the options:

Add package.json#manypkg config object:

{
  "manypkg": {}
}

To support setting a default branch for the INCORRECT_REPOSITORY_FIELD check/fix, a new config option can be set:

{
  "manypkg": {
    "defaultBranch": "master"
  }
}

The default defaultBranch is "master".