From 7406f311b1c37996c088540fa6c6a548b6c59b08 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Sun, 4 Dec 2022 01:40:53 +0100 Subject: [PATCH 01/25] Specify test branch using t in front --- .gitlab-ci.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb854ac..5fca2ee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,3 @@ -# avoids unecessary repulling of node modules -cache: - paths: - - node_modules/ - stages: - lint #- test @@ -21,7 +16,7 @@ variables: .docker: image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:20 rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_COMMIT_TAG + - if: $CI_COMMIT_TAG !~ /(^t)+.*/ variables: IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest - if: $CI_COMMIT_TAG From e63d696e49e9386dffac77bd43f6981ad4035463 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Sun, 4 Dec 2022 01:43:23 +0100 Subject: [PATCH 02/25] Only run CI/CD when Tag is present oops --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5fca2ee..e8e1c18 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,7 +16,7 @@ variables: .docker: image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:20 rules: - - if: $CI_COMMIT_TAG !~ /(^t)+.*/ + - if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /(^t)+.*/ variables: IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest - if: $CI_COMMIT_TAG From 6fa3d727b05d365dcb0c67b2060cc721a58d7231 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Sun, 4 Dec 2022 16:42:25 +0100 Subject: [PATCH 03/25] Add vscode folder to gitignore --- .gitignore | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ddb6132..c29dfdc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ # do not track installed modules -/node_modules +node_modules/ # do not track built files -/.next +.vscode/ +.next/ *.tsbuildinfo next-env.d.ts @@ -13,6 +14,6 @@ yarn-error.log* .pnpm-debug.log* # production -/build -/data -/confs +build/ +data/ +confs/ From 8177802bb3581ad67e9102ba5026d0e05e4c313c Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Sun, 4 Dec 2022 16:42:49 +0100 Subject: [PATCH 04/25] Extract windowsize function from map script --- components/sidebar.tsx | 11 +++++++---- components/windowsize.tsx | 24 ++++++++++++++++++++++++ pages/[map].tsx | 26 ++------------------------ 3 files changed, 33 insertions(+), 28 deletions(-) create mode 100644 components/windowsize.tsx diff --git a/components/sidebar.tsx b/components/sidebar.tsx index 113c438..ccf3a7f 100644 --- a/components/sidebar.tsx +++ b/components/sidebar.tsx @@ -4,7 +4,8 @@ import { useRouter } from 'next/router' import useSWR from 'swr'; import ReadyOrNotMap from '../interfaces/ReadyOrNot'; import React, { useState } from 'react'; -import Image from 'next/image' +import Image from 'next/image'; +import useWindowSize from '../components/windowsize'; const fetcher = (url: string) => fetch(url).then((res) => res.json()) @@ -12,11 +13,13 @@ function stopPropagation(e: any) { e.stopPropagation(); } - const Sidebar = () => { + const isMobile = useWindowSize(); + console.log(isMobile); // DEBUG const router = useRouter(); - const [active, setActive] = useState(true); + const [active, setActive] = useState(!isMobile); const { maps, isLoading, isError } = useNavbar(); + if (isError) { return (<div><nav><a>Error loading Sidemenu</a></nav></div>) } else if (isLoading) { @@ -40,7 +43,7 @@ const Sidebar = () => { ))} </nav> <div className={styles.sidebarArrow}> - <Image src="/sidebar_arrow.webp" width={32} height={96} alt=">"/> + <Image src={active ? "/sidebar_arrow_flipped.webp" : "/sidebar_arrow.webp"} width={32} height={96} alt={active ? ">" : "<" }/> </div> </div> ); diff --git a/components/windowsize.tsx b/components/windowsize.tsx new file mode 100644 index 0000000..27cb575 --- /dev/null +++ b/components/windowsize.tsx @@ -0,0 +1,24 @@ +import { useEffect, useState } from "react"; + +export default function useWindowSize() { + const [windowSize, setWindowSize] = useState({ + width: 0, + height: 0, + }); + + useEffect(() => { + function handleResize() { + setWindowSize({ + width: window.innerWidth, + height: window.innerHeight, + }); + } + + window.addEventListener("resize", handleResize); + + handleResize(); + + return () => window.removeEventListener("resize", handleResize); + }, []); + return windowSize.width <= 1080; +} \ No newline at end of file diff --git a/pages/[map].tsx b/pages/[map].tsx index 5676b61..922df1d 100644 --- a/pages/[map].tsx +++ b/pages/[map].tsx @@ -6,34 +6,12 @@ import { NextPageWithLayout } from './_app'; import React from 'react'; import useSWR, { KeyedMutator, mutate } from 'swr'; import { useRouter } from 'next/router'; -import Image from 'next/image' +import Image from 'next/image'; import ReadyOrNotMap from '../interfaces/ReadyOrNot'; +import useWindowSize from '../components/windowsize'; const fetcher = (url: string) => fetch(url).then((res) => res.json()) -function useWindowSize() { - const [windowSize, setWindowSize] = useState({ - width: 0, - height: 0, - }); - - useEffect(() => { - function handleResize() { - setWindowSize({ - width: window.innerWidth, - height: window.innerHeight, - }); - } - - window.addEventListener("resize", handleResize); - - handleResize(); - - return () => window.removeEventListener("resize", handleResize); - }, []); - return windowSize.width <= 1080; -} - const ReadyOrNotMaps: NextPageWithLayout = () => { const [floor, setFloor] = useState(0); const { mapInfo, isLoadingInfo, isErrorInfo } = useMap(useRouter().query.map?.toString() || "a_lethal_obsession") From 9cba3c50c937f35ec40bca98ebc9e20c2562b326 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Sun, 4 Dec 2022 16:43:10 +0100 Subject: [PATCH 05/25] Changed Arrow color and added flipped verison --- public/sidebar_arrow.webp | Bin 532 -> 704 bytes public/sidebar_arrow_flipped.webp | Bin 0 -> 696 bytes resources/sidebar_arrow.svg | 6 +++--- resources/sidebar_arrow.webp | Bin 532 -> 704 bytes resources/sidebar_arrow_flipped.webp | Bin 0 -> 696 bytes 5 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 public/sidebar_arrow_flipped.webp create mode 100644 resources/sidebar_arrow_flipped.webp diff --git a/public/sidebar_arrow.webp b/public/sidebar_arrow.webp index a78f7505e69e2f0349f751708fdf6b50d7f08a66..9c008891c8a0508e59fe80395d5f5a8a8b720154 100644 GIT binary patch delta 697 zcmV;q0!ICm1i%G<Qb|TexB>tGS4BclR!}%hs{#N3FCV}c5O3okl4Mtz`5AEXU1Aaq z7|6VTOA_HAl58iMAqOY8#3UNdK)%mg2a#ku(F{2_!6hcqa0c>y-a>5KNRk{Z+Ex4C z)d83!j^}AT4yWs~9!JiPht^sS`>wT?Wm#OFPxCx`{r|gv-?nV`ovO+(44%KAs>(17 zfZOhS`@Yw8og_(;uIsecIt)XAYpu2K`&FAHz$JOA1zJ_Qt^>5HbX`aNuPRBZO0udX zQ30n)k|b3(NdaorBzda^F3GB!q`(7s1AqliE${)ZssK>~02Tm5m4v!g6*Yh)Q3s$- zRZ$0^P7+Bq`~j*Y06+lhBmr5sZ5?~FVmr0n)MjeiZEPpc|G$3U?{ti_iu;KEJ968| zk%XOmTXs+Q0+Epuk)Q;B007X@Z@cwMw=--jS9KqBvj=P&<F@jv#Ws1|w*Ayr7Q1Y- zW47{2w>+$BT)1MZY;|+{^Nmf{Dcjz)dgE+g*E!n@^Ht7vXt~-*+qYHH_Qq<FwtMG_ zwf$PG?fs4L`<U-wI8^iJbFsF!SFP>tMQ!_`SljE1)^=n?+rBA(*7o9Wwu9;VmbLAR zV&~7PNo(6Sqir8<THC|3+V+dKy{YHVXtbR=mv1><IFs&L96L)L>E4HB>v4M7wGgiy z&EKEml^@ONK80odZhmqv#QWR6ba&Q6@A7Kj!m@BFy&Q_8Vs#+hcpOzP(@WF$_@|#v zcVxzzKG>9|%|ESp>9GlG`e;j<woY5q6BE|-$+k3YU$UkrC!%To_}R8J?Oe8|XD6a* z{`k2y?a}k){B$tAC!Wi3!0!=7Q}bMprlx3W3a0A4B$%p#sj6Y>-m4m>u7;_ro-gvf fu%0in%2dCXUbbxw*k0QA>XvQ*004mh<%0kKMU!a~ literal 532 zcmV+v0_*)!Nk&Et0ssJ4MM6+kP&iEg0RR9mAHWw7FGG-RQ-AF55D^U9ws9PLSt;Mu zwr#^WWv1V70D#;Fl!&Cz3J?KBQ&F@f0RnyyDi(x_ptz`&qH#fKy7j2B;(rYQ-wKd! z+t#r+E2`U|wvpOQZM*&K=l-wZeZP}2&MN*#^xu)&Mvf%x<T)*S(iZ>#0000000000 z0000000000000000001hjXP|&U+X3-wsKAPQP(<X8?M>P?>SrJgl+Q7R=S&QtyNoj zt?R9*rU$OtDqCIqK)%&xowD85uNThtO`Ws7*sgN6%e`tLZQoT%+nd$N(so~Uz}kK* z*7m_L{66J76gJiM^QBnZJKA<nSKEFp*7io%+V1RW+qcEqURr0nlx}-Z+rBLJ`Z?XO zwhJw7`)FiskF>PyS8aPsUq8EI&GVvo;B30<>&DK;bRWVrev+PccjA#_`TJ8m@^d!b z=P(WK<uC3|yua;FcXtqapI7@Hrq1Q`bU2QR{$jedII3Qyr<ot|Pd}6HXv>;D97)sJ zU)J<^!<s%GOVjzLH9gs|rcWo*bVJvgo@zwX{Py#SG~Lv*rso>bG{61Anr_wC%Y|kz zy)T~2alr2tMN{)!kEW(*Y6_<6y(E~b_o85`nwq-zs;Q}KYU--57x`XTUoW!CRKJ&A Wv5gmPuk3sE+!g=;0D%AHg8%^e84@@E diff --git a/public/sidebar_arrow_flipped.webp b/public/sidebar_arrow_flipped.webp new file mode 100644 index 0000000000000000000000000000000000000000..482d5dbdac05592a0dd25e6015132c062e97b66c GIT binary patch literal 696 zcmV;p0!RH)Nk&Gn0ssJ4MM6+kP&iDZ0ssInAHWw7H{&>xY^T}5U&%iNg5%_o-pC}u zwvi-7)A#6p{vmvDZ!v7MZ6rz2^gX(te+VDkTMXL{+qRM9q$MZWy(g1IWm#9(ZF620 zwte@09$(+*G|#-g&$jFO{(t*n;CbI^yY5t<_hlGIU*AX58t?x<pl#R9>-*aEy{bUp z|4-X>qdrx20O}-Z5`j~v?YdSKNjAx&0{p6qrnLZl|GxkLNlb!D)7n<m0s}P3RTY3q zR{a2@0u)ds$pU}XB&(WalWfyk)dEogs44)Gj0%t>r~pX<5ET_5NdQt+00F2ffF$7$ z>9%bhd$VHOR_!*mZ6%HE`@e;bZ@*(atN0($e@AW`Ig%!AJh6MW_X_|30000000000 z000000000000000000000000$N3-qaqCDD<Z5PjM?`(aWwwt@My02%l@fF*nV_DPs znQV61_Uf#bG2M=g=~|>rWdj?TFx{&itLKDiTz5K!Y4paJ){f0f!ZfZMy}~s5AWY*p zxGqeiUqiw)`esd!?uq%5&qu_3iN4fH)5F`=bZt<WMjx%|-W6-Q)h|q=_vN>;?Hn?f zg=s$TDmTsNueIsCFwN)9()8r9FwN%^*7SRwG~K^pOk=*4n@%q!T6qmCIcBbw&xi*{ zIp)e6U9F7S^8HhO@m6`)c4GfrUiVhQ4VUk4bI#r^??Qg~M_qAkm3zim`Q`a(t>gPx z+n@E;c4^Ys#?XDJZPy!xZ9bi{wx>^wZI0e1Yr8z7ZJ%Oow_A*De0fgWzChUK(>7xp zgKNRqR_;#1HYaGOv5on6zPz5_w)wj*Y%3YtOxfnT#MoxWHdD5_t}?cnvW<10v8`lm eGc$j3U21GIW1AV<qeZ)}es;&!TK~WN0RRBBgIoy! literal 0 HcmV?d00001 diff --git a/resources/sidebar_arrow.svg b/resources/sidebar_arrow.svg index 870d15f..bd01371 100644 --- a/resources/sidebar_arrow.svg +++ b/resources/sidebar_arrow.svg @@ -28,8 +28,8 @@ inkscape:document-units="px" showgrid="true" inkscape:zoom="11.313709" - inkscape:cx="-3.1819805" - inkscape:cy="35.974057" + inkscape:cx="-3.1819804" + inkscape:cy="36.062444" inkscape:window-width="2560" inkscape:window-height="1391" inkscape:window-x="0" @@ -52,7 +52,7 @@ id="layer1"> <path id="path1211" - style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + style="fill:#999999;fill-opacity:1;stroke:#999999;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 8,3.9708715 V 19.970872 c 3.449498,11.952732 9.599609,28.000391 9.599609,28.000391 L 8,75.970872 v 16 L 24,47.971263 C 18.666759,33.304433 13.333375,18.637654 8,3.9708715 Z" sodipodi:nodetypes="ccccccc" /> </g> diff --git a/resources/sidebar_arrow.webp b/resources/sidebar_arrow.webp index a78f7505e69e2f0349f751708fdf6b50d7f08a66..9c008891c8a0508e59fe80395d5f5a8a8b720154 100644 GIT binary patch delta 697 zcmV;q0!ICm1i%G<Qb|TexB>tGS4BclR!}%hs{#N3FCV}c5O3okl4Mtz`5AEXU1Aaq z7|6VTOA_HAl58iMAqOY8#3UNdK)%mg2a#ku(F{2_!6hcqa0c>y-a>5KNRk{Z+Ex4C z)d83!j^}AT4yWs~9!JiPht^sS`>wT?Wm#OFPxCx`{r|gv-?nV`ovO+(44%KAs>(17 zfZOhS`@Yw8og_(;uIsecIt)XAYpu2K`&FAHz$JOA1zJ_Qt^>5HbX`aNuPRBZO0udX zQ30n)k|b3(NdaorBzda^F3GB!q`(7s1AqliE${)ZssK>~02Tm5m4v!g6*Yh)Q3s$- zRZ$0^P7+Bq`~j*Y06+lhBmr5sZ5?~FVmr0n)MjeiZEPpc|G$3U?{ti_iu;KEJ968| zk%XOmTXs+Q0+Epuk)Q;B007X@Z@cwMw=--jS9KqBvj=P&<F@jv#Ws1|w*Ayr7Q1Y- zW47{2w>+$BT)1MZY;|+{^Nmf{Dcjz)dgE+g*E!n@^Ht7vXt~-*+qYHH_Qq<FwtMG_ zwf$PG?fs4L`<U-wI8^iJbFsF!SFP>tMQ!_`SljE1)^=n?+rBA(*7o9Wwu9;VmbLAR zV&~7PNo(6Sqir8<THC|3+V+dKy{YHVXtbR=mv1><IFs&L96L)L>E4HB>v4M7wGgiy z&EKEml^@ONK80odZhmqv#QWR6ba&Q6@A7Kj!m@BFy&Q_8Vs#+hcpOzP(@WF$_@|#v zcVxzzKG>9|%|ESp>9GlG`e;j<woY5q6BE|-$+k3YU$UkrC!%To_}R8J?Oe8|XD6a* z{`k2y?a}k){B$tAC!Wi3!0!=7Q}bMprlx3W3a0A4B$%p#sj6Y>-m4m>u7;_ro-gvf fu%0in%2dCXUbbxw*k0QA>XvQ*004mh<%0kKMU!a~ literal 532 zcmV+v0_*)!Nk&Et0ssJ4MM6+kP&iEg0RR9mAHWw7FGG-RQ-AF55D^U9ws9PLSt;Mu zwr#^WWv1V70D#;Fl!&Cz3J?KBQ&F@f0RnyyDi(x_ptz`&qH#fKy7j2B;(rYQ-wKd! z+t#r+E2`U|wvpOQZM*&K=l-wZeZP}2&MN*#^xu)&Mvf%x<T)*S(iZ>#0000000000 z0000000000000000001hjXP|&U+X3-wsKAPQP(<X8?M>P?>SrJgl+Q7R=S&QtyNoj zt?R9*rU$OtDqCIqK)%&xowD85uNThtO`Ws7*sgN6%e`tLZQoT%+nd$N(so~Uz}kK* z*7m_L{66J76gJiM^QBnZJKA<nSKEFp*7io%+V1RW+qcEqURr0nlx}-Z+rBLJ`Z?XO zwhJw7`)FiskF>PyS8aPsUq8EI&GVvo;B30<>&DK;bRWVrev+PccjA#_`TJ8m@^d!b z=P(WK<uC3|yua;FcXtqapI7@Hrq1Q`bU2QR{$jedII3Qyr<ot|Pd}6HXv>;D97)sJ zU)J<^!<s%GOVjzLH9gs|rcWo*bVJvgo@zwX{Py#SG~Lv*rso>bG{61Anr_wC%Y|kz zy)T~2alr2tMN{)!kEW(*Y6_<6y(E~b_o85`nwq-zs;Q}KYU--57x`XTUoW!CRKJ&A Wv5gmPuk3sE+!g=;0D%AHg8%^e84@@E diff --git a/resources/sidebar_arrow_flipped.webp b/resources/sidebar_arrow_flipped.webp new file mode 100644 index 0000000000000000000000000000000000000000..482d5dbdac05592a0dd25e6015132c062e97b66c GIT binary patch literal 696 zcmV;p0!RH)Nk&Gn0ssJ4MM6+kP&iDZ0ssInAHWw7H{&>xY^T}5U&%iNg5%_o-pC}u zwvi-7)A#6p{vmvDZ!v7MZ6rz2^gX(te+VDkTMXL{+qRM9q$MZWy(g1IWm#9(ZF620 zwte@09$(+*G|#-g&$jFO{(t*n;CbI^yY5t<_hlGIU*AX58t?x<pl#R9>-*aEy{bUp z|4-X>qdrx20O}-Z5`j~v?YdSKNjAx&0{p6qrnLZl|GxkLNlb!D)7n<m0s}P3RTY3q zR{a2@0u)ds$pU}XB&(WalWfyk)dEogs44)Gj0%t>r~pX<5ET_5NdQt+00F2ffF$7$ z>9%bhd$VHOR_!*mZ6%HE`@e;bZ@*(atN0($e@AW`Ig%!AJh6MW_X_|30000000000 z000000000000000000000000$N3-qaqCDD<Z5PjM?`(aWwwt@My02%l@fF*nV_DPs znQV61_Uf#bG2M=g=~|>rWdj?TFx{&itLKDiTz5K!Y4paJ){f0f!ZfZMy}~s5AWY*p zxGqeiUqiw)`esd!?uq%5&qu_3iN4fH)5F`=bZt<WMjx%|-W6-Q)h|q=_vN>;?Hn?f zg=s$TDmTsNueIsCFwN)9()8r9FwN%^*7SRwG~K^pOk=*4n@%q!T6qmCIcBbw&xi*{ zIp)e6U9F7S^8HhO@m6`)c4GfrUiVhQ4VUk4bI#r^??Qg~M_qAkm3zim`Q`a(t>gPx z+n@E;c4^Ys#?XDJZPy!xZ9bi{wx>^wZI0e1Yr8z7ZJ%Oow_A*De0fgWzChUK(>7xp zgKNRqR_;#1HYaGOv5on6zPz5_w)wj*Y%3YtOxfnT#MoxWHdD5_t}?cnvW<10v8`lm eGc$j3U21GIW1AV<qeZ)}es;&!TK~WN0RRBBgIoy! literal 0 HcmV?d00001 From df0326f9ff73d3b2d96d08f6cdefbf80f4051471 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Fri, 9 Dec 2022 18:28:23 +0100 Subject: [PATCH 06/25] Added undefined Size state to useWindowsize --- components/windowsize.tsx | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/components/windowsize.tsx b/components/windowsize.tsx index 27cb575..063fae5 100644 --- a/components/windowsize.tsx +++ b/components/windowsize.tsx @@ -1,9 +1,14 @@ import { useEffect, useState } from "react"; -export default function useWindowSize() { - const [windowSize, setWindowSize] = useState({ - width: 0, - height: 0, +interface ScreenSize { + width: number | undefined; + height: number | undefined; +} + +export default function useWindowSize(): boolean | undefined { + const [windowSize, setWindowSize] = useState<ScreenSize>({ + width: undefined, + height: undefined, }); useEffect(() => { @@ -20,5 +25,10 @@ export default function useWindowSize() { return () => window.removeEventListener("resize", handleResize); }, []); - return windowSize.width <= 1080; + if(typeof(windowSize.width) === "number") { + return windowSize.width <= 1080; + } + else { + return undefined; + } } \ No newline at end of file From fbc815e776abf2510221b491569dd6d0c1d74887 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Fri, 9 Dec 2022 18:28:58 +0100 Subject: [PATCH 07/25] Moved Sidebarplaceholder to sidebar component Potentially equal size to the sidebar in the future --- components/layout.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/components/layout.tsx b/components/layout.tsx index 699bf27..6163070 100644 --- a/components/layout.tsx +++ b/components/layout.tsx @@ -26,7 +26,6 @@ const LayoutReadyOrNot = ({ children }: { children: React.ReactNode }) => { </Script> <Sidebar /> - <div className={styles.sidebarPlaceholder}></div> <main className={styles.main}> {children} </main> From 758cb6a9f036f0dc2af436b57012dc08e87d4479 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Fri, 9 Dec 2022 18:29:47 +0100 Subject: [PATCH 08/25] Various changes Removed debug logging, implemented Issue #7 --- components/sidebar.tsx | 58 ++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 22 deletions(-) diff --git a/components/sidebar.tsx b/components/sidebar.tsx index ccf3a7f..35386ec 100644 --- a/components/sidebar.tsx +++ b/components/sidebar.tsx @@ -15,37 +15,51 @@ function stopPropagation(e: any) { const Sidebar = () => { const isMobile = useWindowSize(); - console.log(isMobile); // DEBUG const router = useRouter(); - const [active, setActive] = useState(!isMobile); - const { maps, isLoading, isError } = useNavbar(); - + const [active, setActive] = useState(isMobile); + const { maps, isLoading, isError }:{ maps: ReadyOrNotMap[], isLoading: boolean, isError: boolean} = useNavbar(); - if (isError) { return (<div><nav><a>Error loading Sidemenu</a></nav></div>) } + if(typeof(isMobile) === "boolean" && typeof(active) === "undefined") { + setActive(!isMobile); + } + + if (isError) { + return ( + <> + <div><nav><a>Error loading Sidemenu</a></nav></div> + <div className={styles.sidebarPlaceholder}></div> + </> + ) + } else if (isLoading) { return ( - <div> - <nav> - <a>Loading...</a> - </nav> - </div> + <> + <div> + <nav> + <a>Loading...</a> + </nav> + </div> + <div className={styles.sidebarPlaceholder}></div> + </> ) } else { - // > is a placeholder return ( - <div className={styles.sidebar} onClick={() => setActive(!active)}> - <nav className={[styles.sidebarList, (active ? styles.sl_active : styles.sl_inactive)].join(" ")}> - {maps.map((item: ReadyOrNotMap) => ( - <Link key={item.name} href={item.href}> - <a className={[styles.navElem, (router.query.map == item.href ? styles.ne_active: styles.ne_inactive)].join(" ")} onClick={stopPropagation}>{item.name}</a> - </Link> - ))} - </nav> - <div className={styles.sidebarArrow}> - <Image src={active ? "/sidebar_arrow_flipped.webp" : "/sidebar_arrow.webp"} width={32} height={96} alt={active ? ">" : "<" }/> + <> + <div className={styles.sidebar} onClick={() => setActive(!active)}> + <nav className={[styles.sidebarList, (active ? styles.sl_active : styles.sl_inactive)].join(" ")}> + {maps.map((item) => ( + <Link key={item.name} href={item.href}> + <a className={[styles.navElem, (router.query.map == item.href ? styles.ne_active : styles.ne_inactive)].join(" ")} onClick={stopPropagation}>{item.name}</a> + </Link> + ))} + </nav> + <div className={styles.sidebarArrow}> + <Image src={active ? "/sidebar_arrow_flipped.webp" : "/sidebar_arrow.webp"} width={32} height={96} alt={active ? ">" : "<"} /> + </div> </div> - </div> + <div className={styles.sidebarPlaceholder}></div> + </> ); } } From e767db6017532eeb38f17110716f5585800c5050 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Fri, 9 Dec 2022 21:38:23 +0100 Subject: [PATCH 09/25] Added transition to the sidebar --- components/sidebar.tsx | 20 +++++++++++--------- styles/ReadyOrNot.module.css | 20 +++++++++++++++++--- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/components/sidebar.tsx b/components/sidebar.tsx index 35386ec..cf5e055 100644 --- a/components/sidebar.tsx +++ b/components/sidebar.tsx @@ -17,9 +17,9 @@ const Sidebar = () => { const isMobile = useWindowSize(); const router = useRouter(); const [active, setActive] = useState(isMobile); - const { maps, isLoading, isError }:{ maps: ReadyOrNotMap[], isLoading: boolean, isError: boolean} = useNavbar(); + const { maps, isLoading, isError }: { maps: ReadyOrNotMap[], isLoading: boolean, isError: boolean } = useNavbar(); - if(typeof(isMobile) === "boolean" && typeof(active) === "undefined") { + if (typeof (isMobile) === "boolean" && typeof (active) === "undefined") { setActive(!isMobile); } @@ -47,13 +47,15 @@ const Sidebar = () => { return ( <> <div className={styles.sidebar} onClick={() => setActive(!active)}> - <nav className={[styles.sidebarList, (active ? styles.sl_active : styles.sl_inactive)].join(" ")}> - {maps.map((item) => ( - <Link key={item.name} href={item.href}> - <a className={[styles.navElem, (router.query.map == item.href ? styles.ne_active : styles.ne_inactive)].join(" ")} onClick={stopPropagation}>{item.name}</a> - </Link> - ))} - </nav> + <div className={[styles.sl_wrapper, (active ? styles.sl_active : styles.sl_inactive)].join(" ")}> + <nav className={styles.sidebarList}> + {maps.map((item) => ( + <Link key={item.name} href={item.href}> + <a className={[styles.navElem, (router.query.map == item.href ? styles.ne_active : styles.ne_inactive)].join(" ")} onClick={stopPropagation}>{item.name}</a> + </Link> + ))} + </nav> + </div> <div className={styles.sidebarArrow}> <Image src={active ? "/sidebar_arrow_flipped.webp" : "/sidebar_arrow.webp"} width={32} height={96} alt={active ? ">" : "<"} /> </div> diff --git a/styles/ReadyOrNot.module.css b/styles/ReadyOrNot.module.css index 2577839..9c46365 100644 --- a/styles/ReadyOrNot.module.css +++ b/styles/ReadyOrNot.module.css @@ -174,15 +174,16 @@ .sidebarList { overflow-y: scroll; + overflow-x: hidden; scrollbar-width: none; height: 100%; display: flex; flex-direction: column; - padding: 2rem; flex-wrap: nowrap; justify-content: flex-start; align-items: flex-start; background-color: var(--background_grey_opaque); + padding: 2rem; } .sidebar::-webkit-scrollbar { @@ -190,15 +191,28 @@ background: transparent; } +.sl_wrapper { + height: 100%; + overflow: hidden; + transition-property: width, visibility; + transition-timing-function: ease-in-out, linear; + transition-duration: 0.3s, 0s; +} + .sl_active { - display: flex; + visibility: visible; + width: 97%; + transition-delay: 0s, 0s; } .sl_inactive { - display: none; + visibility: hidden; + width: 0; + transition-delay: 0s, 0.3s; } .navElem { + white-space:nowrap; font-size: 14pt; width: auto; border-radius: 5px; From ac25eb37084d1de70ce955316bd3adbff58a62a9 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Fri, 9 Dec 2022 22:02:27 +0100 Subject: [PATCH 10/25] Typo in Dockerfile --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index cc2de22..f12604d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,7 @@ RUN yarn build FROM node:16-alpine AS runner LABEL author="neshura@proton.me" -WORKDIR /usr/src/ap +WORKDIR /usr/src/app ENV NODE_ENV production From aaad32a51dd33f36766fd8663c9e35155ec2c9b7 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Wed, 14 Dec 2022 18:39:39 +0100 Subject: [PATCH 11/25] Renamed Sidebar component and updated Node Version --- Dockerfile | 4 ++-- pages/api/navbar.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index f12604d..b5a9bf4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN yarn install --frozen-lockfile ## BUILD STEP # Rebuild the source code only when needed -FROM node:16-alpine AS builder +FROM node:18-alpine AS builder WORKDIR /app @@ -23,7 +23,7 @@ COPY . . RUN yarn build ## RUN STEP -FROM node:16-alpine AS runner +FROM node:18-alpine AS runner LABEL author="neshura@proton.me" WORKDIR /usr/src/app diff --git a/pages/api/navbar.tsx b/pages/api/navbar.tsx index 18ea552..1ec8953 100644 --- a/pages/api/navbar.tsx +++ b/pages/api/navbar.tsx @@ -3,7 +3,7 @@ import fsPromises from 'fs/promises' import path from 'path' import ReadyOrNotMap from '../../interfaces/ReadyOrNot' -export default async function TobarApi(req: any, res: any) { +export default async function SidebarAPI(req: any, res: any) { try { // get list of all folders(maps) in the readyornot folder - maybe there is a cleaner way to do this? var fs = require('fs') From 098a4cad1d75113ec4a6fbd9ac05bc52af7d9f23 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Sat, 14 Jan 2023 21:09:01 +0100 Subject: [PATCH 12/25] URL-fix --- components/layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/layout.tsx b/components/layout.tsx index 6163070..7425eee 100644 --- a/components/layout.tsx +++ b/components/layout.tsx @@ -11,12 +11,12 @@ const LayoutReadyOrNot = ({ children }: { children: React.ReactNode }) => { var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(["setDocumentTitle", document.domain + "/" + document.title]); - _paq.push(["setCookieDomain", "readyornot.neshura-server.net"]); + _paq.push(["setCookieDomain", "readyornot.neshweb.net"]); _paq.push(["disableCookies"]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { - var u="//temp.neshura-server.net/"; + var u="//tracking.neshweb.net/"; _paq.push(['setTrackerUrl', u+'matomo.php']); _paq.push(['setSiteId', '2']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; From 9406dbdc5de7dfd42d576f4bfb66f0d6f6f16d95 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Mon, 6 Mar 2023 18:29:59 +0100 Subject: [PATCH 13/25] Change Port to 8002 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 19e5582..4d7884b 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "0.1.0", "private": true, "scripts": { - "dev:debug": "NODE_OPTIONS='--inspect' next dev -p 4042", - "dev": "next dev", + "dev:debug": "NODE_OPTIONS='--inspect' next dev -p 8002", + "dev": "next dev -p 8002", "build": "next build", "start": "next start", "lint": "next lint" From 8a2e88e3024b66cc9c5726ad9e1128ccd4bdf114 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Mon, 6 Mar 2023 18:39:37 +0100 Subject: [PATCH 14/25] Changed Port for Production --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4d7884b..116ade8 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev:debug": "NODE_OPTIONS='--inspect' next dev -p 8002", "dev": "next dev -p 8002", "build": "next build", - "start": "next start", + "start": "next start -p 8002", "lint": "next lint" }, "dependencies": { From 12c7ef2a8ee1ea89aceb160f64236754971d2887 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Mon, 6 Mar 2023 18:47:14 +0100 Subject: [PATCH 15/25] Change Host to IPv6 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 116ade8..9158e47 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,10 @@ "version": "0.1.0", "private": true, "scripts": { - "dev:debug": "NODE_OPTIONS='--inspect' next dev -p 8002", - "dev": "next dev -p 8002", + "dev:debug": "NODE_OPTIONS='--inspect' next dev -H :: -p 8002", + "dev": "next dev -H :: -p 8002", "build": "next build", - "start": "next start -p 8002", + "start": "next start -H :: -p 8002", "lint": "next lint" }, "dependencies": { From 41174772830e929e94c49300c9a8b05510c58ba3 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@proton.me> Date: Mon, 6 Mar 2023 19:07:52 +0100 Subject: [PATCH 16/25] Update package.json --- package.json | 3 ++- yarn.lock | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 9158e47..2a9cd26 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,10 @@ "swr": "^1.3.0" }, "devDependencies": { + "@types/node": "18.14.6", + "@types/react": "^18.0.14", "eslint": "^8.23.1", "eslint-config-next": "12.2.0", - "@types/react": "^18.0.14", "typescript": "4.9.3" } } diff --git a/yarn.lock b/yarn.lock index 23a6f54..b9af874 100644 --- a/yarn.lock +++ b/yarn.lock @@ -166,6 +166,11 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== +"@types/node@18.14.6": + version "18.14.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.14.6.tgz#ae1973dd2b1eeb1825695bb11ebfb746d27e3e93" + integrity sha512-93+VvleD3mXwlLI/xASjw0FzKcwzl3OdTCzm1LaRfqgS21gfFtK3zDXM5Op9TeeMsJVOaJ2VRDpT9q4Y3d0AvA== + "@types/prop-types@*": version "15.7.5" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" From 9d7109d66cafb0ef8329e7a83545631ad35efdd7 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@neshweb.net> Date: Wed, 20 Dec 2023 22:03:04 +0100 Subject: [PATCH 17/25] Update Dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5a9bf4..de808cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ## INIT STEP # Install dependencies only when needed -FROM node:16-alpine AS deps +FROM node:18-alpine AS deps RUN apk add --no-cache libc6-compat WORKDIR /app @@ -25,7 +25,7 @@ RUN yarn build ## RUN STEP FROM node:18-alpine AS runner -LABEL author="neshura@proton.me" +LABEL author="neshura@neshweb.net" WORKDIR /usr/src/app ENV NODE_ENV production From 4bc9ef0804c215bd8e6ef1fe81d5dd5cbe7fb43b Mon Sep 17 00:00:00 2001 From: Neshura <neshura@neshweb.net> Date: Wed, 20 Dec 2023 22:03:28 +0100 Subject: [PATCH 18/25] Update .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index c29dfdc..72d7a01 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ yarn-error.log* build/ data/ confs/ + +.idea/ From 929df2f3bbb88f51b4032f1cffb67fa22c832e28 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@neshweb.net> Date: Wed, 20 Dec 2023 22:03:36 +0100 Subject: [PATCH 19/25] Add Forgejo Actions --- .forgejo/workflows/build+release.yml | 82 ++++++++++++++++++++++++++++ .forgejo/workflows/test.yml | 35 ++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 .forgejo/workflows/build+release.yml create mode 100644 .forgejo/workflows/test.yml diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml new file mode 100644 index 0000000..570df28 --- /dev/null +++ b/.forgejo/workflows/build+release.yml @@ -0,0 +1,82 @@ +name: 'Build and Release Docker Image' +author: 'Neshura' + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' +jobs: + test: + runs-on: docker + steps: + - + name: Checking Out Repository Code + uses: https://code.forgejo.org/actions/checkout@v3 + - + name: Get Yarn Cache Directory + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + - + name: Set Up Yarn Cache + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - + name: Install Dependencies + run: yarn install + - + name: Run Linter + run: yarn lint + - + name: Check if Version in package.json matches Tag + run: | + echo "Test" + VERSION=$(cat package.json | grep "version" | sed 's/.*://' | tr -d , | tr -d \" ) + if test $VERSION != "${{ github.ref_name }}"; then + echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'"; + exit 1 + else + echo "Version is: '$VERSION'"; + fi + + build: + needs: test + if: success() + runs-on: dind + steps: + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + registry: forgejo.neshweb.net + username: ${{ secrets.FORGEJO_USERNAME }} + password: ${{ secrets.FORGEJO_TOKEN }} + - + name: Push to Package Registry + uses: docker/build-push-action@v5 + with: + push: true + tags: forgejo.neshweb.net/neshweb-sites/readyornot:${{ github.ref_name }}, forgejo.neshweb.net/neshweb-sites/readyornot:latest + + release: + needs: build + if: success() + runs-on: docker + steps: + - + name: Release New Version + uses: actions/forgejo-release@v1 + with: + direction: upload + url: https://forgejo.neshweb.net + release-dir: release + token: ${{ secrets.FORGEJO_TOKEN }} + tag: ${{ github.ref_name }} \ No newline at end of file diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml new file mode 100644 index 0000000..570d370 --- /dev/null +++ b/.forgejo/workflows/test.yml @@ -0,0 +1,35 @@ +name: 'Run Tests on Code' +author: 'Neshura' + +on: + push: + tags-ignore: + - '**' + branches: + - '**' +jobs: + test: + runs-on: docker + steps: + - + name: Checking Out Repository Code + uses: https://code.forgejo.org/actions/checkout@v3 + - + name: Get Yarn Cache Directory + id: yarn-cache-dir-path + run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT + - + name: Set Up Yarn Cache + uses: actions/cache@v3 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - + name: Install Dependencies + run: yarn install + - + name: Run Linter + run: yarn lint \ No newline at end of file From 46c5b39d6b7e83cdd837104cbef8d6a8626f5a1d Mon Sep 17 00:00:00 2001 From: Neshura <neshura@neshweb.net> Date: Wed, 20 Dec 2023 22:04:41 +0100 Subject: [PATCH 20/25] Release 0.1.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2a9cd26..1f521bc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readyornot", - "version": "0.1.0", + "version": "0.1.7", "private": true, "scripts": { "dev:debug": "NODE_OPTIONS='--inspect' next dev -H :: -p 8002", From 197b10cccf6c40c5fe1a70f2aa5abb06f78e5910 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@noreply.forgejo.neshweb.net> Date: Wed, 20 Dec 2023 21:27:22 +0000 Subject: [PATCH 21/25] Update .forgejo/workflows/build+release.yml --- .forgejo/workflows/build+release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index 570df28..6c1955b 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -35,8 +35,7 @@ jobs: - name: Check if Version in package.json matches Tag run: | - echo "Test" - VERSION=$(cat package.json | grep "version" | sed 's/.*://' | tr -d , | tr -d \" ) + VERSION=$(cat package.json | grep "version" | sed 's/.*://' | tr -d , | tr -d \" | tr -d " " ) if test $VERSION != "${{ github.ref_name }}"; then echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'"; exit 1 From 8fda8a730950a0c59e1fed6c3cda8fa24a9ba989 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@neshweb.net> Date: Wed, 20 Dec 2023 22:32:28 +0100 Subject: [PATCH 22/25] Remove Gitlab CI & Fix Dockerfile --- .gitlab-ci.yml | 65 -------------------------------------------------- Dockerfile | 1 + 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index e8e1c18..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,65 +0,0 @@ -stages: - - lint - #- test - - build - - deploy - -variables: - IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG - IMAGE_LATEST: $CI_REGISTRY_IMAGE:develop - - -.node: - image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/node:latest - - -.docker: - image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker:20 - rules: - - if: $CI_COMMIT_TAG && $CI_COMMIT_TAG !~ /(^t)+.*/ - variables: - IMAGE_LATEST: $CI_REGISTRY_IMAGE:latest - - if: $CI_COMMIT_TAG - - -linter: - image: !reference [.node, image] - stage: lint - before_script: - - yarn install - script: - - yarn lint - - -build: - image: !reference [.docker, image] - stage: build - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - script: - - docker build -t $IMAGE_TAG . - after_script: - - docker save $IMAGE_TAG > docker.tar - artifacts: - expire_in: 30 mins - paths: - - docker.tar - rules: - - !reference [.docker, rules] - - -push: - image: !reference [.docker, image] - stage: deploy - needs: - - job: build - artifacts: true - before_script: - - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - - docker load -i docker.tar - script: - - docker tag $IMAGE_TAG $IMAGE_LATEST - - docker push $IMAGE_TAG - - docker push $IMAGE_LATEST - rules: - - !reference [.docker, rules] diff --git a/Dockerfile b/Dockerfile index de808cd..645c82d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,7 @@ WORKDIR /app # Copy the files needed to install deps COPY package.json yarn.lock ./ +RUN yarn add sharp RUN yarn install --frozen-lockfile ## BUILD STEP From a5e6c6fa3b2690645ebd3c69fa476493414cc58b Mon Sep 17 00:00:00 2001 From: Neshura <neshura@neshweb.net> Date: Wed, 20 Dec 2023 22:32:39 +0100 Subject: [PATCH 23/25] Release 0.1.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1f521bc..f5d1313 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readyornot", - "version": "0.1.7", + "version": "0.1.8", "private": true, "scripts": { "dev:debug": "NODE_OPTIONS='--inspect' next dev -H :: -p 8002", From a54baf4b3dd740d9e5c862c7d2a884a734c11203 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@noreply.forgejo.neshweb.net> Date: Mon, 1 Jan 2024 20:42:26 +0000 Subject: [PATCH 24/25] Setup registry for buildx + Update CI to current defaults --- .forgejo/workflows/build+release.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index 6c1955b..44bb69d 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -5,7 +5,7 @@ on: push: tags: - '[0-9]+.[0-9]+.[0-9]+' - - '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' + - '[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+' jobs: test: runs-on: docker @@ -51,6 +51,10 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + config-inline: | + [registry."docker.io"] + mirrors = ["https://docker-cache.neshweb.net"] - name: Login to Docker Hub uses: docker/login-action@v3 @@ -58,12 +62,22 @@ jobs: registry: forgejo.neshweb.net username: ${{ secrets.FORGEJO_USERNAME }} password: ${{ secrets.FORGEJO_TOKEN }} + - + name: Determine Docker tags + id: tags + run: | + if echo ${{ github.ref_name }} | grep -qi '\-rc' ; then + echo latest=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:preview >> $GITHUB_OUTPUT; + else + echo latest=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:latest >> $GITHUB_OUTPUT; + fi + echo version=forgejo.neshweb.net/neshweb-sites/${{ github.event.repository.name }}:${{ github.ref_name }} >> $GITHUB_OUTPUT; - name: Push to Package Registry uses: docker/build-push-action@v5 with: push: true - tags: forgejo.neshweb.net/neshweb-sites/readyornot:${{ github.ref_name }}, forgejo.neshweb.net/neshweb-sites/readyornot:latest + tags: ${{ steps.tags.outputs.version }}, ${{ steps.tags.outputs.latest }} release: needs: build From 025ff6a42fd934fbb9e244d49321c1c7da91a5b7 Mon Sep 17 00:00:00 2001 From: Neshura <neshura@noreply.forgejo.neshweb.net> Date: Mon, 1 Jan 2024 20:51:22 +0000 Subject: [PATCH 25/25] Fix indenting --- .forgejo/workflows/build+release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/build+release.yml b/.forgejo/workflows/build+release.yml index 44bb69d..2b43104 100644 --- a/.forgejo/workflows/build+release.yml +++ b/.forgejo/workflows/build+release.yml @@ -37,10 +37,10 @@ jobs: run: | VERSION=$(cat package.json | grep "version" | sed 's/.*://' | tr -d , | tr -d \" | tr -d " " ) if test $VERSION != "${{ github.ref_name }}"; then - echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'"; - exit 1 + echo "Expected Version is: '${{ github.ref_name }}' actual Version is: '$VERSION'"; + exit 1 else - echo "Version is: '$VERSION'"; + echo "Version is: '$VERSION'"; fi build: