12 Commits

Author SHA1 Message Date
ab7ba528ee removed "@" from dist package
Some checks failed
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build is failing
2021-03-14 21:35:41 +01:00
bfff17c465 🚚 move to apk zip
Some checks failed
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build is failing
2021-03-14 21:28:40 +01:00
de92402a3c CI - 📁 create zip for release
Some checks failed
continuous-integration/drone/push Build was killed
continuous-integration/drone/tag Build is failing
2021-03-14 21:17:05 +01:00
f4037c78ca CI - also trigger on tag events
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
2021-03-14 20:57:13 +01:00
b42ff9ec3c CI Test
Some checks failed
continuous-integration/drone/push Build is failing
2021-03-14 20:54:07 +01:00
08922d3363 CI - added secret from path 2021-03-14 20:51:04 +01:00
49e9317f4a CI file 2021-03-14 20:49:34 +01:00
0189a16df0 🐳 added git as a electron dependency 2021-03-14 20:29:36 +01:00
f9c050b9f7 simple Dockerfile 2021-03-14 20:26:51 +01:00
d728ae37e6 added basic dev script + more readme 2021-03-14 20:07:11 +01:00
18ca318b18 proper scripts for electron building/webapp building 2021-03-14 20:05:00 +01:00
7377b4c9d0 demo for electron packaging 2021-03-14 19:55:21 +01:00
14 changed files with 196 additions and 25 deletions

24
.dockerignore Normal file
View File

@@ -0,0 +1,24 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/charts
**/docker-compose*
**/compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
README.md

47
.drone.yml Normal file
View File

@@ -0,0 +1,47 @@
---
kind: secret
name: gitea_token
get:
path: odit-git-bot
name: apikey
---
kind: pipeline
type: kubernetes
name: build
steps:
- name: run electron packager
depends_on: ["clone"]
image: node:15.11.0-alpine3.13
commands:
- apk add git zip -f
- yarn && cd app && yarn && cd ..
- yarn electron:package
- zip -r out/lfk-scanclient-win32-x64.zip out/lfk-scanclient-win32-x64
- name: gitea_release
depends_on: ["run electron packager"]
image: plugins/gitea-release
settings:
api_key:
from_secret: gitea_token
base_url: https://git.odit.services
# files: out/*
files:
- out/lfk-scanclient-win32-x64.zip
checksum:
- md5
- sha1
- sha256
- sha512
- adler32
- crc32
when:
event: tag
trigger:
# branch:
# - dev
event:
- push
- tag

4
.gitignore vendored
View File

@@ -3,3 +3,7 @@
.DS_Store
package-lock.json
yarn.lock
/out
/yarn.lock
/app/node_modules
/app/dist

6
Dockerfile Normal file
View File

@@ -0,0 +1,6 @@
FROM node:15.11.0-alpine3.13
RUN apk add git -f
WORKDIR /app
COPY . .
RUN yarn && cd app && yarn && cd ..
RUN yarn electron:package

View File

@@ -7,14 +7,19 @@ This is an API client for @lfk/backend
## 🚀 Getting Started
```
yarn
yarn && cd app && yarn && cd ..
```
## WebApp Development
```
yarn dev
/
yarn dev --open
```
## Run in electron
```
yarn electron:dev
yarn electron:start
```
# Package electron
```
yarn electron:pack
yarn electron:package
```

View File

@@ -5,11 +5,12 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>LfK!Scan</title>
<link rel="icon" type="image/png" href="/favicon.png" />
<base href="./">
<link rel="icon" type="image/png" href="./favicon.png" />
</head>
<body class="bg-white font-family-karla h-screen">
<script type="module" src="/src/main.js"></script>
<script type="module" src="./src/main.js"></script>
</body>
</html>

20
app/package.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "@lfk/scanclient",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"@svitejs/vite-plugin-svelte": "^0.11.0",
"@tsconfig/svelte": "^1.0.10",
"@types/html-minifier": "^4.0.0",
"axios": "^0.21.1",
"glob": "^7.1.6",
"html-minifier": "^4.0.0",
"svelte": "^3.35.0",
"svelte-preprocess": "^4.6.9",
"vite": "^2.0.5",
"vite-plugin-windicss": "^0.8.2"
}
}

View File

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -17,6 +17,7 @@ const indexReplace = () => {
export default defineConfig(({ command, mode }) => {
const isProduction = mode === 'production';
return {
base: './',
build: {
polyfillDynamicImport: false,
cssCodeSplit: false,

39
main.js Normal file
View File

@@ -0,0 +1,39 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
function createWindow() {
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
fullscreen: true
// webPreferences: {
// preload: path.join(__dirname, 'preload.js')
// }
});
mainWindow.loadFile('app/dist/index.html');
// mainWindow.removeMenu();
// mainWindow.webContents.openDevTools()
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.whenReady().then(() => {
createWindow();
app.on('activate', function() {
// On macOS it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) createWindow();
});
});
// Quit when all windows are closed, except on macOS. There, it's common
// for applications and their menu bar to stay active until the user quits
// explicitly with Cmd + Q.
app.on('window-all-closed', function() {
if (process.platform !== 'darwin') app.quit();
});
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.

View File

@@ -1,20 +1,44 @@
{
"name": "@lfk/scanclient",
"version": "0.0.0",
"scripts": {
"dev": "vite ",
"build": "vite build"
},
"devDependencies": {
"@svitejs/vite-plugin-svelte": "^0.11.0",
"@tsconfig/svelte": "^1.0.10",
"@types/html-minifier": "^4.0.0",
"axios": "^0.21.1",
"glob": "^7.1.6",
"html-minifier": "^4.0.0",
"svelte": "^3.35.0",
"svelte-preprocess": "^4.6.9",
"vite": "^2.0.5",
"vite-plugin-windicss": "^0.8.2"
}
"name": "@lfk/scanclient",
"version": "0.0.0",
"description": "minimal electron application",
"main": "main.js",
"scripts": {
"dev": "cd app && yarn dev",
"electron:start": "cd app && yarn build && cd .. && electron-forge start",
"electron:package": "cd app && yarn build && cd .. && electron-forge package"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.54",
"@electron-forge/maker-deb": "^6.0.0-beta.54",
"@electron-forge/maker-rpm": "^6.0.0-beta.54",
"@electron-forge/maker-squirrel": "^6.0.0-beta.54",
"@electron-forge/maker-zip": "^6.0.0-beta.54",
"electron-nightly": "14.0.0-nightly.20210311"
},
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
},
"config": {
"forge": {
"packagerConfig": {},
"makers": [
{
"name": "@electron-forge/maker-zip",
"platforms": [ "darwin" ],
"config": {
"name": "lfk__scanclient"
}
},
{
"name": "@electron-forge/maker-deb",
"config": {}
},
{
"name": "@electron-forge/maker-rpm",
"config": {}
}
]
}
}
}