Skip to content

Commit

Permalink
Make open (#4)
Browse files Browse the repository at this point in the history
* remove electron and worker

* cleanup
  • Loading branch information
klausbreyer committed Mar 24, 2023
1 parent b4b7630 commit 962c1d1
Show file tree
Hide file tree
Showing 22 changed files with 554 additions and 4,432 deletions.
27 changes: 8 additions & 19 deletions .github/workflows/pages-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
on: [push]
on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -14,28 +18,13 @@ jobs:
sudo apt-get install nodejs yarn
- name: Build
run: |
yarn && make build-parcel-for-web
yarn && yarn run build
- name: Publish Page
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: unixtime-app # e.g. 'my-project'
directory: dist-parcel # e.g. 'dist'
projectName: unixtime-app
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Worker Refs
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: 'worker'
command: publish index.js --name unixtime-app-refs

- name: Publish Worker Stats
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workingDirectory: 'worker'
command: publish stats.js --name unixtime-app-stats

70 changes: 1 addition & 69 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,70 +1,2 @@
start:
make start-electron & make start-parcel

start-electron:
yarn run electron-forge start

start-parcel:
rm -rf dist-parcel
yarn run parcel src/index.html

start-worker:
npx wrangler dev worker/index.js

start-worker-stats:
npx wrangler dev worker/stats.js

patch:
yarn version --patch
make magic

minor:
yarn version --minor
make magic

magic:
make build-parcel-for-electron
make magic-electron

build-parcel-for-electron:
rm -rf dist-parcel && yarn run parcel build src/index.html --public-url . --dist-dir dist-parcel && cp src/images/* dist-parcel/images/ && cp src/favicon.ico dist-parcel

build-parcel-for-web:
rm -rf dist-parcel && yarn run parcel build src/index.html --public-url / --dist-dir dist-parcel && cp src/images/* dist-parcel/images/ && cp src/favicon.ico dist-parcel

magic-electron:
make build-electron
make upload

build-electron:
rm -rf dist
rm -rf out
make icons
yarn run electron-builder

upload:
xcrun altool --validate-app -f ${shell find dist/mas-universal -name "*.pkg" | head -n 1} -u ${APPLE_ID} -p ${APPLE_PASSWORD} --type macos
xcrun altool --upload-app -f ${shell find dist/mas-universal -name "*.pkg" | head -n 1} -u ${APPLE_ID} -p ${APPLE_PASSWORD} --type macos

icons:
cp build/512x512@2x.png build/icon.png
cp build/Artwork.png src/favicon.png

# local
package-electron:
rm -rf dist
rm -rf out
yarn run electron-forge package

# just to create the favicon.ico
icon:
convert -resize x16 -gravity center -crop 16x16+0+0 src/images/logo.png -flatten -colors 256 -background transparent src/favicon.ico
convert src/images/logo.png -resize 512x512 src/images/logo-512x512.png
convert src/images/logo.png -resize 192x192 src/images/logo-192x192.png
convert src/images/logo.png -resize 256x256 src/images/logo-256x256.png
convert src/images/logo.png -resize 384x384 src/images/logo-384x384.png



#unused
# yarn run electron-builder --dir
npm start
Binary file removed build/150x150raw.png
Binary file not shown.
Binary file removed build/300x300raw.png
Binary file not shown.
Binary file removed build/512x512@2x.png
Binary file not shown.
Binary file removed build/71x71raw.png
Binary file not shown.
Binary file removed build/Artwork.png
Binary file not shown.
10 changes: 0 additions & 10 deletions build/entitlements.mas.inherit.plist

This file was deleted.

20 changes: 0 additions & 20 deletions build/entitlements.mas.plist

This file was deleted.

Binary file removed build/logo-raw-1080.png
Binary file not shown.
46 changes: 0 additions & 46 deletions electron/main.js

This file was deleted.

17 changes: 0 additions & 17 deletions electron/preload.js

This file was deleted.

44 changes: 9 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,20 @@
{
"name": "unixtime",
"version": "4.0.7",
"main": "electron/main.js",
"targets": {
"main": false
},
"version": "5.0.0",
"repository": "git@github.com:klausbreyer/unixtime.app.git",
"author": "Klaus Breyer <kb@v01.io>",
"license": "UNLICENSED",
"devDependencies": {
"@electron-forge/cli": "^6.0.0-beta.65",
"@parcel/packager-raw-url": "2.7.0",
"@parcel/transformer-sass": "2.7.0",
"@parcel/transformer-webmanifest": "2.7.0",
"electron": "^20.0.2",
"electron-builder": "^23.3.3",
"parcel": "^2.7.0",
"@parcel/packager-raw-url": "2.8.3",
"@parcel/transformer-sass": "2.8.3",
"@parcel/transformer-webmanifest": "2.8.3",
"parcel": "^2.8.3",
"posthtml-doctype": "^1.1.1",
"posthtml-include": "^1.7.4"
},
"scripts": {},
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
"scripts": {
"start": "yarn run parcel src/index.html",
"build": " yarn run parcel build src/index.html --public-url / --dist-dir dist && cp src/images/* dist/images/ && cp src/favicon.ico dist/"
},
"config": {},
"build": {
"appId": "app.unixtime",
"mac": {
"target": [
{
"target": "mas",
"arch": "universal"
}
],
"mergeASARs": false,
"category": "public.app-category.developer-tools"
},
"mas": {
"type": "distribution",
"provisioningProfile": "embedded.provisionprofile",
"entitlements": "build/entitlements.mas.plist",
"entitlementsInherit": "build/entitlements.mas.inherit.plist"
}
}
"dependencies": {}
}
31 changes: 0 additions & 31 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ unitElement.addEventListener("change", function () {
}
});

window.addEventListener("DOMContentLoaded", function () {
if (isElectron() || isPwa()) {
this.document.querySelector("header").style.display = "none";
}
});

window.addEventListener("DOMContentLoaded", function () {
if (!localStorage.getItem("epoch")) {
localStorage.setItem("epoch", new Date().getFullYear());
Expand Down Expand Up @@ -86,19 +80,9 @@ function parse() {
let text = output.innerHTML;
let showAlert = false;
toReplace.forEach((n, i) => {
if (!isElectron() && !isPwa() && i > 2) {
showAlert = true;
return;
}
text = text.replace(n, `<span class="inverse">${dateTimeString(n)}</span>`);
});
output.innerHTML = text;

if (showAlert && isBrowserMac()) {
alert(
"Hey, just a little heads-up!\n\nYour results are limited to 3. Please download the desktop application from the Mac App Store to replace more. You can find the link below.\n\nYour support is greatly appreciated to ensure the continued development of the application!\n\nCheers, Klaus."
);
}
}

function dateTimeString(n) {
Expand All @@ -123,18 +107,3 @@ function welcome() {

this.setTimeout(() => parse(), 500);
}

function isElectron() {
return !!window.electron;
}

function isBrowserMac() {
return window.navigator.platform.includes("Mac");
}

function isPwa() {
return ["fullscreen", "standalone", "minimal-ui"].some(
(displayMode) =>
window.matchMedia("(display-mode: " + displayMode + ")").matches
);
}
18 changes: 4 additions & 14 deletions src/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@
<nav>

<a href="/" id="logo">unixtime.app</a>

<a href="/">App</a>
<a href="workflow.html">Origin &amp; Workflow</a>
<a href="support.html">Support</a>
<a href="https://v01.io/category/v01-software/unixtime-app/"
target="_blank">Blog</a>
<p>&copy;<a href="https://v01.software/"
target="_blank">v01.software</a></p>
<a href="https://v01.io/imprint/" target="_blank">Contact</a>
<a href="https://www.v01.io/categories/unixtime.app/"
target="_blank">History</a>
<p>&copy;<a href="https://v01.io" target="_blank">Klaus Breyer</a></p>
</nav>
<div id="support">
<a id="mas-link"
href="https://apps.apple.com/de/app/unixtime-app/id1627321235?l=en&mt=12"
target="_blank"><img src="./images/mas.svg" /></a>
<a id="mss-link"
href="https://apps.microsoft.com/store/detail/unixtimeapp/9NXBTRZH3ZQN?hl=de-de&gl=de"
target="_blank"><img src="./images/mss.svg" /></a>
</div>
</header>
5 changes: 0 additions & 5 deletions src/support.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
<body>
<main>
<include src="src/header.html"></include>

<article>

<h1>Support</h1>
<p>This page is still under construction. Feedback is always
welcome.</p>
Expand All @@ -22,9 +20,6 @@ <h1>Support</h1>
</p>
</article>
</main>


</body>


</html>
8 changes: 1 addition & 7 deletions src/workflow.html
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,7 @@ <h2>Mission Statement</h2>
you would support
development by downloading the full version from the App Stores.
</p>
<div id="support">
<a href="https://apps.apple.com/de/app/unixtime-app/id1627321235?l=en&mt=12"
target="_blank"><img src="./images/mas.svg" /></a>
<a href="https://apps.apple.com/de/app/unixtime-app/id1627321235?l=en&mt=12"
target="_blank"><img src="./images/mss.svg" /></a>
</div>
<p></p>

<hr />
<h2>Subscribe to Updates</h2>
<p>If you found this interesting and want to be informed when
Expand Down
10 changes: 0 additions & 10 deletions worker/.gitignore

This file was deleted.

Loading

0 comments on commit 962c1d1

Please sign in to comment.