Skip to content

Commit 5604a00

Browse files
committed
feat: add --backend-only option and remove hard-coded port numbers
1 parent ba3dfa0 commit 5604a00

10 files changed

Lines changed: 1024 additions & 202 deletions

File tree

clean-architecture-visualizer/frontend/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"dev:backend": "vite --mode backend",
98
"build": "tsc -b && vite build",
109
"setup": "playwright install",
1110
"preview": "vite preview",

clean-architecture-visualizer/frontend/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
12
import { StrictMode } from 'react';
23
import ReactDOM from 'react-dom/client';
3-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
44
import App from './App';
55
import './index.css';
66

Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,46 @@
11
/// <reference types="vitest" />
2-
import { defineConfig, ProxyOptions } from 'vite';
2+
33
import react from '@vitejs/plugin-react';
4-
import svgr from 'vite-plugin-svgr';
54
import path from 'path';
5+
import { defineConfig } from 'vite';
6+
import svgr from 'vite-plugin-svgr';
67

7-
export default defineConfig(({ mode }) => {
8-
const isBackendMode = mode === 'backend';
9-
const proxyConfig: Record<string, string | ProxyOptions> = isBackendMode
10-
? {
11-
'/api': {
12-
target: 'http://localhost:3131',
13-
changeOrigin: true,
14-
ws: true,
15-
},
16-
}
17-
: {};
18-
19-
return {
20-
plugins: [react(), svgr({ include: '**/*.svg?react' })],
21-
server: {
22-
port: 5173,
23-
proxy: proxyConfig,
8+
export default defineConfig({
9+
plugins: [react(), svgr({ include: '**/*.svg?react' })],
10+
build: {
11+
outDir: 'dist',
12+
emptyOutDir: true,
13+
},
14+
resolve: {
15+
alias: {
16+
'@': path.resolve(__dirname, './src'),
17+
react: path.resolve(__dirname, 'node_modules/react'),
18+
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
19+
'react-router-dom': path.resolve(
20+
__dirname,
21+
'node_modules/react-router-dom'
22+
),
23+
'@tanstack/react-query': path.resolve(
24+
__dirname,
25+
'node_modules/@tanstack/react-query'
26+
),
27+
'@testing-library/react': path.resolve(
28+
__dirname,
29+
'node_modules/@testing-library/react'
30+
),
2431
},
25-
build: {
26-
outDir: 'dist',
27-
emptyOutDir: true,
28-
},
29-
resolve: {
30-
alias: {
31-
'@': path.resolve(__dirname, './src'),
32-
react: path.resolve(__dirname, 'node_modules/react'),
33-
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
34-
'react-router-dom': path.resolve(
35-
__dirname,
36-
'node_modules/react-router-dom'
37-
),
38-
'@tanstack/react-query': path.resolve(
39-
__dirname,
40-
'node_modules/@tanstack/react-query'
41-
),
42-
'@testing-library/react': path.resolve(
43-
__dirname,
44-
'node_modules/@testing-library/react'
45-
),
46-
},
47-
},
48-
test: {
49-
globals: true,
50-
environment: 'jsdom',
51-
setupFiles: ['./tests/setup.ts'],
52-
include: ['tests/unit/**/*.{test,ts,tsx}'],
53-
exclude: ['tests/e2e/**'],
54-
server: {
55-
deps: {
56-
inline: [/@tanstack\/react-query/, /msw/],
57-
},
32+
},
33+
test: {
34+
globals: true,
35+
environment: 'jsdom',
36+
setupFiles: ['./tests/setup.ts'],
37+
include: ['tests/unit/**/*.{test,ts,tsx}'],
38+
exclude: ['tests/e2e/**'],
39+
server: {
40+
deps: {
41+
inline: [/@tanstack\/react-query/, /msw/],
5842
},
59-
root: path.resolve(__dirname, './'),
6043
},
61-
};
44+
root: path.resolve(__dirname, './'),
45+
},
6246
});

clean-architecture-visualizer/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ export default {
1616
'^(\\.{1,2}/.*)\\.js$': '$1',
1717
},
1818
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/frontend/'],
19+
modulePathIgnorePatterns: ['<rootDir>/dist'],
1920
};

0 commit comments

Comments
 (0)