diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a3ecb4..0e93597 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,23 +9,23 @@ on: jobs: test: runs-on: ubuntu-latest - + strategy: matrix: node-version: [20, 22] - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: '1.2.20' - + - name: Verify Bun installation run: bun --version - + - name: Cache dependencies uses: actions/cache@v4 with: @@ -35,25 +35,25 @@ jobs: key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} restore-keys: | ${{ runner.os }}-bun- - + - name: Install dependencies run: bun install --frozen-lockfile - + - name: Run linting run: bun run lint - + - name: Run type checking run: bun run check - + - name: Run unit tests run: bun run test:unit --run - + - name: Install Playwright browsers run: bunx playwright install --with-deps - + - name: Run E2E tests run: bun run test:e2e - + - name: Upload test results uses: actions/upload-artifact@v4 if: failure() @@ -63,23 +63,23 @@ jobs: test-results/ playwright-report/ retention-days: 30 - + build: runs-on: ubuntu-latest needs: test - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: '1.2.20' - + - name: Verify Bun installation run: bun --version - + - name: Cache dependencies uses: actions/cache@v4 with: @@ -89,46 +89,46 @@ jobs: key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} restore-keys: | ${{ runner.os }}-bun- - + - name: Install dependencies run: bun install --frozen-lockfile - + - name: Build application run: bun run build - + - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: build-files path: build/ retention-days: 7 - + security: runs-on: ubuntu-latest - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: '1.2.20' - + - name: Verify Bun installation run: bun --version - + - name: Install dependencies run: bun install --frozen-lockfile - + - name: Run security audit run: bun audit continue-on-error: true - + - name: Run CodeQL Analysis uses: github/codeql-action/init@v3 with: languages: javascript - + - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 \ No newline at end of file + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5f73719..e40c8ed 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,28 +8,28 @@ on: jobs: build-and-deploy: runs-on: ubuntu-latest - + permissions: contents: read pages: write id-token: write - + environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: '1.2.20' - + - name: Verify Bun installation run: bun --version - + - name: Cache dependencies uses: actions/cache@v4 with: @@ -39,21 +39,21 @@ jobs: key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }} restore-keys: | ${{ runner.os }}-bun- - + - name: Install dependencies run: bun install --frozen-lockfile - + - name: Build application run: bun run build - + - name: Setup Pages uses: actions/configure-pages@v5 - + - name: Upload to GitHub Pages uses: actions/upload-pages-artifact@v3 with: path: build/ - + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 @@ -61,21 +61,21 @@ jobs: docker-build: runs-on: ubuntu-latest if: github.event_name == 'push' && github.ref == 'refs/heads/master' - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - + - name: Log in to Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Extract metadata id: meta uses: docker/metadata-action@v5 @@ -86,7 +86,7 @@ jobs: type=ref,event=pr type=sha type=raw,value=latest,enable={{is_default_branch}} - + - name: Build and push Docker image uses: docker/build-push-action@v6 with: @@ -96,4 +96,4 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + cache-to: type=gha,mode=max diff --git a/.github/workflows/gitea-ci.yml b/.github/workflows/gitea-ci.yml index e20e623..9d3db61 100644 --- a/.github/workflows/gitea-ci.yml +++ b/.github/workflows/gitea-ci.yml @@ -9,34 +9,34 @@ on: jobs: test: runs-on: ubuntu-latest - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: '1.2.20' - + - name: Verify Bun installation run: bun --version - + - name: Install dependencies run: bun install --frozen-lockfile - + - name: Run linting run: bun run lint - + - name: Run type checking run: bun run check - + - name: Run unit tests run: bun run test:unit --run - + - name: Install Playwright browsers run: bunx playwright install --with-deps - + - name: Run E2E tests run: bun run test:e2e @@ -44,21 +44,21 @@ jobs: runs-on: ubuntu-latest needs: test if: github.ref == 'refs/heads/master' - + steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - + - name: Log in to Container Registry uses: docker/login-action@v2 with: registry: ${{ vars.DOCKER_REGISTRY }} username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - + - name: Build and push Docker image uses: docker/build-push-action@v4 with: @@ -69,4 +69,4 @@ jobs: ${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_REPOSITORY }}:latest ${{ vars.DOCKER_REGISTRY }}/${{ vars.DOCKER_REPOSITORY }}:${{ github.sha }} cache-from: type=gha - cache-to: type=gha,mode=max \ No newline at end of file + cache-to: type=gha,mode=max diff --git a/README.md b/README.md index 51a8861..e2cf4c7 100644 --- a/README.md +++ b/README.md @@ -94,17 +94,18 @@ The static adapter is configured in `svelte.config.js`. Modify settings as neede ```js adapter: adapter({ - pages: 'build', // Output directory - assets: 'build', // Assets directory - fallback: undefined, // SPA fallback page - precompress: false, // Enable gzip/brotli - strict: true // Strict prerendering -}) + pages: 'build', // Output directory + assets: 'build', // Assets directory + fallback: undefined, // SPA fallback page + precompress: false, // Enable gzip/brotli + strict: true // Strict prerendering +}); ``` ### Nginx Production nginx configuration in `nginx.conf` includes: + - Gzip compression - Static asset caching - Security headers diff --git a/docker-compose.yml b/docker-compose.yml index ca3352c..e722133 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,10 @@ services: app: build: . ports: - - "3000:80" + - '3000:80' restart: unless-stopped container_name: svelte-static-app - + # Optional: Add a development service dev: build: @@ -13,11 +13,11 @@ services: target: builder command: npm run dev -- --host 0.0.0.0 ports: - - "5173:5173" + - '5173:5173' volumes: - .:/app - /app/node_modules environment: - NODE_ENV=development profiles: - - dev \ No newline at end of file + - dev diff --git a/src/app.css b/src/app.css index ac256d3..83a890d 100644 --- a/src/app.css +++ b/src/app.css @@ -1,121 +1,121 @@ -@import "tailwindcss"; +@import 'tailwindcss'; -@import "tw-animate-css"; +@import 'tw-animate-css'; @custom-variant dark (&:is(.dark *)); :root { - --radius: 0.625rem; - --background: oklch(1 0 0); - --foreground: oklch(0.145 0 0); - --card: oklch(1 0 0); - --card-foreground: oklch(0.145 0 0); - --popover: oklch(1 0 0); - --popover-foreground: oklch(0.145 0 0); - --primary: oklch(0.205 0 0); - --primary-foreground: oklch(0.985 0 0); - --secondary: oklch(0.97 0 0); - --secondary-foreground: oklch(0.205 0 0); - --muted: oklch(0.97 0 0); - --muted-foreground: oklch(0.556 0 0); - --accent: oklch(0.97 0 0); - --accent-foreground: oklch(0.205 0 0); - --destructive: oklch(0.577 0.245 27.325); - --border: oklch(0.922 0 0); - --input: oklch(0.922 0 0); - --ring: oklch(0.708 0 0); - --chart-1: oklch(0.646 0.222 41.116); - --chart-2: oklch(0.6 0.118 184.704); - --chart-3: oklch(0.398 0.07 227.392); - --chart-4: oklch(0.828 0.189 84.429); - --chart-5: oklch(0.769 0.188 70.08); - --sidebar: oklch(0.985 0 0); - --sidebar-foreground: oklch(0.145 0 0); - --sidebar-primary: oklch(0.205 0 0); - --sidebar-primary-foreground: oklch(0.985 0 0); - --sidebar-accent: oklch(0.97 0 0); - --sidebar-accent-foreground: oklch(0.205 0 0); - --sidebar-border: oklch(0.922 0 0); - --sidebar-ring: oklch(0.708 0 0); + --radius: 0.625rem; + --background: oklch(1 0 0); + --foreground: oklch(0.145 0 0); + --card: oklch(1 0 0); + --card-foreground: oklch(0.145 0 0); + --popover: oklch(1 0 0); + --popover-foreground: oklch(0.145 0 0); + --primary: oklch(0.205 0 0); + --primary-foreground: oklch(0.985 0 0); + --secondary: oklch(0.97 0 0); + --secondary-foreground: oklch(0.205 0 0); + --muted: oklch(0.97 0 0); + --muted-foreground: oklch(0.556 0 0); + --accent: oklch(0.97 0 0); + --accent-foreground: oklch(0.205 0 0); + --destructive: oklch(0.577 0.245 27.325); + --border: oklch(0.922 0 0); + --input: oklch(0.922 0 0); + --ring: oklch(0.708 0 0); + --chart-1: oklch(0.646 0.222 41.116); + --chart-2: oklch(0.6 0.118 184.704); + --chart-3: oklch(0.398 0.07 227.392); + --chart-4: oklch(0.828 0.189 84.429); + --chart-5: oklch(0.769 0.188 70.08); + --sidebar: oklch(0.985 0 0); + --sidebar-foreground: oklch(0.145 0 0); + --sidebar-primary: oklch(0.205 0 0); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.97 0 0); + --sidebar-accent-foreground: oklch(0.205 0 0); + --sidebar-border: oklch(0.922 0 0); + --sidebar-ring: oklch(0.708 0 0); } .dark { - --background: oklch(0.145 0 0); - --foreground: oklch(0.985 0 0); - --card: oklch(0.205 0 0); - --card-foreground: oklch(0.985 0 0); - --popover: oklch(0.205 0 0); - --popover-foreground: oklch(0.985 0 0); - --primary: oklch(0.922 0 0); - --primary-foreground: oklch(0.205 0 0); - --secondary: oklch(0.269 0 0); - --secondary-foreground: oklch(0.985 0 0); - --muted: oklch(0.269 0 0); - --muted-foreground: oklch(0.708 0 0); - --accent: oklch(0.269 0 0); - --accent-foreground: oklch(0.985 0 0); - --destructive: oklch(0.704 0.191 22.216); - --border: oklch(1 0 0 / 10%); - --input: oklch(1 0 0 / 15%); - --ring: oklch(0.556 0 0); - --chart-1: oklch(0.488 0.243 264.376); - --chart-2: oklch(0.696 0.17 162.48); - --chart-3: oklch(0.769 0.188 70.08); - --chart-4: oklch(0.627 0.265 303.9); - --chart-5: oklch(0.645 0.246 16.439); - --sidebar: oklch(0.205 0 0); - --sidebar-foreground: oklch(0.985 0 0); - --sidebar-primary: oklch(0.488 0.243 264.376); - --sidebar-primary-foreground: oklch(0.985 0 0); - --sidebar-accent: oklch(0.269 0 0); - --sidebar-accent-foreground: oklch(0.985 0 0); - --sidebar-border: oklch(1 0 0 / 10%); - --sidebar-ring: oklch(0.556 0 0); + --background: oklch(0.145 0 0); + --foreground: oklch(0.985 0 0); + --card: oklch(0.205 0 0); + --card-foreground: oklch(0.985 0 0); + --popover: oklch(0.205 0 0); + --popover-foreground: oklch(0.985 0 0); + --primary: oklch(0.922 0 0); + --primary-foreground: oklch(0.205 0 0); + --secondary: oklch(0.269 0 0); + --secondary-foreground: oklch(0.985 0 0); + --muted: oklch(0.269 0 0); + --muted-foreground: oklch(0.708 0 0); + --accent: oklch(0.269 0 0); + --accent-foreground: oklch(0.985 0 0); + --destructive: oklch(0.704 0.191 22.216); + --border: oklch(1 0 0 / 10%); + --input: oklch(1 0 0 / 15%); + --ring: oklch(0.556 0 0); + --chart-1: oklch(0.488 0.243 264.376); + --chart-2: oklch(0.696 0.17 162.48); + --chart-3: oklch(0.769 0.188 70.08); + --chart-4: oklch(0.627 0.265 303.9); + --chart-5: oklch(0.645 0.246 16.439); + --sidebar: oklch(0.205 0 0); + --sidebar-foreground: oklch(0.985 0 0); + --sidebar-primary: oklch(0.488 0.243 264.376); + --sidebar-primary-foreground: oklch(0.985 0 0); + --sidebar-accent: oklch(0.269 0 0); + --sidebar-accent-foreground: oklch(0.985 0 0); + --sidebar-border: oklch(1 0 0 / 10%); + --sidebar-ring: oklch(0.556 0 0); } @theme inline { - --radius-sm: calc(var(--radius) - 4px); - --radius-md: calc(var(--radius) - 2px); - --radius-lg: var(--radius); - --radius-xl: calc(var(--radius) + 4px); - --color-background: var(--background); - --color-foreground: var(--foreground); - --color-card: var(--card); - --color-card-foreground: var(--card-foreground); - --color-popover: var(--popover); - --color-popover-foreground: var(--popover-foreground); - --color-primary: var(--primary); - --color-primary-foreground: var(--primary-foreground); - --color-secondary: var(--secondary); - --color-secondary-foreground: var(--secondary-foreground); - --color-muted: var(--muted); - --color-muted-foreground: var(--muted-foreground); - --color-accent: var(--accent); - --color-accent-foreground: var(--accent-foreground); - --color-destructive: var(--destructive); - --color-border: var(--border); - --color-input: var(--input); - --color-ring: var(--ring); - --color-chart-1: var(--chart-1); - --color-chart-2: var(--chart-2); - --color-chart-3: var(--chart-3); - --color-chart-4: var(--chart-4); - --color-chart-5: var(--chart-5); - --color-sidebar: var(--sidebar); - --color-sidebar-foreground: var(--sidebar-foreground); - --color-sidebar-primary: var(--sidebar-primary); - --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); - --color-sidebar-accent: var(--sidebar-accent); - --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); - --color-sidebar-border: var(--sidebar-border); - --color-sidebar-ring: var(--sidebar-ring); + --radius-sm: calc(var(--radius) - 4px); + --radius-md: calc(var(--radius) - 2px); + --radius-lg: var(--radius); + --radius-xl: calc(var(--radius) + 4px); + --color-background: var(--background); + --color-foreground: var(--foreground); + --color-card: var(--card); + --color-card-foreground: var(--card-foreground); + --color-popover: var(--popover); + --color-popover-foreground: var(--popover-foreground); + --color-primary: var(--primary); + --color-primary-foreground: var(--primary-foreground); + --color-secondary: var(--secondary); + --color-secondary-foreground: var(--secondary-foreground); + --color-muted: var(--muted); + --color-muted-foreground: var(--muted-foreground); + --color-accent: var(--accent); + --color-accent-foreground: var(--accent-foreground); + --color-destructive: var(--destructive); + --color-border: var(--border); + --color-input: var(--input); + --color-ring: var(--ring); + --color-chart-1: var(--chart-1); + --color-chart-2: var(--chart-2); + --color-chart-3: var(--chart-3); + --color-chart-4: var(--chart-4); + --color-chart-5: var(--chart-5); + --color-sidebar: var(--sidebar); + --color-sidebar-foreground: var(--sidebar-foreground); + --color-sidebar-primary: var(--sidebar-primary); + --color-sidebar-primary-foreground: var(--sidebar-primary-foreground); + --color-sidebar-accent: var(--sidebar-accent); + --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); + --color-sidebar-border: var(--sidebar-border); + --color-sidebar-ring: var(--sidebar-ring); } @layer base { - * { - @apply border-border outline-ring/50; - } - body { - @apply bg-background text-foreground; - } -} \ No newline at end of file + * { + @apply border-border outline-ring/50; + } + body { + @apply bg-background text-foreground; + } +} diff --git a/src/lib/components/ui/button/button.svelte b/src/lib/components/ui/button/button.svelte index 4daf453..16f1a3c 100644 --- a/src/lib/components/ui/button/button.svelte +++ b/src/lib/components/ui/button/button.svelte @@ -1,36 +1,36 @@ -
This template includes:
-Ready-to-use components:
@@ -46,7 +50,9 @@- Visit svelte.dev/docs/kit + Visit svelte.dev/docs/kit to read the documentation