Home / File/ tsconfig.ts — astro Source File

tsconfig.ts — astro Source File

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

File typescript CoreAstro RenderingEngine 4 imports 4 functions

Entity Profile

Dependency Diagram

graph LR
  1275993c_9183_58e3_869f_4f9529e67337["tsconfig.ts"]
  5d6d1861_a18d_b246_cd94_08889ab7e74c["promises"]
  1275993c_9183_58e3_869f_4f9529e67337 --> 5d6d1861_a18d_b246_cd94_08889ab7e74c
  c52a5f83_66e3_37d7_9ebb_767f7129bc62["node:path"]
  1275993c_9183_58e3_869f_4f9529e67337 --> c52a5f83_66e3_37d7_9ebb_767f7129bc62
  e5bc1d28_6010_ae61_773d_cc0746339061["tsconfck"]
  1275993c_9183_58e3_869f_4f9529e67337 --> e5bc1d28_6010_ae61_773d_cc0746339061
  41525615_7e06_b0e8_f601_674c57b118ee["typescript"]
  1275993c_9183_58e3_869f_4f9529e67337 --> 41525615_7e06_b0e8_f601_674c57b118ee
  style 1275993c_9183_58e3_869f_4f9529e67337 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
import {
	find,
	parse,
	TSConfckParseError,
	type TSConfckParseOptions,
	type TSConfckParseResult,
	toJson,
} from 'tsconfck';
import type { CompilerOptions, TypeAcquisition } from 'typescript';

export const defaultTSConfig: TSConfig = { extends: 'astro/tsconfigs/base' };

export type frameworkWithTSSettings = 'vue' | 'react' | 'preact' | 'solid-js';
// The following presets unfortunately cannot be inside the specific integrations, as we need
// them even in cases where the integrations are not installed
export const presets = new Map<frameworkWithTSSettings, TSConfig>([
	[
		'vue', // Settings needed for template intellisense when using Volar
		{
			compilerOptions: {
				jsx: 'preserve',
			},
		},
	],
	[
		'react', // Default TypeScript settings, but we need to redefine them in case the users changed them previously
		{
			compilerOptions: {
				jsx: 'react-jsx',
				jsxImportSource: 'react',
			},
		},
	],
	[
		'preact', // https://preactjs.com/guide/v10/typescript/#typescript-configuration
		{
			compilerOptions: {
				jsx: 'react-jsx',
				jsxImportSource: 'preact',
			},
		},
	],
	[
		'solid-js', // https://www.solidjs.com/guides/typescript#configuring-typescript
		{
			compilerOptions: {
				jsx: 'preserve',
				jsxImportSource: 'solid-js',
			},
		},
	],
]);

type TSConfigResult<T = object> = Promise<
	(TSConfckParseResult & T) | 'invalid-config' | 'missing-config' | 'unknown-error'
>;

/**
// ... (135 more lines)

Domain

Subdomains

Dependencies

  • node:path
  • promises
  • tsconfck
  • typescript

Frequently Asked Questions

What does tsconfig.ts do?
tsconfig.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 tsconfig.ts?
tsconfig.ts defines 4 function(s): deepMergeObjects, loadTSConfig, safeParse, updateTSConfigForFramework.
What does tsconfig.ts depend on?
tsconfig.ts imports 4 module(s): node:path, promises, tsconfck, typescript.
Where is tsconfig.ts in the architecture?
tsconfig.ts is located at packages/astro/src/core/config/tsconfig.ts (domain: CoreAstro, subdomain: RenderingEngine, directory: packages/astro/src/core/config).

Analyze Your Own Codebase

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

Try Supermodel Free