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 Oxide PreProcessors 13 imports 38 dependents 15 functions

Entity Profile

Dependency Diagram

graph LR
  7600373a_3645_efb1_bcbb_e7c3fcb813ac["utils.ts"]
  c078df4e_9ae3_a02e_4feb_6380507fddd9["line-table.ts"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> c078df4e_9ae3_a02e_4feb_6380507fddd9
  1c8e1044_08e4_f6ad_7550_c4fa3667fbf3["createLineTable"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> 1c8e1044_08e4_f6ad_7550_c4fa3667fbf3
  efac73cf_6ebb_d715_c95b_77e505446ee2["escape.ts"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> efac73cf_6ebb_d715_c95b_77e505446ee2
  3330a25c_8114_660c_a3c7_8f1aaa37457d["escape"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> 3330a25c_8114_660c_a3c7_8f1aaa37457d
  8ff4bb92_b963_efb6_cca2_1da4b3ea849b["dedent"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> 8ff4bb92_b963_efb6_cca2_1da4b3ea849b
  d6f4bbd7_a7f8_a888_9ff3_84565d7d402f["fast-glob"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> d6f4bbd7_a7f8_a888_9ff3_84565d7d402f
  69c3e246_0d60_1a3b_6419_4c423b01252f["node:child_process"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> 69c3e246_0d60_1a3b_6419_4c423b01252f
  b75e8457_6610_e7ce_eeaf_9a1dd10fc510["promises"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> b75e8457_6610_e7ce_eeaf_9a1dd10fc510
  05950b06_34e4_40bd_2622_1cfda03546ff["node:os"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> 05950b06_34e4_40bd_2622_1cfda03546ff
  89aef3dd_1eed_c141_d425_b8949215a653["node:path"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> 89aef3dd_1eed_c141_d425_b8949215a653
  f909665b_1fad_0830_f03c_620b7c9464c3["node:util"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> f909665b_1fad_0830_f03c_620b7c9464c3
  46377737_e2b8_a689_bbdf_90f37c3175a3["source-map-js"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> 46377737_e2b8_a689_bbdf_90f37c3175a3
  f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3["vitest"]
  7600373a_3645_efb1_bcbb_e7c3fcb813ac --> f1e05e5f_c1b2_a3f5_b2e8_3317b9243ac3
  225ce21e_3608_58b0_5e2b_c60284a4deb8["config.test.ts"]
  225ce21e_3608_58b0_5e2b_c60284a4deb8 --> 7600373a_3645_efb1_bcbb_e7c3fcb813ac
  style 7600373a_3645_efb1_bcbb_e7c3fcb813ac 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 Oxide 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: Oxide, subdomain: PreProcessors, directory: integrations).

Analyze Your Own Codebase

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

Try Supermodel Free