From 26060348b74727053e29398b583bc7db420ab37e Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Wed, 3 Jun 2026 18:02:36 +0800 Subject: [PATCH] update contributing --- CONTRIBUTING.md | 25 ++++++++++++++++--------- script/getCommits.ts | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 9 deletions(-) create mode 100644 script/getCommits.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6d48806a..607c3380 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -90,7 +90,7 @@ Before releasing, consider [Maintainence chores](#maintainence-chores) first. - `git checkout master` - `git merge stores` (in case there's an old unmerged stores hotfix) -- **Manually prepare release notes** from [commit history](https://github.com/mifi/lossless-cut/commits/master/) since last version. +- **Manually prepare release notes** from commit history (use `node script/getCommits.ts` to assist) - Create a new file `versions/x.y.z.md` and write the most important highlights from the release notes, but **remove github issue #references** - `node script/generateVersions.ts && git add versions/*.md src/renderer/src/versions.json && git commit -m 'Update change log'` - *If Store-only hotfix release* @@ -140,11 +140,7 @@ How to check the value: yarn pack-mas-dev cat dist/mas-dev-arm64/LosslessCut.app/Contents/Info.plist ``` - -```xml -LSMinimumSystemVersion -10.13 -``` +Look for the key `LSMinimumSystemVersion`. `LSMinimumSystemVersion` can be overridden in `electron-builder` by [`mac.minimumSystemVersion`](https://www.electron.build/configuration/mac.html) @@ -157,11 +153,22 @@ Links: ## Maintainence chores -### Keep dependencies up to date -- FFmpeg: [ffmpeg-build-script](https://github.com/mifi/ffmpeg-build-script), [ffmpeg-builds](https://github.com/mifi/ffmpeg-builds) and [package.json](./package.json) download scripts. +### Upgrade FFmpeg + +- [ffmpeg-build-script](https://github.com/mifi/ffmpeg-build-script) +- [ffmpeg-builds](https://github.com/mifi/ffmpeg-builds) +- [package.json](./package.json) download scripts. + +### Upgrade Electron + - `electron` and upgrade [electron.vite.config.ts](./electron.vite.config.ts) `target`s. - `@electron/remote` -- `package.json` / `yarn.lock` + +### Keep dependencies up to date + +```bash +yarn upgrade-interactive +``` ### i18n strings / Weblate diff --git a/script/getCommits.ts b/script/getCommits.ts new file mode 100644 index 00000000..7172e3c7 --- /dev/null +++ b/script/getCommits.ts @@ -0,0 +1,39 @@ +import { execa } from 'execa'; +import assert from 'node:assert'; +import { DateTime } from 'luxon'; + +// Find the most recent tag that starts with `v` (if any) +const ps1 = await execa('git', ['describe', '--tags', '--abbrev=0', '--match', 'v*']); +const tag = ps1.stdout.trim(); +assert(tag, 'Tag not found'); + +// Use record separator (RS) and field separator (FS) to split commits and fields reliably +const RS = '\u001E'; +const FS = '\u001F'; +const format = `%H${FS}%cI${FS}%an <%ae>${FS}%B${RS}`; + +const args = tag ? ['log', `${tag}..HEAD`, `--pretty=format:${format}`] : ['log', `--pretty=format:${format}`]; +const ps2 = await execa('git', args); +assert(ps2.stdout); + +const commits = ps2.stdout + .split(RS) + .map((s) => s.trim()) + .filter(Boolean) + .map((s) => { + const [hash, date, author, ...bodyParts] = s.split(FS); + assert(date); + const body = bodyParts.join(FS).trim(); + return { hash: hash?.trim(), date: date?.trim(), author: author?.trim(), message: body }; + }); + +const out = commits + .filter((c) => ( + !c.author?.startsWith('dependabot[bot] ') + && !c.message.startsWith('Translated using Weblate') + && !c.message.startsWith('Merge pull request') + )) + .map((c) => `https://github.com/mifi/lossless-cut/commit/${c.hash}\n${DateTime.fromISO(c.date).toISODate()} - ${c.author}\n\n${c.message}`) + .join('\n\n\n------\n'); + +console.log(out);