skillfullstack 0.0.0-stage → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (775) hide show
  1. package/.skillsRegistry/catalog.json +231 -0
  2. package/AGENTS.md +89 -0
  3. package/README.md +210 -2
  4. package/bin/index.js +508 -0
  5. package/package.json +57 -4
  6. package/skills/backend/apiEngineering/SKILL.md +102 -0
  7. package/skills/backend/apiEngineering/evals/evalApiEngineering.py +81 -0
  8. package/skills/backend/apiEngineering/evals/fixtures/invalid/sampleInvalidOpenApi.json +40 -0
  9. package/skills/backend/apiEngineering/evals/fixtures/valid/sampleValidOpenApi.json +47 -0
  10. package/skills/backend/apiEngineering/policies/compatibility.md +42 -0
  11. package/skills/backend/apiEngineering/policies/mandatory.md +48 -0
  12. package/skills/backend/apiEngineering/policies/performance.md +39 -0
  13. package/skills/backend/apiEngineering/policies/security.md +36 -0
  14. package/skills/backend/apiEngineering/references/apiObservability.md +39 -0
  15. package/skills/backend/apiEngineering/references/apiReference.md +3 -0
  16. package/skills/backend/apiEngineering/references/apiSecurityOwasp.md +47 -0
  17. package/skills/backend/apiEngineering/references/contractCompatibility.md +26 -0
  18. package/skills/backend/apiEngineering/references/databaseTransactions.md +40 -0
  19. package/skills/backend/apiEngineering/references/distributedReliability.md +26 -0
  20. package/skills/backend/apiEngineering/references/multiTenancy.md +27 -0
  21. package/skills/backend/apiEngineering/references/openApi32Standards.md +58 -0
  22. package/skills/backend/apiEngineering/references/paginationVersioning.md +57 -0
  23. package/skills/backend/apiEngineering/references/responseStandards.md +94 -0
  24. package/skills/backend/apiEngineering/scripts/auditApiContract.py +123 -0
  25. package/skills/backend/apiEngineering/scripts/checkBreakingChanges.py +77 -0
  26. package/skills/backend/apiEngineering/scripts/generateResponseEnvelope.py +88 -0
  27. package/skills/backend/apiEngineering/templates/apiChecklist.md +27 -0
  28. package/skills/backend/apiEngineering/templates/openapi.yaml +125 -0
  29. package/skills/backend/apiEngineering/templates/problemDetails.json +44 -0
  30. package/skills/backend/databaseArchitecture/SKILL.md +118 -0
  31. package/skills/backend/databaseArchitecture/evals/evalDatabaseArchitecture.py +85 -0
  32. package/skills/backend/databaseArchitecture/evals/fixtures/dangerousMigration.sql +4 -0
  33. package/skills/backend/databaseArchitecture/evals/fixtures/invalidSchema.sql +23 -0
  34. package/skills/backend/databaseArchitecture/evals/fixtures/safeMigration.sql +3 -0
  35. package/skills/backend/databaseArchitecture/evals/fixtures/validSchema.sql +37 -0
  36. package/skills/backend/databaseArchitecture/policies/integrity.md +25 -0
  37. package/skills/backend/databaseArchitecture/policies/mandatory.md +32 -0
  38. package/skills/backend/databaseArchitecture/policies/migration.md +22 -0
  39. package/skills/backend/databaseArchitecture/policies/normalization.md +25 -0
  40. package/skills/backend/databaseArchitecture/policies/performance.md +26 -0
  41. package/skills/backend/databaseArchitecture/policies/recovery.md +23 -0
  42. package/skills/backend/databaseArchitecture/policies/security.md +26 -0
  43. package/skills/backend/databaseArchitecture/policies/tableCreationChecklist.md +70 -0
  44. package/skills/backend/databaseArchitecture/references/analyticsWarehousing.md +32 -0
  45. package/skills/backend/databaseArchitecture/references/apiReference.md +3 -0
  46. package/skills/backend/databaseArchitecture/references/backupDisasterRecovery.md +27 -0
  47. package/skills/backend/databaseArchitecture/references/dataModelingLifecycle.md +30 -0
  48. package/skills/backend/databaseArchitecture/references/databaseTaxonomy.md +32 -0
  49. package/skills/backend/databaseArchitecture/references/indexingOptimization.md +32 -0
  50. package/skills/backend/databaseArchitecture/references/normalizationTheory.md +61 -0
  51. package/skills/backend/databaseArchitecture/references/scalabilitySharding.md +37 -0
  52. package/skills/backend/databaseArchitecture/references/transactionConcurrency.md +39 -0
  53. package/skills/backend/databaseArchitecture/scripts/analyzeMigration.py +99 -0
  54. package/skills/backend/databaseArchitecture/scripts/auditDatabaseSchema.py +177 -0
  55. package/skills/backend/databaseArchitecture/scripts/inspectDatabaseIndexes.py +149 -0
  56. package/skills/backend/databaseArchitecture/templates/adrTemplate.md +32 -0
  57. package/skills/backend/databaseArchitecture/templates/databaseChecklist.md +29 -0
  58. package/skills/backend/databaseArchitecture/templates/migrationPlan.md +40 -0
  59. package/skills/backend/durableBackgroundJobs/SKILL.md +112 -0
  60. package/skills/backend/durableBackgroundJobs/evals/durableJobVerification.json +14 -0
  61. package/skills/backend/durableBackgroundJobs/references/apiReference.md +3 -0
  62. package/skills/backend/durableBackgroundJobs/references/durableStepPatterns.md +6 -0
  63. package/skills/backend/durableBackgroundJobs/references/idempotencyKeys.md +5 -0
  64. package/skills/backend/durableBackgroundJobs/scripts/testWorkflowDispatch.py +24 -0
  65. package/skills/backend/golangStandard/SKILL.md +155 -0
  66. package/skills/backend/golangStandard/evals/goVerification.json +14 -0
  67. package/skills/backend/golangStandard/references/apiReference.md +3 -0
  68. package/skills/backend/golangStandard/references/layoutGuide.md +26 -0
  69. package/skills/backend/golangStandard/references/slogPatterns.md +26 -0
  70. package/skills/backend/golangStandard/scripts/scaffoldGoModule.py +105 -0
  71. package/skills/backend/pythonStandard/SKILL.md +138 -0
  72. package/skills/backend/pythonStandard/evals/pythonVerification.json +14 -0
  73. package/skills/backend/pythonStandard/references/apiReference.md +3 -0
  74. package/skills/backend/pythonStandard/references/pydanticPatterns.md +16 -0
  75. package/skills/backend/pythonStandard/references/pyprojectSpecs.md +37 -0
  76. package/skills/backend/pythonStandard/scripts/scaffoldUvProject.py +79 -0
  77. package/skills/backend/upstash/SKILL.md +98 -0
  78. package/skills/backend/upstash/evals/upstashVerification.json +14 -0
  79. package/skills/backend/upstash/references/apiReference.md +3 -0
  80. package/skills/backend/upstash/references/qstashFlowControl.md +34 -0
  81. package/skills/backend/upstash/references/ratelimitPatterns.md +53 -0
  82. package/skills/backend/upstash/references/workflowPatterns.md +35 -0
  83. package/skills/backend/upstash/scripts/testRedisConnection.py +36 -0
  84. package/skills/cicdDevops/cicdPipeline/SKILL.md +148 -0
  85. package/skills/cicdDevops/cicdPipeline/evals/evalCicd.py +37 -0
  86. package/skills/cicdDevops/cicdPipeline/references/apiReference.md +3 -0
  87. package/skills/cicdDevops/cicdPipeline/references/cicdDeploymentPatterns.md +27 -0
  88. package/skills/cicdDevops/cicdPipeline/scripts/auditDockerfileSecurity.py +56 -0
  89. package/skills/dataAi/mcpServerDevelopment/SKILL.md +123 -0
  90. package/skills/dataAi/mcpServerDevelopment/evals/mcpVerification.json +14 -0
  91. package/skills/dataAi/mcpServerDevelopment/references/apiReference.md +3 -0
  92. package/skills/dataAi/mcpServerDevelopment/references/mcpClientConfigs.md +38 -0
  93. package/skills/dataAi/mcpServerDevelopment/references/toolSchemaDesign.md +6 -0
  94. package/skills/dataAi/mcpServerDevelopment/scripts/runFastMcpBoilerplate.py +36 -0
  95. package/skills/dataAi/ragPipelineProduction/SKILL.md +113 -0
  96. package/skills/dataAi/ragPipelineProduction/evals/ragVerification.json +14 -0
  97. package/skills/dataAi/ragPipelineProduction/references/apiReference.md +3 -0
  98. package/skills/dataAi/ragPipelineProduction/references/chunkingStrategies.md +10 -0
  99. package/skills/dataAi/ragPipelineProduction/references/rrfAlgorithm.md +13 -0
  100. package/skills/dataAi/ragPipelineProduction/scripts/runHybridRrfSearch.py +33 -0
  101. package/skills/devopsCloud/cloudflare/SKILL.md +282 -0
  102. package/skills/devopsCloud/cloudflare/assets/README.md +48 -0
  103. package/skills/devopsCloud/cloudflare/assets/ai/agents-sdk.md +118 -0
  104. package/skills/devopsCloud/cloudflare/assets/ai/ai-gateway.md +105 -0
  105. package/skills/devopsCloud/cloudflare/assets/ai/ai-search.md +129 -0
  106. package/skills/devopsCloud/cloudflare/assets/ai/workers-ai.md +127 -0
  107. package/skills/devopsCloud/cloudflare/assets/cli/c3.md +292 -0
  108. package/skills/devopsCloud/cloudflare/assets/cli/cf-cli.md +90 -0
  109. package/skills/devopsCloud/cloudflare/assets/cli/wrangler.md +43 -0
  110. package/skills/devopsCloud/cloudflare/assets/compute/cron-triggers.md +486 -0
  111. package/skills/devopsCloud/cloudflare/assets/compute/service-bindings.md +251 -0
  112. package/skills/devopsCloud/cloudflare/assets/compute/smart-placement.md +435 -0
  113. package/skills/devopsCloud/cloudflare/assets/compute/static-assets.md +220 -0
  114. package/skills/devopsCloud/cloudflare/assets/compute/workers.md +129 -0
  115. package/skills/devopsCloud/cloudflare/assets/database-storage/d1.md +105 -0
  116. package/skills/devopsCloud/cloudflare/assets/database-storage/durable-objects.md +122 -0
  117. package/skills/devopsCloud/cloudflare/assets/database-storage/hyperdrive.md +210 -0
  118. package/skills/devopsCloud/cloudflare/assets/database-storage/kv.md +198 -0
  119. package/skills/devopsCloud/cloudflare/assets/database-storage/queues.md +105 -0
  120. package/skills/devopsCloud/cloudflare/assets/database-storage/r2.md +105 -0
  121. package/skills/devopsCloud/cloudflare/assets/database-storage/vectorize.md +97 -0
  122. package/skills/devopsCloud/cloudflare/assets/database-storage/workflows.md +141 -0
  123. package/skills/devopsCloud/cloudflare/assets/llms.txt +143 -0
  124. package/skills/devopsCloud/cloudflare/assets/networking-security/cache-cdn.md +109 -0
  125. package/skills/devopsCloud/cloudflare/assets/networking-security/dns.md +71 -0
  126. package/skills/devopsCloud/cloudflare/assets/networking-security/rate-limiting.md +130 -0
  127. package/skills/devopsCloud/cloudflare/assets/networking-security/tunnels.md +57 -0
  128. package/skills/devopsCloud/cloudflare/assets/networking-security/waf.md +143 -0
  129. package/skills/devopsCloud/cloudflare/assets/troubleshooting/1xxx-errors.md +209 -0
  130. package/skills/devopsCloud/cloudflare/assets/troubleshooting/5xx-errors.md +111 -0
  131. package/skills/devopsCloud/cloudflare/assets/troubleshooting/http-status-codes.md +38 -0
  132. package/skills/devopsCloud/cloudflare/evals/evals.json +75 -0
  133. package/skills/devopsCloud/cloudflare/references/ai-gateway/README.md +27 -0
  134. package/skills/devopsCloud/cloudflare/references/ai-gateway/configuration.md +18 -0
  135. package/skills/devopsCloud/cloudflare/references/ai-gateway/dynamic-routing.md +15 -0
  136. package/skills/devopsCloud/cloudflare/references/ai-gateway/features.md +22 -0
  137. package/skills/devopsCloud/cloudflare/references/ai-gateway/sdk-integration.md +19 -0
  138. package/skills/devopsCloud/cloudflare/references/ai-gateway/troubleshooting.md +16 -0
  139. package/skills/devopsCloud/cloudflare/references/ai-search/README.md +25 -0
  140. package/skills/devopsCloud/cloudflare/references/ai-search/api.md +13 -0
  141. package/skills/devopsCloud/cloudflare/references/ai-search/configuration.md +16 -0
  142. package/skills/devopsCloud/cloudflare/references/ai-search/gotchas.md +13 -0
  143. package/skills/devopsCloud/cloudflare/references/ai-search/patterns.md +15 -0
  144. package/skills/devopsCloud/cloudflare/references/bindings/README.md +16 -0
  145. package/skills/devopsCloud/cloudflare/references/bindings/api.md +19 -0
  146. package/skills/devopsCloud/cloudflare/references/bindings/configuration.md +20 -0
  147. package/skills/devopsCloud/cloudflare/references/bindings/gotchas.md +18 -0
  148. package/skills/devopsCloud/cloudflare/references/bindings/patterns.md +20 -0
  149. package/skills/devopsCloud/cloudflare/references/browser-rendering/README.md +18 -0
  150. package/skills/devopsCloud/cloudflare/references/browser-rendering/api.md +12 -0
  151. package/skills/devopsCloud/cloudflare/references/browser-rendering/configuration.md +12 -0
  152. package/skills/devopsCloud/cloudflare/references/browser-rendering/gotchas.md +15 -0
  153. package/skills/devopsCloud/cloudflare/references/browser-rendering/patterns.md +12 -0
  154. package/skills/devopsCloud/cloudflare/references/cliComparison.md +93 -0
  155. package/skills/devopsCloud/cloudflare/references/containers/README.md +23 -0
  156. package/skills/devopsCloud/cloudflare/references/containers/api.md +13 -0
  157. package/skills/devopsCloud/cloudflare/references/containers/configuration.md +15 -0
  158. package/skills/devopsCloud/cloudflare/references/containers/gotchas.md +16 -0
  159. package/skills/devopsCloud/cloudflare/references/containers/patterns.md +18 -0
  160. package/skills/devopsCloud/cloudflare/references/cron-triggers/README.md +20 -0
  161. package/skills/devopsCloud/cloudflare/references/cron-triggers/api.md +16 -0
  162. package/skills/devopsCloud/cloudflare/references/cron-triggers/configuration.md +16 -0
  163. package/skills/devopsCloud/cloudflare/references/cron-triggers/gotchas.md +17 -0
  164. package/skills/devopsCloud/cloudflare/references/cron-triggers/patterns.md +18 -0
  165. package/skills/devopsCloud/cloudflare/references/d1/README.md +15 -0
  166. package/skills/devopsCloud/cloudflare/references/d1/api.md +18 -0
  167. package/skills/devopsCloud/cloudflare/references/d1/configuration.md +18 -0
  168. package/skills/devopsCloud/cloudflare/references/d1/gotchas.md +18 -0
  169. package/skills/devopsCloud/cloudflare/references/d1/patterns.md +21 -0
  170. package/skills/devopsCloud/cloudflare/references/frameworkCompatibility.md +110 -0
  171. package/skills/devopsCloud/cloudflare/references/hyperdrive/README.md +28 -0
  172. package/skills/devopsCloud/cloudflare/references/hyperdrive/api.md +26 -0
  173. package/skills/devopsCloud/cloudflare/references/hyperdrive/configuration.md +34 -0
  174. package/skills/devopsCloud/cloudflare/references/hyperdrive/gotchas.md +20 -0
  175. package/skills/devopsCloud/cloudflare/references/hyperdrive/patterns.md +15 -0
  176. package/skills/devopsCloud/cloudflare/references/images/README.md +12 -0
  177. package/skills/devopsCloud/cloudflare/references/images/api.md +13 -0
  178. package/skills/devopsCloud/cloudflare/references/images/configuration.md +17 -0
  179. package/skills/devopsCloud/cloudflare/references/images/gotchas.md +16 -0
  180. package/skills/devopsCloud/cloudflare/references/images/patterns.md +16 -0
  181. package/skills/devopsCloud/cloudflare/references/kv/README.md +15 -0
  182. package/skills/devopsCloud/cloudflare/references/kv/api.md +18 -0
  183. package/skills/devopsCloud/cloudflare/references/kv/configuration.md +16 -0
  184. package/skills/devopsCloud/cloudflare/references/kv/gotchas.md +17 -0
  185. package/skills/devopsCloud/cloudflare/references/kv/patterns.md +21 -0
  186. package/skills/devopsCloud/cloudflare/references/miniflare/README.md +22 -0
  187. package/skills/devopsCloud/cloudflare/references/miniflare/api.md +16 -0
  188. package/skills/devopsCloud/cloudflare/references/miniflare/configuration.md +16 -0
  189. package/skills/devopsCloud/cloudflare/references/miniflare/gotchas.md +15 -0
  190. package/skills/devopsCloud/cloudflare/references/miniflare/patterns.md +19 -0
  191. package/skills/devopsCloud/cloudflare/references/observability/README.md +27 -0
  192. package/skills/devopsCloud/cloudflare/references/observability/api.md +20 -0
  193. package/skills/devopsCloud/cloudflare/references/observability/configuration.md +23 -0
  194. package/skills/devopsCloud/cloudflare/references/observability/gotchas.md +25 -0
  195. package/skills/devopsCloud/cloudflare/references/observability/patterns.md +14 -0
  196. package/skills/devopsCloud/cloudflare/references/pages/README.md +20 -0
  197. package/skills/devopsCloud/cloudflare/references/pages/api.md +13 -0
  198. package/skills/devopsCloud/cloudflare/references/pages/configuration.md +16 -0
  199. package/skills/devopsCloud/cloudflare/references/pages/gotchas.md +19 -0
  200. package/skills/devopsCloud/cloudflare/references/pages/patterns.md +15 -0
  201. package/skills/devopsCloud/cloudflare/references/pages-functions/README.md +20 -0
  202. package/skills/devopsCloud/cloudflare/references/pages-functions/api.md +13 -0
  203. package/skills/devopsCloud/cloudflare/references/pages-functions/configuration.md +14 -0
  204. package/skills/devopsCloud/cloudflare/references/pages-functions/gotchas.md +17 -0
  205. package/skills/devopsCloud/cloudflare/references/pages-functions/patterns.md +16 -0
  206. package/skills/devopsCloud/cloudflare/references/productSelectionMatrix.md +54 -0
  207. package/skills/devopsCloud/cloudflare/references/queues/README.md +24 -0
  208. package/skills/devopsCloud/cloudflare/references/queues/api.md +16 -0
  209. package/skills/devopsCloud/cloudflare/references/queues/configuration.md +20 -0
  210. package/skills/devopsCloud/cloudflare/references/queues/gotchas.md +18 -0
  211. package/skills/devopsCloud/cloudflare/references/queues/patterns.md +21 -0
  212. package/skills/devopsCloud/cloudflare/references/r2/README.md +26 -0
  213. package/skills/devopsCloud/cloudflare/references/r2/api.md +16 -0
  214. package/skills/devopsCloud/cloudflare/references/r2/configuration.md +19 -0
  215. package/skills/devopsCloud/cloudflare/references/r2/gotchas.md +17 -0
  216. package/skills/devopsCloud/cloudflare/references/r2/patterns.md +18 -0
  217. package/skills/devopsCloud/cloudflare/references/secrets-store/README.md +22 -0
  218. package/skills/devopsCloud/cloudflare/references/secrets-store/api.md +21 -0
  219. package/skills/devopsCloud/cloudflare/references/secrets-store/configuration.md +25 -0
  220. package/skills/devopsCloud/cloudflare/references/secrets-store/gotchas.md +19 -0
  221. package/skills/devopsCloud/cloudflare/references/secrets-store/patterns.md +27 -0
  222. package/skills/devopsCloud/cloudflare/references/skill-feedback.md +41 -0
  223. package/skills/devopsCloud/cloudflare/references/static-assets/README.md +21 -0
  224. package/skills/devopsCloud/cloudflare/references/static-assets/api.md +16 -0
  225. package/skills/devopsCloud/cloudflare/references/static-assets/configuration.md +16 -0
  226. package/skills/devopsCloud/cloudflare/references/static-assets/gotchas.md +18 -0
  227. package/skills/devopsCloud/cloudflare/references/static-assets/patterns.md +17 -0
  228. package/skills/devopsCloud/cloudflare/references/stream/README.md +22 -0
  229. package/skills/devopsCloud/cloudflare/references/stream/api-live.md +18 -0
  230. package/skills/devopsCloud/cloudflare/references/stream/api.md +21 -0
  231. package/skills/devopsCloud/cloudflare/references/stream/configuration.md +18 -0
  232. package/skills/devopsCloud/cloudflare/references/stream/gotchas.md +18 -0
  233. package/skills/devopsCloud/cloudflare/references/stream/patterns.md +22 -0
  234. package/skills/devopsCloud/cloudflare/references/tail-workers/README.md +21 -0
  235. package/skills/devopsCloud/cloudflare/references/tail-workers/api.md +13 -0
  236. package/skills/devopsCloud/cloudflare/references/tail-workers/configuration.md +15 -0
  237. package/skills/devopsCloud/cloudflare/references/tail-workers/gotchas.md +16 -0
  238. package/skills/devopsCloud/cloudflare/references/tail-workers/patterns.md +15 -0
  239. package/skills/devopsCloud/cloudflare/references/tunnel/README.md +20 -0
  240. package/skills/devopsCloud/cloudflare/references/tunnel/api.md +14 -0
  241. package/skills/devopsCloud/cloudflare/references/tunnel/configuration.md +14 -0
  242. package/skills/devopsCloud/cloudflare/references/tunnel/gotchas.md +15 -0
  243. package/skills/devopsCloud/cloudflare/references/tunnel/networking.md +14 -0
  244. package/skills/devopsCloud/cloudflare/references/tunnel/patterns.md +15 -0
  245. package/skills/devopsCloud/cloudflare/references/vectorize/README.md +22 -0
  246. package/skills/devopsCloud/cloudflare/references/vectorize/api.md +18 -0
  247. package/skills/devopsCloud/cloudflare/references/vectorize/configuration.md +19 -0
  248. package/skills/devopsCloud/cloudflare/references/vectorize/gotchas.md +15 -0
  249. package/skills/devopsCloud/cloudflare/references/vectorize/patterns.md +24 -0
  250. package/skills/devopsCloud/cloudflare/references/waf/README.md +21 -0
  251. package/skills/devopsCloud/cloudflare/references/waf/api.md +17 -0
  252. package/skills/devopsCloud/cloudflare/references/waf/configuration.md +18 -0
  253. package/skills/devopsCloud/cloudflare/references/waf/gotchas.md +19 -0
  254. package/skills/devopsCloud/cloudflare/references/waf/patterns.md +17 -0
  255. package/skills/devopsCloud/cloudflare/references/workers-ai/README.md +24 -0
  256. package/skills/devopsCloud/cloudflare/references/workers-ai/api.md +13 -0
  257. package/skills/devopsCloud/cloudflare/references/workers-ai/configuration.md +16 -0
  258. package/skills/devopsCloud/cloudflare/references/workers-ai/gotchas.md +15 -0
  259. package/skills/devopsCloud/cloudflare/references/workers-ai/patterns.md +14 -0
  260. package/skills/devopsCloud/cloudflare/references/workflows/README.md +23 -0
  261. package/skills/devopsCloud/cloudflare/references/workflows/api.md +17 -0
  262. package/skills/devopsCloud/cloudflare/references/workflows/configuration.md +18 -0
  263. package/skills/devopsCloud/cloudflare/references/workflows/gotchas.md +19 -0
  264. package/skills/devopsCloud/cloudflare/references/workflows/patterns.md +30 -0
  265. package/skills/devopsCloud/cloudflare/scripts/auditCloudflareProduction.py +95 -0
  266. package/skills/foundation/promptEvalTesting/SKILL.md +114 -0
  267. package/skills/foundation/promptEvalTesting/evals/promptEvalVerification.json +14 -0
  268. package/skills/foundation/promptEvalTesting/references/apiReference.md +3 -0
  269. package/skills/foundation/promptEvalTesting/references/evalMetricsCatalog.md +7 -0
  270. package/skills/foundation/promptEvalTesting/references/promptfooConfigSpecs.md +16 -0
  271. package/skills/foundation/promptEvalTesting/scripts/runPromptEvalSuite.py +29 -0
  272. package/skills/frontend/astro/SKILL.md +327 -0
  273. package/skills/frontend/astro/assets/README.md +71 -0
  274. package/skills/frontend/astro/assets/add-content-to-your-site/content-collections.md +1061 -0
  275. package/skills/frontend/astro/assets/add-content-to-your-site/data-fetching.md +109 -0
  276. package/skills/frontend/astro/assets/add-content-to-your-site/images.md +719 -0
  277. package/skills/frontend/astro/assets/add-content-to-your-site/markdown.md +725 -0
  278. package/skills/frontend/astro/assets/build-your-ui/components.md +402 -0
  279. package/skills/frontend/astro/assets/build-your-ui/fonts.md +437 -0
  280. package/skills/frontend/astro/assets/build-your-ui/front-end-frameworks.md +245 -0
  281. package/skills/frontend/astro/assets/build-your-ui/layouts.md +267 -0
  282. package/skills/frontend/astro/assets/build-your-ui/scripts-and-event-handling.md +229 -0
  283. package/skills/frontend/astro/assets/build-your-ui/styles-and-css.md +782 -0
  284. package/skills/frontend/astro/assets/build-your-ui/syntax-highlighting.md +269 -0
  285. package/skills/frontend/astro/assets/configuration/build-with-ai.md +389 -0
  286. package/skills/frontend/astro/assets/configuration/configuration-overview.md +122 -0
  287. package/skills/frontend/astro/assets/configuration/dev-toolbar.md +86 -0
  288. package/skills/frontend/astro/assets/configuration/editor-setup.md +166 -0
  289. package/skills/frontend/astro/assets/configuration/environment-variables.md +352 -0
  290. package/skills/frontend/astro/assets/configuration/typescript.md +379 -0
  291. package/skills/frontend/astro/assets/configuration/working-with-integrations.md +606 -0
  292. package/skills/frontend/astro/assets/reference/adapter-reference.md +1242 -0
  293. package/skills/frontend/astro/assets/reference/cli-reference.md +575 -0
  294. package/skills/frontend/astro/assets/reference/configuration-reference.md +3144 -0
  295. package/skills/frontend/astro/assets/reference/content-loader-reference.md +1682 -0
  296. package/skills/frontend/astro/assets/reference/directives-reference.md +324 -0
  297. package/skills/frontend/astro/assets/reference/image-service-reference.md +346 -0
  298. package/skills/frontend/astro/assets/reference/integrations-reference.md +2813 -0
  299. package/skills/frontend/astro/assets/reference/modules/astro-actions.md +604 -0
  300. package/skills/frontend/astro/assets/reference/modules/astro-app.md +460 -0
  301. package/skills/frontend/astro/assets/reference/modules/astro-assets.md +1657 -0
  302. package/skills/frontend/astro/assets/reference/modules/astro-config.md +395 -0
  303. package/skills/frontend/astro/assets/reference/modules/astro-content.md +720 -0
  304. package/skills/frontend/astro/assets/reference/modules/astro-env.md +46 -0
  305. package/skills/frontend/astro/assets/reference/modules/astro-fetch.md +346 -0
  306. package/skills/frontend/astro/assets/reference/modules/astro-hono.md +37 -0
  307. package/skills/frontend/astro/assets/reference/modules/astro-i18n.md +462 -0
  308. package/skills/frontend/astro/assets/reference/modules/astro-middleware.md +292 -0
  309. package/skills/frontend/astro/assets/reference/modules/astro-static-paths.md +74 -0
  310. package/skills/frontend/astro/assets/reference/modules/astro-transitions.md +595 -0
  311. package/skills/frontend/astro/assets/reference/modules/astro-zod.md +120 -0
  312. package/skills/frontend/astro/assets/reference/session-driver-reference.md +205 -0
  313. package/skills/frontend/astro/assets/routing-and-navigation/endpoints.md +251 -0
  314. package/skills/frontend/astro/assets/routing-and-navigation/internationalization.md +374 -0
  315. package/skills/frontend/astro/assets/routing-and-navigation/middleware.md +288 -0
  316. package/skills/frontend/astro/assets/routing-and-navigation/pages.md +205 -0
  317. package/skills/frontend/astro/assets/routing-and-navigation/prefetch.md +273 -0
  318. package/skills/frontend/astro/assets/routing-and-navigation/routing.md +760 -0
  319. package/skills/frontend/astro/assets/routing-and-navigation/view-transitions.md +792 -0
  320. package/skills/frontend/astro/assets/server-rendering/actions.md +770 -0
  321. package/skills/frontend/astro/assets/server-rendering/caching.md +255 -0
  322. package/skills/frontend/astro/assets/server-rendering/on-demand-rendering.md +289 -0
  323. package/skills/frontend/astro/assets/server-rendering/server-islands.md +126 -0
  324. package/skills/frontend/astro/assets/server-rendering/sessions.md +270 -0
  325. package/skills/frontend/astro/assets/start-a-new-project/develop-and-build.md +147 -0
  326. package/skills/frontend/astro/assets/start-a-new-project/installation.md +342 -0
  327. package/skills/frontend/astro/assets/start-a-new-project/project-structure.md +137 -0
  328. package/skills/frontend/astro/assets/upgrade-and-troubleshooting/testing.md +412 -0
  329. package/skills/frontend/astro/assets/upgrade-and-troubleshooting/troubleshooting.md +229 -0
  330. package/skills/frontend/astro/assets/upgrade-and-troubleshooting/upgrade-astro.md +205 -0
  331. package/skills/frontend/astro/assets/welcome/courses.md +46 -0
  332. package/skills/frontend/astro/assets/welcome/islands-architecture.md +135 -0
  333. package/skills/frontend/astro/assets/welcome/why-astro.md +90 -0
  334. package/skills/frontend/astro/evals/evals.json +66 -0
  335. package/skills/frontend/astro/references/contentCollections.md +164 -0
  336. package/skills/frontend/astro/references/islandsArchitecture.md +128 -0
  337. package/skills/frontend/astro/references/serverIslandsAndActions.md +187 -0
  338. package/skills/frontend/astro/scripts/auditAstroProduction.py +78 -0
  339. package/skills/frontend/generativeUi/SKILL.md +128 -0
  340. package/skills/frontend/generativeUi/evals/generativeUiVerification.json +14 -0
  341. package/skills/frontend/generativeUi/references/apiReference.md +3 -0
  342. package/skills/frontend/generativeUi/references/clientToolComponentMapping.md +8 -0
  343. package/skills/frontend/generativeUi/references/dataStreamProtocol.md +10 -0
  344. package/skills/frontend/generativeUi/scripts/generateUiComponentStub.py +46 -0
  345. package/skills/frontend/nextjs/SKILL.md +138 -0
  346. package/skills/frontend/nextjs/assets/README.md +67 -0
  347. package/skills/frontend/nextjs/assets/api-reference/cli/create-next-app.md +210 -0
  348. package/skills/frontend/nextjs/assets/api-reference/cli/next.md +484 -0
  349. package/skills/frontend/nextjs/assets/api-reference/components/font.md +952 -0
  350. package/skills/frontend/nextjs/assets/api-reference/components/form.md +387 -0
  351. package/skills/frontend/nextjs/assets/api-reference/components/image.md +1372 -0
  352. package/skills/frontend/nextjs/assets/api-reference/components/link.md +954 -0
  353. package/skills/frontend/nextjs/assets/api-reference/components/script.md +421 -0
  354. package/skills/frontend/nextjs/assets/api-reference/directives/use-cache-private.md +211 -0
  355. package/skills/frontend/nextjs/assets/api-reference/directives/use-cache-remote.md +652 -0
  356. package/skills/frontend/nextjs/assets/api-reference/directives/use-cache.md +848 -0
  357. package/skills/frontend/nextjs/assets/api-reference/directives/use-client.md +149 -0
  358. package/skills/frontend/nextjs/assets/api-reference/directives/use-server.md +234 -0
  359. package/skills/frontend/nextjs/assets/api-reference/edge-runtime.md +188 -0
  360. package/skills/frontend/nextjs/assets/api-reference/file-conventions/default.md +80 -0
  361. package/skills/frontend/nextjs/assets/api-reference/file-conventions/dynamic-routes.md +417 -0
  362. package/skills/frontend/nextjs/assets/api-reference/file-conventions/error.md +361 -0
  363. package/skills/frontend/nextjs/assets/api-reference/file-conventions/forbidden.md +75 -0
  364. package/skills/frontend/nextjs/assets/api-reference/file-conventions/instrumentation-client.md +308 -0
  365. package/skills/frontend/nextjs/assets/api-reference/file-conventions/instrumentation.md +177 -0
  366. package/skills/frontend/nextjs/assets/api-reference/file-conventions/intercepting-routes.md +78 -0
  367. package/skills/frontend/nextjs/assets/api-reference/file-conventions/layout.md +803 -0
  368. package/skills/frontend/nextjs/assets/api-reference/file-conventions/loading.md +209 -0
  369. package/skills/frontend/nextjs/assets/api-reference/file-conventions/mdx-components.md +84 -0
  370. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/app-icons.md +302 -0
  371. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/manifest.md +90 -0
  372. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/opengraph-image.md +580 -0
  373. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/robots.md +234 -0
  374. package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/sitemap.md +459 -0
  375. package/skills/frontend/nextjs/assets/api-reference/file-conventions/not-found.md +278 -0
  376. package/skills/frontend/nextjs/assets/api-reference/file-conventions/page.md +283 -0
  377. package/skills/frontend/nextjs/assets/api-reference/file-conventions/parallel-routes.md +517 -0
  378. package/skills/frontend/nextjs/assets/api-reference/file-conventions/proxy.md +857 -0
  379. package/skills/frontend/nextjs/assets/api-reference/file-conventions/public-folder.md +47 -0
  380. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-groups.md +40 -0
  381. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/dynamicParams.md +40 -0
  382. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/ensureStatic.md +195 -0
  383. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/instant.md +204 -0
  384. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/maxDuration.md +42 -0
  385. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/preferredRegion.md +55 -0
  386. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/prefetch.md +113 -0
  387. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/runtime.md +43 -0
  388. package/skills/frontend/nextjs/assets/api-reference/file-conventions/route.md +772 -0
  389. package/skills/frontend/nextjs/assets/api-reference/file-conventions/src-folder.md +42 -0
  390. package/skills/frontend/nextjs/assets/api-reference/file-conventions/template.md +174 -0
  391. package/skills/frontend/nextjs/assets/api-reference/file-conventions/unauthorized.md +143 -0
  392. package/skills/frontend/nextjs/assets/api-reference/functions/after.md +332 -0
  393. package/skills/frontend/nextjs/assets/api-reference/functions/cacheLife.md +642 -0
  394. package/skills/frontend/nextjs/assets/api-reference/functions/cacheTag.md +272 -0
  395. package/skills/frontend/nextjs/assets/api-reference/functions/catchError.md +267 -0
  396. package/skills/frontend/nextjs/assets/api-reference/functions/connection.md +114 -0
  397. package/skills/frontend/nextjs/assets/api-reference/functions/cookies.md +349 -0
  398. package/skills/frontend/nextjs/assets/api-reference/functions/draft-mode.md +173 -0
  399. package/skills/frontend/nextjs/assets/api-reference/functions/fetch.md +141 -0
  400. package/skills/frontend/nextjs/assets/api-reference/functions/forbidden.md +327 -0
  401. package/skills/frontend/nextjs/assets/api-reference/functions/generate-image-metadata.md +311 -0
  402. package/skills/frontend/nextjs/assets/api-reference/functions/generate-metadata.md +1510 -0
  403. package/skills/frontend/nextjs/assets/api-reference/functions/generate-sitemaps.md +102 -0
  404. package/skills/frontend/nextjs/assets/api-reference/functions/generate-static-params.md +606 -0
  405. package/skills/frontend/nextjs/assets/api-reference/functions/generate-viewport.md +347 -0
  406. package/skills/frontend/nextjs/assets/api-reference/functions/headers.md +92 -0
  407. package/skills/frontend/nextjs/assets/api-reference/functions/image-response.md +225 -0
  408. package/skills/frontend/nextjs/assets/api-reference/functions/io.md +131 -0
  409. package/skills/frontend/nextjs/assets/api-reference/functions/navigation.md +220 -0
  410. package/skills/frontend/nextjs/assets/api-reference/functions/next-request.md +116 -0
  411. package/skills/frontend/nextjs/assets/api-reference/functions/next-response.md +219 -0
  412. package/skills/frontend/nextjs/assets/api-reference/functions/next-root-params.md +479 -0
  413. package/skills/frontend/nextjs/assets/api-reference/functions/not-found.md +269 -0
  414. package/skills/frontend/nextjs/assets/api-reference/functions/permanentRedirect.md +92 -0
  415. package/skills/frontend/nextjs/assets/api-reference/functions/prefetch.md +202 -0
  416. package/skills/frontend/nextjs/assets/api-reference/functions/redirect.md +255 -0
  417. package/skills/frontend/nextjs/assets/api-reference/functions/refresh.md +91 -0
  418. package/skills/frontend/nextjs/assets/api-reference/functions/revalidatePath.md +248 -0
  419. package/skills/frontend/nextjs/assets/api-reference/functions/revalidateTag.md +175 -0
  420. package/skills/frontend/nextjs/assets/api-reference/functions/unauthorized.md +389 -0
  421. package/skills/frontend/nextjs/assets/api-reference/functions/unstable_cache.md +131 -0
  422. package/skills/frontend/nextjs/assets/api-reference/functions/unstable_noStore.md +61 -0
  423. package/skills/frontend/nextjs/assets/api-reference/functions/unstable_rethrow.md +79 -0
  424. package/skills/frontend/nextjs/assets/api-reference/functions/updateTag.md +173 -0
  425. package/skills/frontend/nextjs/assets/api-reference/functions/use-link-status.md +268 -0
  426. package/skills/frontend/nextjs/assets/api-reference/functions/use-offline.md +222 -0
  427. package/skills/frontend/nextjs/assets/api-reference/functions/use-params.md +102 -0
  428. package/skills/frontend/nextjs/assets/api-reference/functions/use-pathname.md +189 -0
  429. package/skills/frontend/nextjs/assets/api-reference/functions/use-report-web-vitals.md +175 -0
  430. package/skills/frontend/nextjs/assets/api-reference/functions/use-router.md +214 -0
  431. package/skills/frontend/nextjs/assets/api-reference/functions/use-search-params.md +416 -0
  432. package/skills/frontend/nextjs/assets/api-reference/functions/use-selected-layout-segment.md +214 -0
  433. package/skills/frontend/nextjs/assets/api-reference/functions/use-selected-layout-segments.md +116 -0
  434. package/skills/frontend/nextjs/assets/api-reference/functions/use-server-inserted-html.md +145 -0
  435. package/skills/frontend/nextjs/assets/api-reference/functions/userAgent.md +95 -0
  436. package/skills/frontend/nextjs/assets/api-reference/turbopack.md +552 -0
  437. package/skills/frontend/nextjs/assets/architecture/accessibility.md +47 -0
  438. package/skills/frontend/nextjs/assets/architecture/fast-refresh.md +122 -0
  439. package/skills/frontend/nextjs/assets/architecture/nextjs-compiler.md +376 -0
  440. package/skills/frontend/nextjs/assets/architecture/supported-browsers.md +146 -0
  441. package/skills/frontend/nextjs/assets/community/contribution-guide.md +459 -0
  442. package/skills/frontend/nextjs/assets/community/rspack.md +25 -0
  443. package/skills/frontend/nextjs/assets/getting-started/caching.md +626 -0
  444. package/skills/frontend/nextjs/assets/getting-started/css.md +336 -0
  445. package/skills/frontend/nextjs/assets/getting-started/deploying.md +115 -0
  446. package/skills/frontend/nextjs/assets/getting-started/error-handling.md +485 -0
  447. package/skills/frontend/nextjs/assets/getting-started/fetching-data.md +743 -0
  448. package/skills/frontend/nextjs/assets/getting-started/fonts.md +232 -0
  449. package/skills/frontend/nextjs/assets/getting-started/images.md +272 -0
  450. package/skills/frontend/nextjs/assets/getting-started/installation.md +446 -0
  451. package/skills/frontend/nextjs/assets/getting-started/layouts-and-pages.md +386 -0
  452. package/skills/frontend/nextjs/assets/getting-started/linking-and-navigating.md +475 -0
  453. package/skills/frontend/nextjs/assets/getting-started/metadata-and-og-images.md +370 -0
  454. package/skills/frontend/nextjs/assets/getting-started/mutating-data.md +679 -0
  455. package/skills/frontend/nextjs/assets/getting-started/project-structure.md +290 -0
  456. package/skills/frontend/nextjs/assets/getting-started/proxy.md +107 -0
  457. package/skills/frontend/nextjs/assets/getting-started/revalidating.md +241 -0
  458. package/skills/frontend/nextjs/assets/getting-started/route-handlers.md +233 -0
  459. package/skills/frontend/nextjs/assets/getting-started/server-and-client-components.md +683 -0
  460. package/skills/frontend/nextjs/assets/getting-started/upgrading.md +137 -0
  461. package/skills/frontend/nextjs/assets/glossary.md +315 -0
  462. package/skills/frontend/nextjs/evals/nextjsVerification.json +14 -0
  463. package/skills/frontend/nextjs/references/apiReference.md +3 -0
  464. package/skills/frontend/nextjs/references/dataAccessLayer.md +39 -0
  465. package/skills/frontend/nextjs/references/nextjsFeatureMap.md +276 -0
  466. package/skills/frontend/nextjs/references/productionChecklist.md +49 -0
  467. package/skills/frontend/nextjs/references/securityHeadersCsp.md +44 -0
  468. package/skills/frontend/nextjs/scripts/auditProductionReadiness.py +85 -0
  469. package/skills/frontend/shadcn-ui/SKILL.md +102 -0
  470. package/skills/frontend/shadcn-ui/assets/README.md +82 -0
  471. package/skills/frontend/shadcn-ui/assets/advanced/javascript.md +44 -0
  472. package/skills/frontend/shadcn-ui/assets/advanced/monorepo.md +254 -0
  473. package/skills/frontend/shadcn-ui/assets/advanced/react-19.md +166 -0
  474. package/skills/frontend/shadcn-ui/assets/advanced/tailwind-v4.md +333 -0
  475. package/skills/frontend/shadcn-ui/assets/ai-elements/chain-of-thought.md +519 -0
  476. package/skills/frontend/shadcn-ui/assets/ai-elements/chat.md +581 -0
  477. package/skills/frontend/shadcn-ui/assets/ai-elements/checkpoint.md +243 -0
  478. package/skills/frontend/shadcn-ui/assets/ai-elements/confirmation.md +382 -0
  479. package/skills/frontend/shadcn-ui/assets/ai-elements/context.md +188 -0
  480. package/skills/frontend/shadcn-ui/assets/ai-elements/file-tree.md +248 -0
  481. package/skills/frontend/shadcn-ui/assets/ai-elements/index.md +307 -0
  482. package/skills/frontend/shadcn-ui/assets/ai-elements/inline-citation.md +219 -0
  483. package/skills/frontend/shadcn-ui/assets/ai-elements/message.md +298 -0
  484. package/skills/frontend/shadcn-ui/assets/ai-elements/model-selector.md +368 -0
  485. package/skills/frontend/shadcn-ui/assets/ai-elements/plan.md +398 -0
  486. package/skills/frontend/shadcn-ui/assets/ai-elements/prompt-input.md +403 -0
  487. package/skills/frontend/shadcn-ui/assets/ai-elements/queue.md +517 -0
  488. package/skills/frontend/shadcn-ui/assets/ai-elements/reasoning.md +349 -0
  489. package/skills/frontend/shadcn-ui/assets/ai-elements/sources.md +303 -0
  490. package/skills/frontend/shadcn-ui/assets/ai-elements/stack-trace.md +514 -0
  491. package/skills/frontend/shadcn-ui/assets/ai-elements/subagent.md +551 -0
  492. package/skills/frontend/shadcn-ui/assets/ai-elements/suggestion.md +246 -0
  493. package/skills/frontend/shadcn-ui/assets/ai-elements/task.md +380 -0
  494. package/skills/frontend/shadcn-ui/assets/ai-elements/terminal.md +463 -0
  495. package/skills/frontend/shadcn-ui/assets/ai-elements/test-results.md +641 -0
  496. package/skills/frontend/shadcn-ui/assets/ai-elements/tool.md +915 -0
  497. package/skills/frontend/shadcn-ui/assets/components/accordion.md +490 -0
  498. package/skills/frontend/shadcn-ui/assets/components/alert-dialog.md +520 -0
  499. package/skills/frontend/shadcn-ui/assets/components/alert.md +351 -0
  500. package/skills/frontend/shadcn-ui/assets/components/aspect-ratio.md +206 -0
  501. package/skills/frontend/shadcn-ui/assets/components/attachment.md +715 -0
  502. package/skills/frontend/shadcn-ui/assets/components/avatar.md +581 -0
  503. package/skills/frontend/shadcn-ui/assets/components/badge.md +276 -0
  504. package/skills/frontend/shadcn-ui/assets/components/breadcrumb.md +556 -0
  505. package/skills/frontend/shadcn-ui/assets/components/bubble.md +706 -0
  506. package/skills/frontend/shadcn-ui/assets/components/button-group.md +969 -0
  507. package/skills/frontend/shadcn-ui/assets/components/button.md +523 -0
  508. package/skills/frontend/shadcn-ui/assets/components/calendar.md +959 -0
  509. package/skills/frontend/shadcn-ui/assets/components/card.md +684 -0
  510. package/skills/frontend/shadcn-ui/assets/components/carousel.md +643 -0
  511. package/skills/frontend/shadcn-ui/assets/components/chart.md +1295 -0
  512. package/skills/frontend/shadcn-ui/assets/components/checkbox.md +553 -0
  513. package/skills/frontend/shadcn-ui/assets/components/code-block.md +2041 -0
  514. package/skills/frontend/shadcn-ui/assets/components/collapsible.md +504 -0
  515. package/skills/frontend/shadcn-ui/assets/components/combobox.md +1102 -0
  516. package/skills/frontend/shadcn-ui/assets/components/command.md +682 -0
  517. package/skills/frontend/shadcn-ui/assets/components/context-menu.md +949 -0
  518. package/skills/frontend/shadcn-ui/assets/components/data-table.md +1667 -0
  519. package/skills/frontend/shadcn-ui/assets/components/date-picker.md +698 -0
  520. package/skills/frontend/shadcn-ui/assets/components/dialog.md +454 -0
  521. package/skills/frontend/shadcn-ui/assets/components/direction.md +205 -0
  522. package/skills/frontend/shadcn-ui/assets/components/drawer.md +806 -0
  523. package/skills/frontend/shadcn-ui/assets/components/dropdown-menu.md +1315 -0
  524. package/skills/frontend/shadcn-ui/assets/components/empty.md +562 -0
  525. package/skills/frontend/shadcn-ui/assets/components/field.md +1321 -0
  526. package/skills/frontend/shadcn-ui/assets/components/hover-card.md +342 -0
  527. package/skills/frontend/shadcn-ui/assets/components/index.md +82 -0
  528. package/skills/frontend/shadcn-ui/assets/components/input-group.md +980 -0
  529. package/skills/frontend/shadcn-ui/assets/components/input-otp.md +551 -0
  530. package/skills/frontend/shadcn-ui/assets/components/input.md +555 -0
  531. package/skills/frontend/shadcn-ui/assets/components/item.md +937 -0
  532. package/skills/frontend/shadcn-ui/assets/components/kbd.md +290 -0
  533. package/skills/frontend/shadcn-ui/assets/components/label.md +327 -0
  534. package/skills/frontend/shadcn-ui/assets/components/marker.md +445 -0
  535. package/skills/frontend/shadcn-ui/assets/components/menubar.md +804 -0
  536. package/skills/frontend/shadcn-ui/assets/components/message-scroller.md +2770 -0
  537. package/skills/frontend/shadcn-ui/assets/components/message.md +618 -0
  538. package/skills/frontend/shadcn-ui/assets/components/native-select.md +321 -0
  539. package/skills/frontend/shadcn-ui/assets/components/navigation-menu.md +568 -0
  540. package/skills/frontend/shadcn-ui/assets/components/pagination.md +425 -0
  541. package/skills/frontend/shadcn-ui/assets/components/popover.md +402 -0
  542. package/skills/frontend/shadcn-ui/assets/components/progress.md +240 -0
  543. package/skills/frontend/shadcn-ui/assets/components/questionnaire.md +2055 -0
  544. package/skills/frontend/shadcn-ui/assets/components/radio-group.md +440 -0
  545. package/skills/frontend/shadcn-ui/assets/components/resizable.md +302 -0
  546. package/skills/frontend/shadcn-ui/assets/components/scroll-area.md +226 -0
  547. package/skills/frontend/shadcn-ui/assets/components/select.md +647 -0
  548. package/skills/frontend/shadcn-ui/assets/components/separator.md +235 -0
  549. package/skills/frontend/shadcn-ui/assets/components/sheet.md +354 -0
  550. package/skills/frontend/shadcn-ui/assets/components/sidebar.md +1156 -0
  551. package/skills/frontend/shadcn-ui/assets/components/skeleton.md +217 -0
  552. package/skills/frontend/shadcn-ui/assets/components/slider.md +253 -0
  553. package/skills/frontend/shadcn-ui/assets/components/spinner.md +352 -0
  554. package/skills/frontend/shadcn-ui/assets/components/switch.md +296 -0
  555. package/skills/frontend/shadcn-ui/assets/components/table.md +572 -0
  556. package/skills/frontend/shadcn-ui/assets/components/tabs.md +425 -0
  557. package/skills/frontend/shadcn-ui/assets/components/textarea.md +218 -0
  558. package/skills/frontend/shadcn-ui/assets/components/toast.md +260 -0
  559. package/skills/frontend/shadcn-ui/assets/components/toggle-group.md +419 -0
  560. package/skills/frontend/shadcn-ui/assets/components/toggle.md +220 -0
  561. package/skills/frontend/shadcn-ui/assets/components/tooltip.md +332 -0
  562. package/skills/frontend/shadcn-ui/assets/components/trace.md +1890 -0
  563. package/skills/frontend/shadcn-ui/assets/components/typography.md +561 -0
  564. package/skills/frontend/shadcn-ui/assets/dark-mode/next.md +108 -0
  565. package/skills/frontend/shadcn-ui/assets/dark-mode/overview.md +75 -0
  566. package/skills/frontend/shadcn-ui/assets/dark-mode/vite.md +144 -0
  567. package/skills/frontend/shadcn-ui/assets/forms/next.md +716 -0
  568. package/skills/frontend/shadcn-ui/assets/forms/overview.md +60 -0
  569. package/skills/frontend/shadcn-ui/assets/forms/react-hook-form.md +2055 -0
  570. package/skills/frontend/shadcn-ui/assets/forms/tanstack-form.md +2236 -0
  571. package/skills/frontend/shadcn-ui/assets/installation/astro.md +252 -0
  572. package/skills/frontend/shadcn-ui/assets/installation/manual.md +255 -0
  573. package/skills/frontend/shadcn-ui/assets/installation/next.md +256 -0
  574. package/skills/frontend/shadcn-ui/assets/installation/react-router.md +226 -0
  575. package/skills/frontend/shadcn-ui/assets/installation/remix.md +52 -0
  576. package/skills/frontend/shadcn-ui/assets/installation/vite.md +314 -0
  577. package/skills/frontend/shadcn-ui/assets/mcp/mcp.md +338 -0
  578. package/skills/frontend/shadcn-ui/assets/overview/changelog.md +6 -0
  579. package/skills/frontend/shadcn-ui/assets/overview/cli.md +738 -0
  580. package/skills/frontend/shadcn-ui/assets/overview/components-json.md +379 -0
  581. package/skills/frontend/shadcn-ui/assets/overview/directory.md +74 -0
  582. package/skills/frontend/shadcn-ui/assets/overview/introduction.md +77 -0
  583. package/skills/frontend/shadcn-ui/assets/overview/skills.md +71 -0
  584. package/skills/frontend/shadcn-ui/assets/overview/theming.md +304 -0
  585. package/skills/frontend/shadcn-ui/assets/overview/typeset.md +242 -0
  586. package/skills/frontend/shadcn-ui/assets/registry/getting-started.md +648 -0
  587. package/skills/frontend/shadcn-ui/assets/registry/overview.md +90 -0
  588. package/skills/frontend/shadcn-ui/assets/registry/registry-item-json.md +483 -0
  589. package/skills/frontend/shadcn-ui/assets/registry/registry-json.md +178 -0
  590. package/skills/frontend/shadcn-ui/evals/componentVerification.json +19 -0
  591. package/skills/frontend/shadcn-ui/references/aiComponentsCatalog.md +51 -0
  592. package/skills/frontend/shadcn-ui/references/apiReference.md +3 -0
  593. package/skills/frontend/shadcn-ui/references/blocksCatalog.md +32 -0
  594. package/skills/frontend/shadcn-ui/references/cliCommands.md +47 -0
  595. package/skills/frontend/shadcn-ui/references/componentMarkdownSources.md +48 -0
  596. package/skills/frontend/shadcn-ui/scripts/fetchComponentDocs.py +43 -0
  597. package/skills/frontend/tsxReactStandard/SKILL.md +150 -0
  598. package/skills/frontend/tsxReactStandard/evals/tsxVerification.json +14 -0
  599. package/skills/frontend/tsxReactStandard/references/apiReference.md +3 -0
  600. package/skills/frontend/tsxReactStandard/references/discriminatedUnions.md +31 -0
  601. package/skills/frontend/tsxReactStandard/references/tsconfigStrict.md +36 -0
  602. package/skills/frontend/tsxReactStandard/scripts/validateTsxTypes.py +44 -0
  603. package/skills/gitVersionControl/gitWorkflow/SKILL.md +128 -0
  604. package/skills/gitVersionControl/gitWorkflow/assets/README.md +23 -0
  605. package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-environment.md +87 -0
  606. package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-formatting.md +156 -0
  607. package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-reference.md +2363 -0
  608. package/skills/gitVersionControl/gitWorkflow/assets/using-git/about-git.md +156 -0
  609. package/skills/gitVersionControl/gitWorkflow/assets/using-git/about-remote-repositories.md +65 -0
  610. package/skills/gitVersionControl/gitWorkflow/assets/using-git/associating-text-editors-with-git.md +93 -0
  611. package/skills/gitVersionControl/gitWorkflow/assets/using-git/caching-your-github-credentials.md +115 -0
  612. package/skills/gitVersionControl/gitWorkflow/assets/using-git/getting-changes-from-a-remote-repository.md +76 -0
  613. package/skills/gitVersionControl/gitWorkflow/assets/using-git/ignoring-files.md +51 -0
  614. package/skills/gitVersionControl/gitWorkflow/assets/using-git/managing-remote-repositories.md +231 -0
  615. package/skills/gitVersionControl/gitWorkflow/assets/using-git/pushing-commits-to-a-remote-repository.md +119 -0
  616. package/skills/gitVersionControl/gitWorkflow/evals/evalGitWorkflow.py +43 -0
  617. package/skills/gitVersionControl/gitWorkflow/references/apiReference.md +3 -0
  618. package/skills/gitVersionControl/gitWorkflow/references/branchingModels.md +32 -0
  619. package/skills/gitVersionControl/gitWorkflow/scripts/diagnoseGitGraph.py +68 -0
  620. package/skills/github/assets/README.md +39 -0
  621. package/skills/github/assets/cli/gh-environment.md +87 -0
  622. package/skills/github/assets/cli/gh-formatting.md +156 -0
  623. package/skills/github/assets/cli/gh-reference.md +2363 -0
  624. package/skills/github/assets/docs-api/github-docs-api.md +60 -0
  625. package/skills/github/assets/rest-api/actions-secrets.md +1272 -0
  626. package/skills/github/assets/rest-api/actions-variables.md +1247 -0
  627. package/skills/github/assets/rest-api/actions-workflow-runs.md +1697 -0
  628. package/skills/github/assets/rest-api/actions-workflows.md +348 -0
  629. package/skills/github/assets/rest-api/authenticating.md +174 -0
  630. package/skills/github/assets/rest-api/branches.md +727 -0
  631. package/skills/github/assets/rest-api/checks-runs.md +1013 -0
  632. package/skills/github/assets/rest-api/checks-suites.md +1142 -0
  633. package/skills/github/assets/rest-api/code-scanning.md +2957 -0
  634. package/skills/github/assets/rest-api/collaborators.md +547 -0
  635. package/skills/github/assets/rest-api/commits.md +957 -0
  636. package/skills/github/assets/rest-api/dependabot-alerts.md +895 -0
  637. package/skills/github/assets/rest-api/orgs.md +1172 -0
  638. package/skills/github/assets/rest-api/overview.md +875 -0
  639. package/skills/github/assets/rest-api/pull-reviews.md +722 -0
  640. package/skills/github/assets/rest-api/pulls.md +1605 -0
  641. package/skills/github/assets/rest-api/quickstart.md +344 -0
  642. package/skills/github/assets/rest-api/releases.md +650 -0
  643. package/skills/github/assets/rest-api/repos.md +2957 -0
  644. package/skills/github/assets/rest-api/rules.md +1507 -0
  645. package/skills/github/assets/rest-api/secret-scanning.md +947 -0
  646. package/skills/github/assets/rest-api/teams.md +1690 -0
  647. package/skills/github/githubAction/SKILL.md +159 -0
  648. package/skills/github/githubAction/assets/README.md +38 -0
  649. package/skills/github/githubAction/assets/reference/contexts.md +918 -0
  650. package/skills/github/githubAction/assets/reference/dependency-caching.md +393 -0
  651. package/skills/github/githubAction/assets/reference/events-that-trigger-workflows.md +1348 -0
  652. package/skills/github/githubAction/assets/reference/expressions.md +441 -0
  653. package/skills/github/githubAction/assets/reference/metadata-syntax.md +803 -0
  654. package/skills/github/githubAction/assets/reference/variables.md +149 -0
  655. package/skills/github/githubAction/assets/reference/workflow-cancellation.md +22 -0
  656. package/skills/github/githubAction/assets/reference/workflow-commands.md +1056 -0
  657. package/skills/github/githubAction/assets/reference/workflow-syntax.md +1721 -0
  658. package/skills/github/githubAction/assets/rest-api/secrets.md +1272 -0
  659. package/skills/github/githubAction/assets/rest-api/workflow-runs.md +1697 -0
  660. package/skills/github/githubAction/assets/rest-api/workflows.md +348 -0
  661. package/skills/github/githubAction/assets/starter-workflows/automation/stale.yml +27 -0
  662. package/skills/github/githubAction/assets/starter-workflows/ci/blank.yml +36 -0
  663. package/skills/github/githubAction/assets/starter-workflows/ci/docker-image.yml +18 -0
  664. package/skills/github/githubAction/assets/starter-workflows/ci/go.yml +28 -0
  665. package/skills/github/githubAction/assets/starter-workflows/ci/maven.yml +35 -0
  666. package/skills/github/githubAction/assets/starter-workflows/ci/node.js.yml +31 -0
  667. package/skills/github/githubAction/assets/starter-workflows/ci/python-app.yml +39 -0
  668. package/skills/github/githubAction/assets/starter-workflows/ci/rust.yml +22 -0
  669. package/skills/github/githubAction/assets/starter-workflows/code-scanning/codeql.yml +97 -0
  670. package/skills/github/githubAction/evals/actionVerification.json +14 -0
  671. package/skills/github/githubAction/references/apiReference.md +3 -0
  672. package/skills/github/githubAction/references/workflowPatterns.md +81 -0
  673. package/skills/github/githubAction/scripts/validateWorkflowYaml.py +53 -0
  674. package/skills/github/githubQuality/SKILL.md +136 -0
  675. package/skills/github/githubQuality/assets/README.md +24 -0
  676. package/skills/github/githubQuality/assets/pull-requests/about-code-owners.md +178 -0
  677. package/skills/github/githubQuality/assets/pull-requests/about-merge-methods.md +48 -0
  678. package/skills/github/githubQuality/assets/pull-requests/creating-a-pull-request.md +170 -0
  679. package/skills/github/githubQuality/assets/pull-requests/giving-reviews.md +48 -0
  680. package/skills/github/githubQuality/assets/pull-requests/managing-a-merge-queue.md +134 -0
  681. package/skills/github/githubQuality/assets/pull-requests/merging-a-pull-request.md +101 -0
  682. package/skills/github/githubQuality/assets/pull-requests/resolving-reviews.md +59 -0
  683. package/skills/github/githubQuality/assets/pull-requests/status-checks.md +135 -0
  684. package/skills/github/githubQuality/assets/rest-api/checks-runs.md +1013 -0
  685. package/skills/github/githubQuality/assets/rest-api/checks-suites.md +1142 -0
  686. package/skills/github/githubQuality/assets/rest-api/commits.md +957 -0
  687. package/skills/github/githubQuality/assets/rest-api/pulls.md +1605 -0
  688. package/skills/github/githubQuality/assets/rest-api/reviews.md +722 -0
  689. package/skills/github/githubQuality/evals/qualityVerification.json +14 -0
  690. package/skills/github/githubQuality/references/apiReference.md +3 -0
  691. package/skills/github/githubQuality/references/codeownersExample.md +26 -0
  692. package/skills/github/githubQuality/references/prTemplate.md +20 -0
  693. package/skills/github/githubQuality/scripts/auditPrQuality.py +52 -0
  694. package/skills/github/githubSecurity/SKILL.md +170 -0
  695. package/skills/github/githubSecurity/assets/README.md +32 -0
  696. package/skills/github/githubSecurity/assets/code-scanning/code-scanning-alerts.md +133 -0
  697. package/skills/github/githubSecurity/assets/code-scanning/code-scanning.md +67 -0
  698. package/skills/github/githubSecurity/assets/code-scanning/codeql-code-scanning.md +79 -0
  699. package/skills/github/githubSecurity/assets/code-scanning/configure-code-scanning.md +121 -0
  700. package/skills/github/githubSecurity/assets/dependabot/about-the-dependabot-yml-file.md +74 -0
  701. package/skills/github/githubSecurity/assets/dependabot/dependabot-alerts.md +133 -0
  702. package/skills/github/githubSecurity/assets/dependabot/dependabot-security-updates.md +95 -0
  703. package/skills/github/githubSecurity/assets/dependabot/dependabot-version-updates.md +80 -0
  704. package/skills/github/githubSecurity/assets/rest-api/code-scanning.md +2957 -0
  705. package/skills/github/githubSecurity/assets/rest-api/dependabot-alerts.md +895 -0
  706. package/skills/github/githubSecurity/assets/rest-api/secret-scanning.md +947 -0
  707. package/skills/github/githubSecurity/assets/secret-scanning/enable-secret-scanning.md +59 -0
  708. package/skills/github/githubSecurity/assets/secret-scanning/secret-scanning.md +105 -0
  709. package/skills/github/githubSecurity/assets/security-advisories/github-advisory-database.md +148 -0
  710. package/skills/github/githubSecurity/evals/securityVerification.json +14 -0
  711. package/skills/github/githubSecurity/references/apiReference.md +3 -0
  712. package/skills/github/githubSecurity/references/codeqlAnalysis.yml +42 -0
  713. package/skills/github/githubSecurity/references/dependabotConfig.yml +27 -0
  714. package/skills/github/githubSecurity/scripts/auditRepoSecurity.py +47 -0
  715. package/skills/github/githubSetup/SKILL.md +137 -0
  716. package/skills/github/githubSetup/assets/README.md +40 -0
  717. package/skills/github/githubSetup/assets/branches/about-protected-branches.md +198 -0
  718. package/skills/github/githubSetup/assets/branches/changing-the-default-branch.md +49 -0
  719. package/skills/github/githubSetup/assets/branches/deleting-and-restoring-branches.md +44 -0
  720. package/skills/github/githubSetup/assets/branches/managing-a-branch-protection-rule.md +115 -0
  721. package/skills/github/githubSetup/assets/branches/renaming-a-branch.md +74 -0
  722. package/skills/github/githubSetup/assets/branches/viewing-branches-in-your-repository.md +30 -0
  723. package/skills/github/githubSetup/assets/repositories/about-repositories.md +127 -0
  724. package/skills/github/githubSetup/assets/repositories/cloning-a-repository.md +114 -0
  725. package/skills/github/githubSetup/assets/repositories/creating-a-new-repository.md +82 -0
  726. package/skills/github/githubSetup/assets/repositories/creating-a-repository-from-a-template.md +51 -0
  727. package/skills/github/githubSetup/assets/repositories/deleting-a-repository.md +34 -0
  728. package/skills/github/githubSetup/assets/repositories/managing-teams-and-people-with-access.md +69 -0
  729. package/skills/github/githubSetup/assets/repositories/renaming-a-repository.md +47 -0
  730. package/skills/github/githubSetup/assets/repositories/restoring-a-deleted-repository.md +61 -0
  731. package/skills/github/githubSetup/assets/repositories/setting-repository-visibility.md +137 -0
  732. package/skills/github/githubSetup/assets/rest-api/branches.md +727 -0
  733. package/skills/github/githubSetup/assets/rest-api/quickstart.md +344 -0
  734. package/skills/github/githubSetup/assets/rest-api/repos.md +2957 -0
  735. package/skills/github/githubSetup/assets/rulesets/about-rulesets.md +72 -0
  736. package/skills/github/githubSetup/assets/rulesets/available-rules-for-rulesets.md +383 -0
  737. package/skills/github/githubSetup/assets/rulesets/converting-branch-protections-to-rulesets.md +92 -0
  738. package/skills/github/githubSetup/assets/rulesets/creating-rulesets-for-a-repository.md +108 -0
  739. package/skills/github/githubSetup/assets/rulesets/managing-rulesets-for-a-repository.md +149 -0
  740. package/skills/github/githubSetup/assets/rulesets/troubleshooting-rules.md +122 -0
  741. package/skills/github/githubSetup/evals/setupVerification.json +14 -0
  742. package/skills/github/githubSetup/references/apiReference.md +3 -0
  743. package/skills/github/githubSetup/references/repoSettingsBlueprint.md +13 -0
  744. package/skills/github/githubSetup/references/rulesetTemplates.json +42 -0
  745. package/skills/github/githubSetup/scripts/configureRepoBaseline.py +46 -0
  746. package/skills/github/githubTeam/SKILL.md +115 -0
  747. package/skills/github/githubTeam/assets/README.md +21 -0
  748. package/skills/github/githubTeam/assets/organizations/about-organizations.md +69 -0
  749. package/skills/github/githubTeam/assets/organizations/repository-roles-for-an-organization.md +94 -0
  750. package/skills/github/githubTeam/assets/rest-api/collaborators.md +547 -0
  751. package/skills/github/githubTeam/assets/rest-api/orgs.md +1172 -0
  752. package/skills/github/githubTeam/assets/rest-api/teams.md +1690 -0
  753. package/skills/github/githubTeam/assets/teams/about-teams.md +82 -0
  754. package/skills/github/githubTeam/assets/teams/adding-members-to-a-team.md +55 -0
  755. package/skills/github/githubTeam/evals/teamVerification.json +14 -0
  756. package/skills/github/githubTeam/references/apiReference.md +3 -0
  757. package/skills/github/githubTeam/references/permissionMatrix.md +17 -0
  758. package/skills/github/githubTeam/references/reviewAssignment.md +17 -0
  759. package/skills/github/githubTeam/scripts/manageTeamSync.py +31 -0
  760. package/skills/securityQa/llmSecurityRedteaming/SKILL.md +86 -0
  761. package/skills/securityQa/llmSecurityRedteaming/evals/securityRedteamVerification.json +14 -0
  762. package/skills/securityQa/llmSecurityRedteaming/references/apiReference.md +3 -0
  763. package/skills/securityQa/llmSecurityRedteaming/references/jailbreakTaxonomy.md +6 -0
  764. package/skills/securityQa/llmSecurityRedteaming/references/owaspLlmTopTen.md +12 -0
  765. package/skills/securityQa/llmSecurityRedteaming/scripts/testPromptInjection.py +34 -0
  766. package/skills/softwareDevelopment/requirementsEngineering/SKILL.md +110 -0
  767. package/skills/softwareDevelopment/requirementsEngineering/evals/evalRequirements.py +33 -0
  768. package/skills/softwareDevelopment/requirementsEngineering/references/apiReference.md +3 -0
  769. package/skills/softwareDevelopment/requirementsEngineering/references/requirementsAnalysisModels.md +34 -0
  770. package/skills/softwareDevelopment/requirementsEngineering/scripts/validateUserStories.py +49 -0
  771. package/skills/testing/testDrivenDevelopment/SKILL.md +122 -0
  772. package/skills/testing/testDrivenDevelopment/evals/evalTdd.py +25 -0
  773. package/skills/testing/testDrivenDevelopment/references/apiReference.md +3 -0
  774. package/skills/testing/testDrivenDevelopment/references/testPyramidDoubles.md +35 -0
  775. package/skills/testing/testDrivenDevelopment/scripts/auditTestPyramid.py +58 -0
@@ -0,0 +1,2813 @@
1
+ ---
2
+ title: Astro Integration API
3
+ sidebar:
4
+ label: Integration API
5
+ i18nReady: true
6
+ ---
7
+ import ReadMore from '~/components/ReadMore.astro';
8
+ import Since from '~/components/Since.astro'
9
+
10
+ **Astro Integrations** add new functionality and behaviors for your project with only a few lines of code.
11
+
12
+ This reference page is for anyone writing their own integration. To learn how to use an integration in your project, check out our [Using Integrations](/en/guides/integrations/) guide instead.
13
+
14
+ ## Examples
15
+
16
+ The official Astro integrations can act as reference for you as you go to build your own integrations.
17
+
18
+ - **Renderers:** [`svelte`](/en/guides/integrations-guide/svelte/), [`react`](/en/guides/integrations-guide/react/), [`preact`](/en/guides/integrations-guide/preact/), [`vue`](/en/guides/integrations-guide/vue/), [`solid`](/en/guides/integrations-guide/solid-js/)
19
+ - **Libraries:** [`partytown`](/en/guides/integrations-guide/partytown/)
20
+ - **Features:** [`sitemap`](/en/guides/integrations-guide/sitemap/)
21
+
22
+ ## Quick API Reference
23
+
24
+ ```ts
25
+ interface AstroIntegration {
26
+ name: string;
27
+ hooks: {
28
+ 'astro:config:setup'?: (options: {
29
+ config: AstroConfig;
30
+ command: 'dev' | 'build' | 'preview' | 'sync';
31
+ isRestart: boolean;
32
+ updateConfig: (newConfig: DeepPartial<AstroConfig>) => AstroConfig;
33
+ addRenderer: (renderer: AstroRenderer) => void;
34
+ addWatchFile: (path: URL | string) => void;
35
+ addClientDirective: (directive: ClientDirectiveConfig) => void;
36
+ addMiddleware: (middleware: AstroIntegrationMiddleware) => void;
37
+ addDevToolbarApp: (entrypoint: DevToolbarAppEntry) => void;
38
+ injectScript: (stage: InjectedScriptStage, content: string) => void;
39
+ injectRoute: (injectedRoute: InjectedRoute) => void;
40
+ createCodegenDir: () => URL;
41
+ logger: AstroIntegrationLogger;
42
+ }) => void | Promise<void>;
43
+ 'astro:route:setup'?: (options: {
44
+ route: RouteOptions;
45
+ logger: AstroIntegrationLogger;
46
+ }) => void | Promise<void>;
47
+ 'astro:routes:resolved'?: (options: {
48
+ routes: IntegrationResolvedRoute[];
49
+ logger: AstroIntegrationLogger;
50
+ }) => void | Promise<void>;
51
+ 'astro:config:done'?: (options: {
52
+ config: AstroConfig;
53
+ setAdapter: (adapter: AstroAdapter) => void;
54
+ injectTypes: (injectedType: InjectedType) => URL;
55
+ logger: AstroIntegrationLogger;
56
+ buildOutput: 'static' | 'server';
57
+ }) => void | Promise<void>;
58
+ 'astro:server:setup'?: (options: {
59
+ server: vite.ViteDevServer;
60
+ logger: AstroIntegrationLogger;
61
+ toolbar: ReturnType<typeof getToolbarServerCommunicationHelpers>;
62
+ refreshContent?: (options: RefreshContentOptions) => Promise<void>;
63
+ }) => void | Promise<void>;
64
+ 'astro:server:start'?: (options: {
65
+ address: AddressInfo;
66
+ logger: AstroIntegrationLogger;
67
+ }) => void | Promise<void>;
68
+ 'astro:server:done'?: (options: {
69
+ logger: AstroIntegrationLogger;
70
+ }) => void | Promise<void>;
71
+ 'astro:build:start'?: (options: {
72
+ logger: AstroIntegrationLogger;
73
+ setPrerenderer: (prerenderer: AstroPrerenderer | ((defaultPrerenderer: AstroPrerenderer, context: { outputDirectories: AstroBuildOutputDirectories }) => AstroPrerenderer)) => void;
74
+ }) => void | Promise<void>;
75
+ 'astro:build:setup'?: (options: {
76
+ vite: vite.InlineConfig;
77
+ pages: Map<string, PageBuildData>;
78
+ updateConfig: (newConfig: vite.InlineConfig) => void;
79
+ logger: AstroIntegrationLogger;
80
+ }) => void | Promise<void>;
81
+ 'astro:build:ssr'?: (options: {
82
+ manifest: SerializedSSRManifest;
83
+ middlewareEntryPoint: URL | undefined;
84
+ logger: AstroIntegrationLogger;
85
+ }) => void | Promise<void>;
86
+ 'astro:build:generated'?: (options: {
87
+ dir: URL;
88
+ logger: AstroIntegrationLogger;
89
+ routeToHeaders: RouteToHeaders;
90
+ }) => void | Promise<void>;
91
+ 'astro:build:done'?: (options: {
92
+ pages: { pathname: string }[];
93
+ dir: URL;
94
+ assets: Map<string, URL[]>;
95
+ logger: AstroIntegrationLogger;
96
+ }) => void | Promise<void>;
97
+
98
+ // ... any custom hooks from integrations
99
+ };
100
+ }
101
+ ```
102
+
103
+ ## Hooks
104
+
105
+ Astro provides hooks that integrations can implement to execute during certain parts of Astro's lifecycle. Astro hooks are defined in the `IntegrationHooks` interface, which is part of the global `Astro` namespace. Each hook has a [`logger` option](#astrointegrationlogger) that allows you to use the Astro logger to write logs.
106
+
107
+ The following hooks are built in to Astro:
108
+
109
+ ### `astro:config:setup`
110
+
111
+ **Next hook:** [`astro:route:setup`](#astroroutesetup)
112
+
113
+ **When:** On initialization, before either the [Vite](https://vite.dev/config/) or [Astro config](/en/reference/configuration-reference/) have resolved.
114
+
115
+ **Why:** To extend the project config. This includes updating the [Astro config](/en/reference/configuration-reference/), applying [Vite plugins](https://vite.dev/guide/api-plugin.html), adding component renderers, and injecting scripts onto the page.
116
+
117
+ ```ts
118
+ 'astro:config:setup'?: (options: {
119
+ config: AstroConfig;
120
+ command: 'dev' | 'build' | 'preview' | 'sync';
121
+ isRestart: boolean;
122
+ updateConfig: (newConfig: DeepPartial<AstroConfig>) => AstroConfig;
123
+ addRenderer: (renderer: AstroRenderer) => void;
124
+ addClientDirective: (directive: ClientDirectiveConfig) => void;
125
+ addMiddleware: (middleware: AstroIntegrationMiddleware) => void;
126
+ addDevToolbarApp: (entrypoint: DevToolbarAppEntry) => void;
127
+ addWatchFile: (path: URL | string) => void;
128
+ injectScript: (stage: InjectedScriptStage, content: string) => void;
129
+ injectRoute: (injectedRoute: InjectedRoute) => void;
130
+ createCodegenDir: () => URL;
131
+ logger: AstroIntegrationLogger;
132
+ }) => void | Promise<void>;
133
+ ```
134
+
135
+ #### `config` option
136
+
137
+ <p>
138
+
139
+ **Type:** `AstroConfig`
140
+ </p>
141
+
142
+ A read-only copy of the user-supplied [Astro config](/en/reference/configuration-reference/). This is resolved _before_ any other integrations have run. If you need a copy of the config after all integrations have completed their config updates, [see the `astro:config:done` hook](#astroconfigdone).
143
+
144
+ #### `command` option
145
+
146
+ <p>
147
+
148
+ **Type:** `'dev' | 'build' | 'preview' | 'sync'`
149
+ </p>
150
+
151
+ - `dev` - Project is executed with `astro dev`
152
+ - `build` - Project is executed with `astro build`
153
+ - `preview` - Project is executed with `astro preview`
154
+ - `sync` - Project is executed with `astro sync`
155
+
156
+ #### `isRestart` option
157
+
158
+ <p>
159
+
160
+ **Type:** `boolean`<br />
161
+ <Since v="1.5.0" />
162
+ </p>
163
+
164
+ `false` when the dev server starts, `true` when a reload is triggered. Useful to detect when this function is called more than once.
165
+
166
+ #### `updateConfig()` option
167
+
168
+ <p>
169
+
170
+ **Type:** `(newConfig: DeepPartial<AstroConfig>) => AstroConfig;`
171
+ </p>
172
+
173
+ A callback function to update the user-supplied [Astro config](/en/reference/configuration-reference/). Any config you provide **will be merged with the user config + other integration config updates,** so you are free to omit keys!
174
+
175
+ For example, say you need to supply a [Vite](https://vite.dev/) plugin to the user's project:
176
+
177
+ ```js
178
+ import bananaCSS from '@vitejs/official-banana-css-plugin';
179
+
180
+ export default {
181
+ name: 'banana-css-integration',
182
+ hooks: {
183
+ 'astro:config:setup': ({ updateConfig }) => {
184
+ updateConfig({
185
+ vite: {
186
+ plugins: [bananaCSS()],
187
+ }
188
+ })
189
+ }
190
+ }
191
+ }
192
+ ```
193
+
194
+ #### `addRenderer()` option
195
+
196
+ <p>
197
+
198
+ **Type:** <code>(renderer: <a href="/en/reference/renderer-reference/#astrorenderer">AstroRenderer</a>) => void;</code><br />
199
+ **Examples:** [`svelte`](https://github.com/withastro/astro/blob/main/packages/integrations/svelte/src/index.ts), [`react`](https://github.com/withastro/astro/blob/main/packages/integrations/react/src/index.ts), [`preact`](https://github.com/withastro/astro/blob/main/packages/integrations/preact/src/index.ts), [`vue`](https://github.com/withastro/astro/blob/main/packages/integrations/vue/src/index.ts), [`solid`](https://github.com/withastro/astro/blob/main/packages/integrations/solid/src/index.ts)
200
+ </p>
201
+
202
+ A callback function to [add a component framework renderer](/en/reference/renderer-reference/) (i.e. React, Vue, Svelte, etc).
203
+
204
+ #### `addWatchFile()` option
205
+
206
+ <p>
207
+
208
+ **Type:** `(path: URL | string) => void`<br />
209
+ <Since v="1.5.0" />
210
+ </p>
211
+
212
+ If your integration depends on some configuration file that Vite doesn't watch and/or needs a full dev server restart to take effect, add it with `addWatchFile()`. Whenever that file changes, the Astro dev server will be reloaded (you can check when a reload happens with [`isRestart`](#isrestart-option)).
213
+
214
+ Example usage:
215
+
216
+ ```js
217
+ // Must be an absolute path!
218
+ addWatchFile('/home/user/.../my-config.json');
219
+ addWatchFile(new URL('./ec.config.mjs', config.root));
220
+ ```
221
+
222
+ #### `addClientDirective()` option
223
+
224
+ <p>
225
+
226
+ **Type:** <code>(directive: <a href="#clientdirectiveconfig">ClientDirectiveConfig</a>) => void;</code><br />
227
+ <Since v="2.6.0" />
228
+ </p>
229
+
230
+ Adds a [custom client directive](/en/reference/directives-reference/#custom-client-directives) to be used in `.astro` files.
231
+
232
+ Note that directive entrypoints are only bundled through esbuild and should be kept small so they don't slow down component hydration.
233
+
234
+ Example usage:
235
+
236
+ ```js title="astro.config.mjs"
237
+ import { defineConfig } from 'astro/config';
238
+ import clickDirective from './astro-click-directive/register.js'
239
+
240
+ // https://astro.build/config
241
+ export default defineConfig({
242
+ integrations: [
243
+ clickDirective()
244
+ ],
245
+ });
246
+ ```
247
+
248
+ ```js title="astro-click-directive/register.js"
249
+ /**
250
+ * @type {() => import('astro').AstroIntegration}
251
+ */
252
+ export default () => ({
253
+ name: "client:click",
254
+ hooks: {
255
+ "astro:config:setup": ({ addClientDirective }) => {
256
+ addClientDirective({
257
+ name: "click",
258
+ entrypoint: "./astro-click-directive/click.js",
259
+ });
260
+ },
261
+ },
262
+ });
263
+ ```
264
+
265
+ ```js title="astro-click-directive/click.js"
266
+ /**
267
+ * Hydrate on first click on the window
268
+ * @type {import('astro').ClientDirective}
269
+ */
270
+ export default (load, opts, el) => {
271
+ window.addEventListener('click', async () => {
272
+ const hydrate = await load()
273
+ await hydrate()
274
+ }, { once: true })
275
+ }
276
+ ```
277
+
278
+ You can also add types for the directives in your library's type definition file:
279
+
280
+ ```ts title="astro-click-directive/index.d.ts"
281
+ import 'astro'
282
+ declare module 'astro' {
283
+ interface AstroClientDirectives {
284
+ 'client:click'?: boolean
285
+ }
286
+ }
287
+ ```
288
+
289
+ #### `addDevToolbarApp()` option
290
+
291
+ <p>
292
+
293
+ **Type:** `(entrypoint: DevToolbarAppEntry) => void;`<br />
294
+ <Since v="3.4.0" />
295
+ </p>
296
+
297
+ Adds a [custom dev toolbar app](/en/reference/dev-toolbar-app-reference/).
298
+
299
+ Example usage:
300
+
301
+ ```js title="astro.config.mjs"
302
+ import { defineConfig } from 'astro/config';
303
+ import devToolbarIntegration from './astro-dev-toolbar-app/integration.js'
304
+
305
+ // https://astro.build/config
306
+ export default defineConfig({
307
+ integrations: [
308
+ devToolbarIntegration()
309
+ ],
310
+ });
311
+ ```
312
+
313
+ ```js title="astro-dev-toolbar-app/integration.js"
314
+ /**
315
+ * @type {() => import('astro').AstroIntegration}
316
+ */
317
+ export default () => ({
318
+ name: "dev-toolbar-app",
319
+ hooks: {
320
+ "astro:config:setup": ({ addDevToolbarApp }) => {
321
+ addDevToolbarApp({
322
+ entrypoint: "./astro-dev-toolbar-app/plugin.js",
323
+ id: "my-plugin",
324
+ name: "My Plugin"
325
+ });
326
+ },
327
+ },
328
+ });
329
+ ```
330
+
331
+ ```js title="astro-dev-toolbar-app/plugin.js"
332
+
333
+ /**
334
+ * @type {import('astro').DevToolbarApp}
335
+ */
336
+ export default {
337
+ id: "my-plugin",
338
+ name: "My Plugin",
339
+ icon: "<svg>...</svg>",
340
+ init() {
341
+ console.log("I'm a dev toolbar app!")
342
+ },
343
+ };
344
+ ```
345
+ #### `addMiddleware()` option
346
+
347
+ <p>
348
+
349
+ **Type:** <code>(middleware: <a href="#astrointegrationmiddleware">AstroIntegrationMiddleware</a>) => void;</code><br />
350
+ <Since v="3.5.0" />
351
+ </p>
352
+
353
+ Adds [middleware](/en/guides/middleware/) to run on each request. Takes the `entrypoint` module that contains the middleware, and an `order` to specify whether it should run before (`pre`) other middleware or after (`post`).
354
+
355
+ ```js title="@my-package/integration.js"
356
+ /**
357
+ * @type {() => import('astro').AstroIntegration}
358
+ */
359
+ export default () => ({
360
+ name: "my-middleware-package",
361
+ hooks: {
362
+ "astro:config:setup": ({ addMiddleware }) => {
363
+ addMiddleware({
364
+ entrypoint: '@my-package/middleware',
365
+ order: 'pre'
366
+ });
367
+ },
368
+ },
369
+ });
370
+ ```
371
+
372
+ Middleware is defined in a package with an [`onRequest()` function](/en/reference/modules/astro-middleware/#onrequest), as with user-defined middleware.
373
+
374
+ ```js title="@my-package/middleware.js"
375
+ import { defineMiddleware } from 'astro:middleware';
376
+
377
+ export const onRequest = defineMiddleware(async (context, next) => {
378
+ if(context.url.pathname === '/some-test-path') {
379
+ return Response.json({
380
+ ok: true
381
+ });
382
+ }
383
+
384
+ return next();
385
+ });
386
+ ```
387
+
388
+ <p><Since v="5.0.0" /></p>
389
+
390
+ The function also accepts a `URL` for `entrypoint`:
391
+
392
+ ```js title="@my-package/integration.js" ins={9}
393
+ /**
394
+ * @type {() => import('astro').AstroIntegration}
395
+ */
396
+ export default () => ({
397
+ name: "my-middleware-package",
398
+ hooks: {
399
+ "astro:config:setup": ({ addMiddleware }) => {
400
+ addMiddleware({
401
+ entrypoint: new URL('./middleware.js', import.meta.url),
402
+ order: 'pre'
403
+ });
404
+ },
405
+ },
406
+ });
407
+ ```
408
+
409
+ #### `injectRoute()` option
410
+
411
+ <p>
412
+
413
+ **Type:** `({ pattern: string; entrypoint: string | URL; prerender?: boolean }) => void;`
414
+ </p>
415
+
416
+ A callback function to inject routes into an Astro project. Injected routes can be [`.astro` pages](/en/basics/astro-pages/) or [`.js` and `.ts` route handlers](/en/guides/endpoints/#static-file-endpoints).
417
+
418
+ `injectRoute()` takes an object with a `pattern` and an `entrypoint`.
419
+
420
+ - `pattern` - where the route should be output in the browser, for example `/foo/bar`. A `pattern` can use Astro's filepath syntax for denoting dynamic routes, for example `/foo/[bar]` or `/foo/[...bar]`. Note that a file extension is **not** needed in the `pattern`.
421
+ - `entrypoint` - a bare module specifier pointing towards the `.astro` page or `.js`/`.ts` route handler that handles the route denoted in the `pattern`.
422
+ - `prerender` - a boolean to set if Astro can't detect your `prerender` export.
423
+
424
+ ##### Example usage
425
+
426
+ ```js
427
+ injectRoute({
428
+ // Use Astro’s pattern syntax for dynamic routes.
429
+ pattern: '/subfolder/[dynamic]',
430
+ // Use relative path syntax for a local route.
431
+ entrypoint: './src/dynamic-page.astro',
432
+ // Use only if Astro can't detect your prerender export
433
+ prerender: false
434
+ });
435
+ ```
436
+
437
+ For an integration designed to be installed in other projects, use its package name to refer to the route entrypoint.
438
+ The following example shows a package published to npm as `@fancy/dashboard` injecting a dashboard route:
439
+
440
+ ```js
441
+ injectRoute({
442
+ pattern: '/fancy-dashboard',
443
+ entrypoint: '@fancy/dashboard/dashboard.astro'
444
+ });
445
+ ```
446
+
447
+ When publishing your package (`@fancy/dashboard`, in this case) to npm, you must export `dashboard.astro` in your `package.json`:
448
+
449
+ ```json title="package.json" "exports"
450
+ {
451
+ "name": "@fancy/dashboard",
452
+ // ...
453
+ "exports": { "./dashboard.astro": "./dashboard.astro" }
454
+ }
455
+ ```
456
+
457
+ <p><Since v="5.0.0" /></p>
458
+
459
+ The function also accepts a `URL` for `entrypoint`:
460
+
461
+ ```js "new URL('./dashboard.astro', import.meta.url)"
462
+ injectRoute({
463
+ pattern: '/fancy-dashboard',
464
+ entrypoint: new URL('./dashboard.astro', import.meta.url)
465
+ });
466
+ ```
467
+
468
+ #### `injectScript()` option
469
+
470
+ <p>
471
+
472
+ **Type:** `(stage: InjectedScriptStage, content: string) => void;`
473
+ </p>
474
+
475
+ A callback function to inject a string of JavaScript content onto every page.
476
+
477
+ The **`stage`** denotes how this script (the `content`) should be inserted. Some stages allow inserting scripts without modification, while others allow optimization during [Vite's bundling step](https://vite.dev/guide/build.html):
478
+
479
+ - `"head-inline"`: Injected into a script tag in the `<head>` of every page. **Not** optimized or resolved by Vite.
480
+ - `"before-hydration"`: Imported client-side, before the hydration script runs. Optimized and resolved by Vite.
481
+ - `"page"`: Similar to `head-inline`, except that the injected snippet is handled by Vite and bundled with any other `<script>` tags defined inside of Astro components on the page. The script will be loaded with a `<script type="module">` in the final page output, optimized and resolved by Vite.
482
+ - `"page-ssr"`: Imported as a separate module in the frontmatter of every Astro page component. Because this stage imports your script, the `Astro` global is not available and your script will only be run once when the `import` is first evaluated.
483
+
484
+ The main use for the `page-ssr` stage is injecting a CSS `import` into every page to be optimized and resolved by Vite:
485
+ ```js
486
+ injectScript('page-ssr', 'import "global-styles.css";');
487
+ ```
488
+
489
+ #### `createCodegenDir()`
490
+
491
+ <p>
492
+
493
+ **Type:** `() => URL;`<br />
494
+ <Since v="5.0.0" />
495
+ </p>
496
+
497
+ A function that creates the `<root>/.astro/integrations/<normalized_integration_name>` folder and returns its path.
498
+
499
+ It allows you to have a dedicated folder, avoiding conflicts with another integration or Astro itself. This directory is created by calling this function so it's safe to write files to it directly:
500
+
501
+ ```ts title="my-integration.ts"
502
+ import { writeFileSync } from 'node:fs'
503
+
504
+ const integration = {
505
+ name: 'my-integration',
506
+ hooks: {
507
+ 'astro:config:setup': ({ createCodegenDir }) => {
508
+ const codegenDir = createCodegenDir()
509
+ writeFileSync(new URL('cache.json', codegenDir), '{}', 'utf-8')
510
+ }
511
+ }
512
+ }
513
+ ```
514
+
515
+ ### `astro:route:setup`
516
+
517
+ <p><Since v="4.14.0" /></p>
518
+
519
+ **Previous hook:** [`astro:config:setup`](#astroconfigsetup)
520
+
521
+ **Next hook:** [`astro:routes:resolved`](#astroroutesresolved)
522
+
523
+ **When:** In `astro build`, before bundling starts. In `astro dev`, while building the module graph and on every change to a file based route (added/removed/updated).
524
+
525
+ **Why:** To set options for a route at build or request time, such as enabling [on-demand server rendering](/en/guides/on-demand-rendering/#enabling-on-demand-rendering).
526
+
527
+ ```js
528
+ 'astro:route:setup'?: (options: {
529
+ route: RouteOptions;
530
+ logger: AstroIntegrationLogger;
531
+ }) => void | Promise<void>;
532
+ ```
533
+
534
+ #### `route` option
535
+
536
+ <p>
537
+
538
+ **Type:** `{ readonly component: string; prerender?: boolean; }`
539
+ </p>
540
+
541
+ An object with a `component` property to identify the route and the following additional values to allow you to configure the generated route: `prerender`.
542
+
543
+ ##### `route.component`
544
+
545
+ <p>
546
+ **Type:** `string`<br />
547
+ <Since v="4.14.0" />
548
+ </p>
549
+
550
+ The `component` property indicates the entrypoint that will be rendered on the route. You can access this value before the routes are built to configure on-demand server rendering for that page.
551
+
552
+ ##### `route.prerender`
553
+
554
+ <p>
555
+ **Type:** `boolean`<br />
556
+ **Default:** `undefined`<br />
557
+ <Since v="4.14.0" />
558
+ </p>
559
+
560
+ The `prerender` property is used to configure [on-demand server rendering](/en/guides/on-demand-rendering/#enabling-on-demand-rendering) for a route. If the route file contains an explicit `export const prerender` value, the value will be used as the default instead of `undefined`.
561
+
562
+ ```js title="astro.config.mjs"
563
+ import { defineConfig } from 'astro/config';
564
+
565
+ export default defineConfig({
566
+ integrations: [setPrerender()],
567
+ });
568
+
569
+ function setPrerender() {
570
+ return {
571
+ name: 'set-prerender',
572
+ hooks: {
573
+ 'astro:route:setup': ({ route }) => {
574
+ if (route.component.endsWith('/blog/[slug].astro')) {
575
+ route.prerender = true;
576
+ }
577
+ },
578
+ },
579
+ };
580
+ }
581
+ ```
582
+
583
+ If the final value after running all the hooks is `undefined`, the route will fall back to a prerender default based on the [`output` option](/en/reference/configuration-reference/#output): prerendered for `static` mode, and on-demand rendered for `server` mode.
584
+
585
+ ### `astro:routes:resolved`
586
+
587
+ <p>
588
+
589
+ <Since v="5.0.0" />
590
+ </p>
591
+
592
+ **Previous hook:** [`astro:route:setup`](#astroroutesetup)
593
+
594
+ **Next hook:** [`astro:config:done`](#astroconfigdone) (only during setup)
595
+
596
+ **When:** In `astro dev`, it also runs on every change to a file based route (added/removed/updated).
597
+
598
+ **Why:** To access routes and their metadata
599
+
600
+ ```js
601
+ 'astro:routes:resolved'?: (options: {
602
+ routes: IntegrationResolvedRoute[];
603
+ logger: AstroIntegrationLogger;
604
+ }) => void | Promise<void>;
605
+ ```
606
+
607
+ #### `routes` option
608
+
609
+ <p>
610
+
611
+ **Type:** [`IntegrationResolvedRoute[]`](#integrationresolvedroute)
612
+ </p>
613
+
614
+ A list of all routes with their associated metadata.
615
+
616
+ Example use:
617
+
618
+ ```js title="my-integration.mjs"
619
+ const integration = () => {
620
+ return {
621
+ name: 'my-integration',
622
+ hooks: {
623
+ 'astro:routes:resolved': ({ routes }) => {
624
+ const projectRoutes = routes.filter(r => r.origin === 'project').map(r => r.pattern)
625
+
626
+ console.log(projectRoutes)
627
+ },
628
+ }
629
+ }
630
+ }
631
+ ```
632
+
633
+ ### `astro:config:done`
634
+
635
+ **Previous hook:** [`astro:routes:resolved`](#astroroutesresolved)
636
+
637
+ **Next hook:** [`astro:server:setup`](#astroserversetup) when running in "dev" mode, or [`astro:build:start`](#astrobuildstart) during production builds
638
+
639
+ **When:** After the Astro config has resolved and other integrations have run their `astro:config:setup` hooks.
640
+
641
+ **Why:** To retrieve the final config for use in other hooks.
642
+
643
+ ```js
644
+ 'astro:config:done'?: (options: {
645
+ config: AstroConfig;
646
+ setAdapter: (adapter: AstroAdapter) => void;
647
+ injectTypes: (injectedType: InjectedType) => URL;
648
+ logger: AstroIntegrationLogger;
649
+ buildOutput: 'static' | 'server';
650
+ }) => void | Promise<void>;
651
+ ```
652
+
653
+ #### `config` option
654
+
655
+ <p>
656
+
657
+ **Type:** `AstroConfig`
658
+ </p>
659
+
660
+ A read-only copy of the user-supplied [Astro config](/en/reference/configuration-reference/). This is resolved _after_ other integrations have run.
661
+
662
+ #### `setAdapter()` option
663
+
664
+ <p>
665
+
666
+ **Type:** `(adapter: AstroAdapter) => void;`
667
+ </p>
668
+
669
+ Makes the integration an adapter. Read more in the [adapter API](/en/reference/adapter-reference/).
670
+
671
+ #### `injectTypes()` option
672
+
673
+ <p>
674
+
675
+ **Type:** `(injectedType: { filename: string; content: string }) => URL`<br />
676
+ <Since v="4.14.0" />
677
+ </p>
678
+
679
+ Allows you to inject types into your user's project by adding a new `*.d.ts` file.
680
+
681
+ The `filename` property will be used to generate a file at `/.astro/integrations/<normalized_integration_name>/<normalized_filename>.d.ts` and must end with `".d.ts"`.
682
+
683
+ The `content` property will create the body of the file and must be valid TypeScript.
684
+
685
+ Additionally, `injectTypes()` returns a URL to the normalized path so you can overwrite its content later on, or manipulate it in any way you want.
686
+
687
+ ```js
688
+ const path = injectTypes({
689
+ filename: "types.d.ts",
690
+ content: "declare module 'virtual:integration' {}"
691
+ })
692
+ console.log(path) // URL
693
+ ```
694
+
695
+ #### `buildOutput` option
696
+
697
+ <p>
698
+
699
+ **Type:** `'static' | 'server'`<br />
700
+ <Since v="5.0.0" />
701
+ </p>
702
+
703
+ Allows you to adapt the logic of your integration depending on the user's project output.
704
+
705
+ ### `astro:server:setup`
706
+
707
+ **Previous hook:** [`astro:config:done`](#astroconfigdone)
708
+
709
+ **Next hook:** [`astro:server:start`](#astroserverstart)
710
+
711
+ **When:** Just after the Vite server is created in "dev" mode, but before the `listen()` event is fired. [See Vite's createServer API](https://vite.dev/guide/api-javascript.html#createserver) for more.
712
+
713
+ **Why:** To update Vite server options and middleware, or enable support for refreshing the content layer.
714
+
715
+ ```js
716
+ 'astro:server:setup'?: (options: {
717
+ server: vite.ViteDevServer;
718
+ logger: AstroIntegrationLogger;
719
+ toolbar: ReturnType<typeof getToolbarServerCommunicationHelpers>;
720
+ refreshContent: (options: {
721
+ loaders?: Array<string>;
722
+ context?: Record<string, any>;
723
+ }) => Promise<void>;
724
+ }) => void | Promise<void>;
725
+ ```
726
+
727
+ #### `server` option
728
+
729
+ <p>
730
+
731
+ **Type:** [`ViteDevServer`](https://vite.dev/guide/api-javascript.html#vitedevserver)
732
+ </p>
733
+
734
+ A mutable instance of the Vite server used in "dev" mode. For instance, this is [used by our Partytown integration](/en/guides/integrations-guide/partytown/) to inject the Partytown server as middleware:
735
+
736
+ ```js
737
+ export default {
738
+ name: 'partytown',
739
+ hooks: {
740
+ 'astro:server:setup': ({ server }) => {
741
+ server.middlewares.use(
742
+ function middleware(req, res, next) {
743
+ // handle requests
744
+ }
745
+ );
746
+ }
747
+ }
748
+ }
749
+ ```
750
+
751
+ #### `toolbar` option
752
+
753
+ <p>
754
+
755
+ **Type:** `ReturnType<typeof getToolbarServerCommunicationHelpers>`<br />
756
+ <Since v="4.7.0" />
757
+ </p>
758
+
759
+ An object providing callback functions to interact with the [dev toolbar](/en/reference/dev-toolbar-app-reference/):
760
+
761
+ ##### `toolbar.on()`
762
+
763
+ <p>
764
+
765
+ **Type:** `<T>(event: string, callback: (data: T) => void) => void`<br />
766
+ </p>
767
+
768
+ A function that takes an event name as first argument and a callback function as second argument. This allows you to receive a message from a dev toolbar app with data associated to that event.
769
+
770
+ ##### `toolbar.onAppInitialized()`
771
+
772
+ <p>
773
+
774
+ **Type:** `(appId: string, callback: (data: Record<string, never>) => void) => void`<br />
775
+ </p>
776
+
777
+ A function fired when a dev toolbar app is initialized. The first argument is the id of the app that was initialized. The second argument is a callback function to run when the app is initialized.
778
+
779
+ ##### `toolbar.onAppToggled()`
780
+
781
+ <p>
782
+
783
+ **Type:** `(appId: string, callback: (data: { state: boolean; }) => void) => void`<br />
784
+ </p>
785
+
786
+ A function fired when a dev toolbar app is toggled on or off. The first argument is the id of the app that was toggled. The second argument is a callback function providing the state to execute when the application is toggled.
787
+
788
+ ##### `toolbar.send()`
789
+
790
+ <p>
791
+
792
+ **Type:** `<T>(event: string, payload: T) => void`<br />
793
+ </p>
794
+
795
+ A function that sends a message to the dev toolbar that an app can listen for. This takes an event name as the first argument and a payload as the second argument which can be any serializable data.
796
+
797
+ #### `refreshContent()` option
798
+
799
+ <p>
800
+
801
+ **Type:** `(options: { loaders?: Array<string>; context?: Record<string, any>; }) => Promise<void>`<br />
802
+ <Since v="5.0.0" />
803
+ </p>
804
+
805
+ A function for integrations to trigger an update to the content layer during `astro dev`. This can be used, for example, to register a webhook endpoint during dev, or to open a socket to a CMS to listen for changes.
806
+
807
+ By default, `refreshContent()` will refresh all collections. You can optionally pass a `loaders` property, which is an array of loader names. If provided, only collections that use those loaders will be refreshed. For example, A CMS integration could use this property to only refresh its own collections.
808
+
809
+ You can also pass a `context` object to the loaders. This can be used to pass arbitrary data such as the webhook body, or an event from the websocket.
810
+
811
+ ```ts title=my-integration.ts {19-22}
812
+ {
813
+ name: 'my-integration',
814
+ hooks: {
815
+ 'astro:server:setup': async ({ server, refreshContent }) => {
816
+ // Register a dev server webhook endpoint
817
+ server.middlewares.use('/_refresh', async (req, res) => {
818
+ if(req.method !== 'POST') {
819
+ res.statusCode = 405
820
+ res.end('Method Not Allowed');
821
+ return
822
+ }
823
+ let body = '';
824
+ req.on('data', chunk => {
825
+ body += chunk.toString();
826
+ });
827
+ req.on('end', async () => {
828
+ try {
829
+ const webhookBody = JSON.parse(body);
830
+ await refreshContent({
831
+ context: { webhookBody },
832
+ loaders: ['my-loader']
833
+ });
834
+ res.writeHead(200, { 'Content-Type': 'application/json' });
835
+ res.end(JSON.stringify({ message: 'Content refreshed successfully' }));
836
+ } catch (error) {
837
+ res.writeHead(500, { 'Content-Type': 'application/json' });
838
+ res.end(JSON.stringify({ error: 'Failed to refresh content: ' + error.message }));
839
+ }
840
+ });
841
+ });
842
+ }
843
+ }
844
+ }
845
+ ```
846
+
847
+ The loader can then access the `refreshContextData` property to get the webhook body. See the [`refreshContextData`](/en/reference/content-loader-reference/#loadercontextrefreshcontextdata) property for more information.
848
+
849
+ ### `astro:server:start`
850
+
851
+ **Previous hook:** [`astro:server:setup`](#astroserversetup)
852
+
853
+ **Next hook:** [`astro:server:done`](#astroserverdone)
854
+
855
+ **When:** Just after the server's `listen()` event has fired.
856
+
857
+ **Why:** To intercept network requests at the specified address. If you intend to use this address for middleware, consider using `astro:server:setup` instead.
858
+
859
+ ```js
860
+ 'astro:server:start'?: (options: {
861
+ address: AddressInfo;
862
+ logger: AstroIntegrationLogger;
863
+ }) => void | Promise<void>;
864
+ ```
865
+
866
+ #### `address` option
867
+
868
+ <p>
869
+
870
+ **Type:** `AddressInfo`
871
+ </p>
872
+
873
+ The address, family and port number supplied by the [`server.address()` method of the Node.js Net module](https://nodejs.org/api/net.html#serveraddress).
874
+
875
+ ### `astro:server:done`
876
+
877
+ **Previous hook:** [`astro:server:start`](#astroserverstart)
878
+
879
+ **When:** Just after the dev server is closed.
880
+
881
+ **Why:** To run any cleanup events you may trigger during the `astro:server:setup` or `astro:server:start` hooks.
882
+
883
+ ```js
884
+ 'astro:server:done'?: (options: {
885
+ logger: AstroIntegrationLogger;
886
+ }) => void | Promise<void>;
887
+ ```
888
+
889
+ ### `astro:build:start`
890
+
891
+ **Previous hook:** [`astro:config:done`](#astroconfigdone)
892
+
893
+ **Next hook:** [`astro:build:setup`](#astrobuildsetup)
894
+
895
+ **When:** After the `astro:config:done` event, but before the production build begins.
896
+
897
+ **Why:** To set up any global objects or clients needed during a production build. This can also extend the build configuration options in the [adapter API](/en/reference/adapter-reference/).
898
+
899
+ ```js
900
+ 'astro:build:start'?: (options: {
901
+ logger: AstroIntegrationLogger;
902
+ setPrerenderer: (prerenderer: AstroPrerenderer | ((defaultPrerenderer: AstroPrerenderer, context: { outputDirectories: AstroBuildOutputDirectories }) => AstroPrerenderer)) => void;
903
+ }) => void | Promise<void>;
904
+ ```
905
+
906
+
907
+ #### `setPrerenderer()` option
908
+
909
+ <p>
910
+
911
+ **Type:** <code>(prerenderer: <a href="#astroprerenderer">AstroPrerenderer</a> | ((defaultPrerenderer: AstroPrerenderer, context: \{ outputDirectories: <a href="#astrobuildoutputdirectories">AstroBuildOutputDirectories</a> \}) => AstroPrerenderer)) => void</code><br />
912
+ <Since v="6.0.0" />
913
+ </p>
914
+
915
+ A callback function to set a custom prerenderer for the build. This allows adapters to provide their own prerendering logic.
916
+
917
+ The function accepts either an [`AstroPrerenderer` object](#astroprerenderer) directly, or a factory function that receives the default prerenderer and returns a custom one. This is useful when you want to wrap or extend the default behavior.
918
+
919
+ ```js
920
+ 'astro:build:start': ({ setPrerenderer }) => {
921
+ setPrerenderer((defaultPrerenderer) => ({
922
+ name: 'my-prerenderer',
923
+ async setup() {
924
+ // Optional: called once before prerendering starts
925
+ },
926
+ async getStaticPaths() {
927
+ // Returns array of { pathname: string, route: RouteData }
928
+ return defaultPrerenderer.getStaticPaths();
929
+ },
930
+ async render(request, { routeData }) {
931
+ // request: Request, options: { routeData: RouteData }
932
+ // Returns: Response
933
+ },
934
+ async teardown() {
935
+ // Optional: called after all pages are prerendered
936
+ }
937
+ }));
938
+ }
939
+ ```
940
+
941
+ <p><Since v="7.4.0" /></p>
942
+
943
+ The factory function also receives a context object as its second argument. Its `outputDirectories` property contains the [client, server, and prerender output directories](#astrobuildoutputdirectories) resolved by Vite. Integrations and Vite plugins can change where Astro writes build output. Use these values instead of the configured [`build.client`](/en/reference/configuration-reference/#buildclient) or [`build.server`](/en/reference/configuration-reference/#buildserver).
944
+
945
+ The following example reads the output directories in a custom prerenderer factory:
946
+
947
+ ```js
948
+ 'astro:build:start': ({ setPrerenderer }) => {
949
+ setPrerenderer((defaultPrerenderer, { outputDirectories }) => {
950
+ const { client, server, prerender } = outputDirectories;
951
+
952
+ return {
953
+ name: 'my-prerenderer',
954
+ async getStaticPaths() {
955
+ return defaultPrerenderer.getStaticPaths();
956
+ },
957
+ async render(request, { routeData }) {
958
+ // Render using the output in `client`, `server`, or `prerender`
959
+ },
960
+ };
961
+ });
962
+ }
963
+ ```
964
+
965
+ <ReadMore>See the [adapter reference](/en/reference/adapter-reference/#custom-prerenderer) for more details on implementing a custom prerenderer.</ReadMore>
966
+
967
+ ### `astro:build:setup`
968
+
969
+ **Previous hook:** [`astro:build:start`](#astrobuildstart)
970
+
971
+ **Next hook:** [`astro:build:ssr`](#astrobuildssr)
972
+
973
+ **When:** After the `astro:build:start` hook, runs immediately before the build.
974
+
975
+ **Why:** At this point, the Vite config for the build has been completely constructed, this is your final chance to modify it. This can be useful for example to overwrite some defaults. If you're not sure whether you should use this hook or `astro:build:start`, use `astro:build:start` instead.
976
+
977
+ ```js
978
+ 'astro:build:setup'?: (options: {
979
+ vite: vite.InlineConfig;
980
+ pages: Map<string, PageBuildData>;
981
+ updateConfig: (newConfig: vite.InlineConfig) => void;
982
+ logger: AstroIntegrationLogger;
983
+ }) => void | Promise<void>;
984
+
985
+ ```
986
+
987
+ #### `vite` option
988
+
989
+ <p>
990
+
991
+ **Type:** [`InlineConfig`](https://vite.dev/guide/api-javascript.html#inlineconfig)
992
+ </p>
993
+
994
+ An object that allows you to access the Vite configuration used in the build.
995
+
996
+ This can be useful if you need to access configuration options in your integration:
997
+
998
+ ```js
999
+ export default {
1000
+ name: 'my-integration',
1001
+ hooks: {
1002
+ 'astro:build:setup': ({ vite }) => {
1003
+ const { publicDir, root } = vite;
1004
+ },
1005
+ }
1006
+ }
1007
+ ```
1008
+
1009
+ #### `pages` option
1010
+
1011
+ <p>
1012
+
1013
+ **Type:** <code>Map\<string, <a href="#the-pagebuilddata-object">PageBuildData</a>\></code>
1014
+ </p>
1015
+
1016
+ A `Map` with a list of pages as key and [their build data](#the-pagebuilddata-object) as value.
1017
+
1018
+ This can be used to perform an action if a route matches a criteria:
1019
+
1020
+ ```js
1021
+ export default {
1022
+ name: 'my-integration',
1023
+ hooks: {
1024
+ 'astro:build:setup': ({ pages }) => {
1025
+ pages.forEach((data) => {
1026
+ if (data.route.pattern.test("/blog")) {
1027
+ console.log(data.route.type);
1028
+ }
1029
+ });
1030
+ },
1031
+ }
1032
+ }
1033
+ ```
1034
+
1035
+ ##### The `PageBuildData` object
1036
+
1037
+ Describes how to build a page.
1038
+
1039
+ ###### `PageBuildData.key`
1040
+
1041
+ <p>
1042
+
1043
+ **Type:** `string`<br />
1044
+ <Since v="4.8.0" />
1045
+ </p>
1046
+
1047
+ Specifies a unique identifier for the page.
1048
+
1049
+ ###### `PageBuildData.component`
1050
+
1051
+ <p>
1052
+
1053
+ **Type:** `string`
1054
+ </p>
1055
+
1056
+ Specifies the source component URL.
1057
+
1058
+ ###### `PageBuildData.route`
1059
+
1060
+ <p>
1061
+
1062
+ **Type:** [`RouteData`](#routedata)
1063
+ </p>
1064
+
1065
+ Describes the information about the page route.
1066
+
1067
+ ###### `PageBuildData.moduleSpecifier`
1068
+
1069
+ <p>
1070
+
1071
+ **Type:** `string`
1072
+ </p>
1073
+
1074
+ Defines a string that can be resolved into a file path for the module.
1075
+
1076
+ ###### `PageBuildData.styles`
1077
+
1078
+ <p>
1079
+
1080
+ **Type:** `Array<{ depth: number; order: number; sheet: { type: 'inline'; content: string } | { type: 'external'; src: string } }>`<br />
1081
+ <Since v="2.4.0" />
1082
+ </p>
1083
+
1084
+ A list of styles to render on the page. Each style contains its `depth` in the components tree and its display `order` on the page, as well as an indication of whether this should be applied as an inline or external style.
1085
+
1086
+ #### `updateConfig()` option
1087
+
1088
+ <p>
1089
+
1090
+ **Type:** <code>(newConfig: <a href="https://vite.dev/guide/api-javascript.html#inlineconfig">InlineConfig</a>) => void</code>
1091
+ </p>
1092
+
1093
+ A callback function to update the [Vite](https://vite.dev/) options used in the build. Any config you provide **will be merged with the user config + other integration config updates**, so you are free to omit keys!
1094
+
1095
+ For example, this can be used to supply a plugin to the user's project:
1096
+
1097
+ ```js
1098
+ import awesomeCssPlugin from 'awesome-css-vite-plugin';
1099
+
1100
+ export default {
1101
+ name: 'my-integration',
1102
+ hooks: {
1103
+ 'astro:build:setup': ({ updateConfig }) => {
1104
+ updateConfig({
1105
+ plugins: [awesomeCssPlugin()],
1106
+ })
1107
+ }
1108
+ }
1109
+ }
1110
+ ```
1111
+
1112
+ ### `astro:build:ssr`
1113
+
1114
+ **Previous hook:** [`astro:build:setup`](#astrobuildsetup)
1115
+
1116
+ **Next hook:** [`astro:build:generated`](#astrobuildgenerated)
1117
+
1118
+ **When:** After a production SSR build has completed.
1119
+
1120
+ **Why:** To access the SSR manifest and map of the emitted entry points. This is useful when creating custom SSR builds in plugins or integrations.
1121
+ - `middlewareEntryPoint` is the file system path of the middleware file;
1122
+
1123
+ ```js
1124
+ 'astro:build:ssr'?: (options: {
1125
+ manifest: SerializedSSRManifest;
1126
+ middlewareEntryPoint: URL | undefined;
1127
+ logger: AstroIntegrationLogger;
1128
+ }) => void | Promise<void>;
1129
+ ```
1130
+
1131
+ #### `manifest` option
1132
+
1133
+ <p>
1134
+
1135
+ **Type:** `SerializedSSRManifest`
1136
+ </p>
1137
+
1138
+ Allows you to create a custom build by accessing a serialized version of the [`SSRManifest`](#ssrmanifest). This contains the same information as `SSRManifest`, with some properties converted to serializable formats.
1139
+
1140
+ The following example checks the [`i18n.strategy`](#ssrmanifesti18nstrategy) configuration stored in the `manifest`:
1141
+
1142
+ ```js
1143
+ export default {
1144
+ name: 'my-integration',
1145
+ hooks: {
1146
+ 'astro:build:ssr': ({ manifest }) => {
1147
+ const { i18n } = manifest;
1148
+ if (i18n?.strategy === "domains-prefix-always") {
1149
+ // do something
1150
+ }
1151
+ },
1152
+ },
1153
+ }
1154
+ ```
1155
+
1156
+ ##### `manifest.rootDir`
1157
+
1158
+ <p>
1159
+
1160
+ **Type:** `string`
1161
+ </p>
1162
+
1163
+ Specifies a serialized version of the [`SSRManifest.rootDir`](#ssrmanifestrootdir).
1164
+
1165
+ ##### `manifest.srcDir`
1166
+
1167
+ <p>
1168
+
1169
+ **Type:** `string`
1170
+ </p>
1171
+
1172
+ Specifies a serialized version of the [`SSRManifest.srcDir`](#ssrmanifestsrcdir).
1173
+
1174
+ ##### `manifest.cacheDir`
1175
+
1176
+ <p>
1177
+
1178
+ **Type:** `string`
1179
+ </p>
1180
+
1181
+ Specifies a serialized version of the [`SSRManifest.cacheDir`](#ssrmanifestcachedir).
1182
+
1183
+ ##### `manifest.outDir`
1184
+
1185
+ <p>
1186
+
1187
+ **Type:** `string`
1188
+ </p>
1189
+
1190
+ Specifies a serialized version of the [`SSRManifest.outDir`](#ssrmanifestoutdir).
1191
+
1192
+ ##### `manifest.publicDir`
1193
+
1194
+ <p>
1195
+
1196
+ **Type:** `string`
1197
+ </p>
1198
+
1199
+ Specifies a serialized version of the [`SSRManifest.publicDir`](#ssrmanifestpublicdir).
1200
+
1201
+ ##### `manifest.buildClientDir`
1202
+
1203
+ <p>
1204
+
1205
+ **Type:** `string`
1206
+ </p>
1207
+
1208
+ Specifies a serialized version of the [`SSRManifest.buildClientDir`](#ssrmanifestbuildclientdir).
1209
+
1210
+ ##### `manifest.buildServerDir`
1211
+
1212
+ <p>
1213
+
1214
+ **Type:** `string`
1215
+ </p>
1216
+
1217
+ Specifies a serialized version of the [`SSRManifest.buildServerDir`](#ssrmanifestbuildserverdir).
1218
+
1219
+ ##### `manifest.routes`
1220
+
1221
+ <p>
1222
+
1223
+ **Type:** `SerializedRouteInfo[]`
1224
+ </p>
1225
+
1226
+ Defines a list of serialized route information. Each route contains the same properties as [`SSRManifest.routes`](#ssrmanifestroutes), with `routeData` converted to a JSON-serializable format.
1227
+
1228
+ ##### `manifest.assets`
1229
+
1230
+ <p>
1231
+
1232
+ **Type:** `string[]`
1233
+ </p>
1234
+
1235
+ Defines a list of serialized asset file paths.
1236
+
1237
+ ##### `manifest.componentMetadata`
1238
+
1239
+ <p>
1240
+
1241
+ **Type:** <code>[string, <a href="#ssrcomponentmetadata">SSRComponentMetadata</a>][]</code><br />
1242
+ <Since v="2.1.7" />
1243
+ </p>
1244
+
1245
+ Defines an array of key-value pairs where the first element is the component identifier and the second is an object describing the build metadata.
1246
+
1247
+ ##### `manifest.inlinedScripts`
1248
+
1249
+ <p>
1250
+
1251
+ **Type:** `[string, string][]`
1252
+ </p>
1253
+
1254
+ Defines an array of key-value pairs where each entry is a tuple. The first element is the script identifier and the second is the script content.
1255
+
1256
+ ##### `manifest.clientDirectives`
1257
+
1258
+ <p>
1259
+
1260
+ **Type:** `[string, string][]`<br />
1261
+ <Since v="2.5.0" />
1262
+ </p>
1263
+
1264
+ Defines an array of key-value pairs where the first element is the directive name (e.g. `load`, `visible`) and the second is the directive's implementation code.
1265
+
1266
+ ##### `manifest.key`
1267
+
1268
+ <p>
1269
+
1270
+ **Type:** `string`<br />
1271
+ <Since v="4.13.4" />
1272
+ </p>
1273
+
1274
+ Specifies the cryptographic key, serialized as a string, used for encrypting server island props.
1275
+
1276
+ #### `middlewareEntryPoint` option
1277
+
1278
+ <p>
1279
+
1280
+ **Type:** `URL | undefined`<br />
1281
+ <Since v="2.8.0" />
1282
+ </p>
1283
+
1284
+ Exposes the [middleware](/en/guides/middleware/) file path.
1285
+
1286
+ ```js
1287
+ export default {
1288
+ name: 'my-integration',
1289
+ hooks: {
1290
+ 'astro:build:ssr': ({ middlewareEntryPoint }) => {
1291
+ if (middlewareEntryPoint) {
1292
+ // do some operations if a middleware exist
1293
+ }
1294
+ },
1295
+ },
1296
+ }
1297
+ ```
1298
+
1299
+ ### `astro:build:generated`
1300
+
1301
+ <p>
1302
+
1303
+ <Since v="1.3.0" />
1304
+ </p>
1305
+
1306
+ **Previous hook:** [`astro:build:ssr`](#astrobuildssr)
1307
+
1308
+ **Next hook:** [`astro:build:done`](#astrobuilddone)
1309
+
1310
+ **When:** After a static production build has finished generating routes and assets.
1311
+
1312
+ **Why:** To access generated routes and assets **before** build artifacts are cleaned up. This is a very uncommon use case. We recommend using [`astro:build:done`](#astrobuilddone) unless you really need to access the generated files before cleanup.
1313
+
1314
+ ```js
1315
+ 'astro:build:generated'?: (options: {
1316
+ dir: URL;
1317
+ logger: AstroIntegrationLogger;
1318
+ routeToHeaders: RouteToHeaders;
1319
+ }) => void | Promise<void>;
1320
+ ```
1321
+
1322
+ #### `dir` option
1323
+
1324
+ <p>
1325
+
1326
+ **Type:** [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL)
1327
+ </p>
1328
+
1329
+ A URL path to the client build output directory, as resolved by Vite. By default, this is [`outDir`](/en/reference/configuration-reference/#outdir) for static builds and [`build.client`](/en/reference/configuration-reference/#buildclient) for on-demand rendered builds, unless an integration or Vite plugin changes the output directory.
1330
+
1331
+ The following example uses Node's built-in [`fileURLToPath()`](https://nodejs.org/api/url.html#urlfileurltopathurl-options) utility to compute a valid absolute path string for a file provided by the integration:
1332
+
1333
+ ```js
1334
+ import { fileURLToPath } from 'node:url';
1335
+
1336
+ export default {
1337
+ name: 'my-integration',
1338
+ hooks: {
1339
+ 'astro:build:generated': ({ dir }) => {
1340
+ const outFile = fileURLToPath(new URL('./my-integration.json', dir));
1341
+ }
1342
+ }
1343
+ }
1344
+ ```
1345
+
1346
+ #### `routeToHeaders` option
1347
+
1348
+ <p>
1349
+
1350
+ **Type:** <code>Map\<string, <a href="#headerpayload">HeaderPayload</a>\></code><br />
1351
+ <Since v="6.0.0" />
1352
+ </p>
1353
+
1354
+ A mapping of routes to their associated HTTP headers. This is useful when an adapter needs to write a configuration file based on those headers.
1355
+
1356
+ ### `astro:build:done`
1357
+
1358
+ **Previous hook:** [`astro:build:generated`](#astrobuildgenerated)
1359
+
1360
+ **When:** After a production build (SSG or SSR) has completed.
1361
+
1362
+ **Why:** To access generated routes and assets for extension (ex. copy content into the generated `/assets` directory). If you plan to transform generated assets, we recommend exploring the [Vite Plugin API](https://vite.dev/guide/api-plugin.html) and [configuring via `astro:config:setup`](#updateconfig-option) instead.
1363
+
1364
+ ```js
1365
+ 'astro:build:done'?: (options: {
1366
+ pages: { pathname: string }[];
1367
+ dir: URL;
1368
+ assets: Map<string, URL[]>;
1369
+ logger: AstroIntegrationLogger;
1370
+ }) => void | Promise<void>;
1371
+ ```
1372
+
1373
+ #### `dir` option
1374
+
1375
+ <p>
1376
+
1377
+ **Type:** [`URL`](https://developer.mozilla.org/en-US/docs/Web/API/URL)
1378
+ </p>
1379
+
1380
+ A URL path to the client build output directory, as resolved by Vite. By default, this is [`outDir`](/en/reference/configuration-reference/#outdir) for static builds and [`build.client`](/en/reference/configuration-reference/#buildclient) for on-demand rendered builds, unless an integration or Vite plugin changes the output directory.
1381
+
1382
+ The following example uses Node's built-in [`fileURLToPath()`](https://nodejs.org/api/url.html#urlfileurltopathurl-options) utility to compute a valid absolute path string for a file provided by the integration before writing to it:
1383
+
1384
+ ```js
1385
+ import { writeFile } from 'node:fs/promises';
1386
+ import { fileURLToPath } from 'node:url';
1387
+
1388
+ export default function myIntegration() {
1389
+ return {
1390
+ hooks: {
1391
+ 'astro:build:done': async ({ dir }) => {
1392
+ const metadata = await getIntegrationMetadata();
1393
+ // Use fileURLToPath to get a valid, cross-platform absolute path string
1394
+ const outFile = fileURLToPath(new URL('./my-integration.json', dir));
1395
+ await writeFile(outFile, JSON.stringify(metadata));
1396
+ }
1397
+ }
1398
+ }
1399
+ }
1400
+ ```
1401
+
1402
+ #### `assets` option
1403
+
1404
+ <p>
1405
+
1406
+ **Type:** `Map<string, URL[]>`<br />
1407
+ <Since v="5.0.0" />
1408
+ </p>
1409
+
1410
+ Contains URLs to output files paths, grouped by [`IntegrationResolvedRoute`](#integrationresolvedroute) `pattern` property.
1411
+
1412
+ #### `pages` option
1413
+
1414
+ <p>
1415
+
1416
+ **Type:** `{ pathname: string }[]`
1417
+ </p>
1418
+
1419
+ A list of all generated pages. Each entry is an object with one property:
1420
+
1421
+ - `pathname` - the finalized path of the page.
1422
+
1423
+ ### Custom hooks
1424
+
1425
+ Custom hooks can be added to integrations by extending the `IntegrationHooks` interface through [global augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#global-augmentation).
1426
+
1427
+ ```ts
1428
+ declare global {
1429
+ namespace Astro {
1430
+ export interface IntegrationHook {
1431
+ 'your:hook': (params: YourHookParameters) => Promise<void>
1432
+ }
1433
+ }
1434
+ }
1435
+ ```
1436
+
1437
+ Astro reserves the `astro:` prefix for future built-in hooks. Please choose a different prefix when naming your custom hook.
1438
+
1439
+ ## Astro vite environments
1440
+
1441
+ Astro inherits the environments Vite provides by default, `ssr` and `client`.
1442
+
1443
+ Additionally there are two other environments that Astro creates:
1444
+ - `prerender` is an environment used during the `build` and it's used to build static pages.
1445
+ - `astro` is an environment used during the development, and it's used as a "secondary" SSR environment when the Vite `ssr` environment [isn't a runnable dev environment](https://vite.dev/guide/api-environment-frameworks#runnabledevenvironment).
1446
+
1447
+ Astro's [Vite environments](https://vite.dev/guide/api-environment) allow you to optimize your integration's Vite plugins for different environments. One of the main uses of Vite environments is the ability to run and configure your integration's Vite plugins conditionally:
1448
+
1449
+ ```js
1450
+ resolveId(id) {
1451
+ if (id === '\0virtual:foo') {
1452
+ if (this.environment.name === 'client') {
1453
+ throw new Error('This is a server-only module');
1454
+ }
1455
+ return 'export const foo = "bar"';
1456
+ }
1457
+ }
1458
+ ```
1459
+
1460
+ ## Integration types reference
1461
+
1462
+ The following types can be imported from the `astro` module:
1463
+
1464
+ ```ts
1465
+ import type {
1466
+ AstroBuildOutputDirectories,
1467
+ AstroIntegrationLogger,
1468
+ AstroIntegrationMiddleware,
1469
+ AstroMiddlewareInstance,
1470
+ AstroPrerenderer,
1471
+ ClientDirectiveConfig,
1472
+ HeaderPayload,
1473
+ HookParameters,
1474
+ IntegrationResolvedRoute,
1475
+ RedirectConfig,
1476
+ RouteData,
1477
+ RoutePart,
1478
+ RouteType,
1479
+ SSRComponentMetadata,
1480
+ SSRManifest,
1481
+ ValidRedirectStatus,
1482
+ } from "astro";
1483
+ ```
1484
+
1485
+ ### `AstroBuildOutputDirectories`
1486
+
1487
+ <p>
1488
+
1489
+ **Type:** `{ client: URL; server: URL; prerender: URL; }`<br />
1490
+ <Since v="7.4.0" />
1491
+ </p>
1492
+
1493
+ Describes the output directories resolved by Vite for each build environment. A [custom prerenderer factory](#setprerenderer-option) receives this object as `outputDirectories` in its context argument.
1494
+
1495
+ #### `AstroBuildOutputDirectories.client`
1496
+
1497
+ <p>
1498
+
1499
+ **Type:** `URL`
1500
+ </p>
1501
+
1502
+ The resolved output directory for client-side build artifacts (e.g. JavaScript, CSS, and static pages).
1503
+
1504
+ #### `AstroBuildOutputDirectories.server`
1505
+
1506
+ <p>
1507
+
1508
+ **Type:** `URL`
1509
+ </p>
1510
+
1511
+ The resolved output directory for server-side build artifacts.
1512
+
1513
+ #### `AstroBuildOutputDirectories.prerender`
1514
+
1515
+ <p>
1516
+
1517
+ **Type:** `URL`
1518
+ </p>
1519
+
1520
+ The resolved output directory for the prerender build environment.
1521
+
1522
+ ### `AstroIntegrationLogger`
1523
+
1524
+ An instance of the Astro logger, useful to write logs. This logger uses the same [log level](/en/reference/cli-reference/#--verbose)
1525
+ configured via CLI.
1526
+
1527
+ **Methods available** to write to terminal:
1528
+ - `logger.info("Message")`;
1529
+ - `logger.warn("Message")`;
1530
+ - `logger.error("Message")`;
1531
+ - `logger.debug("Message")`;
1532
+
1533
+ All the messages are prepended with a label that has the same value as the name of the integration.
1534
+
1535
+ ```ts title="integration.ts" {8}
1536
+ import type { AstroIntegration } from "astro";
1537
+ export function formatIntegration(): AstroIntegration {
1538
+ return {
1539
+ name: "astro-format",
1540
+ hooks: {
1541
+ "astro:build:done": ({ logger }) => {
1542
+ // do something
1543
+ logger.info("Integration ready.");
1544
+ }
1545
+ }
1546
+ }
1547
+ }
1548
+ ```
1549
+
1550
+ The example above will log a message that includes the provided `info` message:
1551
+
1552
+ ```shell
1553
+ [astro-format] Integration ready.
1554
+ ```
1555
+
1556
+ To log some messages with a different label, use the `.fork` method to specify an alternative to the default `name`:
1557
+
1558
+ ```ts title="integration.ts" ".fork"
1559
+ import type { AstroIntegration } from "astro";
1560
+ export function formatIntegration(): AstroIntegration {
1561
+ return {
1562
+ name: "astro-format",
1563
+ hooks: {
1564
+ "astro:config:done": ({ logger }) => {
1565
+ // do something
1566
+ logger.info("Integration ready.");
1567
+ },
1568
+ "astro:build:done": ({ logger }) => {
1569
+ const buildLogger = logger.fork("astro-format/build");
1570
+ // do something
1571
+ buildLogger.info("Build finished.")
1572
+ }
1573
+ }
1574
+ }
1575
+ }
1576
+ ```
1577
+
1578
+ The example above will produce logs with `[astro-format]` by default, and `[astro-format/build]` when specified:
1579
+
1580
+ ```shell
1581
+ [astro-format] Integration ready.
1582
+ [astro-format/build] Build finished.
1583
+ ```
1584
+
1585
+ ### `AstroIntegrationMiddleware`
1586
+
1587
+ <p>
1588
+
1589
+ **Type:** `{ order: "pre" | "post"; entrypoint: string | URL; }`
1590
+ </p>
1591
+
1592
+ Describes a [middleware added by an integration](#addmiddleware-option).
1593
+
1594
+ #### `AstroIntegrationMiddleware.order`
1595
+
1596
+ <p>
1597
+
1598
+ **Type:** `"pre" | "post"`
1599
+ </p>
1600
+
1601
+ Specifies whether the middleware should run before (`pre`) or after (`post`) other middleware.
1602
+
1603
+ #### `AstroIntegrationMiddleware.entrypoint`
1604
+
1605
+ <p>
1606
+
1607
+ **Type:** `string | URL`
1608
+ </p>
1609
+
1610
+ Defines the import path of the middleware.
1611
+
1612
+ ### `AstroMiddlewareInstance`
1613
+
1614
+ <p>
1615
+
1616
+ **Type:** <code>\{ onRequest?: <a href="/en/reference/modules/astro-middleware/#middlewarehandler">MiddlewareHandler</a>; \}</code>
1617
+ </p>
1618
+
1619
+ An object containing an [`onRequest()`](/en/reference/modules/astro-middleware/#onrequest) property defined with the project's middleware function when it exists.
1620
+
1621
+ ### `AstroPrerenderer`
1622
+
1623
+ <p>
1624
+
1625
+ **Type:** `string`<br />
1626
+ <Since v="6.0.0" />
1627
+ </p>
1628
+
1629
+ Describes a [custom prerender](/en/reference/adapter-reference/#custom-prerenderer) that adapters can provide to control page prerendering.
1630
+
1631
+ #### `AstroPrerenderer.name`
1632
+
1633
+ <p>
1634
+
1635
+ **Type:** `string`
1636
+ </p>
1637
+
1638
+ Specifies a unique name for the prerender.
1639
+
1640
+ #### `AstroPrerenderer.setup()`
1641
+
1642
+ <p>
1643
+
1644
+ **Type:** `() => Promise<void>`
1645
+ </p>
1646
+
1647
+ Defines an optional method that will be called once before the prerendering starts. This is useful for starting a preview server.
1648
+
1649
+ #### `AstroPrerenderer.getStaticPaths()`
1650
+
1651
+ <p>
1652
+
1653
+ **Type:** <code>() => Promise\<\{ paths: Array\<\{ pathname: string; route: <a href="#routedata">RouteData</a>; \}\>; metadata?: object; \}\></code>
1654
+ </p>
1655
+
1656
+ Returns an object with a `paths` list describing the prerendered route paths and their associated data.
1657
+
1658
+ #### `AstroPrerenderer.render()`
1659
+
1660
+ <p>
1661
+
1662
+ **Type:** <code>(request: Request, options: \{ routeData: <a href="#routedata">RouteData</a> \}) => Promise\<\{ response: Response; metadata?: object; \}\></code>
1663
+ </p>
1664
+
1665
+ Defines an optional method describing how to render a page. This will be called by Astro for each path returned by [`getStaticPaths()`](/en/reference/routing-reference/#getstaticpaths).
1666
+
1667
+ #### `AstroPrerenderer.teardown()`
1668
+
1669
+ <p>
1670
+
1671
+ **Type:** `() => Promise<void>`
1672
+ </p>
1673
+
1674
+ Defines an optional method called once all pages are pre-rendered and their images are generated. This is useful for performing cleanup tasks such as stopping a preview server.
1675
+
1676
+ ### `ClientDirectiveConfig`
1677
+
1678
+ <p>
1679
+
1680
+ **Type:** `{ name: string; entrypoint: string | URL; }`
1681
+ </p>
1682
+
1683
+ Describes a [custom client directive added by an integration](#addclientdirective-option).
1684
+
1685
+ #### `ClientDirectiveConfig.name`
1686
+
1687
+ <p>
1688
+
1689
+ **Type:** `string`
1690
+ </p>
1691
+
1692
+ A custom name for the event triggered by the directive.
1693
+
1694
+ #### `ClientDirectiveConfig.entrypoint`
1695
+
1696
+ <p>
1697
+
1698
+ **Type:** `string | URL`
1699
+ </p>
1700
+
1701
+ Defines the import path of the code executed whenever the directive is used.
1702
+
1703
+ ### `HeaderPayload`
1704
+
1705
+ <p>
1706
+
1707
+ **Type:** `{ route: IntegrationResolvedRoute; headers: Headers; }`<br />
1708
+ <Since v="6.0.0" />
1709
+ </p>
1710
+
1711
+ Describes a static route and its associated headers.
1712
+
1713
+ #### `HeaderPayload.route`
1714
+
1715
+ <p>
1716
+
1717
+ **Type:** [`IntegrationResolvedRoute`](#integrationresolvedroute)
1718
+ </p>
1719
+
1720
+ Contains the static route metadata.
1721
+
1722
+ #### `HeaderPayload.headers`
1723
+
1724
+ <p>
1725
+
1726
+ **Type:** `Headers`
1727
+ </p>
1728
+
1729
+ The [`Headers`](https://developer.mozilla.org/en-US/docs/Web/API/Headers) associated with the route.
1730
+
1731
+ ### `HookParameters`
1732
+
1733
+ You can get the type of a hook’s arguments by passing the hook’s name to the `HookParameters` utility type.
1734
+
1735
+ In the following example, a function’s `options` argument is typed to match the parameters of the [`astro:config:setup` hook](#astroconfigsetup):
1736
+
1737
+ ```ts /HookParameters(?:<.+>)?/
1738
+ import type { HookParameters } from 'astro';
1739
+
1740
+ function mySetup(options: HookParameters<'astro:config:setup'>) {
1741
+ options.updateConfig({ /* ... */ });
1742
+ }
1743
+ ```
1744
+
1745
+ ### `IntegrationResolvedRoute`
1746
+
1747
+ A subset of [`RouteData`](#routedata) with remapped properties.
1748
+
1749
+ ```ts
1750
+ interface IntegrationResolvedRoute extends Pick<
1751
+ RouteData,
1752
+ 'params' | 'pathname' | 'segments' | 'type' | 'redirect' | 'origin'
1753
+ > & {
1754
+ pattern: RouteData['route'];
1755
+ patternRegex: RouteData['pattern'];
1756
+ entrypoint: RouteData['component'];
1757
+ isPrerendered: RouteData['prerender'];
1758
+ redirectRoute?: IntegrationResolvedRoute;
1759
+ fallbackRoutes: IntegrationResolvedRoute[];
1760
+ generate: (data?: any) => string;
1761
+ }
1762
+ ```
1763
+
1764
+ #### `IntegrationResolvedRoute.pattern`
1765
+
1766
+ <p>
1767
+
1768
+ **Type:** [`RouteData['route']`](#routedataroute)
1769
+ </p>
1770
+
1771
+ Allows you to identify the type of route based on its path. Here are some examples of paths associated with their pattern:
1772
+ * `src/pages/index.astro` will be `/`
1773
+ * `src/pages/blog/[...slug].astro` will be `/blog/[...slug]`
1774
+ * `src/pages/site/[blog]/[...slug].astro` will be `/site/[blog]/[...slug]`
1775
+
1776
+ #### `IntegrationResolvedRoute.patternRegex`
1777
+
1778
+ <p>
1779
+
1780
+ **Type:** [`RouteData['pattern']`](#routedatapattern)
1781
+ </p>
1782
+
1783
+ Allows you to access a regex used for matching an input URL against a requested route.
1784
+
1785
+ For example, given a `[fruit]/about.astro` path, the regex will be `/^\/([^/]+?)\/about\/?$/`. Using `pattern.test("banana/about")` will return `true`.
1786
+
1787
+ #### `IntegrationResolvedRoute.entrypoint`
1788
+
1789
+ <p>
1790
+
1791
+ **Type:** [`RouteData['component']`](#routedatacomponent)
1792
+ </p>
1793
+
1794
+ The URL pathname of the source component.
1795
+
1796
+ #### `IntegrationResolvedRoute.isPrerendered`
1797
+
1798
+ <p>
1799
+
1800
+ **Type:** [`RouteData['prerender']`](#routedataprerender)
1801
+ </p>
1802
+
1803
+ Determines whether the route use [on demand rendering](/en/guides/on-demand-rendering/). The value will be `true` for projects configured with:
1804
+ * `output: 'static'` when the route does not export `const prerender = true`
1805
+ * `output: 'server'` when the route exports `const prerender = false`
1806
+
1807
+ #### `IntegrationResolvedRoute.redirectRoute`
1808
+
1809
+ <p>
1810
+
1811
+ **Type:** `IntegrationResolvedRoute | undefined`
1812
+ </p>
1813
+
1814
+ When the value of `IntegrationResolvedRoute.type` is `redirect`, the value will be the `IntegrationResolvedRoute` to redirect to. Otherwise, the value will be undefined.
1815
+
1816
+ #### `IntegrationResolvedRoute.fallbackRoutes`
1817
+
1818
+ <p>
1819
+
1820
+ **Type:** `IntegrationResolvedRoute[]`<br />
1821
+ <Since v="6.1.0" />
1822
+ </p>
1823
+
1824
+ When the project uses [i18n with fallback routes](/en/guides/internationalization/#fallback), the value will be a list of the routes this route falls back to when the requested locale isn't available. The fallback content may be served as a redirect or rewrite depending on `i18n.routing.fallbackType`. Otherwise, the value will be an empty array.
1825
+
1826
+
1827
+ #### `IntegrationResolvedRoute.generate()`
1828
+
1829
+ <p>
1830
+
1831
+ **Type:** `(data?: any) => string`<br />
1832
+ <Since v="6.0.0" />
1833
+ </p>
1834
+
1835
+ A function that provides the optional parameters of the route, interpolates them with the route pattern, and returns the path name of the route.
1836
+
1837
+ For example, with a route such as `/blog/[...id].astro`, the `generate()` function could return:
1838
+
1839
+ ```js
1840
+ generate({ id: 'presentation' }) // will output `/blog/presentation`
1841
+ ```
1842
+
1843
+ ### `RedirectConfig`
1844
+
1845
+ <p>
1846
+
1847
+ **Type:** <code>string | \{ status: <a href="#validredirectstatus">ValidRedirectStatus</a>; destination: string; \}</code>
1848
+ </p>
1849
+
1850
+ Describes the destination of a redirect. This can be a string or an object containing information about the status code and its destination.
1851
+
1852
+ ### `RouteData`
1853
+
1854
+ Describes the information about a route.
1855
+
1856
+ #### `RouteData.route`
1857
+
1858
+ <p>
1859
+
1860
+ **Type:** `string`
1861
+ </p>
1862
+
1863
+ Defines the current route pattern. Here are some examples of paths associated with their pattern:
1864
+ * `src/pages/index.astro` will be `/`
1865
+ * `src/pages/blog/[...slug].astro` will be `/blog/[...slug]`
1866
+ * `src/pages/site/[blog]/[...slug].astro` will be `/site/[blog]/[...slug]`
1867
+
1868
+ #### `RouteData.component`
1869
+
1870
+ <p>
1871
+
1872
+ **Type:** `string`
1873
+ </p>
1874
+
1875
+ Specifies the source component URL.
1876
+
1877
+ #### `RouteData.params`
1878
+
1879
+ <p>
1880
+
1881
+ **Type:** `string[]`
1882
+ </p>
1883
+
1884
+ Allows you to access the route `params`. For example, when a project uses the following [dynamic routes](/en/guides/routing/#dynamic-routes) `/pages/[lang]/[...slug].astro`, the value will be `['lang', '...slug']`.
1885
+
1886
+ #### `RouteData.pathname`
1887
+
1888
+ <p>
1889
+
1890
+ **Type:** `string | undefined`
1891
+ </p>
1892
+
1893
+ For regular routes, the value will be the URL pathname where this route will be served. When the project uses [dynamic routes](/en/guides/routing/#dynamic-routes) (ie. `[dynamic]` or `[...spread]`), the pathname will be undefined.
1894
+
1895
+ #### `RouteData.distURL`
1896
+
1897
+ <p>
1898
+
1899
+ **Type:** `URL[]`<br />
1900
+ <Since v="5.0.0" />
1901
+ </p>
1902
+
1903
+ Defines the paths of the physical files emitted by this route. When a route isn't prerendered, the value is an empty array.
1904
+
1905
+ #### `RouteData.pattern`
1906
+
1907
+ <p>
1908
+
1909
+ **Type:** `RegExp`
1910
+ </p>
1911
+
1912
+ Specifies a regex to use for matching an input URL against a requested route.
1913
+
1914
+ For example, given a `[fruit]/about.astro` path, the regex will be `/^\/([^/]+?)\/about\/?$/`. Using `pattern.test("banana/about")` will return `true`.
1915
+
1916
+ #### `RouteData.segments`
1917
+
1918
+ <p>
1919
+
1920
+ **Type:** <code><a href="#routepart">RoutePart</a>[][]</code>
1921
+ </p>
1922
+
1923
+ Allows you to access the route [`params`](#routedataparams) with additional metadata. Each object contains the following properties:
1924
+ * `content`: the `param` name,
1925
+ * `dynamic`: whether the route is dynamic or not,
1926
+ * `spread`: whether the dynamic route uses the spread syntax or not.
1927
+
1928
+ For example, the following route `/pages/[blog]/[...slug].astro` will output the segments:
1929
+
1930
+ ```js
1931
+ [
1932
+ [ { content: 'pages', dynamic: false, spread: false } ],
1933
+ [ { content: 'blog', dynamic: true, spread: false } ],
1934
+ [ { content: '...slug', dynamic: true, spread: true } ]
1935
+ ]
1936
+ ```
1937
+
1938
+ #### `RouteData.type`
1939
+
1940
+ <p>
1941
+
1942
+ **Type:** [`RouteType`](#routetype)
1943
+ </p>
1944
+
1945
+ Allows you to identify the [type of route](#routetype).
1946
+
1947
+ #### `RouteData.prerender`
1948
+
1949
+ <p>
1950
+
1951
+ **Type:** `boolean`
1952
+ </p>
1953
+
1954
+ Determines whether a route uses [on demand rendering](/en/guides/on-demand-rendering/) or is statically prerendered at build time.
1955
+
1956
+ See also [`prerendered`](/en/reference/routing-reference/#prerender) in the routing reference.
1957
+
1958
+ #### `RouteData.redirect`
1959
+
1960
+ <p>
1961
+
1962
+ **Type:** <code><a href="#redirectconfig">RedirectConfig</a> | undefined</code>
1963
+ </p>
1964
+
1965
+ Allows you to access the route to redirect to.
1966
+
1967
+ #### `RouteData.redirectRoute`
1968
+
1969
+ <p>
1970
+
1971
+ **Type:** `RouteData | undefined`
1972
+ </p>
1973
+
1974
+ Specifies the `RouteData` to redirect to when [`RouteData.type`](#routedatatype) is `redirect`.
1975
+
1976
+ #### `RouteData.fallbackRoutes`
1977
+
1978
+ <p>
1979
+
1980
+ **Type:** `RouteData[]`<br />
1981
+ <Since v="3.5.6" />
1982
+ </p>
1983
+
1984
+ Defines a list of `RouteData` to fallback to when [`i18n.fallback`](/en/reference/configuration-reference/#i18nfallback) has a list of locales.
1985
+
1986
+ #### `RouteData.isIndex`
1987
+
1988
+ <p>
1989
+
1990
+ **Type:** `boolean`
1991
+ </p>
1992
+
1993
+ Specifies if the route is a directory index (e.g. `src/pages/index.astro`, `src/pages/blog/index.astro`).
1994
+
1995
+ #### `RouteData.origin`
1996
+
1997
+ <p>
1998
+
1999
+ **Type:** `'internal' | 'external' | 'project'`<br />
2000
+ <Since v="5.0.0" />
2001
+ </p>
2002
+
2003
+ Determines if a route comes from Astro core (`internal`), an integration (`external`) or the user's project (`project`).
2004
+
2005
+ ### `RoutePart`
2006
+
2007
+ <p>
2008
+
2009
+ **Type:** `{ content: string; dynamic: boolean; spread: boolean; }`
2010
+ </p>
2011
+
2012
+ Describes a route segment.
2013
+
2014
+ #### `RoutePart.content`
2015
+
2016
+ <p>
2017
+
2018
+ **Type:** `string`
2019
+ </p>
2020
+
2021
+ Specifies the parameter name for the route. For example:
2022
+ * `about.astro` has the name `about`
2023
+ * `[slug].astro` has the name `slug`
2024
+ * `[...id].astro` has the name `id`
2025
+
2026
+ #### `RoutePart.dynamic`
2027
+
2028
+ <p>
2029
+
2030
+ **Type:** `boolean`
2031
+ </p>
2032
+
2033
+ Whether the route is dynamic or not.
2034
+
2035
+ #### `RoutePart.spread`
2036
+
2037
+ <p>
2038
+
2039
+ **Type:** `boolean`
2040
+ </p>
2041
+
2042
+ Whether the dynamic route uses the spread syntax or not.
2043
+
2044
+ ### `RouteType`
2045
+
2046
+ <p>
2047
+
2048
+ **Type:** `'page' | 'endpoint' | 'redirect' | 'fallback'`
2049
+ </p>
2050
+
2051
+ A union of supported route types:
2052
+
2053
+ * `page`: a route that lives in the file system, usually an Astro component
2054
+ * `endpoint`: a route that lives in the file system, usually a JS file that exposes endpoints methods
2055
+ * `redirect`: a route points to another route that lives in the file system
2056
+ * `fallback`: a route that doesn't exist in the file system that needs to be handled with other means, usually a middleware
2057
+
2058
+ ### `SSRComponentMetadata`
2059
+
2060
+ <p>
2061
+
2062
+ **Type:** `{ propagation: PropagationHint; containsHead: boolean; }`
2063
+ </p>
2064
+
2065
+ Describes the build metadata of a component rendered by the server.
2066
+
2067
+ #### `SSRComponentMetadata.propagation`
2068
+
2069
+ <p>
2070
+
2071
+ **Type:** `'none' | 'self' | 'in-tree'`
2072
+ </p>
2073
+
2074
+ A description of how to render head content from this component, including whether the Astro runtime needs to wait for a component:
2075
+ - `none`: The component does not propagate the head content.
2076
+ - `self`: The component appends the head content.
2077
+ - `in-tree`: Another component within this component's dependency tree appends the head content.
2078
+
2079
+ #### `SSRComponentMetadata.containsHead`
2080
+
2081
+ <p>
2082
+
2083
+ **Type:** `boolean`
2084
+ </p>
2085
+
2086
+ Determines whether the component contains the head content.
2087
+
2088
+ ### `SSRManifest`
2089
+
2090
+ An object containing build configuration and project metadata that the server adapters use at runtime to serve on-demand rendered pages.
2091
+
2092
+ #### `SSRManifest.adapterName`
2093
+
2094
+ <p>
2095
+
2096
+ **Type:** `string`
2097
+ </p>
2098
+
2099
+ Defines the name of the [server adapter](/en/guides/on-demand-rendering/#server-adapters) used for on-demand rendering.
2100
+
2101
+ #### `SSRManifest.routes`
2102
+
2103
+ <p>
2104
+
2105
+ **Type:** `RouteInfo[]`
2106
+ </p>
2107
+
2108
+ A list of information about the routes available in this project. Each entry contains the following properties.
2109
+
2110
+ ##### `RouteInfo.routeData`
2111
+
2112
+ <p>
2113
+
2114
+ **Type:** [`RouteData`](#routedata)
2115
+ </p>
2116
+
2117
+ An object describing known information about a route.
2118
+
2119
+ ##### `RouteInfo.file`
2120
+
2121
+ <p>
2122
+
2123
+ **Type:** `string`
2124
+ </p>
2125
+
2126
+ Specifies the file path to the built route entrypoint.
2127
+
2128
+ ##### `RouteInfo.links`
2129
+
2130
+ <p>
2131
+
2132
+ **Type:** `string[]`
2133
+ </p>
2134
+
2135
+ Defines a list of [HTML `link` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/link) required by this route.
2136
+
2137
+ ##### `RouteInfo.scripts`
2138
+
2139
+ <p>
2140
+
2141
+ **Type:** `Array<{ children: string; stage: string } | { type: 'inline' | 'external'; value: string }>`
2142
+ </p>
2143
+
2144
+ Defines a list of scripts associated with this route. This includes both integration-injected scripts with `children` and `stage` properties and hoisted scripts with `type` and `value` properties.
2145
+
2146
+ ##### `RouteInfo.styles`
2147
+
2148
+ <p>
2149
+
2150
+ **Type:** `Array<{ type: "inline"; content: string; } | { type: "external"; src: string; }>`<br />
2151
+ <Since v="2.4.0" />
2152
+ </p>
2153
+
2154
+ Defines the list of stylesheets associated with this route. This includes both inline styles and stylesheet URLs.
2155
+
2156
+ #### `SSRManifest.site`
2157
+
2158
+ <p>
2159
+
2160
+ **Type:** `string`
2161
+ </p>
2162
+
2163
+ Specifies the [configured `site`](/en/reference/configuration-reference/#site).
2164
+
2165
+ #### `SSRManifest.base`
2166
+
2167
+ <p>
2168
+
2169
+ **Type:** `string`
2170
+ </p>
2171
+
2172
+ Specifies the [configured `base` path](/en/reference/configuration-reference/#base) to deploy to.
2173
+
2174
+ #### `SSRManifest.userAssetsBase`
2175
+
2176
+ <p>
2177
+
2178
+ **Type:** `string | undefined`<br />
2179
+ <Since v="5.3.1" />
2180
+ </p>
2181
+
2182
+ Specifies the base path to use in development mode for user-generated assets, such as scripts and styles.
2183
+
2184
+ #### `SSRManifest.trailingSlash`
2185
+
2186
+ <p>
2187
+
2188
+ **Type:** [`AstroConfig['trailingSlash']`](/en/reference/configuration-reference/#trailingslash)<br />
2189
+ <Since v="3.5.4" />
2190
+ </p>
2191
+
2192
+ Specifies the [configured behavior for trailing slashes](/en/reference/configuration-reference/#trailingslash) in development mode and for on-demand rendered pages.
2193
+
2194
+ #### `SSRManifest.buildFormat`
2195
+
2196
+ <p>
2197
+
2198
+ **Type:** [`NonNullable<AstroConfig['build']>['format']`](/en/reference/configuration-reference/#buildformat)<br />
2199
+ <Since v="4.2.2" />
2200
+ </p>
2201
+
2202
+ Specifies the [configured output file format](/en/reference/configuration-reference/#buildformat).
2203
+
2204
+ #### `SSRManifest.compressHTML`
2205
+
2206
+ <p>
2207
+
2208
+ **Type:** `boolean | "jsx"`<br />
2209
+ <Since v="2.7.2" />
2210
+ </p>
2211
+
2212
+ Determines whether [HTML minification is enabled in the project configuration](/en/reference/configuration-reference/#compresshtml).
2213
+
2214
+ #### `SSRManifest.assetsPrefix`
2215
+
2216
+ <p>
2217
+
2218
+ **Type:** `string | ({ fallback: string; } & Record<string, string>) | undefined`<br />
2219
+ <Since v="2.3.1" />
2220
+ </p>
2221
+
2222
+ Specifies the [configured prefix for Astro-generated asset links](/en/reference/configuration-reference/#buildassetsprefix).
2223
+
2224
+ #### `SSRManifest.renderers`
2225
+
2226
+ <p>
2227
+
2228
+ **Type:** <code><a href="/en/reference/renderer-reference/#ssrloadedrenderer">SSRLoadedRenderer</a>[]</code>
2229
+ </p>
2230
+
2231
+ A list of renderers (e.g. React, Vue, Svelte, MDX) available for the server to use.
2232
+
2233
+ #### `SSRManifest.serverLike`
2234
+
2235
+ <p>
2236
+
2237
+ **Type:** `boolean`<br />
2238
+ <Since v="6.0.0" />
2239
+ </p>
2240
+
2241
+ Determines whether this application uses any on-demand rendered routes.
2242
+
2243
+ #### `SSRManifest.clientDirectives`
2244
+
2245
+ <p>
2246
+
2247
+ **Type:** `Map<string, string>`<br />
2248
+ <Since v="2.5.0" />
2249
+ </p>
2250
+
2251
+ Defines a mapping of client directive names (e.g. `load`, `visible`) to their implementation code. This includes both [built-in client directives](/en/reference/directives-reference/#client-directives) and [custom client directives](/en/reference/directives-reference/#custom-client-directives).
2252
+
2253
+ #### `SSRManifest.entryModules`
2254
+
2255
+ <p>
2256
+
2257
+ **Type:** `Record<string, string>`
2258
+ </p>
2259
+
2260
+ Defines a mapping of entrypoints to their output file paths.
2261
+
2262
+ #### `SSRManifest.inlinedScripts`
2263
+
2264
+ <p>
2265
+
2266
+ **Type:** `Map<string, string>`<br />
2267
+ <Since v="4.5.0" />
2268
+ </p>
2269
+
2270
+ Defines a mapping of script identifiers to their content for scripts that will be inlined in the HTML output.
2271
+
2272
+ #### `SSRManifest.assets`
2273
+
2274
+ <p>
2275
+
2276
+ **Type:** `Set<string>`
2277
+ </p>
2278
+
2279
+ Defines a set of file paths for all assets that are part of the build.
2280
+
2281
+ #### `SSRManifest.componentMetadata`
2282
+
2283
+ <p>
2284
+
2285
+ **Type:** <code>Map\<string, <a href="#ssrcomponentmetadata">SSRComponentMetadata</a>\></code><br />
2286
+ <Since v="2.1.7" />
2287
+ </p>
2288
+
2289
+ Defines a mapping of component identifiers to their build metadata. Each entry contains information about the [`propagation`](#ssrcomponentmetadatapropagation) behavior and whether it contains head elements.
2290
+
2291
+ #### `SSRManifest.pageModule`
2292
+
2293
+ <p>
2294
+
2295
+ **Type:** `{ page: ImportComponentInstance; onRequest?: MiddlewareHandler; }`<br />
2296
+ <Since v="2.7.0" />
2297
+ </p>
2298
+
2299
+ Specifies information about a page module.
2300
+
2301
+ ##### `SSRManifest.pageModule.page()`
2302
+
2303
+ <p>
2304
+
2305
+ **Type:** `() => Promise<ComponentInstance>`
2306
+ </p>
2307
+
2308
+ A function to retrieve an instance of the page component.
2309
+
2310
+ ##### `SSRManifest.pageModule.onRequest()`
2311
+
2312
+ <p>
2313
+
2314
+ **Type:** [`MiddlewareHandler`](/en/reference/modules/astro-middleware/#middlewarehandler)<br />
2315
+ <Since v="3.0.3" />
2316
+ </p>
2317
+
2318
+ An [Astro middleware function](/en/reference/modules/astro-middleware/#onrequest) when defined in the user project.
2319
+
2320
+ #### `SSRManifest.pageMap`
2321
+
2322
+ <p>
2323
+
2324
+ **Type:** <code>Map\<string, () => Promise\<<a href="#ssrmanifestpagemodule">typeof pageModule</a>\>\></code>
2325
+ </p>
2326
+
2327
+ Defines a mapping of component paths to their importable instances.
2328
+
2329
+ #### `SSRManifest.serverIslandMappings`
2330
+
2331
+ <p>
2332
+
2333
+ **Type:** `() => Promise<ServerIslandMappings> | ServerIslandMappings`<br />
2334
+ <Since v="6.0.0" />
2335
+ </p>
2336
+
2337
+ An object, or a function that returns an object, describing available server islands mapping.
2338
+
2339
+ ##### `SSRManifest.serverIslandMappings.serverIslandMap`
2340
+
2341
+ <p>
2342
+
2343
+ **Type:** `Map<string, () => Promise<ComponentInstance>>`<br />
2344
+ <Since v="4.12.0" />
2345
+ </p>
2346
+
2347
+ Defines a mapping of server island IDs to their component instances.
2348
+
2349
+ ##### `SSRManifest.serverIslandMappings.serverIslandNameMap`
2350
+
2351
+ <p>
2352
+
2353
+ **Type:** `Map<string, string>`<br />
2354
+ <Since v="4.12.0" />
2355
+ </p>
2356
+
2357
+ Defines a mapping of server island component paths to their assigned names.
2358
+
2359
+ #### `SSRManifest.key`
2360
+
2361
+ <p>
2362
+
2363
+ **Type:** `Promise<CryptoKey>`<br />
2364
+ <Since v="4.13.4" />
2365
+ </p>
2366
+
2367
+ Determines the [cryptographic key](https://developer.mozilla.org/en-US/docs/Web/API/CryptoKey) used for encrypting server island props.
2368
+
2369
+ #### `SSRManifest.i18n`
2370
+
2371
+ <p>
2372
+
2373
+ **Type:** `SSRManifestI18n | undefined`<br />
2374
+ <Since v="3.5.0" />
2375
+ </p>
2376
+
2377
+ Specifies the resolved [`i18n` configuration](/en/reference/configuration-reference/#i18n) when enabled in the project.
2378
+
2379
+ ##### `SSRManifest.i18n.strategy`
2380
+
2381
+ <p>
2382
+
2383
+ **Type:** `"manual" | "pathname-prefix-always" | "pathname-prefix-other-locales" | "pathname-prefix-always-no-redirect" | "domains-prefix-always" | "domains-prefix-other-locales" | "domains-prefix-always-no-redirect"`
2384
+ </p>
2385
+
2386
+ Defines the [i18n routing strategy](/en/reference/configuration-reference/#i18nrouting) configured. This determines how locales are handled in URLs and whether redirects occur.
2387
+
2388
+ ##### `SSRManifest.i18n.locales`
2389
+
2390
+ <p>
2391
+
2392
+ **Type:** `Locales`
2393
+ </p>
2394
+
2395
+ Specifies a list of [supported locales configured in the project](/en/reference/configuration-reference/#i18nlocales).
2396
+
2397
+ ##### `SSRManifest.i18n.defaultLocale`
2398
+
2399
+ <p>
2400
+
2401
+ **Type:** `string`
2402
+ </p>
2403
+
2404
+ Determines the [default locale configured in the project](/en/reference/configuration-reference/#i18ndefaultlocale).
2405
+
2406
+ ##### `SSRManifest.i18n.fallback`
2407
+
2408
+ <p>
2409
+
2410
+ **Type:** `Record<string, string> | undefined`
2411
+ </p>
2412
+
2413
+ Specifies a mapping of locales to their fallback locales as [configured in `i18n.fallback`](/en/reference/configuration-reference/#i18nfallback).
2414
+
2415
+ ##### `SSRManifest.i18n.fallbackType`
2416
+
2417
+ <p>
2418
+
2419
+ **Type:** `"redirect" | "rewrite"`
2420
+ </p>
2421
+
2422
+ Determines the [configured fallback strategy for the project](/en/reference/configuration-reference/#i18nroutingfallbacktype).
2423
+
2424
+ ##### `SSRManifest.i18n.domainLookupTable`
2425
+
2426
+ <p>
2427
+
2428
+ **Type:** `Record<string, string>`
2429
+ </p>
2430
+
2431
+ A mapping of [configured domains](/en/reference/configuration-reference/#i18ndomains) to their associated locales.
2432
+
2433
+ #### `SSRManifest.middleware`
2434
+
2435
+ <p>
2436
+
2437
+ **Type:** <code>() => Promise\<<a href="#astromiddlewareinstance">AstroMiddlewareInstance</a>\> | <a href="#astromiddlewareinstance">AstroMiddlewareInstance</a></code><br />
2438
+ <Since v="4.2.5" />
2439
+ </p>
2440
+
2441
+ Defines an instance to load the middleware.
2442
+
2443
+ #### `SSRManifest.actions`
2444
+
2445
+ <p>
2446
+
2447
+ **Type:** <code>() => Promise\<\{ server: Record\<string, <a href="/en/reference/modules/astro-actions/#actionclient">ActionClient</a>\>; \}\> | \{ server: Record\<string, <a href="/en/reference/modules/astro-actions/#actionclient">ActionClient</a>\>; \}</code><br />
2448
+ <Since v="5.4.2" />
2449
+ </p>
2450
+
2451
+ An object, or a function that returns an object, with a `server` property that maps action names to their callable functions.
2452
+
2453
+ #### `SSRManifest.sessionDriver()`
2454
+
2455
+ <p>
2456
+
2457
+ **Type:** `() => Promise<{ default: SessionDriverFactory | null }>`<br />
2458
+ <Since v="6.0.0" />
2459
+ </p>
2460
+
2461
+ Retrieves the [configured session driver](/en/reference/configuration-reference/#sessiondriver) when enabled.
2462
+
2463
+ #### `SSRManifest.checkOrigin`
2464
+
2465
+ <p>
2466
+
2467
+ **Type:** `boolean`<br />
2468
+ <Since v="4.6.0" />
2469
+ </p>
2470
+
2471
+ Determines whether [origin checking is enabled in the security configuration](/en/reference/configuration-reference/#securitycheckorigin).
2472
+
2473
+ #### `SSRManifest.allowedDomains`
2474
+
2475
+ <p>
2476
+
2477
+ **Type:** <code>Partial\<<a href="/en/reference/modules/astro-assets/#remotepattern">RemotePattern</a>\>[]</code>
2478
+ </p>
2479
+
2480
+ Specifies the [configured list of permitted host patterns](/en/reference/configuration-reference/#securityalloweddomains) for incoming requests when using on-demand rendering.
2481
+
2482
+ #### `SSRManifest.sessionConfig`
2483
+
2484
+ <p>
2485
+
2486
+ **Type:** <code><a href="/en/reference/configuration-reference/#session-options">SessionConfig\<TDriver\></a> & \{ driverModule?: () => Promise\<\{ default: () => unstorage.Driver \}\>; }</code><br />
2487
+ <Since v="5.1.0" />
2488
+ </p>
2489
+
2490
+ An object containing the [resolved session configuration](/en/reference/configuration-reference/#session-options) and an additional property defining the driver in use.
2491
+
2492
+ #### `SSRManifest.cacheDir`
2493
+
2494
+ <p>
2495
+
2496
+ **Type:** `URL`<br />
2497
+ <Since v="5.2.0" />
2498
+ </p>
2499
+
2500
+ Specifies the [configured directory for caching build artifacts](/en/reference/configuration-reference/#cachedir).
2501
+
2502
+ #### `SSRManifest.srcDir`
2503
+
2504
+ <p>
2505
+
2506
+ **Type:** `URL`<br />
2507
+ <Since v="5.2.0" />
2508
+ </p>
2509
+
2510
+ Specifies the [configured directory that Astro will read the site from](/en/reference/configuration-reference/#srcdir).
2511
+
2512
+ #### `SSRManifest.outDir`
2513
+
2514
+ <p>
2515
+
2516
+ **Type:** `URL`<br />
2517
+ <Since v="5.2.0" />
2518
+ </p>
2519
+
2520
+ Specifies the [configured directory in which to write the final build](/en/reference/configuration-reference/#outdir).
2521
+
2522
+ #### `SSRManifest.rootDir`
2523
+
2524
+ <p>
2525
+
2526
+ **Type:** `URL`<br />
2527
+ <Since v="6.0.0" />
2528
+ </p>
2529
+
2530
+ Specifies the resolved URL for the [directory configured as the project root](/en/reference/configuration-reference/#root).
2531
+
2532
+ #### `SSRManifest.publicDir`
2533
+
2534
+ <p>
2535
+
2536
+ **Type:** `URL`<br />
2537
+ <Since v="5.2.0" />
2538
+ </p>
2539
+
2540
+ Specifies the [configured directory for the static assets](/en/reference/configuration-reference/#publicdir).
2541
+
2542
+ #### `SSRManifest.assetsDir`
2543
+
2544
+ <p>
2545
+
2546
+ **Type:** `string`<br />
2547
+ <Since v="6.0.0" />
2548
+ </p>
2549
+
2550
+ Specifies the [configured directory for generated assets](/en/reference/configuration-reference/#buildassets) in the build output.
2551
+
2552
+ #### `SSRManifest.buildClientDir`
2553
+
2554
+ <p>
2555
+
2556
+ **Type:** `URL`<br />
2557
+ <Since v="5.2.0" />
2558
+ </p>
2559
+
2560
+ Determines the path where client-side build artifacts (e.g. JavaScript, CSS) are output, as resolved by Vite. For on-demand rendered builds, this matches [`build.client`](/en/reference/configuration-reference/#buildclient) by default.
2561
+
2562
+ #### `SSRManifest.buildServerDir`
2563
+
2564
+ <p>
2565
+
2566
+ **Type:** `URL`<br />
2567
+ <Since v="5.2.0" />
2568
+ </p>
2569
+
2570
+ Determines the path where server-side build artifacts are output, as resolved by Vite. For on-demand rendered builds, this matches [`build.server`](/en/reference/configuration-reference/#buildserver) by default.
2571
+
2572
+ #### `SSRManifest.csp`
2573
+
2574
+ <p>
2575
+
2576
+ **Type:** `SSRManifestCSP | undefined`<br />
2577
+ <Since v="5.9.0" />
2578
+ </p>
2579
+
2580
+ Describes the [Content Security Policy configuration](/en/reference/configuration-reference/#securitycsp).
2581
+
2582
+ ##### `SSRManifest.csp.cspDestination`
2583
+
2584
+ <p>
2585
+
2586
+ **Type:** `'adapter' | 'meta' | 'header' | undefined`
2587
+ </p>
2588
+
2589
+ Specifies whether CSP directives should be injected as a `meta` element, as a response `header`, or by the [`adapter` when it supports setting response headers](/en/reference/adapter-reference/#staticheaders).
2590
+
2591
+ ##### `SSRManifest.csp.algorithm`
2592
+
2593
+ <p>
2594
+
2595
+ **Type:** `'SHA-256' | 'SHA-384' | 'SHA-512'`
2596
+ </p>
2597
+
2598
+ Specifies the [configured hash function](/en/reference/configuration-reference/#securitycspalgorithm).
2599
+
2600
+ ##### `SSRManifest.csp.scriptHashes`
2601
+
2602
+ :::caution[Deprecated]
2603
+ Use [`scriptDirective`](#ssrmanifestcspscriptdirective) instead. This property only lists hashes scoped to the generic `script-src` directive. Will be removed in a future major version.
2604
+ :::
2605
+
2606
+ <p>
2607
+
2608
+ **Type:** `string[]`
2609
+ </p>
2610
+
2611
+ Specifies a list of generated hashes for project scripts and [user-supplied hashes](/en/reference/configuration-reference/#securitycspscriptdirectivehashes) for external scripts.
2612
+
2613
+ ##### `SSRManifest.csp.scriptResources`
2614
+
2615
+ :::caution[Deprecated]
2616
+ Use [`scriptDirective`](#ssrmanifestcspscriptdirective) instead. This property only lists sources scoped to the generic `script-src` directive. Will be removed in a future major version.
2617
+ :::
2618
+
2619
+ <p>
2620
+
2621
+ **Type:** `string[]`
2622
+ </p>
2623
+
2624
+ Specifies a list of valid sources combining the [configured script resources](/en/reference/configuration-reference/#securitycspscriptdirectiveresources) and the [injected script resources](/en/reference/api-reference/#cspinsertscriptresource).
2625
+
2626
+ ##### `SSRManifest.csp.isStrictDynamic`
2627
+
2628
+ :::caution[Deprecated]
2629
+ Use [`scriptDirective.strictDynamic`](#ssrmanifestcspscriptdirective) instead. Will be removed in a future major version.
2630
+ :::
2631
+
2632
+ <p>
2633
+
2634
+ **Type:** `boolean`
2635
+ </p>
2636
+
2637
+ Determines whether support for [dynamic script injection is enabled in the configuration](/en/reference/configuration-reference/#securitycspscriptdirectivestrictdynamic).
2638
+
2639
+ ##### `SSRManifest.csp.scriptDirective`
2640
+
2641
+ <p>
2642
+
2643
+ **Type:** `{ resources: Array<string | { resource: string; kind: 'element' | 'attribute' | 'default' }>; hashes: Array<string | { hash: string; kind: 'element' | 'attribute' | 'default' }>; strictDynamic: boolean }`<br />
2644
+ <Since v="7.1.0" />
2645
+ </p>
2646
+
2647
+ Describes the sources, hashes, and [`'strict-dynamic'`](/en/reference/configuration-reference/#securitycspscriptdirectivestrictdynamic) support for the `script-src` family of directives. Each source or hash can target a more specific directive through its `kind` property. Use `'element'` for `script-src-elem`, `'attribute'` for `script-src-attr`, or `'default'` (the same as a bare string) for `script-src`.
2648
+
2649
+ ##### `SSRManifest.csp.styleHashes`
2650
+
2651
+ :::caution[Deprecated]
2652
+ Use [`styleDirective`](#ssrmanifestcspstyledirective) instead. This property only lists hashes scoped to the generic `style-src` directive. Will be removed in a future major version.
2653
+ :::
2654
+
2655
+ <p>
2656
+
2657
+ **Type:** `string[]`
2658
+ </p>
2659
+
2660
+ Specifies a list of generated hashes for project styles and [user-supplied hashes](/en/reference/configuration-reference/#securitycspstyledirectivehashes) for external styles.
2661
+
2662
+ ##### `SSRManifest.csp.styleResources`
2663
+
2664
+ :::caution[Deprecated]
2665
+ Use [`styleDirective`](#ssrmanifestcspstyledirective) instead. This property only lists sources scoped to the generic `style-src` directive. Will be removed in a future major version.
2666
+ :::
2667
+
2668
+ <p>
2669
+
2670
+ **Type:** `string[]`
2671
+ </p>
2672
+
2673
+ Specifies a list of valid sources combining the [configured style resources](/en/reference/configuration-reference/#securitycspstyledirectiveresources) and the [injected style resources](/en/reference/api-reference/#cspinsertstyleresource).
2674
+
2675
+ ##### `SSRManifest.csp.styleDirective`
2676
+
2677
+ <p>
2678
+
2679
+ **Type:** `{ resources: Array<string | { resource: string; kind: 'element' | 'attribute' | 'default' }>; hashes: Array<string | { hash: string; kind: 'element' | 'attribute' | 'default' }> }`<br />
2680
+ <Since v="7.1.0" />
2681
+ </p>
2682
+
2683
+ Describes the sources and hashes for the `style-src` family of directives. Each source or hash can target a more specific directive through its `kind` property. Use `'element'` for `style-src-elem`, `'attribute'` for `style-src-attr`, or `'default'` (the same as a bare string) for `style-src`.
2684
+
2685
+ ##### `SSRManifest.csp.directives`
2686
+
2687
+ <p>
2688
+
2689
+ **Type:** `CspDirective[]`
2690
+ </p>
2691
+
2692
+ Specifies the [configured list of valid sources](/en/reference/configuration-reference/#securitycspdirectives) for specific content types.
2693
+
2694
+ #### `SSRManifest.devToolbar`
2695
+
2696
+ <p>
2697
+
2698
+ **Type:** `{ enabled: boolean; latestAstroVersion: string | undefined; debugInfoOutput: string | undefined; }`<br />
2699
+ <Since v="6.0.0" />
2700
+ </p>
2701
+
2702
+ Describes the resolved dev toolbar settings.
2703
+
2704
+ ##### `SSRManifest.devToolbar.enabled`
2705
+
2706
+ <p>
2707
+
2708
+ **Type:** `boolean`<br />
2709
+ <Since v="6.0.0" />
2710
+ </p>
2711
+
2712
+ Determines [whether the dev toolbar is enabled](/en/reference/configuration-reference/#devtoolbarenabled).
2713
+
2714
+ ##### `SSRManifest.devToolbar.latestAstroVersion`
2715
+
2716
+ <p>
2717
+
2718
+ **Type:** `string | undefined`<br />
2719
+ <Since v="6.0.0" />
2720
+ </p>
2721
+
2722
+ Specifies the latest available version of Astro. This is used to notify the user in the dev toolbar of when an update is available. This will be `undefined` when one of the following conditions applies:
2723
+ - the check fails or has not been completed yet
2724
+ - the user has disabled the check
2725
+ - the user is already using the latest version
2726
+
2727
+ ##### `SSRManifest.devToolbar.debugInfoOutput`
2728
+
2729
+ <p>
2730
+
2731
+ **Type:** `string | undefined`<br />
2732
+ <Since v="6.0.0" />
2733
+ </p>
2734
+
2735
+ Defines the serialized [debug information](/en/reference/cli-reference/#astro-info) passed to the dev toolbar for display.
2736
+
2737
+ #### `SSRManifest.internalFetchHeaders`
2738
+
2739
+ <p>
2740
+
2741
+ **Type:** `Record<string, string>`<br />
2742
+ <Since v="5.15.0" />
2743
+ </p>
2744
+
2745
+ Specifies the headers that are automatically added to internal fetch requests made during rendering.
2746
+
2747
+ #### `SSRManifest.logLevel`
2748
+
2749
+ <p>
2750
+
2751
+ **Type:** `"error" | "warn" | "debug" | "info" | "silent"`<br />
2752
+ <Since v="6.0.0" />
2753
+ </p>
2754
+
2755
+ Specifies the [Vite logging level](https://vite.dev/config/shared-options#loglevel).
2756
+
2757
+ ### `ValidRedirectStatus`
2758
+
2759
+ <p>
2760
+
2761
+ **Type:** `301 | 302 | 303 | 307 | 308 | 300 | 304`
2762
+ </p>
2763
+
2764
+ A union of supported redirect status code.
2765
+
2766
+ ## Allow installation with `astro add`
2767
+
2768
+ [The `astro add` command](/en/reference/cli-reference/#astro-add) allows users to easily add integrations and adapters to their project. If you want _your_ integration to be installable with this tool, **add `astro-integration` to the `keywords` field in your `package.json`**:
2769
+
2770
+ ```json
2771
+ {
2772
+ "name": "example",
2773
+ "keywords": ["astro-integration"],
2774
+ }
2775
+ ```
2776
+
2777
+ Once you [publish your integration to npm](https://docs.npmjs.com/cli/v8/commands/npm-publish), running `astro add example` will install your package with any peer dependencies specified in your `package.json`. This will also apply your integration to the user's `astro.config.*` like so:
2778
+
2779
+ ```js ins={3,6}
2780
+ // astro.config.mjs
2781
+ import { defineConfig } from 'astro/config';
2782
+ import example from 'example';
2783
+
2784
+ export default defineConfig({
2785
+ integrations: [example()],
2786
+ })
2787
+ ```
2788
+
2789
+ :::caution
2790
+ This assumes your integration definition is 1) a `default` export and 2) a function. Ensure this is true before adding the `astro-integration` keyword!
2791
+ :::
2792
+
2793
+ ## Integration Ordering
2794
+
2795
+ All integrations are run in the order that they are configured. For instance, for the array `[react(), svelte()]` in a user's `astro.config.*`, `react` will run before `svelte`.
2796
+
2797
+ Your integration should ideally run in any order. If this isn't possible, we recommend documenting that your integration needs to come first or last in your user's `integrations` configuration array.
2798
+
2799
+ ## Combine integrations into presets
2800
+
2801
+ An integration can also be written as a collection of multiple, smaller integrations. We call these collections **presets.** Instead of creating a factory function that returns a single integration object, a preset returns an _array_ of integration objects. This is useful for building complex features out of multiple integrations.
2802
+
2803
+ ```js
2804
+ integrations: [
2805
+ // Example: where examplePreset() returns: [integrationOne, integrationTwo, ...etc]
2806
+ examplePreset()
2807
+ ]
2808
+ ```
2809
+
2810
+ ## Community Resources
2811
+
2812
+ - [Build your own Astro Integrations](https://www.freecodecamp.org/news/how-to-use-the-astro-ui-framework/#chapter-8-build-your-own-astro-integrations-1) - by Emmanuel Ohans on FreeCodeCamp
2813
+ - [Astro Integration Template](https://github.com/florian-lefebvre/astro-integration-template) - by Florian Lefebvre on GitHub