Home / File/ source-map.ts — tailwindcss Source File

source-map.ts — tailwindcss Source File

Architecture documentation for source-map.ts, a typescript file in the tailwindcss codebase. 8 imports, 4 dependents.

File typescript OxideEngine Scanner 8 imports 4 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a["source-map.ts"]
  42640952_ea63_55f1_1ff1_00816e2980ae["ast.ts"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> 42640952_ea63_55f1_1ff1_00816e2980ae
  c056448b_f7a2_9149_54e8_f0f8470fe3aa["default-map.ts"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> c056448b_f7a2_9149_54e8_f0f8470fe3aa
  bf2992f6_4a37_8536_70f8_94b13631027d["DefaultMap"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> bf2992f6_4a37_8536_70f8_94b13631027d
  d1b39b63_c9d5_6c28_0206_0ddc8b895876["walk.ts"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> d1b39b63_c9d5_6c28_0206_0ddc8b895876
  ed78da58_8727_ad98_120c_61f35cea357a["walk"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> ed78da58_8727_ad98_120c_61f35cea357a
  ac7e86e1_459b_f374_4516_afecc84f2a17["line-table.ts"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> ac7e86e1_459b_f374_4516_afecc84f2a17
  0204f9b9_80aa_c3e8_eb61_22170d608d65["createLineTable"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> 0204f9b9_80aa_c3e8_eb61_22170d608d65
  224e6d20_656a_4689_b56d_bc18bf3b80d9["source.ts"]
  94f6a4ae_3b1f_8e71_a096_1f7d17efc49a --> 224e6d20_656a_4689_b56d_bc18bf3b80d9
  7aee1750_2c9b_68e2_d651_f79f92781488["source-maps.ts"]
  7aee1750_2c9b_68e2_d651_f79f92781488 --> 94f6a4ae_3b1f_8e71_a096_1f7d17efc49a
  5af9cd3c_2cf4_9dee_376e_fc39122d865a["index.ts"]
  5af9cd3c_2cf4_9dee_376e_fc39122d865a --> 94f6a4ae_3b1f_8e71_a096_1f7d17efc49a
  685d98f0_f223_dedf_cfba_bbdb2dc11d1d["source-map.test.ts"]
  685d98f0_f223_dedf_cfba_bbdb2dc11d1d --> 94f6a4ae_3b1f_8e71_a096_1f7d17efc49a
  83f56732_94d8_aae2_694c_e38d0ec61bfd["translation-map.test.ts"]
  83f56732_94d8_aae2_694c_e38d0ec61bfd --> 94f6a4ae_3b1f_8e71_a096_1f7d17efc49a
  style 94f6a4ae_3b1f_8e71_a096_1f7d17efc49a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { type AstNode } from '../ast'
import { DefaultMap } from '../utils/default-map'
import { walk } from '../walk'
import { createLineTable, type LineTable, type Position } from './line-table'
import type { Source } from './source'

// https://tc39.es/ecma426/#sec-original-position-record-type
export interface OriginalPosition extends Position {
  source: DecodedSource
}

/**
 * A "decoded" sourcemap
 *
 * @see https://tc39.es/ecma426/#decoded-source-map-record
 */
export interface DecodedSourceMap {
  file: string | null
  sources: DecodedSource[]
  mappings: DecodedMapping[]
}

/**
 * A "decoded" source
 *
 * @see https://tc39.es/ecma426/#decoded-source-record
 */
export interface DecodedSource {
  url: string | null
  content: string | null
  ignore: boolean
}

/**
 * A "decoded" mapping
 *
 * @see https://tc39.es/ecma426/#decoded-mapping-record
 */
export interface DecodedMapping {
  // https://tc39.es/ecma426/#sec-original-position-record-type
  originalPosition: OriginalPosition | null

  // https://tc39.es/ecma426/#sec-position-record-type
  generatedPosition: Position

  name: string | null
}

/**
 * Build a source map from the given AST.
 *
 * Our AST is build from flat CSS strings but there are many because we handle
 * `@import`. This means that different nodes can have a different source.
 *
 * Instead of taking an input source map, we take the input CSS string we were
 * originally given, as well as the source text for any imported files, and
 * use that to generate a source map.
 *
 * We then require the use of other tools that can translate one or more
 * "input" source maps into a final output source map. For example,
// ... (139 more lines)

Domain

Subdomains

Frequently Asked Questions

What does source-map.ts do?
source-map.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain, Scanner subdomain.
What functions are defined in source-map.ts?
source-map.ts defines 2 function(s): createSourceMap, createTranslationMap.
What does source-map.ts depend on?
source-map.ts imports 8 module(s): DefaultMap, ast.ts, createLineTable, default-map.ts, line-table.ts, source.ts, walk, walk.ts.
What files import source-map.ts?
source-map.ts is imported by 4 file(s): index.ts, source-map.test.ts, source-maps.ts, translation-map.test.ts.
Where is source-map.ts in the architecture?
source-map.ts is located at packages/tailwindcss/src/source-maps/source-map.ts (domain: OxideEngine, subdomain: Scanner, directory: packages/tailwindcss/src/source-maps).

Analyze Your Own Codebase

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

Try Supermodel Free