diff --git a/client/.dockerignore b/client/.dockerignore new file mode 100644 index 0000000..4487150 --- /dev/null +++ b/client/.dockerignore @@ -0,0 +1,126 @@ +# Created by https://www.toptal.com/developers/gitignore/api/node +# Edit at https://www.toptal.com/developers/gitignore?templates=node + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test +.env.production + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +.svelte-kit + +# End of https://www.toptal.com/developers/gitignore/api/node diff --git a/client/package.json b/client/package.json index 14c0d53..920c129 100644 --- a/client/package.json +++ b/client/package.json @@ -22,7 +22,6 @@ "devDependencies": { "@sveltejs/adapter-static": "1.0.0-next.13", "@sveltejs/kit": "1.0.0-next.129", - "@types/cookie": "0.4.1", "@typescript-eslint/eslint-plugin": "4.28.3", "@typescript-eslint/parser": "4.28.3", "cssnano": "5.0.6", @@ -41,9 +40,7 @@ "dependencies": { "@fontsource/fira-mono": "4.5.0", "@fontsource/rubik": "4.5.0", - "@lukeed/uuid": "2.0.0", - "@sentry/browser": "^6.9.0", - "cookie": "0.4.1", + "@sentry/browser": "6.9.0", "dotenv": "10.0.0", "svelte-i18n": "3.3.9" } diff --git a/client/src/hooks.ts b/client/src/hooks.ts deleted file mode 100644 index 7140f07..0000000 --- a/client/src/hooks.ts +++ /dev/null @@ -1,24 +0,0 @@ -// TODO: Find out what the fuck this file is doing -import cookie from 'cookie'; -import { v4 as uuid } from '@lukeed/uuid'; -import type { Handle } from '@sveltejs/kit'; - -export const handle: Handle = async ({ request, resolve }) => { - const cookies = cookie.parse(request.headers.cookie || ''); - request.locals.userid = cookies.userid || uuid(); - - // TODO https://github.com/sveltejs/kit/issues/1046 - if (request.query.has('_method')) { - request.method = request.query.get('_method').toUpperCase(); - } - - const response = await resolve(request); - - if (!cookies.userid) { - // if this is the first time the user has visited this app, - // set a cookie so that we recognise them when they return - response.headers['set-cookie'] = `userid=${request.locals.userid}; Path=/; HttpOnly`; - } - - return response; -}; diff --git a/client/src/routes/__error.svelte b/client/src/routes/__error.svelte index 484a4d3..6df72f5 100644 --- a/client/src/routes/__error.svelte +++ b/client/src/routes/__error.svelte @@ -1,9 +1,10 @@ diff --git a/client/src/routes/__layout.svelte b/client/src/routes/__layout.svelte index 7b1d1b6..1981a19 100644 --- a/client/src/routes/__layout.svelte +++ b/client/src/routes/__layout.svelte @@ -26,7 +26,7 @@