diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 7db0fea..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Deploy to GitHub Pages - -on: - push: - branches: [main] - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: pages - cancel-in-progress: false - -jobs: - build: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 24 - cache: npm - - - run: npm ci - - - name: Build - run: npm run build - - - uses: actions/upload-pages-artifact@v3 - with: - path: web/dist - - deploy: - needs: build - runs-on: ubuntu-24.04 - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - id: deployment - uses: actions/deploy-pages@v4 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a3ab825 --- /dev/null +++ b/LICENSE @@ -0,0 +1,29 @@ +MIT License + +Copyright (c) 2025 Hasnae R. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## Acknowledgements + +The "2048 Time Rush" game included in this project is inspired by the original +2048 game created by Gabriele Cirulli (https://github.com/gabrielecirulli/2048), +which is licensed under the MIT License. diff --git a/package.json b/package.json index 3aaa16d..bc20a51 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@labset/vibe-coded", "version": "1.0.0", "description": "", - "license": "Apache-2.0", + "license": "MIT", "author": "Hasnae R.", "workspaces": [ "web/" diff --git a/web/eslint.config.js b/web/eslint.config.js index c4c538c..f8a7a90 100644 --- a/web/eslint.config.js +++ b/web/eslint.config.js @@ -26,4 +26,10 @@ export default defineConfig([ ], }, }, + { + files: ["src/routes/**/*.{ts,tsx}"], + rules: { + "react-refresh/only-export-components": "off", + }, + }, ]); diff --git a/web/src/components/theme-context.ts b/web/src/components/theme-context.ts new file mode 100644 index 0000000..09d2271 --- /dev/null +++ b/web/src/components/theme-context.ts @@ -0,0 +1,11 @@ +import { createContext } from "react"; +import type { ColorTheme, Mode } from "./theme-provider"; + +interface ThemeContextValue { + colorTheme: ColorTheme; + mode: Mode; + setColorTheme: (theme: ColorTheme) => void; + setMode: (mode: Mode) => void; +} + +export const ThemeContext = createContext(null); diff --git a/web/src/components/theme-provider.tsx b/web/src/components/theme-provider.tsx index 67deccb..b074092 100644 --- a/web/src/components/theme-provider.tsx +++ b/web/src/components/theme-provider.tsx @@ -1,23 +1,9 @@ -import { - createContext, - useCallback, - useContext, - useEffect, - useState, -} from "react"; +import { useCallback, useEffect, useState } from "react"; +import { ThemeContext } from "./theme-context"; export type ColorTheme = "burgundy" | "sage" | "ocean" | "amethyst"; export type Mode = "light" | "dark" | "system"; -interface ThemeContextValue { - colorTheme: ColorTheme; - mode: Mode; - setColorTheme: (theme: ColorTheme) => void; - setMode: (mode: Mode) => void; -} - -const ThemeContext = createContext(null); - const THEME_KEY = "game-gallery-theme"; const MODE_KEY = "game-gallery-mode"; @@ -64,9 +50,3 @@ export function ThemeProvider({ children }: { children: React.ReactNode }) { ); } - -export function useTheme() { - const ctx = useContext(ThemeContext); - if (!ctx) throw new Error("useTheme must be used within ThemeProvider"); - return ctx; -} diff --git a/web/src/components/theme-switcher.tsx b/web/src/components/theme-switcher.tsx index 8910c00..5098259 100644 --- a/web/src/components/theme-switcher.tsx +++ b/web/src/components/theme-switcher.tsx @@ -1,10 +1,7 @@ import { Sun, Moon, Monitor } from "lucide-react"; import { Button } from "@/components/ui/button"; -import { - useTheme, - type ColorTheme, - type Mode, -} from "@/components/theme-provider"; +import { useTheme } from "@/components/use-theme"; +import type { ColorTheme, Mode } from "@/components/theme-provider"; const colorThemes: { value: ColorTheme; label: string; swatch: string }[] = [ { value: "burgundy", label: "Burgundy", swatch: "oklch(.37 .14 15)" }, diff --git a/web/src/components/ui/badge.tsx b/web/src/components/ui/badge.tsx index a8cbbac..a6e893c 100644 --- a/web/src/components/ui/badge.tsx +++ b/web/src/components/ui/badge.tsx @@ -49,4 +49,4 @@ function Badge({ }); } -export { Badge, badgeVariants }; +export { Badge }; diff --git a/web/src/components/ui/button.tsx b/web/src/components/ui/button.tsx index 5ca5e0c..bb07685 100644 --- a/web/src/components/ui/button.tsx +++ b/web/src/components/ui/button.tsx @@ -55,4 +55,4 @@ function Button({ ); } -export { Button, buttonVariants }; +export { Button }; diff --git a/web/src/components/use-theme.ts b/web/src/components/use-theme.ts new file mode 100644 index 0000000..596ace8 --- /dev/null +++ b/web/src/components/use-theme.ts @@ -0,0 +1,8 @@ +import { useContext } from "react"; +import { ThemeContext } from "./theme-context"; + +export function useTheme() { + const ctx = useContext(ThemeContext); + if (!ctx) throw new Error("useTheme must be used within ThemeProvider"); + return ctx; +} diff --git a/web/src/main.tsx b/web/src/main.tsx index e3215fc..2d05ee9 100644 --- a/web/src/main.tsx +++ b/web/src/main.tsx @@ -5,7 +5,7 @@ import { ThemeProvider } from "@/components/theme-provider"; import { routeTree } from "./routeTree.gen"; import "./index.css"; -const router = createRouter({ routeTree, basepath: "/vibe-coded" }); +const router = createRouter({ routeTree }); declare module "@tanstack/react-router" { interface Register { diff --git a/web/vite.config.ts b/web/vite.config.ts index 6370867..8594c1b 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -20,7 +20,7 @@ function spaFallback(): Plugin { // https://vite.dev/config/ export default defineConfig({ - base: "/vibe-coded/", + base: "/", plugins: [ TanStackRouterVite({ target: "react" }), react(),