Home / File/ pipeline.ts — astro Source File

pipeline.ts — astro Source File

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

File typescript CoreAstro CoreMiddleware 6 imports 1 classes

Entity Profile

Dependency Diagram

graph LR
  51b278d5_a895_65bb_f125_920d5fb11dbb["pipeline.ts"]
  e9b74c5a_8d34_34a7_e196_5e41b87214aa["../types/astro.js"]
  51b278d5_a895_65bb_f125_920d5fb11dbb --> e9b74c5a_8d34_34a7_e196_5e41b87214aa
  baa53824_73a3_1e03_2043_4d0c058ecca5["../types/public/index.js"]
  51b278d5_a895_65bb_f125_920d5fb11dbb --> baa53824_73a3_1e03_2043_4d0c058ecca5
  be18ffb8_46cb_5266_8b78_659c01f80146["../core/base-pipeline.js"]
  51b278d5_a895_65bb_f125_920d5fb11dbb --> be18ffb8_46cb_5266_8b78_659c01f80146
  7216d952_4e4a_2d18_a85b_74b4ace79e2b["../core/constants.js"]
  51b278d5_a895_65bb_f125_920d5fb11dbb --> 7216d952_4e4a_2d18_a85b_74b4ace79e2b
  deed754c_ed97_a6b7_2f50_988eb1d9ea7e["../render/ssr-element.js"]
  51b278d5_a895_65bb_f125_920d5fb11dbb --> deed754c_ed97_a6b7_2f50_988eb1d9ea7e
  99bef061_4ac1_91d4_947d_810691aafb80["../core/routing/rewrite.js"]
  51b278d5_a895_65bb_f125_920d5fb11dbb --> 99bef061_4ac1_91d4_947d_810691aafb80
  style 51b278d5_a895_65bb_f125_920d5fb11dbb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { ComponentInstance, ImportedDevStyle } from '../../../types/astro.js';
import type {
	DevToolbarMetadata,
	RewritePayload,
	RouteData,
	SSRElement,
} from '../../../types/public/index.js';
import { type HeadElements, Pipeline, type TryRewriteResult } from '../../base-pipeline.js';
import { ASTRO_VERSION } from '../../constants.js';
import { createModuleScriptElement, createStylesheetElementSet } from '../../render/ssr-element.js';
import { findRouteToRewrite } from '../../routing/rewrite.js';

type DevPipelineCreate = Pick<NonRunnablePipeline, 'logger' | 'manifest' | 'streaming'>;

/**
 * A pipeline that can't load modules at runtime using the vite environment APIs
 */
export class NonRunnablePipeline extends Pipeline {
	getName(): string {
		return 'NonRunnablePipeline';
	}

	static create({ logger, manifest, streaming }: DevPipelineCreate) {
		async function resolve(specifier: string): Promise<string> {
			if (specifier.startsWith('/')) {
				return specifier;
			} else {
				return '/@id/' + specifier;
			}
		}

		const pipeline = new NonRunnablePipeline(
			logger,
			manifest,
			'development',
			manifest.renderers,
			resolve,
			streaming,
			undefined,
			undefined,
			undefined,
			undefined,
			undefined,
			undefined,
			undefined,
			undefined,
		);
		return pipeline;
	}

	async headElements(routeData: RouteData): Promise<HeadElements> {
		const { assetsPrefix, base } = this.manifest;
		const routeInfo = this.manifest.routes.find((route) => route.routeData === routeData);
		// may be used in the future for handling rel=modulepreload, rel=icon, rel=manifest etc.
		const links = new Set<never>();
		const scripts = new Set<SSRElement>();
		const styles = createStylesheetElementSet(routeInfo?.styles ?? [], base, assetsPrefix);

		for (const script of routeInfo?.scripts ?? []) {
			if ('stage' in script) {
// ... (95 more lines)

Domain

Subdomains

Dependencies

  • ../core/base-pipeline.js
  • ../core/constants.js
  • ../core/routing/rewrite.js
  • ../render/ssr-element.js
  • ../types/astro.js
  • ../types/public/index.js

Frequently Asked Questions

What does pipeline.ts do?
pipeline.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, CoreMiddleware subdomain.
What does pipeline.ts depend on?
pipeline.ts imports 6 module(s): ../core/base-pipeline.js, ../core/constants.js, ../core/routing/rewrite.js, ../render/ssr-element.js, ../types/astro.js, ../types/public/index.js.
Where is pipeline.ts in the architecture?
pipeline.ts is located at packages/astro/src/core/app/dev/pipeline.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/astro/src/core/app/dev).

Analyze Your Own Codebase

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

Try Supermodel Free