Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update packages, add favicons #141

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Nuxt",
"image": "ghcr.io/acdh-oeaw/devcontainer-frontend:20",
"customizations": {
"vscode": {
"extensions": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"lokalise.i18n-ally",
"mikestead.dotenv",
"ms-playwright.playwright",
"nuxt.mdc",
"stylelint.vscode-stylelint",
"vue.volar"
]
}
}
}
43 changes: 29 additions & 14 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
node_modules/
.pnpm-store/

# nuxt.js
dist
.nuxt/
.nitro/
.output/

# logs
*.log

Expand All @@ -23,27 +17,48 @@ dist
.stylelintcache
*.tsbuildinfo

# vercel
.vercel

# misc
.DS_Store
.idea/

# nuxt.js
dist
.data/
.nuxt/
.nitro/
.output/

# generated assets
/public/**/favicon.ico
/public/**/icon.svg
/public/**/android-chrome-192x192.png
/public/**/android-chrome-512x512.png
/public/**/apple-touch-icon.png
/public/**/app.webmanifest
/public/**/image.webp
# playwright
/blob-report/
/playwright/.cache/
/playwright-report/
/test-results/


## .dockerignore ##

# git
.git/
.gitattributes
.gitignore

# github
.github/

# vscode settings
.vscode/

# environment variables
.env
.env.*

# tests
playwright.config.ts
/e2e/
/test/

# misc
.editorconfig
9 changes: 0 additions & 9 deletions .env.example

This file was deleted.

24 changes: 24 additions & 0 deletions .env.local.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -------------------------------------------------------------------------------------------------
# app
# -------------------------------------------------------------------------------------------------
NUXT_PUBLIC_APP_BASE_URL="http://localhost:3000"
# imprint service
NUXT_PUBLIC_REDMINE_ID="21622"
# web crawlers
NUXT_PUBLIC_BOTS="disabled"

# -------------------------------------------------------------------------------------------------
# analytics
# -------------------------------------------------------------------------------------------------
# NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION=
NUXT_PUBLIC_MATOMO_BASE_URL="https://matomo.acdh.oeaw.ac.at"
# NUXT_PUBLIC_MATOMO_ID=

# -------------------------------------------------------------------------------------------------
# typesense
# -------------------------------------------------------------------------------------------------
NUXT_PUBLIC_TYPESENSE_API_KEY="nFUaLp9SuREfD8Z5V4YospgXLtXyjfRG"
NUXT_PUBLIC_TYPESENSE_COLLECTION_PREFIX="viecpro_"
NUXT_PUBLIC_TYPESENSE_HOST="typesense.acdh-dev.oeaw.ac.at"
NUXT_PUBLIC_TYPESENSE_PORT="443"
NUXT_PUBLIC_TYPESENSE_PROTOCOL="https"
12 changes: 9 additions & 3 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,27 @@ jobs:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install -g pnpm@8 && pnpm install
run: npm install -g pnpm@9 && pnpm install

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps

- name: Build app
run: pnpm run build
env:
NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000"
NUXT_PUBLIC_REDMINE_ID: "${{ vars.NUXT_PUBLIC_REDMINE_ID }}"

- name: Run Playwright tests
run: pnpm exec playwright test

- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
32 changes: 13 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
node_modules/
.pnpm-store/

# nuxt.js
dist
.nuxt/
.nitro/
.output/

# logs
*.log

Expand All @@ -21,22 +15,22 @@ dist
.stylelintcache
*.tsbuildinfo

# vercel
.vercel

# misc
.DS_Store
.idea
.idea/

# generated assets
/public/**/favicon.ico
/public/**/icon.svg
/public/**/android-chrome-192x192.png
/public/**/android-chrome-512x512.png
/public/**/apple-touch-icon.png
/public/**/app.webmanifest
/public/**/image.webp
# nuxt.js
dist
.data/
.nuxt/
.nitro/
.output/

# notes
DEV_NOTES.md
/test-results/
/playwright-report/
# playwright
/blob-report/
/playwright/.cache/
/playwright-report/
/test-results/
6 changes: 1 addition & 5 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
engine-strict=true
# still necessary for nuxt 3
# @see https://github.com/nuxt/nuxt/issues/14146
shamefully-hoist=true
shell-emulator=true
use-node-version=20.10.0
package-manager-strict=false
shell-emulator=true
25 changes: 25 additions & 0 deletions .vscode/app.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"Nuxt static page component": {
"scope": "vue",
"prefix": "nuxt-page-static",
"body": [
"<script lang=\"ts\" setup>",
"defineRouteRules({",
"\tprerender: true,",
"});",
"",
"const t = useTranslations();",
"",
"usePageMetadata({",
"\ttitle: \"${1:Name}Page.meta.title\",",
"});",
"</script>",
"",
"<template>",
"\t<MainContent class=\"container grid content-start gap-y-8 py-8\">",
"\t\t<PageTitle>{{ t(\"${1:Name}Page.title\") }}</PageTitle>",
"\t</MainContent>",
"</template>",
],
},
}
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
"recommendations": [
"bradlc.vscode-tailwindcss",
"dbaeumer.vscode-eslint",
"editorConfig.editorConfig",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"lokalise.i18n-ally",
"mikestead.dotenv",
"ms-playwright.playwright",
"nuxt.mdc",
"stylelint.vscode-stylelint",
"vue.volar"
]
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "App: Web (server-side)",
"request": "launch",
"runtimeArgs": ["run", "dev"],
"runtimeExecutable": "npm",
"runtimeExecutable": "pnpm",
"skipFiles": ["<node_internals>/**"],
"type": "node"
},
Expand Down
23 changes: 18 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,26 @@
"strings": true
},
"editor.rulers": [100],
"editor.stickyScroll.enabled": true,
"eslint.enable": true,
"eslint.options": {
"ignorePath": ".gitignore"
},
"eslint.validate": ["javascript", "typescript", "vue"],
"files.associations": {
"*.css": "tailwindcss"
},
"files.eol": "\n",
"html.autoCreateQuotes": false,
"i18n-ally.annotations": false,
"i18n-ally.keepFulfilled": true,
"i18n-ally.keystyle": "nested",
"i18n-ally.localesPaths": ["./messages"],
"i18n-ally.review.enabled": false,
"i18n-ally.sortKeys": true,
"i18n-ally.tabStyle": "tab",
"less.validate": false,
"prettier.ignorePath": ".gitignore",
"scss.validate": false,
"stylelint.enable": true,
"stylelint.snippet": ["css", "postcss", "tailwindcss", "vue"],
Expand All @@ -28,14 +40,15 @@
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.inlayHints.parameterNames.enabled": "all",
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.preferTypeOnlyAutoImports": true,
"typescript.tsdk": "node_modules/typescript/lib",
"volar.inlayHints.eventArgumentInInlineHandlers": false,
"workbench.editor.labelFormat": "medium",
"workbench.tree.enableStickyScroll": true,
"[markdown]": {
"editor.wordWrap": "on"
},
"[mdc]": {
"editor.defaultFormatter": null
},
"i18n-ally.localesPaths": ["locales"],
"i18n-ally.keystyle": "nested"
"editor.defaultFormatter": null,
"editor.wordWrap": "on"
}
}
33 changes: 19 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
# syntax=docker/dockerfile:1

# using alpine base image to avoid `sharp` memory leaks.
# @see https://sharp.pixelplumbing.com/install#linux-memory-allocator

# build
FROM node:18-slim AS build
FROM node:20-alpine AS build

RUN corepack enable

RUN mkdir /app && chown -R node:node /app
WORKDIR /app

USER node

COPY --chown=node:node .npmrc package.json pnpm-lock.yaml ./

RUN pnpm fetch

COPY --chown=node:node ./ ./

ARG NUXT_PUBLIC_APP_BASE_URL
ARG NUXT_PUBLIC_BOTS
ARG NUXT_PUBLIC_GOOGLE_SITE_VERIFICATION
ARG NUXT_PUBLIC_MATOMO_BASE_URL
ARG NUXT_PUBLIC_MATOMO_ID
ARG NUXT_PUBLIC_REDMINE_ID
ARG NUXT_PUBLIC_TYPESENSE_API_KEY
ARG NUXT_PUBLIC_TYPESENSE_COLLECTION_PREFIX
ARG NUXT_PUBLIC_TYPESENSE_HOST
ARG NUXT_PUBLIC_TYPESENSE_PORT
ARG NUXT_PUBLIC_TYPESENSE_PROTOCOL
ARG NUXT_PUBLIC_TYPESENSE_HOST
ARG NUXT_PUBLIC_TYPESENSE_COLLECTION_PREFIX

COPY --chown=node:node .npmrc package.json package-lock.json ./
COPY --chown=node:node nuxt.config.ts tailwind.config.cjs tsconfig.json ./
COPY --chown=node:node scripts ./scripts
COPY --chown=node:node config ./config
COPY --chown=node:node public ./public
COPY --chown=node:node src ./
COPY --chown=node:node patches ./patches

RUN npm install --ci --no-audit --no-fund
RUN pnpm install --frozen-lockfile --offline

ENV NODE_ENV=production

RUN npm run build
RUN pnpm run build

# serve
FROM node:18-slim AS serve
FROM node:20-alpine AS serve

RUN mkdir /app && chown -R node:node /app
WORKDIR /app
Expand Down
13 changes: 0 additions & 13 deletions app/router.options.ts

This file was deleted.

4 changes: 2 additions & 2 deletions components/app-header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ defineProps<{ compact?: boolean }>();
<div class="md:hidden">
<Menu v-slot="{ open, close }" as="div" class="relative z-50 inline-block">
<MenuButton as="button" class="rounded border border-gray-300 p-2">
<X v-if="open" class="h-6 w-6 shrink-0" />
<MenuIcon v-else class="h-6 w-6 shrink-0" />
<X v-if="open" class="size-6 shrink-0" />
<MenuIcon v-else class="size-6 shrink-0" />
<span class="sr-only">Open/Close Menu</span>
</MenuButton>
<MenuTransition>
Expand Down
Loading
Loading