-
-
Notifications
You must be signed in to change notification settings - Fork 811
Dont fail changeset status command if there are no changed packages
#504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
25d43da
d045ad3
1227594
d37fa45
9560e3a
fc54526
eb4f31a
5346bd0
7877be2
23afb73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@changesets/cli": minor | ||
| --- | ||
|
|
||
| `changeset status` command no longer errors when no packages have been changed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,8 @@ import chalk from "chalk"; | |
| import table from "tty-table"; | ||
| import fs from "fs-extra"; | ||
| import path from "path"; | ||
|
|
||
| import * as git from "@changesets/git"; | ||
| import getReleasePlan from "@changesets/get-release-plan"; | ||
| import { error, log, info, warn } from "@changesets/logger"; | ||
| import { | ||
|
|
@@ -32,16 +34,22 @@ export default async function getStatus( | |
| ); | ||
| warn("Use --since=master instead"); | ||
| } | ||
| const releasePlan = await getReleasePlan( | ||
| cwd, | ||
| since === undefined ? (sinceMaster ? "master" : undefined) : since, | ||
| config | ||
| ); | ||
|
|
||
| const sinceBranch = | ||
| since === undefined ? (sinceMaster ? "master" : undefined) : since; | ||
| const releasePlan = await getReleasePlan(cwd, sinceBranch, config); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering - do you happen to know why this doesn't account for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question! I took a look at the original PR that added it and couldn't figure out the intent here, so I decided to follow the same logic. Maybe @mitchellhamilton remembers? |
||
| const { changesets, releases } = releasePlan; | ||
| const changedPackages = await git.getChangedPackagesSinceRef({ | ||
| cwd, | ||
| ref: sinceBranch || config.baseBranch | ||
| }); | ||
|
|
||
| if (changesets.length < 1) { | ||
| error("No changesets present"); | ||
| if (changedPackages.length > 0 && changesets.length === 0) { | ||
| error( | ||
| "Some packages have been changed but no changesets were found. Run `changeset add` to resolve this error." | ||
| ); | ||
| error( | ||
| "If this change doesn't need a release, run `changeset add --empty`." | ||
| ); | ||
| process.exit(1); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.