Skip to content

Commit

Permalink
Bump eslint in e2e/kit, update erroring old svelte syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
SeppahBaws committed Aug 19, 2024
1 parent 9aa1de7 commit 309ceb8
Show file tree
Hide file tree
Showing 15 changed files with 103 additions and 102 deletions.
8 changes: 4 additions & 4 deletions e2e/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,22 @@
"@sveltejs/adapter-auto": "^3.2.1",
"@sveltejs/kit": "^2.5.10",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"concurrently": "7.1.0",
"cross-env": "^7.0.3",
"e2e-api": "workspace:^",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.39.0",
"eslint-plugin-svelte": "^2.43.0",
"houdini": "workspace:^",
"houdini-plugin-svelte-global-stores": "workspace:^",
"houdini-svelte": "workspace:^",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "5.0.0-next.208",
"svelte-check": "^3.8.0",
"svelte-eslint-parser": "^0.36.0",
"svelte-eslint-parser": "^0.41.0",
"svelte-preprocess": "^5.1.4",
"tslib": "^2.3.1",
"typescript": "^5.0.0",
Expand Down
6 changes: 4 additions & 2 deletions e2e/kit/src/lib/QueryExt.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script lang="ts">
import { browser } from '$app/environment';
import { GQL_usersListComp } from '$houdini';
import { onMount } from 'svelte';
$: browser && GQL_usersListComp.fetch();
onMount(() => {
GQL_usersListComp.fetch();
});
</script>

<p id="QueryExt-result">
Expand Down
1 change: 1 addition & 0 deletions e2e/kit/src/params/integer.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { MyEnum } from '$houdini';
// this is here to silence the warning that MyEnum isn't being used :facepalm:
// eslint-disable-next-line
MyEnum;

/** @type {import('@sveltejs/kit').ParamMatcher} */
Expand Down
7 changes: 5 additions & 2 deletions e2e/kit/src/routes/lists/all/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<script lang="ts">
import { browser } from '$app/environment';
import { goto, invalidate } from '$app/navigation';
import { page } from '$app/stores';
import { GQL_ListAll_AddUser } from '$houdini';
import { onMount } from 'svelte';
import type { PageData } from './$houdini';
export let data: PageData;
$: ({ ListAll } = data);
let limit = parseInt($page.url.searchParams.get('limit') ?? '1', 10);
$: browser && limit && updateQS();
onMount(() => {
updateQS();
});
async function updateQS() {
const newUrl = new URL($page.url);
Expand Down
4 changes: 2 additions & 2 deletions e2e/kit/src/routes/plugin/subscription/renders/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { graphql } from '$houdini';
graphql`
graphql(`
subscription MySubscription {
userUpdate(id: "1", snapshot: "subscription-test") {
id
}
}
`;
`);
</script>

<div id="result">hello</div>
5 changes: 3 additions & 2 deletions e2e/kit/src/routes/stores/metadata/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { browser } from '$app/environment';
import { CachePolicy, GQL_Session, GQL_UpdateUserSubUnsub } from '$houdini';
import { onMount } from 'svelte';
async function mutate() {
await GQL_UpdateUserSubUnsub.mutate(
Expand All @@ -16,11 +16,12 @@
// there's nothing passing the session there to this fetch so the result is undefined
$: browser &&
onMount(() => {
GQL_Session.fetch({
metadata: { logResult: true },
policy: CachePolicy.NetworkOnly // to enforce a new fetch (even if it's alreay in cache somewhere else)
});
});
</script>

<h1>Metadata</h1>
Expand Down
4 changes: 2 additions & 2 deletions e2e/kit/src/routes/stores/mutation-update/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export async function load(event: LoadEvent) {
};
}

graphql`
graphql(`
query TestMutationUpdateUsersList {
usersList(limit: 5, snapshot: "update-user-mutation") {
id
name
...UserInfo
}
}
`;
`);
6 changes: 4 additions & 2 deletions e2e/kit/src/routes/stores/nested-list/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import { browser } from '$app/environment';
import {
GQL_Cities,
GQL_AddCity,
Expand All @@ -11,8 +10,11 @@
type ForceReturn$options,
GQL_RemoveBook
} from '$houdini';
import { onMount } from 'svelte';
$: browser && GQL_Cities.fetch();
onMount(() => {
GQL_Cities.fetch();
});
const addCity = (event: Event) => {
const target = event?.target as HTMLInputElement;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
<script lang="ts">
import { browser } from '$app/environment';
import { MultiUserStore } from '$houdini';
import { onMount } from 'svelte';
const variables1 = { id: '1' };
const u1 = new MultiUserStore();
$: browser && u1.fetch({ variables: variables1 });
const variables5 = { id: '5' };
const u5 = new MultiUserStore();
$: browser && u5.fetch({ variables: variables5 });
onMount(() => {
u1.fetch({ variables: variables1 });
u5.fetch({ variables: variables5 });
});
</script>

<h1>network-one-store-multivariables</h1>
Expand Down
8 changes: 5 additions & 3 deletions e2e/kit/src/routes/stores/network/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<script lang="ts">
import { browser } from '$app/environment';
import { GQL_Hello, GQL_usersList } from '$houdini';
import { onMount } from 'svelte';
$: browser && GQL_usersList.fetch();
$: browser && GQL_Hello.fetch();
onMount(() => {
GQL_usersList.fetch();
GQL_Hello.fetch();
});
</script>

<h1>NETWORK</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script lang="ts">
import { browser } from '$app/environment';
import { CachePolicy, GQL_StoreForwardCursorPaginationQuery } from '$houdini';
import { onMount } from 'svelte';
$: browser && GQL_StoreForwardCursorPaginationQuery.fetch();
onMount(() => {
GQL_StoreForwardCursorPaginationQuery.fetch();
});
function loadNextPage() {
GQL_StoreForwardCursorPaginationQuery.loadNextPage();
Expand Down
6 changes: 4 additions & 2 deletions e2e/kit/src/routes/stores/subunsub-list/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<script lang="ts">
import { browser } from '$app/environment';
import { GQL_UsersListSubUnSub } from '$houdini';
import { onMount } from 'svelte';
$: browser && GQL_UsersListSubUnSub.fetch();
onMount(() => {
GQL_UsersListSubUnSub.fetch();
});
</script>

<h1>Sub Unsub - List</h1>
Expand Down
1 change: 1 addition & 0 deletions e2e/react/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default defineConfig({
reporter: process.env.CI ? [['list'], ['html'], ['github']] : [['list']],
use: { screenshot: 'only-on-failure' },
testIgnore: '**/$houdini/**',
testMatch: 'test.ts',

webServer: {
command: 'PORT=3008 npm run dev',
Expand Down
6 changes: 3 additions & 3 deletions e2e/svelte/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig } from "@playwright/test";
import { defineConfig } from '@playwright/test'

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const reporter = [['list']]
Expand All @@ -9,7 +9,7 @@ if (process.env.CI) {

const config = defineConfig({
retries: process.env.CI ? 3 : 0,
testMatch: 'spec.ts',
testMatch: 'spec.ts',
workers: 5,
reporter,
screenshot: 'only-on-failure',
Expand All @@ -18,6 +18,6 @@ const config = defineConfig({
port: 3006,
timeout: 120 * 1000,
},
});
})

export default config
Loading

0 comments on commit 309ceb8

Please sign in to comment.