MCPcopy Create free account
hub / github.com/TanStack/cli / createChunkRenderer

Function createChunkRenderer

packages/create/src/worker.ts:64–82  ·  view source on GitHub ↗
(chunks: () => Array<ManifestTemplateModule>)

Source from the content-addressed store, hash-verified

62}
63
64function createChunkRenderer(chunks: () => Array<ManifestTemplateModule>) {
65 return (template: string, context: TemplateRenderContext) => {
66 for (const chunk of chunks()) {
67 if (chunk.hasManifestTemplate && !chunk.hasManifestTemplate(template)) {
68 continue
69 }
70
71 try {
72 return chunk.renderManifestTemplate(template, context)
73 } catch (error) {
74 if (chunk.hasManifestTemplate) {
75 throw error
76 }
77 }
78 }
79
80 throw new Error('Template was not loaded by the worker manifest provider')
81 }
82}
83
84export type WorkerCreateAPI = {
85 getFrameworks: () => Promise<Array<Framework>>

Callers 1

getRendererFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected