diff --git a/.env.development b/.env.development new file mode 100644 index 000000000..d91b6949e --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +VITE_API_BASE_URL=/api \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 000000000..1d5921898 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +VITE_API_BASE_URL=https://dummyjson.com + diff --git a/package.json b/package.json index e014c5272..46af5b7c7 100644 --- a/package.json +++ b/package.json @@ -5,15 +5,20 @@ "type": "module", "scripts": { "dev": "vite", - "build": "tsc -b && vite build", "lint": "eslint .", - "preview": "vite preview", "test": "vitest", - "coverage": "vitest run --coverage" + "coverage": "vitest run --coverage", + "build": "vite build", + "preview": "vite preview", + "predeploy": "pnpm run build", + "deploy": "npx gh-pages -d dist", + "postbuild": "cp dist/index.html dist/404.html" }, "dependencies": { + "@tanstack/react-query": "^5.85.0", "react": "^19.1.1", - "react-dom": "^19.1.1" + "react-dom": "^19.1.1", + "zustand": "^5.0.7" }, "devDependencies": { "@eslint/js": "^9.33.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6b2a40d18..1374df5d0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,18 @@ importers: .: dependencies: + '@tanstack/react-query': + specifier: ^5.85.0 + version: 5.85.0(react@19.1.1) react: specifier: ^19.1.1 version: 19.1.1 react-dom: specifier: ^19.1.1 version: 19.1.1(react@19.1.1) + zustand: + specifier: ^5.0.7 + version: 5.0.7(@types/react@19.1.9)(react@19.1.1) devDependencies: '@eslint/js': specifier: ^9.33.0 @@ -103,10 +109,6 @@ packages: '@asamuzakjp/css-color@2.8.3': resolution: {integrity: sha512-GIc76d9UI1hCvOATjZPyHFmE5qhRccp3/zGfMPapK3jBi+yocEzp6BBB0UnfRYP9NP4FANqUZYb0hnfs3TM3hw==} - '@babel/code-frame@7.26.2': - resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} - engines: {node: '>=6.9.0'} - '@babel/code-frame@7.27.1': resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} engines: {node: '>=6.9.0'} @@ -930,6 +932,14 @@ packages: cpu: [x64] os: [win32] + '@tanstack/query-core@5.83.1': + resolution: {integrity: sha512-OG69LQgT7jSp+5pPuCfzltq/+7l2xoweggjme9vlbCPa/d7D7zaqv5vN/S82SzSYZ4EDLTxNO1PWrv49RAS64Q==} + + '@tanstack/react-query@5.85.0': + resolution: {integrity: sha512-t1HMfToVMGfwEJRya6GG7gbK0luZJd+9IySFNePL1BforU1F3LqQ3tBC2Rpvr88bOrlU6PXyMLgJD0Yzn4ztUw==} + peerDependencies: + react: ^18 || ^19 + '@testing-library/dom@10.4.0': resolution: {integrity: sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==} engines: {node: '>=18'} @@ -2345,6 +2355,24 @@ packages: resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==} engines: {node: '>=18'} + zustand@5.0.7: + resolution: {integrity: sha512-Ot6uqHDW/O2VdYsKLLU8GQu8sCOM1LcoE8RwvLv9uuRT9s6SOHCKs0ZEOhxg+I1Ld+A1Q5lwx+UlKXXUoCZITg==} + engines: {node: '>=12.20.0'} + peerDependencies: + '@types/react': '>=18.0.0' + immer: '>=9.0.6' + react: '>=18.0.0' + use-sync-external-store: '>=1.2.0' + peerDependenciesMeta: + '@types/react': + optional: true + immer: + optional: true + react: + optional: true + use-sync-external-store: + optional: true + snapshots: '@adobe/css-tools@4.4.0': {} @@ -2362,12 +2390,6 @@ snapshots: '@csstools/css-tokenizer': 3.0.3 lru-cache: 10.4.3 - '@babel/code-frame@7.26.2': - dependencies: - '@babel/helper-validator-identifier': 7.25.9 - js-tokens: 4.0.0 - picocolors: 1.1.1 - '@babel/code-frame@7.27.1': dependencies: '@babel/helper-validator-identifier': 7.27.1 @@ -3081,9 +3103,16 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.46.2': optional: true + '@tanstack/query-core@5.83.1': {} + + '@tanstack/react-query@5.85.0(react@19.1.1)': + dependencies: + '@tanstack/query-core': 5.83.1 + react: 19.1.1 + '@testing-library/dom@10.4.0': dependencies: - '@babel/code-frame': 7.26.2 + '@babel/code-frame': 7.27.1 '@babel/runtime': 7.26.0 '@types/aria-query': 5.0.4 aria-query: 5.3.0 @@ -3347,7 +3376,7 @@ snapshots: '@vitest/utils@2.1.3': dependencies: '@vitest/pretty-format': 2.1.3 - loupe: 3.1.3 + loupe: 3.2.0 tinyrainbow: 1.2.0 '@vitest/utils@3.2.4': @@ -4473,3 +4502,8 @@ snapshots: yocto-queue@0.1.0: {} yoctocolors-cjs@2.1.2: {} + + zustand@5.0.7(@types/react@19.1.9)(react@19.1.1): + optionalDependencies: + '@types/react': 19.1.9 + react: 19.1.1 diff --git a/src/components/index.tsx b/src/components/index.tsx deleted file mode 100644 index 8495817d3..000000000 --- a/src/components/index.tsx +++ /dev/null @@ -1,214 +0,0 @@ -import * as React from "react" -import { forwardRef } from "react" -import * as SelectPrimitive from "@radix-ui/react-select" -import * as DialogPrimitive from "@radix-ui/react-dialog" -import { Check, ChevronDown, X } from "lucide-react" -import { cva, VariantProps } from "class-variance-authority" - -const buttonVariants = cva( - "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background", - { - variants: { - variant: { - default: "bg-blue-500 text-white hover:bg-blue-600", - destructive: "bg-red-500 text-white hover:bg-red-600", - outline: "border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-100", - secondary: "bg-gray-200 text-gray-800 hover:bg-gray-300", - ghost: "bg-transparent text-gray-700 hover:bg-gray-100", - link: "underline-offset-4 hover:underline text-blue-500", - }, - size: { - default: "h-10 py-2 px-4", - sm: "h-8 px-3 rounded-md text-xs", - lg: "h-11 px-8 rounded-md", - icon: "h-9 w-9", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - }, -) - -interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { - className?: string -} - -export const Button = forwardRef(({ className, variant, size, ...props }, ref) => { - return