diff --git a/fxmanifest.lua b/fxmanifest.lua
index 030f5dc..793ffb5 100644
--- a/fxmanifest.lua
+++ b/fxmanifest.lua
@@ -15,10 +15,10 @@ client_script 'ui.lua'
server_script 'dist/build.js'
files {
- 'ui/public/index.html',
- 'ui/public/**/*'
+ 'ui/build/index.html',
+ 'ui/build/**/*'
}
-ui_page 'src/ui/public/index.html'
+ui_page 'ui/build/index.html'
provide 'mysql-async'
diff --git a/package.json b/package.json
index c7dfb41..002c6ef 100644
--- a/package.json
+++ b/package.json
@@ -30,4 +30,4 @@
"postinstall-postinstall": "^2.1.0",
"typescript": "^4.5.4"
}
-}
+}
\ No newline at end of file
diff --git a/ui/.gitignore b/ui/.gitignore
index da93220..4d29575 100644
--- a/ui/.gitignore
+++ b/ui/.gitignore
@@ -1,4 +1,23 @@
-/node_modules/
-/public/build/
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+
+# testing
+/coverage
+
+# production
+/build
+
+# misc
.DS_Store
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
diff --git a/ui/README.md b/ui/README.md
new file mode 100644
index 0000000..b58e0af
--- /dev/null
+++ b/ui/README.md
@@ -0,0 +1,46 @@
+# Getting Started with Create React App
+
+This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+
+## Available Scripts
+
+In the project directory, you can run:
+
+### `yarn start`
+
+Runs the app in the development mode.\
+Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
+
+The page will reload if you make edits.\
+You will also see any lint errors in the console.
+
+### `yarn test`
+
+Launches the test runner in the interactive watch mode.\
+See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
+
+### `yarn build`
+
+Builds the app for production to the `build` folder.\
+It correctly bundles React in production mode and optimizes the build for the best performance.
+
+The build is minified and the filenames include the hashes.\
+Your app is ready to be deployed!
+
+See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
+
+### `yarn eject`
+
+**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
+
+If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
+
+Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
+
+You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
+
+## Learn More
+
+You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
+
+To learn React, check out the [React documentation](https://reactjs.org/).
diff --git a/ui/craco.config.js b/ui/craco.config.js
new file mode 100644
index 0000000..76682be
--- /dev/null
+++ b/ui/craco.config.js
@@ -0,0 +1,24 @@
+const path = require("path");
+module.exports = {
+ webpack: {
+ configure: (webpackConfig) => {
+ // Because CEF has issues with loading source maps properly atm,
+ // lets use the best we can get in line with `eval-source-map`
+ if (webpackConfig.mode === 'development' && process.env.IN_GAME_DEV) {
+ webpackConfig.devtool = 'eval-source-map'
+ webpackConfig.output.path = path.join(__dirname, 'build')
+ }
+
+ return webpackConfig
+ }
+ },
+
+ devServer: (devServerConfig) => {
+ if (process.env.IN_GAME_DEV) {
+ // Used for in-game dev mode
+ devServerConfig.writeToDisk = true
+ }
+
+ return devServerConfig
+ }
+}
\ No newline at end of file
diff --git a/ui/package.json b/ui/package.json
index e22d758..0337fc3 100644
--- a/ui/package.json
+++ b/ui/package.json
@@ -1,30 +1,53 @@
{
- "name": "svelte-app",
- "version": "1.0.0",
+ "name": "web",
+ "version": "0.1.0",
+ "homepage": "web/build",
"private": true,
+ "dependencies": {
+ "@chakra-ui/react": "^1.7.3",
+ "@emotion/react": "11",
+ "@emotion/styled": "11",
+ "@testing-library/jest-dom": "^5.15.0",
+ "@testing-library/react": "^12.1.2",
+ "@testing-library/user-event": "^12.1.10",
+ "@types/jest": "^26.0.15",
+ "@types/node": "^16.11.9",
+ "@types/react": "^17.0.35",
+ "@types/react-dom": "^17.0.11",
+ "framer-motion": "4",
+ "react": "^17.0.2",
+ "react-dom": "^17.0.2",
+ "react-scripts": "4.0.3",
+ "typescript": "^4.5.2",
+ "web-vitals": "^2.1.2"
+ },
"scripts": {
- "build": "rollup -c",
- "dev": "rollup -c -w",
- "start": "sirv public --no-clear"
+ "start": "cross-env PUBLIC_URL=/ craco start",
+ "start:game": "cross-env IN_GAME_DEV=1 craco start",
+ "build": "craco build",
+ "test": "craco test",
+ "eject": "react-scripts eject"
+ },
+ "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"
+ ]
},
"devDependencies": {
- "@rollup/plugin-commonjs": "^17.0.0",
- "@rollup/plugin-node-resolve": "^11.0.0",
- "@rollup/plugin-typescript": "^8.0.0",
- "@tsconfig/svelte": "^2.0.0",
- "rollup": "^2.3.4",
- "rollup-plugin-css-only": "^3.1.0",
- "rollup-plugin-livereload": "^2.0.0",
- "rollup-plugin-svelte": "^7.0.0",
- "rollup-plugin-terser": "^7.0.0",
- "svelte": "^3.0.0",
- "svelte-check": "^2.0.0",
- "svelte-preprocess": "^4.0.0",
- "tslib": "^2.0.0",
- "typescript": "^4.0.0"
- },
- "dependencies": {
- "sirv-cli": "^1.0.0",
- "svelte-spa-router": "^3.2.0"
+ "craco": "^0.0.3",
+ "cross-env": "^7.0.3"
}
}
diff --git a/ui/public/global.css b/ui/public/global.css
deleted file mode 100644
index a94d91a..0000000
--- a/ui/public/global.css
+++ /dev/null
@@ -1,11 +0,0 @@
-@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');
-
-* {
- margin: 0;
- padding: 0;
- text-decoration: none;
-}
-
-body {
- height: 100vh;
-}
diff --git a/ui/public/index.html b/ui/public/index.html
index bd206a3..7bc4a2d 100644
--- a/ui/public/index.html
+++ b/ui/public/index.html
@@ -2,15 +2,22 @@
-
-
- Svelte app
-
-
-
-
-
+
+
+ NUI React Boilerplate
+
+
+
+
+
diff --git a/ui/rollup.config.js b/ui/rollup.config.js
deleted file mode 100644
index c584614..0000000
--- a/ui/rollup.config.js
+++ /dev/null
@@ -1,87 +0,0 @@
-import svelte from "rollup-plugin-svelte";
-import commonjs from "@rollup/plugin-commonjs";
-import resolve from "@rollup/plugin-node-resolve";
-import livereload from "rollup-plugin-livereload";
-import { terser } from "rollup-plugin-terser";
-import sveltePreprocess from "svelte-preprocess";
-import typescript from "@rollup/plugin-typescript";
-import css from "rollup-plugin-css-only";
-
-const production = !process.env.ROLLUP_WATCH;
-
-function serve() {
- let server;
-
- function toExit() {
- if (server) server.kill(0);
- }
-
- return {
- writeBundle() {
- if (server) return;
- server = require("child_process").spawn(
- "npm",
- ["run", "start", "--", "--dev"],
- {
- stdio: ["ignore", "inherit", "inherit"],
- shell: true,
- }
- );
-
- process.on("SIGTERM", toExit);
- process.on("exit", toExit);
- },
- };
-}
-
-export default {
- input: "src/main.ts",
- output: {
- sourcemap: false,
- format: "iife",
- name: "app",
- file: "public/build/bundle.js",
- },
- plugins: [
- svelte({
- preprocess: sveltePreprocess({ sourceMap: !production }),
- compilerOptions: {
- // enable run-time checks when not in production
- dev: !production,
- },
- }),
- // we'll extract any component CSS out into
- // a separate file - better for performance
- css({ output: "bundle.css" }),
-
- // If you have external dependencies installed from
- // npm, you'll most likely need these plugins. In
- // some cases you'll need additional configuration -
- // consult the documentation for details:
- // https://github.com/rollup/plugins/tree/master/packages/commonjs
- resolve({
- browser: true,
- dedupe: ["svelte"],
- }),
- commonjs(),
- typescript({
- sourceMap: !production,
- inlineSources: !production,
- }),
-
- // In dev mode, call `npm run start` once
- // the bundle has been generated
- !production && serve(),
-
- // Watch the `public` directory and refresh the
- // browser on changes when not in production
- !production && livereload("public"),
-
- // If we're building for production (npm run build
- // instead of npm run dev), minify
- production && terser(),
- ],
- watch: {
- clearScreen: false,
- },
-};
diff --git a/ui/src/App.svelte b/ui/src/App.svelte
deleted file mode 100644
index b8be177..0000000
--- a/ui/src/App.svelte
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
-
-
-
diff --git a/ui/src/components/App.css b/ui/src/components/App.css
new file mode 100644
index 0000000..e69de29
diff --git a/ui/src/components/App.tsx b/ui/src/components/App.tsx
new file mode 100644
index 0000000..0556a36
--- /dev/null
+++ b/ui/src/components/App.tsx
@@ -0,0 +1,25 @@
+import './App.css';
+import { Center, Box } from '@chakra-ui/react';
+import { debugData } from '../utils/debugData';
+import TopBar from './NavBars/TopBar';
+import SideBar from './NavBars/SideBar';
+
+debugData([
+ {
+ action: 'setVisible',
+ data: true,
+ },
+]);
+
+const App: React.FC = () => {
+ return (
+