From 233372cb8861f3582b56b229c3d55ecc0fd4bab6 Mon Sep 17 00:00:00 2001 From: matthieu42morin Date: Fri, 3 Nov 2023 23:57:27 +0100 Subject: [PATCH] fixing dev env bugs by improving configs --- .vscode/settings.json | 4 +- package.json | 147 +++++++++++++++++++++--------------------- pnpm-lock.yaml | 42 +++++++++--- src/app.html | 2 - tsconfig.json | 17 +++-- 5 files changed, 119 insertions(+), 93 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 5f8b3ca..3b6e9ea 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,9 +5,7 @@ "[svelte]": { "editor.defaultFormatter": "svelte.svelte-vscode" // enable Prettier formatter for JavaScript files }, - "[ts]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" // enable Prettier formatter for JavaScript files - }, + "editor.fontFamily": "Fira Code", "editor.fontLigatures": true, "prettier.documentSelectors": [ diff --git a/package.json b/package.json index 6968f84..88824bb 100644 --- a/package.json +++ b/package.json @@ -1,75 +1,76 @@ { - "name": "portfolio", - "description": "Uses pnpm, svelte, mdsvex", - "version": "1.0.0", - "main": "index.js", - "private": true, - "homepage": "mattmor.in", - "author": "Matthieu Morin", - "license": "AGPLv3", - "repository": { - "type": "git", - "url": "https://github.com/matthieu42morin/Portfolio/" - }, - "packageManager": "pnpm@8.6.6", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", - "test": "vitest", - "lint": "prettier --plugin-search-dir . --check . && eslint .", - "format": "prettier --plugin-search-dir . --write ." - }, - "devDependencies": { - "@skeletonlabs/skeleton": "2.0.0", - "@skeletonlabs/tw-plugin": "0.1.0", - "@sveltejs/adapter-auto": "^2.0.0", - "@sveltejs/kit": "^1.20.4", - "@tailwindcss/forms": "0.5.6", - "@tailwindcss/typography": "0.5.9", - "@types/js-cookie": "^3.0.5", - "@types/node": "20.5.7", - "@typescript-eslint/eslint-plugin": "^5.45.0", - "@typescript-eslint/parser": "^5.45.0", - "autoprefixer": "10.4.15", - "eslint": "^8.28.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-svelte": "^2.30.0", - "js-cookie": "^3.0.5", - "postcss": "8.4.29", - "prettier": "^2.8.0", - "prettier-plugin-svelte": "^2.10.1", - "sass": "^1.66.1", - "svelte": "^4.0.5", - "svelte-check": "^3.4.3", - "tailwindcss": "3.3.3", - "tslib": "^2.4.1", - "typescript": "^5.2.2", - "vite": "^4.4.2", - "vite-plugin-tailwind-purgecss": "0.1.3", - "vitest": "^0.34.0" - }, - "type": "module", - "dependencies": { - "@floating-ui/dom": "1.5.1", - "@threlte/core": "^6.0.10", - "@threlte/extras": "^7.0.0", - "@yushijinhun/three-minifier-rollup": "^0.4.0", - "hastscript": "^8.0.0", - "highlight.js": "11.8.0", - "linkedom": "^0.15.3", - "mdast-util-to-string": "^4.0.0", - "mdsvex": "^0.11.0", - "prismjs": "^1.29.0", - "rehype-img-size": "^1.0.1", - "rehype-wrap-all": "^1.1.0", - "remark-autolink-headings": "^7.0.1", - "remark-external-links": "^9.0.1", - "remark-slug": "^7.0.1", - "rss": "^1.2.2", - "svelte-preprocess": "^5.0.4", - "unist-util-visit": "^5.0.0" - } + "name": "portfolio", + "description": "Uses pnpm, svelte, mdsvex", + "version": "1.0.0", + "main": "index.js", + "private": true, + "homepage": "mattmor.in", + "author": "Matthieu Morin", + "license": "AGPLv3", + "repository": { + "type": "git", + "url": "https://github.com/matthieu42morin/Portfolio/" + }, + "packageManager": "pnpm@8.6.6", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", + "test": "vitest", + "lint": "prettier --plugin-search-dir . --check . && eslint .", + "format": "prettier --plugin-search-dir . --write ." + }, + "devDependencies": { + "@skeletonlabs/skeleton": "2.0.0", + "@skeletonlabs/tw-plugin": "0.1.0", + "@sveltejs/adapter-cloudflare": "^2.3.3", + "@sveltejs/kit": "^1.20.4", + "@tailwindcss/forms": "0.5.6", + "@tailwindcss/typography": "0.5.9", + "@types/js-cookie": "^3.0.5", + "@types/node": "20.5.7", + "@typescript-eslint/eslint-plugin": "^5.45.0", + "@typescript-eslint/parser": "^5.45.0", + "autoprefixer": "10.4.15", + "emoji-regex": "^10.3.0", + "eslint": "^8.28.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-svelte": "^2.30.0", + "js-cookie": "^3.0.5", + "postcss": "8.4.29", + "prettier": "^2.8.0", + "prettier-plugin-svelte": "^2.10.1", + "sass": "^1.66.1", + "svelte": "^4.0.5", + "svelte-check": "^3.4.3", + "tailwindcss": "3.3.3", + "tslib": "^2.4.1", + "typescript": "^5.2.2", + "vite": "^4.4.2", + "vite-plugin-tailwind-purgecss": "0.1.3", + "vitest": "^0.34.0" + }, + "dependencies": { + "@floating-ui/dom": "1.5.1", + "@threlte/core": "^6.0.10", + "@threlte/extras": "^7.0.0", + "@yushijinhun/three-minifier-rollup": "^0.4.0", + "hastscript": "^8.0.0", + "highlight.js": "11.8.0", + "linkedom": "^0.15.3", + "mdast-util-to-string": "^4.0.0", + "mdsvex": "^0.11.0", + "prismjs": "^1.29.0", + "rehype-img-size": "^1.0.1", + "rehype-wrap-all": "^1.1.0", + "remark-autolink-headings": "^7.0.1", + "remark-external-links": "^9.0.1", + "remark-slug": "^7.0.1", + "rss": "^1.2.2", + "svelte-preprocess": "^5.0.4", + "unist-util-visit": "^5.0.0" + }, + "type": "module" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fd28131..6926d2b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,9 +67,9 @@ devDependencies: '@skeletonlabs/tw-plugin': specifier: 0.1.0 version: 0.1.0(tailwindcss@3.3.3) - '@sveltejs/adapter-auto': - specifier: ^2.0.0 - version: 2.1.0(@sveltejs/kit@1.25.0) + '@sveltejs/adapter-cloudflare': + specifier: ^2.3.3 + version: 2.3.3(@sveltejs/kit@1.25.0) '@sveltejs/kit': specifier: ^1.20.4 version: 1.25.0(svelte@4.2.1)(vite@4.4.9) @@ -94,6 +94,9 @@ devDependencies: autoprefixer: specifier: 10.4.15 version: 10.4.15(postcss@8.4.29) + emoji-regex: + specifier: ^10.3.0 + version: 10.3.0 eslint: specifier: ^8.28.0 version: 8.50.0 @@ -162,6 +165,10 @@ packages: '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.19 + /@cloudflare/workers-types@4.20231025.0: + resolution: {integrity: sha512-TkcZkntUTOcvJ4vgmwpNfLTclpMbmbClZCe62B25/VTukmyv91joRa4eKzSjzCZUXTbFHNmVdOpmGaaJU2U3+A==} + dev: true + /@esbuild/android-arm64@0.18.20: resolution: {integrity: sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==} engines: {node: '>=12'} @@ -512,13 +519,15 @@ packages: tailwindcss: 3.3.3 dev: true - /@sveltejs/adapter-auto@2.1.0(@sveltejs/kit@1.25.0): - resolution: {integrity: sha512-o2pZCfATFtA/Gw/BB0Xm7k4EYaekXxaPGER3xGSY3FvzFJGTlJlZjBseaXwYSM94lZ0HniOjTokN3cWaLX6fow==} + /@sveltejs/adapter-cloudflare@2.3.3(@sveltejs/kit@1.25.0): + resolution: {integrity: sha512-bbcm6kq4dEluFtFJZed3KSRG4f5GUElYkVfOmnPruTqZ29nTElPJTomAu5QCp7GLkwA26O3h1Dk7+d9yLTQEXg==} peerDependencies: '@sveltejs/kit': ^1.0.0 dependencies: + '@cloudflare/workers-types': 4.20231025.0 '@sveltejs/kit': 1.25.0(svelte@4.2.1)(vite@4.4.9) - import-meta-resolve: 3.0.0 + esbuild: 0.18.20 + worktop: 0.8.0-next.15 dev: true /@sveltejs/kit@1.25.0(svelte@4.2.1)(vite@4.4.9): @@ -1296,6 +1305,10 @@ packages: resolution: {integrity: sha512-UdREXMXzLkREF4jA8t89FQjA8WHI6ssP38PMY4/4KhXFQbtImnghh4GkCgrtiZwLKUKVD2iTVXvDVQjfomEQuA==} dev: true + /emoji-regex@10.3.0: + resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} + dev: true + /entities@4.5.0: resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} engines: {node: '>=0.12'} @@ -1782,10 +1795,6 @@ packages: resolve-from: 4.0.0 dev: true - /import-meta-resolve@3.0.0: - resolution: {integrity: sha512-4IwhLhNNA8yy445rPjD/lWh++7hMDOml2eHtd58eG7h+qK3EryMuuRbsHGPikCoAgIkkDnckKfWSk2iDla/ejg==} - dev: true - /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} @@ -2489,6 +2498,11 @@ packages: dependencies: picomatch: 2.3.1 + /regexparam@2.0.1: + resolution: {integrity: sha512-zRgSaYemnNYxUv+/5SeoHI0eJIgTL/A2pUtXUPLHQxUldagouJ9p+K6IbIZ/JiQuCEv2E2B1O11SjVQy3aMCkw==} + engines: {node: '>=8'} + dev: true + /rehype-img-size@1.0.1: resolution: {integrity: sha512-+rLkxF2H3mQULAg3iA2Z2spJQlBcCpApG8sHC47bc0p33ol+ddz+O3gyUcTgk5xX5jGaj1oQOBs/cBy8nIIhoQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -3349,6 +3363,14 @@ packages: stackback: 0.0.2 dev: true + /worktop@0.8.0-next.15: + resolution: {integrity: sha512-0ycNO52P6nVwsjr1y20zuf0nqJatAb8L7MODBfQIxbxndHV5O4s50oZZMHWhJG1RLpHwbK0Epq8aaQK4E2GlgQ==} + engines: {node: '>=12'} + dependencies: + mrmime: 1.0.1 + regexparam: 2.0.1 + dev: true + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} diff --git a/src/app.html b/src/app.html index 18ffb78..49322fc 100644 --- a/src/app.html +++ b/src/app.html @@ -5,8 +5,6 @@ - - %sveltekit.head% diff --git a/tsconfig.json b/tsconfig.json index c62dfcb..c1bb777 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,15 +2,22 @@ "extends": "./.svelte-kit/tsconfig.json", "compilerOptions": { "allowJs": true, - "outDir": ".svelte-kit", "checkJs": true, + "noEmit": true, + "target": "esnext", + "module": "esnext", + "moduleResolution": "node", + "allowSyntheticDefaultImports": true, + "strict": true, + "skipLibCheck": true, + // custom compiler options "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "resolveJsonModule": true, - "skipLibCheck": true, - "sourceMap": true, - "strict": true - } + "sourceMap": true + }, + "include": ["./scripts/**/*", "./test/*.js", "./*.js"], + "exclude": ["node_modules/*", ".svelte-kit/*"] // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias // // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes