collections.json.js — astro Source File
Architecture documentation for collections.json.js, a javascript file in the astro codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 10a95760_a970_87df_5da9_6d89809adea5["collections.json.js"] 48f80d01_e646_3924_78f6_a9d836644746["astro:content"] 10a95760_a970_87df_5da9_6d89809adea5 --> 48f80d01_e646_3924_78f6_a9d836644746 ca52ff61_c81f_c2ca_81b6_5a678b65fd31["devalue"] 10a95760_a970_87df_5da9_6d89809adea5 --> ca52ff61_c81f_c2ca_81b6_5a678b65fd31 style 10a95760_a970_87df_5da9_6d89809adea5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { getCollection, getEntry } from 'astro:content';
import * as devalue from 'devalue';
export async function GET() {
const customLoader = await getCollection('blog', (entry) => {
return entry.data.id < 6;
});
const jsonLoader = await getCollection('dogs');
const dataEntry = await getEntry('dogs', 'beagle');
const simpleLoader = await getCollection('cats');
const entryWithReference = await getEntry('spacecraft', 'columbia-copy');
const atlantis = await getEntry('spacecraft', 'atlantis');
const referencedEntry = await getEntry(entryWithReference.data.cat);
const spacecraft = await getCollection('spacecraft');
const spacecraftNoBody = await getCollection('spacecraftNoBody');
const entryWithImagePath = await getEntry('spacecraft', 'lunar-module');
const increment = await getEntry('increment', 'value');
const images = await getCollection('images');
const simpleLoaderObject = await getCollection('rodents')
const probes = await getCollection('probes');
const yamlLoader = await getCollection('fish');
const tomlLoader = await getCollection('songs');
const nestedJsonLoader = await getCollection('birds');
const loaderWithAsyncParse = await getCollection('birdsWithAsyncParse');
const csvLoader = await getCollection('plants');
const rockets = await getCollection('rockets');
const numbers = await getCollection('numbers');
const numbersYaml = await getCollection('numbersYaml');
const numbersToml = await getCollection('numbersToml');
const renderMarkdownTest = await getEntry('renderMarkdownTest', 'with-frontmatter');
const renderMarkdownWithImage = await getEntry('renderMarkdownTest', 'with-image');
// Test for #12689 - dynamic import in loader
const dynamicImportLoader = await getCollection('dynamicImport');
return new Response(
devalue.stringify({
customLoader,
jsonLoader,
dataEntry,
simpleLoader,
simpleLoaderObject,
entryWithReference,
entryWithImagePath,
referencedEntry,
increment,
numbers,
numbersYaml,
numbersToml,
images,
rockets,
probes,
yamlLoader,
tomlLoader,
nestedJsonLoader,
loaderWithAsyncParse,
csvLoader,
atlantis,
spacecraft: spacecraft.map(({id}) => id).sort((a, b) => a.localeCompare(b)),
spacecraftWithBody: spacecraft.map(({id, body}) => ({id, body})),
spacecraftNoBody: spacecraftNoBody.map(({id, body}) => ({id, body})),
renderMarkdownTest,
renderMarkdownWithImage,
dynamicImportLoader,
})
);
}
Domain
Subdomains
Functions
Dependencies
- astro:content
- devalue
Source
Frequently Asked Questions
What does collections.json.js do?
collections.json.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in collections.json.js?
collections.json.js defines 1 function(s): GET.
What does collections.json.js depend on?
collections.json.js imports 2 module(s): astro:content, devalue.
Where is collections.json.js in the architecture?
collections.json.js is located at packages/astro/test/fixtures/content-layer/src/pages/collections.json.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/content-layer/src/pages).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free