Skip to content

Commit b22c1e2

Browse files
committed
split server & client components
1 parent 162be5d commit b22c1e2

File tree

4 files changed

+57
-49
lines changed

4 files changed

+57
-49
lines changed

apps/framework-docs-v2/src/components/mdx/template-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type {
2424
ItemMetadata,
2525
TemplateMetadata,
2626
AppMetadata,
27-
} from "@/lib/templates";
27+
} from "@/lib/template-types";
2828

2929
interface TemplateCardProps {
3030
item: ItemMetadata;

apps/framework-docs-v2/src/components/mdx/template-grid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Button } from "@/components/ui/button";
77
import { Badge } from "@/components/ui/badge";
88
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
99
import { TemplateCard } from "./template-card";
10-
import type { ItemMetadata, TemplateMetadata } from "@/lib/templates";
10+
import type { ItemMetadata, TemplateMetadata } from "@/lib/template-types";
1111
import { IconSearch, IconX } from "@tabler/icons-react";
1212

1313
interface TemplateGridProps {
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Template metadata from template.config.toml
3+
*/
4+
export interface TemplateConfig {
5+
language: "typescript" | "python";
6+
description: string;
7+
visible?: boolean;
8+
default_sloan_telemetry?: string;
9+
}
10+
11+
/**
12+
* Enhanced template metadata with inferred information
13+
*/
14+
export interface TemplateMetadata {
15+
name: string;
16+
slug: string;
17+
language: "typescript" | "python";
18+
description: string;
19+
visible: boolean;
20+
category: "starter" | "framework" | "example";
21+
frameworks: string[];
22+
features: string[];
23+
githubUrl: string;
24+
initCommand: string;
25+
type: "template";
26+
}
27+
28+
/**
29+
* Demo app metadata
30+
*/
31+
export interface AppMetadata {
32+
name: string;
33+
slug: string;
34+
description: string;
35+
githubUrl: string;
36+
features: string[];
37+
frameworks: string[];
38+
language?: "typescript" | "python";
39+
blogPost?: string;
40+
type: "app";
41+
}
42+
43+
/**
44+
* Unified type for templates and apps
45+
*/
46+
export type ItemMetadata = TemplateMetadata | AppMetadata;

apps/framework-docs-v2/src/lib/templates.ts

Lines changed: 9 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,15 @@
11
import fs from "fs";
22
import path from "path";
33
import { parse } from "@iarna/toml";
4-
5-
/**
6-
* Template metadata from template.config.toml
7-
*/
8-
export interface TemplateConfig {
9-
language: "typescript" | "python";
10-
description: string;
11-
visible?: boolean;
12-
default_sloan_telemetry?: string;
13-
}
14-
15-
/**
16-
* Enhanced template metadata with inferred information
17-
*/
18-
export interface TemplateMetadata {
19-
name: string;
20-
slug: string;
21-
language: "typescript" | "python";
22-
description: string;
23-
visible: boolean;
24-
category: "starter" | "framework" | "example";
25-
frameworks: string[];
26-
features: string[];
27-
githubUrl: string;
28-
initCommand: string;
29-
type: "template";
30-
}
31-
32-
/**
33-
* Demo app metadata
34-
*/
35-
export interface AppMetadata {
36-
name: string;
37-
slug: string;
38-
description: string;
39-
githubUrl: string;
40-
features: string[];
41-
frameworks: string[];
42-
language?: "typescript" | "python";
43-
blogPost?: string;
44-
type: "app";
45-
}
46-
47-
/**
48-
* Unified type for templates and apps
49-
*/
50-
export type ItemMetadata = TemplateMetadata | AppMetadata;
4+
import type {
5+
TemplateConfig,
6+
TemplateMetadata,
7+
AppMetadata,
8+
ItemMetadata,
9+
} from "./template-types";
10+
11+
// Re-export types for convenience
12+
export type { TemplateConfig, TemplateMetadata, AppMetadata, ItemMetadata };
5113

5214
/**
5315
* Find the workspace root by traversing up from current directory

0 commit comments

Comments
 (0)