8 Commits

Author SHA1 Message Date
b17f5db58e version bump and footer 2021-04-07 22:53:28 +02:00
064287c34f Update README.md 2021-04-07 22:33:12 +02:00
317c88641d cleanup 2021-04-07 16:39:43 +02:00
39398da265 on push 2021-04-07 15:38:58 +02:00
c045ab43bf workflow 2021-04-07 14:52:53 +02:00
67276e0119 workflow 2021-04-07 13:00:09 +02:00
50a24f847f use deb pacakges 2021-04-07 12:56:33 +02:00
72ee5d7641 cleanup 2021-04-07 12:28:05 +02:00
12 changed files with 62 additions and 17 deletions

22
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Main
on:
push:
branches:
- main
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn run dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -14,6 +14,18 @@ To combat and alleviate the symptoms there is the famous 20/20/20 rule that aims
This is not medical advice. Read more [here](https://en.wikipedia.org/wiki/Computer_vision_syndrome) and [here](https://www.aoa.org/healthy-eyes/eye-and-vision-conditions/computer-vision-syndrome). This is not medical advice. Read more [here](https://en.wikipedia.org/wiki/Computer_vision_syndrome) and [here](https://www.aoa.org/healthy-eyes/eye-and-vision-conditions/computer-vision-syndrome).
## 📦 Install ## 📦 Installation
Head to the [release page](https://github.com/cupcakearmy/unpixel/releases) and grab the latest for your platform. Head to the [release page](https://github.com/cupcakearmy/unpixel/releases) and grab the latest for your platform.
- For `macOS` you can downlaod the `.dmg` image.
- For `Windows` download the `.exe`.
- For `Linux` either the `.AppImage` or `.deb`, you will know what fits you 😉.
## Building / Development
1. Clone the repo
2. `yarn install`
3. `yarn dist` to build for all platforms
Alternatevly you can run `yarn build` and the `yarn electron-builder -m` for `macOS`, `-l` fir `linux` or `-w` for `windows`.

View File

@@ -1,14 +1,18 @@
appId: "io.nicco.app.unpixel" appId: "io.nicco.app.unpixel"
# productName: "UnPixel"
files: files:
- assets - assets
- dist - dist
directories: directories:
output: "./out" output: "./out"
mac: mac:
target: "dmg" target:
- dmg
identity: null identity: null
win: win:
target: "nsis" target:
- nsis
linux: linux:
category: "Utility" category: "Utility"
target:
- AppImage
- deb

View File

@@ -11,7 +11,7 @@
"repository": { "repository": {
"url": "https://github.com/cupcakearmy/unpixel" "url": "https://github.com/cupcakearmy/unpixel"
}, },
"version": "1.0.2", "version": "1.0.4",
"main": "./dist/back/index.js", "main": "./dist/back/index.js",
"scripts": { "scripts": {
"start": "electron .", "start": "electron .",
@@ -22,7 +22,6 @@
"build:back": "parcel build --target back ./src/back/index.ts", "build:back": "parcel build --target back ./src/back/index.ts",
"build": "run-s build:*", "build": "run-s build:*",
"pack": "electron-builder -mwl", "pack": "electron-builder -mwl",
"pack:dev": "electron-builder -m",
"dist": "rm -rf .parcel-cache dist && run-s build pack" "dist": "rm -rf .parcel-cache dist && run-s build pack"
}, },
"browserslist": [ "browserslist": [
@@ -56,6 +55,7 @@
"@types/auto-launch": "^5.0.1", "@types/auto-launch": "^5.0.1",
"@types/react": "^17.0.3", "@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3", "@types/react-dom": "^17.0.3",
"@types/semver": "^7.3.4",
"electron": "^12.0.0", "electron": "^12.0.0",
"electron-builder": "^22.10.5", "electron-builder": "^22.10.5",
"npm-run-all": "^4.1.5", "npm-run-all": "^4.1.5",

View File

@@ -30,7 +30,7 @@ export default class TrayUtility {
static setStatus(status: string) { static setStatus(status: string) {
this.menu[0].label = status this.menu[0].label = status
this.tray.setContextMenu(this.build()) this.tray?.setContextMenu(this.build())
} }
private static build() { private static build() {

View File

@@ -7,7 +7,7 @@ import pkg from '../../package.json'
const current = semver.coerce(pkg.version) const current = semver.coerce(pkg.version)
const url = 'https://api.github.com/repos/cupcakearmy/unpixel/tags' const url = 'https://api.github.com/repos/cupcakearmy/unpixel/tags'
const interval = 1000 * 60 * 60 * 10 // 10 Minutes const interval = 1000 * 60 * 15 // 10 Minutes
export default class Updater { export default class Updater {
static init() { static init() {
@@ -20,8 +20,9 @@ export default class Updater {
url, url,
}) })
// parse tags and reverse sort them to get the highest // parse tags and reverse sort them to get the highest
const tags = data.map((d) => semver.coerce(d.name)).sort(semver.rcompare) const tags = data.map((d: any) => semver.coerce(d.name)).sort(semver.rcompare)
const latest = tags[0] const latest = tags[0]
if (!current) throw new Error('Could not determine current version')
if (semver.lt(current, latest)) { if (semver.lt(current, latest)) {
logger.info('New version available') logger.info('New version available')
dialog dialog

View File

@@ -7,15 +7,17 @@ import { render } from 'react-dom'
// @ts-ignore // @ts-ignore
import chime from 'url:../assets/chime.mp3' import chime from 'url:../assets/chime.mp3'
const useKeyPress = (handler) => { const useKeyPress = (handler: (e: KeyboardEvent) => void) => {
const handlerRef = useRef<(e: KeyboardEvent) => void>() const handlerRef = useRef<typeof handler>()
useEffect(() => { useEffect(() => {
handlerRef.current = handler handlerRef.current = handler
}, [handler]) }, [handler])
useEffect(() => { useEffect(() => {
const fn = (event) => handlerRef.current(event) const fn = (event: KeyboardEvent) => {
if (handlerRef.current) handlerRef.current(event)
}
window.addEventListener('keydown', fn) window.addEventListener('keydown', fn)
return () => { return () => {
window.removeEventListener('keydown', fn) window.removeEventListener('keydown', fn)

View File

@@ -1,4 +1,3 @@
/* @import 'hiq/dist/hiq.css'; */
@import 'spectre.css/dist/spectre.min.css'; @import 'spectre.css/dist/spectre.min.css';
@import 'tachyons/css/tachyons.min.css'; @import 'tachyons/css/tachyons.min.css';

View File

@@ -1,4 +1,4 @@
import React, { useCallback } from 'react' import React from 'react'
import Link from './ExternalLink' import Link from './ExternalLink'

View File

@@ -9,7 +9,7 @@ const Footer: React.FC = () => {
<div className="flex justify-center items-center"> <div className="flex justify-center items-center">
<Link link="https://github.com/cupcakearmy" text="Github" /> <Link link="https://github.com/cupcakearmy" text="Github" />
<div className="ph1"> - </div> <div className="ph1"> - </div>
<Link link="https://nicco.io/support" text="Support" /> <Link link="https://nicco.io/support" text="Support / Donate" />
</div> </div>
<div className="code o-20 mt1"> <div className="code o-20 mt1">
<small>version: {version}</small> <small>version: {version}</small>

View File

@@ -9,7 +9,7 @@
// "lib": [], /* Specify library files to be included in the compilation. */ // "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */ // "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */ // "checkJs": true, /* Report errors in .js files. */
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */ "jsx": "react" /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */,
// "declaration": true, /* Generates corresponding '.d.ts' file. */ // "declaration": true, /* Generates corresponding '.d.ts' file. */
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
// "sourceMap": true, /* Generates corresponding '.map' file. */ // "sourceMap": true, /* Generates corresponding '.map' file. */

View File

@@ -1665,6 +1665,11 @@
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275" resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.1.tgz#18845205e86ff0038517aab7a18a62a6b9f71275"
integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA== integrity sha512-EaCxbanVeyxDRTQBkdLb3Bvl/HK7PBK6UJjsSixB0iHKoWxE5uu2Q/DgtpOhPIojN0Zl1whvOd7PoHs2P0s5eA==
"@types/semver@^7.3.4":
version "7.3.4"
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.4.tgz#43d7168fec6fa0988bb1a513a697b29296721afb"
integrity sha512-+nVsLKlcUCeMzD2ufHEYuJ9a2ovstb6Dp52A5VsoKxDXgvE051XgHI/33I1EymwkRGQkwnA0LkhnUzituGs4EQ==
"@types/verror@^1.10.3": "@types/verror@^1.10.3":
version "1.10.4" version "1.10.4"
resolved "https://registry.yarnpkg.com/@types/verror/-/verror-1.10.4.tgz#805c0612b3a0c124cf99f517364142946b74ba3b" resolved "https://registry.yarnpkg.com/@types/verror/-/verror-1.10.4.tgz#805c0612b3a0c124cf99f517364142946b74ba3b"