Updated skeleton

This commit is contained in:
Jeroen De Meerleer 2023-08-17 00:22:44 +02:00
parent 13ca1d1432
commit f8b7247346
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
20 changed files with 365 additions and 1124 deletions

View File

@ -1,16 +1,10 @@
module.exports = { module.exports = {
root: true, root: true,
parser: '@typescript-eslint/parser', extends: ['eslint:recommended', 'plugin:svelte/recommended', 'prettier'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
settings: {
'svelte3/typescript': () => require('typescript')
},
parserOptions: { parserOptions: {
sourceType: 'module', sourceType: 'module',
ecmaVersion: 2020 ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
}, },
env: { env: {
browser: true, browser: true,

1
.npmrc
View File

@ -1 +1,2 @@
engine-strict=true engine-strict=true
resolution-mode=highest

44
.vscode/settings.json vendored
View File

@ -1,44 +1,74 @@
{ {
"prettier.documentSelectors": [
"**/*.svelte"
],
"tailwindCSS.classAttributes": [ "tailwindCSS.classAttributes": [
"class", "class",
"accent", "accent",
"active", "active",
"aspectRatio",
"background", "background",
"badge", "badge",
"bgBackdrop",
"bgDark",
"bgDrawer",
"bgLight",
"blur",
"border", "border",
"borderColor",
"borderWidth",
"button", "button",
"buttonAction",
"buttonBack", "buttonBack",
"buttonClasses", "buttonClasses",
"buttonComplete", "buttonComplete",
"buttonDismiss",
"buttonNeutral",
"buttonNext", "buttonNext",
"buttonPositive",
"buttonTextCancel",
"buttonTextConfirm",
"buttonTextFirst",
"buttonTextLast",
"buttonTextNext", "buttonTextNext",
"buttonTextPrevious", "buttonTextPrevious",
"buttonTextSubmit",
"caretClosed",
"caretOpen",
"chips", "chips",
"color", "color",
"controlSeparator",
"controlVariant",
"cursor", "cursor",
"display", "display",
"element", "element",
"fill", "fill",
"fillDark",
"fillLight",
"flex", "flex",
"gap", "gap",
"gridColumns", "gridColumns",
"height", "height",
"hover", "hover",
"invalid", "indent",
"justify", "justify",
"meter", "meter",
"padding", "padding",
"position",
"regionBackdrop",
"regionBody", "regionBody",
"regionCaption", "regionCaption",
"regionCaret", "regionCaret",
"regionCell",
"regionChildren",
"regionCone", "regionCone",
"regionContent", "regionContent",
"regionControl", "regionControl",
"regionDefault", "regionDefault",
"regionDrawer",
"regionFoot", "regionFoot",
"regionFootCell",
"regionFooter",
"regionHead", "regionHead",
"regionHeadCell",
"regionHeader", "regionHeader",
"regionIcon", "regionIcon",
"regionInterface", "regionInterface",
@ -52,7 +82,11 @@
"regionPanel", "regionPanel",
"regionRowHeadline", "regionRowHeadline",
"regionRowMain", "regionRowMain",
"regionSummary",
"regionSymbol",
"regionTab",
"regionTrail", "regionTrail",
"ring",
"rounded", "rounded",
"select", "select",
"shadow", "shadow",
@ -68,10 +102,10 @@
"slotSidebarLeft", "slotSidebarLeft",
"slotSidebarRight", "slotSidebarRight",
"slotTrail", "slotTrail",
"space",
"spacing", "spacing",
"text", "text",
"track", "track",
"width" "width",
"zIndex"
] ]
} }

1252
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,45 +1,33 @@
{ {
"name": "blackbirdchess-client-web", "name": "my-skeleton-app",
"version": "0.0.1", "version": "0.0.1",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"test": "playwright test",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:unit": "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 ."
}, },
"devDependencies": { "devDependencies": {
"@playwright/test": "^1.28.1", "@floating-ui/dom": "^1.5.1",
"@skeletonlabs/skeleton": "^1.0.0", "@skeletonlabs/skeleton": "^1.12.0",
"@sveltejs/adapter-auto": "^2.0.0", "@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.5.0", "@sveltejs/kit": "^1.5.0",
"@tailwindcss/forms": "^0.5.3", "@tailwindcss/forms": "^0.5.4",
"@typescript-eslint/eslint-plugin": "^5.45.0", "@tailwindcss/typography": "^0.5.9",
"@typescript-eslint/parser": "^5.45.0", "autoprefixer": "^10.4.15",
"autoprefixer": "^10.4.7", "axios": "^1.4.0",
"eslint": "^8.28.0", "eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0", "eslint-plugin-svelte": "^2.26.0",
"postcss": "^8.4.14", "postcss": "^8.4.28",
"postcss-load-config": "^4.0.1",
"prettier": "^2.8.0", "prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1", "prettier-plugin-svelte": "^2.8.1",
"sass": "^1.65.1",
"svelte": "^3.54.0", "svelte": "^3.54.0",
"svelte-check": "^3.0.1", "tailwindcss": "^3.3.3",
"svelte-preprocess": "^4.10.7", "vite": "^4.3.0"
"tailwindcss": "^3.1.5",
"tslib": "^2.4.1",
"typescript": "^4.9.3",
"vite": "^4.0.0",
"vitest": "^0.25.3"
}, },
"type": "module", "type": "module"
"dependencies": {
"axios": "^1.3.4"
}
} }

View File

@ -1,11 +0,0 @@
import type { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
webServer: {
command: 'npm run build && npm run preview',
port: 4173
},
testDir: 'tests'
};
export default config;

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
plugins: { plugins: {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {} autoprefixer: {},
} },
}; }

1
src/app.d.ts vendored
View File

@ -7,4 +7,3 @@ declare namespace App {
// interface Error {} // interface Error {}
// interface Platform {} // interface Platform {}
} }

View File

@ -1,12 +1,12 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en" class="dark">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> <link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width" /> <meta name="viewport" content="width=device-width" />
%sveltekit.head% %sveltekit.head%
</head> </head>
<body data-sveltekit-preload-data="hover" data-theme="skeleton"> <body data-sveltekit-preload-data="hover" data-theme="skeleton">
<div style="display: contents">%sveltekit.body%</div> <div style="display: contents">%sveltekit.body%</div>
</body> </body>
</html> </html>

View File

@ -1,10 +1,6 @@
/*Write your global styles here, in PostCSS syntax */
@import "/static/scss/icons.scss";
@tailwind base;
/*place global styles here */ /*place global styles here */
@import "/static/scss/icons.scss";
html, html,
body { body {
@apply h-full overflow-hidden; @apply h-full;
} }
@tailwind components;
@tailwind utilities;

View File

@ -1,7 +0,0 @@
import { describe, it, expect } from 'vitest';
describe('sum test', () => {
it('adds 1 + 2 to equal 3', () => {
expect(1 + 2).toBe(3);
});
});

View File

@ -1,10 +1,10 @@
<script lang="ts"> <script lang="ts">
// The ordering of these imports is critical to your app working properly // The ordering of these imports is critical to your app working properly
import '@skeletonlabs/skeleton/themes/theme-skeleton.css'; import '@skeletonlabs/skeleton/themes/theme-skeleton.css';
// If you have source.organizeImports set to true in VSCode, then it will auto change this ordering // If you have source.organizeImports set to true in VSCode, then it will auto change this ordering
import '@skeletonlabs/skeleton/styles/all.css'; import '@skeletonlabs/skeleton/styles/all.css';
// Most of your app wide CSS should be put in this file // Most of your app wide CSS should be put in this file
import '../app.postcss'; import '../app.postcss';
import {alerts, globals} from "$lib/stores.js"; import {alerts, globals} from "$lib/stores.js";

View File

@ -32,7 +32,6 @@
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
import {browser} from "$app/environment"; import {browser} from "$app/environment";
import {requestor} from "../../../serverrequest.js"; import {requestor} from "../../../serverrequest.js";
import {throwError} from "svelte-preprocess/dist/modules/errors.js";
import {goto} from "$app/navigation"; import {goto} from "$app/navigation";
var email = ''; var email = '';
@ -53,7 +52,7 @@
if(response.status != 200) { if(response.status != 200) {
let message = 'Something went wrong during login' let message = 'Something went wrong during login'
if(typeof responsedata.message !== 'undefined') message = responsedata.message if(typeof responsedata.message !== 'undefined') message = responsedata.message
throwError(message) throw(message)
} }
if(!responsedata.success) return alerts.update(data => [...data, {text: 'Login failed: ' + responsedata.message , class: 'error'}]); if(!responsedata.success) return alerts.update(data => [...data, {text: 'Login failed: ' + responsedata.message , class: 'error'}]);
globals.update((globalobj) => ({ ...globalobj, ...{user: responsedata.user }})); globals.update((globalobj) => ({ ...globalobj, ...{user: responsedata.user }}));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -1,17 +1,10 @@
import preprocess from 'svelte-preprocess';
import adapter from '@sveltejs/adapter-auto'; import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite'; import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { 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: vitePreprocess(),
vitePreprocess(),
preprocess({
postcss: true
})
],
kit: { kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
@ -20,5 +13,4 @@ const config = {
adapter: adapter() adapter: adapter()
} }
}; };
export default config; export default config;

View File

@ -1,15 +1,14 @@
import { join } from 'path'
import forms from '@tailwindcss/forms'
import typography from '@tailwindcss/typography'
import skeleton from '@skeletonlabs/skeleton/tailwind/skeleton.cjs'
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
module.exports = { module.exports = {
darkMode: 'class', darkMode: 'class',
content: [ content: ['./src/**/*.{html,js,svelte,ts}', join(require.resolve('@skeletonlabs/skeleton'), '../**/*.{html,js,svelte,ts}')],
'./src/**/*.{html,js,svelte,ts}',
require('path').join(require.resolve('@skeletonlabs/skeleton'), '../**/*.{html,js,svelte,ts}')
],
theme: { theme: {
extend: {} extend: {},
}, },
plugins: [ plugins: [forms,typography,...skeleton()],
...require('@skeletonlabs/skeleton/tailwind/skeleton.cjs')(), }
require('@tailwindcss/forms')
]
};

View File

@ -1,6 +0,0 @@
import { expect, test } from '@playwright/test';
test('index page has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: 'Welcome to SvelteKit' })).toBeVisible();
});

View File

@ -1,17 +0,0 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true
}
// 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
// from the referenced tsconfig.json - TypeScript does not merge them in
}

6
vite.config.js Normal file
View File

@ -0,0 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()]
});

View File

@ -1,12 +0,0 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [sveltekit()],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
server: {
port: 5174
}
});