Skip to content

Commit

Permalink
Merge branch 'feature/nx'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoosepAlviste committed Jul 16, 2023
2 parents 68e634d + f987118 commit 08088de
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 15 deletions.
Binary file added apps/webapp/public/apple-touch-icon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
11 changes: 11 additions & 0 deletions apps/webapp/public/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/webapp/public/maskable-icon-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions apps/webapp/src/renderer/_default.page.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ import type { PageContextClient } from './types'

import '#/lib/initSentry'

// A dummy import of the favicon to make sure that it is copied into the
// `dist/client` folder. It's only actually used in the server default page.
import './favicon.ico'

let root: Root | undefined
/**
* Keep track of the Apollo client instance used in the client-side so that we
Expand Down
11 changes: 8 additions & 3 deletions apps/webapp/src/renderer/_default.page.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { escapeInject, dangerouslySkipEscape } from 'vite-plugin-ssr/server'
import { darkThemeClass, lightThemeClass } from '#/styles/theme.css'
import { THEME } from '#/utils/theme'

import favicon from './favicon.ico'
import { PageShell } from './PageShell'
import type { PageContextServer } from './types'

Expand Down Expand Up @@ -37,15 +36,21 @@ export async function render(pageContext: PageContextServer) {
// See https://vite-plugin-ssr.com/head
const { documentProps } = pageContext.exports
const title = documentProps?.title ?? 'Serieslist'
const desc = documentProps?.description ?? 'App using Vite + vite-plugin-ssr'
const desc =
documentProps?.description ??
'Always know which episode to watch next. Keep track of your series and seen episodes.'

const themeClass = theme == THEME.DARK ? darkThemeClass : lightThemeClass

const documentHtml = escapeInject`<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="${favicon}" />
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" sizes="180x180">
<link rel="mask-icon" href="/maskable-icon-512x512.png" color="#FFFFFF">
<meta name="theme-color" content="#6366f1">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="${desc}" />
<title>${title}</title>
Expand Down
8 changes: 5 additions & 3 deletions apps/webapp/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ async function startServer() {
await app.register(fastifyCookie)

if (isProduction) {
const distPath = join(root, '/dist/client/assets')
await app.register(fastifyStatic, {
root: distPath,
prefix: '/assets/',
root: join(root, '/dist/client'),
prefix: '/',
decorateReply: false,
index: false,
wildcard: false,
})
} else {
const vite = await import('vite')
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
"start": "nx run-many -t start,start:jobs",
"lint": "nx affected -t lint",
"tsc": "nx affected -t tsc",
"test:coverage": "nx affected -t test:coverage",
"test:coverage": "dotenv -e .env.test -- nx affected -t test:coverage --verbose",
"build": "nx affected -t build",
"migrate": "pnpm -F api migrate",
"migrate:test": "pnpm -F api migrate:test",
"test:e2e": "pnpm -F webapp test:e2e"
"migrate:test": "dotenv -e .env.test -- pnpm -F api migrate:test",
"test:e2e": "dotenv -e .env.e2e -- pnpm -F webapp test:e2e"
},
"devDependencies": {
"dotenv-cli": "^7.1.0",
"nx": "^16.5.2"
}
}
5 changes: 3 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 08088de

Please sign in to comment.