regenerateCollectionFileManifest() — astro Function Reference
Architecture documentation for the regenerateCollectionFileManifest() function in content-layer.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD b5de73ce_33fc_df1a_559d_4a8d2c6dde27["regenerateCollectionFileManifest()"] 4a6efe25_e6e4_25af_3955_aede0d8f5983["ContentLayer"] b5de73ce_33fc_df1a_559d_4a8d2c6dde27 -->|defined in| 4a6efe25_e6e4_25af_3955_aede0d8f5983 650841f3_f9b7_57f0_481a_fdc3aaab95b1["options()"] 650841f3_f9b7_57f0_481a_fdc3aaab95b1 -->|calls| b5de73ce_33fc_df1a_559d_4a8d2c6dde27 style b5de73ce_33fc_df1a_559d_4a8d2c6dde27 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/content/content-layer.ts lines 349–380
async regenerateCollectionFileManifest() {
const collectionsManifest = new URL(COLLECTIONS_MANIFEST_FILE, this.#settings.dotAstroDir);
this.#logger.debug('content', 'Regenerating collection file manifest');
if (existsSync(collectionsManifest)) {
try {
const collections = await fs.readFile(collectionsManifest, 'utf-8');
const collectionsJson = JSON.parse(collections);
collectionsJson.entries ??= {};
for (const { hasSchema, name } of collectionsJson.collections) {
if (!hasSchema) {
continue;
}
const entries = this.#store.values(name);
if (!entries?.[0]?.filePath) {
continue;
}
for (const { filePath } of entries) {
if (!filePath) {
continue;
}
const key = new URL(filePath, this.#settings.config.root).href.toLowerCase();
collectionsJson.entries[key] = name;
}
}
await fs.writeFile(collectionsManifest, JSON.stringify(collectionsJson, null, 2));
} catch {
this.#logger.error('content', 'Failed to regenerate collection file manifest');
}
}
this.#logger.debug('content', 'Regenerated collection file manifest');
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does regenerateCollectionFileManifest() do?
regenerateCollectionFileManifest() is a function in the astro codebase, defined in packages/astro/src/content/content-layer.ts.
Where is regenerateCollectionFileManifest() defined?
regenerateCollectionFileManifest() is defined in packages/astro/src/content/content-layer.ts at line 349.
What calls regenerateCollectionFileManifest()?
regenerateCollectionFileManifest() is called by 1 function(s): options.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free