Skip to content
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

perf(cli): abort generating changelog earlier #220

Merged
merged 2 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 14 additions & 16 deletions cli/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# @molt/cli

## Installation (optional)

The molt CLI can be installed globally with the following command, for example:
Expand Down Expand Up @@ -32,20 +30,20 @@ Description:

Options:

-h, --help - Show this help.
-v, --version - Print version info.
-w, --write - Write changes to the local files. (Conflicts: --commit)
-c, --commit - Commit changes to the local git repository. (Conflicts: --write)
--changelog [types] - Print a curated changelog for each update.
--config <file> - Specify the Deno configuration file.
--dry-run - See what would happen without actually doing it.
--ignore <pattern> - Specify dependencies to ignore.
--only <pattern> - Specify dependencies to check.
--lock <file> - Specify the lock file.
--no-config - Disable automatic loading of the configuration file.
--no-lock - Disable automatic loading of the lock file.
--pre-commit <tasks> - Run tasks before each commit (Depends: --commit)
--prefix <prefix> - Prefix for commit messages (Depends: --commit)
-h, --help - Show this help.
-v, --version - Print version info.
-w, --write - Write changes to the local files. (Conflicts: --commit)
-c, --commit - Commit changes to the local git repository. (Conflicts: --write)
--changelog [types] - Print commits for each update. (requires --unstable-kv)
--config <file> - Specify the Deno configuration file.
--dry-run - See what would happen without actually doing it.
--ignore <pattern> - Specify dependencies to ignore.
--only <pattern> - Specify dependencies to check.
--lock <file> - Specify the lock file.
--no-config - Disable automatic loading of the configuration file.
--no-lock - Disable automatic loading of the lock file.
--pre-commit <tasks> - Run tasks before each commit (Depends: --commit)
--prefix <prefix> - Prefix for commit messages (Depends: --commit)
--referrer - Print files that import the dependency.
```

Expand Down
2 changes: 1 addition & 1 deletion cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const main = new Command()
})
.option(
"--changelog=[types:string[]]",
"Print a curated changelog for each update.",
"Print commits for each update. (requires --unstable-kv)",
)
.option("--config <file:string>", "Specify the Deno configuration file.")
.option("--dry-run", "See what would happen without actually doing it.")
Expand Down
4 changes: 4 additions & 0 deletions cli/src/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ export async function printChangelog(
return;
}
const messages = await compareCommits(repo, oldest, to);
if (!messages.length) {
// Couldn't find tags for the versions
return;
}
const root = await resolvePackageRoot(repo, pkg, to);
if (!root) {
// The package seems to be generated dynamically on publish
Expand Down