Skip to content

Commit

Permalink
Bump kitql dependencies (#1219)
Browse files Browse the repository at this point in the history
  • Loading branch information
jycouet authored Oct 15, 2023
1 parent a6a5147 commit 11b1226
Show file tree
Hide file tree
Showing 39 changed files with 108 additions and 115 deletions.
2 changes: 1 addition & 1 deletion e2e/_api/graphql.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep } from '@kitql/helper'
import { sleep } from '@kitql/helpers'
import fs from 'fs-extra'
import { GraphQLError } from 'graphql'
import { GraphQLScalarType, Kind } from 'graphql'
Expand Down
2 changes: 1 addition & 1 deletion e2e/_api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@graphql-yoga/plugin-persisted-operations": "^1.9.1",
"@envelop/core": "^3.0.6",
"@kitql/helper": "^0.5.0",
"@kitql/helpers": "^0.8.2",
"fs-extra": "^10.1.0",
"graphql": "^15.8.0",
"graphql-relay": "^0.10.0",
Expand Down
6 changes: 3 additions & 3 deletions e2e/_api/server.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { usePersistedOperations } from '@graphql-yoga/plugin-persisted-operations'
import { logGreen } from '@kitql/helper'
import { green } from '@kitql/helpers'
import fs from 'fs-extra'
import { useServer } from 'graphql-ws/lib/use/ws'
import { createYoga, createSchema } from 'graphql-yoga'
Expand Down Expand Up @@ -137,8 +137,8 @@ mutation AddUser {

httpServer.prependOnceListener('error', (err) => {
if (err.code === 'EADDRINUSE') {
console.info(logGreen(` 🧐 Port 4000 is already in use.`))
console.info(logGreen(` ✅ API probably started by another e2e test, It's all good.`))
console.info(green(` 🧐 Port 4000 is already in use.`))
console.info(green(` ✅ API probably started by another e2e test, It's all good.`))
process.exit(0)
}
})
Expand Down
4 changes: 2 additions & 2 deletions e2e/kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
},
"devDependencies": {
"@kitql/helper": "^0.5.0",
"@kitql/helpers": "^0.8.2",
"@playwright/test": "1.30.0",
"@sveltejs/adapter-auto": "2.0.0",
"@sveltejs/kit": "1.9.3",
Expand All @@ -46,7 +46,7 @@
"tslib": "^2.3.1",
"typescript": "^4.9",
"vite": "^4.1.4",
"vite-plugin-lib-reporter": "^0.0.6"
"vite-plugin-lib-reporter": "^0.0.7"
},
"dependencies": {
"graphql-ws": "^5.8.2"
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/lib/utils/testsHelper.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { routes } from './routes.js';
import { sleep, stry } from '@kitql/helper';
import { sleep, stry } from '@kitql/helpers';
import type { Page, Response } from '@playwright/test';
import { expect } from '@playwright/test';

Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/blocking/spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';
import { expect, test } from '@playwright/test';
import { routes } from '../../lib/utils/routes.js';
import { clientSideNavigation, expect_to_be, goto } from '../../lib/utils/testsHelper.js';
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/fragment-masking-partial/spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';
import { test } from '@playwright/test';
import { routes } from '../../lib/utils/routes.js';
import { expect_to_be, goto_expect_n_gql } from '../../lib/utils/testsHelper.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test.describe('backwards cursor paginatedQuery', () => {
// wait for the api response
const response = await expect_1_gql(page, 'button[id=refetch]');
expect(response).toBe(
'{"data":{"usersConnection":{"edges":[{"node":{"name":"Will Smith","id":"pagination-query-backwards-cursor:5","__typename":"User"},"cursor":"YXJyYXljb25uZWN0aW9uOjQ="},{"node":{"name":"Harrison Ford","id":"pagination-query-backwards-cursor:6","__typename":"User"},"cursor":"YXJyYXljb25uZWN0aW9uOjU="},{"node":{"name":"Eddie Murphy","id":"pagination-query-backwards-cursor:7","__typename":"User"},"cursor":"YXJyYXljb25uZWN0aW9uOjY="},{"node":{"name":"Clint Eastwood","id":"pagination-query-backwards-cursor:8","__typename":"User"},"cursor":"YXJyYXljb25uZWN0aW9uOjc="}],"pageInfo":{"endCursor":"YXJyYXljb25uZWN0aW9uOjc=","hasNextPage":false,"hasPreviousPage":true,"startCursor":"YXJyYXljb25uZWN0aW9uOjQ="}}}}'
'{"data":{"usersConnection":{"edges":[{"cursor":"YXJyYXljb25uZWN0aW9uOjQ=","node":{"__typename":"User","id":"pagination-query-backwards-cursor:5","name":"Will Smith"}},{"cursor":"YXJyYXljb25uZWN0aW9uOjU=","node":{"__typename":"User","id":"pagination-query-backwards-cursor:6","name":"Harrison Ford"}},{"cursor":"YXJyYXljb25uZWN0aW9uOjY=","node":{"__typename":"User","id":"pagination-query-backwards-cursor:7","name":"Eddie Murphy"}},{"cursor":"YXJyYXljb25uZWN0aW9uOjc=","node":{"__typename":"User","id":"pagination-query-backwards-cursor:8","name":"Clint Eastwood"}}],"pageInfo":{"endCursor":"YXJyYXljb25uZWN0aW9uOjc=","hasNextPage":false,"hasPreviousPage":true,"startCursor":"YXJyYXljb25uZWN0aW9uOjQ="}}}}'
);
});

Expand Down
16 changes: 8 additions & 8 deletions e2e/kit/src/routes/pagination/query/forward-cursor/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ test.describe('forwards cursor paginatedQuery', () => {
// wait for the api response
let response = await expect_1_gql(page, 'button[id=next]');
expect(response).not.toContain(
'"name":"Bruce Willis","id":"pagination-query-forwards-cursor:1"'
'"id":"pagination-query-forwards-cursor:1","name":"Bruce Willis"'
);
expect(response).not.toContain(
'"name":"Samuel Jackson","id":"pagination-query-forwards-cursor:2"'
'"id":"pagination-query-forwards-cursor:2","name":"Samuel Jackson"'
);
expect(response).toContain('"name":"Morgan Freeman","id":"pagination-query-forwards-cursor:3"');
expect(response).toContain('"name":"Tom Hanks","id":"pagination-query-forwards-cursor:4"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:3","name":"Morgan Freeman"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:4","name":"Tom Hanks"');

// wait for the api response
response = await expect_1_gql(page, 'button[id=refetch]');

expect(response).toContain('"name":"Bruce Willis","id":"pagination-query-forwards-cursor:1"');
expect(response).toContain('"name":"Samuel Jackson","id":"pagination-query-forwards-cursor:2"');
expect(response).toContain('"name":"Morgan Freeman","id":"pagination-query-forwards-cursor:3"');
expect(response).toContain('"name":"Tom Hanks","id":"pagination-query-forwards-cursor:4"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:1","name":"Bruce Willis"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:2","name":"Samuel Jackson"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:3","name":"Morgan Freeman"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:4","name":"Tom Hanks"');
});

test('page info tracks connection state', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('offset paginatedQuery', () => {
// wait for the api response
const response = await expect_1_gql(page, 'button[id=refetch]');
expect(response).toBe(
'{"data":{"usersList":[{"name":"Bruce Willis","id":"pagination-query-offset-variables:1"},{"name":"Samuel Jackson","id":"pagination-query-offset-variables:2"},{"name":"Morgan Freeman","id":"pagination-query-offset-variables:3"},{"name":"Tom Hanks","id":"pagination-query-offset-variables:4"}]}}'
'{"data":{"usersList":[{"id":"pagination-query-offset-variables:1","name":"Bruce Willis"},{"id":"pagination-query-offset-variables:2","name":"Samuel Jackson"},{"id":"pagination-query-offset-variables:3","name":"Morgan Freeman"},{"id":"pagination-query-offset-variables:4","name":"Tom Hanks"}]}}'
);
});
});
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/pagination/query/offset/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test.describe('offset paginatedQuery', () => {
// wait for the api response
const response = await expect_1_gql(page, 'button[id=refetch]');
expect(response).toBe(
'{"data":{"usersList":[{"name":"Bruce Willis","id":"pagination-query-offset:1"},{"name":"Samuel Jackson","id":"pagination-query-offset:2"},{"name":"Morgan Freeman","id":"pagination-query-offset:3"},{"name":"Tom Hanks","id":"pagination-query-offset:4"}]}}'
'{"data":{"usersList":[{"id":"pagination-query-offset:1","name":"Bruce Willis"},{"id":"pagination-query-offset:2","name":"Samuel Jackson"},{"id":"pagination-query-offset:3","name":"Morgan Freeman"},{"id":"pagination-query-offset:4","name":"Tom Hanks"}]}}'
);
});
});
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/action-mutation/spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';
import { test } from '@playwright/test';
import { routes } from '../../../lib/utils/routes.js';
import { expect_to_be, goto } from '../../../lib/utils/testsHelper.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { test } from '@playwright/test';
import { routes } from '../../../lib/utils/routes.js';
import { expect_to_be, goto } from '../../../lib/utils/testsHelper.js';
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';

test("Components without load shouldn't subscribe to the cache", async ({ page }) => {
await goto(page, routes.Stores_Component_no_load_no_setup);
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/mutation-opti-list/spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';
import { test } from '@playwright/test';
import { routes } from '../../../lib/utils/routes.js';
import { expect_to_be, goto, locator_click } from '../../../lib/utils/testsHelper.js';
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/mutation-update/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { GQL_UpdateUser } from '$houdini';
import { stry } from '@kitql/helper';
import { stry } from '@kitql/helpers';
import type { PageData } from './$types';
export let data: PageData;
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/mutation/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { graphql, GQL_UpdateUser } from '$houdini';
import { stry } from '@kitql/helper';
import { stry } from '@kitql/helpers';
$: query = graphql(`
query OptimisticUserQuery @load {
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/mutation/spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep, stry } from '@kitql/helper';
import { sleep, stry } from '@kitql/helpers';
import { expect, test } from '@playwright/test';
import { routes } from '../../../lib/utils/routes.js';
import { expect_to_be, goto, locator_click } from '../../../lib/utils/testsHelper.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ test.describe('forwards cursor paginatedQuery', () => {
// wait for the api response
let response = await expect_1_gql(page, 'button[id=next]');
expect(response).not.toContain(
'"name":"Bruce Willis","id":"pagination-query-forwards-cursor:1"'
'"id":"pagination-query-forwards-cursor:1","name":"Bruce Willis"'
);
expect(response).not.toContain(
'"name":"Samuel Jackson","id":"pagination-query-forwards-cursor:2"'
'"id":"pagination-query-forwards-cursor:2","name":"Samuel Jackson"'
);
expect(response).toContain('"name":"Morgan Freeman","id":"pagination-query-forwards-cursor:3"');
expect(response).toContain('"name":"Tom Hanks","id":"pagination-query-forwards-cursor:4"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:3","name":"Morgan Freeman"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:4","name":"Tom Hanks"');

// wait for the api response
response = await expect_1_gql(page, 'button[id=refetch]');

expect(response).toContain('"name":"Bruce Willis","id":"pagination-query-forwards-cursor:1"');
expect(response).toContain('"name":"Samuel Jackson","id":"pagination-query-forwards-cursor:2"');
expect(response).toContain('"name":"Morgan Freeman","id":"pagination-query-forwards-cursor:3"');
expect(response).toContain('"name":"Tom Hanks","id":"pagination-query-forwards-cursor:4"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:1","name":"Bruce Willis"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:2","name":"Samuel Jackson"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:3","name":"Morgan Freeman"');
expect(response).toContain('"id":"pagination-query-forwards-cursor:4","name":"Tom Hanks"');
});

test('page info tracks connection state', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/partial/partial/spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
goto,
locator_click
} from '../../../../lib/utils/testsHelper.js';
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';
import { test } from '@playwright/test';

test.describe('Partial Pages', () => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/prefetch-[userId]/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { stry } from '@kitql/helper';
import { stry } from '@kitql/helpers';
import type { PageData } from './$types';
export let data: PageData;
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/stores/ssr-[userId]/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { CachePolicy } from '$houdini';
import { page } from '$app/stores';
import { stry } from '@kitql/helper';
import { stry } from '@kitql/helpers';
import type { PageData } from './$houdini';
export let data: PageData;
Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/subscriptions/[snapshot]/spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from '@playwright/test';
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';
import { routes } from '../../../lib/utils/routes.js';
import { expect_to_be, goto } from '../../../lib/utils/testsHelper.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/kit/src/routes/subscriptions/two/spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { test } from '@playwright/test';
import { sleep } from '@kitql/helper';
import { sleep } from '@kitql/helpers';
import { routes } from '../../../lib/utils/routes.js';
import { expect_to_be, goto } from '../../../lib/utils/testsHelper.js';

Expand Down
2 changes: 1 addition & 1 deletion e2e/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@kitql/helper": "^0.5.0",
"@kitql/helpers": "^0.8.2",
"@playwright/test": "1.30.0",
"@sveltejs/vite-plugin-svelte": "^2.0.2",
"@tsconfig/svelte": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion e2e/svelte/src/spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { sleep } from '@kitql/helper'
import { sleep } from '@kitql/helpers'
import { expect, test } from '@playwright/test'

test('1 query on the home page', async ({ page }) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/houdini-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"vitest": "^0.28.3"
},
"dependencies": {
"@kitql/helper": "^0.5.0",
"@kitql/helpers": "^0.8.2",
"@sveltejs/kit": "^1.9.3",
"ast-types": "^0.16.1",
"estree-walker": "^3.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/houdini-svelte/src/plugin/extractLoadFunction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logYellow } from '@kitql/helper'
import { yellow } from '@kitql/helpers'
import type { ExpressionKind } from 'ast-types/lib/gen/kinds'
import * as graphql from 'graphql'
import type { Config } from 'houdini'
Expand Down Expand Up @@ -176,8 +176,8 @@ async function processScript(
load.push(result)
if (!result) {
throw new Error(
`Could not find ${logYellow(element.name)} ` +
`for computing ${logYellow(houdini_load_fn)}. ` +
`Could not find ${yellow(element.name)} ` +
`for computing ${yellow(houdini_load_fn)}. ` +
`(if it was a global store, you need to instantiate the store manually.)` +
`\nfilepath: ${filepath}`
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ test('missing variables', async function () {
"❌ Encountered error in src/lib/component.svelte"
],
[
"Could not find required variable function: \\u001b[33m_TestQueryVariables\\u001b[37m\\u001b[0m. maybe its not exported? "
"Could not find required variable function: \\u001b[33m_TestQueryVariables\\u001b[39m. maybe its not exported? "
]
]
`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logYellow } from '@kitql/helper'
import { yellow } from '@kitql/helpers'
import type { ExpressionKind } from 'ast-types/lib/gen/kinds'
import type * as graphql from 'graphql'
import type { Config, Script } from 'houdini'
Expand Down Expand Up @@ -114,7 +114,7 @@ export default async function QueryProcessor(config: Config, page: SvelteTransfo
) {
formatErrors({
filepath: page.filepath,
message: `Could not find required variable function: ${logYellow(
message: `Could not find required variable function: ${yellow(
variable_fn
)}. maybe its not exported? `,
})
Expand Down
4 changes: 2 additions & 2 deletions packages/houdini-svelte/src/plugin/transforms/kit/load.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logYellow } from '@kitql/helper'
import { yellow } from '@kitql/helpers'
import type { IdentifierKind, StatementKind } from 'ast-types/lib/gen/kinds'
import type { namedTypes } from 'ast-types/lib/gen/namedTypes'
import * as graphql from 'graphql'
Expand Down Expand Up @@ -550,7 +550,7 @@ function variable_function_for_query(
if (missing_args.length > 0 && !has_local) {
throw {
filepath: page.filepath,
message: `Could not find required variable function: ${logYellow(
message: `Could not find required variable function: ${yellow(
query_variable_fn(query.name!.value)
)}. maybe its not exported?`,
}
Expand Down
4 changes: 2 additions & 2 deletions packages/houdini/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@babel/parser": "^7.20.5",
"@clack/prompts": "^0.6.3",
"@graphql-tools/schema": "^9.0.4",
"@kitql/helper": "^0.5.0",
"@kitql/helpers": "^0.8.2",
"@types/estree": "^1.0.0",
"@types/fs-extra": "^9.0.13",
"@types/micromatch": "^4.0.2",
Expand All @@ -57,7 +57,7 @@
"node-fetch": "^3.2.10",
"npx-import": "^1.1.3",
"recast": "^0.23.1",
"vite-plugin-watch-and-run": "^1.1.0"
"vite-plugin-watch-and-run": "^1.3.2"
},
"files": [
"build"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logCyan, logGreen } from '@kitql/helper'
import { cyan, green } from '@kitql/helpers'
import type { ExpressionKind, StatementKind, TSTypeKind } from 'ast-types/lib/gen/kinds'
import type * as graphql from 'graphql'
import * as recast from 'recast'
Expand Down Expand Up @@ -183,12 +183,12 @@ type in your config file:
{
scalars: {
${logCyan(`/* in your case, something like */`)}
${cyan(`/* in your case, something like */`)}
${[...missingScalars]
.map(
(c) =>
` ${c}: { ${logGreen(`// <- The GraphQL Scalar`)}
type: "${logCyan(`YourType_${c}`)}" ${logGreen(`// <- The TypeScript type`)}
` ${c}: { ${green(`// <- The GraphQL Scalar`)}
type: "${cyan(`YourType_${c}`)}" ${green(`// <- The TypeScript type`)}
}`
)
.join(
Expand Down
Loading

0 comments on commit 11b1226

Please sign in to comment.