Summary
The Astro integration logs a warning during build when the configured/default contentDir does not exist. For Astro projects that use CMS-backed content or page-derived output only, src/content may legitimately be absent, so this should probably be treated as an empty content set rather than a warning.
Repro
In an Astro project using aeo.js@0.0.14:
// astro.config.mjs
import { aeoAstroIntegration } from 'aeo.js/astro';
export default defineConfig({
output: 'static',
integrations: [
aeoAstroIntegration({
title: 'Quantum',
description: '...',
url: 'https://quantum.systems',
generators: {
llmsTxt: false,
robotsTxt: false,
sitemap: false,
},
}),
],
});
With no src/content directory, run:
Actual
The build succeeds, but aeo.js logs:
Warning: Could not read directory src/content: Error: ENOENT: no such file or directory, scandir 'src/content'
Expected
If contentDir is missing, the Astro integration should silently treat it as empty content, consistent with other generator paths that already guard with existsSync(config.contentDir).
Likely Cause
In the built Astro integration, several paths already guard the directory scan:
const markdownFiles = existsSync(config.contentDir) ? collectMarkdownFiles(config.contentDir) : [];
const sections = existsSync(config.contentDir) ? collectAndConcatenateMarkdown(config.contentDir) : [];
But copyMarkdownFiles(config) calls copyRecursive(config.contentDir) unconditionally. The internal copyRecursive catches the missing directory and logs a warning.
A small guard in copyMarkdownFiles should avoid noisy warnings for valid Astro projects without src/content:
function copyMarkdownFiles(config) {
const copiedFiles = [];
if (!config.contentDir || !existsSync(config.contentDir)) return copiedFiles;
// existing copyRecursive flow...
}
Environment
aeo.js: 0.0.14
- Astro:
5.17.1
- Output mode:
static
- Content source: Sanity/CMS, no local
src/content directory
Summary
The Astro integration logs a warning during build when the configured/default
contentDirdoes not exist. For Astro projects that use CMS-backed content or page-derived output only,src/contentmay legitimately be absent, so this should probably be treated as an empty content set rather than a warning.Repro
In an Astro project using
aeo.js@0.0.14:With no
src/contentdirectory, run:Actual
The build succeeds, but
aeo.jslogs:Expected
If
contentDiris missing, the Astro integration should silently treat it as empty content, consistent with other generator paths that already guard withexistsSync(config.contentDir).Likely Cause
In the built Astro integration, several paths already guard the directory scan:
But
copyMarkdownFiles(config)callscopyRecursive(config.contentDir)unconditionally. The internalcopyRecursivecatches the missing directory and logs a warning.A small guard in
copyMarkdownFilesshould avoid noisy warnings for valid Astro projects withoutsrc/content:Environment
aeo.js:0.0.145.17.1staticsrc/contentdirectory