utils.test.ts — ui Source File
Architecture documentation for utils.test.ts, a typescript file in the ui codebase. 12 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR d51ab9e0_8488_8598_7079_e383487a0885["utils.test.ts"] 913f04e7_90de_d0b5_5068_4dacd40de96e["get-config.ts"] d51ab9e0_8488_8598_7079_e383487a0885 --> 913f04e7_90de_d0b5_5068_4dacd40de96e 01ad0f79_968a_e85b_5aa4_a9aceb0aa35c["Config"] d51ab9e0_8488_8598_7079_e383487a0885 --> 01ad0f79_968a_e85b_5aa4_a9aceb0aa35c d622c874_d9cc_69e4_4150_aadbf45b3cda["schema.ts"] d51ab9e0_8488_8598_7079_e383487a0885 --> d622c874_d9cc_69e4_4150_aadbf45b3cda edc2979a_e040_ab0c_5174_c69f7c8fa905["utils.ts"] d51ab9e0_8488_8598_7079_e383487a0885 --> edc2979a_e040_ab0c_5174_c69f7c8fa905 1a0f4abc_3605_ccdc_e2a7_5fdd28719196["canDeduplicateFiles"] d51ab9e0_8488_8598_7079_e383487a0885 --> 1a0f4abc_3605_ccdc_e2a7_5fdd28719196 56f8e3f8_10f2_39ea_2a08_e9bf97266d40["deduplicateFilesByTarget"] d51ab9e0_8488_8598_7079_e383487a0885 --> 56f8e3f8_10f2_39ea_2a08_e9bf97266d40 79799d76_cdb2_3542_2249_0f44998edeea["getDependencyFromModuleSpecifier"] d51ab9e0_8488_8598_7079_e383487a0885 --> 79799d76_cdb2_3542_2249_0f44998edeea fe7f4163_7b5c_8e6e_fb28_4db1891f64b4["isLocalFile"] d51ab9e0_8488_8598_7079_e383487a0885 --> fe7f4163_7b5c_8e6e_fb28_4db1891f64b4 8ddcdfbe_d6bd_5d57_f9bf_ce44b542a4fa["isUniversalRegistryItem"] d51ab9e0_8488_8598_7079_e383487a0885 --> 8ddcdfbe_d6bd_5d57_f9bf_ce44b542a4fa ef860c53_bcca_c729_b5d1_a490f284253c["isUrl"] d51ab9e0_8488_8598_7079_e383487a0885 --> ef860c53_bcca_c729_b5d1_a490f284253c c8d55bee_7008_1e1f_317b_8dc47b31b6a8["vitest"] d51ab9e0_8488_8598_7079_e383487a0885 --> c8d55bee_7008_1e1f_317b_8dc47b31b6a8 6802ce19_522d_e5fb_e458_8826d9f6952e["zod"] d51ab9e0_8488_8598_7079_e383487a0885 --> 6802ce19_522d_e5fb_e458_8826d9f6952e style d51ab9e0_8488_8598_7079_e383487a0885 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { describe, expect, it, test, vi } from "vitest"
import { z } from "zod"
import { Config } from "../utils/get-config"
import { registryItemFileSchema } from "./schema"
import {
canDeduplicateFiles,
deduplicateFilesByTarget,
getDependencyFromModuleSpecifier,
isLocalFile,
isUniversalRegistryItem,
isUrl,
} from "./utils"
describe("getDependencyFromModuleSpecifier", () => {
it("should return the first part of a non-scoped package with path", () => {
expect(getDependencyFromModuleSpecifier("foo/bar")).toBe("foo")
expect(getDependencyFromModuleSpecifier("lodash/get")).toBe("lodash")
})
it("should return the full package name for scoped packages", () => {
expect(getDependencyFromModuleSpecifier("@types/react")).toBe(
"@types/react"
)
expect(getDependencyFromModuleSpecifier("@radix-ui/react-dialog")).toBe(
"@radix-ui/react-dialog"
)
})
it.each([
// Core packages
"react",
"react/jsx-runtime",
"react/dom",
"react/experimental",
"react-dom",
"react-dom/client",
"react-dom/server",
"react-dom/test-utils",
"next",
"next/link",
"next/image",
"next/navigation",
])("should return null for core package %s", (moduleSpecifier) => {
expect(getDependencyFromModuleSpecifier(moduleSpecifier)).toBe(null)
})
it.each([
// Node.js modules
"node:fs",
"node:path",
"node:http",
"node:stream",
// JSR modules
"jsr:@std/fs",
"jsr:@std/path",
"jsr:@std/http",
// NPM modules
"npm:lodash",
"npm:@types/react",
// ... (621 more lines)
Domain
Dependencies
Source
Frequently Asked Questions
What does utils.test.ts do?
utils.test.ts is a source file in the ui codebase, written in typescript. It belongs to the FrameworkTooling domain.
What does utils.test.ts depend on?
utils.test.ts imports 12 module(s): Config, canDeduplicateFiles, deduplicateFilesByTarget, get-config.ts, getDependencyFromModuleSpecifier, isLocalFile, isUniversalRegistryItem, isUrl, and 4 more.
Where is utils.test.ts in the architecture?
utils.test.ts is located at packages/shadcn/src/registry/utils.test.ts (domain: FrameworkTooling, directory: packages/shadcn/src/registry).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free