Skip to content

Commit

Permalink
rfac: react-query in index.tsx (frontend)
Browse files Browse the repository at this point in the history
  • Loading branch information
yp969803 committed Jan 5, 2025
1 parent 43e9f32 commit 496d961
Show file tree
Hide file tree
Showing 10 changed files with 195 additions and 184 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
build: get
build: buildFrontend buildProducerDevImage
@docker run -it --rm -v $(shell pwd)/src/producer/:/app -v /var/autocd:/var/autocd -p 5001:5001 autocd-producer /bin/bash -c "mvn clean install -DskipTests -Dmaven.test.skip=true"

buildFrontend:
@docker run -it --rm -v $(shell pwd)/:/app -p 3000:3000 autocd-client /bin/bash -c "npm --prefix ./src/client install && npm --prefix ./src/client run build"

build:
@npm --prefix ./src/client run build && mvn -f ./src/producer/pom.xml clean install -DskipTests -Dmaven.test.skip=true

run:
Expand All @@ -8,13 +14,13 @@ test:
@mvn -f ./src/producer/pom.xml test

format: buildClientDevImage
@docker run -it --rm -v $(shell pwd)/src/client/:/app -p 3000:3000 autocd-client /bin/bash -c "npm run format"
@docker run -it --rm -v $(shell pwd)/src/client/:/app -p 3000:3000 autocd-client /bin/bash -c "npm install && npm run format"


buildProducerDevImage:
@docker build -t autocd-producer -f ./src/producer/Dockerfile.dev ./src/producer/

buildClientDevImage: get
buildClientDevImage:
@docker build -t autocd-client -f ./src/client/Dockerfile.dev ./src/client/

runProducerDevContainer: buildProducerDevImage
Expand All @@ -26,7 +32,8 @@ runClientDevImage: buildClientDevImage

help:
@echo "Available commands:"
@echo " make build - Build the application"
@echo " make build - Build autoCD"
@echo " make buildFrontend - Build the frontend"
@echo " make buildProducerDevImage - Build java dev docker image"
@echo " make runProducerDevContainer - Run java dev docker image"
@echo " make buildClientDevImage - Build client dev image"
Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ This is a rough outline of what a contributor's workflow looks like:
- Make sure the tests pass, and add any new tests as appropriate. ([Testing guidelines](TESTING.md))
- Submit a pull request to the original repository.

Before submitting a pull request, make sure that you've executed `sudo make format`, `sudo make` and committed the format changes.
Before submitting a pull request, make sure that you've executed `make format`, `maken buildFrontend` and committed the format changes.

Thanks for your contributions!

Expand Down
6 changes: 5 additions & 1 deletion src/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ import App from './App';
import reportWebVitals from './reportWebVitals';
import { BrowserRouter } from 'react-router-dom';
import { Toaster } from 'react-hot-toast';
import { QueryClient, QueryClientProvider } from 'react-query';

const queryClient = new QueryClient();
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
root.render(
<React.StrictMode>
<BrowserRouter>
<Toaster />
<App />
<QueryClientProvider client={queryClient}>
<App />
</QueryClientProvider>
</BrowserRouter>
</React.StrictMode>
);
Expand Down
6 changes: 3 additions & 3 deletions src/producer/src/main/resources/static/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"files": {
"main.css": "/static/css/main.092e2e82.css",
"main.js": "/static/js/main.fe467d57.js",
"main.js": "/static/js/main.181c3982.js",
"static/js/453.419a5d54.chunk.js": "/static/js/453.419a5d54.chunk.js",
"static/media/autocd-logo.png": "/static/media/autocd-logo.a4cd8552835c4e76a8b9.png",
"index.html": "/index.html",
"main.092e2e82.css.map": "/static/css/main.092e2e82.css.map",
"main.fe467d57.js.map": "/static/js/main.fe467d57.js.map",
"main.181c3982.js.map": "/static/js/main.181c3982.js.map",
"453.419a5d54.chunk.js.map": "/static/js/453.419a5d54.chunk.js.map"
},
"entrypoints": [
"static/css/main.092e2e82.css",
"static/js/main.fe467d57.js"
"static/js/main.181c3982.js"
]
}
2 changes: 1 addition & 1 deletion src/producer/src/main/resources/static/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="A tool to automate the process of Continuous Deployment in monolithic servers"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>autoCD</title><script defer="defer" src="/static/js/main.fe467d57.js"></script><link href="/static/css/main.092e2e82.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="A tool to automate the process of Continuous Deployment in monolithic servers"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>autoCD</title><script defer="defer" src="/static/js/main.181c3982.js"></script><link href="/static/css/main.092e2e82.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
173 changes: 173 additions & 0 deletions src/producer/src/main/resources/static/static/js/main.181c3982.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

173 changes: 0 additions & 173 deletions src/producer/src/main/resources/static/static/js/main.fe467d57.js

This file was deleted.

This file was deleted.

0 comments on commit 496d961

Please sign in to comment.