Home / File/ utils.ts — tailwindcss Source File

utils.ts — tailwindcss Source File

Architecture documentation for utils.ts, a typescript file in the tailwindcss codebase. 13 imports, 38 dependents.

File typescript OxideEngine PreProcessors 13 imports 38 dependents 15 functions

Entity Profile

Dependency Diagram

graph LR
  9ffd1dda_9675_c514_373d_0f4ab4648249["utils.ts"]
  ac7e86e1_459b_f374_4516_afecc84f2a17["line-table.ts"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> ac7e86e1_459b_f374_4516_afecc84f2a17
  0204f9b9_80aa_c3e8_eb61_22170d608d65["createLineTable"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 0204f9b9_80aa_c3e8_eb61_22170d608d65
  e28f6b6c_be9a_6950_8075_180c1b66f0ea["escape.ts"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> e28f6b6c_be9a_6950_8075_180c1b66f0ea
  433dc479_0296_0a89_fd12_79fc4ea2b8bd["escape"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 433dc479_0296_0a89_fd12_79fc4ea2b8bd
  211db6bb_9759_d0cf_acda_36d7f5733ce2["dedent"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 211db6bb_9759_d0cf_acda_36d7f5733ce2
  1b2c207b_41cb_30e8_96bf_fcae14ed2295["fast-glob"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 1b2c207b_41cb_30e8_96bf_fcae14ed2295
  8d4c06fc_a152_c497_9c1b_b60c5c91b817["node:child_process"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 8d4c06fc_a152_c497_9c1b_b60c5c91b817
  8118fcf2_a51d_d1a1_93d3_c71d3a646692["promises"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 8118fcf2_a51d_d1a1_93d3_c71d3a646692
  6697e014_f05e_326e_fc13_a0cc17f46c5d["node:os"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 6697e014_f05e_326e_fc13_a0cc17f46c5d
  2a7660a5_3e09_bd74_37f0_e4e54bc64ce5["node:path"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 2a7660a5_3e09_bd74_37f0_e4e54bc64ce5
  041a5d56_b2a1_1fbe_eb9b_b605f45324db["node:util"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 041a5d56_b2a1_1fbe_eb9b_b605f45324db
  82ad9cd3_d590_5d6c_5489_cb5e47cde1b7["source-map-js"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 82ad9cd3_d590_5d6c_5489_cb5e47cde1b7
  696bd648_5f24_1b59_8e8b_7a97a692869e["vitest"]
  9ffd1dda_9675_c514_373d_0f4ab4648249 --> 696bd648_5f24_1b59_8e8b_7a97a692869e
  f81303b7_8849_4296_d684_a24c0d860cf6["config.test.ts"]
  f81303b7_8849_4296_d684_a24c0d860cf6 --> 9ffd1dda_9675_c514_373d_0f4ab4648249
  style 9ffd1dda_9675_c514_373d_0f4ab4648249 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import dedent from 'dedent'
import fastGlob from 'fast-glob'
import { exec, spawn } from 'node:child_process'
import fs from 'node:fs/promises'
import { platform, tmpdir } from 'node:os'
import path from 'node:path'
import { stripVTControlCharacters } from 'node:util'
import { RawSourceMap, SourceMapConsumer } from 'source-map-js'
import { test as defaultTest, type ExpectStatic } from 'vitest'
import { createLineTable } from '../packages/tailwindcss/src/source-maps/line-table'
import { escape } from '../packages/tailwindcss/src/utils/escape'

const REPO_ROOT = path.join(__dirname, '..')
const PUBLIC_PACKAGES = (await fs.readdir(path.join(REPO_ROOT, 'dist'))).map((name) =>
  name.replace('tailwindcss-', '@tailwindcss/').replace('.tgz', ''),
)

interface SpawnedProcess {
  dispose: () => void
  flush: () => void
  onStdout: (predicate: (message: string) => boolean) => Promise<void>
  onStderr: (predicate: (message: string) => boolean) => Promise<void>
}

interface ChildProcessOptions {
  cwd?: string
  env?: Record<string, string>
}

interface ExecOptions {
  ignoreStdErr?: boolean
  stdin?: string
}

interface TestConfig {
  fs: {
    [filePath: string]: string | Uint8Array
  }

  timeout?: number
  installDependencies?: boolean
}
interface TestContext {
  root: string
  expect: ExpectStatic
  exec(command: string, options?: ChildProcessOptions, execOptions?: ExecOptions): Promise<string>
  spawn(command: string, options?: ChildProcessOptions): Promise<SpawnedProcess>
  parseSourceMap(opts: string | SourceMapOptions): SourceMap
  fs: {
    write(filePath: string, content: string, encoding?: BufferEncoding): Promise<void>
    create(filePaths: string[]): Promise<void>
    read(filePath: string): Promise<string>
    glob(pattern: string): Promise<[string, string][]>
    dumpFiles(pattern: string): Promise<string>
    expectFileToContain(
      filePath: string,
      contents: string | RegExp | (string | RegExp)[],
    ): Promise<void>
    expectFileNotToContain(filePath: string, contents: string | string[]): Promise<void>
  }
// ... (636 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does utils.ts do?
utils.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain, PreProcessors subdomain.
What functions are defined in utils.ts?
utils.ts defines 15 function(s): PUBLIC_PACKAGES, binary, candidate, context, fetchStyles, gracefullyRemove, message, overwriteVersionsInPackageJson, parseSourceMap, pkgToFilename, and 5 more.
What does utils.ts depend on?
utils.ts imports 13 module(s): createLineTable, dedent, escape, escape.ts, fast-glob, line-table.ts, node:child_process, node:os, and 5 more.
What files import utils.ts?
utils.ts is imported by 38 file(s): astro.test.ts, config.test.ts, config.test.ts, config.test.ts, core-as-postcss-plugin.test.ts, css-modules.test.ts, html-style-blocks.test.ts, ignored-packages.test.ts, and 30 more.
Where is utils.ts in the architecture?
utils.ts is located at integrations/utils.ts (domain: OxideEngine, subdomain: PreProcessors, directory: integrations).

Analyze Your Own Codebase

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

Try Supermodel Free