@camox/cli 0.2.0-alpha.4

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/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@camox/cli",
3
+ "version": "0.2.0-alpha.4",
4
+ "bin": {
5
+ "camox": "./dist/index.js"
6
+ },
7
+ "files": [
8
+ "dist",
9
+ "template"
10
+ ],
11
+ "type": "module",
12
+ "main": "./dist/index.js",
13
+ "exports": {
14
+ ".": "./dist/index.js"
15
+ },
16
+ "dependencies": {
17
+ "@clack/prompts": "^0.10.0",
18
+ "@optique/core": "*",
19
+ "@optique/run": "*",
20
+ "@orpc/client": "^1.13.13",
21
+ "@orpc/server": "^1.13.13"
22
+ },
23
+ "devDependencies": {
24
+ "@types/node": "^24.6.2",
25
+ "@typescript/native-preview": "^7.0.0-dev",
26
+ "oxlint": "^0.15.0",
27
+ "tsup": "^8.4.0",
28
+ "typescript": "^5.7.2"
29
+ },
30
+ "scripts": {
31
+ "build": "tsup",
32
+ "dev": "tsup --watch",
33
+ "lint": "oxlint",
34
+ "check": "tsgo --noEmit && oxlint --fix"
35
+ }
36
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema.json",
3
+ "style": "new-york",
4
+ "rsc": false,
5
+ "tsx": true,
6
+ "tailwind": {
7
+ "config": "",
8
+ "css": "src/styles.css",
9
+ "baseColor": "gray",
10
+ "cssVariables": true,
11
+ "prefix": ""
12
+ },
13
+ "iconLibrary": "lucide",
14
+ "aliases": {
15
+ "components": "@/components",
16
+ "utils": "@/lib/utils",
17
+ "ui": "@/components/ui",
18
+ "lib": "@/lib",
19
+ "hooks": "@/hooks"
20
+ },
21
+ "registries": {}
22
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "{{projectSlug}}",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "vite dev --port 3000",
7
+ "start": "node .output/server/index.mjs",
8
+ "build": "vite build",
9
+ "serve": "vite preview",
10
+ "lint": "oxlint",
11
+ "check": "tsgo --noEmit && oxlint --fix"
12
+ },
13
+ "dependencies": {
14
+ "@radix-ui/react-slot": "^1.2.3",
15
+ "@tailwindcss/vite": "^4.2.2",
16
+ "@tanstack/react-router": "^1.166.2",
17
+ "@tanstack/react-start": "^1.166.2",
18
+ "@tanstack/router-plugin": "^1.166.2",
19
+ "camox": "{{camoxVersion}}",
20
+ "class-variance-authority": "^0.7.1",
21
+ "clsx": "^2.1.1",
22
+ "lucide-react": "^0.476.0",
23
+ "react": "^19.1.0",
24
+ "react-dom": "^19.1.0",
25
+ "tailwind-merge": "^3.0.2",
26
+ "tailwindcss": "^4.0.6"
27
+ },
28
+ "devDependencies": {
29
+ "@types/react": "^19.0.8",
30
+ "@types/react-dom": "^19.0.3",
31
+ "@typescript/native-preview": "^7.0.0-dev",
32
+ "@vitejs/plugin-react": "^6.0.1",
33
+ "babel-plugin-react-compiler": "19.1.0-rc.3",
34
+ "oxlint": "^0.15.15",
35
+ "tw-animate-css": "^1.3.6",
36
+ "typescript": "^5.7.2",
37
+ "vite": "8.0.1"
38
+ }
39
+ }
@@ -0,0 +1,67 @@
1
+ import { Link } from "@tanstack/react-router";
2
+ import { Type, createBlock } from "camox/createBlock";
3
+
4
+ const footer = createBlock({
5
+ id: "footer",
6
+ title: "Footer",
7
+ layoutOnly: true,
8
+ description: "A footer at the bottom of a page with a site name and navigation links.",
9
+ toMarkdown: ["{{title}}", "{{links}}"],
10
+ content: {
11
+ title: Type.String({ default: "{{projectName}}" }),
12
+ links: Type.RepeatableItem(
13
+ {
14
+ link: Type.Link({
15
+ default: { text: "Link", href: "#", newTab: false },
16
+ title: "Link",
17
+ }),
18
+ },
19
+ {
20
+ minItems: 1,
21
+ maxItems: 12,
22
+ title: "Links",
23
+ toMarkdown: ["{{link}}"],
24
+ },
25
+ ),
26
+ },
27
+ component: FooterComponent,
28
+ });
29
+
30
+ function FooterComponent() {
31
+ return (
32
+ <footer className="dark bg-background py-12">
33
+ <div className="container mx-auto px-4">
34
+ <div className="flex flex-col items-center gap-6 sm:flex-row sm:justify-between">
35
+ <footer.Field name="title">
36
+ {(content) => <div className="text-foreground text-lg font-bold">{content}</div>}
37
+ </footer.Field>
38
+
39
+ <div className="flex flex-wrap items-center gap-4">
40
+ <footer.Repeater name="links">
41
+ {(linkItem) => (
42
+ <linkItem.Link name="link">
43
+ {({ text, href, newTab }) => (
44
+ <Link
45
+ to={href}
46
+ target={newTab ? "_blank" : undefined}
47
+ rel={newTab ? "noreferrer" : undefined}
48
+ className="text-muted-foreground hover:text-foreground text-sm transition-colors"
49
+ >
50
+ {text}
51
+ </Link>
52
+ )}
53
+ </linkItem.Link>
54
+ )}
55
+ </footer.Repeater>
56
+ </div>
57
+ </div>
58
+
59
+ <div className="text-muted-foreground mt-8 text-center text-sm">
60
+ &copy; {new Date().getFullYear()} All rights reserved.
61
+ </div>
62
+ </div>
63
+ </footer>
64
+ );
65
+ }
66
+
67
+ export { footer as block };
@@ -0,0 +1,64 @@
1
+ import { Link } from "@tanstack/react-router";
2
+ import { Type, createBlock } from "camox/createBlock";
3
+
4
+ import { Button } from "@/components/ui/button";
5
+
6
+ const hero = createBlock({
7
+ id: "hero",
8
+ title: "Hero",
9
+ description:
10
+ "Use this block as the main landing section at the top of a page. It should capture attention immediately with a clear value proposition.",
11
+ toMarkdown: ["# {{title}}", "{{description}}", "{{cta}}"],
12
+ content: {
13
+ title: Type.String({
14
+ default: "Welcome to {{projectName}}",
15
+ title: "Title",
16
+ }),
17
+ description: Type.String({
18
+ default: "Build something amazing with Camox.",
19
+ maxLength: 280,
20
+ title: "Description",
21
+ }),
22
+ cta: Type.Link({
23
+ default: { text: "Get Started", href: "/", newTab: false },
24
+ title: "CTA",
25
+ }),
26
+ },
27
+ component: HeroComponent,
28
+ });
29
+
30
+ function HeroComponent() {
31
+ return (
32
+ <section className="flex flex-col items-center justify-center py-32">
33
+ <div className="container mx-auto px-4">
34
+ <div className="mx-auto max-w-3xl text-center">
35
+ <hero.Field name="title">
36
+ {(content) => (
37
+ <h1 className="text-foreground mb-6 text-5xl font-bold tracking-tight sm:text-6xl">
38
+ {content}
39
+ </h1>
40
+ )}
41
+ </hero.Field>
42
+ <hero.Field name="description">
43
+ {(content) => <p className="text-muted-foreground mb-10 text-xl">{content}</p>}
44
+ </hero.Field>
45
+ <hero.Link name="cta">
46
+ {({ text, href, newTab }) => (
47
+ <Button size="lg" asChild>
48
+ <Link
49
+ to={href}
50
+ target={newTab ? "_blank" : undefined}
51
+ rel={newTab ? "noreferrer" : undefined}
52
+ >
53
+ {text}
54
+ </Link>
55
+ </Button>
56
+ )}
57
+ </hero.Link>
58
+ </div>
59
+ </div>
60
+ </section>
61
+ );
62
+ }
63
+
64
+ export { hero as block };
@@ -0,0 +1,95 @@
1
+ import { Link } from "@tanstack/react-router";
2
+ import { Type, createBlock } from "camox/createBlock";
3
+
4
+ import { Button } from "@/components/ui/button";
5
+
6
+ const navbar = createBlock({
7
+ id: "navbar",
8
+ title: "Navbar",
9
+ layoutOnly: true,
10
+ description:
11
+ "A navigation bar at the top of a page with a brand name, navigation links, and a call-to-action link.",
12
+ toMarkdown: ["{{title}}", "{{links}}", "{{cta}}"],
13
+ content: {
14
+ title: Type.Link({
15
+ title: "Site name",
16
+ default: {
17
+ href: "/",
18
+ text: "{{projectName}}",
19
+ newTab: false,
20
+ },
21
+ }),
22
+ links: Type.RepeatableItem(
23
+ {
24
+ link: Type.Link({
25
+ default: { text: "Link", href: "#", newTab: false },
26
+ title: "Link",
27
+ }),
28
+ },
29
+ {
30
+ minItems: 1,
31
+ maxItems: 6,
32
+ title: "Links",
33
+ toMarkdown: ["{{link}}"],
34
+ },
35
+ ),
36
+ cta: Type.Link({
37
+ default: { text: "Get Started", href: "#", newTab: false },
38
+ title: "CTA",
39
+ }),
40
+ },
41
+ component: NavbarComponent,
42
+ });
43
+
44
+ function NavbarComponent() {
45
+ return (
46
+ <nav className="dark bg-background border-border border-b">
47
+ <div className="container mx-auto px-4">
48
+ <div className="flex h-16 items-center justify-between">
49
+ <navbar.Link name="title">
50
+ {(link) => (
51
+ <Link className="text-foreground text-xl font-bold" to={link.href}>
52
+ {link.text}
53
+ </Link>
54
+ )}
55
+ </navbar.Link>
56
+
57
+ <div className="flex items-center gap-6">
58
+ <navbar.Repeater name="links">
59
+ {(linkItem) => (
60
+ <linkItem.Link name="link">
61
+ {({ text, href, newTab }) => (
62
+ <Link
63
+ to={href}
64
+ target={newTab ? "_blank" : undefined}
65
+ rel={newTab ? "noreferrer" : undefined}
66
+ className="text-muted-foreground hover:text-foreground text-sm transition-colors"
67
+ >
68
+ {text}
69
+ </Link>
70
+ )}
71
+ </linkItem.Link>
72
+ )}
73
+ </navbar.Repeater>
74
+
75
+ <navbar.Link name="cta">
76
+ {({ text, href, newTab }) => (
77
+ <Button size="sm" asChild>
78
+ <Link
79
+ to={href}
80
+ target={newTab ? "_blank" : undefined}
81
+ rel={newTab ? "noreferrer" : undefined}
82
+ >
83
+ {text}
84
+ </Link>
85
+ </Button>
86
+ )}
87
+ </navbar.Link>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </nav>
92
+ );
93
+ }
94
+
95
+ export { navbar as block };
@@ -0,0 +1,99 @@
1
+ import { Type, createBlock } from "camox/createBlock";
2
+
3
+ const statistics = createBlock({
4
+ id: "statistics",
5
+ title: "Statistics",
6
+ description:
7
+ "Showcase key metrics, achievements, or performance indicators. Ideal for displaying platform statistics or company milestones.",
8
+ toMarkdown: ["## {{subtitle}}", "{{description}}", "{{statistics}}"],
9
+ content: {
10
+ title: Type.String({
11
+ default: "By the numbers",
12
+ maxLength: 30,
13
+ title: "Title",
14
+ }),
15
+ subtitle: Type.String({
16
+ default: "Trusted by teams worldwide",
17
+ title: "Subtitle",
18
+ }),
19
+ description: Type.String({
20
+ default:
21
+ "Our platform empowers teams to build and ship faster. Here are some numbers we're proud of.",
22
+ title: "Description",
23
+ }),
24
+ statistics: Type.RepeatableItem(
25
+ {
26
+ number: Type.String({
27
+ default: "100+",
28
+ maxLength: 7,
29
+ title: "Number",
30
+ }),
31
+ label: Type.String({
32
+ default: "projects launched",
33
+ title: "Label",
34
+ }),
35
+ },
36
+ {
37
+ minItems: 3,
38
+ maxItems: 8,
39
+ title: "Statistics",
40
+ toMarkdown: ["**{{number}}** — {{label}}"],
41
+ },
42
+ ),
43
+ },
44
+ component: StatisticsComponent,
45
+ });
46
+
47
+ function StatisticsComponent() {
48
+ return (
49
+ <section className="dark bg-background py-24">
50
+ <div className="container mx-auto px-4">
51
+ <div className="mx-auto max-w-6xl">
52
+ <div className="mb-16">
53
+ <statistics.Field name="title">
54
+ {(content) => (
55
+ <div className="text-primary mb-4 text-sm font-semibold tracking-wider uppercase">
56
+ {content}
57
+ </div>
58
+ )}
59
+ </statistics.Field>
60
+ <statistics.Field name="subtitle">
61
+ {(content) => (
62
+ <h2 className="text-foreground mb-6 text-4xl font-bold sm:text-5xl">{content}</h2>
63
+ )}
64
+ </statistics.Field>
65
+ <statistics.Field name="description">
66
+ {(content) => (
67
+ <p className="text-muted-foreground max-w-3xl text-lg leading-relaxed">{content}</p>
68
+ )}
69
+ </statistics.Field>
70
+ </div>
71
+
72
+ <div className="grid grid-cols-1 gap-8 md:grid-cols-2 lg:grid-cols-4">
73
+ <statistics.Repeater name="statistics">
74
+ {(stat) => (
75
+ <div className="flex gap-3">
76
+ <div className="w-0.5 bg-linear-to-b from-teal-400 to-blue-500" />
77
+ <div className="flex flex-col">
78
+ <stat.Field name="number">
79
+ {(content) => (
80
+ <div className="text-foreground mb-2 text-4xl font-bold">{content}</div>
81
+ )}
82
+ </stat.Field>
83
+ <stat.Field name="label">
84
+ {(content) => (
85
+ <p className="text-muted-foreground text-sm leading-relaxed">{content}</p>
86
+ )}
87
+ </stat.Field>
88
+ </div>
89
+ </div>
90
+ )}
91
+ </statistics.Repeater>
92
+ </div>
93
+ </div>
94
+ </div>
95
+ </section>
96
+ );
97
+ }
98
+
99
+ export { statistics as block };
@@ -0,0 +1,56 @@
1
+ import { Type, createBlock } from "camox/createBlock";
2
+
3
+ const testimonial = createBlock({
4
+ id: "testimonial",
5
+ title: "Testimonial",
6
+ description:
7
+ "Display a customer testimonial or user review. Ideal for building trust and social proof.",
8
+ toMarkdown: ["> {{quote}}", "— {{author}}, {{title}}, {{company}}"],
9
+ content: {
10
+ quote: Type.String({
11
+ default:
12
+ "This platform has transformed how we build and manage our website. The developer experience is exceptional.",
13
+ title: "Quote",
14
+ }),
15
+ author: Type.String({ default: "Sarah Chen", title: "Author" }),
16
+ title: Type.String({ default: "Senior Developer", title: "Title" }),
17
+ company: Type.String({ default: "TechCorp", title: "Company" }),
18
+ },
19
+ component: TestimonialComponent,
20
+ });
21
+
22
+ function TestimonialComponent() {
23
+ return (
24
+ <section className="bg-background py-24">
25
+ <div className="container mx-auto px-4">
26
+ <div className="mx-auto max-w-4xl text-center">
27
+ <testimonial.Field name="quote">
28
+ {(content) => (
29
+ <blockquote className="text-foreground mb-8 text-2xl leading-relaxed font-medium sm:text-3xl">
30
+ "{content}"
31
+ </blockquote>
32
+ )}
33
+ </testimonial.Field>
34
+ <div className="flex flex-col items-center">
35
+ <testimonial.Field name="author">
36
+ {(content) => (
37
+ <cite className="text-foreground text-lg font-semibold not-italic">{content}</cite>
38
+ )}
39
+ </testimonial.Field>
40
+ <div className="text-muted-foreground flex flex-col sm:flex-row sm:items-center sm:gap-2">
41
+ <testimonial.Field name="title">
42
+ {(content) => <span>{content}</span>}
43
+ </testimonial.Field>
44
+ <span className="hidden sm:inline">&bull;</span>
45
+ <testimonial.Field name="company">
46
+ {(content) => <span>{content}</span>}
47
+ </testimonial.Field>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </section>
53
+ );
54
+ }
55
+
56
+ export { testimonial as block };
@@ -0,0 +1,85 @@
1
+ import { createLayout } from "camox/createLayout";
2
+
3
+ import { block as footerBlock } from "../blocks/footer";
4
+ import { block as heroBlock } from "../blocks/hero";
5
+ import { block as navbarBlock } from "../blocks/navbar";
6
+ import { block as statisticsBlock } from "../blocks/statistics";
7
+
8
+ const defaultLayout = createLayout({
9
+ id: "default",
10
+ title: "Default",
11
+ description: "Default page layout with a navbar and footer",
12
+ blocks: { before: [navbarBlock], after: [footerBlock] },
13
+ initialBlocks: [heroBlock, statisticsBlock],
14
+ component: DefaultLayout,
15
+ buildMetaTitle: ({ pageMetaTitle, projectName }) => `${pageMetaTitle} | ${projectName}`,
16
+ buildOgImage: ({ title, description, projectName }) => (
17
+ <div
18
+ style={{
19
+ display: "flex",
20
+ flexDirection: "column",
21
+ justifyContent: "center",
22
+ alignItems: "flex-start",
23
+ width: "100%",
24
+ height: "100%",
25
+ backgroundColor: "#09090b",
26
+ padding: "60px 80px",
27
+ fontFamily: "sans-serif",
28
+ }}
29
+ >
30
+ {projectName && (
31
+ <div
32
+ style={{
33
+ fontSize: 24,
34
+ color: "#a1a1aa",
35
+ marginBottom: 24,
36
+ textTransform: "uppercase",
37
+ letterSpacing: "0.1em",
38
+ }}
39
+ >
40
+ {projectName}
41
+ </div>
42
+ )}
43
+ <div
44
+ style={{
45
+ fontSize: 64,
46
+ fontWeight: 700,
47
+ color: "#fafafa",
48
+ lineHeight: 1.2,
49
+ marginBottom: 24,
50
+ maxWidth: "100%",
51
+ overflow: "hidden",
52
+ textOverflow: "ellipsis",
53
+ }}
54
+ >
55
+ {title}
56
+ </div>
57
+ {description && (
58
+ <div
59
+ style={{
60
+ fontSize: 28,
61
+ color: "#a1a1aa",
62
+ lineHeight: 1.5,
63
+ maxWidth: "80%",
64
+ overflow: "hidden",
65
+ textOverflow: "ellipsis",
66
+ }}
67
+ >
68
+ {description}
69
+ </div>
70
+ )}
71
+ </div>
72
+ ),
73
+ });
74
+
75
+ function DefaultLayout({ children }: { children: React.ReactNode }) {
76
+ return (
77
+ <main className="flex min-h-screen flex-col">
78
+ <defaultLayout.blocks.Navbar />
79
+ <div className="flex-1">{children}</div>
80
+ <defaultLayout.blocks.Footer />
81
+ </main>
82
+ );
83
+ }
84
+
85
+ export { defaultLayout as layout };
@@ -0,0 +1,57 @@
1
+ import { Slot } from "@radix-ui/react-slot";
2
+ import type { VariantProps } from "class-variance-authority";
3
+ import { cva } from "class-variance-authority";
4
+ import * as React from "react";
5
+
6
+ import { cn } from "@/lib/utils";
7
+
8
+ const buttonVariants = cva(
9
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
10
+ {
11
+ variants: {
12
+ variant: {
13
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
14
+ destructive:
15
+ "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
16
+ outline:
17
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
18
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
19
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
20
+ link: "text-primary underline-offset-4 hover:underline",
21
+ },
22
+ size: {
23
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
24
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
25
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
26
+ icon: "size-9",
27
+ },
28
+ },
29
+ defaultVariants: {
30
+ variant: "default",
31
+ size: "default",
32
+ },
33
+ },
34
+ );
35
+
36
+ function Button({
37
+ className,
38
+ variant,
39
+ size,
40
+ asChild = false,
41
+ ...props
42
+ }: React.ComponentProps<"button"> &
43
+ VariantProps<typeof buttonVariants> & {
44
+ asChild?: boolean;
45
+ }) {
46
+ const Comp = asChild ? Slot : "button";
47
+
48
+ return (
49
+ <Comp
50
+ data-slot="button"
51
+ className={cn(buttonVariants({ variant, size, className }))}
52
+ {...props}
53
+ />
54
+ );
55
+ }
56
+
57
+ export { Button, buttonVariants };
@@ -0,0 +1,7 @@
1
+ import type { ClassValue } from "clsx";
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+
5
+ export function cn(...inputs: Array<ClassValue>) {
6
+ return twMerge(clsx(inputs));
7
+ }
@@ -0,0 +1,18 @@
1
+ import { createRouter as createTanstackRouter } from "@tanstack/react-router";
2
+
3
+ import { routeTree } from "./routeTree.gen";
4
+
5
+ export function getRouter() {
6
+ const router = createTanstackRouter({
7
+ routeTree,
8
+ defaultPreload: "intent",
9
+ });
10
+
11
+ return router;
12
+ }
13
+
14
+ declare module "@tanstack/react-router" {
15
+ interface Register {
16
+ router: ReturnType<typeof getRouter>;
17
+ }
18
+ }