summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-10 21:51:10 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-10 21:52:26 -0400
commit215b0c5cb2ff0ef0b2c7b5549704e23d651a4df9 (patch)
tree356484ce699539f2937b768d1a1c9b83f0c7a402
parent4401dce2b5545ce8117818812d8e3c8919f5f7fd (diff)
Hoist the UI one step up further
-rw-r--r--.gitignore1
-rw-r--r--.npmrc (renamed from ui/.npmrc)0
-rw-r--r--.prettierignore (renamed from ui/.prettierignore)0
-rw-r--r--.prettierrc (renamed from ui/.prettierrc)0
-rw-r--r--eslint.config.js (renamed from ui/eslint.config.js)0
-rw-r--r--package-lock.json (renamed from ui/package-lock.json)4
-rw-r--r--package.json (renamed from ui/package.json)6
-rw-r--r--postcss.config.js (renamed from ui/postcss.config.js)0
-rw-r--r--src/ui.rs2
-rw-r--r--svelte.config.js30
-rw-r--r--tailwind.config.js (renamed from ui/tailwind.config.js)6
-rwxr-xr-xtools/build-ui2
-rw-r--r--ui/.gitignore21
-rw-r--r--ui/README.md26
-rw-r--r--ui/app.css (renamed from ui/src/app.css)0
-rw-r--r--ui/app.html (renamed from ui/src/app.html)0
-rw-r--r--ui/lib/apiServer.js (renamed from ui/src/lib/apiServer.js)0
-rw-r--r--ui/lib/components/ActiveChannel.svelte (renamed from ui/src/lib/components/ActiveChannel.svelte)0
-rw-r--r--ui/lib/components/Channel.svelte (renamed from ui/src/lib/components/Channel.svelte)0
-rw-r--r--ui/lib/components/ChannelList.svelte (renamed from ui/src/lib/components/ChannelList.svelte)0
-rw-r--r--ui/lib/components/CreateChannelForm.svelte (renamed from ui/src/lib/components/CreateChannelForm.svelte)0
-rw-r--r--ui/lib/components/LogIn.svelte (renamed from ui/src/lib/components/LogIn.svelte)0
-rw-r--r--ui/lib/components/LogOut.svelte (renamed from ui/src/lib/components/LogOut.svelte)0
-rw-r--r--ui/lib/components/Message.svelte (renamed from ui/src/lib/components/Message.svelte)0
-rw-r--r--ui/lib/components/MessageInput.svelte (renamed from ui/src/lib/components/MessageInput.svelte)0
-rw-r--r--ui/lib/index.js (renamed from ui/src/lib/index.js)0
-rw-r--r--ui/lib/store.js (renamed from ui/src/lib/store.js)0
-rw-r--r--ui/lib/store/channels.js (renamed from ui/src/lib/store/channels.js)0
-rw-r--r--ui/lib/store/logins.js (renamed from ui/src/lib/store/logins.js)0
-rw-r--r--ui/lib/store/messages.js (renamed from ui/src/lib/store/messages.js)0
-rw-r--r--ui/routes/(app)/+layout.svelte (renamed from ui/src/routes/(app)/+layout.svelte)0
-rw-r--r--ui/routes/(app)/+page.svelte (renamed from ui/src/routes/(app)/+page.svelte)0
-rw-r--r--ui/routes/(app)/ch/[channel]/+page.svelte (renamed from ui/src/routes/(app)/ch/[channel]/+page.svelte)0
-rw-r--r--ui/routes/+layout.js (renamed from ui/src/routes/+layout.js)0
-rw-r--r--ui/routes/+layout.svelte (renamed from ui/src/routes/+layout.svelte)0
-rw-r--r--ui/svelte.config.js17
-rw-r--r--vite.config.js (renamed from ui/vite.config.js)5
37 files changed, 46 insertions, 74 deletions
diff --git a/.gitignore b/.gitignore
index d63432f..e598495 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
+/node_modules
/target
/.hi
diff --git a/ui/.npmrc b/.npmrc
index b6f27f1..b6f27f1 100644
--- a/ui/.npmrc
+++ b/.npmrc
diff --git a/ui/.prettierignore b/.prettierignore
index ab78a95..ab78a95 100644
--- a/ui/.prettierignore
+++ b/.prettierignore
diff --git a/ui/.prettierrc b/.prettierrc
index 9573023..9573023 100644
--- a/ui/.prettierrc
+++ b/.prettierrc
diff --git a/ui/eslint.config.js b/eslint.config.js
index 2eeebcc..2eeebcc 100644
--- a/ui/eslint.config.js
+++ b/eslint.config.js
diff --git a/ui/package-lock.json b/package-lock.json
index b9e8f14..723553f 100644
--- a/ui/package-lock.json
+++ b/package-lock.json
@@ -1,11 +1,11 @@
{
- "name": "hi-ui",
+ "name": "hi",
"version": "0.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
- "name": "hi-ui",
+ "name": "hi",
"version": "0.0.1",
"dependencies": {
"axios": "^1.7.7",
diff --git a/ui/package.json b/package.json
index 04b94bc..ac8a0d0 100644
--- a/ui/package.json
+++ b/package.json
@@ -1,13 +1,13 @@
{
- "name": "hi-ui",
+ "name": "hi",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
- "lint": "prettier --check . && eslint .",
- "format": "prettier --write ."
+ "lint": "prettier --check ui && eslint ui",
+ "format": "prettier --write ui"
},
"devDependencies": {
"@skeletonlabs/skeleton": "^2.10.2",
diff --git a/ui/postcss.config.js b/postcss.config.js
index 2e7af2b..2e7af2b 100644
--- a/ui/postcss.config.js
+++ b/postcss.config.js
diff --git a/src/ui.rs b/src/ui.rs
index b5290a6..b296325 100644
--- a/src/ui.rs
+++ b/src/ui.rs
@@ -11,7 +11,7 @@ use rust_embed::EmbeddedFile;
use crate::{app::App, channel, error::Internal, login::Login};
#[derive(rust_embed::Embed)]
-#[folder = "ui/build"]
+#[folder = "target/ui"]
struct Assets;
pub fn router() -> Router<App> {
diff --git a/svelte.config.js b/svelte.config.js
new file mode 100644
index 0000000..5e64863
--- /dev/null
+++ b/svelte.config.js
@@ -0,0 +1,30 @@
+import adapter from '@sveltejs/adapter-static';
+import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
+
+/** @type {import('@sveltejs/kit').Config} */
+const config = {
+ kit: {
+ adapter: adapter({
+ pages: 'target/ui',
+ fallback: 'index.html',
+ }),
+ files: {
+ hooks: {
+ universal: 'ui/hooks',
+ server: 'ui/hooks.server',
+ client: 'ui/hooks.client',
+ },
+ assets: 'ui/static',
+ lib: 'ui/lib',
+ params: 'ui/params',
+ routes: 'ui/routes',
+ serviceWorker: 'ui/service-worker',
+ appTemplate: 'ui/app.html',
+ errorTemplate: 'ui/error.html',
+ },
+ outDir: 'target/svelte-kit',
+ },
+ preprocess: vitePreprocess(),
+};
+
+export default config;
diff --git a/ui/tailwind.config.js b/tailwind.config.js
index ca516e2..d6511b8 100644
--- a/ui/tailwind.config.js
+++ b/tailwind.config.js
@@ -7,9 +7,9 @@ import forms from '@tailwindcss/forms';
export default {
darkMode: 'class',
content: [
- './src/**/*.{html,js,svelte,ts}',
- join(require.resolve(
- '@skeletonlabs/skeleton'),
+ 'ui/**/*.{html,js,svelte,ts}',
+ join(
+ require.resolve('@skeletonlabs/skeleton'),
'../**/*.{html,js,svelte,ts}'
)
],
diff --git a/tools/build-ui b/tools/build-ui
index 46171ca..ba8d016 100755
--- a/tools/build-ui
+++ b/tools/build-ui
@@ -4,7 +4,7 @@
##
## Builds the Svelte UI.
-cd "$(dirname "$0")/../ui"
+cd "$(dirname "$0")/.."
npm install
npm run build
diff --git a/ui/.gitignore b/ui/.gitignore
deleted file mode 100644
index 79518f7..0000000
--- a/ui/.gitignore
+++ /dev/null
@@ -1,21 +0,0 @@
-node_modules
-
-# Output
-.output
-.vercel
-/.svelte-kit
-/build
-
-# OS
-.DS_Store
-Thumbs.db
-
-# Env
-.env
-.env.*
-!.env.example
-!.env.test
-
-# Vite
-vite.config.js.timestamp-*
-vite.config.ts.timestamp-*
diff --git a/ui/README.md b/ui/README.md
deleted file mode 100644
index 3f05f42..0000000
--- a/ui/README.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# create-svelte
-
-Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
-
-## 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.
diff --git a/ui/src/app.css b/ui/app.css
index b5c61c9..b5c61c9 100644
--- a/ui/src/app.css
+++ b/ui/app.css
diff --git a/ui/src/app.html b/ui/app.html
index 63eb917..63eb917 100644
--- a/ui/src/app.html
+++ b/ui/app.html
diff --git a/ui/src/lib/apiServer.js b/ui/lib/apiServer.js
index f6d6148..f6d6148 100644
--- a/ui/src/lib/apiServer.js
+++ b/ui/lib/apiServer.js
diff --git a/ui/src/lib/components/ActiveChannel.svelte b/ui/lib/components/ActiveChannel.svelte
index 978e952..978e952 100644
--- a/ui/src/lib/components/ActiveChannel.svelte
+++ b/ui/lib/components/ActiveChannel.svelte
diff --git a/ui/src/lib/components/Channel.svelte b/ui/lib/components/Channel.svelte
index 97fea1f..97fea1f 100644
--- a/ui/src/lib/components/Channel.svelte
+++ b/ui/lib/components/Channel.svelte
diff --git a/ui/src/lib/components/ChannelList.svelte b/ui/lib/components/ChannelList.svelte
index e0e5f06..e0e5f06 100644
--- a/ui/src/lib/components/ChannelList.svelte
+++ b/ui/lib/components/ChannelList.svelte
diff --git a/ui/src/lib/components/CreateChannelForm.svelte b/ui/lib/components/CreateChannelForm.svelte
index ddcf486..ddcf486 100644
--- a/ui/src/lib/components/CreateChannelForm.svelte
+++ b/ui/lib/components/CreateChannelForm.svelte
diff --git a/ui/src/lib/components/LogIn.svelte b/ui/lib/components/LogIn.svelte
index 2836e6d..2836e6d 100644
--- a/ui/src/lib/components/LogIn.svelte
+++ b/ui/lib/components/LogIn.svelte
diff --git a/ui/src/lib/components/LogOut.svelte b/ui/lib/components/LogOut.svelte
index 01bef1b..01bef1b 100644
--- a/ui/src/lib/components/LogOut.svelte
+++ b/ui/lib/components/LogOut.svelte
diff --git a/ui/src/lib/components/Message.svelte b/ui/lib/components/Message.svelte
index d040433..d040433 100644
--- a/ui/src/lib/components/Message.svelte
+++ b/ui/lib/components/Message.svelte
diff --git a/ui/src/lib/components/MessageInput.svelte b/ui/lib/components/MessageInput.svelte
index b33574b..b33574b 100644
--- a/ui/src/lib/components/MessageInput.svelte
+++ b/ui/lib/components/MessageInput.svelte
diff --git a/ui/src/lib/index.js b/ui/lib/index.js
index 856f2b6..856f2b6 100644
--- a/ui/src/lib/index.js
+++ b/ui/lib/index.js
diff --git a/ui/src/lib/store.js b/ui/lib/store.js
index b964b4b..b964b4b 100644
--- a/ui/src/lib/store.js
+++ b/ui/lib/store.js
diff --git a/ui/src/lib/store/channels.js b/ui/lib/store/channels.js
index bb6c86c..bb6c86c 100644
--- a/ui/src/lib/store/channels.js
+++ b/ui/lib/store/channels.js
diff --git a/ui/src/lib/store/logins.js b/ui/lib/store/logins.js
index 5b45206..5b45206 100644
--- a/ui/src/lib/store/logins.js
+++ b/ui/lib/store/logins.js
diff --git a/ui/src/lib/store/messages.js b/ui/lib/store/messages.js
index 931b8fb..931b8fb 100644
--- a/ui/src/lib/store/messages.js
+++ b/ui/lib/store/messages.js
diff --git a/ui/src/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte
index f8744c1..f8744c1 100644
--- a/ui/src/routes/(app)/+layout.svelte
+++ b/ui/routes/(app)/+layout.svelte
diff --git a/ui/src/routes/(app)/+page.svelte b/ui/routes/(app)/+page.svelte
index e69de29..e69de29 100644
--- a/ui/src/routes/(app)/+page.svelte
+++ b/ui/routes/(app)/+page.svelte
diff --git a/ui/src/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte
index ef439d0..ef439d0 100644
--- a/ui/src/routes/(app)/ch/[channel]/+page.svelte
+++ b/ui/routes/(app)/ch/[channel]/+page.svelte
diff --git a/ui/src/routes/+layout.js b/ui/routes/+layout.js
index a3d1578..a3d1578 100644
--- a/ui/src/routes/+layout.js
+++ b/ui/routes/+layout.js
diff --git a/ui/src/routes/+layout.svelte b/ui/routes/+layout.svelte
index 7b99d62..7b99d62 100644
--- a/ui/src/routes/+layout.svelte
+++ b/ui/routes/+layout.svelte
diff --git a/ui/svelte.config.js b/ui/svelte.config.js
deleted file mode 100644
index 07e332f..0000000
--- a/ui/svelte.config.js
+++ /dev/null
@@ -1,17 +0,0 @@
-import adapter from '@sveltejs/adapter-static';
-import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
-
-/** @type {import('@sveltejs/kit').Config} */
-const config = {
- 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({
- fallback: 'index.html',
- }),
- },
- preprocess: vitePreprocess()
-};
-
-export default config;
diff --git a/ui/vite.config.js b/vite.config.js
index 05a5a6f..3229f33 100644
--- a/ui/vite.config.js
+++ b/vite.config.js
@@ -4,6 +4,11 @@ import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()],
server: {
+ fs: {
+ allow: [
+ 'ui'
+ ]
+ },
proxy: {
'/api': 'http://localhost:64209',
},