transform-rsc.ts — ui Source File
Architecture documentation for transform-rsc.ts, a typescript file in the ui codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR a5988b62_45dd_fee6_13c8_dbce7e60d806["transform-rsc.ts"] e69863ed_3e2f_ef94_648a_ef0155c386ef["transformers"] a5988b62_45dd_fee6_13c8_dbce7e60d806 --> e69863ed_3e2f_ef94_648a_ef0155c386ef 4f6f7e78_23ff_4f5f_c723_474454f64c85["ts-morph"] a5988b62_45dd_fee6_13c8_dbce7e60d806 --> 4f6f7e78_23ff_4f5f_c723_474454f64c85 style a5988b62_45dd_fee6_13c8_dbce7e60d806 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { Transformer } from "@/src/utils/transformers"
import { SyntaxKind } from "ts-morph"
const directiveRegex = /^["']use client["']$/g
export const transformRsc: Transformer = async ({ sourceFile, config }) => {
if (config.rsc) {
return sourceFile
}
// Remove "use client" from the top of the file.
const first = sourceFile.getFirstChildByKind(SyntaxKind.ExpressionStatement)
if (first && directiveRegex.test(first.getText())) {
first.remove()
}
return sourceFile
}
Domain
Subdomains
Functions
Dependencies
- transformers
- ts-morph
Source
Frequently Asked Questions
What does transform-rsc.ts do?
transform-rsc.ts is a source file in the ui codebase, written in typescript. It belongs to the FrameworkTooling domain, TemplateSync subdomain.
What functions are defined in transform-rsc.ts?
transform-rsc.ts defines 1 function(s): transformRsc.
What does transform-rsc.ts depend on?
transform-rsc.ts imports 2 module(s): transformers, ts-morph.
Where is transform-rsc.ts in the architecture?
transform-rsc.ts is located at packages/shadcn/src/utils/transformers/transform-rsc.ts (domain: FrameworkTooling, subdomain: TemplateSync, directory: packages/shadcn/src/utils/transformers).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free