Skip to content

Commit

Permalink
Revert "Merge branch 'main' into dev"
Browse files Browse the repository at this point in the history
This reverts commit 1fcfe5b, reversing
changes made to cd7756b.
  • Loading branch information
michaelbrusegard committed Oct 24, 2024
1 parent 1fcfe5b commit cf7d669
Show file tree
Hide file tree
Showing 80 changed files with 522 additions and 2,086 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,9 @@ jobs:
FEIDE_TOKEN_ENDPOINT: "https://auth.dataporten.no/oauth/token"
FEIDE_USERINFO_ENDPOINT: "https://auth.dataporten.no/openid/userinfo"
NEXT_PUBLIC_SITE_URL: "http://localhost:3000"
LHCI_TOKEN: ${{ secrets.LHCI_BUILD_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 20
- name: Fetch base_ref HEAD
run: git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
- name: Setup bun
uses: oven-sh/setup-bun@v2
with:
Expand All @@ -59,5 +54,5 @@ jobs:
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
run: |
bun add -g @lhci/cli@0.14.x
bun add -g @lhci/cli@0.13.x
lhci autorun
2 changes: 1 addition & 1 deletion .github/workflows/deploy-script.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
jobs:
script:
name: Script
runs-on: self-hosted
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- uses: appleboy/[email protected]
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,3 @@ public/robots.txt

# data
/data

# Ignore husky files, see PR #54
/.husky/*
60 changes: 60 additions & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}

call_lefthook run "pre-commit" "$@"
60 changes: 60 additions & 0 deletions .husky/_/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}

call_lefthook run "prepare-commit-msg" "$@"
3 changes: 0 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"enabled": true,
"rules": {
"recommended": true,
"a11y": {
"useSemanticElements": "off"
},
"nursery": {
"useSortedClasses": {
"level": "warn",
Expand Down
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Use type safe message keys with `next-intl`
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
type Messages = typeof import('./messages/en.json');
// eslint-disable-next-line @typescript-eslint/no-empty-interface
declare interface IntlMessages extends Messages {}
2 changes: 1 addition & 1 deletion lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,tsx,json}"
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
stage_fixed: true
run: bunx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off {staged_files}
66 changes: 0 additions & 66 deletions lighthouserc.cjs

This file was deleted.

37 changes: 37 additions & 0 deletions lighthouserc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ci:
collect:
url:
- 'http://localhost:3000/en'
- 'http://localhost:3000/en/events'
- 'http://localhost:3000/en/news'
- 'http://localhost:3000/en/news/1'
- 'http://localhost:3000/en/about'
startServerCommand: 'bun run start'
upload:
target: 'temporary-public-storage'
assert:
preset: 'lighthouse:recommended'
assertions:
first-contentful-paint:
- error
- maxNumericValue: 2000
aggregationMethod: optimistic
interactive:
- error
- maxNumericValue: 5000
aggregationMethod: optimistic
bf-cache: 'off'
csp-xss: 'off'
identical-links-same-purpose: 'off'
total-byte-weight: 'off'
color-contrast: 'off'
heading-order: 'off'
mainthread-work-breakdown: 'off'
bootup-time: 'off'
largest-contentful-paint: 'off'
dom-size: 'off'
render-blocking-resources: 'off'
server-response-time: 'off'
uses-responsive-images: 'off'
maskable-icon: 'off'
installable-manifest: 'off'
54 changes: 3 additions & 51 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,7 @@
"next": "Next",
"goToNextPage": "Go to next page",
"morePages": "More pages",
"page": "page",
"category": "category",
"sort": "sort",
"photoOf": "Photo of {name}"
},
"error": {
"notFound": "404 - Page not found",
"notFoundDescription": "Oops! Looks like this page got lost in cyberspace.",
"error": "Oops! Something went wrong",
"errorDescription": "Don't worry, our best hackers are on it!",
"goToHomepage": "Return to homepage",
"tryAgain": "Try again"
"page": "page"
},
"layout": {
"hackerspaceHome": "Hackerspace homepage",
Expand Down Expand Up @@ -63,15 +52,13 @@
},
"storage": {
"title": "Storage",
"searchPlaceholder": "Search for product...",
"card": {
"quantityInfo": "{quantity} units",
"addToCart": "Add to cart",
"removeFromCart": "Remove from cart"
"addToCart": "Add to cart"
},
"select": {
"ariaLabel": "Select how to filter the storage items",
"filters": "Filters",
"defaultPlaceholder": "Sort results",
"popularity": "Popularity",
"sortDescending": "Inventory (descending)",
"sortAscending": "Inventory (ascending)",
Expand All @@ -85,43 +72,8 @@
"peripherals": "PC peripherals",
"miniPC": "Mini PC"
},
"searchParams": {
"popularity": "popularity",
"descending": "descending",
"ascending": "ascending",
"name": "name",
"cables": "cables",
"sensors": "sensors",
"peripherals": "peripherals",
"miniPC": "minipc"
},
"tooltips": {
"viewShoppingCart": "View shopping cart"
},
"shoppingCart": {
"title": "Shopping Cart",
"productId": "Product ID",
"productName": "Product Name",
"location": "Location",
"unitsAvailable": "Units available",
"tableDescription": "A list of your shopping cart items.",
"backToStorage": "Back to storage",
"cartEmpty": "Your shopping cart is empty.",
"clearCart": "Empty shopping cart",
"cancel": "Cancel",
"clear": "Clear",
"clearCartDescription": "Are you sure you want to clear your shopping cart? All items will be removed.",
"borrowNow": "Borrow now",
"amountOfItemARIA": "Select number of this item"
},
"loanForm": {
"name": "Name",
"email": "Email",
"phoneNumber": "Phone number",
"phoneNumberDescription": "Phone number for contact. Include country code if the number isn't Norwegian.",
"returnBy": "Return by",
"returnByDescription": "Select how long you would like to borrow the item for.",
"submit": "Submit"
}
}
}
Loading

0 comments on commit cf7d669

Please sign in to comment.