Merge pull request #232 from appwrite/chore-upgrade-sveltekit

Chore: upgrade sveltekit and dependencies
This commit is contained in:
Torsten Dittmann authored and GitHub committed 2023-02-06 10:53:42 +01:00
commit 5ea4622f1f
19 files changed
+3024 -7536

No files matched your search

+2960 -7482
View File
File diff suppressed because it is too large. Load diff
+26 -25
View File
@@ -23,43 +23,44 @@
"@appwrite.io/pink": "^0.0.3",
"@aw-labs/appwrite-console": "^13.1.0",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.19.0",
"@sentry/tracing": "^7.19.0",
"@sentry/svelte": "^7.36.0",
"@sentry/tracing": "^7.36.0",
"analytics": "^0.8.1",
"echarts": "^5.4.0",
"pretty-bytes": "^6.0.0",
"echarts": "^5.4.1",
"pretty-bytes": "^6.1.0",
"prismjs": "^1.29.0",
"tippy.js": "^6.3.7",
"web-vitals": "^3.0.3"
"web-vitals": "^3.1.1"
},
"devDependencies": {
"@playwright/test": "^1.27.1",
"@sveltejs/adapter-static": "1.0.0-next.46",
"@sveltejs/kit": "1.0.0-next.525",
"@sveltejs/vite-plugin-svelte": "^1.1.0",
"@testing-library/dom": "^8.19.0",
"@playwright/test": "^1.30.0",
"@sveltejs/adapter-static": "1.0.6",
"@sveltejs/kit": "1.3.10",
"@sveltejs/vite-plugin-svelte": "^2.0.2",
"@testing-library/dom": "^8.20.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "^3.2.2",
"@testing-library/user-event": "^14.4.3",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.41.0",
"@typescript-eslint/parser": "^5.41.0",
"@vitest/ui": "^0.24.3",
"eslint": "^8.26.0",
"eslint-config-prettier": "^8.5.0",
"@typescript-eslint/eslint-plugin": "^5.50.0",
"@typescript-eslint/parser": "^5.50.0",
"@vitest/ui": "^0.28.4",
"eslint": "^8.33.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-svelte3": "^4.0.0",
"jsdom": "^21.1.0",
"pre-commit": "^1.2.2",
"prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.8.0",
"sass": "^1.55.0",
"svelte": "^3.52.0",
"svelte-check": "^2.9.2",
"prettier": "^2.8.3",
"prettier-plugin-svelte": "^2.9.0",
"sass": "^1.58.0",
"svelte": "^3.55.1",
"svelte-check": "^3.0.3",
"svelte-jester": "^2.3.2",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.4.0",
"typescript": "^4.8.4",
"vite": "^3.2.1",
"vitest": "^0.24.3"
"svelte-preprocess": "^5.0.1",
"tslib": "^2.5.0",
"typescript": "^4.9.5",
"vite": "^4.1.1",
"vitest": "^0.28.4"
},
"type": "module",
"pre-commit": [
+1 -1
View File
@@ -18,7 +18,7 @@ export function trackEvent(name: string, data: object = null): void {
if (!isTrackingAllowed()) {
return;
}
const path = get(page).routeId;
const path = get(page).route.id;
analytics.track(name, { ...data, path });
sendEventToGrowth(name, path, data);
}
+4 -1
View File
@@ -7,6 +7,9 @@
export let danger = false;
export let href: string = null;
//allows to add the href attribute without throwing an error
let attributes = { href } as Record<string, string>;
function getElement(): string {
switch (true) {
case !!href:
@@ -27,6 +30,6 @@
class:is-danger={danger}
on:click
on:keyup={clickOnEnter}
{href}>
{...attributes}>
<slot />
</svelte:element>
+4 -1
View File
@@ -4,10 +4,13 @@
export let href: string;
export let icon: string = null;
export let disabled = false;
//allows to add the disabled attribute to <a> tag without throwing an error
let attributes = { disabled } as Record<string, boolean>;
</script>
<li class="drop-list-item" on:click on:keyup={clickOnEnter}>
<a {href} class="drop-button" {disabled}>
<a {href} class="drop-button" {...attributes}>
<span class="text"><slot /></span>
{#if icon}
<span class={`icon-${icon}`} aria-hidden="true" />
+4 -1
View File
@@ -179,6 +179,9 @@
inputData = null;
showInput = false;
}
//allows to add the href attribute without throwing an error
const attributes = { type: 'text', readonly: 'readonly' } as Record<string, string>;
</script>
<Modal bind:show on:submit={create} size="big">
@@ -279,7 +282,7 @@
</div>
{:else}
<div class="input-text-wrapper" style="--amount-of-buttons:2">
<div type="text" readonly style="min-height: 2.5rem;">
<div {...attributes} style="min-height: 2.5rem;">
{#if inputData}
<span>{inputData}</span>
{:else}
+1 -1
View File
@@ -46,7 +46,7 @@
url.search = value;
goto(url, { keepfocus: true });
goto(url, { keepFocus: true });
}, debounce);
};
</script>
+4 -1
View File
@@ -14,6 +14,9 @@
export let noMargin = false;
export let event: string = null;
//allows to add the disabled attribute to <a> tag without throwing an error
let attributes = { disabled } as Record<string, boolean>;
function track() {
if (!event) {
return;
@@ -28,7 +31,7 @@
{#if href}
<a
on:click={track}
{disabled}
{...attributes}
{href}
target={external ? '_blank' : ''}
rel={external ? 'noopener noreferrer' : ''}
@@ -19,8 +19,6 @@
role="textbox"
{id}
aria-placeholder={placeholder}
name={id}
type="text"
class="input-text is-resizable"
bind:textContent={value} />
{:else}
+4 -1
View File
@@ -11,6 +11,9 @@
export let href: string = null;
export let trim = false;
//allows to add the disabled attribute to <a> tag without throwing an error
let attributes = { disabled } as Record<string, boolean>;
let element: HTMLButtonElement;
const isOverflowing = (elem: HTMLButtonElement, iterator = 1) => {
@@ -41,7 +44,7 @@
{#if href}
<a
{disabled}
{...attributes}
{href}
target={external ? '_blank' : '_self'}
rel={external ? 'noopener noreferrer' : ''}
+1 -7
View File
@@ -2,12 +2,6 @@
import { clickOnEnter } from '$lib/helpers/a11y';
</script>
<!-- svelte-ignore a11y-unknown-role -->
<tr
class="table-row"
role="row button"
tabindex="0"
on:keyup={clickOnEnter}
on:click|preventDefault>
<tr class="table-row" role="button" tabindex="0" on:keyup={clickOnEnter} on:click|preventDefault>
<slot />
</tr>
+1 -1
View File
@@ -18,7 +18,7 @@ const vitalsUrl = 'https://vitals.vercel-analytics.com/v1/vitals';
function getConnectionSpeed() {
return 'connection' in navigator &&
navigator['connection'] &&
'effectiveType' in navigator['connection']
'effectiveType' in (navigator['connection'] as Record<string, unknown>)
? navigator['connection']['effectiveType']
: '';
}
+1 -1
View File
@@ -49,7 +49,7 @@
{#if $log.data}
<section class="cover-frame">
<header class="cover-frame-header u-flex u-gap-16 u-main-space-between u-cross-center">
<h1 class="body-text-1" name="title">Function ID: {$log.func.$id}</h1>
<h1 class="body-text-1">Function ID: {$log.func.$id}</h1>
<button
on:click={() => ($log.show = false)}
class="button is-text is-only-icon"
+1 -1
View File
@@ -37,7 +37,7 @@ export function createPersistentPagination(limit: number) {
}
goto(target, {
noscroll: true
noScroll: true
});
};
+1 -2
View File
@@ -53,7 +53,6 @@
!$page.url.pathname.startsWith('/console') &&
!$page.url.pathname.startsWith('/invite')
) {
console.log('test');
await goto(`${base}/console`, {
replaceState: true
});
@@ -73,7 +72,7 @@
});
afterNavigate((navigation) => {
trackPageView(navigation.to.routeId);
trackPageView(navigation.to.route.id);
});
$: {
@@ -349,7 +349,7 @@
<label class="choice-item" for="encryption">
<div class="input-text-wrapper">
<input
label="Encryption"
name="encryption"
id="encryption"
type="checkbox"
class="switch"
@@ -372,7 +372,7 @@
<label class="choice-item" for="antivirus">
<div class="input-text-wrapper">
<input
label="Antivirus"
name="antivirus"
id="antivirus"
type="checkbox"
class="switch"
+6 -5
View File
@@ -59,7 +59,7 @@ test('shows next step with submit', async () => {
expect(step1Required).toBeInTheDocument();
expect(step1Optional).toBeInTheDocument();
form.submit();
form.dispatchEvent(new Event('submit'));
await tick();
expect(step1).not.toBeInTheDocument();
@@ -72,7 +72,7 @@ test('shows next step with submit', async () => {
expect(step2First).toBeInTheDocument();
expect(step2Second).toBeInTheDocument();
form.submit();
form.dispatchEvent(new Event('submit'));
await tick();
expect(form).not.toBeInTheDocument();
@@ -96,7 +96,8 @@ test('intercepts submit', async () => {
expect(step1Optional).toBeInTheDocument();
await userEvent.type(step1Required, 'fail');
form.submit();
form.dispatchEvent(new Event('submit'));
await tick();
expect(step1).toBeInTheDocument();
@@ -104,7 +105,7 @@ test('intercepts submit', async () => {
expect(step1Optional).toBeInTheDocument();
await userEvent.type(step1Required, 'works');
form.submit();
form.dispatchEvent(new Event('submit'));
await tick();
expect(step1).not.toBeInTheDocument();
@@ -117,7 +118,7 @@ test('intercepts submit', async () => {
expect(step2First).toBeInTheDocument();
expect(step2Second).toBeInTheDocument();
form.submit();
form.dispatchEvent(new Event('submit'));
await tick();
expect(form).not.toBeInTheDocument();
+2
View File
@@ -1,4 +1,5 @@
import { vi } from 'vitest';
import * as svelteinternal from 'svelte/internal';
beforeAll(() => {
vi.mock('$app/environment', () => ({
@@ -10,4 +11,5 @@ beforeAll(() => {
vi.mock('$app/navigation', () => ({
goto: vi.fn()
}));
vi.mock('svelte', () => svelteinternal);
});
+1 -1
View File
@@ -7,7 +7,7 @@ const config = {
include: ['echarts', 'prismjs']
},
ssr: {
noExternal: ['echarts', 'prismjs']
noExternal: ['echarts', 'prismjs', '@analytics/google-analytics', 'analytics']
},
define: {
'import.meta.env.VERCEL_ANALYTICS_ID': JSON.stringify(process.env.VERCEL_ANALYTICS_ID)