This app is built using Electron. Make sure you have at least Node v16. The app uses ffmpeg from PATH when developing.
git clone https://github.com/mifi/lossless-cut.git
cd lossless-cut
yarn
yarn install-electronNote: yarn may take some time to complete.
Run one of the below commands:
yarn download-ffmpeg-darwin-x64
yarn download-ffmpeg-darwin-arm64
yarn download-ffmpeg-linux-x64
yarn download-ffmpeg-win32-x64
yarn download-ffmpeg-win32-arm64For Windows, you may have to install 7z, and then put the 7z folder in your PATH.
yarn devRun linting, code style, types, tests etc with the following command:
yarn checkMost of these checks are automatically run in GitHub Actions.
See package.json "scripts" section.
To contribute code, use pull requests. If you would like to contribute a lot of code, please first create an issue to check the viability of your change - the larger the PR you submit, the less likely that it will be merged.
This will sign using the development provisioning profile:
yarn pack-mas-devMAS builds have some restrictions, see isMasBuild variable in code. In particular, any file cannot be read without the user's consent.
NOTE: when MAS (dev) build, Application Support will instead be located here:
~/Library/Containers/no.mifi.losslesscut-mac/Data/Library/Application Support
rm -rf ~/Library/Containers/no.mifi.losslesscut-macWindows store version is built as a Desktop Bridge app (with runFullTrust capability). This means the app has access to essentially everything the user has access to, and even internetClient is redundant.
- https://learn.microsoft.com/en-us/windows/uwp/packaging/app-capability-declarations
- https://learn.microsoft.com/en-us/archive/blogs/appconsult/a-simpler-and-faster-way-to-publish-your-desktop-bridge-applications-on-the-microsoft-store
- https://stackoverflow.com/a/52921641/6519037
Before releasing, consider Maintainence chores first.
git checkout mastergit merge stores(in case there's an old unmerged stores hotfix)- Manually prepare release notes from commit history (use
node script/getCommits.tsto assist) - Create a new file
versions/x.y.z.mdand 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
git checkout storesnpm version patch
- If normal GitHub-first release
npm version minor && git --no-pager show
git push --follow-tags- Wait for build and draft in Github actions
- Open draft in github and add the prepared release notes
- If GitHub release
- Release the draft
- If Store-only hotfix release
- Remove all other artifacts and release the draft as pre-release
- If Stores-only hotfix release
git checkout mastergit merge stores
- Bump snap version
- Copy paste release notes and post to discord & twitter and re-tweet
git checkout stores- Find the tag just released in the Stores
- Merge this tag (from
master) intostores:git merge vX.Y.Z git pushgit checkout master
For per-platform build/signing setup, see this article.
Apple sends an email when certificates are about to expire. Follow the "Certificate creation/renewal" section of the article above. LosslessCut specifics:
- The Development provisioning profile is kept in the project root as
LosslessCut_Dev.provisionprofile(gitignored) — replace it with the newly downloaded one, for use withyarn pack-mas-dev.
See requirements.
MacOS LSMinimumSystemVersion
How to check the value:
yarn pack-mas-dev
cat dist/mas-dev-arm64/LosslessCut.app/Contents/Info.plistLook for the key LSMinimumSystemVersion.
LSMinimumSystemVersion can be overridden in electron-builder by mac.minimumSystemVersion
See also MACOSX_DEPLOYMENT_TARGET in ffmpeg-build-script.
Links:
- https://support.google.com/chrome/a/answer/7100626
- https://bignerdranch.com/blog/requiring-a-minimum-version-of-os-x-for-your-application/
- #1386
- ffmpeg-build-script
- ffmpeg-builds
- package.json download scripts.
electronand upgrade electron.vite.config.tstargets.@electron/remote
yarn upgrade-interactiveInstall scripts are disabled by default (enableScripts: false in .yarnrc.yml), so a
compromised dependency cannot run code just by being installed. No package currently needs an
exception.
Installs print YN0004: <package> lists build scripts, but all build scripts have been disabled for packages whose scripts were skipped. That warning is not by itself a problem —
most install scripts in modern packages are no-ops that only matter when a prebuilt native
binary is missing, and some are explicitly skipped under Yarn anyway. Before granting an
exception, read the script and check whether the package actually works without it.
If it genuinely needs to build, opt that one package in:
"dependenciesMeta": {
"<package>": { "built": true }
}Prefer verifying over granting: a package that silently fails to build usually surfaces as a
confusing runtime error, but a blanket enableScripts: true gives every dependency in the
tree the right to execute code at install time.
Run yarn scan-i18n to get the newest English strings and push so Weblate gets them.
Find the latest PR from Weblate and rebase+merge it.
Warning: Do not squash and merge (see here why)!
yarn generate-licenses
#cp licenses.txt losslesscut.mifi.no/public/Then deploy.
https://github.com/mifi/lossless-cut/security/dependabot
- https://github.com/BtbN/FFmpeg-Builds
- https://www.gyan.dev/ffmpeg/builds/
- https://github.com/m-ab-s/media-autobuild_suite
- Update
copyrightYearvariable and package.jsoncopyright