Skip to content

Commit

Permalink
feat: integrate workshop (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterpeterparker authored Oct 27, 2024
1 parent c4238ce commit 3bb1c5e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
13 changes: 10 additions & 3 deletions src/constants/templates.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type {Template} from '../types/template';

const APP_DESCRIPTION_STARTER = 'Opt for a barebones scaffolding to kickstart your app';
const APP_DESCRIPTION_STARTER = 'Barebones scaffolding for your new app';
const APP_DESCRIPTION_EXAMPLE =
'Begin with an example app featuring authentication, document storage, and image handling';
'An example featuring authentication, data persistence, and image storage';

export const TEMPLATES: Template[] = [
{
framework: `Astro`,
key: `astro-starter`,
type: 'Starter',
description: 'Opt for a barebones scaffolding to kickstart your website',
description: 'Barebones scaffolding for your new website',
kind: 'website'
},
{
Expand Down Expand Up @@ -40,6 +40,13 @@ export const TEMPLATES: Template[] = [
description: APP_DESCRIPTION_EXAMPLE,
kind: 'app'
},
{
framework: `React`,
key: `react-workshop`,
type: 'Workshop',
description: 'Explore Juno in an interactive workshop',
kind: 'app'
},
{
framework: `SvelteKit`,
key: `sveltekit-starter`,
Expand Down
3 changes: 2 additions & 1 deletion src/services/prompt.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export const promptTemplate = async (projectKind: ProjectKind): Promise<Template

assertAnswerCtrlC(framework);

const templates = allTemplates[framework];
// We exclude workshop which is a material that serves a particular use case
const templates = allTemplates[framework]?.filter(({type}) => type !== 'Workshop');

if (isNullish(templates) || templates.length === 0) {
console.log(`No template(s) found for ${red(framework)}. This is unexpected.`);
Expand Down
2 changes: 1 addition & 1 deletion src/types/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export type TemplateFramework =
| 'Vue'
| 'Vanilla JavaScript';

export type TemplateType = 'Starter' | 'Example';
export type TemplateType = 'Starter' | 'Example' | 'Workshop';

0 comments on commit 3bb1c5e

Please sign in to comment.