Skip to content

Commit

Permalink
chore: updates sveltekit, atelier & vite
Browse files Browse the repository at this point in the history
  • Loading branch information
feugy committed Dec 18, 2022
1 parent ad79e64 commit e9f2254
Show file tree
Hide file tree
Showing 14 changed files with 858 additions and 572 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Expand Up @@ -5,4 +5,5 @@ dist/
dist-atelier/
node_modules/
scans/
.vercel/
!.storybook/
4 changes: 3 additions & 1 deletion .prettierignore
@@ -1,6 +1,8 @@
coverage/
dist/
dist-atelier/
node_modules/
scans/
.husky/
.svelte-kit
.svelte-kit
.vercel/
2 changes: 2 additions & 0 deletions TODO.md
Expand Up @@ -74,6 +74,8 @@ AssertionError: expected 2nd "spy" call to have been called with [ 'anima' ]

## Refactor

- vitest@0.25.8: issue when loading peer deps, resolve in [next release](https://github.com/vitest-dev/vitest/pull/2463)
- @urql/core@3.1.1: receiveGameListUpdates subscribtion fails because urql's stringification sends the whole games.graphql file instead of the subscription as a payload. This is because [these lines](https://github.com/urql-graphql/urql/pull/2871/files#diff-425e8fcb48a8df1865f99ca1fb981873c6d0ef33ee3856e18f85a8b449bb81b7R41-R42)
- add tests for web/src/utils/peer-connection
- use node 18 when msw/interceptor will [handle it](https://github.com/mswjs/interceptors/pull/283)
- ts-check all the things!
Expand Down
6 changes: 3 additions & 3 deletions apps/cli/package.json
Expand Up @@ -13,19 +13,19 @@
},
"dependencies": {
"@tabulous/cli": "workspace:^0.0.1",
"@urql/core": "^3.0.5",
"@urql/core": "^3.1.1",
"add": "^2.0.6",
"ajv": "^8.11.2",
"arg": "^5.0.2",
"chalk": "^5.1.2",
"chalk": "^5.2.0",
"chalk-template": "^0.4.0",
"dotenv": "^16.0.3",
"es-main": "^1.2.0",
"fast-jwt": "^2.0.2",
"graphql": "^16.6.0",
"lodash.camelcase": "^4.3.0",
"lodash.kebabcase": "^4.1.1",
"undici": "^5.13.0"
"undici": "^5.14.0"
},
"devDependencies": {
"strip-ansi": "^7.0.1"
Expand Down
2 changes: 1 addition & 1 deletion apps/games/package.json
Expand Up @@ -4,6 +4,6 @@
"description": "Tabulous game descriptors and assets",
"type": "module",
"dependencies": {
"@tabulous/server": "workspace:0.0.1"
"@tabulous/server": "workspace:*"
}
}
6 changes: 3 additions & 3 deletions apps/server/package.json
Expand Up @@ -12,7 +12,7 @@
},
"dependencies": {
"@fastify/cors": "^8.2.0",
"@fastify/static": "^6.5.1",
"@fastify/static": "^6.6.0",
"@fastify/websocket": "^7.1.1",
"@isaacs/ttlcache": "^1.2.1",
"ajv": "^8.11.2",
Expand All @@ -25,8 +25,8 @@
"mercurius": "^11.4.0",
"mqemitter-redis": "^5.0.0",
"pino-pretty": "^9.1.1",
"rxjs": "^7.6.0",
"undici": "^5.13.0"
"rxjs": "^7.8.0",
"undici": "^5.14.0"
},
"devDependencies": {
"nodemon": "^2.0.20",
Expand Down
4 changes: 2 additions & 2 deletions apps/server/tests/services/auth/github.test.js
Expand Up @@ -88,7 +88,7 @@ describe('Github authentication service', () => {
return { access_token: token }
})
githubApiMock.intercept({ path: '/user' }).reply(200, req => {
userInvoked(req.headers.authorization)
userInvoked(req.headers.Authorization)
return user
})
const state = githubAuth.storeFinalLocation(location)
Expand Down Expand Up @@ -151,7 +151,7 @@ describe('Github authentication service', () => {
return { access_token: token }
})
githubApiMock.intercept({ path: '/user' }).reply(500, req => {
userInvoked(req.headers.authorization)
userInvoked(req.headers.Authorization)
return 'server error'
})
const state = githubAuth.storeFinalLocation(location)
Expand Down
42 changes: 21 additions & 21 deletions apps/web/package.json
Expand Up @@ -16,30 +16,30 @@
"test:integration:run": "playwright test"
},
"devDependencies": {
"@atelier-wb/svelte": "^0.9.0",
"@atelier-wb/toolshot": "^0.9.0",
"@atelier-wb/vite-plugin-atelier": "^0.9.0",
"@babylonjs/core": "^5.35.1",
"@babylonjs/inspector": "^5.35.1",
"@babylonjs/loaders": "^5.35.1",
"@atelier-wb/svelte": "^0.10.1",
"@atelier-wb/toolshot": "^0.10.1",
"@atelier-wb/vite-plugin-atelier": "^0.10.1",
"@babylonjs/core": "^5.38.0",
"@babylonjs/inspector": "^5.38.0",
"@babylonjs/loaders": "^5.38.0",
"@fastify/cors": "^8.2.0",
"@fastify/static": "^6.5.1",
"@fastify/static": "^6.6.0",
"@fastify/websocket": "^7.1.1",
"@playwright/test": "^1.28.1",
"@playwright/test": "^1.29.0",
"@rollup/plugin-graphql": "^2.0.2",
"@rollup/plugin-yaml": "^4.0.1",
"@sveltejs/adapter-vercel": "^1.0.0-next.84",
"@sveltejs/kit": "^1.0.0-next.571",
"@sveltejs/vite-plugin-svelte": "^1.4.0",
"@sveltejs/adapter-vercel": "^1.0.0",
"@sveltejs/kit": "^1.0.1",
"@sveltejs/vite-plugin-svelte": "^2.0.2",
"@testing-library/dom": "^8.19.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "^3.2.2",
"@testing-library/user-event": "^14.4.3",
"@urql/core": "^3.0.5",
"@vitejs/plugin-basic-ssl": "^0.1.2",
"@urql/core": "3.1.0",
"@vitejs/plugin-basic-ssl": "^1.0.1",
"autoprefixer": "^10.4.13",
"babylonjs-gltf2interface": "^5.37.0",
"chalk": "^5.1.2",
"babylonjs-gltf2interface": "^5.38.0",
"chalk": "^5.2.0",
"chalk-template": "^0.4.0",
"cookie": "^0.5.0",
"dotenv": "^16.0.3",
Expand All @@ -57,21 +57,21 @@
"jsdom": "^20.0.3",
"material-design-icons-iconfont": "^6.7.0",
"ms": "^3.0.0-canary.1",
"msw": "^0.49.1",
"postcss": "^8.4.19",
"msw": "^0.49.2",
"postcss": "^8.4.20",
"postcss-import": "^15.0.1",
"postcss-nested": "^6.0.0",
"rfdc": "^1.3.0",
"rollup-plugin-svelte-svg": "^1.0.0-beta.6",
"rxjs": "^7.6.0",
"svelte": "^3.53.1",
"rxjs": "^7.8.0",
"svelte": "^3.55.0",
"svelte-htm": "^1.2.0",
"svelte-intl": "^1.1.4",
"svelte-markdown": "^0.2.3",
"svelte-portal": "^2.2.0",
"v8-to-istanbul": "^9.0.1",
"vite": "^3.2.4",
"vite-plugin-windicss": "^1.8.8",
"vite": "^4.0.1",
"vite-plugin-windicss": "^1.8.10",
"webrtc-adapter": "^8.2.0",
"whatwg-fetch": "^3.6.2",
"wonka": "^6.1.2"
Expand Down
4 changes: 3 additions & 1 deletion apps/web/src/app.html
Expand Up @@ -8,6 +8,8 @@
%sveltekit.head%
</head>

<body>%sveltekit.body%</body>
<body>
%sveltekit.body%
</body>

</html>
Expand Up @@ -2,7 +2,7 @@
import { Dropdown } from '@src/components'
import { gameAssetsUrl } from '@src/utils'
import { _, locale } from 'svelte-intl'
import { findViolations } from './utils'
export let name
Expand All @@ -21,7 +21,7 @@
// when defauling to first option, mutates values
$: if (!value && options.length) {
handleSelection({ detail: options[0] })
setTimeout(() => handleSelection({ detail: options[0] }), 0)
}
function handleSelection({ detail }) {
Expand Down
72 changes: 72 additions & 0 deletions apps/web/tests/components/__snapshots__/Button.tools.shot
@@ -1,5 +1,59 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Empty 1`] = `undefined`;

exports[`Multiple entries 1`] = `
<ol
class="s-x5nEMCoiqeIy"
>
<li
class="s-x5nEMCoiqeIy"
>
<a
class="s-x5nEMCoiqeIy"
href="/"
>
home
</a>
</li>

<li
class="s-x5nEMCoiqeIy"
>
&gt;
</li>

<li
class="s-x5nEMCoiqeIy"
>
<a
class="s-x5nEMCoiqeIy"
href="/account"
>
account
</a>
</li>

<li
class="s-x5nEMCoiqeIy"
>
&gt;
</li>

<li
class="s-x5nEMCoiqeIy"
>
<a
class="s-x5nEMCoiqeIy"
>
details
</a>
</li>


</ol>
`;

exports[`Primary image icon only 1`] = `
<button
class="s-NMyTiX1zi6rz"
Expand Down Expand Up @@ -159,6 +213,24 @@ exports[`Secondary with text and icon 1`] = `
</button>
`;

exports[`Single entry 1`] = `
<ol
class="s-x5nEMCoiqeIy"
>
<li
class="s-x5nEMCoiqeIy"
>
<a
class="s-x5nEMCoiqeIy"
>
home
</a>
</li>


</ol>
`;

exports[`Transparent with text 1`] = `
<button
class="transparent s-NMyTiX1zi6rz"
Expand Down
@@ -1,6 +1,6 @@
import Parameters from '@src/routes/(auth)/game/[gameId]/Parameters/Container.svelte'
import { fireEvent, render, screen } from '@testing-library/svelte'
import { extractText, translate } from '@tests/test-utils'
import { extractText, sleep, translate } from '@tests/test-utils'
import html from 'svelte-htm'
import { beforeEach, describe, expect, it, vi } from 'vitest'

Expand All @@ -9,13 +9,16 @@ describe('Parameters component', () => {

beforeEach(vi.resetAllMocks)

function renderComponent(schema) {
async function renderComponent(schema) {
function onSubmit({ detail }) {
handleSubmit(detail)
}
return render(
const result = render(
html`<${Parameters} schema=${schema} on:submit=${onSubmit} />`
)

await sleep()
return result
}

it('displays dropdown for enums', async () => {
Expand All @@ -38,7 +41,8 @@ describe('Parameters component', () => {
}
}
}
renderComponent(schema)
await renderComponent(schema)

expect(
screen.getByText(colorLabel + translate('labels.colon'), { trim: false })
).toBeInTheDocument()
Expand Down Expand Up @@ -84,7 +88,8 @@ describe('Parameters component', () => {
}
}
}
renderComponent(schema)
await renderComponent(schema)

expect(
screen.getByText(colorLabel + translate('labels.colon'), { trim: false })
).toBeInTheDocument()
Expand Down Expand Up @@ -155,7 +160,7 @@ describe('Parameters component', () => {
}
}
}
renderComponent(schema)
await renderComponent(schema)

const [playerDropdown, opponent1Dropdown, opponent2Dropdown] =
screen.getAllByRole('combobox')
Expand Down Expand Up @@ -233,7 +238,7 @@ describe('Parameters component', () => {
}
}
}
renderComponent(schema)
await renderComponent(schema)

let dropdowns = screen.getAllByRole('combobox')
expect(dropdowns).toHaveLength(2)
Expand All @@ -242,6 +247,7 @@ describe('Parameters component', () => {

await fireEvent.click(dropdowns[0])
await fireEvent.click(screen.getAllByRole('menuitem')[1])
await sleep()

dropdowns = screen.getAllByRole('combobox')
expect(dropdowns).toHaveLength(3)
Expand Down Expand Up @@ -293,7 +299,7 @@ describe('Parameters component', () => {
}
}
}
renderComponent(schema)
await renderComponent(schema)

let [countDropdown] = screen.getAllByRole('combobox')
await fireEvent.click(countDropdown)
Expand Down

0 comments on commit e9f2254

Please sign in to comment.