Skip to content

Commit 6189be6

Browse files
authored
Merge pull request #32 from unisonweb/electron
Migrate from Tauri to Electron
2 parents 4e7cd18 + b3abcf6 commit 6189be6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+10488
-8148
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- release
88

99
jobs:
10-
publish-tauri:
10+
publish-electron:
1111
permissions:
1212
contents: write
1313
strategy:
@@ -40,17 +40,6 @@ jobs:
4040
node-version: lts/*
4141
cache: 'npm'
4242

43-
- name: Install Rust stable
44-
uses: dtolnay/rust-toolchain@stable # Set this to dtolnay/rust-toolchain@nightly
45-
with:
46-
# Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds.
47-
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
48-
49-
- name: Rust cache
50-
uses: swatinem/rust-cache@v2
51-
with:
52-
workspaces: './src-tauri -> target'
53-
5443
- name: Install FrontEnd dependencies
5544
run: npm install
5645

@@ -77,7 +66,7 @@ jobs:
7766
echo "CERT_ID=$CERT_ID" >> $GITHUB_ENV
7867
echo "Certificate imported."
7968
80-
- uses: tauri-apps/tauri-action@v0
69+
- name: package
8170
env:
8271
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8372
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
@@ -93,3 +82,4 @@ jobs:
9382
releaseDraft: true
9483
prerelease: false
9584
args: ${{ matrix.args }}
85+
run: npm run package

.gitignore

Lines changed: 97 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,98 @@
1-
elm-stuff
2-
repl-temp-*
3-
node_modules
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
417
.DS_Store
5-
.unisonHistory
6-
.jj
7-
target/
8-
dist
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# TypeScript v1 declaration files
40+
typings/
41+
42+
# TypeScript cache
43+
*.tsbuildinfo
44+
45+
# Optional npm cache directory
46+
.npm
47+
48+
# Optional eslint cache
49+
.eslintcache
50+
51+
# Optional REPL history
52+
.node_repl_history
53+
54+
# Output of 'npm pack'
55+
*.tgz
56+
57+
# Yarn Integrity file
58+
.yarn-integrity
59+
60+
# dotenv environment variables file
61+
.env
62+
.env.test
63+
64+
# parcel-bundler cache (https://parceljs.org/)
65+
.cache
66+
67+
# next.js build output
68+
.next
69+
70+
# nuxt.js build output
71+
.nuxt
72+
73+
# vuepress build output
74+
.vuepress/dist
75+
76+
# Serverless directories
77+
.serverless/
78+
79+
# FuseBox cache
80+
.fusebox/
81+
82+
# DynamoDB Local files
83+
.dynamodb/
84+
85+
# Webpack
86+
.webpack/
87+
88+
# Vite
89+
.vite/
90+
91+
# Electron-Forge
92+
out/
93+
94+
# Elm
95+
elm-stuff
96+
97+
# Unison
98+
.unison*

forge.config.js

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
2+
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
3+
4+
const API_URL = process.env.API_URL || "http://127.0.0.1:5858";
5+
6+
module.exports = {
7+
packagerConfig: {
8+
asar: true,
9+
icon: './icons/icon',
10+
osxSign: {},
11+
osxNotarize: {
12+
appleId: process.env.APPLE_ID,
13+
appleIdPassword: process.env.APPLE_PASSWORD,
14+
teamId: process.env.APPLE_TEAM_ID
15+
},
16+
},
17+
rebuildConfig: {},
18+
makers: [
19+
{
20+
name: '@electron-forge/maker-squirrel',
21+
config: {},
22+
},
23+
{
24+
name: '@electron-forge/maker-zip',
25+
platforms: ['darwin'],
26+
},
27+
{
28+
name: '@electron-forge/maker-deb',
29+
config: {},
30+
},
31+
{
32+
name: '@electron-forge/maker-rpm',
33+
config: {},
34+
},
35+
],
36+
plugins: [
37+
{
38+
name: '@electron-forge/plugin-auto-unpack-natives',
39+
config: {},
40+
},
41+
{
42+
name: '@electron-forge/plugin-webpack',
43+
config: {
44+
devServer: {
45+
proxy: {
46+
context: ['/codebase'],
47+
target: API_URL,
48+
logLevel: "debug",
49+
},
50+
},
51+
mainConfig: './webpack.main.config.js',
52+
renderer: {
53+
config: './webpack.renderer.config.js',
54+
entryPoints: [
55+
{
56+
html: './src/index.html',
57+
js: './src/renderer.js',
58+
name: 'main_window',
59+
preload: {
60+
js: './src/preload.js',
61+
},
62+
},
63+
],
64+
},
65+
},
66+
},
67+
// Fuses are used to enable/disable various Electron functionality
68+
// at package time, before code signing the application
69+
new FusesPlugin({
70+
version: FuseVersion.V1,
71+
[FuseV1Options.RunAsNode]: false,
72+
[FuseV1Options.EnableCookieEncryption]: true,
73+
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
74+
[FuseV1Options.EnableNodeCliInspectArguments]: false,
75+
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
76+
[FuseV1Options.OnlyLoadAppFromAsar]: true,
77+
}),
78+
],
79+
};
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)