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

initial vite + redux toolkit + react app #545

Draft
wants to merge 33 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5655dc3
initial vite + redux toolkit + react app
Salam-Dalloul Sep 23, 2024
7d3be3d
revert package.json changed code
Salam-Dalloul Sep 23, 2024
0ca5c3a
remove lock files
Salam-Dalloul Sep 23, 2024
f3eac49
update gitignore file
Salam-Dalloul Sep 23, 2024
8709ee0
add main layout
Salam-Dalloul Sep 26, 2024
87a6d21
add flex layout
Salam-Dalloul Oct 3, 2024
1047fb4
merge develop
Salam-Dalloul Oct 3, 2024
e8e0b69
add flexlayout
Salam-Dalloul Oct 4, 2024
99e42dc
update config files
Salam-Dalloul Oct 4, 2024
44b1453
update store
Salam-Dalloul Oct 4, 2024
d7f2537
add widget action
Salam-Dalloul Oct 4, 2024
be7739d
edit layout
Salam-Dalloul Oct 4, 2024
33711d2
edit layout
Salam-Dalloul Oct 4, 2024
4655fd8
add 3D canvas
Salam-Dalloul Oct 7, 2024
6cdb688
toggle viewing widgets
Salam-Dalloul Oct 8, 2024
694f8fb
add an example of using the redux toolkit store
Salam-Dalloul Oct 8, 2024
8c272c6
dicom viewer
Salam-Dalloul Oct 8, 2024
7202aee
Include plugin to deal with gzip file format with vite
aranega Oct 8, 2024
61171e5
Port features from dicom viewer of HFO project
aranega Oct 14, 2024
14405e8
Fix style for dicom viewer component
aranega Oct 14, 2024
9d3d01d
Fix refresh of loaded model for dicom viewer
aranega Oct 14, 2024
d34073c
GEP-174 Add new preconfigured dicom viewer
aranega Oct 15, 2024
69de30f
Merge branch 'develop' of github.com:MetaCell/geppetto-meta into feat…
aranega Oct 15, 2024
2c1b359
Fix update condition of the dicom viewer
aranega Oct 16, 2024
ab064fa
Fix compilation issue
aranega Oct 16, 2024
34d5800
Merge branch 'feature/update-dicom-viewer' into check-dicom-viewer
aranega Oct 16, 2024
6c84001
Fix example with dicom viewer
aranega Oct 16, 2024
6597d09
Merge pull request #553 from MetaCell/check-dicom-viewer
Salam-Dalloul Oct 25, 2024
13b65db
merge develop
Salam-Dalloul Oct 26, 2024
628183b
Revert "Check dicom viewer"
Salam-Dalloul Oct 26, 2024
3401353
Merge pull request #554 from MetaCell/revert-553-check-dicom-viewer
Salam-Dalloul Oct 26, 2024
ba70897
add dicom viewer
Salam-Dalloul Oct 26, 2024
fceb2bf
add geppetto 3D viewer
Salam-Dalloul Oct 27, 2024
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
8 changes: 4 additions & 4 deletions examples/redux-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
"test": "node scripts/test.js"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.4.0",
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@fortawesome/react-fontawesome": "^0.1.9",
"@fortawesome/fontawesome-free": "^6.4.0",
"@material-ui/core": "^4.9.14",
"@material-ui/icons": "^4.11.2",
"@metacell/geppetto-meta-client": "^2.0.0",
"@metacell/geppetto-meta-core": "^2.0.0",
"@metacell/geppetto-meta-ui": "^2.0.0",
"@metacell/geppetto-meta-client": "file:.yalc/@metacell/geppetto-meta-client",
"@metacell/geppetto-meta-core": "file:.yalc/@metacell/geppetto-meta-core",
"@metacell/geppetto-meta-ui": "file:.yalc/@metacell/geppetto-meta-ui",
"@nosferatu500/react-sortable-tree": "3.0.5",
"@pmmmwh/react-refresh-webpack-plugin": "0.4.3",
"@reduxjs/toolkit": "^1.5.1",
Expand Down
48 changes: 48 additions & 0 deletions examples/vite-redux-toolkit-react-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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*

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
48 changes: 48 additions & 0 deletions examples/vite-redux-toolkit-react-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Getting Started with Create React App

This project was bootstrapped with [Vite](https://vitejs.dev/guide/) using React template.

To start develop, you need to setup yalc to link geppetto libraries to the current project.

To do so, run

```
bash setup.sh
```

## Available Scripts

You can run the project in dev or preview mode using `yarn dev` and `yarn preview`.
To build the project, use `yarn build`.

Here is a description of what each command is doing.

### `yarn dev`

Runs the app in the development mode.
Open [http://localhost:5143](http://localhost:5143) to view it in the browser (the port might be different on your machine, check the logs displayed by vite to be sure you are targeting the right address).

The page will reload if you make edits.
You will also see any lint errors in the console.

If you are developping at the same time on any of the geppetto.js lib (core, ui, client), you can run:

```
bash watch-geppettojs-updates.sh
```

This command will launch a `watch` on all the geppetto.js libraries and hot-reload the application if any of the source code of those dependencies changes.


### `yarn preview`

Runs the app in preview mode.
This means that a local webserver is launched to serve the app, but hot-reloading is not avaiable and the application is served from the `dist` directory where the application have been compiled/built.


### `yarn build`

Builds the app for production to the `dist` folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

Your app is ready to be deployed!
71 changes: 71 additions & 0 deletions examples/vite-redux-toolkit-react-app/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
import json from 'eslint-plugin-json'


export default tseslint.config(
{ ignores: [
'dist',
'node_modules',
'.yalc',
'src/rest/*' // do not lint generated code
] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx,js,jsx}'],
languageOptions: {
ecmaVersion: "latest",
globals: globals.browser,
sourceType: "module"
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
indent: ["error", 2, {
SwitchCase: 1,
}],
curly: "error", // enforce braces for one-line blocks
"no-tabs": "error", // enforce no tabs
"no-console": ["warn", {
allow: ["warn", "error", "debug"],
}],
"consistent-return": "warn", // https://eslint.org/docs/latest/rules/consistent-return
"prefer-arrow-callback": ["warn"],
"object-curly-spacing": ["warn", "always"], // enforce consistent spacing inside braces
"func-style": "off", // function expressions or arrow functions are equally valid
"no-unneeded-ternary": "warn", // disallow unnecessary ternary expressions
// React rules: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules
"react/prop-types": "off", // PropTypes are not forced
"react/forbid-prop-types": "off", // all PropTypes are allowed
"react-hooks/rules-of-hooks": "error", // https://react.dev/reference/rules/rules-of-hooks
"react-hooks/exhaustive-deps": "warn", // Hooks dependency array, sometimes it's better to ignore
},
},
{ // Linting for tsconfig.json files allows comments
files: ["tsconfig*.json"],
plugins: { json },
processor: "json/json",
rules: {
...json.configs["recommended-with-comments"].rules,
}
},
{ // Linting for *.json files do now allow comments
files: ["**/*.json"],
ignores: ["tsconfig*.json"],
plugins: { json },
processor: "json/json",
rules: {
...json.configs.recommended.rules,
}
}
)
13 changes: 13 additions & 0 deletions examples/vite-redux-toolkit-react-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
77 changes: 77 additions & 0 deletions examples/vite-redux-toolkit-react-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "vite-redux-toolkit-react-app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"prepare": "yarn link:yalc",
"link:yalc": "yalc link @metacell/geppetto-meta-core && yalc link @metacell/geppetto-meta-ui && yalc link @metacell/geppetto-meta-client",
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"lint-fix": "eslint . --fix",
"preview": "vite preview"
},
"dependencies": {
"@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0",
"@fortawesome/fontawesome-free": "^6.6.0",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@material-ui/core": "^4.12.4",
"@metacell/geppetto-meta-client": "^2.0.0",
"@metacell/geppetto-meta-core": "^2.0.0",
"@metacell/geppetto-meta-ui": "^2.0.0",
"@mui/icons-material": "^6.1.1",
"@mui/material": "^6.1.1",
"@reduxjs/toolkit": "^2.2.7",
"@types/react-redux": "^7.1.34",
"ami.js": ">=0.32.0",
"file-saver": "^2.0.5",
"html-to-image": "^1.6.1",
"jszip": "^3.10.1",
"nifti-reader-js": "^0.6.8",
"openseadragon": "^5.0.0",
"react": "^18.3.1",
"react-color": "^2.19.3",
"react-dom": "^18.3.1",
"react-redux": "^9.1.2",
"react-resize-detector": "^6.7.4",
"three": "^0.118.0",
"three-render-objects": ">=1.13.3"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^9.9.0",
"eslint-plugin-json": "^4.0.1",
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
"less": "^4.2.0",
"sass": "^1.32.12",
"typescript": "^5.5.4",
"typescript-eslint": "^8.4.0",
"vite": "^5.4.3",
"yalc": "^1.0.0-pre.53"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"resolutions": {
"bezier-js": "4.0.3",
"three": "0.118.0"
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading