Skip to content

Commit fb23efc

Browse files
committed
current state
1 parent 7024e6f commit fb23efc

File tree

88 files changed

+11582
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+11582
-0
lines changed

.coderabbit.yaml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
language: en-US
2+
tone_instructions: ''
3+
early_access: false
4+
enable_free_tier: true
5+
reviews:
6+
profile: assertive
7+
request_changes_workflow: false
8+
high_level_summary: true
9+
high_level_summary_placeholder: '@coderabbitai summary'
10+
high_level_summary_in_walkthrough: false
11+
auto_title_placeholder: '@coderabbitai'
12+
auto_title_instructions: ''
13+
review_status: true
14+
commit_status: true
15+
fail_commit_status: false
16+
collapse_walkthrough: false
17+
changed_files_summary: true
18+
sequence_diagrams: true
19+
assess_linked_issues: true
20+
related_issues: true
21+
related_prs: true
22+
suggested_labels: true
23+
auto_apply_labels: false
24+
suggested_reviewers: true
25+
auto_assign_reviewers: false
26+
poem: true
27+
labeling_instructions: []
28+
path_filters: []
29+
path_instructions: []
30+
abort_on_close: true
31+
disable_cache: false
32+
auto_review:
33+
enabled: true
34+
auto_incremental_review: true
35+
ignore_title_keywords: []
36+
labels: []
37+
drafts: false
38+
base_branches: []
39+
finishing_touches:
40+
docstrings:
41+
enabled: true
42+
unit_tests:
43+
enabled: true
44+
tools:
45+
ast-grep:
46+
rule_dirs: []
47+
util_dirs: []
48+
essential_rules: true
49+
packages: []
50+
shellcheck:
51+
enabled: true
52+
ruff:
53+
enabled: true
54+
markdownlint:
55+
enabled: true
56+
github-checks:
57+
enabled: true
58+
timeout_ms: 90000
59+
languagetool:
60+
enabled: true
61+
enabled_rules: []
62+
disabled_rules: []
63+
enabled_categories: []
64+
disabled_categories: []
65+
enabled_only: false
66+
level: default
67+
biome:
68+
enabled: true
69+
hadolint:
70+
enabled: true
71+
swiftlint:
72+
enabled: true
73+
phpstan:
74+
enabled: true
75+
level: default
76+
golangci-lint:
77+
enabled: true
78+
yamllint:
79+
enabled: true
80+
gitleaks:
81+
enabled: true
82+
checkov:
83+
enabled: true
84+
detekt:
85+
enabled: true
86+
eslint:
87+
enabled: true
88+
rubocop:
89+
enabled: true
90+
buf:
91+
enabled: true
92+
regal:
93+
enabled: true
94+
actionlint:
95+
enabled: true
96+
pmd:
97+
enabled: true
98+
cppcheck:
99+
enabled: true
100+
semgrep:
101+
enabled: true
102+
circleci:
103+
enabled: true
104+
sqlfluff:
105+
enabled: true
106+
prismaLint:
107+
enabled: true
108+
oxc:
109+
enabled: true
110+
shopifyThemeCheck:
111+
enabled: true
112+
chat:
113+
auto_reply: true
114+
integrations:
115+
jira:
116+
usage: auto
117+
linear:
118+
usage: auto
119+
knowledge_base:
120+
opt_out: false
121+
web_search:
122+
enabled: true
123+
learnings:
124+
scope: auto
125+
issues:
126+
scope: auto
127+
jira:
128+
usage: auto
129+
project_keys: []
130+
linear:
131+
usage: auto
132+
team_keys: []
133+
pull_requests:
134+
scope: auto
135+
code_generation:
136+
docstrings:
137+
language: en-US
138+
path_instructions: []
139+
unit_tests:
140+
path_instructions: []

.cursor/rules/svelte.mdc

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
---
2+
description:
3+
globs: *.svelte,*.svelte.ts
4+
alwaysApply: false
5+
---
6+
7+
You are an expert in Svelte 5, SvelteKit, TypeScript, and modern web development.
8+
9+
Key Principles
10+
- Write concise, technical code with accurate Svelte 5 and SvelteKit examples.
11+
- Leverage SvelteKit's server-side rendering (SSR) and static site generation (SSG) capabilities.
12+
- Prioritize performance optimization and minimal JavaScript for optimal user experience.
13+
- Use descriptive variable names and follow Svelte and SvelteKit conventions.
14+
- Organize files using SvelteKit's file-based routing system.
15+
16+
Code Style and Structure
17+
- Write concise, technical TypeScript or JavaScript code with accurate examples.
18+
- Use functional and declarative programming patterns; avoid unnecessary classes except for state machines.
19+
- Prefer iteration and modularization over code duplication.
20+
- Structure files: component logic, markup, styles, helpers, types.
21+
- Follow Svelte's official documentation for setup and configuration: https://svelte.dev/docs
22+
23+
Naming Conventions
24+
- Use lowercase with hyphens for component files (e.g., `components/auth-form.svelte`).
25+
- Use PascalCase for component names in imports and usage.
26+
- Use camelCase for variables, functions, and props.
27+
28+
TypeScript Usage
29+
- Use TypeScript for all code; prefer interfaces over types.
30+
- Avoid enums; use const objects instead.
31+
- Use functional components with TypeScript interfaces for props.
32+
- Enable strict mode in TypeScript for better type safety.
33+
34+
Svelte Runes
35+
- `$state`: Declare reactive state
36+
```typescript
37+
let count = $state(0);
38+
```
39+
- `$derived`: Compute derived values
40+
```typescript
41+
let doubled = $derived(count * 2);
42+
```
43+
- `$effect`: Manage side effects and lifecycle
44+
```typescript
45+
$effect(() => {
46+
console.log(`Count is now ${count}`);
47+
});
48+
```
49+
- `$props`: Declare component props
50+
```typescript
51+
let { optionalProp = 42, requiredProp } = $props();
52+
```
53+
- `$bindable`: Create two-way bindable props
54+
```typescript
55+
let { bindableProp = $bindable() } = $props();
56+
```
57+
- `$inspect`: Debug reactive state (development only)
58+
```typescript
59+
$inspect(count);
60+
```
61+
62+
UI and Styling
63+
- Use Tailwind CSS for utility-first styling approach.
64+
- Leverage Shadcn components for pre-built, customizable UI elements.
65+
- Import Shadcn components from `$lib/components/ui`.
66+
- Organize Tailwind classes using the `cn()` utility from `$lib/utils`.
67+
- Use Svelte's built-in transition and animation features.
68+
69+
Shadcn Color Conventions
70+
- Use `background` and `foreground` convention for colors.
71+
- Define CSS variables without color space function:
72+
```css
73+
--primary: 222.2 47.4% 11.2%;
74+
--primary-foreground: 210 40% 98%;
75+
```
76+
- Usage example:
77+
```svelte
78+
<div class="bg-primary text-primary-foreground">Hello</div>
79+
```
80+
- Key color variables:
81+
- `--background`, `--foreground`: Default body colors
82+
- `--muted`, `--muted-foreground`: Muted backgrounds
83+
- `--card`, `--card-foreground`: Card backgrounds
84+
- `--popover`, `--popover-foreground`: Popover backgrounds
85+
- `--border`: Default border color
86+
- `--input`: Input border color
87+
- `--primary`, `--primary-foreground`: Primary button colors
88+
- `--secondary`, `--secondary-foreground`: Secondary button colors
89+
- `--accent`, `--accent-foreground`: Accent colors
90+
- `--destructive`, `--destructive-foreground`: Destructive action colors
91+
- `--ring`: Focus ring color
92+
- `--radius`: Border radius for components
93+
94+
SvelteKit Project Structure
95+
- Use the recommended SvelteKit project structure:
96+
```
97+
- src/
98+
- lib/
99+
- routes/
100+
- app.html
101+
- static/
102+
- svelte.config.js
103+
- vite.config.js
104+
```
105+
106+
Component Development
107+
- Create .svelte files for Svelte components.
108+
- Use .svelte.ts files for component logic and state machines.
109+
- Implement proper component composition and reusability.
110+
- Use Svelte's props for data passing.
111+
- Leverage Svelte's reactive declarations for local state management.
112+
113+
State Management
114+
- Use classes for complex state management (state machines):
115+
```typescript
116+
// counter.svelte.ts
117+
class Counter {
118+
count = $state(0);
119+
incrementor = $state(1);
120+
121+
increment() {
122+
this.count += this.incrementor;
123+
}
124+
125+
resetCount() {
126+
this.count = 0;
127+
}
128+
129+
resetIncrementor() {
130+
this.incrementor = 1;
131+
}
132+
}
133+
134+
export const counter = new Counter();
135+
```
136+
- Use in components:
137+
```svelte
138+
<script lang="ts">
139+
import { counter } from './counter.svelte.ts';
140+
</script>
141+
142+
<button on:click={() => counter.increment()}>
143+
Count: {counter.count}
144+
</button>
145+
```
146+
147+
Routing and Pages
148+
- Utilize SvelteKit's file-based routing system in the src/routes/ directory.
149+
- Implement dynamic routes using [slug] syntax.
150+
- Use load functions for server-side data fetching and pre-rendering.
151+
- Implement proper error handling with +error.svelte pages.
152+
153+
Server-Side Rendering (SSR) and Static Site Generation (SSG)
154+
- Leverage SvelteKit's SSR capabilities for dynamic content.
155+
- Implement SSG for static pages using prerender option.
156+
- Use the adapter-auto for automatic deployment configuration.
157+
158+
Performance Optimization
159+
- Leverage Svelte's compile-time optimizations.
160+
- Use `{#key}` blocks to force re-rendering of components when needed.
161+
- Implement code splitting using dynamic imports for large applications.
162+
- Profile and monitor performance using browser developer tools.
163+
- Use `$effect.tracking()` to optimize effect dependencies.
164+
- Minimize use of client-side JavaScript; leverage SvelteKit's SSR and SSG.
165+
- Implement proper lazy loading for images and other assets.
166+
167+
Data Fetching and API Routes
168+
- Use load functions for server-side data fetching.
169+
- Implement proper error handling for data fetching operations.
170+
- Create API routes in the src/routes/api/ directory.
171+
- Implement proper request handling and response formatting in API routes.
172+
- Use SvelteKit's hooks for global API middleware.
173+
174+
SEO and Meta Tags
175+
- Use Svelte:head component for adding meta information.
176+
- Implement canonical URLs for proper SEO.
177+
- Create reusable SEO components for consistent meta tag management.
178+
179+
Forms and Actions
180+
- Utilize SvelteKit's form actions for server-side form handling.
181+
- Implement proper client-side form validation using Svelte's reactive declarations.
182+
- Use progressive enhancement for JavaScript-optional form submissions.
183+
184+
Internationalization (i18n) with Paraglide.js
185+
- Use Paraglide.js for internationalization: https://inlang.com/m/gerre34r/library-inlang-paraglideJs
186+
- Install Paraglide.js: `npm install @inlang/paraglide-js`
187+
- Set up language files in the `languages` directory.
188+
- Use the `t` function to translate strings:
189+
```svelte
190+
<script>
191+
import { t } from '@inlang/paraglide-js';
192+
</script>
193+
194+
<h1>{t('welcome_message')}</h1>
195+
```
196+
- Support multiple languages and RTL layouts.
197+
- Ensure text scaling and font adjustments for accessibility.
198+
199+
Accessibility
200+
- Ensure proper semantic HTML structure in Svelte components.
201+
- Implement ARIA attributes where necessary.
202+
- Ensure keyboard navigation support for interactive elements.
203+
- Use Svelte's bind:this for managing focus programmatically.
204+
205+
Key Conventions
206+
1. Embrace Svelte's simplicity and avoid over-engineering solutions.
207+
2. Use SvelteKit for full-stack applications with SSR and API routes.
208+
3. Prioritize Web Vitals (LCP, FID, CLS) for performance optimization.
209+
4. Use environment variables for configuration management.
210+
5. Follow Svelte's best practices for component composition and state management.
211+
6. Ensure cross-browser compatibility by testing on multiple platforms.
212+
7. Keep your Svelte and SvelteKit versions up to date.
213+
214+
Documentation
215+
- Svelte 5 Runes: https://svelte-5-preview.vercel.app/docs/runes
216+
- Svelte Documentation: https://svelte.dev/docs
217+
- SvelteKit Documentation: https://kit.svelte.dev/docs
218+
- Paraglide.js Documentation: https://inlang.com/m/gerre34r/library-inlang-paraglideJs/usage
219+
220+
Refer to Svelte, SvelteKit, and Paraglide.js documentation for detailed information on components, internationalization, and best practices.

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [humanspeak]

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
labels:
9+
- dependencies
10+
11+
- package-ecosystem: npm
12+
directory: /docs
13+
schedule:
14+
interval: monthly
15+
labels: []
16+
ignore:
17+
- dependency-name: '*'

0 commit comments

Comments
 (0)