diff --git a/client/Dockerfile b/client/Dockerfile index 0abff03..5911162 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,11 +1,11 @@ -FROM node:16.13-bullseye +FROM node:16.17.0-bullseye WORKDIR /app COPY . . -RUN npm install && npm run build +RUN npm ci && npm run build && rm -rf node_modules && npm ci --omit=dev EXPOSE ${PORT} -CMD ["npm", "run", "preview"] \ No newline at end of file +CMD ["node", "dist/index.js"] \ No newline at end of file diff --git a/client/README.md b/client/README.md index 5c60cdd..7fac2bd 100644 --- a/client/README.md +++ b/client/README.md @@ -1,35 +1,35 @@ # Jokes Bapak2 Client -Still work in progress +The frontend. ## Development ```bash # Install modules -$ yarn install +$ npm install # Run local server -$ yarn dev +$ npm run dev # build everything -$ yarn build +$ npm run build ``` -> You can preview the built app with `yarn preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production. +> You can preview the built app with `npm run preview`, regardless of whether you installed an adapter. This should _not_ be used to serve your app in production. ## Used packages -| Name | Version | Type | -| --- | --- | --- | -| @sveltejs/kit | `1.0.0-next.195` | Framework | -| svelte | `3.44.1` | Framework | -| typescript | `4.4.4` | Static type language | -| svelte-i18n | `3.3.13` | i18n Library | -| svelte-windicss-preprocess | `4.1.5` | CSS Library | -| @fontsource/fira-mono | `4.5.0` | Webfont | -| @fontsource/rubik | `4.5.0` | Webfont | -| dotenv | `10.0.0` | Utils | -| @sentry/browser | `6.14.1` | Logging | +| Name | Version | Type | +| -------------------------- | ---------------- | -------------------- | +| @sveltejs/kit | `1.0.0-next.480` | Framework | +| svelte | `3.50.1` | Framework | +| typescript | `4.8.3` | Static type language | +| svelte-i18n | `3.4.0` | i18n Library | +| svelte-windicss-preprocess | `4.2.8` | CSS Library | +| @fontsource/fira-mono | `4.5.9` | Webfont | +| @fontsource/rubik | `4.5.11` | Webfont | +| dotenv | `16.0.2` | Utils | +| @sentry/browser | `7.12.1` | Logging | ## Directory structure @@ -48,8 +48,8 @@ $ yarn build ├── static - Static/public directory ├── svelte.config.js - Svelte configuration file ├── tsconfig.json - Typescript configuration file -├── windi.config.js - WindiCSS configuration file -└── yarn.lock - Packages lock file +├── windi.config.ts - WindiCSS configuration file +└── package-lock.json - Packages lock file ``` ## `.env` configuration diff --git a/client/package-lock.json b/client/package-lock.json index c4b9d13..f5d97c6 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -32,7 +32,8 @@ "svelte-preprocess": "4.10.7", "svelte-windicss-preprocess": "4.2.8", "tslib": "2.4.0", - "typescript": "4.8.3" + "typescript": "4.8.3", + "vite": "^3.1.0" } }, "node_modules/@antfu/utils": { @@ -2074,8 +2075,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true, - "peer": true + "dev": true }, "node_modules/functional-red-black-tree": { "version": "1.0.1", @@ -2177,7 +2177,6 @@ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, - "peer": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -2272,7 +2271,6 @@ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", "dev": true, - "peer": true, "dependencies": { "has": "^1.0.3" }, @@ -2544,7 +2542,6 @@ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", "dev": true, - "peer": true, "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -2749,8 +2746,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "peer": true + "dev": true }, "node_modules/path-type": { "version": "4.0.0", @@ -2794,7 +2790,6 @@ "url": "https://tidelift.com/funding/github/npm/postcss" } ], - "peer": true, "dependencies": { "nanoid": "^3.3.4", "picocolors": "^1.0.0", @@ -3320,7 +3315,6 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, - "peer": true, "dependencies": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -3372,7 +3366,6 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.78.1.tgz", "integrity": "sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==", "dev": true, - "peer": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -3535,7 +3528,6 @@ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3622,7 +3614,6 @@ "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true, - "peer": true, "engines": { "node": ">= 0.4" }, @@ -4002,7 +3993,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-3.1.0.tgz", "integrity": "sha512-YBg3dUicDpDWFCGttmvMbVyS9ydjntwEjwXRj2KBFwSB8SxmGcudo1yb8FW5+M/G86aS8x828ujnzUVdsLjs9g==", "dev": true, - "peer": true, "dependencies": { "esbuild": "^0.15.6", "postcss": "^8.4.16", @@ -4051,7 +4041,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4062,7 +4051,6 @@ "integrity": "sha512-7V8tzllIbAQV1M4QoE52ImKu8hT/NLGlGXkiDsbEU5PS6K8Mn09ZnYoS+dcmHxOS9CRsV4IRAMdT3I67IyUNXw==", "dev": true, "hasInstallScript": true, - "peer": true, "bin": { "esbuild": "bin/esbuild" }, @@ -4105,7 +4093,6 @@ "os": [ "android" ], - "peer": true, "engines": { "node": ">=12" } @@ -4122,7 +4109,6 @@ "os": [ "android" ], - "peer": true, "engines": { "node": ">=12" } @@ -4139,7 +4125,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=12" } @@ -4156,7 +4141,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=12" } @@ -4173,7 +4157,6 @@ "os": [ "freebsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -4190,7 +4173,6 @@ "os": [ "freebsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -4207,7 +4189,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4224,7 +4205,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4241,7 +4221,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4258,7 +4237,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4275,7 +4253,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4292,7 +4269,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4309,7 +4285,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4326,7 +4301,6 @@ "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -4343,7 +4317,6 @@ "os": [ "netbsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -4360,7 +4333,6 @@ "os": [ "openbsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -4377,7 +4349,6 @@ "os": [ "sunos" ], - "peer": true, "engines": { "node": ">=12" } @@ -4394,7 +4365,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">=12" } @@ -4411,7 +4381,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">=12" } @@ -4428,7 +4397,6 @@ "os": [ "win32" ], - "peer": true, "engines": { "node": ">=12" } @@ -5907,8 +5875,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true, - "peer": true + "dev": true }, "functional-red-black-tree": { "version": "1.0.1", @@ -5989,7 +5956,6 @@ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, - "peer": true, "requires": { "function-bind": "^1.1.1" } @@ -6063,7 +6029,6 @@ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", "dev": true, - "peer": true, "requires": { "has": "^1.0.3" } @@ -6268,8 +6233,7 @@ "version": "3.3.4", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "integrity": "sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==", - "dev": true, - "peer": true + "dev": true }, "natural-compare": { "version": "1.4.0", @@ -6409,8 +6373,7 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", - "dev": true, - "peer": true + "dev": true }, "path-type": { "version": "4.0.0", @@ -6435,7 +6398,6 @@ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.16.tgz", "integrity": "sha512-ipHE1XBvKzm5xI7hiHCZJCSugxvsdq2mPnsq5+UF+VHCjiBvtDrlxJfMBToWaP9D5XlgNmcFGqoHmUn0EYEaRQ==", "dev": true, - "peer": true, "requires": { "nanoid": "^3.3.4", "picocolors": "^1.0.0", @@ -6760,7 +6722,6 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, - "peer": true, "requires": { "is-core-module": "^2.9.0", "path-parse": "^1.0.7", @@ -6793,7 +6754,6 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.78.1.tgz", "integrity": "sha512-VeeCgtGi4P+o9hIg+xz4qQpRl6R401LWEXBmxYKOV4zlF82lyhgh2hTZnheFUbANE8l2A41F458iwj2vEYaXJg==", "dev": true, - "peer": true, "requires": { "fsevents": "~2.3.2" } @@ -6907,8 +6867,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, - "peer": true + "dev": true }, "sourcemap-codec": { "version": "1.4.8", @@ -6969,8 +6928,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "dev": true, - "peer": true + "dev": true }, "svelte": { "version": "3.50.1", @@ -7213,7 +7171,6 @@ "resolved": "https://registry.npmjs.org/vite/-/vite-3.1.0.tgz", "integrity": "sha512-YBg3dUicDpDWFCGttmvMbVyS9ydjntwEjwXRj2KBFwSB8SxmGcudo1yb8FW5+M/G86aS8x828ujnzUVdsLjs9g==", "dev": true, - "peer": true, "requires": { "esbuild": "^0.15.6", "fsevents": "~2.3.2", @@ -7227,15 +7184,13 @@ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.7.tgz", "integrity": "sha512-IKznSJOsVUuyt7cDzzSZyqBEcZe+7WlBqTVXiF1OXP/4Nm387ToaXZ0fyLwI1iBlI/bzpxVq411QE2/Bt2XWWw==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.7.tgz", "integrity": "sha512-7V8tzllIbAQV1M4QoE52ImKu8hT/NLGlGXkiDsbEU5PS6K8Mn09ZnYoS+dcmHxOS9CRsV4IRAMdT3I67IyUNXw==", "dev": true, - "peer": true, "requires": { "@esbuild/linux-loong64": "0.15.7", "esbuild-android-64": "0.15.7", @@ -7265,160 +7220,140 @@ "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.15.7.tgz", "integrity": "sha512-p7rCvdsldhxQr3YHxptf1Jcd86dlhvc3EQmQJaZzzuAxefO9PvcI0GLOa5nCWem1AJ8iMRu9w0r5TG8pHmbi9w==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-android-arm64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.15.7.tgz", "integrity": "sha512-L775l9ynJT7rVqRM5vo+9w5g2ysbOCfsdLV4CWanTZ1k/9Jb3IYlQ06VCI1edhcosTYJRECQFJa3eAvkx72eyQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-darwin-64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.15.7.tgz", "integrity": "sha512-KGPt3r1c9ww009t2xLB6Vk0YyNOXh7hbjZ3EecHoVDxgtbUlYstMPDaReimKe6eOEfyY4hBEEeTvKwPsiH5WZg==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-darwin-arm64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.7.tgz", "integrity": "sha512-kBIHvtVqbSGajN88lYMnR3aIleH3ABZLLFLxwL2stiuIGAjGlQW741NxVTpUHQXUmPzxi6POqc9npkXa8AcSZQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-freebsd-64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.7.tgz", "integrity": "sha512-hESZB91qDLV5MEwNxzMxPfbjAhOmtfsr9Wnuci7pY6TtEh4UDuevmGmkUIjX/b+e/k4tcNBMf7SRQ2mdNuK/HQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-freebsd-arm64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.7.tgz", "integrity": "sha512-dLFR0ChH5t+b3J8w0fVKGvtwSLWCv7GYT2Y2jFGulF1L5HftQLzVGN+6pi1SivuiVSmTh28FwUhi9PwQicXI6Q==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-32": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.15.7.tgz", "integrity": "sha512-v3gT/LsONGUZcjbt2swrMjwxo32NJzk+7sAgtxhGx1+ZmOFaTRXBAi1PPfgpeo/J//Un2jIKm/I+qqeo4caJvg==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.15.7.tgz", "integrity": "sha512-LxXEfLAKwOVmm1yecpMmWERBshl+Kv5YJ/1KnyAr6HRHFW8cxOEsEfisD3sVl/RvHyW//lhYUVSuy9jGEfIRAQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-arm": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.15.7.tgz", "integrity": "sha512-JKgAHtMR5f75wJTeuNQbyznZZa+pjiUHV7sRZp42UNdyXC6TiUYMW/8z8yIBAr2Fpad8hM1royZKQisqPABPvQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-arm64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.7.tgz", "integrity": "sha512-P3cfhudpzWDkglutWgXcT2S7Ft7o2e3YDMrP1n0z2dlbUZghUkKCyaWw0zhp4KxEEzt/E7lmrtRu/pGWnwb9vw==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-mips64le": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.7.tgz", "integrity": "sha512-T7XKuxl0VpeFLCJXub6U+iybiqh0kM/bWOTb4qcPyDDwNVhLUiPcGdG2/0S7F93czUZOKP57YiLV8YQewgLHKw==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-ppc64le": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.7.tgz", "integrity": "sha512-6mGuC19WpFN7NYbecMIJjeQgvDb5aMuvyk0PDYBJrqAEMkTwg3Z98kEKuCm6THHRnrgsdr7bp4SruSAxEM4eJw==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-riscv64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.7.tgz", "integrity": "sha512-uUJsezbswAYo/X7OU/P+PuL/EI9WzxsEQXDekfwpQ23uGiooxqoLFAPmXPcRAt941vjlY9jtITEEikWMBr+F/g==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-linux-s390x": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.7.tgz", "integrity": "sha512-+tO+xOyTNMc34rXlSxK7aCwJgvQyffqEM5MMdNDEeMU3ss0S6wKvbBOQfgd5jRPblfwJ6b+bKiz0g5nABpY0QQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-netbsd-64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.7.tgz", "integrity": "sha512-yVc4Wz+Pu3cP5hzm5kIygNPrjar/v5WCSoRmIjCPWfBVJkZNb5brEGKUlf+0Y759D48BCWa0WHrWXaNy0DULTQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-openbsd-64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.7.tgz", "integrity": "sha512-GsimbwC4FSR4lN3wf8XmTQ+r8/0YSQo21rWDL0XFFhLHKlzEA4SsT1Tl8bPYu00IU6UWSJ+b3fG/8SB69rcuEQ==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-sunos-64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.15.7.tgz", "integrity": "sha512-8CDI1aL/ts0mDGbWzjEOGKXnU7p3rDzggHSBtVryQzkSOsjCHRVe0iFYUuhczlxU1R3LN/E7HgUO4NXzGGP/Ag==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-windows-32": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.15.7.tgz", "integrity": "sha512-cOnKXUEPS8EGCzRSFa1x6NQjGhGsFlVgjhqGEbLTPsA7x4RRYiy2RKoArNUU4iR2vHmzqS5Gr84MEumO/wxYKA==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-windows-64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.15.7.tgz", "integrity": "sha512-7MI08Ec2sTIDv+zH6StNBKO+2hGUYIT42GmFyW6MBBWWtJhTcQLinKS6ldIN1d52MXIbiJ6nXyCJ+LpL4jBm3Q==", "dev": true, - "optional": true, - "peer": true + "optional": true }, "esbuild-windows-arm64": { "version": "0.15.7", "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.7.tgz", "integrity": "sha512-R06nmqBlWjKHddhRJYlqDd3Fabx9LFdKcjoOy08YLimwmsswlFBJV4rXzZCxz/b7ZJXvrZgj8DDv1ewE9+StMw==", "dev": true, - "optional": true, - "peer": true + "optional": true } } }, diff --git a/client/package.json b/client/package.json index 158d6d4..376ac4e 100644 --- a/client/package.json +++ b/client/package.json @@ -11,9 +11,9 @@ ], "type": "module", "scripts": { - "dev": "svelte-kit dev", - "build": "svelte-kit build", - "preview": "svelte-kit preview", + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", "check": "svelte-check --tsconfig ./tsconfig.json", "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", "lint": "eslint --fix --ext .svelte,.js,.ts --ignore-path .gitignore .", @@ -35,7 +35,8 @@ "svelte-preprocess": "4.10.7", "svelte-windicss-preprocess": "4.2.8", "tslib": "2.4.0", - "typescript": "4.8.3" + "typescript": "4.8.3", + "vite": "^3.1.0" }, "dependencies": { "@fontsource/fira-mono": "4.5.9", diff --git a/client/src/app.html b/client/src/app.html index ee781b5..41182c3 100644 --- a/client/src/app.html +++ b/client/src/app.html @@ -1,30 +1,29 @@ - +
- + - - + + - + - - + + - - %svelte.head% + %sveltekit.head% -{$_('footer.language')} {$_('footer.english')} + | {$_('footer.indonesian')}.
-- Analytics. -
-
{$_('home.more.1')}
goto('/guide')}>{$_('navigation.guide')}
diff --git a/client/src/routes/+page.ts b/client/src/routes/+page.ts
new file mode 100644
index 0000000..ee82859
--- /dev/null
+++ b/client/src/routes/+page.ts
@@ -0,0 +1 @@
+export const ssr = true;
\ No newline at end of file
diff --git a/client/src/routes/api.svelte b/client/src/routes/api/+page.svelte
similarity index 91%
rename from client/src/routes/api.svelte
rename to client/src/routes/api/+page.svelte
index 77e4f1c..deb4a8e 100644
--- a/client/src/routes/api.svelte
+++ b/client/src/routes/api/+page.svelte
@@ -4,8 +4,8 @@
import { _ } from 'svelte-i18n';
import env from '$lib/env';
import { $fetch as omf } from 'ohmyfetch';
- import Codeblock from '../components/codeblock.svelte';
- import Notice from '../components/notice.svelte';
+ import Codeblock from '../../components/codeblock.svelte';
+ import Notice from '../../components/notice.svelte';
interface TotalResponse {
message: string;
@@ -28,7 +28,7 @@
-
+
diff --git a/client/src/routes/guide.svelte b/client/src/routes/guide/+page.svelte
similarity index 72%
rename from client/src/routes/guide.svelte
rename to client/src/routes/guide/+page.svelte
index 94a9a02..cc6634f 100644
--- a/client/src/routes/guide.svelte
+++ b/client/src/routes/guide/+page.svelte
@@ -1,5 +1,5 @@
@@ -9,7 +9,7 @@
-
+
@@ -25,20 +25,24 @@
{$_('guide.fetch.2')}{$_('guide.direct.1')}
- <img>
{$_('guide.direct.2')}{$_('guide.fetch.1')}
- .then(response => response.text())
- .then(data => console.log(data))
+ const response = await fetch("https://jokesbapak2.reinaldyrafli.com/api/");
- // {$_('guide.fetch.3')}
+ if (!response.ok) {
+ // {$_('guide.fetch.3')}
+ }
- <img src="data:image/jpeg;base64, { data }" />
+ const blob = await response.blob();
+
+ const objectURL = URL.createObjectURL(blob);
+
+ <img src="{ objectURL }" />