@onexapis/cli 1.1.17 → 1.1.19

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 (61) hide show
  1. package/README.md +82 -16
  2. package/dist/cli.js +621 -294
  3. package/dist/cli.js.map +1 -1
  4. package/dist/cli.mjs +618 -291
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/index.js +73 -278
  7. package/dist/index.js.map +1 -1
  8. package/dist/index.mjs +73 -278
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/templates/default/.env.example +1 -1
  12. package/templates/default/.mcp.json +8 -0
  13. package/templates/default/CLAUDE.md +941 -0
  14. package/templates/default/bundle-entry.ts +18 -0
  15. package/templates/default/index.ts +26 -0
  16. package/templates/default/package.json +34 -0
  17. package/templates/default/pages/about.ts +66 -0
  18. package/templates/default/pages/home.ts +93 -0
  19. package/templates/default/pages/showcase.ts +146 -0
  20. package/templates/default/sections/about/about-default.tsx +237 -0
  21. package/templates/default/sections/about/about.schema.ts +259 -0
  22. package/templates/default/sections/about/index.ts +15 -0
  23. package/templates/default/sections/cta/cta-default.tsx +180 -0
  24. package/templates/default/sections/cta/cta.schema.ts +210 -0
  25. package/templates/default/sections/cta/index.ts +11 -0
  26. package/templates/default/sections/features/features-default.tsx +154 -0
  27. package/templates/default/sections/features/features.schema.ts +330 -0
  28. package/templates/default/sections/features/index.ts +11 -0
  29. package/templates/default/sections/gallery/gallery-default.tsx +134 -0
  30. package/templates/default/sections/gallery/gallery.schema.ts +397 -0
  31. package/templates/default/sections/gallery/index.ts +11 -0
  32. package/templates/default/sections/hero/hero-default.tsx +212 -0
  33. package/templates/default/sections/hero/hero.schema.ts +273 -0
  34. package/templates/default/sections/hero/index.ts +15 -0
  35. package/templates/default/sections/stats/index.ts +11 -0
  36. package/templates/default/sections/stats/stats-default.tsx +103 -0
  37. package/templates/default/sections/stats/stats.schema.ts +266 -0
  38. package/templates/default/sections/testimonials/index.ts +11 -0
  39. package/templates/default/sections/testimonials/testimonials-default.tsx +130 -0
  40. package/templates/default/sections/testimonials/testimonials.schema.ts +371 -0
  41. package/templates/default/sections-registry.ts +32 -0
  42. package/templates/default/theme.config.ts +107 -0
  43. package/templates/default/theme.layout.ts +21 -0
  44. package/templates/default/tsconfig.json +16 -7
  45. package/templates/default/README.md.ejs +0 -129
  46. package/templates/default/esbuild.config.js +0 -81
  47. package/templates/default/package.json.ejs +0 -31
  48. package/templates/default/src/config.ts.ejs +0 -98
  49. package/templates/default/src/index.ts.ejs +0 -11
  50. package/templates/default/src/layout.ts +0 -23
  51. package/templates/default/src/manifest.ts.ejs +0 -47
  52. package/templates/default/src/pages/home.ts.ejs +0 -37
  53. package/templates/default/src/sections/footer/footer-default.tsx +0 -28
  54. package/templates/default/src/sections/footer/footer.schema.ts +0 -45
  55. package/templates/default/src/sections/footer/index.ts +0 -2
  56. package/templates/default/src/sections/header/header-default.tsx +0 -61
  57. package/templates/default/src/sections/header/header.schema.ts +0 -46
  58. package/templates/default/src/sections/header/index.ts +0 -2
  59. package/templates/default/src/sections/hero/hero-default.tsx +0 -52
  60. package/templates/default/src/sections/hero/hero.schema.ts +0 -52
  61. package/templates/default/src/sections/hero/index.ts +0 -2
@@ -0,0 +1,18 @@
1
+ /**
2
+ * My Simple Theme Bundle Entry
3
+ *
4
+ * This file exports all sections, schemas, and configurations.
5
+ * It's compiled into a standalone bundle that can be loaded at runtime.
6
+ */
7
+
8
+ // Export all sections and schemas from registry
9
+ export * from "./sections-registry";
10
+
11
+ // Export theme configuration
12
+ export { default as themeConfig } from "./theme.config";
13
+ export { default as layoutConfig } from "./theme.layout";
14
+
15
+ // Export pages
16
+ export { default as homePageConfig } from "./pages/home";
17
+ export { default as aboutPageConfig } from "./pages/about";
18
+ export { default as showcasePageConfig } from "./pages/showcase";
@@ -0,0 +1,26 @@
1
+ /**
2
+ * My Simple Theme - Main Export
3
+ * Exports theme configuration, layout, and pages
4
+ * Sections are auto-discovered by ThemeRegistryManager
5
+ */
6
+
7
+ // Design system config (colors, fonts, spacing)
8
+ export { default as themeConfig, simpleThemeConfig } from "./theme.config";
9
+
10
+ // Layout config (header/footer sections)
11
+ export { default as layoutConfig, simpleLayoutConfig } from "./theme.layout";
12
+
13
+ // Page configurations
14
+ export { default as homePageConfig } from "./pages/home";
15
+ export { default as aboutPageConfig } from "./pages/about";
16
+ export { default as showcasePageConfig } from "./pages/showcase";
17
+
18
+ // Page map for dynamic access
19
+ export const pages = {
20
+ home: () => import("./pages/home").then((m) => m.default),
21
+ about: () => import("./pages/about").then((m) => m.default),
22
+ showcase: () => import("./pages/showcase").then((m) => m.default),
23
+ };
24
+
25
+ // Page slugs (for discovery)
26
+ export const pageList = ["home", "about", "showcase"] as const;
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "@onex-themes/my-simple",
3
+ "version": "1.0.0",
4
+ "description": "My Simple - A clean and minimal theme for basic websites",
5
+ "private": true,
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "scripts": {
9
+ "dev": "onexthm dev",
10
+ "build": "onexthm build",
11
+ "publish": "onexthm publish",
12
+ "validate": "onexthm validate",
13
+ "type-check": "tsc --noEmit",
14
+ "lint": "echo 'no linter configured'"
15
+ },
16
+ "keywords": [
17
+ "onex",
18
+ "theme",
19
+ "simple",
20
+ "minimal"
21
+ ],
22
+ "author": "OneX Team",
23
+ "license": "MIT",
24
+ "peerDependencies": {
25
+ "@onexapis/core": "^1.0.0",
26
+ "react": "^19.0.0",
27
+ "react-dom": "^19.0.0"
28
+ },
29
+ "devDependencies": {
30
+ "@types/react": "^19.0.0",
31
+ "@types/react-dom": "^19.0.0",
32
+ "typescript": "^5.0.0"
33
+ }
34
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * My Simple Theme - About Page Configuration
3
+ * Page skeleton with sections structure
4
+ */
5
+
6
+ import type { PageConfig } from "@onexapis/core/types";
7
+
8
+ export const aboutPageConfig: Omit<
9
+ PageConfig,
10
+ "id" | "createdAt" | "updatedAt"
11
+ > = {
12
+ title: "About Us - My Simple Theme",
13
+ handle: "about",
14
+ path: "/about",
15
+ type: "about",
16
+ renderMode: "sections",
17
+ themeId: "my-simple",
18
+ editable: true,
19
+ published: true,
20
+
21
+ seo: {
22
+ title: "About Us - My Simple Theme",
23
+ description: "Learn more about us",
24
+ keywords: ["about", "company", "team"],
25
+ },
26
+
27
+ sections: [
28
+ {
29
+ id: "about-1",
30
+ type: "my-simple-about",
31
+ template: "default",
32
+ order: 0,
33
+ enabled: true,
34
+ settings: {
35
+ heading: "About Our Company",
36
+ subheading: "Our Story",
37
+ description:
38
+ "We are a team dedicated to creating simple, elegant solutions for the web. Our mission is to make beautiful websites accessible to everyone.",
39
+ secondaryDescription:
40
+ "Founded with a vision to simplify the digital experience, we have grown into a team of passionate creators dedicated to excellence.",
41
+ badgeText: "About Us",
42
+ showImage: true,
43
+ layout: "image-right",
44
+ },
45
+ components: [],
46
+ blocks: [],
47
+ },
48
+ {
49
+ id: "testimonials-1",
50
+ type: "my-simple-testimonials",
51
+ template: "default",
52
+ order: 1,
53
+ enabled: true,
54
+ settings: {
55
+ sectionTitle: "What People Say About Us",
56
+ sectionSubtitle: "Hear from our satisfied customers",
57
+ columns: "3",
58
+ backgroundColor: "#F9FAFB",
59
+ },
60
+ components: [],
61
+ blocks: [],
62
+ },
63
+ ],
64
+ };
65
+
66
+ export default aboutPageConfig;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * My Simple Theme - Home Page Configuration
3
+ * Page skeleton with sections structure
4
+ */
5
+
6
+ import type { PageConfig } from "@onexapis/core/types";
7
+
8
+ export const homePageConfig: Omit<
9
+ PageConfig,
10
+ "id" | "createdAt" | "updatedAt"
11
+ > = {
12
+ title: "My Simple Theme - Home",
13
+ handle: "home",
14
+ path: "/",
15
+ type: "home",
16
+ renderMode: "sections",
17
+ themeId: "my-simple",
18
+ editable: true,
19
+ published: true,
20
+
21
+ seo: {
22
+ title: "My Simple Theme - Home",
23
+ description: "A simple, clean theme for your website",
24
+ keywords: ["simple", "theme", "website"],
25
+ },
26
+
27
+ sections: [
28
+ {
29
+ id: "hero-1",
30
+ type: "my-simple-hero",
31
+ template: "default",
32
+ order: 0,
33
+ enabled: true,
34
+ settings: {
35
+ title: "Welcome to My Simple Theme",
36
+ subtitle: "A clean and minimal theme for your website",
37
+ buttonText: "Learn More",
38
+ buttonLink: "/about",
39
+ secondaryButtonText: "View Showcase",
40
+ secondaryButtonLink: "/showcase",
41
+ badgeText: "New Release",
42
+ showBadge: true,
43
+ showImage: false,
44
+ },
45
+ components: [],
46
+ blocks: [],
47
+ },
48
+ {
49
+ id: "features-1",
50
+ type: "my-simple-features",
51
+ template: "default",
52
+ order: 1,
53
+ enabled: true,
54
+ settings: {
55
+ sectionTitle: "Why Choose Us",
56
+ sectionSubtitle: "Built with the best tools and practices",
57
+ columns: "3",
58
+ backgroundColor: "#F9FAFB",
59
+ },
60
+ components: [],
61
+ blocks: [],
62
+ },
63
+ {
64
+ id: "stats-1",
65
+ type: "my-simple-stats",
66
+ template: "default",
67
+ order: 2,
68
+ enabled: true,
69
+ settings: {
70
+ sectionTitle: "Our Impact",
71
+ columns: "4",
72
+ backgroundColor: "#111827",
73
+ },
74
+ components: [],
75
+ blocks: [],
76
+ },
77
+ {
78
+ id: "cta-1",
79
+ type: "my-simple-cta",
80
+ template: "default",
81
+ order: 3,
82
+ enabled: true,
83
+ settings: {
84
+ backgroundColor: "#3B82F6",
85
+ layout: "centered",
86
+ },
87
+ components: [],
88
+ blocks: [],
89
+ },
90
+ ],
91
+ };
92
+
93
+ export default homePageConfig;
@@ -0,0 +1,146 @@
1
+ /**
2
+ * My Simple Theme - Showcase Page Configuration
3
+ * Demonstrates all available sections
4
+ */
5
+
6
+ import type { PageConfig } from "@onexapis/core/types";
7
+
8
+ export const showcasePageConfig: Omit<
9
+ PageConfig,
10
+ "id" | "createdAt" | "updatedAt"
11
+ > = {
12
+ title: "Showcase - My Simple Theme",
13
+ handle: "showcase",
14
+ path: "/showcase",
15
+ type: "custom",
16
+ renderMode: "sections",
17
+ themeId: "my-simple",
18
+ editable: true,
19
+ published: true,
20
+
21
+ seo: {
22
+ title: "Showcase - My Simple Theme",
23
+ description: "A showcase of all available sections in the My Simple Theme",
24
+ keywords: ["showcase", "sections", "demo"],
25
+ },
26
+
27
+ sections: [
28
+ {
29
+ id: "showcase-hero",
30
+ type: "my-simple-hero",
31
+ template: "default",
32
+ order: 0,
33
+ enabled: true,
34
+ settings: {
35
+ title: "Section Showcase",
36
+ subtitle: "Explore all the sections available in the My Simple Theme",
37
+ buttonText: "Explore",
38
+ buttonLink: "#features",
39
+ secondaryButtonText: "Back Home",
40
+ secondaryButtonLink: "/",
41
+ badgeText: "Showcase",
42
+ showBadge: true,
43
+ showImage: false,
44
+ backgroundColor: "#7C3AED",
45
+ },
46
+ components: [],
47
+ blocks: [],
48
+ },
49
+ {
50
+ id: "showcase-features",
51
+ type: "my-simple-features",
52
+ template: "default",
53
+ order: 1,
54
+ enabled: true,
55
+ settings: {
56
+ sectionTitle: "Features Section",
57
+ sectionSubtitle: "Block-based feature grid with icons",
58
+ columns: "3",
59
+ backgroundColor: "#F9FAFB",
60
+ },
61
+ components: [],
62
+ blocks: [],
63
+ },
64
+ {
65
+ id: "showcase-stats",
66
+ type: "my-simple-stats",
67
+ template: "default",
68
+ order: 2,
69
+ enabled: true,
70
+ settings: {
71
+ sectionTitle: "Stats Section",
72
+ columns: "4",
73
+ backgroundColor: "#111827",
74
+ },
75
+ components: [],
76
+ blocks: [],
77
+ },
78
+ {
79
+ id: "showcase-about",
80
+ type: "my-simple-about",
81
+ template: "default",
82
+ order: 3,
83
+ enabled: true,
84
+ settings: {
85
+ heading: "About Section",
86
+ subheading: "With image-left layout",
87
+ description:
88
+ "This about section supports multiple layouts including centered, image-left, and image-right.",
89
+ secondaryDescription:
90
+ "It uses badge, heading, subheading, divider, paragraph, and image components.",
91
+ badgeText: "About",
92
+ showImage: true,
93
+ layout: "image-left",
94
+ },
95
+ components: [],
96
+ blocks: [],
97
+ },
98
+ {
99
+ id: "showcase-testimonials",
100
+ type: "my-simple-testimonials",
101
+ template: "default",
102
+ order: 4,
103
+ enabled: true,
104
+ settings: {
105
+ sectionTitle: "Testimonials Section",
106
+ sectionSubtitle:
107
+ "Block-based testimonial cards with quotes and ratings",
108
+ columns: "3",
109
+ backgroundColor: "#FFFFFF",
110
+ },
111
+ components: [],
112
+ blocks: [],
113
+ },
114
+ {
115
+ id: "showcase-gallery",
116
+ type: "my-simple-gallery",
117
+ template: "default",
118
+ order: 5,
119
+ enabled: true,
120
+ settings: {
121
+ sectionTitle: "Gallery Section",
122
+ sectionSubtitle: "Block-based responsive image gallery",
123
+ columns: "3",
124
+ gap: "md",
125
+ backgroundColor: "#F9FAFB",
126
+ },
127
+ components: [],
128
+ blocks: [],
129
+ },
130
+ {
131
+ id: "showcase-cta",
132
+ type: "my-simple-cta",
133
+ template: "default",
134
+ order: 6,
135
+ enabled: true,
136
+ settings: {
137
+ backgroundColor: "#3B82F6",
138
+ layout: "centered",
139
+ },
140
+ components: [],
141
+ blocks: [],
142
+ },
143
+ ],
144
+ };
145
+
146
+ export default showcasePageConfig;
@@ -0,0 +1,237 @@
1
+ "use client";
2
+
3
+ import type { SectionComponentProps } from "@onexapis/core/types";
4
+ import coreRenderers from "@onexapis/core/renderers";
5
+ import coreUtils from "@onexapis/core/utils";
6
+
7
+ const { ComponentRenderer } = coreRenderers;
8
+ const { toComponentInstance, getSectionValues, filterEnabledComponents } =
9
+ coreUtils;
10
+
11
+ export function AboutDefault({
12
+ section,
13
+ schema,
14
+ isEditing,
15
+ }: SectionComponentProps) {
16
+ // Get components from the first block (preferred) or fallback to section.components
17
+ const contentBlock = (section.blocks || [])[0];
18
+ const components = contentBlock?.components
19
+ ? filterEnabledComponents(contentBlock.components)
20
+ : filterEnabledComponents(section.components || []);
21
+
22
+ // Find components by slot (preferred) OR legacy ID (backward compatibility)
23
+ const badgeComp = components.find(
24
+ (c) => c.slot === "badge" || c.id === "about-badge"
25
+ );
26
+ const headingComp = components.find(
27
+ (c) => c.slot === "heading" || c.id === "about-heading"
28
+ );
29
+ const subheadingComp = components.find(
30
+ (c) => c.slot === "subheading" || c.id === "about-subheading"
31
+ );
32
+ const dividerComp = components.find(
33
+ (c) => c.slot === "divider" || c.id === "about-divider"
34
+ );
35
+ const descriptionComp = components.find(
36
+ (c) => c.slot === "description" || c.id === "about-description"
37
+ );
38
+ const secondaryDescComp = components.find(
39
+ (c) =>
40
+ c.slot === "secondary-description" ||
41
+ c.id === "about-secondary-description"
42
+ );
43
+ const imageComp = components.find(
44
+ (c) => c.slot === "image" || c.id === "about-image"
45
+ );
46
+
47
+ const { settings } = getSectionValues(section, schema);
48
+ const {
49
+ heading,
50
+ subheading,
51
+ description,
52
+ secondaryDescription,
53
+ badgeText,
54
+ showImage,
55
+ layout,
56
+ } = settings;
57
+
58
+ const isTwoColumn = layout === "image-left" || layout === "image-right";
59
+ const isImageLeft = layout === "image-left";
60
+
61
+ // Block-level settings
62
+ const blockSettings = contentBlock?.settings || {};
63
+ const alignMap: Record<string, string> = {
64
+ left: "text-left",
65
+ center: "text-center",
66
+ right: "text-right",
67
+ };
68
+ const widthMap: Record<string, string> = {
69
+ sm: "max-w-2xl",
70
+ md: "max-w-3xl",
71
+ lg: "max-w-4xl",
72
+ full: "max-w-6xl",
73
+ };
74
+ const blockAlign =
75
+ alignMap[blockSettings.contentAlignment as string] || "text-center";
76
+ const blockWidth =
77
+ widthMap[blockSettings.contentWidth as string] || "max-w-4xl";
78
+
79
+ const renderContent = () => (
80
+ <div className={isTwoColumn ? "" : "text-center"}>
81
+ {/* Badge */}
82
+ {badgeComp ? (
83
+ <div
84
+ key="badge-wrapper"
85
+ className={`mb-4 ${isTwoColumn ? "" : "inline-block"}`}
86
+ >
87
+ <ComponentRenderer
88
+ instance={toComponentInstance(badgeComp)}
89
+ sectionId={section.id}
90
+ isEditing={isEditing}
91
+ />
92
+ </div>
93
+ ) : badgeText ? (
94
+ <span
95
+ key="badge-fallback"
96
+ className={`inline-block mb-4 px-3 py-1 text-sm font-semibold text-blue-600 bg-blue-50 rounded-full`}
97
+ >
98
+ {String(badgeText)}
99
+ </span>
100
+ ) : null}
101
+
102
+ {/* Heading */}
103
+ {headingComp ? (
104
+ <ComponentRenderer
105
+ key="heading"
106
+ instance={toComponentInstance(headingComp)}
107
+ sectionId={section.id}
108
+ isEditing={isEditing}
109
+ />
110
+ ) : heading ? (
111
+ <h2
112
+ key="heading-fallback"
113
+ className="text-4xl font-bold text-gray-900 mb-2"
114
+ >
115
+ {String(heading)}
116
+ </h2>
117
+ ) : null}
118
+
119
+ {/* Subheading */}
120
+ {subheadingComp ? (
121
+ <ComponentRenderer
122
+ key="subheading"
123
+ instance={toComponentInstance(subheadingComp)}
124
+ sectionId={section.id}
125
+ isEditing={isEditing}
126
+ />
127
+ ) : subheading ? (
128
+ <h3
129
+ key="subheading-fallback"
130
+ className="text-xl font-medium text-gray-500 mb-4"
131
+ >
132
+ {String(subheading)}
133
+ </h3>
134
+ ) : null}
135
+
136
+ {/* Divider */}
137
+ {dividerComp && (
138
+ <ComponentRenderer
139
+ key="divider"
140
+ instance={toComponentInstance(dividerComp)}
141
+ sectionId={section.id}
142
+ isEditing={isEditing}
143
+ />
144
+ )}
145
+
146
+ {/* Description */}
147
+ {descriptionComp ? (
148
+ <ComponentRenderer
149
+ key="description"
150
+ instance={toComponentInstance(descriptionComp)}
151
+ sectionId={section.id}
152
+ isEditing={isEditing}
153
+ />
154
+ ) : description ? (
155
+ <p
156
+ key="description-fallback"
157
+ className="text-lg text-gray-600 leading-relaxed mb-4"
158
+ >
159
+ {String(description)}
160
+ </p>
161
+ ) : null}
162
+
163
+ {/* Secondary Description */}
164
+ {secondaryDescComp ? (
165
+ <ComponentRenderer
166
+ key="secondary-description"
167
+ instance={toComponentInstance(secondaryDescComp)}
168
+ sectionId={section.id}
169
+ isEditing={isEditing}
170
+ />
171
+ ) : secondaryDescription ? (
172
+ <p
173
+ key="secondary-description-fallback"
174
+ className="text-base text-gray-500 leading-relaxed"
175
+ >
176
+ {String(secondaryDescription)}
177
+ </p>
178
+ ) : null}
179
+ </div>
180
+ );
181
+
182
+ const renderImage = () => {
183
+ if (showImage === false) return null;
184
+ if (!imageComp) return null;
185
+
186
+ return (
187
+ <div>
188
+ <ComponentRenderer
189
+ key={imageComp.id}
190
+ instance={toComponentInstance(imageComp)}
191
+ sectionId={section.id}
192
+ isEditing={isEditing}
193
+ />
194
+ </div>
195
+ );
196
+ };
197
+
198
+ return (
199
+ <section
200
+ className="py-16 bg-white"
201
+ data-section="about"
202
+ data-section-id={section.id}
203
+ data-section-template="default"
204
+ data-section-name="Simple About"
205
+ >
206
+ <div
207
+ className="container mx-auto px-4 max-w-6xl"
208
+ data-section-id={section.id}
209
+ data-block-id={contentBlock?.id || "about-content-1"}
210
+ data-block-type="about-content"
211
+ >
212
+ {isTwoColumn ? (
213
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-12 items-center">
214
+ {isImageLeft ? (
215
+ <>
216
+ {renderImage()}
217
+ {renderContent()}
218
+ </>
219
+ ) : (
220
+ <>
221
+ {renderContent()}
222
+ {renderImage()}
223
+ </>
224
+ )}
225
+ </div>
226
+ ) : (
227
+ <div className={`${blockWidth} mx-auto`}>
228
+ {renderContent()}
229
+ {renderImage()}
230
+ </div>
231
+ )}
232
+ </div>
233
+ </section>
234
+ );
235
+ }
236
+
237
+ export default AboutDefault;