Home / File/ index.ts — astro Source File

index.ts — astro Source File

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

File typescript CoreAstro CoreMiddleware 3 imports 5 functions

Entity Profile

Dependency Diagram

graph LR
  521ea8e1_a097_01f1_b8ac_61938dc6b706["index.ts"]
  f16d8c76_2866_6150_bd14_0347b59abfe9["astro"]
  521ea8e1_a097_01f1_b8ac_61938dc6b706 --> f16d8c76_2866_6150_bd14_0347b59abfe9
  263e522e_1aa5_ebc3_e7d6_45ebc51671f7["vite"]
  521ea8e1_a097_01f1_b8ac_61938dc6b706 --> 263e522e_1aa5_ebc3_e7d6_45ebc51671f7
  2c1e87f7_980c_8ec7_13d0_fe0f5d0861b6["vite-plugin-solid"]
  521ea8e1_a097_01f1_b8ac_61938dc6b706 --> 2c1e87f7_980c_8ec7_13d0_fe0f5d0861b6
  style 521ea8e1_a097_01f1_b8ac_61938dc6b706 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { AstroIntegration, AstroIntegrationLogger, AstroRenderer } from 'astro';
import type { PluginOption, UserConfig, Plugin } from 'vite';
import solid, { type Options as ViteSolidPluginOptions } from 'vite-plugin-solid';

// TODO: keep in sync with https://github.com/thetarnav/solid-devtools/blob/main/packages/main/src/vite/index.ts#L7
type DevtoolsPluginOptions = {
	/** Add automatic name when creating signals, memos, stores, or mutables */
	autoname?: boolean;
	locator?:
		| boolean
		| {
				/** Choose in which IDE the component source code should be revealed. */
				targetIDE?: string;
				/**
				 * Holding which key should enable the locator overlay?
				 * @default 'Alt'
				 */
				key?: string;
				/** Inject location attributes to jsx templates */
				jsxLocation?: boolean;
				/** Inject location information to component declarations */
				componentLocation?: boolean;
		  };
};
type DevtoolsPlugin = (_options?: DevtoolsPluginOptions) => PluginOption;

async function getDevtoolsPlugin(logger: AstroIntegrationLogger, retrieve: boolean) {
	if (!retrieve) {
		return null;
	}

	try {
		// @ts-ignore
		return (await import('solid-devtools/vite')).default as DevtoolsPlugin;
	} catch (_) {
		logger.warn(
			'Solid Devtools requires `solid-devtools` as a peer dependency, add it to your project.',
		);
		return null;
	}
}

function getViteConfiguration(
	{ include, exclude }: Options,
	devtoolsPlugin: DevtoolsPlugin | null,
) {
	const config: UserConfig = {
		plugins: [solid({ include, exclude, ssr: true }), configEnvironmentPlugin()],
	};

	if (devtoolsPlugin) {
		config.plugins?.push(devtoolsPlugin({ autoname: true }));
	}

	return config;
}

function getRenderer(): AstroRenderer {
	return {
		name: '@astrojs/solid-js',
// ... (66 more lines)

Domain

Subdomains

Dependencies

  • astro
  • vite
  • vite-plugin-solid

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 5 function(s): PluginOption, configEnvironmentPlugin, getDevtoolsPlugin, getRenderer, getViteConfiguration.
What does index.ts depend on?
index.ts imports 3 module(s): astro, vite, vite-plugin-solid.
Where is index.ts in the architecture?
index.ts is located at packages/integrations/solid/src/index.ts (domain: CoreAstro, subdomain: CoreMiddleware, directory: packages/integrations/solid/src).

Analyze Your Own Codebase

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

Try Supermodel Free