Add app-react component: web
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
jordan 2026-02-04 08:07:31 +00:00
parent 6069570da0
commit 104b79ed98
20 changed files with 378 additions and 1 deletions

View File

@ -35,6 +35,33 @@ steps:
event: push
# COMPONENT_STEPS_BELOW
# Woodpecker CI step for web React app
# Add this step to your .woodpecker.yml
build-web:
image: woodpeckerci/plugin-kaniko
settings:
registry: registry.threesix.ai
repo: css-fix-test-1770192445/web
tags:
- latest
- ${CI_COMMIT_SHA:0:8}
context: .
dockerfile: apps/web/Dockerfile
cache: true
skip-tls-verify: true
when:
branch: main
event: push
deploy-web:
image: bitnami/kubectl:latest
commands:
- kubectl set image deployment/css-fix-test-1770192445-web web=registry.threesix.ai/css-fix-test-1770192445/web:${CI_COMMIT_SHA:0:8} -n projects || echo "Deployment not found, skipping"
when:
branch: main
event: push
# Do not remove the marker above - component steps are inserted here
verify:

View File

@ -76,4 +76,7 @@ css-fix-test-1770192445/
## Components
<!-- Components will be listed here as they're added -->
| Component | Type | Path |
|-----------|------|------|
| **web** | React app | `apps/web/` |

View File

@ -1,2 +1,3 @@
# Local development processes
# Components will be added below as they're created
web: cd apps/web && npm run dev

18
apps/web/.eslintrc.cjs Normal file
View File

@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
};

34
apps/web/Dockerfile Normal file
View File

@ -0,0 +1,34 @@
# Build stage - using pnpm for workspace dependency resolution
FROM node:20-alpine AS build
# Install pnpm
RUN npm install -g pnpm
WORKDIR /workspace
# Copy workspace configuration files
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml* ./
# Copy shared packages (required for workspace:* dependencies)
COPY packages/ ./packages/
# Copy the app component
COPY apps/web/ ./apps/web/
# Install dependencies using pnpm (resolves workspace:* correctly)
RUN pnpm install --frozen-lockfile || pnpm install
# Build the app
WORKDIR /workspace/apps/web
RUN pnpm build
# Production stage
FROM nginx:alpine
# Copy built assets
COPY --from=build /workspace/apps/web/dist /usr/share/nginx/html
COPY apps/web/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3001
CMD ["nginx", "-g", "daemon off;"]

6
apps/web/component.yaml Normal file
View File

@ -0,0 +1,6 @@
name: web
type: app
port: 3001
path: apps/web
stack: react
dependencies: []

13
apps/web/index.html Normal file
View File

@ -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>web | css-fix-test-1770192445</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>

26
apps/web/nginx.conf Normal file
View File

@ -0,0 +1,26 @@
server {
listen 3001;
server_name localhost;
root /usr/share/nginx/html;
index index.html;
# Gzip compression
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
# Cache static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
# SPA fallback
location / {
try_files $uri $uri/ /index.html;
}
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
}

37
apps/web/package.json Normal file
View File

@ -0,0 +1,37 @@
{
"name": "web",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite --port 3001",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview --port 3001",
"format": "prettier --write src/"
},
"dependencies": {
"@css-fix-test-1770192445/logger": "workspace:*",
"@css-fix-test-1770192445/ui": "workspace:*",
"@css-fix-test-1770192445/layout": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router-dom": "^6.23.1"
},
"devDependencies": {
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@vitejs/plugin-react": "^4.3.1",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.7",
"postcss": "^8.4.38",
"prettier": "^3.3.2",
"tailwindcss": "^3.4.4",
"typescript": "^5.5.3",
"vite": "^5.4.1"
}
}

View File

@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};

1
apps/web/public/vite.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFBD4F"></stop><stop offset="100%" stop-color="#FF980E"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

113
apps/web/src/App.tsx Normal file
View File

@ -0,0 +1,113 @@
import { DashboardShell, Sidebar, Header, type NavItem } from '@css-fix-test-1770192445/layout';
import {
Button,
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
Badge,
Home,
Users,
Settings,
BarChart3,
} from '@css-fix-test-1770192445/ui';
const navItems: NavItem[] = [
{ label: 'Dashboard', href: '/', icon: Home, active: true },
{ label: 'Analytics', href: '/analytics', icon: BarChart3 },
{ label: 'Users', href: '/users', icon: Users, badge: '12' },
{ label: 'Settings', href: '/settings', icon: Settings },
];
function App() {
return (
<DashboardShell
sidebar={
<Sidebar
logo={
<span className="font-semibold text-lg">css-fix-test-1770192445</span>
}
items={navItems}
footer={
<div className="text-sm text-[var(--text-muted)]">
v0.0.1
</div>
}
/>
}
header={
<Header
title="Dashboard"
showSearch
searchPlaceholder="Search..."
/>
}
>
<div className="space-y-6">
{/* Welcome card */}
<Card>
<CardHeader>
<CardTitle>Welcome to web</CardTitle>
<CardDescription>
This is part of the{' '}
<code className="bg-[var(--surface-200)] px-1.5 py-0.5 rounded text-sm">
css-fix-test-1770192445
</code>{' '}
monorepo, using the shared UI library and layout components.
</CardDescription>
</CardHeader>
<CardContent>
<div className="flex gap-3">
<Button>Get Started</Button>
<Button variant="outline">Documentation</Button>
</div>
</CardContent>
</Card>
{/* Stats cards */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Card>
<CardHeader className="pb-2">
<CardDescription>Total Users</CardDescription>
<CardTitle className="text-3xl">1,234</CardTitle>
</CardHeader>
<CardContent>
<Badge variant="success">+12% from last month</Badge>
</CardContent>
</Card>
<Card>
<CardHeader className="pb-2">
<CardDescription>Active Sessions</CardDescription>
<CardTitle className="text-3xl">567</CardTitle>
</CardHeader>
<CardContent>
<Badge variant="info">Live</Badge>
</CardContent>
</Card>
<Card>
<CardHeader className="pb-2">
<CardDescription>API Requests</CardDescription>
<CardTitle className="text-3xl">89.2k</CardTitle>
</CardHeader>
<CardContent>
<Badge variant="warning">High traffic</Badge>
</CardContent>
</Card>
</div>
{/* Edit hint */}
<p className="text-sm text-[var(--text-muted)]">
Edit this file at{' '}
<code className="bg-[var(--surface-200)] px-1.5 py-0.5 rounded">
apps/web/src/App.tsx
</code>
</p>
</div>
</DashboardShell>
);
}
export default App;

6
apps/web/src/index.css Normal file
View File

@ -0,0 +1,6 @@
/* Import design system tokens */
@import '@css-fix-test-1770192445/ui/styles';
@tailwind base;
@tailwind components;
@tailwind utilities;

View File

@ -0,0 +1,11 @@
import { createLogger, installGlobalHandlers } from '@css-fix-test-1770192445/logger';
export const logger = createLogger({
level: import.meta.env.DEV ? 'debug' : 'info',
service: 'web',
// Set endpoint to send logs to your backend:
// endpoint: '/api/logs',
});
// Install global error handlers
installGlobalHandlers(logger);

11
apps/web/src/main.tsx Normal file
View File

@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App.tsx';
import './index.css';
import './lib/logger';
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);

1
apps/web/src/vite-env.d.ts vendored Normal file
View File

@ -0,0 +1 @@
/// <reference types="vite/client" />

View File

@ -0,0 +1,14 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
'./index.html',
'./src/**/*.{js,ts,jsx,tsx}',
// Include shared packages for Tailwind classes
'../../packages/ui/src/**/*.{js,ts,jsx,tsx}',
'../../packages/layout/src/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
},
plugins: [],
};

25
apps/web/tsconfig.json Normal file
View File

@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src"],
"references": [{ "path": "./tsconfig.node.json" }]
}

View File

@ -0,0 +1,11 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["vite.config.ts"]
}

13
apps/web/vite.config.ts Normal file
View File

@ -0,0 +1,13 @@
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
server: {
port: 3001,
},
preview: {
port: 3001,
},
});