Skip to content

Commit ccd4883

Browse files
committed
Update to Nuxt 3
Use har for audio tests to prevent provider requests and flakiness Convert ui cookies for ease of use Move analytics tests from unit tests to e2e tests Disable buttons until hydrated Make audio tapes smaller Update tests Use har for audio tests to prevent provider requests and flakiness Convert ui cookies for ease of use Move analytics tests from unit tests to e2e tests Disable buttons until hydrated Remove everything but the homepage and content pages Vendor in SVG sprites Remove patch Add search, media and related-media stores Add search pages with search functionality Add single result pages Re-add tests; fix unit tests; disable buttons until hydrated Fix invalid locale keys Refactor search page and fetching Fix localePath warning Add additional search views Get localePath from useNuxtApp Add healthcheck and robots server routes Add photos redirect Add sitemap Add simple sentry integration Proxy API calls Tests Add a missing tapes and add peaks=true to related audio tapes Add peaks=true to related tapes Reuse the same audio for seo Add server-prepare for initial provider loading Fix e2e route mocking Fix collection test Fix provider unit test Handle case when there are no providers Fix ui cookie overwriting Fix Tab border when focused Fix Waveform on box layout Fix Sources table sorting Fix content report POST request Fix global audio player on navigation Add link to source page to the sources table Update nuxt prepare script and add logging Remove aria-pressed from buttons when not set Refactor media store to make easier to test Add coverage to unit tests Add more media store unit tests Extract api-token from the api route Add api token tests Remove duplicate tags Use script setup for pages fetching data Improve VSkipToContentButton and add it to VCollectionPage Error component: add modal target and script setup Unify error handling Update sentry and env settings Remove unnecessary await from VSvg Remove provider-init plugin Set lazy to true in useAsyncData Remove error watch from index pages Remove VFetchingError Use script setup and remove useHead from pages Remove head and localeHead from app, error and single result Remove sentry Use script setup; simplify VLoadMore; remove fetchState Remove async from watchers Convert headers to script setup Replace store getters with actions Remove page title Update @nuxtjs/i18n to edge version Update dependencies Move search handling to search.vue Remove single-result middleware Use script setup and t from useNuxtApp.$i18n layout Replace axios with ofetch Signed-off-by: Olga Bulat <[email protected]> Update prettier; types; analytics plugin Signed-off-by: Olga Bulat <[email protected]> Use axios for fetching search requests Signed-off-by: Olga Bulat <[email protected]>
1 parent e6fa7b3 commit ccd4883

File tree

393 files changed

+11520
-20626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

393 files changed

+11520
-20626
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
coverage
22

3+
frontend/test/unit/test-utils/render-suspended.ts
4+
35
frontend/test/tapes
46
frontend/nuxt-template-overrides
57
frontend/storybook-static

.github/actions/build-docs/action.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,8 @@ runs:
1717
# Pass -W to fail CI if warnings exist
1818
just documentation/build -W
1919
20-
- name: Install translations
21-
shell: bash
22-
run: |
23-
just frontend/run i18n
24-
25-
- name: Build Storybook
26-
shell: bash
27-
run: |
28-
just frontend/run storybook:build-for-docs
29-
3020
# Storybook will be available at `/storybook`
3121
- name: Merge all docs
3222
shell: bash
3323
run: |
3424
mv documentation/_build /tmp/docs
35-
mv frontend/storybook-static /tmp/docs/storybook

.github/workflows/ci_cd.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -670,14 +670,11 @@ jobs:
670670
name:
671671
- playwright_vr
672672
- playwright_e2e
673-
- storybook
674673
include:
675674
- name: playwright_vr
676675
script: "test:playwright visual-regression"
677676
- name: playwright_e2e
678677
script: "test:playwright e2e"
679-
- name: storybook
680-
script: "test:storybook"
681678

682679
steps:
683680
- name: Checkout repository
@@ -714,7 +711,6 @@ jobs:
714711
name:
715712
- playwright_vr
716713
- playwright_e2e
717-
- storybook
718714

719715
steps:
720716
- name: Pass

frontend/.env.template

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1-
#API_URL=http://127.17.0.1:8000/
2-
#API_CLIENT_ID=""
3-
#API_CLIENT_SECRET=""
1+
#NUXT_PUBLIC_API_URL=http://127.17.0.1:8000/ # local dev API
2+
#NUXT_PUBLIC_API_URL=http://localhost:49153/ # talkback proxy
3+
#NUXT_PUBLIC_API_URL=https://api.openverse.engineering/ # prod API
4+
#NUXT_API_CLIENT_ID=""
5+
#NUXT_API_CLIENT_SECRET=""
6+
NUXT_PUBLIC_SAVED_SEARCH_COUNT=4
7+
NUXT_PUBLIC_PROVIDER_UPDATE_FREQUENCY=3600000# 1 hour
8+
NUXT_PUBLIC_PLAUSIBLE_DOMAIN="openverse.org" #localhost
9+
NUXT_PUBLIC_PLAUSIBLE_API_HOST="https://openverse.org" #http://localhost:50290
10+
NUXT_PUBLIC_SENTRY_DSN="https://[email protected]/5799642"
11+
NUXT_PUBLIC_SENTRY_ENVIRONMENT="local"
12+
NUXT_PUBLIC_SENTRY_RELEASE=""
13+
PORT=8443

frontend/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Nuxt
22
.nuxt
3+
.output
34

45
# Storybook
56
.nuxt-storybook
@@ -11,6 +12,7 @@ test/Default
1112

1213
# Coverage
1314
test/unit/coverage/
15+
coverage
1416

1517
# Generated translation files
1618
*.pot

frontend/.storybook/decorators/with-rtl.js

Lines changed: 0 additions & 37 deletions
This file was deleted.

frontend/.storybook/decorators/with-screenshot-area.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

frontend/.storybook/decorators/with-ui-store.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

frontend/.storybook/main.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

frontend/.storybook/middleware.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

frontend/.storybook/preview.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

frontend/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ WORKDIR /home/node/
2222

2323
# Copy monorepo mocking files into `/home/node`, which pretends to be the monorepo root.
2424
# Note: these files must be manually un-ignored in the root .dockerignore
25-
COPY --from=repo_root --chown=node:node .npmrc .pnpmfile.cjs pnpm-lock.yaml tsconfig.base.json ./
25+
COPY --from=repo_root --chown=node:node .npmrc .pnpmfile.cjs pnpm-lock.yaml ./
2626
RUN echo '{"packages":["frontend/"]}' > pnpm-workspace.yaml
2727

2828
# Copy the `frontend/` directory into `/home/node/frontend`, as a package in the monorepo.
@@ -41,9 +41,10 @@ RUN pnpm install
4141
# disable telemetry when building the app
4242
ENV NUXT_TELEMETRY_DISABLED=1
4343
ENV NODE_ENV=production
44-
ENV SENTRY_DSN=https://[email protected]/5799642
44+
ENV NUXT_PUBLIC_SENTRY_DSN=https://[email protected]/5799642
4545

46-
ARG API_URL
46+
ARG API_URL=https://api.openverse.engineering/
47+
ENV NUXT_PUBLIC_API_URL=$API_URL
4748

4849
RUN pnpm build:only
4950

@@ -68,7 +69,9 @@ COPY --from=builder --chown=node:node /home/node/frontend ./frontend/
6869
WORKDIR /home/node/frontend/
6970

7071
ARG SEMANTIC_VERSION
71-
ENV SENTRY_RELEASE=$SEMANTIC_VERSION
72+
ARG DEPLOYMENT_ENV=production
73+
ENV NUXT_PUBLIC_SENTRY_RELEASE=$SEMANTIC_VERSION
74+
ENV NUXT_PUBLIC_SENTRY_ENVIRONMENT=$DEPLOYMENT_ENV
7275

7376
# set app serving to permissive / assigned
7477
ENV NUXT_HOST=0.0.0.0

frontend/Dockerfile.playwright

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ FROM mcr.microsoft.com/playwright:v${PLAYWRIGHT_VERSION}-jammy
66

77
ARG PACKAGE_MANAGER
88

9+
WORKDIR /frontend
10+
911
COPY package.json .
1012

1113
# Requires `packageManager` field to be present in `frontend/package.json`.
1214
RUN npm install -g $PACKAGE_MANAGER
15+
16+
# DO NOT actually run `pnpm install` here. Doing so requires us to copy the the source into the container.
17+
# However, that's a waste of time because we mount the source in the compose file anyway.
18+
# Instead, we run `pnpm install` in the entrypoint script defined in the compose file.
19+
# ENTRYPOINT ["pnpm", "install", "&&"]

frontend/docker-compose.playwright.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ services:
88
- PACKAGE_MANAGER=${PACKAGE_MANAGER}
99
- PLAYWRIGHT_VERSION=${PLAYWRIGHT_VERSION}
1010
volumes:
11-
- ../node_modules:/node_modules
12-
- .:/frontend
13-
- ${PWD}/../tsconfig.base.json:/tsconfig.base.json
11+
- ../node_modules:/node_modules:rw,Z
12+
- .:/frontend:rw,Z
1413
user: ${USER_ID}
1514
working_dir: /frontend
16-
command: pnpm ${TEST_COMMAND} ${PLAYWRIGHT_ARGS:-}
15+
entrypoint: >
16+
/bin/sh -c '
17+
pnpm install;
18+
pnpm ${TEST_COMMAND} ${PLAYWRIGHT_ARGS:-};
19+
'
1720
environment:
1821
# This makes the webserver that Playwright runs show the build
1922
- DEBUG=pw:webserver

0 commit comments

Comments
 (0)