Home / File/ index.ts — astro Source File

index.ts — astro Source File

Architecture documentation for index.ts, a typescript file in the astro codebase. 10 imports, 0 dependents.

File typescript CoreAstro RenderingEngine 10 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  92304efa_ee81_529f_e9c5_00f519ffb291["index.ts"]
  6d4ff623_63ed_2360_85a7_197d38173f66["./actions/context.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> 6d4ff623_63ed_2360_85a7_197d38173f66
  404747da_115a_9fb3_4875_82fa62b0eda4["./actions/dependencies.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> 404747da_115a_9fb3_4875_82fa62b0eda4
  fb7042e7_800a_21b1_23a1_3b74d4277b70["./actions/git.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> fb7042e7_800a_21b1_23a1_3b74d4277b70
  ff6e7d54_5a42_8bae_6e71_ef93912d9dd9["./actions/help.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> ff6e7d54_5a42_8bae_6e71_ef93912d9dd9
  9d545b5b_9457_705b_58c0_ecb73aeec8f2["./actions/intro.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> 9d545b5b_9457_705b_58c0_ecb73aeec8f2
  aa1764a3_0098_32b7_0687_31d47e8c5967["./actions/next-steps.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> aa1764a3_0098_32b7_0687_31d47e8c5967
  839a2130_ba09_af9a_9cf6_b6bcb0e0ba93["./actions/project-name.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> 839a2130_ba09_af9a_9cf6_b6bcb0e0ba93
  417cee1f_f6ce_984a_2c18_ee3bdfba04f3["./actions/template.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> 417cee1f_f6ce_984a_2c18_ee3bdfba04f3
  2b509984_0b83_7720_b1cd_c4309c08b839["./actions/verify.js"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> 2b509984_0b83_7720_b1cd_c4309c08b839
  44da03af_fba3_824c_9c9c_2685d1d33d31["cli-kit"]
  92304efa_ee81_529f_e9c5_00f519ffb291 --> 44da03af_fba3_824c_9c9c_2685d1d33d31
  style 92304efa_ee81_529f_e9c5_00f519ffb291 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { tasks } from '@astrojs/cli-kit';
import { getContext } from './actions/context.js';
import { dependencies } from './actions/dependencies.js';
import { git } from './actions/git.js';
import { help } from './actions/help.js';
import { intro } from './actions/intro.js';
import { next } from './actions/next-steps.js';
import { projectName } from './actions/project-name.js';
import { template } from './actions/template.js';
import { verify } from './actions/verify.js';

export { processTemplateReadme, removeTemplateMarkerSections } from './actions/template.js';
export { setStdout } from './messages.js';

const exit = () => process.exit(0);
process.on('SIGINT', exit);
process.on('SIGTERM', exit);

export async function main() {
	// Add some extra spacing from the noisy npm/pnpm init output
	// biome-ignore lint/suspicious/noConsole: allowed
	console.log('');
	// NOTE: In the v7.x version of npm, the default behavior of `npm init` was changed
	// to no longer require `--` to pass args and instead pass `--` directly to us. This
	// broke our arg parser, since `--` is a special kind of flag. Filtering for `--` here
	// fixes the issue so that create-astro now works on all npm versions.
	const cleanArgv = process.argv.slice(2).filter((arg) => arg !== '--');
	const ctx = await getContext(cleanArgv);
	if (ctx.help) {
		help();
		return;
	}

	const steps = [
		verify,
		intro,
		projectName,
		template,
		dependencies,

		// Steps which write to files need to go above git
		git,
	];

	for (const step of steps) {
		await step(ctx);
	}

	// biome-ignore lint/suspicious/noConsole: allowed
	console.log('');

	const labels = {
		start: 'Project initializing...',
		end: 'Project initialized!',
	};
	await tasks(labels, ctx.tasks);

	await next(ctx);

	process.exit(0);
}

export { dependencies, getContext, git, intro, next, projectName, template, verify };

Domain

Subdomains

Functions

Dependencies

  • ./actions/context.js
  • ./actions/dependencies.js
  • ./actions/git.js
  • ./actions/help.js
  • ./actions/intro.js
  • ./actions/next-steps.js
  • ./actions/project-name.js
  • ./actions/template.js
  • ./actions/verify.js
  • cli-kit

Frequently Asked Questions

What does index.ts do?
index.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RenderingEngine subdomain.
What functions are defined in index.ts?
index.ts defines 2 function(s): exit, main.
What does index.ts depend on?
index.ts imports 10 module(s): ./actions/context.js, ./actions/dependencies.js, ./actions/git.js, ./actions/help.js, ./actions/intro.js, ./actions/next-steps.js, ./actions/project-name.js, ./actions/template.js, and 2 more.
Where is index.ts in the architecture?
index.ts is located at packages/create-astro/src/index.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/create-astro/src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free