Removed test-site

graph-rework
noah metz 2023-06-18 19:38:03 -06:00
parent a1a1d5133c
commit 001614189f
11 changed files with 0 additions and 5696 deletions

@ -1,38 +0,0 @@
# create-svelte
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

File diff suppressed because it is too large Load Diff

@ -1,39 +0,0 @@
{
"name": "test-site",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --plugin-search-dir . --check . && eslint .",
"format": "prettier --plugin-search-dir . --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/kit": "^1.5.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte": "^2.26.0",
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.3.0"
},
"type": "module",
"dependencies": {
"@apollo/client": "^3.7.15",
"graphql": "^16.6.0",
"graphql-ws": "^5.13.1",
"svelte-apollo": "^0.5.0",
"urql": "^4.0.4",
"ws": "^8.13.0"
}
}

@ -1,12 +0,0 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
}
export {};

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

@ -1,101 +0,0 @@
<script lang="ts">
import Button from "./Button.svelte"
import { createClient } from 'graphql-ws';
import { WebSocket } from 'ws';
const client = createClient({
url: "ws://localhost:8080/gqlws",
webSocketImpl: WebSocket,
keepAlive: 10_000,
});
var game_id = null
var arena_id = null
console.log("STARTING_CLIENT")
client.subscribe({
query: "query { Arenas { Name ID Owner { Name, ID } }}"
},
{
next: (data) => {
let obj = JSON.parse(data.data)
arena_id = obj.Arenas[0].ID
game_id = obj.Arenas[0].Owner.ID
client.subscribe({
query: "subscription($arena_id:String) { Arena(arena_id:$arena_id) { Owner { ID Name ... on Match { State Control StateStart StateDuration } } }}",
variables: {
arena_id: arena_id
},
},
{
next: (data) => {
console.log("ARENA_SUB")
let obj = JSON.parse(data.data)
if(obj.Arena.Owner != null) {
game_id = obj.Arena.Owner.ID
}
},
error: (err) => {
console.log("ARENA_SUB")
console.log(err)
},
complete: () => {
},
});
},
error: (err) => {
console.log(err)
},
complete: () => {
},
});
client.subscribe({
query: "subscription { Updates { String } }"
},
{
next: (data) => {
console.log(data)
},
error: (err) => {
console.log(err)
},
complete: () => {
},
});
async function match_state(match_id, state) {
let url = "http://localhost:8080/gql"
let data = {
operationName: "MatchState",
query: "mutation MatchState($match_id:String, $match_state:String) { setMatchState(id:$match_id, state:$match_state) { String } }",
variables: {
match_id: match_id,
match_state: state,
}
}
const response = await fetch(url, {
method: "POST",
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
"Content-Type": "applicaton/json",
},
redirect: "follow",
referrerPolicy: "no-referrer",
body: JSON.stringify(data),
});
console.log(response.json())
}
</script>
<Button on:click={()=>match_state(game_id, "queue_autonomous")}>Queue Autonomous</Button>
<Button on:click={()=>match_state(game_id, "start_autonomous")}>Start Autonomous</Button>
<Button on:click={()=>match_state(game_id, "queue_driver")}>Queue Driver</Button>
<Button on:click={()=>match_state(game_id, "start_driver")}>Start Driver</Button>

@ -1,28 +0,0 @@
<script>
let buttonProps = {
class:[$$restProps.class]
}
</script>
<button on:click
on:mouseover
on:mouseenter
on:mouseleave
{...buttonProps}>
<slot/>
</button>
<style>
.primary{
color:green;
}
.danger {
color:red;
}
.sm {
font-size:1em;
padding:0.1em;
}
.lg {
font-size:2em
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

@ -1,18 +0,0 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/kit/vite';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
}
};
export default config;

@ -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
}

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