@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
package/docs/EXPORTS.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Export Structure
|
|
2
|
+
|
|
3
|
+
The framework provides separate entry points for different contexts to ensure edge-runtime safety and tree-shaking.
|
|
4
|
+
|
|
5
|
+
## Entry Points
|
|
6
|
+
|
|
7
|
+
### Main Index (`simple-site-framework`)
|
|
8
|
+
Server-safe exports - can be imported in any context including middleware.
|
|
9
|
+
|
|
10
|
+
```typescript
|
|
11
|
+
import {
|
|
12
|
+
// Configuration
|
|
13
|
+
ThemeConfig, SiteContent, NavigationConfig,
|
|
14
|
+
|
|
15
|
+
// Server-safe utilities
|
|
16
|
+
getLocalizedString,
|
|
17
|
+
cn,
|
|
18
|
+
|
|
19
|
+
// Server-safe components (no client hooks)
|
|
20
|
+
TrackedLink,
|
|
21
|
+
FeaturesGrid,
|
|
22
|
+
} from 'simple-site-framework';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Components (`simple-site-framework/components`)
|
|
26
|
+
All UI components with 'use client' directive.
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import {
|
|
30
|
+
Button,
|
|
31
|
+
Header,
|
|
32
|
+
Footer,
|
|
33
|
+
HeroSection,
|
|
34
|
+
ContactSection,
|
|
35
|
+
LanguageSelector,
|
|
36
|
+
I18nMetaTags,
|
|
37
|
+
// ... all other components
|
|
38
|
+
} from 'simple-site-framework/components';
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### i18n Library (`simple-site-framework/lib/i18n`)
|
|
42
|
+
**Middleware-safe** - No client code, can be used in edge runtime.
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
// ✅ Safe to import in middleware
|
|
46
|
+
import {
|
|
47
|
+
createI18nMiddleware,
|
|
48
|
+
setI18nConfig,
|
|
49
|
+
getTextDirection,
|
|
50
|
+
formatDate,
|
|
51
|
+
// ... all i18n utilities
|
|
52
|
+
} from 'simple-site-framework/lib/i18n';
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Client-Only (`simple-site-framework/client`)
|
|
56
|
+
**Browser-only components** - Uses client hooks and browser APIs.
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
// ⚠️ DO NOT import in middleware or SSR context
|
|
60
|
+
import { AnalyticsTracker } from 'simple-site-framework/client';
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Usage Examples
|
|
64
|
+
|
|
65
|
+
### ✅ Correct: Middleware
|
|
66
|
+
```typescript
|
|
67
|
+
// src/middleware.ts
|
|
68
|
+
import { createI18nMiddleware } from 'simple-site-framework/lib/i18n';
|
|
69
|
+
import { i18nConfig } from './config/i18n';
|
|
70
|
+
|
|
71
|
+
export default createI18nMiddleware(i18nConfig);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### ✅ Correct: Layout with Client Component
|
|
75
|
+
```typescript
|
|
76
|
+
// src/app/layout.tsx
|
|
77
|
+
import { Header, Footer } from 'simple-site-framework/components';
|
|
78
|
+
import { AnalyticsTracker } from 'simple-site-framework/client';
|
|
79
|
+
|
|
80
|
+
export default function Layout({ children }) {
|
|
81
|
+
return (
|
|
82
|
+
<html>
|
|
83
|
+
<body>
|
|
84
|
+
<AnalyticsTracker />
|
|
85
|
+
<Header />
|
|
86
|
+
{children}
|
|
87
|
+
<Footer />
|
|
88
|
+
</body>
|
|
89
|
+
</html>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### ❌ Wrong: Importing Client Code in Middleware
|
|
95
|
+
```typescript
|
|
96
|
+
// src/middleware.ts
|
|
97
|
+
import { AnalyticsTracker } from 'simple-site-framework'; // ❌ Will break!
|
|
98
|
+
import { createI18nMiddleware } from 'simple-site-framework'; // ❌ Pulls in client code!
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Bundle Sizes
|
|
102
|
+
|
|
103
|
+
- **Main index**: ~48 KB (server-safe)
|
|
104
|
+
- **Components**: ~1.3 MB (includes all UI components)
|
|
105
|
+
- **lib/i18n**: ~18 KB (middleware-safe)
|
|
106
|
+
- **client**: ~2.3 KB (browser-only)
|
|
107
|
+
|
|
108
|
+
## Migration from Old Structure
|
|
109
|
+
|
|
110
|
+
If you were importing `AnalyticsTracker` from the main index:
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
// Old (before v0.2.0)
|
|
114
|
+
import { AnalyticsTracker } from 'simple-site-framework';
|
|
115
|
+
|
|
116
|
+
// New (v0.2.0+)
|
|
117
|
+
import { AnalyticsTracker } from 'simple-site-framework/client';
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
All other component imports remain unchanged:
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
// Still works the same
|
|
124
|
+
import { Button, Header } from 'simple-site-framework/components';
|
|
125
|
+
```
|