@@ -186,6 +186,10 @@ const Home: FunctionComponent<React.PropsWithChildren<HomeProps>> = ({
186
186
< div className = "pt-10" >
187
187
< h3 className = "text-3xl font-bold" > Key Features</ h3 >
188
188
< ul >
189
+ < li className = "pt-3" >
190
+ < span className = "pr-3 text-yellow-300 text-lg" > ▪︎</ span >
191
+ Write your scripts in TypeScript with our SDK. Zero config.
192
+ </ li >
189
193
< li className = "pt-3" >
190
194
< span className = "pr-3 text-yellow-300 text-lg" > ▪︎</ span >
191
195
Launch the prompt from anywhere as part of your flow
@@ -214,9 +218,9 @@ const Home: FunctionComponent<React.PropsWithChildren<HomeProps>> = ({
214
218
</ li >
215
219
< li className = "pt-3" >
216
220
< span className = "pr-3 text-yellow-300 text-lg" > ▪︎</ span >
217
- Load npm libraries:{ '' }
221
+ Watches your scripts and prompts to install npm libraries:{ '' }
218
222
< code className = "whitespace-nowrap font-mono text-sm bg-yellow-500 bg-opacity-10 py-1 rounded-md text-yellow-300 px-2 ml-2" >
219
- await npm("sharp")
223
+ import express from "express"
220
224
</ code >
221
225
</ li >
222
226
< li className = "pt-3" >
@@ -337,10 +341,27 @@ export async function getStaticProps(context: any) {
337
341
338
342
const scripts = await getAllScripts ( )
339
343
340
- const featuredScripts = scripts . filter ( ( s ) => {
341
- return selectedScripts . find (
342
- ( ss ) => ss . user === s . user && ss . command === s . command ,
344
+ const featuredScriptsSet = new Set (
345
+ selectedScripts . map ( ( ss ) => `${ ss . user } /${ ss . command } ` ) ,
346
+ )
347
+ const featuredScripts = [ ]
348
+ for ( const script of scripts ) {
349
+ const scriptIdentifier = `${ script . user } /${ script . command } `
350
+ if ( featuredScriptsSet . has ( scriptIdentifier ) ) {
351
+ featuredScripts . push ( script )
352
+ featuredScriptsSet . delete ( scriptIdentifier ) // Ensure uniqueness
353
+ }
354
+ }
355
+
356
+ // Sort featuredScripts by order in selectedScripts
357
+ featuredScripts . sort ( ( a , b ) => {
358
+ const aIndex = selectedScripts . findIndex (
359
+ ( ss ) => ss . user === a . user && ss . command === a . command ,
360
+ )
361
+ const bIndex = selectedScripts . findIndex (
362
+ ( ss ) => ss . user === b . user && ss . command === b . command ,
343
363
)
364
+ return aIndex - bIndex
344
365
} )
345
366
346
367
const testimonials = await getTestimonials ( )
0 commit comments