Home / Function/ getAiPromptsImpl() — supabase Function Reference

getAiPromptsImpl() — supabase Function Reference

Architecture documentation for the getAiPromptsImpl() function in AiPrompts.utils.ts from the supabase codebase.

Entity Profile

Dependency Diagram

graph TD
  6335b469_2f2b_5cc5_1b82_daf325621a71["getAiPromptsImpl()"]
  e38a04b3_32ca_b573_96de_78cee3d3898c["parseMarkdown()"]
  6335b469_2f2b_5cc5_1b82_daf325621a71 -->|calls| e38a04b3_32ca_b573_96de_78cee3d3898c
  style 6335b469_2f2b_5cc5_1b82_daf325621a71 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/docs/app/guides/getting-started/ai-prompts/[slug]/AiPrompts.utils.ts lines 55–80

async function getAiPromptsImpl() {
  const directoryContents = await readdir(PROMPTS_DIRECTORY)

  const prompts = directoryContents
    .filter(async (file) => {
      if (extname(file) !== '.md') {
        return false
      }

      const fileStats = await stat(join(PROMPTS_DIRECTORY, file))
      const isFile = fileStats.isFile()
      return isFile
    })
    .map(async (filename) => {
      const rawContent = await readFile(join(PROMPTS_DIRECTORY, filename), 'utf-8')
      const { heading, content } = parseMarkdown(rawContent)

      return {
        filename: basename(filename, '.md'),
        heading,
        content,
      }
    })

  return (await Promise.all(prompts)).sort((a, b) => b.filename.localeCompare(a.filename))
}

Subdomains

Frequently Asked Questions

What does getAiPromptsImpl() do?
getAiPromptsImpl() is a function in the supabase codebase.
What does getAiPromptsImpl() call?
getAiPromptsImpl() calls 1 function(s): parseMarkdown.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free