Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Update layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jul 21, 2022
1 parent 88db635 commit 37f62b8
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 11 deletions.
6 changes: 5 additions & 1 deletion interface/components/buildNumber.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<div class="build sticky top-0 z-20 w-full bg-black p-1 text-center">
<p class="buildContent text-lg font-bold">You are running a pre release version of Authme.</p>
<p class="buildContent text-lg font-bold">You are running a pre release version of Authme - Version {build.version} - Build {build.number}</p>
</div>

<script lang="ts">
import build from "../../build.json"
</script>
7 changes: 0 additions & 7 deletions interface/components/navigation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@
Settings
</a>

<button class="menuButton">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
About
</button>

<a href="/" class="menuButton mx-3 mt-0"> Landing </a>
</div>
</div>
Expand Down
4 changes: 3 additions & 1 deletion interface/layout/app.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{/if}

<div class="w-full overflow-hidden overflow-y-scroll">
<BuildNumber />
<div class="top" />

<Route path="/"><Landing /></Route>
Expand All @@ -27,6 +28,7 @@
import { state } from "../stores/state"
// import UpdateAlert from "../components/updateAlert.svelte"
import BuildNumber from "../components/buildNumber.svelte"
import Landing from "../windows/landing/landing.svelte"
import Codes from "../windows/codes/codes.svelte"
Expand All @@ -35,7 +37,7 @@
import Export from "../windows/export/export.svelte"
import Confirm from "../windows/confirm.svelte"
import Navigation from "../components/navigation.svelte"
import Edit from "../windows/edit.svelte"
import Edit from "../windows/edit/edit.svelte"
onMount(() => {
router.subscribe(() => {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"type": "module",
"scripts": {
"dev": "parcel ./interface/layout/index.html --port 3000",
"build": "parcel build ./interface/layout/index.html",
"start": "tauri dev"
"build:bundle": "parcel build ./interface/layout/index.html --no-content-hash --no-source-maps",
"build": "node scripts/build.cjs alpha && tauri build",
"start": "node scripts/build.cjs alpha && tauri dev"
},
"devDependencies": {
"@tailwindcss/forms": "^0.5.2",
Expand Down
27 changes: 27 additions & 0 deletions scripts/build.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const { existsSync, mkdirSync, writeFileSync } = require("fs")
const package = require("../package.json")

const build = new Date().toISOString().replace("T", "X").replaceAll(":", ".").substring(0, 19).replaceAll("-", ".").slice(2).replaceAll(".", "").replace("X", ".")

const date = new Date()

const year = date.getFullYear()
const month = date.toLocaleString("en-us", { timeZone: "UTC", month: "long" })
const day = date.toISOString().substring(8, 10)

const buildNumber = `${process.argv[2]}.${build}`
const releaseDate = `${year}. ${month} ${day}.`

const file = {
number: buildNumber,
date: releaseDate,
version: package.version,
arch: process.arch,
}

if (!existsSync("core/target/release")) {
mkdirSync("core/target/release", { recursive: true })
}

writeFileSync("build.json", JSON.stringify(file, null, "\t"))
writeFileSync("core/target/release/build.json", JSON.stringify(file, null, "\t"))

0 comments on commit 37f62b8

Please sign in to comment.