Initial Template
This commit is contained in:
commit
35342d6c2d
23 changed files with 4945 additions and 0 deletions
14
packages/web/index.html
Normal file
14
packages/web/index.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<!doctype html>
|
||||
<!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>Template</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
45
packages/web/package.json
Normal file
45
packages/web/package.json
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"name": "tdkdb-rxjs",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "biome lint . && stylelint **/*.css",
|
||||
"preview": "vite preview",
|
||||
"test": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emotion/react": "11.13.3",
|
||||
"@emotion/styled": "11.13.0",
|
||||
"@fontsource/roboto": "^5.1.0",
|
||||
"@mui/icons-material": "6.1.1",
|
||||
"@mui/lab": "6.0.0-beta.10",
|
||||
"@mui/material": "6.1.1",
|
||||
"observable-hooks": "=4.2.4",
|
||||
"react": "=18.3.1",
|
||||
"react-dom": "=18.3.1",
|
||||
"react-hook-form": "7.53.0",
|
||||
"react-router-dom": "6.26.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "=1.9.2",
|
||||
"@eslint/js": "=9.10.0",
|
||||
"@types/react": "=18.3.8",
|
||||
"@types/react-dom": "=18.3.0",
|
||||
"@vitejs/plugin-react": "=4.3.1",
|
||||
"eslint": "=9.10.0",
|
||||
"eslint-plugin-react-hooks": "=5.1.0-rc.0",
|
||||
"eslint-plugin-react-refresh": "=0.4.12",
|
||||
"globals": "=15.9.0",
|
||||
"meow": "=9.0.0",
|
||||
"stylelint": "=16.9.0",
|
||||
"stylelint-config-standard": "=36.0.1",
|
||||
"typescript": "=5.6.2",
|
||||
"typescript-eslint": "=8.6.0",
|
||||
"vite": "=5.4.6",
|
||||
"vite-plugin-checker": "=0.8.0",
|
||||
"vitest": "2.1.1"
|
||||
}
|
||||
}
|
||||
BIN
packages/web/public/favicon.ico
Normal file
BIN
packages/web/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.8 KiB |
BIN
packages/web/public/logo192.png
Normal file
BIN
packages/web/public/logo192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
BIN
packages/web/public/logo512.png
Normal file
BIN
packages/web/public/logo512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
25
packages/web/public/manifest.json
Normal file
25
packages/web/public/manifest.json
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
},
|
||||
{
|
||||
"src": "logo192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
},
|
||||
{
|
||||
"src": "logo512.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
||||
3
packages/web/public/robots.txt
Normal file
3
packages/web/public/robots.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
29
packages/web/src/App.tsx
Normal file
29
packages/web/src/App.tsx
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
import {
|
||||
createBrowserRouter,
|
||||
Navigate,
|
||||
Outlet,
|
||||
RouterProvider,
|
||||
} from "react-router-dom";
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
element: <Outlet />,
|
||||
children: [
|
||||
{
|
||||
path: "/",
|
||||
element: <Navigate to="/test" />,
|
||||
},
|
||||
{
|
||||
path: "test",
|
||||
element: <p>Test</p>,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
function App() {
|
||||
return <RouterProvider router={router} />;
|
||||
}
|
||||
|
||||
export default App;
|
||||
5
packages/web/src/index.css
Normal file
5
packages/web/src/index.css
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
16
packages/web/src/main.tsx
Normal file
16
packages/web/src/main.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./App.tsx";
|
||||
import "./index.css";
|
||||
|
||||
const root = document.getElementById("root");
|
||||
|
||||
if (root != null) {
|
||||
createRoot(root).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
);
|
||||
} else {
|
||||
console.error("No #root element found");
|
||||
}
|
||||
12
packages/web/src/requireContext.ts
Normal file
12
packages/web/src/requireContext.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import { useContext } from "react";
|
||||
|
||||
export function useRequiredContext<T>(
|
||||
c: React.Context<T | undefined>,
|
||||
error: string,
|
||||
): T {
|
||||
const ctx = useContext(c);
|
||||
if (ctx == null) {
|
||||
throw new Error(error);
|
||||
}
|
||||
return ctx;
|
||||
}
|
||||
5
packages/web/tsconfig.json
Normal file
5
packages/web/tsconfig.json
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"files": [],
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"include": ["src"]
|
||||
}
|
||||
34
packages/web/vite.config.ts
Normal file
34
packages/web/vite.config.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import checker from "vite-plugin-checker";
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
checker({
|
||||
biome: { command: "check", dev: { command: "lint" } },
|
||||
typescript: true,
|
||||
stylelint: { lintCommand: "stylelint ./src/**/*.css" },
|
||||
}),
|
||||
react(),
|
||||
],
|
||||
server: {
|
||||
fs: {
|
||||
deny: [".devenv/", ".direnv/"],
|
||||
},
|
||||
watch: {
|
||||
ignored: [
|
||||
"**/.devenv/**",
|
||||
"**/.devenv",
|
||||
"**/.direnv/**",
|
||||
"**/.direnv",
|
||||
"**/.git/**",
|
||||
"**/.git",
|
||||
"**/node_modules/**",
|
||||
"**/node_modules",
|
||||
"**/dist/**",
|
||||
"**/dist",
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue