Home / File/ extract-static-plugins.ts — tailwindcss Source File

extract-static-plugins.ts — tailwindcss Source File

Architecture documentation for extract-static-plugins.ts, a typescript file in the tailwindcss codebase. 2 imports, 2 dependents.

File typescript CommandLineInterface Renderer 2 imports 2 dependents 3 functions

Entity Profile

Dependency Diagram

graph LR
  84232925_f388_3f84_db95_7d674fc02190["extract-static-plugins.ts"]
  753693ff_2ae3_7429_cdb4_c900163b9007["tree-sitter"]
  84232925_f388_3f84_db95_7d674fc02190 --> 753693ff_2ae3_7429_cdb4_c900163b9007
  dcfa86ea_30eb_8ba7_c99f_7ee9454a5634["tree-sitter-typescript"]
  84232925_f388_3f84_db95_7d674fc02190 --> dcfa86ea_30eb_8ba7_c99f_7ee9454a5634
  ffe9c87e_35ad_f431_9625_80fc875792a7["migrate-js-config.ts"]
  ffe9c87e_35ad_f431_9625_80fc875792a7 --> 84232925_f388_3f84_db95_7d674fc02190
  433277d6_4fe1_58fa_6367_5c63b58283da["extract-static-plugins.test.ts"]
  433277d6_4fe1_58fa_6367_5c63b58283da --> 84232925_f388_3f84_db95_7d674fc02190
  style 84232925_f388_3f84_db95_7d674fc02190 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import Parser from 'tree-sitter'
import TS from 'tree-sitter-typescript'

let parser = new Parser()
parser.setLanguage(TS.typescript)
const treesitter = String.raw

// Extract `plugins` property of the object export for both ESM and CJS files
const PLUGINS_QUERY = new Parser.Query(
  TS.typescript,
  treesitter`
    ; export default {}
    (export_statement
      value: [
        (satisfies_expression (object
          (pair
            key: (property_identifier) @_name (#eq? @_name "plugins")
            value: (array) @imports
          )
        ))
        value: (as_expression (object
          (pair
            key: (property_identifier) @_name (#eq? @_name "plugins")
            value: (array) @imports
          )
        ))
        value: (object
          (pair
            key: (property_identifier) @_name (#eq? @_name "plugins")
            value: (array) @imports
          )
        )
      ]
    )

    ; module.exports = {}
    (expression_statement
      (assignment_expression
        left: (member_expression) @left (#eq? @left "module.exports")
        right: [
          (satisfies_expression (object
            (pair
              key: (property_identifier) @_name (#eq? @_name "plugins")
              value: (array) @imports
            )
          ))
          (as_expression (object
            (pair
              key: (property_identifier) @_name (#eq? @_name "plugins")
              value: (array) @imports
            )
          ))
          (object
            (pair
              key: (property_identifier) @_name (#eq? @_name "plugins")
              value: (array) @imports
            )
          )
        ]
      )
// ... (323 more lines)

Subdomains

Dependencies

  • tree-sitter
  • tree-sitter-typescript

Frequently Asked Questions

What does extract-static-plugins.ts do?
extract-static-plugins.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the CommandLineInterface domain, Renderer subdomain.
What functions are defined in extract-static-plugins.ts?
extract-static-plugins.ts defines 3 function(s): extractStaticImportMap, extractValue, findStaticPlugins.
What does extract-static-plugins.ts depend on?
extract-static-plugins.ts imports 2 module(s): tree-sitter, tree-sitter-typescript.
What files import extract-static-plugins.ts?
extract-static-plugins.ts is imported by 2 file(s): extract-static-plugins.test.ts, migrate-js-config.ts.
Where is extract-static-plugins.ts in the architecture?
extract-static-plugins.ts is located at packages/@tailwindcss-upgrade/src/utils/extract-static-plugins.ts (domain: CommandLineInterface, subdomain: Renderer, directory: packages/@tailwindcss-upgrade/src/utils).

Analyze Your Own Codebase

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

Try Supermodel Free