Harden CI and switch release builds to tagged immutable images
This commit is contained in:
parent
bed2e6cfb6
commit
f24e96efa7
60 changed files with 4710 additions and 64 deletions
32
web/eslint.config.js
Normal file
32
web/eslint.config.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import eslint from "@eslint/js";
|
||||
import globals from "globals";
|
||||
import reactHooks from "eslint-plugin-react-hooks";
|
||||
import tseslint from "typescript-eslint";
|
||||
|
||||
export default tseslint.config(
|
||||
{ ignores: ["dist", "coverage", "src/api/generated", "eslint.config.js"] },
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommendedTypeChecked,
|
||||
reactHooks.configs.flat.recommended,
|
||||
{
|
||||
files: ["**/*.{ts,tsx}"],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2023,
|
||||
globals: globals.browser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
"max-lines": ["error", { "max": 350, "skipBlankLines": true, "skipComments": true }],
|
||||
"max-lines-per-function": ["error", { "max": 100, "skipBlankLines": true, "skipComments": true }],
|
||||
"@typescript-eslint/consistent-type-imports": "error",
|
||||
"@typescript-eslint/no-floating-promises": "error"
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ["**/*.test.{ts,tsx}"],
|
||||
languageOptions: { globals: globals.node }
|
||||
}
|
||||
);
|
||||
15
web/index.html
Normal file
15
web/index.html
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="theme-color" content="#14213d" />
|
||||
<meta name="description" content="Private self-hosted Drive v2" />
|
||||
<title>Drive v2</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
3286
web/package-lock.json
generated
Normal file
3286
web/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
37
web/package.json
Normal file
37
web/package.json
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"name": "drive-v2-web",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=24 <25"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "eslint . --max-warnings 0",
|
||||
"typecheck": "tsc -b --pretty false",
|
||||
"test": "vitest run",
|
||||
"check": "npm run lint && npm run typecheck && npm run test"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tanstack/react-query": "5.101.2",
|
||||
"@tanstack/react-router": "1.170.18",
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "10.0.1",
|
||||
"@types/node": "26.1.1",
|
||||
"@types/react": "19.2.17",
|
||||
"@types/react-dom": "19.2.3",
|
||||
"@vitejs/plugin-react": "6.0.3",
|
||||
"eslint": "10.7.0",
|
||||
"eslint-plugin-react-hooks": "7.1.1",
|
||||
"globals": "17.7.0",
|
||||
"typescript": "6.0.3",
|
||||
"typescript-eslint": "8.64.0",
|
||||
"vite": "8.1.0",
|
||||
"vitest": "4.1.10"
|
||||
}
|
||||
}
|
||||
36
web/src/app/App.tsx
Normal file
36
web/src/app/App.tsx
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getSetupStatus } from "../features/setup/api/getSetupStatus";
|
||||
|
||||
export function App() {
|
||||
const status = useQuery({
|
||||
queryKey: ["setup-status"],
|
||||
queryFn: getSetupStatus
|
||||
});
|
||||
|
||||
return (
|
||||
<main className="foundation-shell">
|
||||
<section className="foundation-card" aria-labelledby="foundation-title">
|
||||
<p className="eyebrow">Foundation phase</p>
|
||||
<h1 id="foundation-title">Drive v2</h1>
|
||||
<p className="summary">
|
||||
The repository, contracts, architecture boundaries, and deployment shell are ready for product development.
|
||||
</p>
|
||||
<dl className="status-list">
|
||||
<div>
|
||||
<dt>API</dt>
|
||||
<dd>{status.isPending ? "Checking…" : status.isError ? "Unavailable" : "Connected"}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Owner setup</dt>
|
||||
<dd>{status.data?.initialized === true ? "Complete" : "Begins in Phase 1"}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Build</dt>
|
||||
<dd>{status.data?.version ?? "development"}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</section>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
11
web/src/features/setup/api/getSetupStatus.test.ts
Normal file
11
web/src/features/setup/api/getSetupStatus.test.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import type { SetupStatus } from "./getSetupStatus";
|
||||
|
||||
describe("SetupStatus", () => {
|
||||
it("represents the foundation state", () => {
|
||||
const status: SetupStatus = { initialized: false, phase: "foundation", version: "test" };
|
||||
expect(status.phase).toBe("foundation");
|
||||
expect(status.initialized).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
17
web/src/features/setup/api/getSetupStatus.ts
Normal file
17
web/src/features/setup/api/getSetupStatus.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
export interface SetupStatus {
|
||||
initialized: boolean;
|
||||
phase: string;
|
||||
version: string;
|
||||
}
|
||||
|
||||
export async function getSetupStatus(): Promise<SetupStatus> {
|
||||
const response = await fetch("/api/v1/setup/status", {
|
||||
headers: { Accept: "application/json" },
|
||||
credentials: "same-origin"
|
||||
});
|
||||
if (!response.ok) {
|
||||
throw new Error(`Setup status failed with ${response.status.toString()}`);
|
||||
}
|
||||
return (await response.json()) as SetupStatus;
|
||||
}
|
||||
|
||||
28
web/src/main.tsx
Normal file
28
web/src/main.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { App } from "./app/App";
|
||||
import "./shared/styles/base.css";
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 30_000,
|
||||
retry: 1
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const root = document.getElementById("root");
|
||||
if (root === null) {
|
||||
throw new Error("Drive root element is missing");
|
||||
}
|
||||
|
||||
createRoot(root).render(
|
||||
<StrictMode>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<App />
|
||||
</QueryClientProvider>
|
||||
</StrictMode>
|
||||
);
|
||||
|
||||
123
web/src/shared/styles/base.css
Normal file
123
web/src/shared/styles/base.css
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
:root {
|
||||
color-scheme: light dark;
|
||||
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
color: #162033;
|
||||
background: #edf2f7;
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.foundation-shell {
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
padding: 2rem;
|
||||
background:
|
||||
radial-gradient(circle at 15% 15%, rgb(75 114 170 / 24%), transparent 32rem),
|
||||
linear-gradient(145deg, #edf2f7, #dfe8f2);
|
||||
}
|
||||
|
||||
.foundation-card {
|
||||
width: min(42rem, 100%);
|
||||
padding: clamp(2rem, 6vw, 4rem);
|
||||
border: 1px solid rgb(20 33 61 / 12%);
|
||||
border-radius: 1.5rem;
|
||||
background: rgb(255 255 255 / 88%);
|
||||
box-shadow: 0 1.5rem 4rem rgb(20 33 61 / 14%);
|
||||
backdrop-filter: blur(1rem);
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 0.5rem;
|
||||
color: #426da9;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 750;
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
color: #14213d;
|
||||
font-size: clamp(2.5rem, 8vw, 5rem);
|
||||
line-height: 1;
|
||||
letter-spacing: -0.06em;
|
||||
}
|
||||
|
||||
.summary {
|
||||
max-width: 34rem;
|
||||
margin: 1.5rem 0 2.5rem;
|
||||
color: #52627a;
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
.status-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 1rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.status-list div {
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid rgb(20 33 61 / 14%);
|
||||
}
|
||||
|
||||
.status-list dt {
|
||||
color: #718096;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.status-list dd {
|
||||
margin: 0.4rem 0 0;
|
||||
color: #14213d;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
@media (max-width: 36rem) {
|
||||
.status-list {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
color: #e6edf7;
|
||||
background: #0d1525;
|
||||
}
|
||||
|
||||
.foundation-shell {
|
||||
background:
|
||||
radial-gradient(circle at 15% 15%, rgb(66 109 169 / 32%), transparent 30rem),
|
||||
linear-gradient(145deg, #111b2e, #080d17);
|
||||
}
|
||||
|
||||
.foundation-card {
|
||||
border-color: rgb(255 255 255 / 10%);
|
||||
background: rgb(18 29 49 / 86%);
|
||||
}
|
||||
|
||||
h1,
|
||||
.status-list dd {
|
||||
color: #f4f7fb;
|
||||
}
|
||||
|
||||
.summary {
|
||||
color: #adbbcf;
|
||||
}
|
||||
}
|
||||
|
||||
2
web/src/vite-env.d.ts
vendored
Normal file
2
web/src/vite-env.d.ts
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/// <reference types="vite/client" />
|
||||
|
||||
28
web/tsconfig.app.json
Normal file
28
web/tsconfig.app.json
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitOverride": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
8
web/tsconfig.json
Normal file
8
web/tsconfig.json
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"files": [],
|
||||
"references": [
|
||||
{ "path": "./tsconfig.app.json" },
|
||||
{ "path": "./tsconfig.node.json" }
|
||||
]
|
||||
}
|
||||
|
||||
17
web/tsconfig.node.json
Normal file
17
web/tsconfig.node.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
||||
"target": "ES2023",
|
||||
"lib": ["ES2023"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "Bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"strict": true
|
||||
},
|
||||
"include": ["vite.config.ts", "eslint.config.js"]
|
||||
}
|
||||
|
||||
17
web/vite.config.ts
Normal file
17
web/vite.config.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
port: 5173,
|
||||
proxy: {
|
||||
"/api": "http://localhost:8080",
|
||||
"/health": "http://localhost:8080"
|
||||
}
|
||||
},
|
||||
build: {
|
||||
sourcemap: true
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue