MCPcopy
hub / github.com/shadcn-ui/ui / npxShadcn

Function npxShadcn

packages/tests/src/utils/helpers.ts:69–96  ·  view source on GitHub ↗
(
  cwd: string,
  args: string[],
  {
    debug = false,
    input,
    timeout,
  }: {
    debug?: boolean
    input?: string
    timeout?: number
  } = {}
)

Source from the content-addressed store, hash-verified

67}
68
69export async function npxShadcn(
70 cwd: string,
71 args: string[],
72 {
73 debug = false,
74 input,
75 timeout,
76 }: {
77 debug?: boolean
78 input?: string
79 timeout?: number
80 } = {}
81) {
82 const result = await runCommand(cwd, args, {
83 env: {
84 REGISTRY_URL: getRegistryUrl(),
85 SHADCN_TEMPLATE_DIR: TEMPLATES_DIR,
86 },
87 input,
88 timeout,
89 })
90
91 if (debug) {
92 console.log(result)
93 }
94
95 return result
96}
97
98export function cssHasProperties(
99 cssContent: string,

Callers 12

init.test.tsFile · 0.90
createInitializedProjectFunction · 0.90
apply.test.tsFile · 0.90
view.test.tsFile · 0.90
registries.test.tsFile · 0.90
add.test.tsFile · 0.90
runSearchFunction · 0.90
search.test.tsFile · 0.90

Calls 2

runCommandFunction · 0.85
getRegistryUrlFunction · 0.85

Tested by 6

createInitializedProjectFunction · 0.72
runSearchFunction · 0.72