The initial config-store approach failed because Astro's injected routes run in isolated contexts during prerendering and don't have access to global state set during astro:config:setup. Solution: Created a Vite plugin that provides the configuration through a virtual module (virtual:@astrojs/discovery/config) which routes can import at build time. Changes: - Added Vite plugin in astro:config:setup hook - Updated all route handlers to import from virtual module - Changed version from date-based (2025.11.03) to semantic (1.0.0) per npm requirements - Added @ts-ignore comments for virtual module imports Testing: Verified in test project that all configuration now properly passes through to generated files (robots.txt, llms.txt, humans.txt).
63 lines
1.3 KiB
JSON
63 lines
1.3 KiB
JSON
{
|
|
"name": "@astrojs/discovery",
|
|
"version": "1.0.0",
|
|
"description": "Complete discovery integration for Astro - handles robots.txt, llms.txt, humans.txt, and sitemap generation",
|
|
"type": "module",
|
|
"exports": {
|
|
".": "./dist/index.js",
|
|
"./routes/*": "./dist/routes/*.js"
|
|
},
|
|
"files": [
|
|
"dist",
|
|
"README.md",
|
|
"LICENSE"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"dev": "tsc --watch",
|
|
"test": "vitest",
|
|
"test:ci": "vitest run",
|
|
"prepublishOnly": "npm run build && npm test"
|
|
},
|
|
"peerDependencies": {
|
|
"astro": "^5.0.0"
|
|
},
|
|
"dependencies": {
|
|
"@astrojs/sitemap": "^3.6.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.0.0",
|
|
"astro": "^5.0.0",
|
|
"typescript": "^5.7.0",
|
|
"vitest": "^2.1.0"
|
|
},
|
|
"keywords": [
|
|
"astro",
|
|
"astro-integration",
|
|
"astro-component",
|
|
"robots",
|
|
"sitemap",
|
|
"llms",
|
|
"llms-txt",
|
|
"humans",
|
|
"humans-txt",
|
|
"discovery",
|
|
"seo",
|
|
"ai",
|
|
"llm"
|
|
],
|
|
"author": {
|
|
"name": "Ryan Malloy",
|
|
"email": "ryan@supported.systems"
|
|
},
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/withastro/astro-discovery"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/withastro/astro-discovery/issues"
|
|
},
|
|
"homepage": "https://github.com/withastro/astro-discovery#readme"
|
|
}
|