Home / File/ default.ts — astro Source File

default.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 5 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  aff8ca19_ee2c_80fd_1daf_24c72a8b3fad["default.ts"]
  e9b74c5a_8d34_34a7_e196_5e41b87214aa["../types/astro.js"]
  aff8ca19_ee2c_80fd_1daf_24c72a8b3fad --> e9b74c5a_8d34_34a7_e196_5e41b87214aa
  a4f2698c_5256_262a_ba7c_f72b51878d10["../core/app/types.js"]
  aff8ca19_ee2c_80fd_1daf_24c72a8b3fad --> a4f2698c_5256_262a_ba7c_f72b51878d10
  7216d952_4e4a_2d18_a85b_74b4ace79e2b["../core/constants.js"]
  aff8ca19_ee2c_80fd_1daf_24c72a8b3fad --> 7216d952_4e4a_2d18_a85b_74b4ace79e2b
  6753d7be_860e_1564_f3fe_9b97397c52b4["../server-islands/endpoint.js"]
  aff8ca19_ee2c_80fd_1daf_24c72a8b3fad --> 6753d7be_860e_1564_f3fe_9b97397c52b4
  9448bae7_8c9f_817b_4d45_a0ad40f771b0["../core/routing/astro-designed-error-pages.js"]
  aff8ca19_ee2c_80fd_1daf_24c72a8b3fad --> 9448bae7_8c9f_817b_4d45_a0ad40f771b0
  style aff8ca19_ee2c_80fd_1daf_24c72a8b3fad fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { ComponentInstance } from '../../types/astro.js';
import type { SSRManifest } from '../app/types.js';
import { DEFAULT_404_COMPONENT } from '../constants.js';
import {
	createEndpoint as createServerIslandEndpoint,
	SERVER_ISLAND_COMPONENT,
	SERVER_ISLAND_ROUTE,
} from '../server-islands/endpoint.js';
import { DEFAULT_404_ROUTE, default404Instance } from './astro-designed-error-pages.js';

type DefaultRouteParams = {
	instance: ComponentInstance;
	matchesComponent(filePath: URL): boolean;
	route: string;
	component: string;
};

export const DEFAULT_COMPONENTS = [DEFAULT_404_COMPONENT, SERVER_ISLAND_COMPONENT];

export function createDefaultRoutes(manifest: SSRManifest): DefaultRouteParams[] {
	const root = new URL(manifest.rootDir);
	return [
		{
			instance: default404Instance,
			matchesComponent: (filePath) => filePath.href === new URL(DEFAULT_404_COMPONENT, root).href,
			route: DEFAULT_404_ROUTE.route,
			component: DEFAULT_404_COMPONENT,
		},
		{
			instance: createServerIslandEndpoint(manifest),
			matchesComponent: (filePath) => filePath.href === new URL(SERVER_ISLAND_COMPONENT, root).href,
			route: SERVER_ISLAND_ROUTE,
			component: SERVER_ISLAND_COMPONENT,
		},
	];
}

Domain

Subdomains

Dependencies

  • ../core/app/types.js
  • ../core/constants.js
  • ../core/routing/astro-designed-error-pages.js
  • ../server-islands/endpoint.js
  • ../types/astro.js

Frequently Asked Questions

What does default.ts do?
default.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 default.ts?
default.ts defines 1 function(s): createDefaultRoutes.
What does default.ts depend on?
default.ts imports 5 module(s): ../core/app/types.js, ../core/constants.js, ../core/routing/astro-designed-error-pages.js, ../server-islands/endpoint.js, ../types/astro.js.
Where is default.ts in the architecture?
default.ts is located at packages/astro/src/core/routing/default.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/core/routing).

Analyze Your Own Codebase

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

Try Supermodel Free