Home / File/ get-item-target-path.test.ts — ui Source File

get-item-target-path.test.ts — ui Source File

Architecture documentation for get-item-target-path.test.ts, a typescript file in the ui codebase. 6 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  6ea6e05e_8734_6e99_4eb0_d0d099c54524["get-item-target-path.test.ts"]
  c41eed12_c415_48c8_bcf4_9d09d3424a18["api.ts"]
  6ea6e05e_8734_6e99_4eb0_d0d099c54524 --> c41eed12_c415_48c8_bcf4_9d09d3424a18
  3c11564a_93a3_54bb_b29e_b57518169213["getItemTargetPath"]
  6ea6e05e_8734_6e99_4eb0_d0d099c54524 --> 3c11564a_93a3_54bb_b29e_b57518169213
  913f04e7_90de_d0b5_5068_4dacd40de96e["get-config.ts"]
  6ea6e05e_8734_6e99_4eb0_d0d099c54524 --> 913f04e7_90de_d0b5_5068_4dacd40de96e
  accda39a_0dd0_5dea_eb7b_df6ae4616716["getConfig"]
  6ea6e05e_8734_6e99_4eb0_d0d099c54524 --> accda39a_0dd0_5dea_eb7b_df6ae4616716
  d05ec4ea_7a68_3a36_bfa4_9ba7f8409ee5["path"]
  6ea6e05e_8734_6e99_4eb0_d0d099c54524 --> d05ec4ea_7a68_3a36_bfa4_9ba7f8409ee5
  c8d55bee_7008_1e1f_317b_8dc47b31b6a8["vitest"]
  6ea6e05e_8734_6e99_4eb0_d0d099c54524 --> c8d55bee_7008_1e1f_317b_8dc47b31b6a8
  style 6ea6e05e_8734_6e99_4eb0_d0d099c54524 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import path from "path"
import { expect, test } from "vitest"

import { getItemTargetPath } from "../../src/registry/api"
import { getConfig } from "../../src/utils/get-config"

test("get item target path", async () => {
  // Full config.
  let appDir = path.resolve(__dirname, "../fixtures/config-full")
  expect(
    await getItemTargetPath(await getConfig(appDir), {
      type: "registry:ui",
    })
  ).toEqual(path.resolve(appDir, "./src/ui"))

  // Partial config.
  appDir = path.resolve(__dirname, "../fixtures/config-partial")
  expect(
    await getItemTargetPath(await getConfig(appDir), {
      type: "registry:ui",
    })
  ).toEqual(path.resolve(appDir, "./components/ui"))

  // JSX.
  appDir = path.resolve(__dirname, "../fixtures/config-jsx")
  expect(
    await getItemTargetPath(await getConfig(appDir), {
      type: "registry:ui",
    })
  ).toEqual(path.resolve(appDir, "./components/ui"))

  // Custom paths.
  appDir = path.resolve(__dirname, "../fixtures/config-ui")
  expect(
    await getItemTargetPath(await getConfig(appDir), {
      type: "registry:ui",
    })
  ).toEqual(path.resolve(appDir, "./src/ui"))
})

Frequently Asked Questions

What does get-item-target-path.test.ts do?
get-item-target-path.test.ts is a source file in the ui codebase, written in typescript. It belongs to the FrameworkTooling domain.
What does get-item-target-path.test.ts depend on?
get-item-target-path.test.ts imports 6 module(s): api.ts, get-config.ts, getConfig, getItemTargetPath, path, vitest.
Where is get-item-target-path.test.ts in the architecture?
get-item-target-path.test.ts is located at packages/shadcn/test/utils/get-item-target-path.test.ts (domain: FrameworkTooling, directory: packages/shadcn/test/utils).

Analyze Your Own Codebase

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

Try Supermodel Free