diff --git a/.gitignore b/.gitignore index a650c75..31d68b3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,136 +1,5 @@ -_/ +/_/ -# Unmodified -# Created by https://www.toptal.com/developers/gitignore/api/firebase,node -# Edit at https://www.toptal.com/developers/gitignore?templates=firebase,node - -### Firebase ### -.idea -**/node_modules/* -**/.firebaserc - -### Firebase Patch ### -.runtimeconfig.json .firebase/ - -### Node ### -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test -.env.production - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -# End of https://www.toptal.com/developers/gitignore/api/firebase,node +.firebaserc +ui-debug.log diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..38f928a --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["svelte.svelte-vscode", "esbenp.prettier-vscode"] +} diff --git a/README.md b/README.md index 7512b79..2a9b521 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ # llama-bot-web-interface -![License: MIT](https://img.shields.io/github/license/llama-bot/llama-bot-web-api?style=flat-square) -[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) - -[Documentation](https://llama-bot.github.io/llama-bot-docs/docs/web-interface/overview) +## [Documentation](https://llama-bot.github.io/llama-bot-docs/docs/web-interface/overview) diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs new file mode 100644 index 0000000..3ed0474 --- /dev/null +++ b/frontend/.eslintrc.cjs @@ -0,0 +1,24 @@ +module.exports = { + root: true, + parser: "@typescript-eslint/parser", + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "prettier", + ], + plugins: ["svelte3", "@typescript-eslint"], + ignorePatterns: ["*.cjs"], + overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }], + settings: { + "svelte3/typescript": () => require("typescript"), + }, + parserOptions: { + sourceType: "module", + ecmaVersion: 2020, + }, + env: { + browser: true, + es2017: true, + node: true, + }, +} diff --git a/frontend/.gitignore b/frontend/.gitignore index 75aa819..8c52166 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -1,26 +1,15 @@ -# dependencies -/node_modules -/.pnp -.pnp.js +/build/ +/.svelte-kit/ +/package/ +/node_modules/ -# testing -/coverage - -# production -/build - -# misc .DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local -.vscode -.idea +.env +.env.* +!.env.example +.vercel +.output npm-debug.log* yarn-debug.log* yarn-error.log* - -# Optional eslint cache -.eslintcache diff --git a/frontend/capacitor.config.ts b/frontend/capacitor.config.ts deleted file mode 100644 index 00ceb2b..0000000 --- a/frontend/capacitor.config.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { CapacitorConfig } from "@capacitor/cli" - -const config: CapacitorConfig = { - appId: "io.ionic.starter", - appName: "llama-bot-web-interface", - webDir: "build", - bundledWebRuntime: false, -} - -export default config diff --git a/frontend/ionic.config.json b/frontend/ionic.config.json deleted file mode 100644 index e535ef1..0000000 --- a/frontend/ionic.config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "llama-bot-web-interface", - "integrations": { - "capacitor": {} - }, - "type": "react" -} diff --git a/frontend/package.json b/frontend/package.json index b8210f4..43a243e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,71 +1,38 @@ { - "name": "llama-bot-web-interface", - "version": "1.0.0", - "private": true, + "type": "module", "scripts": { - "start": "react-scripts start", - "serve": "npm run build && firebase serve", - "build": "react-scripts build", - "test": "react-scripts test", - "analyze": "source-map-explorer 'build/static/js/*.js'" + "dev": "svelte-kit dev", + "build": "svelte-kit build", + "preview": "svelte-kit preview", + "check": "svelte-check --tsconfig ./tsconfig.json", + "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch", + "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .", + "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ." }, "dependencies": { - "@fortawesome/fontawesome-svg-core": "^1.2.36", - "@fortawesome/free-brands-svg-icons": "^5.15.4", - "@fortawesome/free-solid-svg-icons": "^5.15.4", - "@fortawesome/react-fontawesome": "^0.1.15", - "evergreen-ui": "^6.5.1", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "react-router": "^5.2.1", - "react-router-dom": "^5.3.0", - "react-spinners": "^0.11.0", - "styled-components": "^5.3.1", - "web-vitals": "^2.1.2", - "workbox-background-sync": "^6.3.0", - "workbox-broadcast-update": "^6.3.0", - "workbox-cacheable-response": "^6.3.0", - "workbox-core": "^6.3.0", - "workbox-expiration": "^6.3.0", - "workbox-google-analytics": "^6.3.0", - "workbox-navigation-preload": "^6.3.0", - "workbox-precaching": "^6.3.0", - "workbox-range-requests": "^6.3.0", - "workbox-routing": "^6.3.0", - "workbox-strategies": "^6.3.0", - "workbox-streams": "^6.3.0" + "@fontsource/noto-sans": "^4.5.4", + "@lukeed/uuid": "^2.0.0", + "cookie": "^0.4.2" }, "devDependencies": { - "@testing-library/jest-dom": "^5.14.1", - "@testing-library/react": "^12.1.2", - "@testing-library/user-event": "^13.3.0", - "@types/jest": "^27.0.2", - "@types/node": "^16.10.4", - "@types/react": "^17.0.29", - "@types/react-dom": "^17.0.9", - "@types/react-router": "^5.1.17", - "@types/react-router-dom": "^5.3.1", - "@types/styled-components": "^5.1.15", - "react-scripts": "^4.0.3", - "source-map-explorer": "^2.5.2", - "typescript": "^4.4.4" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] + "@sveltejs/adapter-auto": "^1.0.0-next.17", + "@sveltejs/adapter-static": "^1.0.0-next.28", + "@sveltejs/kit": "^1.0.0-next.278", + "@types/cookie": "^0.4.1", + "@typescript-eslint/eslint-plugin": "^5.12.0", + "@typescript-eslint/parser": "^5.12.0", + "eslint": "^8.9.0", + "eslint-config-prettier": "^8.4.0", + "eslint-plugin-svelte3": "^3.4.0", + "prettier": "^2.5.1", + "prettier-plugin-svelte": "^2.6.0", + "sass": "^1.49.8", + "svelte": "^3.46.4", + "svelte-check": "^2.4.5", + "svelte-icons": "^2.1.0", + "svelte-loading-spinners": "^0.1.7", + "svelte-preprocess": "^4.10.3", + "tslib": "^2.3.1", + "typescript": "^4.5.5" } } diff --git a/frontend/public/index.html b/frontend/public/index.html deleted file mode 100644 index 8d256d0..0000000 --- a/frontend/public/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Llama Bot - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - diff --git a/frontend/public/manifest.json b/frontend/public/manifest.json deleted file mode 100644 index 5808705..0000000 --- a/frontend/public/manifest.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "short_name": "Ionic App", - "name": "My Ionic App", - "icons": [ - { - "src": "assets/icon/favicon.png", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "assets/icon/icon.png", - "type": "image/png", - "sizes": "512x512", - "purpose": "maskable" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#ffffff", - "background_color": "#ffffff" -} diff --git a/frontend/resources/icon.png b/frontend/resources/icon.png deleted file mode 100644 index 4faee53..0000000 Binary files a/frontend/resources/icon.png and /dev/null differ diff --git a/frontend/resources/splash.png b/frontend/resources/splash.png deleted file mode 100644 index 2d66293..0000000 Binary files a/frontend/resources/splash.png and /dev/null differ diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx deleted file mode 100644 index a0be969..0000000 --- a/frontend/src/App.test.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import { render } from "@testing-library/react" -import App from "./App" - -test("renders without crashing", () => { - const { baseElement } = render() - expect(baseElement).toBeDefined() -}) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx deleted file mode 100644 index f30d355..0000000 --- a/frontend/src/App.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { lazy, Suspense } from "react" -import { ThemeProvider } from "evergreen-ui" -import { BrowserRouter as Router, Route } from "react-router-dom" -import styled, { createGlobalStyle, css } from "styled-components" - -import Loader from "react-spinners/CircleLoader" -import Navbar from "./components/Navbar" -import Footer from "./components/Footer" - -import darkTheme from "./theme/dark" - -const Home = lazy(() => import("./pages/Home")) -const Servers = lazy(() => import("./pages/Servers")) -// const Dashboard = lazy(() => import("./pages/Dashboard")) - -// wrapping it using css because prettier extension does not work well with styled-components -// https://github.com/styled-components/vscode-styled-components/issues/175 -const _globalStyle = css` - html, - body, - #root { - font-family: "Noto Sans KR", sans-serif; - - height: 100vh; - margin: 0; - - display: flex; - flex-direction: column; - } -` - -const GlobalStyle = createGlobalStyle` - ${_globalStyle} -` - -const StyledSpinContainer = styled.div` - width: 100%; - opacity: 0; - - /* center elements */ - display: flex; - align-content: center; - justify-content: center; - - /* fade in */ - animation-delay: 0.2s; - animation-duration: 2s; - animation-name: fadein; - - @keyframes fadein { - from { - opacity: 0; - } - to { - opacity: 1; - } - } -` - -const App: React.FC = () => { - return ( - <> - - - - - - } - > - - - - - - - - - - - {/* - - */} - -