From 6c8482fc677da40d6ec7f94c4699104c3952dd9f Mon Sep 17 00:00:00 2001 From: Stefan Probst Date: Sun, 27 Oct 2024 16:22:08 +0100 Subject: [PATCH] refactor: adopt nuxt v4 folder structure, remove unused deps --- .dockerignore | 2 +- .github/workflows/build-deploy.yml | 12 +- .github/workflows/validate.yml | 6 +- .gitignore | 2 +- .vscode/app.code-snippets | 6 +- .vscode/settings.json | 9 +- app.vue => app/app.vue | 0 {components => app/components}/app-footer.vue | 0 {components => app/components}/app-header.vue | 0 .../components}/book-overview.vue | 0 .../components}/color-scheme-switcher.vue | 0 .../components}/content/prose-a.vue | 0 .../components}/content/prose-img.vue | 0 .../components}/detail-disclosure.vue | 0 .../components}/detail-page.vue | 0 .../components}/error-boundary.vue | 0 {components => app/components}/facet.vue | 0 .../components}/family-tree.vue | 0 .../components}/graph-viz.client.vue | 0 .../components}/iiif-viewer.vue | 0 {components => app/components}/imprint.vue | 2 +- .../components}/main-content.vue | 0 {components => app/components}/map.vue | 0 {components => app/components}/nav-link.vue | 0 .../components}/networkVisualization.vue | 0 {components => app/components}/pagination.vue | 0 .../components}/reference-button.vue | 0 .../components}/route-announcer.vue | 0 .../components}/search-navigation.vue | 0 .../components}/search-page.vue | 0 .../components}/search-table.vue | 0 {components => app/components}/skip-link.vue | 0 .../components}/timeline/timeline-entry.vue | 0 .../components}/timeline/timeline.vue | 0 .../timeline/vertical-timeline-entry.vue | 0 .../timeline/vertical-timeline.vue | 0 .../components}/ui/centered.vue | 0 {components => app/components}/ui/loader.vue | 0 .../components}/ui/page-title.vue | 0 .../composables}/use-locale.ts | 0 .../composables}/use-translations.ts | 0 {config => app/config}/i18n.config.ts | 2 +- {config => app/config}/imprint.config.ts | 0 error.vue => app/error.vue | 0 {layouts => app/layouts}/default.vue | 16 +- {lib => app/lib}/colors.ts | 0 {lib => app/lib}/group-relations.ts | 0 {lib => app/lib}/load-network-data.ts | 0 {pages => app/pages}/detail/event/[id].vue | 0 {pages => app/pages}/detail/function/[id].vue | 0 .../pages}/detail/institution/[id].vue | 0 {pages => app/pages}/detail/person/[id].vue | 0 {pages => app/pages}/detail/place/[id].vue | 0 {pages => app/pages}/detail/salary/[id].vue | 0 {pages => app/pages}/iiif.vue | 0 {pages => app/pages}/imprint.vue | 0 {pages => app/pages}/index.vue | 3 +- {pages => app/pages}/network.vue | 0 {pages => app/pages}/search.vue | 0 {pages => app/pages}/search/events.vue | 0 {pages => app/pages}/search/functions.vue | 0 {pages => app/pages}/search/institutions.vue | 0 {pages => app/pages}/search/persons.vue | 0 {pages => app/pages}/search/places.vue | 0 {pages => app/pages}/search/salaries.vue | 0 {plugins => app/plugins}/api.ts | 7 +- {plugins => app/plugins}/query-client.ts | 0 {styles => app/styles}/index.css | 0 {types => app/types}/i18n.d.ts | 0 {types => app/types}/nuxt.d.ts | 0 {types => app/types}/resulttypes.d.ts | 0 {types => app/types}/timeline.ts | 0 {utils => app/utils}/analytics.ts | 0 {utils => app/utils}/safe-json-ld-replacer.ts | 0 {utils => app/utils}/slice-trailing-slash.ts | 0 {utils => app/utils}/timeline-utils.ts | 0 e2e/lib/fixtures/i18n.ts | 2 +- e2e/tsconfig.json | 2 +- i18n.config.ts => i18n/i18n.config.ts | 0 {messages => i18n/messages}/de.json | 0 nuxt.config.ts | 38 +-- package.json | 11 +- playwright.config.ts | 4 + pnpm-lock.yaml | 272 +----------------- readme.md | 73 ++++- scripts/generate-api-client.ts | 3 +- server/routes/manifest.webmanifest.get.ts | 2 +- server/routes/sitemap.xml.get.ts | 2 +- tailwind.config.ts | 37 ++- 89 files changed, 159 insertions(+), 354 deletions(-) rename app.vue => app/app.vue (100%) rename {components => app/components}/app-footer.vue (100%) rename {components => app/components}/app-header.vue (100%) rename {components => app/components}/book-overview.vue (100%) rename {components => app/components}/color-scheme-switcher.vue (100%) rename {components => app/components}/content/prose-a.vue (100%) rename {components => app/components}/content/prose-img.vue (100%) rename {components => app/components}/detail-disclosure.vue (100%) rename {components => app/components}/detail-page.vue (100%) rename {components => app/components}/error-boundary.vue (100%) rename {components => app/components}/facet.vue (100%) rename {components => app/components}/family-tree.vue (100%) rename {components => app/components}/graph-viz.client.vue (100%) rename {components => app/components}/iiif-viewer.vue (100%) rename {components => app/components}/imprint.vue (91%) rename {components => app/components}/main-content.vue (100%) rename {components => app/components}/map.vue (100%) rename {components => app/components}/nav-link.vue (100%) rename {components => app/components}/networkVisualization.vue (100%) rename {components => app/components}/pagination.vue (100%) rename {components => app/components}/reference-button.vue (100%) rename {components => app/components}/route-announcer.vue (100%) rename {components => app/components}/search-navigation.vue (100%) rename {components => app/components}/search-page.vue (100%) rename {components => app/components}/search-table.vue (100%) rename {components => app/components}/skip-link.vue (100%) rename {components => app/components}/timeline/timeline-entry.vue (100%) rename {components => app/components}/timeline/timeline.vue (100%) rename {components => app/components}/timeline/vertical-timeline-entry.vue (100%) rename {components => app/components}/timeline/vertical-timeline.vue (100%) rename {components => app/components}/ui/centered.vue (100%) rename {components => app/components}/ui/loader.vue (100%) rename {components => app/components}/ui/page-title.vue (100%) rename {composables => app/composables}/use-locale.ts (100%) rename {composables => app/composables}/use-translations.ts (100%) rename {config => app/config}/i18n.config.ts (92%) rename {config => app/config}/imprint.config.ts (100%) rename error.vue => app/error.vue (100%) rename {layouts => app/layouts}/default.vue (84%) rename {lib => app/lib}/colors.ts (100%) rename {lib => app/lib}/group-relations.ts (100%) rename {lib => app/lib}/load-network-data.ts (100%) rename {pages => app/pages}/detail/event/[id].vue (100%) rename {pages => app/pages}/detail/function/[id].vue (100%) rename {pages => app/pages}/detail/institution/[id].vue (100%) rename {pages => app/pages}/detail/person/[id].vue (100%) rename {pages => app/pages}/detail/place/[id].vue (100%) rename {pages => app/pages}/detail/salary/[id].vue (100%) rename {pages => app/pages}/iiif.vue (100%) rename {pages => app/pages}/imprint.vue (100%) rename {pages => app/pages}/index.vue (99%) rename {pages => app/pages}/network.vue (100%) rename {pages => app/pages}/search.vue (100%) rename {pages => app/pages}/search/events.vue (100%) rename {pages => app/pages}/search/functions.vue (100%) rename {pages => app/pages}/search/institutions.vue (100%) rename {pages => app/pages}/search/persons.vue (100%) rename {pages => app/pages}/search/places.vue (100%) rename {pages => app/pages}/search/salaries.vue (100%) rename {plugins => app/plugins}/api.ts (61%) rename {plugins => app/plugins}/query-client.ts (100%) rename {styles => app/styles}/index.css (100%) rename {types => app/types}/i18n.d.ts (100%) rename {types => app/types}/nuxt.d.ts (100%) rename {types => app/types}/resulttypes.d.ts (100%) rename {types => app/types}/timeline.ts (100%) rename {utils => app/utils}/analytics.ts (100%) rename {utils => app/utils}/safe-json-ld-replacer.ts (100%) rename {utils => app/utils}/slice-trailing-slash.ts (100%) rename {utils => app/utils}/timeline-utils.ts (100%) rename i18n.config.ts => i18n/i18n.config.ts (100%) rename {messages => i18n/messages}/de.json (100%) diff --git a/.dockerignore b/.dockerignore index e92f3be..9887711 100644 --- a/.dockerignore +++ b/.dockerignore @@ -38,7 +38,7 @@ dist /test-results/ # generated api client -lib/api.ts +app/lib/api.ts # generated iiif manifests assets/manifests/ diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml index 2be51ef..f05d48b 100644 --- a/.github/workflows/build-deploy.yml +++ b/.github/workflows/build-deploy.yml @@ -10,7 +10,8 @@ on: jobs: env: - runs-on: ubuntu-latest + name: Generate environment variables + runs-on: ubuntu-22.04 steps: - name: Derive environment from git ref id: environment @@ -37,8 +38,9 @@ jobs: image: ${{ github.repository }} vars: + name: Generate public url needs: [env] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 environment: name: ${{ needs.env.outputs.environment }} steps: @@ -56,11 +58,14 @@ jobs: public_url: ${{ steps.public_url.outputs.PUBLIC_URL }} build: + name: Build and push docker image needs: [env, vars] - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 permissions: contents: read packages: write + environment: + name: "${{ needs.env.outputs.environment }}" steps: - name: Checkout repository @@ -109,6 +114,7 @@ jobs: cache-to: type=gha,mode=max deploy: + name: Deploy docker image needs: [env, vars, build] uses: acdh-oeaw/gl-autodevops-minimal-port/.github/workflows/deploy.yml@main secrets: inherit diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 3c0f704..a856923 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -22,7 +22,7 @@ jobs: fail-fast: true matrix: node-version: [22.x] - os: [ubuntu-latest] + os: [ubuntu-22.04] steps: - name: Checkout repository @@ -79,15 +79,15 @@ jobs: - name: Build app run: pnpm run build env: - NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000" NUXT_PUBLIC_API_BASE_URL: "${{ vars.NUXT_PUBLIC_API_BASE_URL }}" + NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000" NUXT_PUBLIC_REDMINE_ID: "${{ vars.SERVICE_ID }}" - name: Run e2e tests run: pnpm run test:e2e env: - NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000" NUXT_PUBLIC_API_BASE_URL: "${{ vars.NUXT_PUBLIC_API_BASE_URL }}" + NUXT_PUBLIC_APP_BASE_URL: "http://localhost:3000" - uses: actions/upload-artifact@v4 if: always() diff --git a/.gitignore b/.gitignore index ae85cd2..2235649 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ dist /test-results/ # generated api client -lib/api.ts +app/lib/api.ts # generated iiif manifests assets/manifests/ diff --git a/.vscode/app.code-snippets b/.vscode/app.code-snippets index e906ec6..2111199 100644 --- a/.vscode/app.code-snippets +++ b/.vscode/app.code-snippets @@ -8,11 +8,11 @@ "\tprerender: true,", "});", "", - "definePageMeta({", + "const t = useTranslations();", + "", + "usePageMetadata({", "\ttitle: \"${1:Name}Page.meta.title\",", "});", - "", - "const t = useTranslations();", "", "", "