Merge pull request #1 from unprolix/feat/linux-support
feat(linux): native window frame and pacman packaging
This commit is contained in:
commit
15e80406fa
4 changed files with 856 additions and 30 deletions
50
.github/workflows/release.yml
vendored
50
.github/workflows/release.yml
vendored
|
|
@ -153,3 +153,53 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: pnpm dist:win
|
run: pnpm dist:win
|
||||||
|
|
||||||
|
release-linux:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download dist artifact
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
|
||||||
|
- name: Setup pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
cache: pnpm
|
||||||
|
|
||||||
|
- name: Setup Python for node-gyp
|
||||||
|
uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --no-frozen-lockfile
|
||||||
|
|
||||||
|
- name: Set version from tag
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
run: |
|
||||||
|
VERSION="${GITHUB_REF#refs/tags/v}"
|
||||||
|
pnpm pkg set version="$VERSION"
|
||||||
|
|
||||||
|
- name: Build app (Linux)
|
||||||
|
run: pnpm build
|
||||||
|
|
||||||
|
- name: Verify packaged inputs (Linux)
|
||||||
|
run: |
|
||||||
|
test -f dist-electron/main/index.cjs
|
||||||
|
test -f dist-electron/preload/index.js
|
||||||
|
test -f out/renderer/index.html
|
||||||
|
|
||||||
|
- name: Package & Release (Linux)
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: pnpm dist:linux
|
||||||
|
|
|
||||||
10
package.json
10
package.json
|
|
@ -17,9 +17,10 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "electron-vite dev",
|
"dev": "electron-vite dev",
|
||||||
"build": "electron-vite build",
|
"build": "electron-vite build",
|
||||||
"dist": "electron-builder --mac --win",
|
"dist": "electron-builder --mac --win --linux",
|
||||||
"dist:mac": "electron-builder --mac --publish always",
|
"dist:mac": "electron-builder --mac --publish always",
|
||||||
"dist:win": "electron-builder --win --publish always",
|
"dist:win": "electron-builder --win --publish always",
|
||||||
|
"dist:linux": "electron-builder --linux --publish always",
|
||||||
"preview": "electron-vite preview",
|
"preview": "electron-vite preview",
|
||||||
"typecheck": "tsc --noEmit",
|
"typecheck": "tsc --noEmit",
|
||||||
"lint": "eslint src/",
|
"lint": "eslint src/",
|
||||||
|
|
@ -150,6 +151,13 @@
|
||||||
],
|
],
|
||||||
"icon": "resources/icons/win/icon.ico"
|
"icon": "resources/icons/win/icon.ico"
|
||||||
},
|
},
|
||||||
|
"linux": {
|
||||||
|
"target": [
|
||||||
|
"pacman"
|
||||||
|
],
|
||||||
|
"icon": "resources/icons/png",
|
||||||
|
"category": "Development"
|
||||||
|
},
|
||||||
"nsis": {
|
"nsis": {
|
||||||
"oneClick": false,
|
"oneClick": false,
|
||||||
"perMachine": false,
|
"perMachine": false,
|
||||||
|
|
|
||||||
818
pnpm-lock.yaml
818
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -28,7 +28,10 @@ const getWindowIconPath = (): string | undefined => {
|
||||||
const isDev = process.env.NODE_ENV === 'development';
|
const isDev = process.env.NODE_ENV === 'development';
|
||||||
const candidates = isDev
|
const candidates = isDev
|
||||||
? [join(process.cwd(), 'resources/icon.png')]
|
? [join(process.cwd(), 'resources/icon.png')]
|
||||||
: [join(process.resourcesPath, 'resources/icon.png'), join(__dirname, '../../resources/icon.png')];
|
: [
|
||||||
|
join(process.resourcesPath, 'resources/icon.png'),
|
||||||
|
join(__dirname, '../../resources/icon.png'),
|
||||||
|
];
|
||||||
|
|
||||||
for (const candidate of candidates) {
|
for (const candidate of candidates) {
|
||||||
if (existsSync(candidate)) {
|
if (existsSync(candidate)) {
|
||||||
|
|
@ -363,6 +366,7 @@ function syncTrafficLightPosition(win: BrowserWindow): void {
|
||||||
*/
|
*/
|
||||||
function createWindow(): void {
|
function createWindow(): void {
|
||||||
const isMac = process.platform === 'darwin';
|
const isMac = process.platform === 'darwin';
|
||||||
|
const isLinux = process.platform === 'linux';
|
||||||
const iconPath = isMac ? undefined : getWindowIconPath();
|
const iconPath = isMac ? undefined : getWindowIconPath();
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: DEFAULT_WINDOW_WIDTH,
|
width: DEFAULT_WINDOW_WIDTH,
|
||||||
|
|
@ -374,7 +378,7 @@ function createWindow(): void {
|
||||||
contextIsolation: true,
|
contextIsolation: true,
|
||||||
},
|
},
|
||||||
backgroundColor: '#1a1a1a',
|
backgroundColor: '#1a1a1a',
|
||||||
titleBarStyle: 'hidden',
|
...(isLinux ? {} : { titleBarStyle: 'hidden' as const }),
|
||||||
...(isMac && { trafficLightPosition: getTrafficLightPositionForZoom(1) }),
|
...(isMac && { trafficLightPosition: getTrafficLightPositionForZoom(1) }),
|
||||||
title: 'claude-devtools',
|
title: 'claude-devtools',
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue