Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hasundue/molt
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.19.3
Choose a base ref
...
head repository: hasundue/molt
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.19.4
Choose a head ref
  • 6 commits
  • 7 files changed
  • 1 contributor

Commits on Aug 2, 2024

  1. Copy the full SHA
    de035e4 View commit details
  2. docs(cli): inform --changelog requires --unstable-kv

    hasundue committed Aug 2, 2024
    Copy the full SHA
    8cdf706 View commit details

Commits on Aug 3, 2024

  1. Copy the full SHA
    c9de647 View commit details
  2. Copy the full SHA
    eadd754 View commit details
  3. Copy the full SHA
    0f04fdc View commit details
  4. chore: release 0.19.4

    hasundue committed Aug 3, 2024
    Copy the full SHA
    e70a980 View commit details
Showing with 46 additions and 20 deletions.
  1. +3 −1 .github/workflows/update.yml
  2. +14 −16 cli/README.md
  3. +1 −1 cli/main.ts
  4. +4 −0 cli/src/changelog.ts
  5. +1 −1 integration/commits.ts
  6. +22 −0 integration/commits_test.ts
  7. +1 −1 integration/deno.json
4 changes: 3 additions & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -20,4 +20,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hasundue/molt-action@v1-rc
- uses: hasundue/molt-action@v1
with:
token: ${{ secrets.PAT_UPDATE }}
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:
@@ -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.
```

2 changes: 1 addition & 1 deletion cli/main.ts
Original file line number Diff line number Diff line change
@@ -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.")
4 changes: 4 additions & 0 deletions cli/src/changelog.ts
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion integration/commits.ts
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ export async function compareCommits(
if (!base || !head) {
return [];
}
const commits = await _compareCommits(repo, from, to);
const commits = await _compareCommits(repo, base, head);
await kv.set(
["commits", repo.owner, repo.name, from, to],
commits,
22 changes: 22 additions & 0 deletions integration/commits_test.ts
Original file line number Diff line number Diff line change
@@ -40,3 +40,25 @@ Deno.test("compareCommits - non existing tags", async () => {
[],
);
});

Deno.test("compareCommits - inconsistently prefixed tags", async () => {
assertEquals(
await compareCommits(
{
host: "github",
owner: "jsr-core",
name: "unknownutil",
},
"3.18.0",
"3.18.1",
),
[
":memo: Fix NPM README",
"Merge pull request #78 from jsr-core/fix-npm\n\n:memo: Fix NPM README",
":coffee: Refine deno tasks",
":memo: Add deprecation warning",
"Merge pull request #83 from jsr-core/deprecate\n" +
"\n" + ":memo: Add deprecation warning message",
],
);
});
2 changes: 1 addition & 1 deletion integration/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@molt/integration",
"version": "0.19.3",
"version": "0.19.4",
"exports": {
".": "./mod.ts",
"./commits": "./commits.ts",