Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup biome.js and remove runtime errors #13

Merged
merged 11 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/biome.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check JS/TS/TSX/JSX format

on: [push, pull_request]

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: 1.8.3

- name: Run Biome format check
working-directory: applications/visualizer/frontend
run: biome format .
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Lint
name: Python Format

on: [push, pull_request]

Expand Down
18 changes: 0 additions & 18 deletions applications/visualizer/frontend/.eslintrc.cjs

This file was deleted.

12 changes: 6 additions & 6 deletions applications/visualizer/frontend/additional.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare module '*.svg' {
import React = require('react');
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
const src: string;
export default src;
}
declare module "*.svg" {
import React = require("react");
export const ReactComponent: React.FC<React.SVGProps<SVGSVGElement>>;
const src: string;
export default src;
}
24 changes: 11 additions & 13 deletions applications/visualizer/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
aranega marked this conversation as resolved.
Show resolved Hide resolved
"lint-fix": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
"preview": "vite preview",
"format": "biome format --write .",
"lint": "biome lint .",
"lint-fix": "biome lint --write .",
"generate-client": "openapi --input ../backend/openapi/openapi.json --output ./src/rest --useOptions --useUnionTypes --client xhr",
"start": "DOMAIN=http://localhost:8000 vite",
"start:dev": "DOMAIN=https://visualizer.celegans.metacell.us vite",
Expand All @@ -20,32 +21,29 @@
"@metacell/geppetto-meta-client": "^1.2.8",
"@metacell/geppetto-meta-core": "^1.2.8",
"@metacell/geppetto-meta-ui": "^1.2.8",
"@mui/icons-material": "^5.15.15",
"@mui/material": "^5.15.15",
"@mui/base": "^5.0.0-beta.40",
"@mui/icons-material": "^5.16.4",
"@mui/material": "^5.16.4",
"@react-three/drei": "^9.105.4",
"@react-three/fiber": "^8.16.2",
"@reduxjs/toolkit": "^2.2.3",
"@types/cytoscape": "^3.21.1",
"@types/three": "^0.164.0",
"@types/three": "^0.166.0",
"cytoscape": "^3.29.2",
"cytoscape-dagre": "^2.5.0",
"cytoscape-fcose": "^2.2.0",
"file-saver": "^2.0.5",
"react": "^18.2.0",
"react": "^18.3.1",
"react-color": "^2.19.3",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-redux": "^9.1.1",
"three": "^0.163.0"
"three": "^0.166.1"
},
"devDependencies": {
"@biomejs/biome": "1.8.3",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"openapi-typescript-codegen": "^0.29.0",
"sass": "^1.75.0",
"typescript": "^5.2.2",
Expand Down
64 changes: 29 additions & 35 deletions applications/visualizer/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,48 +1,42 @@
import { Provider } from "react-redux";
import { ThemeProvider } from "@mui/material/styles";
import { Box, CssBaseline } from "@mui/material";
import { ThemeProvider } from "@mui/material/styles";
import { Provider } from "react-redux";
import theme from "./theme/index.tsx";
import "./App.css";
import { useGlobalContext } from "./contexts/GlobalContext.tsx";
import AppLauncher from "./components/AppLauncher.tsx";
import WorkspaceComponent from "./components/WorkspaceComponent.tsx";
import { useGlobalContext } from "./contexts/GlobalContext.tsx";
import { ViewMode } from "./models";

function App() {
const {
workspaces,
currentWorkspaceId,
viewMode,
selectedWorkspacesIds,
} = useGlobalContext();


const hasLaunched = currentWorkspaceId != undefined

return (
<>
<ThemeProvider theme={theme}>
<CssBaseline />
{hasLaunched ? (
<Box className={"layout-manager-container"}>
{viewMode === ViewMode.Compare ?
Array.from(selectedWorkspacesIds).map(id => (
<Provider key={id} store={workspaces[id].store}>
<WorkspaceComponent />
</Provider>
))
:
<Provider store={workspaces[currentWorkspaceId].store}>
<WorkspaceComponent />
</Provider>
}
const { workspaces, currentWorkspaceId, viewMode, selectedWorkspacesIds } = useGlobalContext();

</Box>
const hasLaunched = currentWorkspaceId !== undefined;

) : <AppLauncher />}
</ThemeProvider>
</>
)
return (
<>
<ThemeProvider theme={theme}>
<CssBaseline />
{hasLaunched ? (
<Box className={"layout-manager-container"}>
{viewMode === ViewMode.Compare ? (
Array.from(selectedWorkspacesIds).map((id) => (
<Provider key={id} store={workspaces[id].store}>
<WorkspaceComponent />
</Provider>
))
) : (
<Provider store={workspaces[currentWorkspaceId].store}>
<WorkspaceComponent />
</Provider>
)}
</Box>
) : (
<AppLauncher />
)}
</ThemeProvider>
</>
);
}

export default App;
Loading