diff --git a/.prettierignore b/.prettierignore index 7d74fe2..39e16e7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -7,3 +7,9 @@ bun.lockb # Miscellaneous /static/ + +# Cloudflare +worker-configuration.d.ts + +# SpacetimeDB generated bindings +src/lib/st-bindings/* diff --git a/.prettierrc b/.prettierrc index 6255599..8929e91 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,12 +1,9 @@ { "useTabs": true, - "singleQuote": true, - "trailingComma": "none", + "singleQuote": false, + "trailingComma": "all", "printWidth": 100, - "plugins": [ - "prettier-plugin-svelte", - "prettier-plugin-tailwindcss" - ], + "plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"], "tailwindStylesheet": "./src/routes/layout.css", "overrides": [ { diff --git a/.vscode/extensions.json b/.vscode/extensions.json index cdab7df..11efe25 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,3 @@ { - "recommendations": [ - "svelte.svelte-vscode", - "bradlc.vscode-tailwindcss", - "esbenp.prettier-vscode" - ] + "recommendations": ["svelte.svelte-vscode", "bradlc.vscode-tailwindcss", "esbenp.prettier-vscode"] } diff --git a/package.json b/package.json index 3561d01..29d936f 100644 --- a/package.json +++ b/package.json @@ -37,4 +37,4 @@ "vite-plugin-devtools-json": "^1.0.0", "wrangler": "^4.81.1" } -} \ No newline at end of file +} diff --git a/spacetime.json b/spacetime.json index 14681d9..552f131 100644 --- a/spacetime.json +++ b/spacetime.json @@ -1,4 +1,4 @@ { - "module-path": "./spacetimedb", - "server": "maincloud" -} \ No newline at end of file + "module-path": "./spacetimedb", + "server": "maincloud" +} diff --git a/spacetime.local.json b/spacetime.local.json index 4518195..b5a5d60 100644 --- a/spacetime.local.json +++ b/spacetime.local.json @@ -1,3 +1,3 @@ { - "database": "space-stream-b8trs" -} \ No newline at end of file + "database": "space-stream-b8trs" +} diff --git a/spacetimedb/package.json b/spacetimedb/package.json index c677ade..d2213dd 100644 --- a/spacetimedb/package.json +++ b/spacetimedb/package.json @@ -1,18 +1,18 @@ { - "name": "space-stream", - "version": "1.0.0", - "description": "", - "scripts": { - "build": "spacetime build", - "publish": "spacetime publish" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "spacetimedb": "^2.1.0" - }, - "devDependencies": { - "typescript": "~5.6.2" - } -} \ No newline at end of file + "name": "space-stream", + "version": "1.0.0", + "description": "", + "scripts": { + "build": "spacetime build", + "publish": "spacetime publish" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "spacetimedb": "^2.1.0" + }, + "devDependencies": { + "typescript": "~5.6.2" + } +} diff --git a/spacetimedb/src/index.ts b/spacetimedb/src/index.ts index ac6004b..f3238d4 100644 --- a/spacetimedb/src/index.ts +++ b/spacetimedb/src/index.ts @@ -1,37 +1,34 @@ -import { schema, table, t } from 'spacetimedb/server'; +import { schema, table, t } from "spacetimedb/server"; const spacetimedb = schema({ - person: table( - { public: true }, - { - name: t.string(), - } - ), + person: table( + { public: true }, + { + name: t.string(), + }, + ), }); export default spacetimedb; -export const init = spacetimedb.init(_ctx => { - // Called when the module is initially published +export const init = spacetimedb.init((_ctx) => { + // Called when the module is initially published }); -export const onConnect = spacetimedb.clientConnected(_ctx => { - // Called every time a new client connects +export const onConnect = spacetimedb.clientConnected((_ctx) => { + // Called every time a new client connects }); -export const onDisconnect = spacetimedb.clientDisconnected(_ctx => { - // Called every time a client disconnects +export const onDisconnect = spacetimedb.clientDisconnected((_ctx) => { + // Called every time a client disconnects }); -export const add = spacetimedb.reducer( - { name: t.string() }, - (ctx, { name }) => { - ctx.db.person.insert({ name }); - } -); - -export const sayHello = spacetimedb.reducer(ctx => { - for (const person of ctx.db.person.iter()) { - console.info(`Hello, ${person.name}!`); - } - console.info('Hello, World!'); +export const add = spacetimedb.reducer({ name: t.string() }, (ctx, { name }) => { + ctx.db.person.insert({ name }); +}); + +export const sayHello = spacetimedb.reducer((ctx) => { + for (const person of ctx.db.person.iter()) { + console.info(`Hello, ${person.name}!`); + } + console.info("Hello, World!"); }); diff --git a/spacetimedb/tsconfig.json b/spacetimedb/tsconfig.json index b6f79b9..524168f 100644 --- a/spacetimedb/tsconfig.json +++ b/spacetimedb/tsconfig.json @@ -4,20 +4,20 @@ * some options are required by SpacetimeDB. */ { - "compilerOptions": { - "strict": true, - "skipLibCheck": true, - "moduleResolution": "bundler", - "jsx": "react-jsx", + "compilerOptions": { + "strict": true, + "skipLibCheck": true, + "moduleResolution": "bundler", + "jsx": "react-jsx", - /* The following options are required by SpacetimeDB - * and should not be modified - */ - "target": "ESNext", - "lib": ["ES2021", "dom"], - "module": "ESNext", - "isolatedModules": true, - "noEmit": true - }, - "include": ["./**/*"] + /* The following options are required by SpacetimeDB + * and should not be modified + */ + "target": "ESNext", + "lib": ["ES2021", "dom"], + "module": "ESNext", + "isolatedModules": true, + "noEmit": true + }, + "include": ["./**/*"] } diff --git a/src/app.d.ts b/src/app.d.ts index 1d8cb5b..3329955 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -2,12 +2,12 @@ // for information about these interfaces declare global { namespace App { - interface Platform { - env: Env; - cf: CfProperties; - ctx: ExecutionContext; - } - } + interface Platform { + env: Env; + cf: CfProperties; + ctx: ExecutionContext; + } + } } -export {}; \ No newline at end of file +export {}; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index ebf364a..cf60de3 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,31 +1,31 @@ @@ -27,7 +27,7 @@