Home / File/ index.ts — astro Source File

index.ts — astro Source File

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

Entity Profile

Dependency Diagram

graph LR
  de1d947f_a5f6_2274_60a7_09d6dd393f15["index.ts"]
  f16d8c76_2866_6150_bd14_0347b59abfe9["astro"]
  de1d947f_a5f6_2274_60a7_09d6dd393f15 --> f16d8c76_2866_6150_bd14_0347b59abfe9
  style de1d947f_a5f6_2274_60a7_09d6dd393f15 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { AstroAdapter, AstroIntegration } from 'astro';

export function getAdapter(): AstroAdapter {
	return {
		name: '@benchmark/timer',
		serverEntrypoint: '@benchmark/timer/server.js',
		previewEntrypoint: '@benchmark/timer/preview.js',
		exports: ['handler'],
		supportedAstroFeatures: {
			serverOutput: 'stable',
		},
	};
}

export default function createIntegration(): AstroIntegration {
	return {
		name: '@benchmark/timer',
		hooks: {
			'astro:config:setup': ({ updateConfig }) => {
				updateConfig({
					vite: {
						ssr: {
							noExternal: ['@benchmark/timer'],
						},
					},
				});
			},
			'astro:config:done': ({ setAdapter, config }) => {
				setAdapter(getAdapter());

				if (config.output === 'static') {
					console.warn(`[@benchmark/timer] \`output: "server"\` is required to use this adapter.`);
				}
			},
		},
	};
}

Subdomains

Dependencies

  • astro

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 PerformanceBenchmarking domain, ProjectGenerator subdomain.
What functions are defined in index.ts?
index.ts defines 2 function(s): createIntegration, getAdapter.
What does index.ts depend on?
index.ts imports 1 module(s): astro.
Where is index.ts in the architecture?
index.ts is located at benchmark/packages/timer/src/index.ts (domain: PerformanceBenchmarking, subdomain: ProjectGenerator, directory: benchmark/packages/timer/src).

Analyze Your Own Codebase

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

Try Supermodel Free