1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-25 11:43:17 +01:00
lossless-cut/CONTRIBUTING.md

178 lines
4.7 KiB
Markdown
Raw Normal View History

# Contributing
## Development environment setup
2020-02-23 11:21:31 +01:00
2021-01-18 22:19:06 +01:00
This app is built using Electron.
Make sure you have at least Node v16. The app uses ffmpeg from PATH when developing.
2021-01-18 22:19:06 +01:00
```bash
2020-02-23 11:21:31 +01:00
git clone https://github.com/mifi/lossless-cut.git
cd lossless-cut
2020-05-06 08:06:06 +02:00
yarn
2020-02-23 11:21:31 +01:00
```
2021-01-18 22:19:06 +01:00
Note: `yarn` may take some time to complete.
2020-02-23 11:21:31 +01:00
2023-01-02 05:41:59 +01:00
### Installing `ffmpeg`
2022-04-15 06:58:55 +02:00
Run one of the below commands:
2021-07-25 06:48:15 +02:00
```bash
2024-02-20 15:48:40 +01:00
yarn download-ffmpeg-darwin-x64
yarn download-ffmpeg-darwin-arm64
yarn download-ffmpeg-linux-x64
yarn download-ffmpeg-win32-x64
2022-04-15 06:58:55 +02:00
```
2020-05-06 08:06:06 +02:00
2023-07-17 16:08:07 +02:00
For Windows, you may have to install [7z](https://www.7-zip.org/download.html), and then put the 7z folder in your `PATH`.
2023-05-18 21:36:33 +02:00
2022-04-15 06:58:55 +02:00
### Running
```bash
2024-02-20 15:48:40 +01:00
yarn dev
2020-02-23 11:21:31 +01:00
```
2024-02-12 16:18:23 +01:00
## `mas-dev` (Mac App Store) local build
2021-10-30 17:43:50 +02:00
This will sign using the development provisioning profile:
2024-08-06 23:00:03 +02:00
```bash
2024-02-20 15:48:40 +01:00
yarn pack-mas-dev
2021-10-30 17:43:50 +02:00
```
2023-02-16 16:22:27 +01:00
MAS builds have some restrictions, see `isMasBuild` variable in code. In particular, any file cannot be read without the user's consent.
2024-08-06 23:00:03 +02:00
NOTE: when MAS (dev) build, Application Support will instead be located here:
2023-02-16 16:22:27 +01:00
```
~/Library/Containers/no.mifi.losslesscut-mac/Data/Library/Application Support
```
### Starting over fresh
2024-08-06 23:00:03 +02:00
```bash
2023-02-16 16:22:27 +01:00
rm -rf ~/Library/Containers/no.mifi.losslesscut-mac
```
2024-01-05 11:27:40 +01:00
## Windows Store notes
2023-01-02 05:41:59 +01:00
Windows 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
## Releasing
2018-05-22 23:32:54 +02:00
2024-10-07 11:16:37 +02:00
### Build new version
- `git checkout master`
- `git merge stores` (in case there's an old unmerged stores hotfix)
- *If Store-only hotfix release*
- `git checkout stores`
- `npm version patch`
- *If normal GitHub-first release*
- `npm version minor`
2023-12-22 10:05:56 +01:00
- `git push --follow-tags`
- Wait for build and draft in Github actions
2024-10-07 11:16:37 +02:00
### Release built version
2023-04-08 16:51:52 +02:00
- Open draft in github and add Release notes
2024-10-07 12:25:07 +02:00
- Add prefix `-DO-NOT-DOWNLOAD` to `LosslessCut-mac-universal.pkg` and `LosslessCut-win-x64.appx`
2024-10-07 11:16:37 +02:00
- *If GitHub release*
- Release the draft
- *If Store-only hotfix release*
- Remove all other artifacts and release the draft as **pre-release**
2024-01-05 11:27:40 +01:00
2024-10-07 11:16:37 +02:00
#### After releasing on GitHub
2024-01-05 11:27:40 +01:00
2024-10-07 11:16:37 +02:00
- *If Stores-only hotfix release*
- `git checkout master`
- `git merge stores`
- Bump [snap version](https://snapcraft.io/losslesscut/releases)
### After releasing existing GitHub version in Stores
- `git checkout stores`
- Find the tag just released in the Stores
- Merge this tag (from `master`) into `stores`: `git merge vX.Y.Z`
- `git push`
- `git checkout master`
### More info
For per-platform build/signing setup, see [this article](https://mifi.no/blog/automated-electron-build-with-release-to-mac-app-store-microsoft-store-snapcraft/).
2024-10-07 10:58:36 +02:00
## Weblate
`yarn scan-i18n` to get the newest English strings and push so Weblate gets them.
Find the [latest PR](https://github.com/mifi/lossless-cut/pulls) from Weblate and **rebase+merge** it.
**Warning:** Do not squash and merge (see [here why](translation.md#weblate))!
2021-11-15 08:32:27 +01:00
2023-01-15 12:05:05 +01:00
## Minimum OS version
Minimum supported OS versions for Electron. As of electron 22:
- MacOS High Sierra 10.13
- Windows 10
### MacOS [`LSMinimumSystemVersion`](https://developer.apple.com/documentation/bundleresources/information_property_list/lsminimumsystemversion)
How to check the value:
```bash
2024-02-20 15:48:40 +01:00
yarn pack-mas-dev
2023-01-15 12:05:05 +01:00
cat dist/mas-dev-arm64/LosslessCut.app/Contents/Info.plist
```
2024-08-06 23:00:03 +02:00
```xml
2023-01-15 12:05:05 +01:00
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
```
`LSMinimumSystemVersion` can be overridden in `electron-builder` by [`mac.minimumSystemVersion`](https://www.electron.build/configuration/mac.html)
See also `MACOS_MIN` in [ffmpeg-build-script](https://github.com/mifi/ffmpeg-build-script/blob/master/build-ffmpeg).
Links:
- https://support.google.com/chrome/a/answer/7100626
- https://bignerdranch.com/blog/requiring-a-minimum-version-of-os-x-for-your-application/
- [#1386](https://github.com/mifi/lossless-cut/issues/1386)
2022-01-18 08:09:14 +01:00
## Maintainence chores
2021-11-15 08:32:27 +01:00
2022-01-18 08:09:14 +01:00
### Keep dependencies up to date
- ffmpeg
2024-08-06 21:06:50 +02:00
- `electron`, `@electron/remote` and upgrade [electron.vite.config.ts](./electron.vite.config.ts) `target`s.
- `package.json`
2022-01-18 08:09:14 +01:00
### i18n
2024-08-06 23:00:03 +02:00
```bash
yarn scan-i18n
```
2022-01-18 08:09:14 +01:00
### Generate license summary
2021-11-15 08:32:27 +01:00
2024-08-06 23:00:03 +02:00
```bash
2021-11-15 08:32:27 +01:00
npx license-checker --summary
```
### Regenerate licenses file
2021-11-15 08:32:27 +01:00
2024-08-06 23:00:03 +02:00
```bash
2024-02-20 15:48:40 +01:00
yarn generate-licenses
2023-01-15 10:38:27 +01:00
#cp licenses.txt losslesscut.mifi.no/public/
2021-11-15 08:32:27 +01:00
```
2022-01-18 08:09:14 +01:00
Then deploy.
### Dependabot
https://github.com/mifi/lossless-cut/security/dependabot
## ffmpeg builds
- https://github.com/BtbN/FFmpeg-Builds
- https://www.gyan.dev/ffmpeg/builds/
- https://github.com/m-ab-s/media-autobuild_suite