Skip to content

Commit

Permalink
Merge pull request #4003 from usu/chore/nuxt3
Browse files Browse the repository at this point in the history
chore(print): upgrade to nuxt3
  • Loading branch information
BacLuc committed Nov 12, 2023
2 parents 9297984 + b6b52e3 commit f46fb47
Show file tree
Hide file tree
Showing 95 changed files with 12,952 additions and 20,944 deletions.
21 changes: 8 additions & 13 deletions .docker-hub/print/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,24 @@ WORKDIR /app

COPY print/package*.json ./

ENV SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
ENV SENTRY_ORG=$SENTRY_ORG
ENV SENTRY_PRINT_PROJECT=$SENTRY_PRINT_PROJECT
ENV SENTRY_RELEASE_NAME=$SENTRY_RELEASE_NAME
ENV NUXT_SENTRY_AUTH_TOKEN=$SENTRY_AUTH_TOKEN
ENV NUXT_SENTRY_ORG=$SENTRY_ORG
ENV NUXT_SENTRY_PROJECT=$SENTRY_PRINT_PROJECT
ENV NUXT_SENTRY_RELEASE_NAME=$SENTRY_RELEASE_NAME

RUN npm ci

COPY print .
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN npm run build

# production stage
FROM node:20.9.0 AS production-stage
WORKDIR /app

COPY --from=build-stage /app/node_modules ./node_modules
COPY --from=build-stage /app/.nuxt ./.nuxt
COPY --from=build-stage /app/static ./static
COPY --from=build-stage /app/server-middleware ./server-middleware
COPY print/nuxt.config.js .
COPY --from=build-stage /app/.output ./.output

ENV NUXT_HOST 0.0.0.0
ENV NUXT_PORT 80
ENV NITRO_HOST 0.0.0.0
ENV NITRO_PORT 80

EXPOSE 80
CMD ./node_modules/.bin/nuxt start
CMD node ./.output/server/index.mjs
13 changes: 6 additions & 7 deletions .helm/ecamp3/templates/print_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ metadata:
{{- include "print.selectorLabels" . | nindent 4 }}
{{- include "app.commonLabels" . | nindent 4 }}
data:
INTERNAL_API_ROOT_URL: {{ include "api.url" . | quote }}
FRONTEND_URL: {{ include "frontend.url" . | quote }}
PRINT_URL: {{ include "print.url" . | quote }}
COOKIE_PREFIX: {{ include "api.cookiePrefix" . | quote }}
SENTRY_ENVIRONMENT: {{ .Values.domain | quote }}
NUXT_INTERNAL_API_ROOT_URL: {{ include "api.url" . | quote }}
NUXT_PRINT_URL: {{ include "print.url" . | quote }}
NUXT_COOKIE_PREFIX: {{ include "api.cookiePrefix" . | quote }}
NUXT_SENTRY_ENVIRONMENT: {{ .Values.domain | quote }}
{{- if .Values.print.renderHTMLTimeoutMs }}
RENDER_HTML_TIMEOUT_MS: {{ .Values.print.renderHTMLTimeoutMs | quote }}
NUXT_RENDER_HTML_TIMEOUT_MS: {{ .Values.print.renderHTMLTimeoutMs | quote }}
{{- end }}
{{- if .Values.print.renderPDFTimeoutMs }}
RENDER_PDF_TIMEOUT_MS: {{ .Values.print.renderPDFTimeoutMs | quote }}
NXT_RENDER_PDF_TIMEOUT_MS: {{ .Values.print.renderPDFTimeoutMs | quote }}
{{- end }}
12 changes: 6 additions & 6 deletions .helm/ecamp3/templates/print_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ spec:
readinessProbe:
httpGet:
scheme: HTTP
path: /health
path: /print/health
port: 3003
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 10
livenessProbe:
httpGet:
scheme: HTTP
path: /server/health
path: /print/api/health
port: 3003
initialDelaySeconds: 10
periodSeconds: 30
Expand All @@ -62,20 +62,20 @@ spec:
- configMapRef:
name: {{ include "print.name" . }}-configmap
env:
- name: SENTRY_PRINT_DSN
- name: NUXT_SENTRY_DSN
valueFrom:
secretKeyRef:
name: {{ include "print.name" . }}
key: sentry-dsn
- name: BROWSER_WS_ENDPOINT
- name: NUXT_BROWSER_WS_ENDPOINT
valueFrom:
secretKeyRef:
name: {{ include "print.name" . }}
key: browser-ws-endpoint
- name: NUXT_PORT
- name: NITRO_PORT
value: "3003"
{{- if and .Values.ingress.enabled .Values.ingress.basicAuth.enabled }}
- name: BASIC_AUTH_TOKEN
- name: NUXT_BASIC_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "print.name" . }}
Expand Down
2 changes: 0 additions & 2 deletions .helm/ecamp3/templates/print_ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- include "ingress.basicAuth.annotations" . | nindent 4 }}
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/x-forwarded-prefix: {{ .Values.print.subpath }}
{{- if not (.Values.print.ingress.readTimeoutSeconds | empty) }}
nginx.ingress.kubernetes.io/proxy-read-timeout: {{ .Values.print.ingress.readTimeoutSeconds | quote }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion api/docker/caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}
}

handle_path /print* {
handle /print* {
reverse_proxy print:3003
}

Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ services:
- ./.cache/npm:/home/node/.npm/_cacache:delegated
- ./.cache/npm/sentry-cli:/home/node/.npm/sentry-cli:delegated
environment:
- NODE_OPTIONS=--openssl-legacy-provider #TODO: remove when we update to webpack >=5
- NUXT_HOST=0.0.0.0
- NUXT_PORT=3003
- NITRO_PORT=3003
- NPM_CONFIG_UPDATE_NOTIFIER=false
- NPM_CONFIG_CACHE=/home/node/.npm
- CI=${CI}
Expand Down Expand Up @@ -160,7 +160,7 @@ services:
docker-host:
image: qoomon/docker-host
container_name: 'ecamp3-docker-host-forwarder'
cap_add: [ 'NET_ADMIN', 'NET_RAW' ]
cap_add: ['NET_ADMIN', 'NET_RAW']
restart: on-failure

browserless:
Expand All @@ -180,7 +180,7 @@ services:

e2e:
image: cypress/included:13.5.0
profiles: [ "e2e" ]
profiles: ['e2e']
container_name: 'ecamp3-e2e'
environment:
- DISPLAY
Expand All @@ -193,7 +193,7 @@ services:

translation:
image: node:20.9.0
profiles: [ "translation" ]
profiles: ['translation']
container_name: 'ecamp3-translation'
volumes:
- ./translation:/translation:delegated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const generatePdfMixin = {
const response = await axios({
baseURL: null,
method: 'get',
url: `${PRINT_URL}/server/pdfChrome?config=${encodeURIComponent(
url: `${PRINT_URL}/api/pdf?config=${encodeURIComponent(
JSON.stringify(config)
)}`,
responseType: 'arraybuffer',
Expand Down
1 change: 1 addition & 0 deletions print/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ typings/

# nuxt.js build output
.nuxt
.output

# Nuxt generate
dist
Expand Down
8 changes: 3 additions & 5 deletions print/assets/calendar/CalendarDaily.sass
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
.v-calendar-daily_head-weekday
user-select: none
padding: $calendar-daily-weekday-padding
font-size: $calendar-daily-weekday-font-size
text-align: center
text-transform: uppercase

Expand All @@ -84,20 +83,20 @@

.v-calendar-daily__body
flex: 1 1 60%
overflow: hidden
overflow: visible
display: flex
position: relative
flex-direction: column

.v-calendar-daily__scroll-area
overflow-y: scroll
overflow-y: visible
flex: 1 1 auto
display: flex
align-items: flex-start

.v-calendar-daily__pane
width: 100%
overflow-y: hidden
overflow-y: visible
flex: none
display: flex
align-items: flex-start
Expand Down Expand Up @@ -131,7 +130,6 @@
display: block
position: relative
top: $calendar-daily-interval-gutter-top
font-size: $calendar-daily-interval-gutter-font-size
padding-right: $calendar-daily-interval-gutter-width

.v-calendar-daily__day
Expand Down
31 changes: 0 additions & 31 deletions print/assets/calendar/CalendarWithEvents.sass
Original file line number Diff line number Diff line change
@@ -1,39 +1,18 @@

@import './_variables.scss'

.theme--light.v-calendar-events
.v-event-timed
border: $calendar-event-border-width solid !important

.v-event-more
background-color: $calendar-background-color

&.v-outside
background-color: $calendar-outside-background-color

.v-calendar
.v-event
position: relative
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
font-size: $calendar-event-font-size
cursor: pointer
line-height: $calendar-event-line-height
margin-right: -$calendar-line-width
z-index: 1
border-radius: $calendar-event-border-radius

.v-event-more
overflow: hidden
text-overflow: ellipsis
white-space: nowrap
font-size: $calendar-event-font-size
cursor: pointer
font-weight: bold
z-index: 1
position: relative

.v-event-timed-container
position: absolute
top: 0
Expand All @@ -45,20 +24,10 @@

.v-event-timed
position: absolute
white-space: nowrap
text-overflow: ellipsis
font-size: $calendar-event-font-size
cursor: pointer
border-radius: $calendar-event-border-radius
pointer-events: all

.v-event-summary
display: inline-block
overflow: hidden
text-overflow: ellipsis
width: 100%
white-space: nowrap

&.v-calendar-events
.v-calendar-weekly__head-weekday
margin-right: -$calendar-line-width
Expand Down
2 changes: 0 additions & 2 deletions print/assets/calendar/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ $calendar-weekly-weekday-padding: 0px 4px 0px 4px !default;
$calendar-weekly-weekday-font-size: 11px !default;
$calendar-weekly-day-padding: 0px 0px 0px 0px !default;
$calendar-weekly-day-label-size: 32px !default;
$calendar-weekly-day-label-font-size: 12px !default;
$calendar-weekly-day-label-margin: 4px 0 0 0 !default;
$calendar-weekly-day-month-left: 36px !default;
$calendar-weekly-weeknumber-flex-basis: 24px !default;
Expand All @@ -36,6 +35,5 @@ $calendar-weekly-weeknumber-padding-top: 14.5px !default;
$calendar-event-bottom-space: 1px !default;
$calendar-event-border-width: 1px !default;
$calendar-event-border-radius: $border-radius-root !default;
$calendar-event-font-size: 12px !default;
$calendar-event-line-height: 20px !default;
$calendar-event-right-empty: 10px !default;

0 comments on commit f46fb47

Please sign in to comment.