diff --git a/next.config.js b/next.config.js index 9d477ea..830bde8 100644 --- a/next.config.js +++ b/next.config.js @@ -1,62 +1,12 @@ -/* eslint-env node */ /** @type {import('next').NextConfig} */ -const isGithubPages = process.env.GITHUB_PAGES === 'true' || process.env.GITHUB_ACTIONS === 'true' -const repoBasePath = process.env.NEXT_PUBLIC_BASE_PATH - || (isGithubPages && process.env.GITHUB_REPOSITORY - ? `/${process.env.GITHUB_REPOSITORY.split('/')[1]}` - : '') - const nextConfig = { - output: process.env.BUILD_STATIC || isGithubPages ? 'export' : 'standalone', - basePath: repoBasePath, - assetPrefix: repoBasePath || undefined, - images: { - unoptimized: true, + sassOptions: { + includePaths: ['./src/styles'], + additionalData: `@use "m3-scss/material" as mat;`, }, experimental: { - optimizePackageImports: ['@radix-ui/react-icons', '@phosphor-icons/react'], - turbopackScopeHoisting: false, + optimizePackageImports: ['@phosphor-icons/react'], }, - serverExternalPackages: ['pyodide'], - webpack: (config, { isServer, webpack }) => { - // Pyodide contains references to Node.js built-in modules that should be ignored in browser bundles - if (!isServer) { - // Replace node: protocol imports with empty modules - config.plugins.push( - new webpack.NormalModuleReplacementPlugin( - /^node:/, - (resource) => { - resource.request = resource.request.replace(/^node:/, ''); - } - ) - ); +} - // Set fallbacks for node modules to false (don't polyfill) - config.resolve.fallback = { - ...config.resolve.fallback, - fs: false, - child_process: false, - crypto: false, - path: false, - url: false, - vm: false, - }; - - // Exclude pyodide from server-side rendering completely - config.resolve.alias = { - ...config.resolve.alias, - pyodide: false, - }; - } - - // On server, also exclude pyodide - if (isServer) { - config.externals = config.externals || []; - config.externals.push('pyodide'); - } - - return config; - }, -}; - -export default nextConfig; +module.exports = nextConfig diff --git a/package.json b/package.json index dce8ed6..89151ca 100644 --- a/package.json +++ b/package.json @@ -1,92 +1,33 @@ { - "name": "spark-template", - "type": "module", - "private": true, - "version": "0.0.0", - "scripts": { - "dev": "next dev", - "build": "next build", - "start": "next start", - "lint": "eslint .", - "stylelint": "stylelint \"src/**/*.{scss,css}\"", - "kill": "fuser -k 5000/tcp", - "test:e2e": "playwright test" - }, - "dependencies": { - "@babel/standalone": "^7.28.6", - "@hookform/resolvers": "^4.1.3", - "@monaco-editor/react": "^4.7.0", - "@phosphor-icons/react": "^2.1.7", - "@radix-ui/colors": "^3.0.0", - "@radix-ui/react-accordion": "^1.2.3", - "@radix-ui/react-alert-dialog": "^1.1.6", - "@radix-ui/react-aspect-ratio": "^1.1.2", - "@radix-ui/react-avatar": "^1.1.3", - "@radix-ui/react-checkbox": "^1.1.4", - "@radix-ui/react-collapsible": "^1.1.3", - "@radix-ui/react-context-menu": "^2.2.6", - "@radix-ui/react-dialog": "^1.1.6", - "@radix-ui/react-dropdown-menu": "^2.1.6", - "@radix-ui/react-hover-card": "^1.1.6", - "@radix-ui/react-label": "^2.1.2", - "@radix-ui/react-menubar": "^1.1.6", - "@radix-ui/react-navigation-menu": "^1.2.5", - "@radix-ui/react-popover": "^1.1.6", - "@radix-ui/react-progress": "^1.1.2", - "@radix-ui/react-radio-group": "^1.2.3", - "@radix-ui/react-scroll-area": "^1.2.9", - "@radix-ui/react-select": "^2.1.6", - "@radix-ui/react-separator": "^1.1.2", - "@radix-ui/react-slider": "^1.3.6", - "@radix-ui/react-slot": "^1.1.2", - "@radix-ui/react-switch": "^1.1.3", - "@radix-ui/react-tabs": "^1.1.3", - "@radix-ui/react-toggle": "^1.1.2", - "@radix-ui/react-toggle-group": "^1.1.2", - "@radix-ui/react-tooltip": "^1.1.8", - "@reduxjs/toolkit": "^2.11.2", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "date-fns": "^3.6.0", - "embla-carousel-react": "^8.5.2", - "framer-motion": "^12.6.2", - "lucide-react": "^0.562.0", - "marked": "^15.0.7", - "next": "16.1.3", - "next-themes": "^0.4.6", - "pyodide": "^0.27.0", - "react": "^19.2.3", - "react-dom": "^19.2.3", - "react-error-boundary": "^6.0.0", - "react-hook-form": "^7.54.2", - "react-redux": "^9.2.0", - "react-resizable-panels": "^2.1.7", - "recharts": "^2.15.1", - "sass": "^1.97.2", - "sonner": "^2.0.1", - "uuid": "^11.1.0", - "zod": "^3.25.76" - }, - "devDependencies": { - "@eslint/js": "^9.21.0", - "@playwright/test": "^1.57.0", - "@types/node": "^25.0.9", - "@types/react": "^19.2.8", - "@types/react-dom": "^19.0.4", - "eslint": "^9.28.0", - "eslint-config-next": "^16.1.3", - "eslint-plugin-react-hooks": "^7.0.1", - "globals": "^16.0.0", - "stylelint": "^17.0.0", - "stylelint-config-standard-scss": "^17.0.0", - "stylelint-order": "^7.0.1", - "stylelint-scss": "^7.0.0", - "typescript": "~5.9.3", - "typescript-eslint": "^8.53.1" - }, - "workspaces": { - "packages": [ - "packages/*" - ] - } + "name": "codesnippet", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@monaco-editor/react": "^4.6.0", + "@phosphor-icons/react": "^2.1.7", + "@reduxjs/toolkit": "^2.5.0", + "dexie": "^4.0.10", + "framer-motion": "^11.15.0", + "monaco-editor": "^0.52.2", + "next": "15.1.3", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "react-redux": "^9.2.0", + "sonner": "^1.7.3" + }, + "devDependencies": { + "@types/node": "^20", + "@types/react": "^19", + "@types/react-dom": "^19", + "eslint": "^8", + "eslint-config-next": "15.1.3", + "sass": "^1.70.0", + "typescript": "^5" + } } diff --git a/postcss.config.mjs b/postcss.config.mjs new file mode 100644 index 0000000..b6dc034 --- /dev/null +++ b/postcss.config.mjs @@ -0,0 +1,5 @@ +export default { + plugins: { + autoprefixer: {}, + }, +} diff --git a/src/app/globals.css b/src/app/globals.css new file mode 100644 index 0000000..a9b2e8b --- /dev/null +++ b/src/app/globals.css @@ -0,0 +1,62 @@ +@import '../styles/theme.scss'; + +* { + box-sizing: border-box; + margin: 0; + padding: 0; +} + +html, +body { + height: 100%; + font-family: var(--mat-sys-body-large-font); + background-color: var(--mat-sys-background); + color: var(--mat-sys-on-background); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + color: var(--mat-sys-primary); + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +code { + font-family: 'JetBrains Mono', monospace; + background-color: var(--mat-sys-surface-variant); + padding: 0.125rem 0.25rem; + border-radius: 0.25rem; + font-size: 0.875em; +} + +pre { + font-family: 'JetBrains Mono', monospace; + background-color: var(--mat-sys-surface-variant); + padding: 1rem; + border-radius: 0.5rem; + overflow-x: auto; +} + +pre code { + background-color: transparent; + padding: 0; +} + +button { + font-family: inherit; +} + +input, +textarea, +select { + font-family: inherit; +} + +:focus-visible { + outline: 2px solid var(--mat-sys-primary); + outline-offset: 2px; +} diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9348095..c7e4683 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,29 +1,42 @@ -import type { Metadata } from 'next'; -import './globals.scss'; -import { Providers } from './providers'; +import type { Metadata } from 'next' +import { Inter, Bricolage_Grotesque, JetBrains_Mono } from 'next/font/google' +import '@/styles/theme.scss' +import '@/app/globals.css' +import { Providers } from '@/components/providers/Providers' + +const inter = Inter({ + subsets: ['latin'], + variable: '--font-inter', + display: 'swap', +}) + +const bricolage = Bricolage_Grotesque({ + subsets: ['latin'], + variable: '--font-bricolage', + display: 'swap', +}) + +const jetbrainsMono = JetBrains_Mono({ + subsets: ['latin'], + variable: '--font-jetbrains', + display: 'swap', +}) export const metadata: Metadata = { - title: 'CodeSnippet - Share & Run Code (Python, React & More)', - description: 'Save, organize, and share your code snippets with beautiful syntax highlighting and live execution', -}; + title: 'CodeSnippet - Material Design 3', + description: 'A modern code snippet manager built with Material Design 3', +} export default function RootLayout({ children, -}: Readonly<{ - children: React.ReactNode; -}>) { +}: { + children: React.ReactNode +}) { return ( - -
- - - - + -