This commit is contained in:
matthieu42morin 2024-04-04 02:39:54 +02:00
parent 8265e41250
commit 1156a503fa
6 changed files with 171 additions and 121 deletions

View File

@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install -g pnpm && pnpm install
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30

33
.gitignore vendored
View File

@ -1,19 +1,41 @@
+ .turbo + .turbo
+ build/** + build/**
+ dist/** + dist/**
dist
dist-ssr
.DS_Store .DS_Store
node_modules node_modules
/build /build
/.svelte-kit /.svelte-kit
/package /package
/lambda/
# Sentry Config File
.sentryclirc
.env .env
.env.* .env.*
!.env.example !.env.example
*.local
vite.config.js.timestamp-* vite.config.js.timestamp-*
vite.config.ts.timestamp-* vite.config.ts.timestamp-*
.vercel .vercel
.output .output
.netlify
cypress/screenshots
cypress/videos
.idea
.stars-cache
# pm
.yarn .yarn
yarn-error.log
yarn.lock
pnpm-lock.yaml
# Logs # Logs
logs logs
@ -24,14 +46,10 @@ yarn-error.log*
pnpm-debug.log* pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files # Editor directories and files
!.vscode/extensions.json !.vscode/extensions.json
.vscode/* .vscode/*
.editorconfig
.idea .idea
*.suo *.suo
*.ntvs* *.ntvs*
@ -61,3 +79,8 @@ public/api/vendor
/playwright-report/ /playwright-report/
/blob-report/ /blob-report/
/playwright/.cache/ /playwright/.cache/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

View File

@ -36,3 +36,7 @@ npm run build
You can preview the production build with `npm run preview`. You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment. > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
TODO: REcompose based on KkosmetickySalon project

View File

@ -1,85 +1,83 @@
{ {
"name": "portfolio", "name": "its-personal~portfolio",
"description": "Uses pnpm, svelte, mdsvex", "description": "Uses pnpm, svelte, mdsvex",
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"private": true, "private": true,
"homepage": "mattmor.in", "homepage": "mattmor.in",
"author": "Matthieu Morin", "author": "Matthieu Morin",
"license": "AGPLv3", "license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/matthieu42morin/Portfolio/" "url": "https://git.mattmor.in/Madmin/its-personal/"
}, },
"packageManager": "pnpm@8.6.6", "packageManager": "pnpm@8.6.6",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json", "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test": "vitest", "test": "vitest",
"lint": "prettier --plugin-search-dir . --check . && eslint .", "lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write .", "format": "prettier --plugin-search-dir . --write .",
"test-ct": "playwright test -c playwright-ct.config.ts" "test-ct": "playwright test -c playwright-ct.config.ts"
}, },
"devDependencies": { "devDependencies": {
"@playwright/experimental-ct-svelte": "^1.41.2", "@playwright/test": "^1.41.2",
"@skeletonlabs/skeleton": "2.0.0", "@skeletonlabs/skeleton": "2.0.0",
"@skeletonlabs/tw-plugin": "0.1.0", "@skeletonlabs/tw-plugin": "0.1.0",
"@sveltejs/adapter-cloudflare": "^2.3.4", "@sveltejs/kit": "^2.5.0",
"@sveltejs/kit": "^1.30.3", "@tailwindcss/forms": "0.5.6",
"@tailwindcss/forms": "0.5.6", "@tailwindcss/typography": "0.5.9",
"@tailwindcss/typography": "0.5.9", "@types/js-cookie": "^3.0.6",
"@types/js-cookie": "^3.0.6", "@types/node": "20.5.7",
"@types/node": "20.5.7", "@types/prismjs": "^1.26.3",
"@types/prismjs": "^1.26.3", "@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/eslint-plugin": "^5.62.0", "@typescript-eslint/parser": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0", "autoprefixer": "10.4.15",
"autoprefixer": "10.4.15", "emoji-regex": "^10.3.0",
"emoji-regex": "^10.3.0", "eslint": "^8.56.0",
"eslint": "^8.56.0", "eslint-config-prettier": "^8.10.0",
"eslint-config-prettier": "^8.10.0", "eslint-plugin-svelte": "^2.35.1",
"eslint-plugin-svelte": "^2.35.1", "js-cookie": "^3.0.5",
"ficons": "^1.1.54", "postcss": "8.4.29",
"hastscript": "^8.0.0", "prettier": "^2.8.8",
"js-cookie": "^3.0.5", "prettier-plugin-svelte": "^2.10.1",
"mdast-util-to-string": "^4.0.0", "rehype-autolink-headings": "^7.1.0",
"mdsvex": "^0.11.0", "rehype-img-size": "^1.0.1",
"postcss": "8.4.29", "rehype-slug": "^6.0.0",
"prettier": "^2.8.8", "remark-external-links": "^9.0.1",
"prettier-plugin-svelte": "^2.10.1", "remark-toc": "^9.0.0",
"rehype-img-size": "^1.0.1", "remark-unwrap-images": "^4.0.0",
"rehype-wrap-all": "^1.1.0", "sass": "^1.71.0",
"remark-external-links": "^9.0.1", "shiki": "^1.1.6",
"sass": "^1.70.0", "svelte": "^4.2.11",
"svelte": "^4.2.10", "svelte-check": "^3.6.4",
"svelte-check": "^3.6.4", "tailwindcss": "3.3.3",
"tailwindcss": "3.3.3", "tslib": "^2.6.2",
"tslib": "^2.6.2", "typescript": "^5.3.3",
"typescript": "^5.3.3", "unist-util-visit": "^5.0.0",
"unist-util-visit": "^5.0.0", "vite": "^5.1.3",
"vite": "^4.5.2", "vite-plugin-tailwind-purgecss": "0.2.0",
"vite-plugin-tailwind-purgecss": "0.1.3", "vitest": "^0.34.6"
"vitest": "^0.34.6" },
}, "dependencies": {
"dependencies": { "@floating-ui/dom": "1.5.1",
"@floating-ui/dom": "1.5.1", "@fortawesome/fontawesome-free": "^6.5.1",
"@fortawesome/fontawesome-free": "^6.5.1", "@sentry/sveltekit": "^7.102.0",
"@sveltejs/adapter-node": "^4.0.1", "@sveltejs/adapter-node": "^4.0.1",
"@threlte/core": "^6.1.1", "@sveltejs/vite-plugin-svelte": "^3.0.2",
"@threlte/extras": "^8.7.4", "@threlte/core": "^6.1.1",
"@yushijinhun/three-minifier-rollup": "^0.4.0", "@threlte/extras": "^8.7.5",
"highlight.js": "11.8.0", "@yushijinhun/three-minifier-rollup": "^0.4.0",
"latest": "^0.2.0", "highlight.js": "11.8.0",
"linkedom": "^0.15.6", "latest": "^0.2.0",
"prismjs": "^1.29.0", "linkedom": "^0.15.6",
"rehype-autolink-headings": "^7.1.0", "mdsvex": "^0.11.0",
"rehype-slug": "^6.0.0", "prismjs": "^1.29.0",
"remark-toc": "^9.0.0", "rss": "^1.2.2",
"remark-unwrap-images": "^4.0.0", "svelte-preprocess": "^5.1.3"
"rss": "^1.2.2", },
"svelte-preprocess": "^5.1.3" "type": "module"
},
"type": "module"
} }

View File

@ -1,14 +1,9 @@
import adapter from '@sveltejs/adapter-cloudflare'; import adapter from '@sveltejs/adapter-node';
import { vitePreprocess } from '@sveltejs/kit/vite';
import preprocess from 'svelte-preprocess'; import preprocess from 'svelte-preprocess';
// import { mdsvexGlobalComponents } from './src/lib/utils/mdsvexGlobalComponents.js/index.js'; // config extensions
import { mdsvex } from 'mdsvex'; import { mdsvex } from 'mdsvex';
import mdsvexConfig from './mdsvex.config.js'; import mdsvexConfig from './mdsvex.config.js';
/* Not using
// import { mdsvexGlobalComponents } from './src/lib/utils/mdsvex-global-components.js';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { const config = {
@ -16,10 +11,7 @@ const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors // Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors // for more information about preprocessors
preprocess: [ preprocess: [
preprocess({ preprocess({ postcss: true }),
postcss: true
}),
vitePreprocess(),
// No neeed rn unless using mdsvex highlighter with svelte components // No neeed rn unless using mdsvex highlighter with svelte components
//mdsvexGlobalComponents({ //mdsvexGlobalComponents({
@ -38,8 +30,12 @@ const config = {
// If your environment is not supported or you settled on a specific environment, switch out the adapter. // If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters. // See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter({}), adapter: adapter({
// sometimes problems with out: 'build',
precompress: false
}),
// Aliases need tsconfig explicit inclusion
alias: { alias: {
$lib: './src/lib', $lib: './src/lib',
$root: './', $root: './',
@ -47,15 +43,6 @@ const config = {
$routes: './src/routes', $routes: './src/routes',
$content: './src/content' $content: './src/content'
}, },
// TODO: FIX Banning external malware scripts for security and privacy of users, threw errors,
// csp: {
// directives: {
// 'script-src': ['self']
// },
// reportOnly: {
// 'script-src': ['self']
// }
// },
csrf: { csrf: {
checkOrigin: process.env.NODE_ENV === 'development' ? false : true checkOrigin: process.env.NODE_ENV === 'development' ? false : true
}, },
@ -66,7 +53,7 @@ const config = {
// Handle blog trying to prerender relative links that it can't // Handle blog trying to prerender relative links that it can't
if ( if (
details.status == 404 && details.status == 404 &&
details.path.startsWith('/blog') && details.path.startsWith('/blog' && '/projects') &&
details.referenceType == 'linked' details.referenceType == 'linked'
) { ) {
console.warn(`PRERENDER ignored route ${details.path}`); console.warn(`PRERENDER ignored route ${details.path}`);

View File

@ -3,20 +3,31 @@
"compilerOptions": { "compilerOptions": {
"allowJs": true, "allowJs": true,
"checkJs": true, "checkJs": true,
"noEmit": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "Bundler",
"allowSyntheticDefaultImports": true,
"strict": true,
"skipLibCheck": true,
// custom compiler options
"esModuleInterop": true, "esModuleInterop": true,
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"sourceMap": true "skipLibCheck": true,
"sourceMap": true,
"strict": true,
// custom compiler options
"noEmit": true,
"target": "ES2018",
"module": "ES2022",
"moduleResolution": "Bundler",
"allowSyntheticDefaultImports": true
}, },
"include": ["./scripts/**/*", "./test/*.js", "./*.js", "mdsvex.config.ts", "svelte.config.ts"], "include": [
"./scripts/**/*",
"./test/*.js",
"./*.js",
"./src/**/*.d.ts",
"./src/**/*.js",
"./src/**/*.svelte",
"./src/**/*.ts",
".svelte-kit/ambient.d.ts",
".svelte-kit/types/**/$types.d.ts",
"./csp-directives.ts"
],
"exclude": ["node_modules/*"] "exclude": ["node_modules/*"]
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
// //