feat: electron build for mac
BIN
assets/images/logo-transparent.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
assets/images/logo.png
Normal file
After Width: | Height: | Size: 31 KiB |
@ -16,6 +16,7 @@
|
|||||||
"dev:web": "npm run dev --workspace=packages/bruno-app",
|
"dev:web": "npm run dev --workspace=packages/bruno-app",
|
||||||
"build:web": "npm run build --workspace=packages/bruno-app",
|
"build:web": "npm run build --workspace=packages/bruno-app",
|
||||||
"dev:electron": "npm run dev --workspace=packages/bruno-electron",
|
"dev:electron": "npm run dev --workspace=packages/bruno-electron",
|
||||||
"build:chrome-extension": "./scripts/create-chrome-extension.sh"
|
"build:chrome-extension": "./scripts/build-chrome-extension.sh",
|
||||||
|
"build:electron": "./scripts/build-electron.sh"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
3
packages/bruno-electron/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
web
|
||||||
|
out
|
@ -1 +0,0 @@
|
|||||||
{"type": "commonjs"}
|
|
24
packages/bruno-electron/electron-builder.yml
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
appId: com.usebruno.app
|
||||||
|
productName: Bruno
|
||||||
|
electronVersion: 21.1.1
|
||||||
|
directories:
|
||||||
|
buildResources: resources
|
||||||
|
output: out
|
||||||
|
files:
|
||||||
|
- "**/*"
|
||||||
|
mac:
|
||||||
|
artifactName: ${name}_${version}_${arch}_${os}.${ext}
|
||||||
|
category: public.app-category.developer-tools
|
||||||
|
target:
|
||||||
|
- target: dmg
|
||||||
|
arch:
|
||||||
|
- x64
|
||||||
|
- arm64
|
||||||
|
- target: zip
|
||||||
|
arch:
|
||||||
|
- x64
|
||||||
|
- arm64
|
||||||
|
icon: resources/icons/mac/icon.icns
|
||||||
|
hardenedRuntime: true
|
||||||
|
entitlements: resources/entitlements.mac.plist
|
||||||
|
entitlementsInherit: resources/entitlements.mac.plist
|
@ -1,24 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "@usebruno/bruno-electron",
|
"version": "0.1.0",
|
||||||
|
"name": "bruno",
|
||||||
|
"description": "Opensource API Client",
|
||||||
"private": true,
|
"private": true,
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
|
"author": "Anoop M D <anoop.md1421@gmail.com> (https://helloanoop.com/)",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "rimraf dist",
|
"clean": "rimraf dist",
|
||||||
"dev": "electron .",
|
"dev": "electron .",
|
||||||
"build": "next build renderer && next export renderer",
|
"dist": "electron-builder",
|
||||||
"pack-app": "npm run build && electron-builder --dir",
|
"pack-app": "electron-builder --dir"
|
||||||
"dist": "npm run build && electron-builder"
|
|
||||||
},
|
|
||||||
"build": {
|
|
||||||
"asar": true,
|
|
||||||
"files": [
|
|
||||||
"main",
|
|
||||||
"renderer/out"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.26.0",
|
"axios": "^0.26.0",
|
||||||
"chokidar": "^3.5.3",
|
"chokidar": "^3.5.3",
|
||||||
|
"dmg-license": "^1.0.11",
|
||||||
"electron-is-dev": "^2.0.0",
|
"electron-is-dev": "^2.0.0",
|
||||||
"electron-store": "^8.1.0",
|
"electron-store": "^8.1.0",
|
||||||
"electron-util": "^0.17.2",
|
"electron-util": "^0.17.2",
|
||||||
@ -29,7 +25,8 @@
|
|||||||
"nanoid": "3.3.4"
|
"nanoid": "3.3.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "^17.1.0",
|
"electron": "^21.1.1",
|
||||||
"electron-builder": "^22.14.13"
|
"electron-builder": "23.0.2",
|
||||||
|
"electron-icon-maker": "^0.0.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
packages/bruno-electron/resources/entitlements.mac.plist
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
BIN
packages/bruno-electron/resources/icons/mac/icon.icns
Normal file
BIN
packages/bruno-electron/resources/icons/png/1024x1024.png
Normal file
After Width: | Height: | Size: 214 KiB |
BIN
packages/bruno-electron/resources/icons/png/128x128.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
packages/bruno-electron/resources/icons/png/16x16.png
Normal file
After Width: | Height: | Size: 795 B |
BIN
packages/bruno-electron/resources/icons/png/24x24.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
packages/bruno-electron/resources/icons/png/256x256.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
packages/bruno-electron/resources/icons/png/32x32.png
Normal file
After Width: | Height: | Size: 1.9 KiB |
BIN
packages/bruno-electron/resources/icons/png/48x48.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
packages/bruno-electron/resources/icons/png/512x512.png
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
packages/bruno-electron/resources/icons/png/64x64.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
BIN
packages/bruno-electron/resources/icons/win/icon.ico
Normal file
After Width: | Height: | Size: 353 KiB |
@ -1,6 +1,5 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const chokidar = require('chokidar');
|
const chokidar = require('chokidar');
|
||||||
const { hasJsonExtension } = require('../utils/filesystem');
|
const { hasJsonExtension } = require('../utils/filesystem');
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ setContentSecurityPolicy(`
|
|||||||
connect-src * 'unsafe-inline';
|
connect-src * 'unsafe-inline';
|
||||||
base-uri 'none';
|
base-uri 'none';
|
||||||
form-action 'none';
|
form-action 'none';
|
||||||
frame-ancestors 'none';
|
frame-ancestors ghbtns.com;
|
||||||
`);
|
`);
|
||||||
|
|
||||||
const menu = Menu.buildFromTemplate(menuTemplate);
|
const menu = Menu.buildFromTemplate(menuTemplate);
|
||||||
@ -42,7 +42,7 @@ app.on('ready', async () => {
|
|||||||
const url = isDev
|
const url = isDev
|
||||||
? 'http://localhost:3000'
|
? 'http://localhost:3000'
|
||||||
: format({
|
: format({
|
||||||
pathname: path.join(__dirname, '../packages/bruno-app/out/index.html'),
|
pathname: path.join(__dirname, '../web/index.html'),
|
||||||
protocol: 'file:',
|
protocol: 'file:',
|
||||||
slashes: true
|
slashes: true
|
||||||
});
|
});
|
||||||
|
22
scripts/build-electron.sh
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Remove out directory
|
||||||
|
rm -rf packages/bruno-electron/out
|
||||||
|
|
||||||
|
# Remove web directory
|
||||||
|
rm -rf packages/bruno-electron/web
|
||||||
|
|
||||||
|
# Create a new web directory
|
||||||
|
mkdir packages/bruno-electron/web
|
||||||
|
|
||||||
|
# Copy build
|
||||||
|
cp -r packages/bruno-app/out/* packages/bruno-electron/web
|
||||||
|
|
||||||
|
|
||||||
|
# Change paths in next
|
||||||
|
sed -i'' -e 's@/_next/@_next/@g' packages/bruno-electron/web/**.html
|
||||||
|
|
||||||
|
# Remove sourcemaps
|
||||||
|
find packages/bruno-electron/web -name '*.map' -type f -delete
|
||||||
|
|
||||||
|
npm run pack-app --workspace=packages/bruno-electron
|