Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
#186 init electron ci build
Browse files Browse the repository at this point in the history
  • Loading branch information
neil authored and neil committed Feb 2, 2023
1 parent bc0e317 commit bf48a16
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 238 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ jobs:
key: ${{matrix.platform.name}}-pnpm-cargo
path: |
./pnpm
- name: build desktop installer
run: tea -ES xc build
build_tauri:
needs: changes
if: false
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,24 @@ pnpm install
### build
```sh
pnpm install
pnpm build:gui
pnpm build:desktop
```

### dev
```sh
pnpm install
pnpm dev
```

## Development
To develop the GUI within Tauri Webview
To develop the GUI within electron view
```
$ pnpm dev:gui
$ pnpm dev:desktop
```

To develop the GUI within your local browser at localhost:8080
```
$ pnpm web:gui
$ pnpm web:desktop
```

# Creating a release
Expand Down
3 changes: 2 additions & 1 deletion modules/desktop/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ node_modules
.env
.env.*
!.env.example
coverage/*
coverage/*
dist/*
4 changes: 3 additions & 1 deletion modules/desktop/electron-builder.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"asar": false,
"appId": "xyz.tea.gui",
"productName": "gui",
"asar": true,
"directories": { "output": "dist" },
"files": ["src/electron.cjs", { "from": "build", "to": "" }]
}
40 changes: 24 additions & 16 deletions modules/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"name": "@tea/desktop",
"version": "0.0.0",
"private": true,
"description": "tea gui app",
"author": "tea.xyz",
"main": "src/electron.cjs",
"scripts": {
"package": "pnpm build && electron-builder --config electron-builder.config.json",
"dev:package": "pnpm build && electron-builder --config electron-builder.config.json --dir",
"electron": "concurrently --kill-others \"vite dev\" \"electron src/electron.cjs\"",
"dev": "vite dev --port 8080",
"build": "vite build && cp build/app.html build/index.html",
"build": "vite build",
"preview": "vite preview",
"unit:test": "vitest",
"coverage": "vitest run --coverage",
Expand All @@ -18,27 +21,23 @@
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@sveltejs/adapter-node": "^1.0.0-next.101",
"@sveltejs/adapter-static": "^1.0.0-next.48",
"@sveltejs/kit": "^1.0.0-next.562",
"concurrently": "^6.5.1",
"electron": "^22.1.0",
"electron-builder": "^23.6.0",
"electron-reloader": "^1.2.3",
"sass": "^1.56.1",
"svelte": "^3.55.1",
"svelte-preprocess": "^5.0.1",
"vite": "^4.0.4",
"@playwright/experimental-ct-svelte": "^1.29.2",
"@playwright/test": "1.25.0",
"@sveltejs/adapter-auto": "^1.0.0",
"@sveltejs/adapter-node": "^1.0.0-next.101",
"@sveltejs/adapter-static": "^1.0.0-next.48",
"@sveltejs/kit": "^1.0.0-next.562",
"@tea/ui": "workspace:*",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "^3.2.2",
"@types/testing-library__jest-dom": "^5.14.5",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"autoprefixer": "^10.4.13",
"concurrently": "^6.5.1",
"electron": "^22.1.0",
"electron-builder": "^23.6.0",
"electron-reloader": "^1.2.3",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^4.0.0",
Expand All @@ -47,23 +46,27 @@
"prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.7.0",
"prettier-plugin-tailwindcss": "^0.2.0",
"svelte": "^3.55.1",
"svelte-check": "^2.8.0",
"svelte-preprocess": "^5.0.1",
"svelte2tsx": "^0.5.20",
"tailwindcss": "^3.2.4",
"tslib": "^2.3.1",
"typescript": "^4.7.4",
"vite": "^4.0.0",
"vitest": "^0.27.1"
},
"type": "module",
"dependencies": {
"electron-log": "^4.4.8",
"electron-serve": "^1.1.0",
"electron-window-state": "^5.0.3",
"@electron/asar": "^3.2.3",
"@types/bcryptjs": "^2.4.2",
"@types/url-join": "^4.0.1",
"@vitest/coverage-c8": "^0.27.1",
"bcryptjs": "^2.4.3",
"buffer": "^6.0.3",
"electron-log": "^4.4.8",
"electron-serve": "^1.1.0",
"electron-window-state": "^5.0.3",
"fuse.js": "^6.6.2",
"lodash": "^4.17.21",
"lorem-ipsum": "^2.0.8",
Expand All @@ -75,5 +78,10 @@
"onlyBuiltDependencies": [
"@tea/ui"
]
}
},
"build": {
"appId": "xyz.tea.gui"
},
"homepage": "https://tea.xyz",
"repository": "https://github.com/teaxyz/gui.git"
}
8 changes: 3 additions & 5 deletions modules/desktop/src/app.scss → modules/desktop/src/app.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
$primary: #ff3e00;

:root {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
'Open Sans', 'Helvetica Neue', sans-serif;
}

.text-primary {
color: $primary;
color: #ff3e00;
}

.button {
padding: 10px 10px;
display: inline-block;
background-color: $primary;
background-color: #ff3e00;
color: white;
text-decoration: none;
border: none;
Expand All @@ -26,7 +24,7 @@ $primary: #ff3e00;
z-index: 1; /* Stay on top */
top: 0; /* Stay at the top */
left: 0;
background-color: $primary;
background-color: #ff3e00;
overflow-x: hidden; /* Disable horizontal scroll */
padding-top: 20px;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/desktop/src/lib/SideBar.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- Based on: https://www.w3schools.com/howto/howto_css_fixed_sidebar.asp -->
<script>
import '../app.scss';
import '../app.css';
</script>

<div class="sidenav">
Expand Down
2 changes: 1 addition & 1 deletion modules/desktop/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import '../app.scss';
import '../app.css';
import SideBar from '$lib/SideBar.svelte';
</script>

Expand Down
2 changes: 1 addition & 1 deletion modules/desktop/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</p>
</main>

<style lang="scss">
<style lang="css">
main {
text-align: center;
padding: 1em;
Expand Down
File renamed without changes.
File renamed without changes.
13 changes: 9 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
"author": "neil molina <[email protected]>",
"private": true,
"scripts": {
"dev": "pnpm --filter desktop exec pnpm electron",
"release": "sh ./.github/update-latest-binary.sh",
"build:gui": "pnpm --filter gui exec tauri build --verbose",
"dev:gui": "pnpm --filter gui exec tauri dev",
"web:gui": "BUILD_FOR=preview pnpm --filter gui dev"
"build:desktop": "pnpm --filter desktop exec pnpm package",
"web:desktop": "BUILD_FOR=preview pnpm --filter desktop dev"
},
"workspaces": {
"packages": [
"modules/*"
]
}
},
"homepage": "https://tea.xyz",
"repository": {
"type": "git",
"url": "https://github.com/teaxyz/gui.git"
}
}
Loading

0 comments on commit bf48a16

Please sign in to comment.