-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
195 changed files
with
1,407 additions
and
1,004 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
/dist | ||
/vite-dist | ||
/out | ||
/ts-dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ node_modules | |
!.yarn/versions | ||
|
||
/dist | ||
/vite-dist | ||
/out | ||
/icon-build | ||
/build-resources | ||
/doc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"search.exclude": { | ||
"/public/locales/**": true, | ||
"/src/main/locales/**": true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'; | ||
import react from '@vitejs/plugin-react'; | ||
|
||
|
||
export default defineConfig({ | ||
main: { | ||
// https://electron-vite.org/guide/dev#dependencies-vs-devdependencies | ||
// For the main process and preload, the best practice is to externalize dependencies and only bundle our own code. | ||
// However, until we use ESM for electron main, we need to include ESM-only deps in the bundle: (exclude from externalize) | ||
plugins: [externalizeDepsPlugin({ exclude: ['p-map', 'execa', 'nanoid'] })], | ||
}, | ||
preload: { | ||
// https://electron-vite.org/guide/dev#dependencies-vs-devdependencies | ||
plugins: [externalizeDepsPlugin({ exclude: [] })], | ||
}, | ||
renderer: { | ||
plugins: [react()], | ||
build: { | ||
chunkSizeWarningLimit: 3e6, | ||
sourcemap: true, | ||
}, | ||
server: { | ||
port: 3001, | ||
host: '127.0.0.1', | ||
https: false, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// eslint-disable-line unicorn/filename-case | ||
import sharp from 'sharp'; | ||
import icongenRaw from 'icon-gen'; | ||
|
||
const icongen = icongenRaw as unknown as typeof icongenRaw['default']; | ||
|
||
const svg2png = (from: string, to: string, width: number, height: number) => sharp(from) | ||
.png() | ||
.resize(width, height, { | ||
fit: sharp.fit.contain, | ||
background: { r: 0, g: 0, b: 0, alpha: 0 }, | ||
}) | ||
.toFile(to); | ||
|
||
const srcIcon = 'src/renderer/src/icon.svg'; | ||
// Linux: | ||
await svg2png(srcIcon, './icon-build/app-512.png', 512, 512); | ||
|
||
// Windows Store | ||
await svg2png(srcIcon, './build-resources/appx/StoreLogo.png', 50, 50); | ||
await svg2png(srcIcon, './build-resources/appx/Square150x150Logo.png', 300, 300); | ||
await svg2png(srcIcon, './build-resources/appx/Square44x44Logo.png', 44, 44); | ||
await svg2png(srcIcon, './build-resources/appx/Wide310x150Logo.png', 620, 300); | ||
|
||
// MacOS: | ||
// https://github.com/mifi/lossless-cut/issues/1820 | ||
await icongen('./src/renderer/src/icon-mac.svg', './icon-build', { icns: { sizes: [512, 1024] }, report: false }); | ||
|
||
// Windows ICO: | ||
// https://github.com/mifi/lossless-cut/issues/778 | ||
// https://stackoverflow.com/questions/3236115/which-icon-sizes-should-my-windows-applications-icon-include | ||
await icongen(srcIcon, './icon-build', { ico: { sizes: [16, 24, 32, 40, 48, 64, 96, 128, 256, 512] }, report: false }); |
Oops, something went wrong.