@zoyth/simple-site-framework 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +572 -0
- package/bin/create-simple-site.js +390 -0
- package/bin/simple-site.js +664 -0
- package/dist/client.js +135 -0
- package/dist/client.js.map +1 -0
- package/dist/client.mjs +107 -0
- package/dist/client.mjs.map +1 -0
- package/dist/components/index.d.mts +3936 -0
- package/dist/components/index.d.ts +3936 -0
- package/dist/components/index.js +38265 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +38173 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/config/index.d.mts +298 -0
- package/dist/config/index.d.ts +298 -0
- package/dist/config/index.js +19 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/index.mjs +1 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/index.d.mts +2184 -0
- package/dist/index.d.ts +2184 -0
- package/dist/index.js +1713 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1605 -0
- package/dist/index.mjs.map +1 -0
- package/dist/lib/i18n/index.js +665 -0
- package/dist/lib/i18n/index.js.map +1 -0
- package/dist/lib/i18n/index.mjs +621 -0
- package/dist/lib/i18n/index.mjs.map +1 -0
- package/docs/DOCUMENTATION-STRUCTURE.md +1156 -0
- package/docs/EXPORTS.md +125 -0
- package/docs/PERFORMANCE.md +757 -0
- package/docs/POLICY-PAGES.md +867 -0
- package/docs/ROADMAP.md +334 -0
- package/docs/SEO.md +455 -0
- package/docs/SITEMAP.md +708 -0
- package/docs/STRUCTURED-DATA.md +671 -0
- package/docs/accessibility/common-patterns.md +529 -0
- package/docs/accessibility/keyboard-navigation.md +263 -0
- package/docs/accessibility/overview.md +122 -0
- package/docs/accessibility/screen-readers.md +311 -0
- package/docs/accessibility/wcag-compliance.md +159 -0
- package/docs/api/README.md +164 -0
- package/docs/api/components/Accessibility.md +356 -0
- package/docs/api/components/Button.md +240 -0
- package/docs/api/components/HeroSection.md +306 -0
- package/docs/architecture/decisions.md +449 -0
- package/docs/components/AnalyticsTracker.md +58 -0
- package/docs/components/AnimatedCounter.md +48 -0
- package/docs/components/AnimatedSection.md +56 -0
- package/docs/components/BlogCard.md +42 -0
- package/docs/components/Checkbox.md +56 -0
- package/docs/components/CodeBlock.md +52 -0
- package/docs/components/ComparisonTable.md +40 -0
- package/docs/components/ComponentDemo.md +38 -0
- package/docs/components/CountdownTimer.md +51 -0
- package/docs/components/ExitIntentModal.md +56 -0
- package/docs/components/FAQAccordion.md +66 -0
- package/docs/components/FeaturesGrid.md +55 -0
- package/docs/components/FileUpload.md +54 -0
- package/docs/components/I18nMetaTags.md +55 -0
- package/docs/components/Icon.md +53 -0
- package/docs/components/LazySection.md +46 -0
- package/docs/components/LiveProof.md +53 -0
- package/docs/components/LoadingSpinner.md +46 -0
- package/docs/components/MultiStepForm.md +48 -0
- package/docs/components/PolicyLayout.md +55 -0
- package/docs/components/PricingTable.md +49 -0
- package/docs/components/Radio.md +59 -0
- package/docs/components/SEOMetaTags.md +58 -0
- package/docs/components/ScriptInjector.md +50 -0
- package/docs/components/Select.md +72 -0
- package/docs/components/Skeleton.md +47 -0
- package/docs/components/StatsSection.md +48 -0
- package/docs/components/StickyBar.md +62 -0
- package/docs/components/StructuredData.md +99 -0
- package/docs/components/StyleGuide.md +46 -0
- package/docs/components/TableOfContents.md +47 -0
- package/docs/components/TestimonialCarousel.md +42 -0
- package/docs/components/Timeline.md +51 -0
- package/docs/components/Toast.md +59 -0
- package/docs/components/TrackedLink.md +62 -0
- package/docs/components/TrustBadges.md +44 -0
- package/docs/components/conversion/MobileCTA.md +363 -0
- package/docs/components/forms/ContactForm.md +75 -0
- package/docs/components/forms/FormField.md +74 -0
- package/docs/components/layout/Footer.md +601 -0
- package/docs/components/layout/Header.md +549 -0
- package/docs/components/layout/LanguageSelector.md +54 -0
- package/docs/components/layout/LanguageSwitcher.md +24 -0
- package/docs/components/overview.md +447 -0
- package/docs/components/sections/AboutSection.md +48 -0
- package/docs/components/sections/CTASection.md +596 -0
- package/docs/components/sections/CaseStudySection.md +47 -0
- package/docs/components/sections/ContactSection.md +599 -0
- package/docs/components/sections/FeatureSection.md +44 -0
- package/docs/components/sections/HeroSection.md +404 -0
- package/docs/components/sections/LogosSection.md +47 -0
- package/docs/components/sections/PersonalTaxesSection.md +23 -0
- package/docs/components/sections/RecruitingSection.md +23 -0
- package/docs/components/sections/SecurePortalSection.md +23 -0
- package/docs/components/sections/ServicePageLayout.md +52 -0
- package/docs/components/sections/ServicesSection.md +49 -0
- package/docs/components/sections/TestimonialSection.md +44 -0
- package/docs/components/sections/WhyChooseUsSection.md +54 -0
- package/docs/components/ui/Breadcrumb.md +70 -0
- package/docs/components/ui/Button.md +514 -0
- package/docs/components/ui/Card.md +501 -0
- package/docs/components/ui/Input.md +54 -0
- package/docs/components/ui/MobileLinks.md +43 -0
- package/docs/components/ui/Modal.md +60 -0
- package/docs/components/ui/Tabs.md +62 -0
- package/docs/components/ui/Textarea.md +52 -0
- package/docs/core-concepts/configuration-driven.md +552 -0
- package/docs/core-concepts/overview.md +351 -0
- package/docs/features/accessibility/README.md +73 -0
- package/docs/features/accessibility/aria-support.md +177 -0
- package/docs/features/accessibility/color-contrast.md +155 -0
- package/docs/features/accessibility/focus-management.md +187 -0
- package/docs/features/accessibility/testing.md +196 -0
- package/docs/features/analytics/README.md +51 -0
- package/docs/features/analytics/ab-testing.md +171 -0
- package/docs/features/analytics/conversion-tracking.md +207 -0
- package/docs/features/analytics/custom-events.md +219 -0
- package/docs/features/analytics/privacy.md +198 -0
- package/docs/features/analytics/setup.md +114 -0
- package/docs/features/analytics/tracking-events.md +224 -0
- package/docs/features/i18n/README.md +51 -0
- package/docs/features/i18n/best-practices.md +273 -0
- package/docs/features/i18n/configuration.md +84 -0
- package/docs/features/i18n/formatting.md +133 -0
- package/docs/features/i18n/locale-detection.md +122 -0
- package/docs/features/i18n/routing.md +99 -0
- package/docs/features/i18n/rtl-support.md +191 -0
- package/docs/features/i18n/translations.md +129 -0
- package/docs/features/internationalization.md +595 -0
- package/docs/features/performance/README.md +77 -0
- package/docs/features/performance/bundle-size.md +134 -0
- package/docs/features/performance/caching.md +131 -0
- package/docs/features/performance/code-splitting.md +121 -0
- package/docs/features/performance/image-optimization.md +110 -0
- package/docs/features/performance/lazy-loading.md +92 -0
- package/docs/features/performance/monitoring.md +148 -0
- package/docs/features/seo/README.md +51 -0
- package/docs/features/seo/best-practices.md +184 -0
- package/docs/features/seo/canonical-urls.md +182 -0
- package/docs/features/seo/meta-tags.md +126 -0
- package/docs/features/seo/open-graph.md +166 -0
- package/docs/features/seo/robots-txt.md +146 -0
- package/docs/features/seo/sitemaps.md +162 -0
- package/docs/features/seo/structured-data.md +166 -0
- package/docs/getting-started/installation.md +292 -0
- package/docs/getting-started/introduction.md +195 -0
- package/docs/getting-started/quick-start.md +460 -0
- package/docs/guides/analytics-setup.md +616 -0
- package/docs/i18n/CONFIGURATION.md +353 -0
- package/docs/i18n/EXAMPLES.md +402 -0
- package/docs/i18n/MIGRATION.md +260 -0
- package/docs/i18n/SEO.md +392 -0
- package/docs/i18n/STATIC-GENERATION-FIX.md +71 -0
- package/docs/migration/changelog.md +136 -0
- package/docs/migration/overview.md +233 -0
- package/docs/recipes/adding-animations.md +475 -0
- package/docs/recipes/forms-with-validation.md +393 -0
- package/package.json +152 -0
|
@@ -0,0 +1,1156 @@
|
|
|
1
|
+
# Simple Site Framework - Documentation Structure
|
|
2
|
+
|
|
3
|
+
> Comprehensive documentation outline for the framework
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📚 Documentation Organization
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
docs/
|
|
11
|
+
├── README.md # Documentation index
|
|
12
|
+
├── getting-started/
|
|
13
|
+
│ ├── introduction.md
|
|
14
|
+
│ ├── installation.md
|
|
15
|
+
│ ├── quick-start.md
|
|
16
|
+
│ ├── first-project.md
|
|
17
|
+
│ └── migration-guide.md
|
|
18
|
+
├── core-concepts/
|
|
19
|
+
│ ├── overview.md
|
|
20
|
+
│ ├── configuration-driven.md
|
|
21
|
+
│ ├── internationalization.md
|
|
22
|
+
│ ├── server-client-split.md
|
|
23
|
+
│ └── theme-system.md
|
|
24
|
+
├── components/
|
|
25
|
+
│ ├── README.md
|
|
26
|
+
│ ├── layout/
|
|
27
|
+
│ ├── sections/
|
|
28
|
+
│ ├── ui/
|
|
29
|
+
│ ├── forms/
|
|
30
|
+
│ ├── conversion/
|
|
31
|
+
│ └── accessibility/
|
|
32
|
+
├── features/
|
|
33
|
+
│ ├── i18n/
|
|
34
|
+
│ ├── analytics/
|
|
35
|
+
│ ├── seo/
|
|
36
|
+
│ ├── performance/
|
|
37
|
+
│ └── accessibility/
|
|
38
|
+
├── guides/
|
|
39
|
+
│ ├── building-landing-page.md
|
|
40
|
+
│ ├── multi-language-site.md
|
|
41
|
+
│ ├── ab-testing.md
|
|
42
|
+
│ ├── analytics-setup.md
|
|
43
|
+
│ ├── seo-optimization.md
|
|
44
|
+
│ ├── deployment.md
|
|
45
|
+
│ └── troubleshooting.md
|
|
46
|
+
├── api-reference/
|
|
47
|
+
│ ├── components.md
|
|
48
|
+
│ ├── utilities.md
|
|
49
|
+
│ ├── hooks.md
|
|
50
|
+
│ └── types.md
|
|
51
|
+
├── examples/
|
|
52
|
+
│ ├── landing-pages/
|
|
53
|
+
│ ├── service-sites/
|
|
54
|
+
│ ├── multi-language/
|
|
55
|
+
│ └── e-commerce/
|
|
56
|
+
└── contributing/
|
|
57
|
+
├── development.md
|
|
58
|
+
├── testing.md
|
|
59
|
+
├── pull-requests.md
|
|
60
|
+
└── code-style.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 1. Getting Started
|
|
66
|
+
|
|
67
|
+
### 1.1 Introduction (`introduction.md`)
|
|
68
|
+
|
|
69
|
+
**Purpose:** Orient new users to the framework
|
|
70
|
+
|
|
71
|
+
**Content:**
|
|
72
|
+
- What is Simple Site Framework?
|
|
73
|
+
- Who is it for?
|
|
74
|
+
- Key features and benefits
|
|
75
|
+
- When to use (and when not to use)
|
|
76
|
+
- Framework philosophy
|
|
77
|
+
- Comparison with other solutions
|
|
78
|
+
- Browser and Next.js version compatibility
|
|
79
|
+
|
|
80
|
+
**Examples:**
|
|
81
|
+
```markdown
|
|
82
|
+
## What is Simple Site Framework?
|
|
83
|
+
|
|
84
|
+
A configuration-driven Next.js framework for building professional
|
|
85
|
+
service websites with minimal code...
|
|
86
|
+
|
|
87
|
+
## Key Features
|
|
88
|
+
|
|
89
|
+
- 🌍 Built-in internationalization (i18n)
|
|
90
|
+
- 📊 Integrated analytics and A/B testing
|
|
91
|
+
- 🎨 Themeable components
|
|
92
|
+
- ♿ Accessibility-first design
|
|
93
|
+
- 🚀 Optimized for performance
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### 1.2 Installation (`installation.md`)
|
|
99
|
+
|
|
100
|
+
**Purpose:** Get the framework installed
|
|
101
|
+
|
|
102
|
+
**Content:**
|
|
103
|
+
- System requirements (Node.js version, etc.)
|
|
104
|
+
- Installation via npm/yarn/pnpm
|
|
105
|
+
- Installing peer dependencies
|
|
106
|
+
- Setting up a new Next.js project
|
|
107
|
+
- Adding to existing project
|
|
108
|
+
- Verifying installation
|
|
109
|
+
- Common installation issues
|
|
110
|
+
|
|
111
|
+
**Examples:**
|
|
112
|
+
```bash
|
|
113
|
+
# Create new Next.js project
|
|
114
|
+
npx create-next-app@latest my-site
|
|
115
|
+
|
|
116
|
+
# Install framework
|
|
117
|
+
npm install @zoyth/simple-site-framework
|
|
118
|
+
|
|
119
|
+
# Install peer dependencies
|
|
120
|
+
npm install framer-motion lucide-react @radix-ui/react-accordion
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 1.3 Quick Start (`quick-start.md`)
|
|
126
|
+
|
|
127
|
+
**Purpose:** Get something running in 5 minutes
|
|
128
|
+
|
|
129
|
+
**Content:**
|
|
130
|
+
- Minimal working example
|
|
131
|
+
- Basic configuration
|
|
132
|
+
- Your first page
|
|
133
|
+
- Running the dev server
|
|
134
|
+
- What you just built
|
|
135
|
+
- Next steps
|
|
136
|
+
|
|
137
|
+
**Examples:**
|
|
138
|
+
```tsx
|
|
139
|
+
// app/page.tsx
|
|
140
|
+
import { HeroSection } from '@zoyth/simple-site-framework/components';
|
|
141
|
+
|
|
142
|
+
export default function Home() {
|
|
143
|
+
return (
|
|
144
|
+
<HeroSection
|
|
145
|
+
heading="Welcome to My Site"
|
|
146
|
+
description="Built with Simple Site Framework"
|
|
147
|
+
primaryCTA={{ text: "Get Started", href: "/start" }}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### 1.4 First Project (`first-project.md`)
|
|
156
|
+
|
|
157
|
+
**Purpose:** Build a complete landing page
|
|
158
|
+
|
|
159
|
+
**Content:**
|
|
160
|
+
- Project structure overview
|
|
161
|
+
- Creating configuration file
|
|
162
|
+
- Building the homepage
|
|
163
|
+
- Adding sections (Hero, Features, Testimonials, CTA)
|
|
164
|
+
- Setting up navigation
|
|
165
|
+
- Adding a second page
|
|
166
|
+
- Styling and theming
|
|
167
|
+
- Building for production
|
|
168
|
+
|
|
169
|
+
**Examples:**
|
|
170
|
+
- Complete landing page walkthrough
|
|
171
|
+
- Code snippets for each section
|
|
172
|
+
- Screenshots of the result
|
|
173
|
+
- Common pitfalls and solutions
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
### 1.5 Migration Guide (`migration-guide.md`)
|
|
178
|
+
|
|
179
|
+
**Purpose:** Help users migrate from other solutions
|
|
180
|
+
|
|
181
|
+
**Content:**
|
|
182
|
+
- Migrating from plain Next.js
|
|
183
|
+
- Migrating from create-react-app
|
|
184
|
+
- Migrating from other frameworks
|
|
185
|
+
- Breaking changes between versions
|
|
186
|
+
- Upgrade guides
|
|
187
|
+
- Deprecation notices
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## 2. Core Concepts
|
|
192
|
+
|
|
193
|
+
### 2.1 Overview (`overview.md`)
|
|
194
|
+
|
|
195
|
+
**Purpose:** Understand framework architecture
|
|
196
|
+
|
|
197
|
+
**Content:**
|
|
198
|
+
- Framework architecture diagram
|
|
199
|
+
- Component hierarchy
|
|
200
|
+
- Configuration system
|
|
201
|
+
- Build and bundle structure
|
|
202
|
+
- Server vs Client components
|
|
203
|
+
- File organization patterns
|
|
204
|
+
- Mental model
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
### 2.2 Configuration-Driven (`configuration-driven.md`)
|
|
209
|
+
|
|
210
|
+
**Purpose:** Master the configuration approach
|
|
211
|
+
|
|
212
|
+
**Content:**
|
|
213
|
+
- Why configuration over code
|
|
214
|
+
- Configuration file structure
|
|
215
|
+
- Content schema
|
|
216
|
+
- Type safety with Zod
|
|
217
|
+
- Environment-specific config
|
|
218
|
+
- Overriding defaults
|
|
219
|
+
- Best practices
|
|
220
|
+
|
|
221
|
+
**Examples:**
|
|
222
|
+
```typescript
|
|
223
|
+
// config/site.ts
|
|
224
|
+
export const siteConfig = {
|
|
225
|
+
name: "My Company",
|
|
226
|
+
description: "Professional services",
|
|
227
|
+
locales: ['en', 'fr'],
|
|
228
|
+
defaultLocale: 'en',
|
|
229
|
+
theme: {
|
|
230
|
+
primary: '#0066CC',
|
|
231
|
+
secondary: '#FF6600'
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
### 2.3 Internationalization (`internationalization.md`)
|
|
239
|
+
|
|
240
|
+
**Purpose:** Understand i18n system
|
|
241
|
+
|
|
242
|
+
**Content:**
|
|
243
|
+
- i18n architecture
|
|
244
|
+
- LocalizedString type
|
|
245
|
+
- Locale detection and routing
|
|
246
|
+
- Translation workflow
|
|
247
|
+
- RTL support
|
|
248
|
+
- Date/number formatting
|
|
249
|
+
- Best practices
|
|
250
|
+
|
|
251
|
+
**Examples:**
|
|
252
|
+
```typescript
|
|
253
|
+
// Using LocalizedString
|
|
254
|
+
const heading: LocalizedString = {
|
|
255
|
+
en: "Welcome",
|
|
256
|
+
fr: "Bienvenue"
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// In components
|
|
260
|
+
<HeroSection heading={heading} locale={locale} />
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### 2.4 Server-Client Split (`server-client-split.md`)
|
|
266
|
+
|
|
267
|
+
**Purpose:** Understand packaging and imports
|
|
268
|
+
|
|
269
|
+
**Content:**
|
|
270
|
+
- What's in main export
|
|
271
|
+
- What's in /client export
|
|
272
|
+
- What's in /components export
|
|
273
|
+
- When to use which export
|
|
274
|
+
- 'use client' directive
|
|
275
|
+
- Server Component benefits
|
|
276
|
+
- Common pitfalls
|
|
277
|
+
|
|
278
|
+
**Examples:**
|
|
279
|
+
```tsx
|
|
280
|
+
// Server component (default)
|
|
281
|
+
import { HeroSection } from '@zoyth/simple-site-framework/components';
|
|
282
|
+
|
|
283
|
+
// Client component (when needed)
|
|
284
|
+
'use client';
|
|
285
|
+
import { AnalyticsTracker, getABTestVariant } from '@zoyth/simple-site-framework/client';
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
### 2.5 Theme System (`theme-system.md`)
|
|
291
|
+
|
|
292
|
+
**Purpose:** Understand theming capabilities
|
|
293
|
+
|
|
294
|
+
**Content:**
|
|
295
|
+
- Theme configuration
|
|
296
|
+
- CSS variables
|
|
297
|
+
- Tailwind integration
|
|
298
|
+
- Color palette
|
|
299
|
+
- Typography scale
|
|
300
|
+
- Spacing system
|
|
301
|
+
- Dark mode support
|
|
302
|
+
- Custom themes
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 3. Components
|
|
307
|
+
|
|
308
|
+
### 3.1 Component Documentation Template
|
|
309
|
+
|
|
310
|
+
**Each component doc should include:**
|
|
311
|
+
|
|
312
|
+
```markdown
|
|
313
|
+
# ComponentName
|
|
314
|
+
|
|
315
|
+
> Brief one-line description
|
|
316
|
+
|
|
317
|
+
## Overview
|
|
318
|
+
|
|
319
|
+
Detailed description of what the component does and when to use it.
|
|
320
|
+
|
|
321
|
+
## Installation
|
|
322
|
+
|
|
323
|
+
If component has specific dependencies.
|
|
324
|
+
|
|
325
|
+
## Basic Usage
|
|
326
|
+
|
|
327
|
+
Simplest possible example.
|
|
328
|
+
|
|
329
|
+
## Props
|
|
330
|
+
|
|
331
|
+
| Prop | Type | Default | Description |
|
|
332
|
+
|------|------|---------|-------------|
|
|
333
|
+
| ... | ... | ... | ... |
|
|
334
|
+
|
|
335
|
+
## Examples
|
|
336
|
+
|
|
337
|
+
### Example 1: Basic
|
|
338
|
+
### Example 2: Advanced
|
|
339
|
+
### Example 3: Real-world
|
|
340
|
+
|
|
341
|
+
## Variants
|
|
342
|
+
|
|
343
|
+
Different visual/behavioral variants.
|
|
344
|
+
|
|
345
|
+
## Accessibility
|
|
346
|
+
|
|
347
|
+
ARIA attributes, keyboard navigation, screen reader support.
|
|
348
|
+
|
|
349
|
+
## Styling
|
|
350
|
+
|
|
351
|
+
How to customize appearance.
|
|
352
|
+
|
|
353
|
+
## Related Components
|
|
354
|
+
|
|
355
|
+
Links to similar/related components.
|
|
356
|
+
|
|
357
|
+
## API Reference
|
|
358
|
+
|
|
359
|
+
Detailed API documentation.
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
### 3.2 Layout Components (`components/layout/`)
|
|
365
|
+
|
|
366
|
+
**Files:**
|
|
367
|
+
- `header.md` - Navigation header
|
|
368
|
+
- `footer.md` - Site footer
|
|
369
|
+
- `language-switcher.md` - Language selector
|
|
370
|
+
- `language-selector.md` - New multi-language selector
|
|
371
|
+
- `breadcrumb.md` - Breadcrumb navigation
|
|
372
|
+
- `skip-link.md` - Accessibility skip links
|
|
373
|
+
|
|
374
|
+
**Each includes:**
|
|
375
|
+
- Configuration options
|
|
376
|
+
- Customization examples
|
|
377
|
+
- Responsive behavior
|
|
378
|
+
- Accessibility features
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
### 3.3 Section Components (`components/sections/`)
|
|
383
|
+
|
|
384
|
+
**Files:**
|
|
385
|
+
- `hero-section.md` - Hero/banner sections
|
|
386
|
+
- `features-section.md` - Feature showcases
|
|
387
|
+
- `testimonial-section.md` - Customer testimonials
|
|
388
|
+
- `services-section.md` - Service listings
|
|
389
|
+
- `pricing-section.md` - Pricing tables
|
|
390
|
+
- `faq-section.md` - FAQ accordions
|
|
391
|
+
- `contact-section.md` - Contact forms
|
|
392
|
+
- `cta-section.md` - Call-to-action sections
|
|
393
|
+
- `case-study-section.md` - Customer success stories
|
|
394
|
+
- `stats-section.md` - Statistics/metrics
|
|
395
|
+
- `about-section.md` - About/team sections
|
|
396
|
+
|
|
397
|
+
---
|
|
398
|
+
|
|
399
|
+
### 3.4 UI Components (`components/ui/`)
|
|
400
|
+
|
|
401
|
+
**Files:**
|
|
402
|
+
- `button.md` - Button component
|
|
403
|
+
- `input.md` - Text inputs
|
|
404
|
+
- `textarea.md` - Multi-line text
|
|
405
|
+
- `card.md` - Content cards
|
|
406
|
+
- `badge.md` - Labels/tags
|
|
407
|
+
- `tooltip.md` - Tooltips
|
|
408
|
+
- `modal.md` - Modals/dialogs
|
|
409
|
+
- `tabs.md` - Tab navigation
|
|
410
|
+
- `toast.md` - Toast notifications
|
|
411
|
+
- `loading-spinner.md` - Loading states
|
|
412
|
+
- `skeleton.md` - Skeleton loaders
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
### 3.5 Form Components (`components/forms/`)
|
|
417
|
+
|
|
418
|
+
**Files:**
|
|
419
|
+
- `form-field.md` - Form field wrapper
|
|
420
|
+
- `checkbox.md` - Checkbox inputs
|
|
421
|
+
- `radio.md` - Radio buttons
|
|
422
|
+
- `select.md` - Select dropdowns
|
|
423
|
+
- `file-upload.md` - File uploads
|
|
424
|
+
- `contact-form.md` - Complete contact form
|
|
425
|
+
- `multi-step-form.md` - Multi-step forms
|
|
426
|
+
|
|
427
|
+
---
|
|
428
|
+
|
|
429
|
+
### 3.6 Conversion Components (`components/conversion/`)
|
|
430
|
+
|
|
431
|
+
**Files:**
|
|
432
|
+
- `mobile-cta.md` - Mobile sticky CTA
|
|
433
|
+
- `exit-intent-modal.md` - Exit intent popups
|
|
434
|
+
- `countdown-timer.md` - Urgency timers
|
|
435
|
+
- `sticky-bar.md` - Announcement bars
|
|
436
|
+
- `live-proof.md` - Social proof notifications
|
|
437
|
+
- `trust-badges.md` - Trust indicators
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
### 3.7 Accessibility Components (`components/accessibility/`)
|
|
442
|
+
|
|
443
|
+
**Files:**
|
|
444
|
+
- `form-field-aria.md` - ARIA-enhanced forms
|
|
445
|
+
- `checkbox-group-aria.md` - Accessible checkbox groups
|
|
446
|
+
- `radio-group-aria.md` - Accessible radio groups
|
|
447
|
+
- `skip-link.md` - Skip navigation
|
|
448
|
+
- `a11y-announcer.md` - Screen reader announcements
|
|
449
|
+
|
|
450
|
+
---
|
|
451
|
+
|
|
452
|
+
## 4. Features
|
|
453
|
+
|
|
454
|
+
### 4.1 Internationalization (`features/i18n/`)
|
|
455
|
+
|
|
456
|
+
**Files:**
|
|
457
|
+
- `README.md` - i18n overview
|
|
458
|
+
- `configuration.md` - Setting up i18n
|
|
459
|
+
- `routing.md` - Locale routing
|
|
460
|
+
- `translations.md` - Managing translations
|
|
461
|
+
- `locale-detection.md` - Browser detection
|
|
462
|
+
- `formatting.md` - Dates, numbers, currency
|
|
463
|
+
- `rtl-support.md` - Right-to-left languages
|
|
464
|
+
- `best-practices.md` - i18n best practices
|
|
465
|
+
|
|
466
|
+
**Examples:**
|
|
467
|
+
- Multi-language site setup
|
|
468
|
+
- Translation workflow
|
|
469
|
+
- Dynamic locale switching
|
|
470
|
+
- SEO for multiple languages
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
474
|
+
### 4.2 Analytics (`features/analytics/`)
|
|
475
|
+
|
|
476
|
+
**Files:**
|
|
477
|
+
- `README.md` - Analytics overview
|
|
478
|
+
- `setup.md` - Initial setup
|
|
479
|
+
- `tracking-events.md` - Event tracking
|
|
480
|
+
- `ab-testing.md` - A/B test setup
|
|
481
|
+
- `conversion-tracking.md` - Conversion tracking
|
|
482
|
+
- `custom-events.md` - Custom analytics
|
|
483
|
+
- `privacy.md` - Privacy compliance
|
|
484
|
+
|
|
485
|
+
**Examples:**
|
|
486
|
+
```tsx
|
|
487
|
+
// Track CTA clicks
|
|
488
|
+
import { trackCTAClick } from '@zoyth/simple-site-framework/client';
|
|
489
|
+
|
|
490
|
+
<button onClick={() => trackCTAClick('signup', 'hero')}>
|
|
491
|
+
Sign Up
|
|
492
|
+
</button>
|
|
493
|
+
|
|
494
|
+
// A/B testing
|
|
495
|
+
import { getABTestVariant } from '@zoyth/simple-site-framework/client';
|
|
496
|
+
|
|
497
|
+
const variant = getABTestVariant({
|
|
498
|
+
testId: 'hero-cta',
|
|
499
|
+
variants: { A: { weight: 50 }, B: { weight: 50 } }
|
|
500
|
+
});
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
---
|
|
504
|
+
|
|
505
|
+
### 4.3 SEO (`features/seo/`)
|
|
506
|
+
|
|
507
|
+
**Files:**
|
|
508
|
+
- `README.md` - SEO overview
|
|
509
|
+
- `meta-tags.md` - Meta tag configuration
|
|
510
|
+
- `structured-data.md` - Schema.org markup
|
|
511
|
+
- `sitemaps.md` - XML sitemap generation
|
|
512
|
+
- `open-graph.md` - Social media previews
|
|
513
|
+
- `robots-txt.md` - Robots.txt configuration
|
|
514
|
+
- `canonical-urls.md` - Canonical URL management
|
|
515
|
+
- `best-practices.md` - SEO best practices
|
|
516
|
+
|
|
517
|
+
**Examples:**
|
|
518
|
+
```tsx
|
|
519
|
+
import { SEOMetaTags, StructuredData } from '@zoyth/simple-site-framework/components';
|
|
520
|
+
|
|
521
|
+
<SEOMetaTags
|
|
522
|
+
title="My Page Title"
|
|
523
|
+
description="Page description"
|
|
524
|
+
canonical="https://example.com/page"
|
|
525
|
+
openGraph={{
|
|
526
|
+
type: 'website',
|
|
527
|
+
image: '/og-image.jpg'
|
|
528
|
+
}}
|
|
529
|
+
/>
|
|
530
|
+
|
|
531
|
+
<StructuredData
|
|
532
|
+
data={{
|
|
533
|
+
'@type': 'Organization',
|
|
534
|
+
name: 'My Company',
|
|
535
|
+
url: 'https://example.com'
|
|
536
|
+
}}
|
|
537
|
+
/>
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
### 4.4 Performance (`features/performance/`)
|
|
543
|
+
|
|
544
|
+
**Files:**
|
|
545
|
+
- `README.md` - Performance overview
|
|
546
|
+
- `lazy-loading.md` - Component lazy loading
|
|
547
|
+
- `image-optimization.md` - Image optimization
|
|
548
|
+
- `code-splitting.md` - Code splitting strategies
|
|
549
|
+
- `caching.md` - Caching strategies
|
|
550
|
+
- `bundle-size.md` - Bundle optimization
|
|
551
|
+
- `monitoring.md` - Performance monitoring
|
|
552
|
+
|
|
553
|
+
---
|
|
554
|
+
|
|
555
|
+
### 4.5 Accessibility (`features/accessibility/`)
|
|
556
|
+
|
|
557
|
+
**Files:**
|
|
558
|
+
- `README.md` - Accessibility overview
|
|
559
|
+
- `aria-support.md` - ARIA implementation
|
|
560
|
+
- `keyboard-navigation.md` - Keyboard support
|
|
561
|
+
- `screen-readers.md` - Screen reader testing
|
|
562
|
+
- `color-contrast.md` - Color contrast
|
|
563
|
+
- `focus-management.md` - Focus handling
|
|
564
|
+
- `testing.md` - Accessibility testing
|
|
565
|
+
- `wcag-compliance.md` - WCAG 2.1 compliance
|
|
566
|
+
|
|
567
|
+
---
|
|
568
|
+
|
|
569
|
+
## 5. Guides
|
|
570
|
+
|
|
571
|
+
### 5.1 Building a Landing Page (`guides/building-landing-page.md`)
|
|
572
|
+
|
|
573
|
+
**Purpose:** Complete tutorial for a landing page
|
|
574
|
+
|
|
575
|
+
**Content:**
|
|
576
|
+
- Planning the structure
|
|
577
|
+
- Setting up configuration
|
|
578
|
+
- Building hero section
|
|
579
|
+
- Adding features section
|
|
580
|
+
- Testimonials and social proof
|
|
581
|
+
- CTA sections
|
|
582
|
+
- Contact form
|
|
583
|
+
- Mobile optimization
|
|
584
|
+
- SEO setup
|
|
585
|
+
- Launch checklist
|
|
586
|
+
|
|
587
|
+
---
|
|
588
|
+
|
|
589
|
+
### 5.2 Multi-Language Site (`guides/multi-language-site.md`)
|
|
590
|
+
|
|
591
|
+
**Purpose:** Build a fully localized site
|
|
592
|
+
|
|
593
|
+
**Content:**
|
|
594
|
+
- i18n configuration
|
|
595
|
+
- Setting up locales
|
|
596
|
+
- Creating translations
|
|
597
|
+
- Locale routing
|
|
598
|
+
- Language switcher
|
|
599
|
+
- Translating content
|
|
600
|
+
- Managing translation files
|
|
601
|
+
- SEO for multiple languages
|
|
602
|
+
- Testing all locales
|
|
603
|
+
|
|
604
|
+
---
|
|
605
|
+
|
|
606
|
+
### 5.3 A/B Testing (`guides/ab-testing.md`)
|
|
607
|
+
|
|
608
|
+
**Purpose:** Implement A/B tests
|
|
609
|
+
|
|
610
|
+
**Content:**
|
|
611
|
+
- Setting up A/B tests
|
|
612
|
+
- Creating variants
|
|
613
|
+
- Tracking conversions
|
|
614
|
+
- Analyzing results
|
|
615
|
+
- Best practices
|
|
616
|
+
- Common patterns
|
|
617
|
+
- Tools integration
|
|
618
|
+
|
|
619
|
+
**Examples:**
|
|
620
|
+
```tsx
|
|
621
|
+
// Hero CTA A/B test
|
|
622
|
+
const variant = getABTestVariant({
|
|
623
|
+
testId: 'hero-cta-text',
|
|
624
|
+
variants: { A: { weight: 50 }, B: { weight: 50 } }
|
|
625
|
+
});
|
|
626
|
+
|
|
627
|
+
const ctaText = variant === 'A'
|
|
628
|
+
? 'Start Free Trial'
|
|
629
|
+
: 'Get Started Free';
|
|
630
|
+
|
|
631
|
+
<button onClick={() => {
|
|
632
|
+
trackABTestEvent('hero-cta-text', variant, 'click');
|
|
633
|
+
trackConversion('signup_click');
|
|
634
|
+
}}>
|
|
635
|
+
{ctaText}
|
|
636
|
+
</button>
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
641
|
+
### 5.4 Analytics Setup (`guides/analytics-setup.md`)
|
|
642
|
+
|
|
643
|
+
**Purpose:** Configure analytics tracking
|
|
644
|
+
|
|
645
|
+
**Content:**
|
|
646
|
+
- Google Analytics 4 setup
|
|
647
|
+
- Installing AnalyticsTracker
|
|
648
|
+
- Custom event tracking
|
|
649
|
+
- E-commerce tracking
|
|
650
|
+
- User privacy
|
|
651
|
+
- GDPR compliance
|
|
652
|
+
- Testing analytics
|
|
653
|
+
- Debugging
|
|
654
|
+
|
|
655
|
+
---
|
|
656
|
+
|
|
657
|
+
### 5.5 SEO Optimization (`guides/seo-optimization.md`)
|
|
658
|
+
|
|
659
|
+
**Purpose:** Optimize for search engines
|
|
660
|
+
|
|
661
|
+
**Content:**
|
|
662
|
+
- Meta tags checklist
|
|
663
|
+
- Structured data implementation
|
|
664
|
+
- Sitemap generation
|
|
665
|
+
- Internal linking
|
|
666
|
+
- Performance optimization
|
|
667
|
+
- Mobile optimization
|
|
668
|
+
- Content optimization
|
|
669
|
+
- Monitoring and tools
|
|
670
|
+
|
|
671
|
+
---
|
|
672
|
+
|
|
673
|
+
### 5.6 Deployment (`guides/deployment.md`)
|
|
674
|
+
|
|
675
|
+
**Purpose:** Deploy to production
|
|
676
|
+
|
|
677
|
+
**Content:**
|
|
678
|
+
- Vercel deployment
|
|
679
|
+
- Netlify deployment
|
|
680
|
+
- AWS deployment
|
|
681
|
+
- Custom server deployment
|
|
682
|
+
- Environment variables
|
|
683
|
+
- Domain configuration
|
|
684
|
+
- CDN setup
|
|
685
|
+
- Monitoring
|
|
686
|
+
|
|
687
|
+
---
|
|
688
|
+
|
|
689
|
+
### 5.7 Troubleshooting (`guides/troubleshooting.md`)
|
|
690
|
+
|
|
691
|
+
**Purpose:** Solve common problems
|
|
692
|
+
|
|
693
|
+
**Content:**
|
|
694
|
+
- Build errors
|
|
695
|
+
- Runtime errors
|
|
696
|
+
- Performance issues
|
|
697
|
+
- i18n issues
|
|
698
|
+
- Styling problems
|
|
699
|
+
- TypeScript errors
|
|
700
|
+
- Dependency conflicts
|
|
701
|
+
- Getting help
|
|
702
|
+
|
|
703
|
+
**Format:**
|
|
704
|
+
```markdown
|
|
705
|
+
## Problem: "X is not a function" error
|
|
706
|
+
|
|
707
|
+
**Symptoms:** ...
|
|
708
|
+
**Cause:** ...
|
|
709
|
+
**Solution:** ...
|
|
710
|
+
**Prevention:** ...
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
---
|
|
714
|
+
|
|
715
|
+
## 6. API Reference
|
|
716
|
+
|
|
717
|
+
### 6.1 Components API (`api-reference/components.md`)
|
|
718
|
+
|
|
719
|
+
**Purpose:** Complete component API reference
|
|
720
|
+
|
|
721
|
+
**Content:**
|
|
722
|
+
- Alphabetical component list
|
|
723
|
+
- Props tables
|
|
724
|
+
- Type definitions
|
|
725
|
+
- Default values
|
|
726
|
+
- Required vs optional props
|
|
727
|
+
- Deprecated props
|
|
728
|
+
|
|
729
|
+
**Format:**
|
|
730
|
+
```typescript
|
|
731
|
+
interface HeroSectionProps {
|
|
732
|
+
/** Localized heading text */
|
|
733
|
+
heading: LocalizedString | string;
|
|
734
|
+
/** Localized description */
|
|
735
|
+
description?: LocalizedString | string;
|
|
736
|
+
/** Primary CTA button */
|
|
737
|
+
primaryCTA: CTAConfig;
|
|
738
|
+
/** Optional secondary CTA */
|
|
739
|
+
secondaryCTA?: CTAConfig;
|
|
740
|
+
/** Current locale */
|
|
741
|
+
locale: string;
|
|
742
|
+
/** Animation variant */
|
|
743
|
+
animation?: 'fade' | 'slide' | 'zoom';
|
|
744
|
+
}
|
|
745
|
+
```
|
|
746
|
+
|
|
747
|
+
---
|
|
748
|
+
|
|
749
|
+
### 6.2 Utilities API (`api-reference/utilities.md`)
|
|
750
|
+
|
|
751
|
+
**Purpose:** Utility function reference
|
|
752
|
+
|
|
753
|
+
**Content:**
|
|
754
|
+
- Analytics utilities
|
|
755
|
+
- i18n utilities
|
|
756
|
+
- SEO utilities
|
|
757
|
+
- Form utilities
|
|
758
|
+
- Navigation utilities
|
|
759
|
+
- Theme utilities
|
|
760
|
+
|
|
761
|
+
**Examples:**
|
|
762
|
+
```typescript
|
|
763
|
+
// Analytics
|
|
764
|
+
trackEvent(eventName: string, properties?: Record<string, unknown>): void
|
|
765
|
+
trackPageView(url: string): void
|
|
766
|
+
trackCTAClick(ctaId: string, location: string): void
|
|
767
|
+
|
|
768
|
+
// i18n
|
|
769
|
+
getLocalizedString(value: LocalizedString, locale: string): string
|
|
770
|
+
formatDate(date: Date, locale: string, options?: Intl.DateTimeFormatOptions): string
|
|
771
|
+
formatCurrency(amount: number, locale: string, currency: string): string
|
|
772
|
+
|
|
773
|
+
// SEO
|
|
774
|
+
generateSitemap(config: SitemapConfig): string
|
|
775
|
+
createStructuredData(type: string, data: Record<string, unknown>): object
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
---
|
|
779
|
+
|
|
780
|
+
### 6.3 Hooks API (`api-reference/hooks.md`)
|
|
781
|
+
|
|
782
|
+
**Purpose:** React hooks reference
|
|
783
|
+
|
|
784
|
+
**Content:**
|
|
785
|
+
- Available hooks
|
|
786
|
+
- Parameters
|
|
787
|
+
- Return values
|
|
788
|
+
- Usage examples
|
|
789
|
+
- Common patterns
|
|
790
|
+
|
|
791
|
+
**Examples:**
|
|
792
|
+
```typescript
|
|
793
|
+
// useAnalytics
|
|
794
|
+
const { trackEvent, trackPageView } = useAnalytics();
|
|
795
|
+
|
|
796
|
+
// useLocale
|
|
797
|
+
const { locale, setLocale, t } = useLocale();
|
|
798
|
+
|
|
799
|
+
// useABTest
|
|
800
|
+
const variant = useABTest('test-id', { A: 50, B: 50 });
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
---
|
|
804
|
+
|
|
805
|
+
### 6.4 Types API (`api-reference/types.md`)
|
|
806
|
+
|
|
807
|
+
**Purpose:** TypeScript type reference
|
|
808
|
+
|
|
809
|
+
**Content:**
|
|
810
|
+
- Core types
|
|
811
|
+
- Component prop types
|
|
812
|
+
- Utility types
|
|
813
|
+
- Enums
|
|
814
|
+
- Type guards
|
|
815
|
+
|
|
816
|
+
**Examples:**
|
|
817
|
+
```typescript
|
|
818
|
+
type LocalizedString = {
|
|
819
|
+
[locale: string]: string;
|
|
820
|
+
};
|
|
821
|
+
|
|
822
|
+
type Locale = 'en' | 'fr' | 'es' | 'de';
|
|
823
|
+
|
|
824
|
+
type CTAConfig = {
|
|
825
|
+
text: LocalizedString | string;
|
|
826
|
+
href: string;
|
|
827
|
+
onClick?: () => void;
|
|
828
|
+
};
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
---
|
|
832
|
+
|
|
833
|
+
## 7. Examples
|
|
834
|
+
|
|
835
|
+
### 7.1 Landing Pages (`examples/landing-pages/`)
|
|
836
|
+
|
|
837
|
+
**Files:**
|
|
838
|
+
- `saas-landing.md` - SaaS product landing page
|
|
839
|
+
- `agency-landing.md` - Agency landing page
|
|
840
|
+
- `consulting-landing.md` - Consulting service page
|
|
841
|
+
- `product-launch.md` - Product launch page
|
|
842
|
+
- `event-registration.md` - Event registration page
|
|
843
|
+
|
|
844
|
+
**Each includes:**
|
|
845
|
+
- Complete code
|
|
846
|
+
- Live demo link
|
|
847
|
+
- Screenshot
|
|
848
|
+
- Key features used
|
|
849
|
+
- Customization ideas
|
|
850
|
+
|
|
851
|
+
---
|
|
852
|
+
|
|
853
|
+
### 7.2 Service Sites (`examples/service-sites/`)
|
|
854
|
+
|
|
855
|
+
**Files:**
|
|
856
|
+
- `law-firm.md` - Law firm website
|
|
857
|
+
- `dental-practice.md` - Dental practice site
|
|
858
|
+
- `real-estate.md` - Real estate agency
|
|
859
|
+
- `accounting.md` - Accounting services
|
|
860
|
+
- `consulting.md` - Consulting firm
|
|
861
|
+
|
|
862
|
+
---
|
|
863
|
+
|
|
864
|
+
### 7.3 Multi-Language (`examples/multi-language/`)
|
|
865
|
+
|
|
866
|
+
**Files:**
|
|
867
|
+
- `bilingual-site.md` - English/French site
|
|
868
|
+
- `multilingual-site.md` - 5+ languages
|
|
869
|
+
- `rtl-support.md` - Arabic/Hebrew support
|
|
870
|
+
- `locale-detection.md` - Auto-detection example
|
|
871
|
+
|
|
872
|
+
---
|
|
873
|
+
|
|
874
|
+
### 7.4 E-commerce (`examples/e-commerce/`)
|
|
875
|
+
|
|
876
|
+
**Files:**
|
|
877
|
+
- `product-page.md` - Product detail page
|
|
878
|
+
- `pricing-page.md` - Pricing/plans page
|
|
879
|
+
- `checkout-flow.md` - Checkout process
|
|
880
|
+
- `cart-integration.md` - Shopping cart
|
|
881
|
+
|
|
882
|
+
---
|
|
883
|
+
|
|
884
|
+
## 8. Contributing
|
|
885
|
+
|
|
886
|
+
### 8.1 Development (`contributing/development.md`)
|
|
887
|
+
|
|
888
|
+
**Purpose:** Set up development environment
|
|
889
|
+
|
|
890
|
+
**Content:**
|
|
891
|
+
- Forking the repository
|
|
892
|
+
- Installing dependencies
|
|
893
|
+
- Running dev server
|
|
894
|
+
- Project structure
|
|
895
|
+
- Development workflow
|
|
896
|
+
- Building locally
|
|
897
|
+
- Running tests
|
|
898
|
+
|
|
899
|
+
---
|
|
900
|
+
|
|
901
|
+
### 8.2 Testing (`contributing/testing.md`)
|
|
902
|
+
|
|
903
|
+
**Purpose:** Write and run tests
|
|
904
|
+
|
|
905
|
+
**Content:**
|
|
906
|
+
- Testing philosophy (TDD)
|
|
907
|
+
- Unit tests with Vitest
|
|
908
|
+
- Component tests with Testing Library
|
|
909
|
+
- Integration tests
|
|
910
|
+
- E2E tests
|
|
911
|
+
- Coverage requirements
|
|
912
|
+
- Running tests
|
|
913
|
+
- Writing new tests
|
|
914
|
+
|
|
915
|
+
**Examples:**
|
|
916
|
+
```typescript
|
|
917
|
+
// Component test example
|
|
918
|
+
describe('Button', () => {
|
|
919
|
+
it('renders with text', () => {
|
|
920
|
+
render(<Button>Click me</Button>);
|
|
921
|
+
expect(screen.getByText('Click me')).toBeInTheDocument();
|
|
922
|
+
});
|
|
923
|
+
|
|
924
|
+
it('calls onClick when clicked', async () => {
|
|
925
|
+
const onClick = vi.fn();
|
|
926
|
+
render(<Button onClick={onClick}>Click</Button>);
|
|
927
|
+
await user.click(screen.getByRole('button'));
|
|
928
|
+
expect(onClick).toHaveBeenCalled();
|
|
929
|
+
});
|
|
930
|
+
});
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
---
|
|
934
|
+
|
|
935
|
+
### 8.3 Pull Requests (`contributing/pull-requests.md`)
|
|
936
|
+
|
|
937
|
+
**Purpose:** Submit contributions
|
|
938
|
+
|
|
939
|
+
**Content:**
|
|
940
|
+
- Before you start
|
|
941
|
+
- Creating a branch
|
|
942
|
+
- Making changes
|
|
943
|
+
- Commit message format
|
|
944
|
+
- Pre-commit hooks
|
|
945
|
+
- Submitting PR
|
|
946
|
+
- Review process
|
|
947
|
+
- Addressing feedback
|
|
948
|
+
|
|
949
|
+
**Commit format:**
|
|
950
|
+
```
|
|
951
|
+
<type>: <subject>
|
|
952
|
+
|
|
953
|
+
<body>
|
|
954
|
+
|
|
955
|
+
<footer>
|
|
956
|
+
|
|
957
|
+
Types: feat, fix, docs, style, refactor, test, chore
|
|
958
|
+
```
|
|
959
|
+
|
|
960
|
+
---
|
|
961
|
+
|
|
962
|
+
### 8.4 Code Style (`contributing/code-style.md`)
|
|
963
|
+
|
|
964
|
+
**Purpose:** Maintain consistent code
|
|
965
|
+
|
|
966
|
+
**Content:**
|
|
967
|
+
- TypeScript style
|
|
968
|
+
- React patterns
|
|
969
|
+
- Component structure
|
|
970
|
+
- File naming
|
|
971
|
+
- Import order
|
|
972
|
+
- Comments and documentation
|
|
973
|
+
- Linting and formatting
|
|
974
|
+
- Best practices
|
|
975
|
+
|
|
976
|
+
**Rules:**
|
|
977
|
+
```typescript
|
|
978
|
+
// ✅ Good
|
|
979
|
+
export function ComponentName({ prop1, prop2 }: Props) {
|
|
980
|
+
return <div>{prop1}</div>;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// ❌ Bad
|
|
984
|
+
export const ComponentName = ({ prop1, prop2 }: Props) => {
|
|
985
|
+
return <div>{prop1}</div>;
|
|
986
|
+
};
|
|
987
|
+
```
|
|
988
|
+
|
|
989
|
+
---
|
|
990
|
+
|
|
991
|
+
## 9. Additional Resources
|
|
992
|
+
|
|
993
|
+
### 9.1 Changelog (`CHANGELOG.md`)
|
|
994
|
+
|
|
995
|
+
**Purpose:** Track version history
|
|
996
|
+
|
|
997
|
+
**Content:**
|
|
998
|
+
- Version history
|
|
999
|
+
- Breaking changes
|
|
1000
|
+
- New features
|
|
1001
|
+
- Bug fixes
|
|
1002
|
+
- Deprecations
|
|
1003
|
+
- Migration guides
|
|
1004
|
+
|
|
1005
|
+
---
|
|
1006
|
+
|
|
1007
|
+
### 9.2 FAQ (`FAQ.md`)
|
|
1008
|
+
|
|
1009
|
+
**Purpose:** Answer common questions
|
|
1010
|
+
|
|
1011
|
+
**Content:**
|
|
1012
|
+
- General questions
|
|
1013
|
+
- Technical questions
|
|
1014
|
+
- Troubleshooting
|
|
1015
|
+
- Best practices
|
|
1016
|
+
- Limitations
|
|
1017
|
+
- Roadmap
|
|
1018
|
+
|
|
1019
|
+
---
|
|
1020
|
+
|
|
1021
|
+
### 9.3 Glossary (`GLOSSARY.md`)
|
|
1022
|
+
|
|
1023
|
+
**Purpose:** Define terminology
|
|
1024
|
+
|
|
1025
|
+
**Content:**
|
|
1026
|
+
- Framework terms
|
|
1027
|
+
- Next.js terms
|
|
1028
|
+
- React terms
|
|
1029
|
+
- i18n terms
|
|
1030
|
+
- SEO terms
|
|
1031
|
+
- Analytics terms
|
|
1032
|
+
|
|
1033
|
+
---
|
|
1034
|
+
|
|
1035
|
+
### 9.4 Resources (`RESOURCES.md`)
|
|
1036
|
+
|
|
1037
|
+
**Purpose:** External links and tools
|
|
1038
|
+
|
|
1039
|
+
**Content:**
|
|
1040
|
+
- Useful links
|
|
1041
|
+
- Third-party tools
|
|
1042
|
+
- Design resources
|
|
1043
|
+
- Learning resources
|
|
1044
|
+
- Community resources
|
|
1045
|
+
- Video tutorials
|
|
1046
|
+
|
|
1047
|
+
---
|
|
1048
|
+
|
|
1049
|
+
## 10. Documentation Best Practices
|
|
1050
|
+
|
|
1051
|
+
### Writing Style
|
|
1052
|
+
|
|
1053
|
+
**Guidelines:**
|
|
1054
|
+
- Use active voice
|
|
1055
|
+
- Write in second person ("you")
|
|
1056
|
+
- Be concise and clear
|
|
1057
|
+
- Use examples liberally
|
|
1058
|
+
- Include code snippets
|
|
1059
|
+
- Add screenshots where helpful
|
|
1060
|
+
- Link to related docs
|
|
1061
|
+
- Keep updated
|
|
1062
|
+
|
|
1063
|
+
### Code Examples
|
|
1064
|
+
|
|
1065
|
+
**Requirements:**
|
|
1066
|
+
- Working code (tested)
|
|
1067
|
+
- TypeScript types
|
|
1068
|
+
- Comments for complex logic
|
|
1069
|
+
- Real-world scenarios
|
|
1070
|
+
- Progressive complexity
|
|
1071
|
+
- Copy-paste ready
|
|
1072
|
+
|
|
1073
|
+
### Structure
|
|
1074
|
+
|
|
1075
|
+
**Each doc should have:**
|
|
1076
|
+
1. Title and brief description
|
|
1077
|
+
2. Table of contents (if long)
|
|
1078
|
+
3. Overview/introduction
|
|
1079
|
+
4. Main content sections
|
|
1080
|
+
5. Examples
|
|
1081
|
+
6. Related resources
|
|
1082
|
+
7. Next steps
|
|
1083
|
+
|
|
1084
|
+
---
|
|
1085
|
+
|
|
1086
|
+
## 11. Documentation Maintenance
|
|
1087
|
+
|
|
1088
|
+
### Regular Updates
|
|
1089
|
+
|
|
1090
|
+
**Schedule:**
|
|
1091
|
+
- Review quarterly
|
|
1092
|
+
- Update with releases
|
|
1093
|
+
- Fix reported issues
|
|
1094
|
+
- Add new examples
|
|
1095
|
+
- Improve clarity
|
|
1096
|
+
|
|
1097
|
+
### Community Contributions
|
|
1098
|
+
|
|
1099
|
+
**Process:**
|
|
1100
|
+
- Welcome doc PRs
|
|
1101
|
+
- Review for accuracy
|
|
1102
|
+
- Maintain consistency
|
|
1103
|
+
- Credit contributors
|
|
1104
|
+
- Update CHANGELOG
|
|
1105
|
+
|
|
1106
|
+
---
|
|
1107
|
+
|
|
1108
|
+
## Tools for Documentation
|
|
1109
|
+
|
|
1110
|
+
### Recommended Stack
|
|
1111
|
+
|
|
1112
|
+
- **Markdown** - All docs in markdown
|
|
1113
|
+
- **Docusaurus** or **Nextra** - Doc site generator
|
|
1114
|
+
- **Algolia** - Search functionality
|
|
1115
|
+
- **GitHub Pages** or **Vercel** - Hosting
|
|
1116
|
+
- **Mermaid** - Diagrams
|
|
1117
|
+
- **Carbon** - Code screenshots
|
|
1118
|
+
|
|
1119
|
+
### Documentation Site Features
|
|
1120
|
+
|
|
1121
|
+
- Search
|
|
1122
|
+
- Version selector
|
|
1123
|
+
- Dark mode
|
|
1124
|
+
- Mobile responsive
|
|
1125
|
+
- Copy code button
|
|
1126
|
+
- Live examples
|
|
1127
|
+
- Interactive playground
|
|
1128
|
+
- API explorer
|
|
1129
|
+
|
|
1130
|
+
---
|
|
1131
|
+
|
|
1132
|
+
## Success Metrics
|
|
1133
|
+
|
|
1134
|
+
### Documentation Quality
|
|
1135
|
+
|
|
1136
|
+
**Measure:**
|
|
1137
|
+
- Time to first success
|
|
1138
|
+
- Support ticket reduction
|
|
1139
|
+
- Community contributions
|
|
1140
|
+
- Search effectiveness
|
|
1141
|
+
- User satisfaction
|
|
1142
|
+
- Example usage
|
|
1143
|
+
|
|
1144
|
+
### Continuous Improvement
|
|
1145
|
+
|
|
1146
|
+
**Track:**
|
|
1147
|
+
- Most viewed pages
|
|
1148
|
+
- Search queries
|
|
1149
|
+
- Broken links
|
|
1150
|
+
- Outdated content
|
|
1151
|
+
- Missing topics
|
|
1152
|
+
- User feedback
|
|
1153
|
+
|
|
1154
|
+
---
|
|
1155
|
+
|
|
1156
|
+
This structure provides comprehensive coverage of the framework while being organized for easy navigation and discovery. Each section builds on previous ones, guiding users from beginner to advanced usage.
|