Skip to content

Commit 5b50e6f

Browse files
committed
feat: Use create-harper for agent chat metadata
1 parent a2ee2d1 commit 5b50e6f

4 files changed

Lines changed: 123 additions & 97 deletions

File tree

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
"@ai-sdk/react": "^3.0.171",
2929
"@datadog/browser-rum": "^7.0.0",
3030
"@datadog/browser-rum-react": "^7.0.0",
31-
"@harperfast/agent-tools": "^1.1.6",
32-
"@harperfast/skills": "^1.4.1",
31+
"@harperfast/agent-tools": "^1.2.0",
32+
"@harperfast/skills": "^1.10.0",
3333
"@hookform/resolvers": "^5.0.0",
3434
"@monaco-editor/react": "^4.7.0",
3535
"@radix-ui/react-accordion": "^1.2.12",
@@ -62,6 +62,7 @@
6262
"axios": "^1.7.9",
6363
"class-variance-authority": "^0.7.1",
6464
"clsx": "^2.1.1",
65+
"create-harper": "^1.9.0",
6566
"html-to-image": "^1.11.13",
6667
"lucide-react": "^1.0.0",
6768
"mermaid": "^11.13.0",

pnpm-lock.yaml

Lines changed: 86 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ allowBuilds:
1515
tree-sitter: true
1616
tree-sitter-json: true
1717
utf-8-validate: true
18+
minimumReleaseAgeExclude:
19+
- '@harperfast/agent-tools@1.2.0'
20+
- '@harperfast/skills@1.10.0'
21+
- create-harper@1.9.0
1822
onlyBuiltDependencies:
1923
- '@tailwindcss/oxide'
2024
- core-js-pure
Lines changed: 30 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,31 @@
1-
const CREATE_HARPER_TREE = 'https://github.com/HarperFast/create-harper/tree/main';
1+
import { templates as catalog } from 'create-harper/templates';
22

3-
export const templates = [
4-
{
5-
id: 'vanilla',
6-
name: 'Vanilla JS',
7-
description: "Define your entities in schema.graphql, add your HTML/CSS/JS in web, and you're cooking!",
8-
tags: ['Vanilla', 'REST', 'GraphQL', 'ORM'],
9-
npm: '@harperfast/template-vanilla-studio',
10-
githubUrl: `${CREATE_HARPER_TREE}/template-vanilla`,
11-
},
12-
{
13-
id: 'vanilla-ts',
14-
name: 'Vanilla + TypeScript',
15-
description: 'The same Web + REST ORM from the first template, but with TypeScript sprinkled in.',
16-
tags: ['Vanilla', 'TypeScript', 'GraphQL'],
17-
npm: '@harperfast/template-vanilla-ts-studio',
18-
githubUrl: `${CREATE_HARPER_TREE}/template-vanilla-ts`,
19-
},
20-
{
21-
id: 'react',
22-
name: 'React',
23-
description: "A Vite-powered React single-page app, wired up to Harper's REST + GraphQL APIs out of the box.",
24-
tags: ['React', 'Vite', 'SPA', 'GraphQL'],
25-
npm: '@harperfast/template-react-studio',
26-
githubUrl: `${CREATE_HARPER_TREE}/template-react`,
27-
},
28-
{
29-
id: 'react-ts',
30-
name: 'React + TypeScript',
31-
description: 'The same Vite-powered React app, with end-to-end type safety from TypeScript.',
32-
tags: ['React', 'TypeScript', 'Vite', 'SPA'],
33-
npm: '@harperfast/template-react-ts-studio',
34-
githubUrl: `${CREATE_HARPER_TREE}/template-react-ts`,
35-
},
36-
{
37-
id: 'react-ssr',
38-
name: 'React + SSR',
39-
description: 'Server-rendered React with Vite for fast first paints, hydrating into a full SPA on Harper.',
40-
tags: ['React', 'SSR', 'Vite', 'GraphQL'],
41-
npm: '@harperfast/template-react-ssr-studio',
42-
githubUrl: `${CREATE_HARPER_TREE}/template-react-ssr`,
43-
},
44-
{
45-
id: 'react-ts-ssr',
46-
name: 'React + TypeScript + SSR',
47-
description: 'Server-rendered React with Vite and TypeScript for type-safe, SEO-friendly pages on Harper.',
48-
tags: ['React', 'TypeScript', 'SSR', 'Vite'],
49-
npm: '@harperfast/template-react-ts-ssr-studio',
50-
githubUrl: `${CREATE_HARPER_TREE}/template-react-ts-ssr`,
51-
},
52-
{
53-
id: 'vue',
54-
name: 'Vue',
55-
description: "A Vite-powered Vue single-page app, wired up to Harper's REST + GraphQL APIs out of the box.",
56-
tags: ['Vue', 'Vite', 'SPA', 'GraphQL'],
57-
npm: '@harperfast/template-vue-studio',
58-
githubUrl: `${CREATE_HARPER_TREE}/template-vue`,
59-
},
60-
{
61-
id: 'vue-ts',
62-
name: 'Vue + TypeScript',
63-
description: 'The same Vite-powered Vue app, with end-to-end type safety from TypeScript.',
64-
tags: ['Vue', 'TypeScript', 'Vite', 'SPA'],
65-
npm: '@harperfast/template-vue-ts-studio',
66-
githubUrl: `${CREATE_HARPER_TREE}/template-vue-ts`,
67-
},
68-
{
69-
id: 'vue-ssr',
70-
name: 'Vue + SSR',
71-
description: 'Server-rendered Vue with Vite for fast first paints, hydrating into a full SPA on Harper.',
72-
tags: ['Vue', 'SSR', 'Vite', 'GraphQL'],
73-
npm: '@harperfast/template-vue-ssr-studio',
74-
githubUrl: `${CREATE_HARPER_TREE}/template-vue-ssr`,
75-
},
76-
{
77-
id: 'vue-ts-ssr',
78-
name: 'Vue + TypeScript + SSR',
79-
description: 'Server-rendered Vue with Vite and TypeScript for type-safe, SEO-friendly pages on Harper.',
80-
tags: ['Vue', 'TypeScript', 'SSR', 'Vite'],
81-
npm: '@harperfast/template-vue-ts-ssr-studio',
82-
githubUrl: `${CREATE_HARPER_TREE}/template-vue-ts-ssr`,
83-
},
84-
];
3+
// create-harper is the single source of truth for the template list, descriptions, npm packages, and
4+
// GitHub links. New templates added there flow through here (and into the createApp agent tool)
5+
// automatically. create-harper lists TypeScript-first; we re-sort to Studio's established display order
6+
// (by framework, then non-SSR before SSR, then JavaScript before TypeScript) so the picker and its
7+
// default selection stay stable.
8+
const FRAMEWORK_ORDER = ['vanilla', 'react', 'vue'] as const;
9+
10+
// Rank a framework by its position in FRAMEWORK_ORDER. Any framework not listed (e.g. a future
11+
// Svelte/Angular template added to create-harper) sorts to the end rather than the top.
12+
function frameworkRank(framework: string): number {
13+
const index = (FRAMEWORK_ORDER as readonly string[]).indexOf(framework);
14+
return index === -1 ? Infinity : index;
15+
}
16+
17+
export const templates = [...catalog]
18+
.sort((a, b) =>
19+
frameworkRank(a.framework) - frameworkRank(b.framework)
20+
|| Number(a.ssr) - Number(b.ssr)
21+
|| Number(a.typescript) - Number(b.typescript)
22+
)
23+
.map((t) => ({
24+
// Widen to `string`: the New Application form supplies the selected id as a plain string.
25+
id: t.name as string,
26+
name: t.title,
27+
description: t.description,
28+
tags: [...t.tags],
29+
npm: t.npmPackage,
30+
githubUrl: t.githubUrl,
31+
}));

0 commit comments

Comments
 (0)