setAdapter() — astro Function Reference
Architecture documentation for the setAdapter() function in index.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD baa08624_1acd_75f1_ecfc_8d7091335a43["setAdapter()"] 9151bb3d_ee1e_da42_752a_45a9db1dd918["index.ts"] baa08624_1acd_75f1_ecfc_8d7091335a43 -->|defined in| 9151bb3d_ee1e_da42_752a_45a9db1dd918 e251add5_ea46_2280_c246_1b5a023acc3b["add()"] e251add5_ea46_2280_c246_1b5a023acc3b -->|calls| baa08624_1acd_75f1_ecfc_8d7091335a43 98a90619_5f07_3f07_2127_1bc79b52e32b["toIdent()"] baa08624_1acd_75f1_ecfc_8d7091335a43 -->|calls| 98a90619_5f07_3f07_2127_1bc79b52e32b style baa08624_1acd_75f1_ecfc_8d7091335a43 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/cli/add/index.ts lines 626–646
function setAdapter(mod: ProxifiedModule<any>, adapter: IntegrationInfo, exportName: string) {
const config = getDefaultExportOptions(mod);
const adapterId = toIdent(adapter.id);
if (!mod.imports.$items.some((imp) => imp.local === adapterId)) {
mod.imports.$append({
imported: 'default',
local: adapterId,
from: exportName,
});
}
switch (adapter.id) {
case 'node':
config.adapter = builders.functionCall(adapterId, { mode: 'standalone' });
break;
default:
config.adapter = builders.functionCall(adapterId);
break;
}
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does setAdapter() do?
setAdapter() is a function in the astro codebase, defined in packages/astro/src/cli/add/index.ts.
Where is setAdapter() defined?
setAdapter() is defined in packages/astro/src/cli/add/index.ts at line 626.
What does setAdapter() call?
setAdapter() calls 1 function(s): toIdent.
What calls setAdapter()?
setAdapter() 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