setupIntegrationConfig() — astro Function Reference
Architecture documentation for the setupIntegrationConfig() function in index.ts from the astro codebase.
Entity Profile
Dependency Diagram
graph TD bd16dbfd_3c3b_e117_15e8_b4bea7275e1e["setupIntegrationConfig()"] 9151bb3d_ee1e_da42_752a_45a9db1dd918["index.ts"] bd16dbfd_3c3b_e117_15e8_b4bea7275e1e -->|defined in| 9151bb3d_ee1e_da42_752a_45a9db1dd918 e251add5_ea46_2280_c246_1b5a023acc3b["add()"] e251add5_ea46_2280_c246_1b5a023acc3b -->|calls| bd16dbfd_3c3b_e117_15e8_b4bea7275e1e 2ee262d1_8614_9c2d_75fd_5bb9c01ac63c["askToContinue()"] bd16dbfd_3c3b_e117_15e8_b4bea7275e1e -->|calls| 2ee262d1_8614_9c2d_75fd_5bb9c01ac63c style bd16dbfd_3c3b_e117_15e8_b4bea7275e1e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/astro/src/cli/add/index.ts lines 1189–1227
async function setupIntegrationConfig(opts: {
root: URL;
logger: Logger;
flags: Flags;
integrationName: string;
possibleConfigFiles: string[];
defaultConfigFile: string;
defaultConfigContent: string;
}) {
const logger = opts.logger;
const possibleConfigFiles = opts.possibleConfigFiles.map((p) =>
fileURLToPath(new URL(p, opts.root)),
);
let alreadyConfigured = false;
for (const possibleConfigPath of possibleConfigFiles) {
if (existsSync(possibleConfigPath)) {
alreadyConfigured = true;
break;
}
}
if (!alreadyConfigured) {
logger.info(
'SKIP_FORMAT',
`\n ${magenta(`Astro will generate a minimal ${bold(opts.defaultConfigFile)} file.`)}\n`,
);
if (await askToContinue({ flags: opts.flags, logger })) {
await fs.writeFile(
fileURLToPath(new URL(opts.defaultConfigFile, opts.root)),
opts.defaultConfigContent,
{
encoding: 'utf-8',
},
);
logger.debug('add', `Generated default ${opts.defaultConfigFile} file`);
}
} else {
logger.debug('add', `Using existing ${opts.integrationName} configuration`);
}
}
Domain
Subdomains
Defined In
Calls
Called By
Source
Frequently Asked Questions
What does setupIntegrationConfig() do?
setupIntegrationConfig() is a function in the astro codebase, defined in packages/astro/src/cli/add/index.ts.
Where is setupIntegrationConfig() defined?
setupIntegrationConfig() is defined in packages/astro/src/cli/add/index.ts at line 1189.
What does setupIntegrationConfig() call?
setupIntegrationConfig() calls 1 function(s): askToContinue.
What calls setupIntegrationConfig()?
setupIntegrationConfig() 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