Skip to content

Commit

Permalink
refactor: point templates to solana-templates repo
Browse files Browse the repository at this point in the history
  • Loading branch information
beeman committed Feb 27, 2025
1 parent 3036495 commit 07cb9bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
14 changes: 6 additions & 8 deletions src/templates/frameworks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ export interface Framework {
templates: Template[]
}

export const defaultRepository = `gh:solana-developers/template-{{name}}`

export const frameworks: Framework[] = [
{
id: 'next',
Expand All @@ -18,17 +16,17 @@ export const frameworks: Framework[] = [
{
name: 'next-tailwind-counter',
description: 'Next.js + Tailwind CSS + Anchor Counter Example',
repository: defaultRepository,
repository: 'gh:solana-developers/solana-templates/templates/legacy-next-tailwind-counter',
},
{
name: 'next-tailwind-basic',
description: 'Next.js + Tailwind CSS + Anchor Basic Example',
repository: defaultRepository,
repository: 'gh:solana-developers/solana-templates/templates/legacy-next-tailwind-basic',
},
{
name: 'next-tailwind',
description: 'Next.js + Tailwind CSS, no Anchor',
repository: defaultRepository,
repository: 'gh:solana-developers/solana-templates/templates/legacy-next-tailwind',
},
],
},
Expand All @@ -40,17 +38,17 @@ export const frameworks: Framework[] = [
{
name: 'react-vite-tailwind-counter',
description: 'React with Vite + Tailwind CSS + Anchor Counter Example',
repository: defaultRepository,
repository: 'gh:solana-developers/solana-templates/templates/react-vite-tailwind-counter',
},
{
name: 'react-vite-tailwind-basic',
description: 'React with Vite + Tailwind CSS + Anchor Basic Example',
repository: defaultRepository,
repository: 'gh:solana-developers/solana-templates/templates/react-vite-tailwind-basic',
},
{
name: 'react-vite-tailwind',
description: 'React with Vite + Tailwind CSS, no Anchor',
repository: defaultRepository,
repository: 'gh:solana-developers/solana-templates/templates/react-vite-tailwind',
},
],
},
Expand Down
11 changes: 1 addition & 10 deletions src/templates/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export interface Template {
name: string
description: string
repository: string
path?: string
}

export function findTemplate(name: string): Template {
Expand Down Expand Up @@ -35,15 +34,7 @@ function getTemplatesForFrameworks(frameworks: Framework[] = []): Template[] {
}

export function getTemplatesForFramework(framework: Framework): Template[] {
return (
framework.templates
// Normalize the template repository
.map((template) => ({
...template,
repository: template.repository.replace('{{name}}', template.name),
path: template.path ?? '/',
}))
)
return framework.templates
}

export function listTemplates() {
Expand Down

0 comments on commit 07cb9bf

Please sign in to comment.