@forgewp/compiler 0.4.1 → 0.4.3

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.
Files changed (51) hide show
  1. package/README.md +11 -3
  2. package/bin/add.js +15 -6
  3. package/bin/analyze.js +66 -1
  4. package/bin/cli.js +20 -12
  5. package/bin/fresh.js +1 -1
  6. package/bin/make-block.js +11 -0
  7. package/bin/make-island.js +11 -0
  8. package/bin/{make-template.js → make-loop.js} +24 -19
  9. package/bin/make-page.js +83 -0
  10. package/bin/make-post-type.js +11 -0
  11. package/bin/make-sandbox.js +558 -0
  12. package/bin/sync-hooks.js +221 -0
  13. package/lib/adapters/html-adapter.js +8 -3
  14. package/lib/adapters/stub-adapter.js +6 -2
  15. package/lib/asset-loader.js +22 -0
  16. package/lib/blueprints.js +122 -1434
  17. package/lib/functions-builder.js +1172 -3
  18. package/lib/generate-theme.js +340 -23
  19. package/lib/hydration-scanner.js +170 -11
  20. package/lib/index.d.ts +38 -1
  21. package/lib/index.js +1 -1
  22. package/lib/load-config.js +98 -0
  23. package/lib/markup-processor.js +110 -0
  24. package/lib/page-config-plugin.js +40 -0
  25. package/lib/php-builders.js +4 -2
  26. package/lib/react-adapter.js +82 -23
  27. package/lib/render-theme.mts +115 -25
  28. package/lib/validate-export.js +49 -0
  29. package/package.json +4 -2
  30. package/templates/PresetsStyle.tsx +74 -0
  31. package/templates/SEO.tsx +109 -0
  32. package/templates/auth/components/dashboard-view-wrapper.tsx +168 -0
  33. package/templates/auth/components/forgot-password-form-wrapper.tsx +133 -0
  34. package/templates/auth/components/login-form-wrapper.tsx +203 -0
  35. package/templates/auth/components/reset-password-form-wrapper.tsx +182 -0
  36. package/templates/auth/components/signup-form-wrapper.tsx +257 -0
  37. package/templates/auth/components/verify-email-view-wrapper.tsx +265 -0
  38. package/templates/auth/pages/DashboardPage.tsx +15 -0
  39. package/templates/auth/pages/ForgotPasswordPage.tsx +14 -0
  40. package/templates/auth/pages/LoginPage.tsx +14 -0
  41. package/templates/auth/pages/ResetPasswordPage.tsx +14 -0
  42. package/templates/auth/pages/SignUpPage.tsx +14 -0
  43. package/templates/auth/pages/VerifyEmailPage.tsx +14 -0
  44. package/templates/forgewp-config.ts +110 -0
  45. package/templates/menus.json +11 -0
  46. package/templates/mock-data.json +123 -0
  47. package/templates/products.json +5 -0
  48. package/templates/roles.json +7 -0
  49. package/templates/sessions.json +1 -0
  50. package/templates/users.json +34 -0
  51. package/templates/wordpress.tsx +1390 -0
@@ -0,0 +1,110 @@
1
+ export interface ColorPreset {
2
+ name: string;
3
+ slug: string;
4
+ color: string;
5
+ }
6
+
7
+ export interface FontSizePreset {
8
+ name: string;
9
+ slug: string;
10
+ size: string;
11
+ }
12
+
13
+ export interface FontFamilyPreset {
14
+ name: string;
15
+ slug: string;
16
+ fontFamily: string;
17
+ }
18
+
19
+ export interface CustomPostTypeConfig {
20
+ translatable?: boolean;
21
+ labels?: {
22
+ singular?: string;
23
+ plural?: string;
24
+ };
25
+ }
26
+
27
+ export interface ForgeWPI18nConfig {
28
+ locales: string[];
29
+ defaultLocale: string;
30
+ provider?: 'local' | 'deepl' | 'libretranslate' | 'google' | string;
31
+ cache?: string;
32
+ providerConfig?: {
33
+ apiKey?: string;
34
+ endpoint?: string;
35
+ };
36
+ }
37
+
38
+ export interface ForgeWpSeoSitemapsConfig {
39
+ postTypes: string[];
40
+ taxonomies: string[];
41
+ }
42
+
43
+ export interface ForgeWPPlugin {
44
+ name: string;
45
+ validateConfig?: (config: ForgeWPThemeConfig, themeRoot: string) => void;
46
+ transformFunctionsPhp?: (php: string, config: ForgeWPThemeConfig, themeRoot: string) => string;
47
+ }
48
+
49
+ export interface ForgeWPThemeConfig {
50
+ name: string;
51
+ slug: string;
52
+ version: string;
53
+ description: string;
54
+ textDomain: string;
55
+ configVersion?: number;
56
+ favicon?: string;
57
+ headerPath?: string;
58
+ footerPath?: string;
59
+ seo?: {
60
+ sitemaps?: ForgeWpSeoSitemapsConfig;
61
+ plugins?: {
62
+ yoast?: boolean;
63
+ rankMath?: boolean;
64
+ };
65
+ };
66
+ frameworkAdapter?: 'react' | 'html' | 'stub';
67
+ style?: 'forgewp' | 'shadcn';
68
+ headless?: {
69
+ apiUrl?: string;
70
+ jwtAuth?: boolean;
71
+ };
72
+ auth?: {
73
+ loginField?: 'usernameOnly' | 'emailOnly' | 'usernameAndEmail';
74
+ defaultRole?: string;
75
+ reservedUsernames?: string[];
76
+ features?: {
77
+ registration?: boolean;
78
+ emailVerification?: boolean;
79
+ autoLoginAfterSignup?: boolean;
80
+ };
81
+ emails?: {
82
+ verification?: {
83
+ subject?: string;
84
+ body?: string;
85
+ };
86
+ passwordReset?: {
87
+ subject?: string;
88
+ body?: string;
89
+ };
90
+ };
91
+ };
92
+ postTypes?: Record<string, CustomPostTypeConfig>;
93
+ i18n?: ForgeWPI18nConfig;
94
+ settings?: {
95
+ layout?: {
96
+ contentSize?: string;
97
+ wideSize?: string;
98
+ };
99
+ color?: {
100
+ palette?: ColorPreset[];
101
+ custom?: boolean;
102
+ };
103
+ typography?: {
104
+ fontSizes?: FontSizePreset[];
105
+ fontFamilies?: FontFamilyPreset[];
106
+ googleFonts?: string[];
107
+ };
108
+ };
109
+ plugins?: ForgeWPPlugin[];
110
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "_comment": "⚡ ForgeWP Navigation Menus — Edit this file to add/remove links in local dev.",
3
+ "primary": [
4
+ { "title": "Hotelvergleiche", "url": "/hotelvergleiche" },
5
+ { "title": "Hotels", "url": "/hotels" },
6
+ { "title": "Über uns", "url": "/about" }
7
+ ],
8
+ "utility": [
9
+ { "title": "Kontakt", "url": "/contact" }
10
+ ]
11
+ }
@@ -0,0 +1,123 @@
1
+ {
2
+ "post": [
3
+ {
4
+ "id": 1,
5
+ "title": "Welcome to ForgeWP: The Headless Revolution",
6
+ "excerpt": "Discover how ForgeWP bridges standard WordPress themes with blistering fast React architectures.",
7
+ "content": "<p>This is the first mock post. In local dev, you can modify <code>cms/mock-data.json</code> to test layout content changes.</p>",
8
+ "date": "2026-05-10T09:00:00Z",
9
+ "author": "Antigravity",
10
+ "featuredImage": {
11
+ "id": 101,
12
+ "url": "https://picsum.photos/seed/forgewp/1200/630",
13
+ "alt": "ForgeWP Logo and Brand Artwork",
14
+ "title": "ForgeWP Logo",
15
+ "caption": "A high-fidelity minimalist logo graphic.",
16
+ "width": 1200,
17
+ "height": 630,
18
+ "sizes": {
19
+ "thumbnail": { "url": "https://picsum.photos/seed/forgewp/150/150", "width": 150, "height": 150 },
20
+ "medium": { "url": "https://picsum.photos/seed/forgewp/300/300", "width": 300, "height": 300 },
21
+ "large": { "url": "https://picsum.photos/seed/forgewp/1024/768", "width": 1024, "height": 768 }
22
+ }
23
+ },
24
+ "customFields": { "read_time": "5" },
25
+ "_terms": {
26
+ "category": [
27
+ { "id": 1, "slug": "tutorials", "name": "Tutorials" },
28
+ { "id": 2, "slug": "framework", "name": "Framework" }
29
+ ],
30
+ "post_tag": [
31
+ { "id": 10, "slug": "react", "name": "React" },
32
+ { "id": 11, "slug": "wordpress", "name": "WordPress" }
33
+ ]
34
+ }
35
+ },
36
+ {
37
+ "id": 2,
38
+ "title": "Unlocking Brutalist Web Design Aesthetics",
39
+ "excerpt": "A deep dive into high-contrast grids, sharp corners, and premium flat shadows in modern interfaces.",
40
+ "content": "<p>This is the second mock post. Style these grids using beautiful Tailwind utilities.</p>",
41
+ "date": "2026-05-12T14:30:00Z",
42
+ "author": "DeepMind Partner",
43
+ "featuredImage": "https://picsum.photos/seed/brutalist/1200/630",
44
+ "customFields": { "read_time": "8" },
45
+ "_terms": {
46
+ "category": [
47
+ { "id": 3, "slug": "design", "name": "Design" },
48
+ { "id": 4, "slug": "css", "name": "CSS" }
49
+ ],
50
+ "post_tag": [
51
+ { "id": 12, "slug": "brutalism", "name": "Brutalism" },
52
+ { "id": 13, "slug": "tailwind", "name": "Tailwind" }
53
+ ]
54
+ }
55
+ }
56
+ ],
57
+ "project": [
58
+ {
59
+ "id": 1,
60
+ "title": "ForgeWP Scaffolding Platform",
61
+ "excerpt": "Building a custom compiler framework to transpile React elements into standard PHP themes.",
62
+ "content": "<p>Detailed description of the ForgeWP compiler pipeline project.</p>",
63
+ "date": "2026-05-15T12:00:00Z",
64
+ "author": "Lead Architect",
65
+ "featuredImage": "https://picsum.photos/seed/platform/1200/630",
66
+ "customFields": {
67
+ "client_name": "El Dorado",
68
+ "project_budget": "45000",
69
+ "status": "active"
70
+ },
71
+ "_terms": {
72
+ "project_type": [{ "id": 20, "slug": "open-source", "name": "Open Source" }],
73
+ "technology": [{ "id": 30, "slug": "react", "name": "React" }]
74
+ }
75
+ },
76
+ {
77
+ "id": 2,
78
+ "title": "Brutalist Starter Theme",
79
+ "excerpt": "A clean, responsive, and robust high-contrast interface leveraging Tailwind CSS v4.",
80
+ "content": "<p>A brutalist theme showcasing raw black borders and vivid accent colors.</p>",
81
+ "date": "2026-05-16T16:00:00Z",
82
+ "author": "Theme Engineer",
83
+ "featuredImage": "https://picsum.photos/seed/starter/1200/630",
84
+ "customFields": {
85
+ "client_name": "ForgeWP Community",
86
+ "project_budget": "0",
87
+ "status": "completed"
88
+ },
89
+ "_terms": {
90
+ "project_type": [{ "id": 20, "slug": "open-source", "name": "Open Source" }],
91
+ "technology": [{ "id": 32, "slug": "tailwind", "name": "Tailwind CSS" }]
92
+ }
93
+ }
94
+ ],
95
+ "attachment": [
96
+ {
97
+ "id": 101,
98
+ "url": "https://picsum.photos/seed/forgewp/1200/630",
99
+ "alt": "ForgeWP Logo and Brand Artwork",
100
+ "title": "ForgeWP Logo",
101
+ "caption": "A high-fidelity minimalist logo graphic.",
102
+ "width": 1200,
103
+ "height": 630,
104
+ "sizes": {
105
+ "thumbnail": { "url": "https://picsum.photos/seed/forgewp/150/150", "width": 150, "height": 150 },
106
+ "medium": { "url": "https://picsum.photos/seed/forgewp/300/300", "width": 300, "height": 300 },
107
+ "large": { "url": "https://picsum.photos/seed/forgewp/1024/768", "width": 1024, "height": 768 }
108
+ }
109
+ },
110
+ {
111
+ "id": 102,
112
+ "url": "https://picsum.photos/seed/layout/1200/800",
113
+ "alt": "Brutalist Layout Preview",
114
+ "title": "Layout Preview",
115
+ "width": 1200,
116
+ "height": 800,
117
+ "sizes": {
118
+ "thumbnail": { "url": "https://picsum.photos/seed/layout/150/150", "width": 150, "height": 150 },
119
+ "medium": { "url": "https://picsum.photos/seed/layout/300/300", "width": 300, "height": 300 }
120
+ }
121
+ }
122
+ ]
123
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "product": [],
3
+ "_taxonomy_product_cat": [],
4
+ "_taxonomy_product_tag": []
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "administrator": ["manage_options", "edit_theme_options", "edit_posts", "edit_others_posts", "publish_posts", "read"],
3
+ "editor": ["edit_posts", "edit_others_posts", "publish_posts", "read"],
4
+ "author": ["edit_posts", "publish_posts", "read"],
5
+ "subscriber": ["read"],
6
+ "customer": ["read"]
7
+ }
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1,34 @@
1
+ [
2
+ {
3
+ "id": 1,
4
+ "username": "admin",
5
+ "email": "admin@forgewp.local",
6
+ "displayName": "Concrete Designer",
7
+ "roles": ["administrator"],
8
+ "avatarUrl": "https://picsum.photos/seed/avatar1/150/150"
9
+ },
10
+ {
11
+ "id": 2,
12
+ "username": "subscriber",
13
+ "email": "user@forgewp.local",
14
+ "displayName": "Sub Concrete",
15
+ "roles": ["subscriber"],
16
+ "avatarUrl": "https://picsum.photos/seed/avatar2/150/150"
17
+ },
18
+ {
19
+ "id": 3,
20
+ "username": "editor",
21
+ "email": "editor@forgewp.local",
22
+ "displayName": "Concrete Editor",
23
+ "roles": ["editor"],
24
+ "avatarUrl": "https://picsum.photos/seed/avatar3/150/150"
25
+ },
26
+ {
27
+ "id": 4,
28
+ "username": "customer",
29
+ "email": "customer@forgewp.local",
30
+ "displayName": "Concrete Customer",
31
+ "roles": ["customer"],
32
+ "avatarUrl": "https://picsum.photos/seed/avatar4/150/150"
33
+ }
34
+ ]