Home / File/ index.ts — astro Source File

index.ts — astro Source File

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

File typescript CoreAstro CoreMiddleware 5 imports 2 functions

Entity Profile

Dependency Diagram

graph LR
  535244c0_21f4_4656_3218_b7b776eeebd0["index.ts"]
  a92de0dc_dbd8_66cd_eaac_504972b46b30["./actions/context.js"]
  535244c0_21f4_4656_3218_b7b776eeebd0 --> a92de0dc_dbd8_66cd_eaac_504972b46b30
  283a4c21_7489_2de9_f3f5_4d2decdce968["./actions/help.js"]
  535244c0_21f4_4656_3218_b7b776eeebd0 --> 283a4c21_7489_2de9_f3f5_4d2decdce968
  3c7f29af_3cf1_5799_d420_32dd45ce6af7["./actions/install.js"]
  535244c0_21f4_4656_3218_b7b776eeebd0 --> 3c7f29af_3cf1_5799_d420_32dd45ce6af7
  594dddfd_025f_fa3f_d563_80dd9177580f["./actions/verify.js"]
  535244c0_21f4_4656_3218_b7b776eeebd0 --> 594dddfd_025f_fa3f_d563_80dd9177580f
  73414401_e2bb_915f_9b7e_7876ce05c609["./messages.js"]
  535244c0_21f4_4656_3218_b7b776eeebd0 --> 73414401_e2bb_915f_9b7e_7876ce05c609
  style 535244c0_21f4_4656_3218_b7b776eeebd0 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { getContext } from './actions/context.js';

import { help } from './actions/help.js';
import { install } from './actions/install.js';
import { collectPackageInfo, verify } from './actions/verify.js';
import { setStdout } from './messages.js';

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

export async function main() {
	// 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, install];

	for (const step of steps) {
		await step(ctx);
	}
	process.exit(0);
}

export { getContext, install, setStdout, verify, collectPackageInfo };

Domain

Subdomains

Functions

Dependencies

  • ./actions/context.js
  • ./actions/help.js
  • ./actions/install.js
  • ./actions/verify.js
  • ./messages.js

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, CoreMiddleware 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 5 module(s): ./actions/context.js, ./actions/help.js, ./actions/install.js, ./actions/verify.js, ./messages.js.
Where is index.ts in the architecture?
index.ts is located at packages/upgrade/src/index.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/upgrade/src).

Analyze Your Own Codebase

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

Try Supermodel Free