feat(setup): initialize SvelteKit project with TypeScript template

This commit is contained in:
Ilia Mashkov
2025-12-26 14:26:37 +03:00
parent 42852a77e1
commit cd7c4ef9a3
23 changed files with 14124 additions and 93 deletions

View File

@@ -56,6 +56,9 @@ Create a modern, fast, and intuitive web application for comparing fonts side-by
| Styling | Tailwind CSS 4.x | Utility-first CSS framework |
| Component Library | Bits UI | Accessible Svelte components (Radix UI port) |
| Type Safety | TypeScript 5.x | Static type checking |
| Package Manager | Yarn | Fast, reliable dependency management |
| Linting | oxlint | Fast Rust-based linter |
| Formatting | dprint | Fast Rust-based code formatter |
| Hosting | Vercel | Edge deployment & preview environments |
### Project Goals
@@ -1351,7 +1354,7 @@ export * from './ui';
- [ ] Create SvelteKit project with TypeScript template
- [ ] Install and configure Tailwind CSS 4.x
- [ ] Install and set up Bits UI component library
- [ ] Configure Prettier and ESLint with Svelte plugin
- [ ] Configure oxlint and dprint for linting and formatting
- [ ] Set up Git repository and .gitignore
- [ ] **Environment Configuration**
@@ -2368,9 +2371,9 @@ useEffect(() => {
```json
{
"buildCommand": "npm run build",
"devCommand": "npm run dev",
"installCommand": "npm install",
"buildCommand": "yarn build",
"devCommand": "yarn dev",
"installCommand": "yarn install",
"framework": "sveltekit",
"regions": ["iad1"],
"headers": [
@@ -2481,28 +2484,28 @@ export default defineConfig({
```bash
# Install dependencies
npm install
yarn install
# Run development server
npm run dev
yarn dev
# Build for production
npm run build
yarn build
# Preview production build
npm run preview
yarn preview
# Run tests
npm test
yarn test
# Run linter
npm run lint
yarn lint
# Format code
npm run format
yarn format
# Type check
npm run check
yarn check
```
#### package.json Scripts
@@ -2518,8 +2521,9 @@ npm run check
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"lint": "oxlint",
"format": "dprint fmt",
"format:check": "dprint check",
"test": "playwright test",
"test:unit": "vitest"
},
@@ -2640,64 +2644,67 @@ npm run check
```bash
# Create new SvelteKit project
npm create svelte@latest glyphdiff
yarn create svelte@latest glyphdiff
# Select options:
# - Which Svelte app template? Skeleton project
# - Add type checking? Yes, using TypeScript
# - Select additional options: ESLint, Prettier, Playwright
# - Select additional options: Playwright
# Navigate to project
cd glyphdiff
# Install dependencies
npm install
yarn install
# Add Tailwind CSS
npx svelte-add@latest tailwindcss
yarn dlx svelte-add@latest tailwindcss
# Add Bits UI
npm install bits-ui
yarn add bits-ui
# Install additional dependencies
npm install clsx tailwind-merge
yarn add clsx tailwind-merge
# Install oxlint and dprint
yarn add -D oxlint dprint
```
#### Development Commands
```bash
# Start development server
npm run dev
yarn dev
# Open browser to localhost:5173
# Type check
npm run check
yarn check
# Type check in watch mode
npm run check:watch
yarn check:watch
# Lint code
npm run lint
yarn lint
# Format code
npm run format
yarn format
# Run Playwright tests
npm run test
yarn test
# Run unit tests (Vitest)
npm run test:unit
yarn test:unit
```
#### Build Commands
```bash
# Build for production
npm run build
yarn build
# Preview production build
npm run preview
yarn preview
# Clean build artifacts
rm -rf .svelte-kit build