From d69166e2e4fdfd083b1052619e90094927b178d1 Mon Sep 17 00:00:00 2001 From: Adam Pluth Date: Mon, 27 Feb 2023 11:02:00 -0700 Subject: [PATCH 01/13] cleaned up code and refactored main app scaffolding into separate components --- WebGLViewer/{src => app}/helpers/regex.js | 0 WebGLViewer/app/hooks.ts | 6 - WebGLViewer/app/hooks/hooks.ts | 6 - WebGLViewer/app/hooks/reduxTypescriptHooks.ts | 10 + WebGLViewer/app/hooks/use-thunk.ts | 21 - WebGLViewer/app/store/index.ts | 7 +- WebGLViewer/app/store/slices/webGLSlice.js | 14 - WebGLViewer/app/store/thunks/fetchWebGL.ts | 8 - WebGLViewer/src/App.tsx | 33 +- WebGLViewer/src/components/coreapp/Header.tsx | 103 +-- .../src/components/coreapp/PageCard.tsx | 9 +- .../src/components/coreapp/SideBarLeft.tsx | 595 ++++++++++-------- .../src/components/coreapp/SideBarRight.tsx | 63 +- .../src/components/display/MetadataPanels.tsx | 23 +- .../src/components/display/UnityInstance.tsx | 4 +- WebGLViewer/src/components/display/WebGL.tsx | 10 +- WebGLViewer/src/index.css | 73 --- WebGLViewer/src/layouts/LayoutDashboard.tsx | 14 +- WebGLViewer/src/layouts/LayoutSettings.tsx | 2 + WebGLViewer/src/layouts/MainScaffold.tsx | 71 +++ WebGLViewer/src/main.tsx | 10 +- WebGLViewer/src/styles/App.scss | 6 +- 22 files changed, 543 insertions(+), 545 deletions(-) rename WebGLViewer/{src => app}/helpers/regex.js (100%) delete mode 100644 WebGLViewer/app/hooks.ts delete mode 100644 WebGLViewer/app/hooks/hooks.ts create mode 100644 WebGLViewer/app/hooks/reduxTypescriptHooks.ts delete mode 100644 WebGLViewer/app/hooks/use-thunk.ts delete mode 100644 WebGLViewer/app/store/thunks/fetchWebGL.ts delete mode 100644 WebGLViewer/src/index.css create mode 100644 WebGLViewer/src/layouts/MainScaffold.tsx diff --git a/WebGLViewer/src/helpers/regex.js b/WebGLViewer/app/helpers/regex.js similarity index 100% rename from WebGLViewer/src/helpers/regex.js rename to WebGLViewer/app/helpers/regex.js diff --git a/WebGLViewer/app/hooks.ts b/WebGLViewer/app/hooks.ts deleted file mode 100644 index e48f9bfff..000000000 --- a/WebGLViewer/app/hooks.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; -import type { RootState, AppDispatch } from './store'; - -// Use throughout your app instead of plain `useDispatch` and `useSelector` -export const useAppDispatch: () => AppDispatch = useDispatch; -export const useAppSelector: TypedUseSelectorHook = useSelector; \ No newline at end of file diff --git a/WebGLViewer/app/hooks/hooks.ts b/WebGLViewer/app/hooks/hooks.ts deleted file mode 100644 index 720ad97cd..000000000 --- a/WebGLViewer/app/hooks/hooks.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; -import type { RootState, AppDispatch } from '../store'; - -// Use throughout your app instead of plain `useDispatch` and `useSelector` -export const useAppDispatch: () => AppDispatch = useDispatch; -export const useAppSelector: TypedUseSelectorHook = useSelector; \ No newline at end of file diff --git a/WebGLViewer/app/hooks/reduxTypescriptHooks.ts b/WebGLViewer/app/hooks/reduxTypescriptHooks.ts new file mode 100644 index 000000000..56009806c --- /dev/null +++ b/WebGLViewer/app/hooks/reduxTypescriptHooks.ts @@ -0,0 +1,10 @@ +import { TypedUseSelectorHook, useDispatch, useSelector } from 'react-redux'; +import type { RootState, AppDispatch } from '../store'; + +// Use throughout your app instead of plain `useSelector` and `useDispatch` + +//Typed `useSelector` to work better with TypeScript +export const useAppSelector: TypedUseSelectorHook = useSelector; + +// Not typed, just created for sake of uniformity, since `useSelector` is typed. Regular `useDispatch` should still work fine. +export const useAppDispatch: () => AppDispatch = useDispatch; diff --git a/WebGLViewer/app/hooks/use-thunk.ts b/WebGLViewer/app/hooks/use-thunk.ts deleted file mode 100644 index a9ab6a4ed..000000000 --- a/WebGLViewer/app/hooks/use-thunk.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { useState, useCallback } from 'react'; -import { useDispatch } from 'react-redux'; - -export function useThunk(thunk: any) { - const [isLoading, setIsLoading] = useState(false); - const [error, setError] = useState(null); - const dispatch = useDispatch(); - - const runThunk = useCallback( - (arg: any) => { - setIsLoading(true); - dispatch(thunk(arg)) - .unwrap() - .catch((err: any) => setError(err)) - .finally(() => setIsLoading(false)); - }, - [dispatch, thunk] - ); - - return [runThunk, isLoading, error]; -} diff --git a/WebGLViewer/app/store/index.ts b/WebGLViewer/app/store/index.ts index a67147a67..673bb580c 100644 --- a/WebGLViewer/app/store/index.ts +++ b/WebGLViewer/app/store/index.ts @@ -3,7 +3,9 @@ import { webGLReducer } from './slices/webGLSlice'; const initialState = { openDrawerLeft: true, + openDrawerLeftWidth: 365, openDrawerRight: false, + openDrawerRightWidth: 425, selectedAssetObject: {}, selectAssetOnScene: '', highlightAssetOnScene: '', @@ -53,7 +55,4 @@ export const appStateActions = appStateSlice.actions; // Infer the `RootState` and `AppDispatch` types from the store itself export type RootState = ReturnType // Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState} -export type AppDispatch = typeof store.dispatch - - -export * from './thunks/fetchWebGL'; \ No newline at end of file +export type AppDispatch = typeof store.dispatch \ No newline at end of file diff --git a/WebGLViewer/app/store/slices/webGLSlice.js b/WebGLViewer/app/store/slices/webGLSlice.js index 7264b41d8..8867e5d6f 100644 --- a/WebGLViewer/app/store/slices/webGLSlice.js +++ b/WebGLViewer/app/store/slices/webGLSlice.js @@ -1,5 +1,4 @@ import { createSlice } from '@reduxjs/toolkit'; -import { fetchWebGL } from '../thunks/fetchWebGL'; const webGLSlice = createSlice({ name: 'webGL', @@ -8,19 +7,6 @@ const webGLSlice = createSlice({ data: [], error: null, }, - extraReducers(builder) { - builder.addCase(fetchWebGL.pending, (state, action) => { - state.isLoading = true; - }); - builder.addCase(fetchWebGL.fulfilled, (state, action) => { - state.isLoading = false; - state.data = action.payload; - }); - builder.addCase(fetchWebGL.rejected, (state, action) => { - state.isLoading = false; - state.error = action.error; - }); - }, }); export const webGLReducer = webGLSlice.reducer; diff --git a/WebGLViewer/app/store/thunks/fetchWebGL.ts b/WebGLViewer/app/store/thunks/fetchWebGL.ts deleted file mode 100644 index 4b7d9d450..000000000 --- a/WebGLViewer/app/store/thunks/fetchWebGL.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { createAsyncThunk } from '@reduxjs/toolkit'; -import axios from 'axios'; - -const fetchWebGL = createAsyncThunk('webgl/fetch', async () => { - -}); - -export { fetchWebGL }; diff --git a/WebGLViewer/src/App.tsx b/WebGLViewer/src/App.tsx index 7aec7a654..705538c76 100644 --- a/WebGLViewer/src/App.tsx +++ b/WebGLViewer/src/App.tsx @@ -1,20 +1,35 @@ +// React import * as React from 'react'; +import { Routes, Route } from 'react-router-dom'; + +// Hooks import { useEffect } from 'react'; -import { Box, CssBaseline } from '@mui/material'; -import { useTheme, ThemeProvider, createTheme } from '@mui/material/styles'; -import { useAppSelector, useAppDispatch } from '../app/hooks/hooks'; +import { useAppSelector, useAppDispatch } from '../app/hooks/reduxTypescriptHooks'; + +// MUI Styles +import { + useTheme, + ThemeProvider, + createTheme +} from '@mui/material/styles'; +// MUI Components +import { + Box, + CssBaseline, + PaletteMode +} from '@mui/material'; + +// Styles // @ts-ignore import COLORS from './styles/variables'; import './styles/App.scss'; -import { Routes, Route } from 'react-router-dom'; -import Header from './components/coreapp/Header'; +// Custom Components +import MainScaffold from './layouts/MainScaffold'; import Dashboard from './pages/Dashboard'; // import Settings from './pages/Settings'; -import { PaletteMode } from '@mui/material'; - const getDesignTokens = (mode: PaletteMode) => ({ palette: { mode, @@ -124,12 +139,12 @@ function App() { return (
-
+ } /> {/* } /> */} -
+
); diff --git a/WebGLViewer/src/components/coreapp/Header.tsx b/WebGLViewer/src/components/coreapp/Header.tsx index 569b65860..fd89dc59d 100644 --- a/WebGLViewer/src/components/coreapp/Header.tsx +++ b/WebGLViewer/src/components/coreapp/Header.tsx @@ -1,27 +1,35 @@ +// React import * as React from 'react'; -import { styled, useTheme } from '@mui/material/styles'; -import { useAppSelector, useAppDispatch } from '../../../app/hooks/hooks'; + +// Hooks +import { useAppSelector, useAppDispatch } from '../../../app/hooks/reduxTypescriptHooks'; + +// Import packages import classNames from 'classnames'; +// Import Redux actions import { appStateActions } from '../../../app/store/index'; -import Box from '@mui/material/Box'; -import Drawer from '@mui/material/Drawer'; -import CssBaseline from '@mui/material/CssBaseline'; +// MUI Styles +import { styled, useTheme } from '@mui/material/styles'; + +// MUI Components +import { + Box, + IconButton, + Paper, + Toolbar, + Typography +} from '@mui/material'; import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@mui/material/AppBar'; -import Toolbar from '@mui/material/Toolbar'; -import Typography from '@mui/material/Typography'; -import IconButton from '@mui/material/IconButton'; + +// MUI Icons import MenuIcon from '@mui/icons-material/Menu'; -import Paper from '@mui/material/Paper'; -import SideBarLeft from './SideBarLeft'; -import SideBarRight from './SideBarRight'; +// Styles // @ts-ignore import COLORS from '../../styles/variables'; -const drawerWidth = 365; - const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })<{ open?: boolean; }>(({ theme, open }) => ({ @@ -31,7 +39,7 @@ const Main = styled('main', { shouldForwardProp: (prop) => prop !== 'open' })<{ easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen, }), - marginLeft: `-${drawerWidth}px`, + marginLeft: `-${useAppSelector((state: any) => state.appState.openDrawerLeftWidth)}px`, ...(open && { transition: theme.transitions.create('margin', { easing: theme.transitions.easing.easeOut, @@ -48,14 +56,14 @@ interface AppBarProps extends MuiAppBarProps { const AppBar = styled(MuiAppBar, { shouldForwardProp: (prop) => prop !== 'open', })(({ theme, open }) => ({ - transition: theme.transitions.create(['margin', 'width'], { + transition: theme.transitions.create(['margin-left', 'width'], { easing: theme.transitions.easing.sharp, duration: theme.transitions.duration.leavingScreen, }), ...(open && { - width: `calc(100% - ${drawerWidth}px)`, - marginLeft: `${drawerWidth}px`, - transition: theme.transitions.create(['margin', 'width'], { + width: `calc(100% - ${useAppSelector((state: any) => state.appState.openDrawerLeftWidth)}px)`, + marginLeft: `${useAppSelector((state: any) => state.appState.openDrawerLeftWidth)}px`, + transition: theme.transitions.create(['margin-left', 'width'], { easing: theme.transitions.easing.easeOut, duration: theme.transitions.duration.enteringScreen, }), @@ -74,12 +82,14 @@ export default function Header(props: any) { dispatch(appStateActions.toggleDrawerLeft()); }; + type openDrawerLeftWidth = number; + const openDrawerLeftWidth: openDrawerLeftWidth = useAppSelector((state: any) => state.appState.openDrawerLeftWidth); + type openDrawerRightState = boolean; const openDrawerRightState: openDrawerRightState = useAppSelector((state: any) => state.appState.openDrawerRight); return ( - - + <> @@ -101,57 +111,6 @@ export default function Header(props: any) { - - - - - Deep Lynx Logo - - - - - -
- {children} - - - -
- + ); } diff --git a/WebGLViewer/src/components/coreapp/PageCard.tsx b/WebGLViewer/src/components/coreapp/PageCard.tsx index 929f8cd87..aabd2afcf 100644 --- a/WebGLViewer/src/components/coreapp/PageCard.tsx +++ b/WebGLViewer/src/components/coreapp/PageCard.tsx @@ -1,7 +1,14 @@ +// React import * as React from 'react'; -import { Card, CardContent, Typography } from '@mui/material'; +// MUI Components +import { + Card, + CardContent, + Typography +} from '@mui/material'; +// Styles import '../../styles/App.scss'; // @ts-ignore import COLORS from '../../styles/variables'; diff --git a/WebGLViewer/src/components/coreapp/SideBarLeft.tsx b/WebGLViewer/src/components/coreapp/SideBarLeft.tsx index 8d6cce5c9..32eed11b6 100644 --- a/WebGLViewer/src/components/coreapp/SideBarLeft.tsx +++ b/WebGLViewer/src/components/coreapp/SideBarLeft.tsx @@ -1,31 +1,41 @@ +// React import * as React from 'react'; + +// Hooks import { useState } from 'react'; -import { styled, useTheme } from '@mui/material/styles'; -import { useAppSelector, useAppDispatch } from '../../../app/hooks/hooks'; +import { useAppSelector, useAppDispatch } from '../../../app/hooks/reduxTypescriptHooks'; + +// Import Packages import classNames from 'classnames'; -// Import Redux actions +// Import Redux Actions import { appStateActions } from '../../../app/store/index'; -// Import MUI components +// MUI Styles +import { useTheme } from '@mui/material/styles'; + +// MUI Components import { Box, Button, + Drawer, FormControl, List, ListItem, ListItemText, ListItemButton, OutlinedInput, + Paper, Stack, + Toolbar, Tooltip, Typography } from '@mui/material'; -// Import Icons +// MUI Icons import InfoIcon from '@mui/icons-material/Info'; -// Import custom components +// Custom Components import MetadataPanels from '../display/MetadataPanels'; // Import styles @@ -33,7 +43,6 @@ import '../../styles/App.scss'; // @ts-ignore import COLORS from '../../styles/variables'; - const filterData = (query: any, data: any) => { if (!query) { return data; @@ -61,13 +70,19 @@ const SearchBar = ({setSearchQuery}: any) => ( ); -export default function PersistentDrawerLeft(props: any) { +export default function SideBarLeft(props: any) { const { children } = props; const theme = useTheme(); const dispatch = useAppDispatch(); + type openDrawerLeftState = boolean; + const openDrawerLeftState: openDrawerLeftState = useAppSelector((state: any) => state.appState.openDrawerLeft); + + type openDrawerLeftWidth = number; + const openDrawerLeftWidth: openDrawerLeftWidth = useAppSelector((state: any) => state.appState.openDrawerLeftWidth); + const [searchQuery, setSearchQuery] = useState(""); const [selected, setSelected] = React.useState(false); @@ -101,286 +116,310 @@ export default function PersistentDrawerLeft(props: any) { } return ( - - - - {/* - - Assets - - - - - - - - - Id - - - Title - - */} - - {/* - {dataFiltered.map((object: any, index: number) => ( - - - - - - - } - > - handleSelectAssetObject(object, `listItem${index+1}`)} - selected={selected === `listItem${index+1}`} - sx={{ - '&.Mui-selected': { - backgroundColor: `${COLORS.colorListSelectGray} !important` - }, - '&.Mui-focusVisible': { - backgroundColor: `${COLORS.colorListSelectGray} !important` - }, - '&:hover': { - backgroundColor: `${COLORS.colorListSelectGray} !important` - } - }} - > - - - - { object.id } - - - { object.title } - - - - - - ))} - */} - + + + + + Deep Lynx Logo + + - {Object.keys(selectedAssetObject).length !== 0 && + + + - + + {/* - Asset Information + Assets - - - { selectedAssetObject.id } - - - { selectedAssetObject.title } - + + + + + + + + Id - - - - - - - - - + + Title - - - + */} + + {/* + {dataFiltered.map((object: any, index: number) => ( + + + + + + + } + > + handleSelectAssetObject(object, `listItem${index+1}`)} + selected={selected === `listItem${index+1}`} + sx={{ + '&.Mui-selected': { + backgroundColor: `${COLORS.colorListSelectGray} !important` + }, + '&.Mui-focusVisible': { + backgroundColor: `${COLORS.colorListSelectGray} !important` + }, + '&:hover': { + backgroundColor: `${COLORS.colorListSelectGray} !important` + } + }} + > + + + + { object.id } + + + { object.title } + + + + + + ))} + */} - } - + {Object.keys(selectedAssetObject).length !== 0 && + + + + Asset Information + + + + { selectedAssetObject.id } + + + { selectedAssetObject.title } + + + + + + + + + + + + + + + + + + } + + ) } diff --git a/WebGLViewer/src/components/coreapp/SideBarRight.tsx b/WebGLViewer/src/components/coreapp/SideBarRight.tsx index 4a0757ca1..e62417994 100644 --- a/WebGLViewer/src/components/coreapp/SideBarRight.tsx +++ b/WebGLViewer/src/components/coreapp/SideBarRight.tsx @@ -1,41 +1,54 @@ +// React import * as React from 'react'; -import { styled, useTheme } from '@mui/material/styles'; -import Box from '@mui/material/Box'; -import Drawer from '@mui/material/Drawer'; -import CssBaseline from '@mui/material/CssBaseline'; -import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@mui/material/AppBar'; -import Toolbar from '@mui/material/Toolbar'; -import List from '@mui/material/List'; -import Typography from '@mui/material/Typography'; -import Divider from '@mui/material/Divider'; -import IconButton from '@mui/material/IconButton'; -import MenuIcon from '@mui/icons-material/Menu'; -import ListItem from '@mui/material/ListItem'; -import ListItemButton from '@mui/material/ListItemButton'; -import ListItemText from '@mui/material/ListItemText'; - -import MetadataPanels from '../display/MetadataPanels'; + +// Hooks +import { useAppSelector } from '../../../app/hooks/reduxTypescriptHooks'; + +// MUI Styles +import { useTheme } from '@mui/material/styles'; + +// MUI Components +import { + Drawer, + Typography +} from "@mui/material"; export default function SideBarRight(props: any) { const { children } = props; const theme = useTheme(); - const [open, setOpen] = React.useState(true); - const handleDrawerOpenState = () => { - setOpen(state => !state); - }; + type openDrawerRightState = boolean; + const openDrawerRightState: openDrawerRightState = useAppSelector((state: any) => state.appState.openDrawerRight); + + type openDrawerRightWidth = number; + const openDrawerRightWidth: openDrawerRightWidth = useAppSelector((state: any) => state.appState.openDrawerRightWidth); return ( <> - - Data View - + + Data View + + ) } diff --git a/WebGLViewer/src/components/display/MetadataPanels.tsx b/WebGLViewer/src/components/display/MetadataPanels.tsx index fc8f847a7..909456f94 100644 --- a/WebGLViewer/src/components/display/MetadataPanels.tsx +++ b/WebGLViewer/src/components/display/MetadataPanels.tsx @@ -1,14 +1,23 @@ +// React import * as React from 'react'; -import { useAppSelector, useAppDispatch } from '../../../app/hooks/hooks'; -import Box from '@mui/material/Box'; -import Accordion from '@mui/material/Accordion'; -import AccordionDetails from '@mui/material/AccordionDetails'; -import AccordionSummary from '@mui/material/AccordionSummary'; -import Typography from '@mui/material/Typography'; +// Hooks +import { useAppSelector } from '../../../app/hooks/reduxTypescriptHooks'; + +// MUI Components +import { + Accordion, + AccordionDetails, + AccordionSummary, + Box, + Divider, + Typography +} from "@mui/material"; + +// MUI Icons import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; -import Divider from '@mui/material/Divider'; +// Styles // @ts-ignore import COLORS from '../../styles/variables'; diff --git a/WebGLViewer/src/components/display/UnityInstance.tsx b/WebGLViewer/src/components/display/UnityInstance.tsx index 7c5f76bc8..b1a4710e2 100644 --- a/WebGLViewer/src/components/display/UnityInstance.tsx +++ b/WebGLViewer/src/components/display/UnityInstance.tsx @@ -3,7 +3,7 @@ import React from "react"; // Hooks import { useEffect, useState } from "react"; -import { useAppSelector } from '../../../app/hooks/hooks'; +import { useAppSelector } from '../../../app/hooks/reduxTypescriptHooks'; // Styles import '../../styles/App.scss'; @@ -11,7 +11,7 @@ import '../../styles/App.scss'; // Unity import { Unity, useUnityContext } from "react-unity-webgl"; -// Material +// MUI Components import { Box, Button, diff --git a/WebGLViewer/src/components/display/WebGL.tsx b/WebGLViewer/src/components/display/WebGL.tsx index 889be529c..55dd723d5 100644 --- a/WebGLViewer/src/components/display/WebGL.tsx +++ b/WebGLViewer/src/components/display/WebGL.tsx @@ -4,17 +4,17 @@ import React from "react"; // Hooks import { useEffect, useState } from "react"; -// Material +// Helpers +import regex from "../../../app/helpers/regex"; + +// MUI Components import { Box, } from "@mui/material"; -// Components +// Custom Components import UnityInstance from "./UnityInstance"; -// Helpers -import regex from "../../helpers/regex"; - export default function WebGL() { // WebGL Urls diff --git a/WebGLViewer/src/index.css b/WebGLViewer/src/index.css deleted file mode 100644 index 16030587c..000000000 --- a/WebGLViewer/src/index.css +++ /dev/null @@ -1,73 +0,0 @@ -:root { - font-family: Inter, Avenir, Helvetica, Arial, sans-serif; - font-size: 16px; - font-weight: 400; - line-height: 24px; - color-scheme: light dark; - color: rgb(255 255 255 / 87%); - background-color: #242424; - font-synthesis: none; - text-rendering: optimizelegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-text-size-adjust: 100%; -} - -a { - font-weight: 500; - color: #646cff; - text-decoration: inherit; -} - -a:hover { - color: #535bf2; -} - -body { - display: flex; - place-items: center; - min-width: 320px; - min-height: 100vh; - margin: 0; -} - -h1 { - font-size: 3.2em; - line-height: 1.1; -} - -button { - padding: 0.6em 1.2em; - font-family: inherit; - font-size: 1em; - font-weight: 500; - cursor: pointer; - background-color: #1a1a1a; - border: 1px solid transparent; - border-radius: 8px; - transition: border-color 0.25s; -} - -button:hover { - border-color: #646cff; -} - -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - -@media (prefers-color-scheme: light) { - :root { - color: #213547; - background-color: #fff; - } - - a:hover { - color: #747bff; - } - - button { - background-color: #f9f9f9; - } -} diff --git a/WebGLViewer/src/layouts/LayoutDashboard.tsx b/WebGLViewer/src/layouts/LayoutDashboard.tsx index 3ba77be0b..c2581aa34 100644 --- a/WebGLViewer/src/layouts/LayoutDashboard.tsx +++ b/WebGLViewer/src/layouts/LayoutDashboard.tsx @@ -1,15 +1,11 @@ +// React import * as React from 'react'; -import { useAppSelector } from '../../app/hooks/hooks'; -import WebGL from '../components/display/WebGL'; - -// Load transitions -import Fade from '@mui/material/Fade'; +// Hooks +import { useAppSelector } from '../../app/hooks/reduxTypescriptHooks'; -// Load MUI components -import { Grid, Box } from '@mui/material'; - -// Load Custom Components +// Custom Components +import WebGL from '../components/display/WebGL'; function LayoutDashboard() { diff --git a/WebGLViewer/src/layouts/LayoutSettings.tsx b/WebGLViewer/src/layouts/LayoutSettings.tsx index a093373e0..96fa48f1e 100644 --- a/WebGLViewer/src/layouts/LayoutSettings.tsx +++ b/WebGLViewer/src/layouts/LayoutSettings.tsx @@ -1,5 +1,7 @@ +// React import * as React from 'react' +// Custom Components import PageCard from '../components/coreapp/PageCard' function LayoutSettings() { diff --git a/WebGLViewer/src/layouts/MainScaffold.tsx b/WebGLViewer/src/layouts/MainScaffold.tsx new file mode 100644 index 000000000..c40273160 --- /dev/null +++ b/WebGLViewer/src/layouts/MainScaffold.tsx @@ -0,0 +1,71 @@ +// React +import * as React from 'react'; + +// Hooks +import { useAppSelector, useAppDispatch } from '../../app/hooks/reduxTypescriptHooks'; + +// Import packages +import classNames from 'classnames'; + +// Import Redux actions +import { appStateActions } from '../../app/store/index'; + +// MUI Styles +import { styled, useTheme } from '@mui/material/styles'; + +// MUI Components +import { + Box, + CssBaseline, + Drawer, + IconButton, + Toolbar, + Typography +} from '@mui/material'; +import MuiAppBar, { AppBarProps as MuiAppBarProps } from '@mui/material/AppBar'; + +import Paper from '@mui/material/Paper'; + +// MUI Icons +import MenuIcon from '@mui/icons-material/Menu'; + +// Custom Components +import Header from '../components/coreapp/Header'; +import SideBarLeft from '../components/coreapp/SideBarLeft'; +import SideBarRight from '../components/coreapp/SideBarRight'; + +// Styles +// @ts-ignore +import COLORS from '../../styles/variables'; + +export default function MainScaffold(props: any) { + const { children } = props; + + const theme = useTheme(); + const dispatch = useAppDispatch(); + + type openDrawerLeftState = boolean; + const openDrawerLeftState: openDrawerLeftState = useAppSelector((state: any) => state.appState.openDrawerLeft); + + type openDrawerLeftWidth = number; + const openDrawerLeftWidth: openDrawerLeftWidth = useAppSelector((state: any) => state.appState.openDrawerLeftWidth); + + return ( + +
+ + + {children} + + + + ); +} diff --git a/WebGLViewer/src/main.tsx b/WebGLViewer/src/main.tsx index 92e709a88..c7a8f1a9c 100644 --- a/WebGLViewer/src/main.tsx +++ b/WebGLViewer/src/main.tsx @@ -1,14 +1,20 @@ +// React import React from 'react' import ReactDOM from 'react-dom/client' - -import { store } from '../app/store/index'; import { Provider } from 'react-redux'; import { BrowserRouter } from 'react-router-dom'; +// Import Store +import { store } from '../app/store/index'; + +// Import Fonts import '@fontsource/source-sans-pro'; import '@fontsource/montserrat'; +// Custom Components import App from './App' + +// Styles import './styles/App.scss'; ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( diff --git a/WebGLViewer/src/styles/App.scss b/WebGLViewer/src/styles/App.scss index 07fc80007..334b96cc6 100644 --- a/WebGLViewer/src/styles/App.scss +++ b/WebGLViewer/src/styles/App.scss @@ -70,18 +70,18 @@ Button { height: calc(100vh - 64px); width: calc(100vw); overflow: hidden; - transition: all .3s; + transition: all 400ms; &.main-container-sizing-with-drawer { width: calc(100vw - 365px); - transition: all .3s; + transition: all 400ms; } } .webgl-canvas { width: 100% !important; height: 100% !important; - transition: all .3s; + transition: all 400ms; } .sidebar-sizing { From 652d0e3c6ba0ecc0c1160d46e99159e852395145 Mon Sep 17 00:00:00 2001 From: Adam Pluth Date: Mon, 27 Feb 2023 12:16:12 -0700 Subject: [PATCH 02/13] rename of sidebars to drawers for better consistency --- .../coreapp/{SideBarLeft.tsx => DrawerLeft.tsx} | 6 +++--- .../coreapp/{SideBarRight.tsx => DrawerRight.tsx} | 2 +- WebGLViewer/src/layouts/MainScaffold.tsx | 8 ++++---- WebGLViewer/src/styles/App.scss | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) rename WebGLViewer/src/components/coreapp/{SideBarLeft.tsx => DrawerLeft.tsx} (98%) rename WebGLViewer/src/components/coreapp/{SideBarRight.tsx => DrawerRight.tsx} (95%) diff --git a/WebGLViewer/src/components/coreapp/SideBarLeft.tsx b/WebGLViewer/src/components/coreapp/DrawerLeft.tsx similarity index 98% rename from WebGLViewer/src/components/coreapp/SideBarLeft.tsx rename to WebGLViewer/src/components/coreapp/DrawerLeft.tsx index 32eed11b6..13d685330 100644 --- a/WebGLViewer/src/components/coreapp/SideBarLeft.tsx +++ b/WebGLViewer/src/components/coreapp/DrawerLeft.tsx @@ -70,7 +70,7 @@ const SearchBar = ({setSearchQuery}: any) => ( ); -export default function SideBarLeft(props: any) { +export default function DrawerLeft(props: any) { const { children } = props; const theme = useTheme(); @@ -143,9 +143,9 @@ export default function SideBarLeft(props: any) { diff --git a/WebGLViewer/src/components/coreapp/SideBarRight.tsx b/WebGLViewer/src/components/coreapp/DrawerRight.tsx similarity index 95% rename from WebGLViewer/src/components/coreapp/SideBarRight.tsx rename to WebGLViewer/src/components/coreapp/DrawerRight.tsx index e62417994..3b9dad4a7 100644 --- a/WebGLViewer/src/components/coreapp/SideBarRight.tsx +++ b/WebGLViewer/src/components/coreapp/DrawerRight.tsx @@ -13,7 +13,7 @@ import { Typography } from "@mui/material"; -export default function SideBarRight(props: any) { +export default function DrawerRight(props: any) { const { children } = props; const theme = useTheme(); diff --git a/WebGLViewer/src/layouts/MainScaffold.tsx b/WebGLViewer/src/layouts/MainScaffold.tsx index c40273160..2ae506465 100644 --- a/WebGLViewer/src/layouts/MainScaffold.tsx +++ b/WebGLViewer/src/layouts/MainScaffold.tsx @@ -31,8 +31,8 @@ import MenuIcon from '@mui/icons-material/Menu'; // Custom Components import Header from '../components/coreapp/Header'; -import SideBarLeft from '../components/coreapp/SideBarLeft'; -import SideBarRight from '../components/coreapp/SideBarRight'; +import DrawerLeft from '../components/coreapp/DrawerLeft'; +import DrawerRight from '../components/coreapp/DrawerRight'; // Styles // @ts-ignore @@ -53,7 +53,7 @@ export default function MainScaffold(props: any) { return (
- + {children} - + ); diff --git a/WebGLViewer/src/styles/App.scss b/WebGLViewer/src/styles/App.scss index 334b96cc6..b85db6357 100644 --- a/WebGLViewer/src/styles/App.scss +++ b/WebGLViewer/src/styles/App.scss @@ -84,10 +84,10 @@ Button { transition: all 400ms; } -.sidebar-sizing { +.drawer-left-sizing { flex: 1 0 100%; - &.sidebar-sizing-asset-selected { + &.drawer-left-sizing-asset-selected { flex: 1 0 50%; } } From e11e020c365a5189dbab236d9f2ef214ca193068 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 08:34:46 -0700 Subject: [PATCH 03/13] corrected build image --- Dockerfile | 28 ++++++++++++------------- NodeLibraries/dl-fast-load/package.json | 2 +- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index b65d5615c..f4adb3511 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ -FROM cimg/rust:1.67.0-node as build +FROM rust:alpine3.17 as build-rust +RUN mkdir /module +WORKDIR /module -USER root -RUN sudo apt-get update -RUN sudo apt-get upgrade libtasn1-6 +COPY NodeLibraries/dl-fast-load . + +RUN cargo build > build-output.txt + + +FROM node:18.14.1-alpine3.17 as production # these settings are needed for the admin web gui build, these variables are all baked into the Vue application and thus # are available to any end user that wants to dig deep enough in the webpage - as such we don't feel it a security risk @@ -23,17 +28,18 @@ ENV CORE_DB_CONNECTION_STRING=postgresql://postgres:root@timescaledb:5432/deep_l # Create the base directory and set the rust version to use default stable RUN mkdir /srv/core_api -RUN rustup default stable WORKDIR /srv/core_api COPY package*.json ./ -RUN npm update --location=global RUN npm install npm@latest --location=global +RUN npm update --location=global +RUN npm install pm2 --location=global RUN npm install cargo-cp-artifact --location=global # Bundle app source COPY . . +COPY --from=build-rust /module /srv/core_api/NodeLibraries/dl-fast-load RUN npm ci --include=dev RUN npm run build:docker @@ -43,16 +49,8 @@ RUN rm -rf /srv/core_api/AdminWebApp/node_modules RUN npm run build:web-gl # catch any env file a user might have accidentally built into the container RUN rm -rf .env +RUN rm -rf /srv/core_api/NodeLibraries/dl-fast-load -FROM node:18.14.1-alpine3.17 as production - -WORKDIR /srv/core_api - -RUN npm install npm@latest --location=global -RUN npm update --location=global -RUN npm install pm2 --location=global - -COPY --from=build /srv/core_api /srv/core_api # Add docker-compose-wait tool ---------------------- ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait diff --git a/NodeLibraries/dl-fast-load/package.json b/NodeLibraries/dl-fast-load/package.json index b461e5765..502376f7b 100644 --- a/NodeLibraries/dl-fast-load/package.json +++ b/NodeLibraries/dl-fast-load/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", "build-debug": "npm run build --", - "build-release": "npm run build -- --release", + "build-release": "cargo-cp-artifact -a cdylib dl-fast-load index.node -- cat build-output.txt", "install": "npm run build-release", "test": "cargo test" }, From adeaeff58189b014c3163221057341680ac4e745 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 08:37:15 -0700 Subject: [PATCH 04/13] corrected build image --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f4adb3511..5747d6211 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,6 +39,7 @@ RUN npm install cargo-cp-artifact --location=global # Bundle app source COPY . . +RUN rm -rf /srv/core_api/NodeLibraries/dl-fast-load COPY --from=build-rust /module /srv/core_api/NodeLibraries/dl-fast-load RUN npm ci --include=dev @@ -49,7 +50,6 @@ RUN rm -rf /srv/core_api/AdminWebApp/node_modules RUN npm run build:web-gl # catch any env file a user might have accidentally built into the container RUN rm -rf .env -RUN rm -rf /srv/core_api/NodeLibraries/dl-fast-load # Add docker-compose-wait tool ---------------------- From da6fa90281d0521b20c1613908678813a9b57fb0 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 08:44:07 -0700 Subject: [PATCH 05/13] built --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5747d6211..775d5bbf1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,8 +3,8 @@ RUN mkdir /module WORKDIR /module COPY NodeLibraries/dl-fast-load . - -RUN cargo build > build-output.txt +ENV RUSTFLAGS="-C target-feature=-crt-static" +RUN cargo build > build-output.txt FROM node:18.14.1-alpine3.17 as production From 1f1e833a7ed5664ffd023b830a79ee89ccd4dd90 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 08:49:28 -0700 Subject: [PATCH 06/13] no more alpine --- Dockerfile | 28 +++++++++++++------------ NodeLibraries/dl-fast-load/package.json | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 775d5bbf1..414a333be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,8 @@ -FROM rust:alpine3.17 as build-rust -RUN mkdir /module -WORKDIR /module +FROM cimg/rust:1.67.0-node as build -COPY NodeLibraries/dl-fast-load . -ENV RUSTFLAGS="-C target-feature=-crt-static" -RUN cargo build > build-output.txt - - -FROM node:18.14.1-alpine3.17 as production +USER root +RUN sudo apt-get update +RUN sudo apt-get upgrade libtasn1-6 # these settings are needed for the admin web gui build, these variables are all baked into the Vue application and thus # are available to any end user that wants to dig deep enough in the webpage - as such we don't feel it a security risk @@ -28,19 +23,17 @@ ENV CORE_DB_CONNECTION_STRING=postgresql://postgres:root@timescaledb:5432/deep_l # Create the base directory and set the rust version to use default stable RUN mkdir /srv/core_api +RUN rustup default stable WORKDIR /srv/core_api COPY package*.json ./ -RUN npm install npm@latest --location=global RUN npm update --location=global -RUN npm install pm2 --location=global +RUN npm install npm@latest --location=global RUN npm install cargo-cp-artifact --location=global # Bundle app source COPY . . -RUN rm -rf /srv/core_api/NodeLibraries/dl-fast-load -COPY --from=build-rust /module /srv/core_api/NodeLibraries/dl-fast-load RUN npm ci --include=dev RUN npm run build:docker @@ -51,6 +44,15 @@ RUN npm run build:web-gl # catch any env file a user might have accidentally built into the container RUN rm -rf .env +FROM cimg/node:lts as production + +WORKDIR /srv/core_api + +RUN npm install npm@latest --location=global +RUN npm update --location=global +RUN npm install pm2 --location=global + +COPY --from=build /srv/core_api /srv/core_api # Add docker-compose-wait tool ---------------------- ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait diff --git a/NodeLibraries/dl-fast-load/package.json b/NodeLibraries/dl-fast-load/package.json index 502376f7b..b461e5765 100644 --- a/NodeLibraries/dl-fast-load/package.json +++ b/NodeLibraries/dl-fast-load/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", "build-debug": "npm run build --", - "build-release": "cargo-cp-artifact -a cdylib dl-fast-load index.node -- cat build-output.txt", + "build-release": "npm run build -- --release", "install": "npm run build-release", "test": "cargo test" }, From ab23fb841efb4eab0414bed6162c4b87356b6ff1 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 08:57:45 -0700 Subject: [PATCH 07/13] corrected perms --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 414a333be..6a1ff4cdc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,7 +45,7 @@ RUN npm run build:web-gl RUN rm -rf .env FROM cimg/node:lts as production - +USER root WORKDIR /srv/core_api RUN npm install npm@latest --location=global From a65ecc6990053c03781b3f3c5c13c078b3312751 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 09:25:07 -0700 Subject: [PATCH 08/13] try building --- Dockerfile | 28 ++++++++++++------------- NodeLibraries/dl-fast-load/package.json | 2 +- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6a1ff4cdc..7aff1c672 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,14 @@ -FROM cimg/rust:1.67.0-node as build +FROM rust:alpine3.17 as build-rust +RUN apk add musl-dev +RUN mkdir /module +WORKDIR /module -USER root -RUN sudo apt-get update -RUN sudo apt-get upgrade libtasn1-6 +COPY NodeLibraries/dl-fast-load . +ENV RUSTFLAGS="-C target-feature=-crt-static" +RUN cargo build > build-output.txt + +FROM node:18.14.1-alpine3.17 as production # these settings are needed for the admin web gui build, these variables are all baked into the Vue application and thus # are available to any end user that wants to dig deep enough in the webpage - as such we don't feel it a security risk # to have these env variables available to anyone running the history commmand on the container/image @@ -23,17 +28,19 @@ ENV CORE_DB_CONNECTION_STRING=postgresql://postgres:root@timescaledb:5432/deep_l # Create the base directory and set the rust version to use default stable RUN mkdir /srv/core_api -RUN rustup default stable WORKDIR /srv/core_api COPY package*.json ./ -RUN npm update --location=global RUN npm install npm@latest --location=global +RUN npm update --location=global +RUN npm install pm2 --location=global RUN npm install cargo-cp-artifact --location=global # Bundle app source COPY . . +RUN rm -rf /srv/core_api/NodeLibraries/dl-fast-load +COPY --from=build-rust /module /srv/core_api/NodeLibraries/dl-fast-load RUN npm ci --include=dev RUN npm run build:docker @@ -44,15 +51,6 @@ RUN npm run build:web-gl # catch any env file a user might have accidentally built into the container RUN rm -rf .env -FROM cimg/node:lts as production -USER root -WORKDIR /srv/core_api - -RUN npm install npm@latest --location=global -RUN npm update --location=global -RUN npm install pm2 --location=global - -COPY --from=build /srv/core_api /srv/core_api # Add docker-compose-wait tool ---------------------- ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait diff --git a/NodeLibraries/dl-fast-load/package.json b/NodeLibraries/dl-fast-load/package.json index b461e5765..502376f7b 100644 --- a/NodeLibraries/dl-fast-load/package.json +++ b/NodeLibraries/dl-fast-load/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", "build-debug": "npm run build --", - "build-release": "npm run build -- --release", + "build-release": "cargo-cp-artifact -a cdylib dl-fast-load index.node -- cat build-output.txt", "install": "npm run build-release", "test": "cargo test" }, From 3233d239687fb96035e32ef858c0a75e1d624aef Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 09:28:34 -0700 Subject: [PATCH 09/13] try building --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7aff1c672..cdf8aa870 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM rust:alpine3.17 as build-rust -RUN apk add musl-dev +RUN apk add build-base musl-dev openssl-dev RUN mkdir /module WORKDIR /module From 95ec7911a9070f8ac06f58422fa3ad7daa2a29eb Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 09:40:36 -0700 Subject: [PATCH 10/13] corrected build --- Dockerfile | 2 +- NodeLibraries/dl-fast-load/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index cdf8aa870..f9d9cf655 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /module COPY NodeLibraries/dl-fast-load . ENV RUSTFLAGS="-C target-feature=-crt-static" -RUN cargo build > build-output.txt +RUN cargo build --release --message-format=json-render-diagnostics > build-output.txt FROM node:18.14.1-alpine3.17 as production diff --git a/NodeLibraries/dl-fast-load/package.json b/NodeLibraries/dl-fast-load/package.json index 502376f7b..3e7569d75 100644 --- a/NodeLibraries/dl-fast-load/package.json +++ b/NodeLibraries/dl-fast-load/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", "build-debug": "npm run build --", - "build-release": "cargo-cp-artifact -a cdylib dl-fast-load index.node -- cat build-output.txt", + "build-release": "cargo-cp-artifact -a cdylib dl-fast-load lib/index.node -- cat build-output.txt", "install": "npm run build-release", "test": "cargo test" }, From 70917525b76abb01e721a8137876a76b242ad8c2 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 09:51:18 -0700 Subject: [PATCH 11/13] copy better --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9d9cf655..f69bb4730 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ FROM rust:alpine3.17 as build-rust RUN apk add build-base musl-dev openssl-dev -RUN mkdir /module -WORKDIR /module +RUN mkdir /srv/core_api +WORKDIR /srv/core_api -COPY NodeLibraries/dl-fast-load . +COPY . . ENV RUSTFLAGS="-C target-feature=-crt-static" +WORKDIR /srv/core_api/NodeLibaries/dl-fast-load RUN cargo build --release --message-format=json-render-diagnostics > build-output.txt @@ -40,7 +41,7 @@ RUN npm install cargo-cp-artifact --location=global # Bundle app source COPY . . RUN rm -rf /srv/core_api/NodeLibraries/dl-fast-load -COPY --from=build-rust /module /srv/core_api/NodeLibraries/dl-fast-load +COPY --from=build-rust /srv/core_api/NodeLibraries/dl-fast-load /srv/core_api/NodeLibraries/dl-fast-load RUN npm ci --include=dev RUN npm run build:docker From 06841e1c82cacca61429b70abf2bc273b6f9734a Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 10:00:18 -0700 Subject: [PATCH 12/13] spelling --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index f69bb4730..48c53f999 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ WORKDIR /srv/core_api COPY . . ENV RUSTFLAGS="-C target-feature=-crt-static" -WORKDIR /srv/core_api/NodeLibaries/dl-fast-load +WORKDIR /srv/core_api/NodeLibraries/dl-fast-load RUN cargo build --release --message-format=json-render-diagnostics > build-output.txt From ca3c00fbd5f8bba8acf217e3b21e3e022d634c05 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Tue, 28 Feb 2023 10:28:11 -0700 Subject: [PATCH 13/13] corrected again --- NodeLibraries/dl-fast-load/package.json | 2 +- readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NodeLibraries/dl-fast-load/package.json b/NodeLibraries/dl-fast-load/package.json index 3e7569d75..502376f7b 100644 --- a/NodeLibraries/dl-fast-load/package.json +++ b/NodeLibraries/dl-fast-load/package.json @@ -6,7 +6,7 @@ "scripts": { "build": "cargo-cp-artifact -nc index.node -- cargo build --message-format=json-render-diagnostics", "build-debug": "npm run build --", - "build-release": "cargo-cp-artifact -a cdylib dl-fast-load lib/index.node -- cat build-output.txt", + "build-release": "cargo-cp-artifact -a cdylib dl-fast-load index.node -- cat build-output.txt", "install": "npm run build-release", "test": "cargo test" }, diff --git a/readme.md b/readme.md index 02ede5b94..9fdf3612d 100644 --- a/readme.md +++ b/readme.md @@ -62,7 +62,7 @@ You must follow these steps in the exact order given. Failure to do so will caus 2. Clone the DeepLynx [repository](https://gitlab.software.inl.gov/b650/Deep-Lynx/-/tree/master). -3. Change directories with `cd ./NodeLibraries/dl-fast-load` and run `cargo clean && npm install` - this preps the dl-fast-load rust module for installation +3. Change directories with `cd ./NodeLibraries/dl-fast-load` and run `cargo clean && cargo build --release --message-format=json-render-diagnostics > build-output.txt` - this preps the dl-fast-load rust module for installation 4. Return to the root DeepLynx directory with `cd ../../` and run `npm upgrade && npm ci`.