addIntegration() — astro Function Reference
Architecture documentation for the addIntegration() function in index.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD 07b08a43_b086_cd40_27c8_a3517efced2a["addIntegration()"] 9151bb3d_ee1e_da42_752a_45a9db1dd918["index.ts"] 07b08a43_b086_cd40_27c8_a3517efced2a -->|defined in| 9151bb3d_ee1e_da42_752a_45a9db1dd918 e251add5_ea46_2280_c246_1b5a023acc3b["add()"] e251add5_ea46_2280_c246_1b5a023acc3b -->|calls| 07b08a43_b086_cd40_27c8_a3517efced2a 98a90619_5f07_3f07_2127_1bc79b52e32b["toIdent()"] 07b08a43_b086_cd40_27c8_a3517efced2a -->|calls| 98a90619_5f07_3f07_2127_1bc79b52e32b style 07b08a43_b086_cd40_27c8_a3517efced2a fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/cli/add/index.ts lines 576–599
function addIntegration(mod: ProxifiedModule<any>, integration: IntegrationInfo) {
const config = getDefaultExportOptions(mod);
const integrationId = toIdent(integration.id);
if (!mod.imports.$items.some((imp) => imp.local === integrationId)) {
mod.imports.$append({
imported: 'default',
local: integrationId,
from: integration.packageName,
});
}
config.integrations ??= [];
if (
!config.integrations.$ast.elements.some(
(el: ASTNode) =>
el.type === 'CallExpression' &&
el.callee.type === 'Identifier' &&
el.callee.name === integrationId,
)
) {
config.integrations.push(builders.functionCall(integrationId));
}
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does addIntegration() do?
addIntegration() is a function in the astro codebase, defined in packages/astro/src/cli/add/index.ts.
Where is addIntegration() defined?
addIntegration() is defined in packages/astro/src/cli/add/index.ts at line 576.
What does addIntegration() call?
addIntegration() calls 1 function(s): toIdent.
What calls addIntegration()?
addIntegration() is called by 1 function(s): add.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free