shadcn 4.16.1 → 4.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-UDHSWRLP.js → chunk-4WBGNKSZ.js} +1 -1
- package/dist/{chunk-HHYTEWMD.js → chunk-FWHPVUDH.js} +1 -1
- package/dist/{chunk-MZJVAM2M.js → chunk-Q6Y23SOV.js} +33 -33
- package/dist/index.js +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/registry/index.d.ts +1 -0
- package/dist/registry/index.js +1 -1
- package/dist/schema/index.d.ts +8 -0
- package/dist/schema/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {b as b$2,c as c$4,a as a$5}from'./chunk-3W6BGJGE.js';import {a as a$3}from'./chunk-
|
|
2
|
+
import {b as b$2,c as c$4,a as a$5}from'./chunk-3W6BGJGE.js';import {a as a$3}from'./chunk-FWHPVUDH.js';import {f,e,N as N$1,g,za as za$1,h,i,Ca as Ca$1,a as a$1,Z,Ma as Ma$1,ia,Q,Aa as Aa$1,W,X,C,b as b$1,Y as Y$1,V,La as La$1,oa as oa$1,qa as qa$1,T as T$1,U,R,Ba as Ba$1,_,c as c$2,ka as ka$1,O,na,d,Pa,Qa as Qa$1,Ra as Ra$1,ta,ra,Da as Da$1,ua,H,D,E,G,F,z as z$1,fa as fa$1,Ia,va as va$1,ca as ca$1,P,Wa as Wa$1,Va as Va$1,$,Ta as Ta$1,aa as aa$1,Ua as Ua$1,Xa as Xa$1,ea as ea$1,Ea,Ka as Ka$1,ba as ba$1,wa as wa$1,Ja as Ja$1,pa as pa$1,ha as ha$1,Ga as Ga$1,y,da,q as q$1,S,L as L$1,J,K as K$1,B as B$1,I,M,A,Fa as Fa$1,Ha as Ha$1,j as j$1}from'./chunk-Q6Y23SOV.js';export{ta as fetchTree,ua as getItemTargetPath,ya as getPreset,xa as getPresets,va as getRegistries,ma as getRegistriesConfig,wa as getRegistriesIndex,ja as getRegistry,ra as getRegistryBaseColor,qa as getRegistryBaseColors,pa as getRegistryIcons,ka as getRegistryItems,oa as getRegistryStyles,na as getShadcnRegistryIndex,la as resolveRegistryItems,sa as resolveTree}from'./chunk-Q6Y23SOV.js';import {a,t,b,s,c as c$1,e as e$1,i as i$1,m,n,j,k,f as f$2,r,h as h$1}from'./chunk-2XFBGS5K.js';import {c,f as f$3,n as n$1}from'./chunk-4WBGNKSZ.js';import {a as a$2,c as c$3,g as g$1,d as d$1,f as f$1,e as e$2}from'./chunk-7SBJAAAY.js';import {a as a$4}from'./chunk-CHWMSXYA.js';import*as T from'path';import T__default from'path';import {promises,existsSync}from'fs';import L from'fs-extra';import Hi from'open';import de from'prompts';import qo from'dedent';import Ki,{tmpdir}from'os';import {execa}from'execa';import Yo from'deepmerge';import {Command}from'commander';import $r,{z}from'zod';import {Project,ScriptKind,SyntaxKind,Node}from'ts-morph';import {loadConfig}from'tsconfig-paths';import {diffLines,structuredPatch,diffWords}from'diff';import {dim,yellow,bold,green,cyan,red}from'kleur/colors';import*as Ie from'fs/promises';import Ie__default from'fs/promises';import Pa$1 from'postcss';import {StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import {randomBytes}from'crypto';import jr from'fast-glob';async function zo(e$1){let t={};if(!L.existsSync(e$1.cwd)||!L.existsSync(T__default.resolve(e$1.cwd,"package.json")))return t["1"]=true,{errors:t,projectInfo:null};let r=C("Preflight checks.",{silent:e$1.silent}).start();L.existsSync(T__default.resolve(e$1.cwd,"components.json"))&&!e$1.force&&(r?.fail(),f.break(),f.error(`A ${e.info("components.json")} file already exists at ${e.info(e$1.cwd)}.
|
|
3
3
|
To start over, remove the ${e.info("components.json")} file and run ${e.info("init")} again.`),f.break(),process.exit(1)),r?.succeed();let o=C("Verifying framework.",{silent:e$1.silent}).start(),n=e$1.existingConfig?.tailwind,i$1=await za$1(e$1.cwd,{configCssFile:typeof n?.css=="string"?n.css:void 0});if(!i$1||i$1?.framework.name==="manual"){if(t["7"]=true,o?.fail(),!e$1.monorepo&&await g(e$1.cwd)){let m=await h(e$1.cwd);m.length>0&&(i("init",m),process.exit(1));}f.break(),i$1?.framework.links.installation&&f.error(`We could not detect a supported framework at ${e.info(e$1.cwd)}.
|
|
4
4
|
Visit ${e.info(i$1?.framework.links.installation)} to manually configure your project.
|
|
5
5
|
Once configured, you can use the cli to add components.`),f.break(),process.exit(1);}o?.succeed(`Verifying framework. Found ${e.info(i$1.framework.label)}.`);let s="Validating Tailwind CSS.";i$1.tailwindVersion==="v4"&&(s=`Validating Tailwind CSS. Found ${e.info("v4")}.`);let l=C(s,{silent:e$1.silent}).start();i$1.tailwindVersion==="v3"&&(!i$1?.tailwindConfigFile||!i$1?.tailwindCssFile)?(t["5"]=true,l?.fail()):i$1.tailwindVersion==="v4"&&!i$1?.tailwindCssFile?(t["5"]=true,l?.fail()):i$1.tailwindVersion?l?.succeed():(t["5"]=true,l?.fail());let c=C("Validating import alias.",{silent:e$1.silent}).start();return i$1?.aliasPrefix?c?.succeed():(t["6"]=true,c?.fail()),Object.keys(t).length>0&&(t["5"]&&(f.break(),f.error(`No Tailwind CSS configuration found at ${e.info(e$1.cwd)}.`),f.error("It is likely you do not have Tailwind CSS installed or have an invalid configuration."),f.error("Install Tailwind CSS then try again."),i$1?.framework.links.tailwind&&f.error(`Visit ${e.info(i$1?.framework.links.tailwind)} to get started.`)),t["6"]&&(f.break(),f.error(`Could not find valid path aliases or package imports for ${e.info("init")}.`),f.error(`Configure path aliases in ${e.info("tsconfig.json")} or imports in ${e.info("package.json")}, then run ${e.info("init")} again.`),f.error(`Learn more at ${e.info(`${a$1}/docs/installation/manual#configure-import-aliases`)}.`)),f.break(),process.exit(1)),{errors:t,projectInfo:i$1}}async function Ho(e,t){let r=new Set,o=new Set,n=[...e];for(;n.length>0;){let i=n.shift();if(o.has(i))continue;o.add(i);let{registry:s}=y(i);s&&!b$1[s]&&r.add(s);try{let[l]=await da([i],t,{useCache:!0});if(l?.registryDependencies)for(let c of l.registryDependencies){let{registry:m}=y(c);m&&!b$1[m]&&r.add(m),o.has(c)||n.push(c);}}catch(l){if(l instanceof q$1){let{registry:c}=y(i);c&&!b$1[c]&&r.add(c);continue}continue}}return Array.from(r)}async function B(e,t,r={}){r={silent:false,writeFile:true,...r};let n=(await Ho(e,t)).filter(m=>!t.registries?.[m]&&!Object.keys(b$1).includes(m));if(n.length===0)return {config:t,newRegistries:[]};let i=await wa$1({useCache:process.env.NODE_ENV!=="development"});if(!i)return {config:t,newRegistries:[]};let s={};for(let m of n)i[m]&&(s[m]=i[m]);if(Object.keys(s).length===0)return {config:t,newRegistries:[]};let l=Object.fromEntries(Object.entries(t.registries||{}).filter(([m])=>!Object.keys(b$1).includes(m))),c$1={...t,registries:{...l,...s}};if(r.writeFile){let{resolvedPaths:m,...d}=c$1,p=C("Updating components.json.",{silent:r.silent}).start(),y=c.parse(d);await L.writeFile(T__default.resolve(t.resolvedPaths.cwd,"components.json"),JSON.stringify(y,null,2)+`
|
package/dist/mcp/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as server}from'../chunk-
|
|
1
|
+
export{a as server}from'../chunk-FWHPVUDH.js';import'../chunk-Q6Y23SOV.js';import'../chunk-2XFBGS5K.js';import'../chunk-4WBGNKSZ.js';import'../chunk-7SBJAAAY.js';import'../chunk-CHWMSXYA.js';
|
package/dist/registry/index.d.ts
CHANGED
package/dist/registry/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{x as RegistriesIndexParseError,l as RegistryError,k as RegistryErrorCode,p as RegistryFetchError,o as RegistryForbiddenError,w as RegistryInvalidNamespaceError,u as RegistryItemNotFoundError,r as RegistryLocalFileError,v as RegistryMissingEnvironmentVariablesError,q as RegistryNotConfiguredError,m as RegistryNotFoundError,s as RegistryParseError,n as RegistryUnauthorizedError,t as RegistryValidationError,Sa as addRegistryItems,va as getRegistries,ma as getRegistriesConfig,wa as getRegistriesIndex,ja as getRegistry,ka as getRegistryItems,Na as loadRegistry,Oa as loadRegistryItem,la as resolveRegistryItems,Ua as searchRegistries}from'../chunk-
|
|
1
|
+
export{x as RegistriesIndexParseError,l as RegistryError,k as RegistryErrorCode,p as RegistryFetchError,o as RegistryForbiddenError,w as RegistryInvalidNamespaceError,u as RegistryItemNotFoundError,r as RegistryLocalFileError,v as RegistryMissingEnvironmentVariablesError,q as RegistryNotConfiguredError,m as RegistryNotFoundError,s as RegistryParseError,n as RegistryUnauthorizedError,t as RegistryValidationError,Sa as addRegistryItems,va as getRegistries,ma as getRegistriesConfig,wa as getRegistriesIndex,ja as getRegistry,ka as getRegistryItems,Na as loadRegistry,Oa as loadRegistryItem,la as resolveRegistryItems,Ua as searchRegistries}from'../chunk-Q6Y23SOV.js';import'../chunk-2XFBGS5K.js';import'../chunk-4WBGNKSZ.js';import'../chunk-7SBJAAAY.js';import'../chunk-CHWMSXYA.js';
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -7339,6 +7339,7 @@ declare const registryResolvedItemsTreeSchema: z.ZodObject<Pick<{
|
|
|
7339
7339
|
}>;
|
|
7340
7340
|
declare const searchResultItemSchema: z.ZodObject<{
|
|
7341
7341
|
name: z.ZodString;
|
|
7342
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7342
7343
|
type: z.ZodOptional<z.ZodString>;
|
|
7343
7344
|
description: z.ZodOptional<z.ZodString>;
|
|
7344
7345
|
registry: z.ZodString;
|
|
@@ -7348,12 +7349,14 @@ declare const searchResultItemSchema: z.ZodObject<{
|
|
|
7348
7349
|
name: string;
|
|
7349
7350
|
addCommandArgument: string;
|
|
7350
7351
|
type?: string | undefined;
|
|
7352
|
+
title?: string | undefined;
|
|
7351
7353
|
description?: string | undefined;
|
|
7352
7354
|
}, {
|
|
7353
7355
|
registry: string;
|
|
7354
7356
|
name: string;
|
|
7355
7357
|
addCommandArgument: string;
|
|
7356
7358
|
type?: string | undefined;
|
|
7359
|
+
title?: string | undefined;
|
|
7357
7360
|
description?: string | undefined;
|
|
7358
7361
|
}>;
|
|
7359
7362
|
declare const searchResultErrorSchema: z.ZodObject<{
|
|
@@ -7385,6 +7388,7 @@ declare const searchResultsSchema: z.ZodObject<{
|
|
|
7385
7388
|
}>;
|
|
7386
7389
|
items: z.ZodArray<z.ZodObject<{
|
|
7387
7390
|
name: z.ZodString;
|
|
7391
|
+
title: z.ZodOptional<z.ZodString>;
|
|
7388
7392
|
type: z.ZodOptional<z.ZodString>;
|
|
7389
7393
|
description: z.ZodOptional<z.ZodString>;
|
|
7390
7394
|
registry: z.ZodString;
|
|
@@ -7394,12 +7398,14 @@ declare const searchResultsSchema: z.ZodObject<{
|
|
|
7394
7398
|
name: string;
|
|
7395
7399
|
addCommandArgument: string;
|
|
7396
7400
|
type?: string | undefined;
|
|
7401
|
+
title?: string | undefined;
|
|
7397
7402
|
description?: string | undefined;
|
|
7398
7403
|
}, {
|
|
7399
7404
|
registry: string;
|
|
7400
7405
|
name: string;
|
|
7401
7406
|
addCommandArgument: string;
|
|
7402
7407
|
type?: string | undefined;
|
|
7408
|
+
title?: string | undefined;
|
|
7403
7409
|
description?: string | undefined;
|
|
7404
7410
|
}>, "many">;
|
|
7405
7411
|
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -7418,6 +7424,7 @@ declare const searchResultsSchema: z.ZodObject<{
|
|
|
7418
7424
|
name: string;
|
|
7419
7425
|
addCommandArgument: string;
|
|
7420
7426
|
type?: string | undefined;
|
|
7427
|
+
title?: string | undefined;
|
|
7421
7428
|
description?: string | undefined;
|
|
7422
7429
|
}[];
|
|
7423
7430
|
pagination: {
|
|
@@ -7436,6 +7443,7 @@ declare const searchResultsSchema: z.ZodObject<{
|
|
|
7436
7443
|
name: string;
|
|
7437
7444
|
addCommandArgument: string;
|
|
7438
7445
|
type?: string | undefined;
|
|
7446
|
+
title?: string | undefined;
|
|
7439
7447
|
description?: string | undefined;
|
|
7440
7448
|
}[];
|
|
7441
7449
|
pagination: {
|
package/dist/schema/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{C as configJsonSchema,d as configSchema,t as iconsSchema,B as presetSchema,c as rawConfigSchema,z as registriesIndexSchema,A as registriesSchema,u as registryBaseColorSchema,p as registryChunkSchema,a as registryConfigItemSchema,b as registryConfigSchema,r as registryIndexSchema,m as registryItemCommonSchema,j as registryItemCssSchema,i as registryItemCssVarsSchema,k as registryItemEnvVarsSchema,g as registryItemFileSchema,l as registryItemFontSchema,n as registryItemSchema,h as registryItemTailwindSchema,f as registryItemTypeSchema,o as registryPaginationSchema,v as registryResolvedItemsTreeSchema,q as registrySchema,x as searchResultErrorSchema,w as searchResultItemSchema,y as searchResultsSchema,s as stylesSchema,e as workspaceConfigSchema}from'../chunk-
|
|
1
|
+
export{C as configJsonSchema,d as configSchema,t as iconsSchema,B as presetSchema,c as rawConfigSchema,z as registriesIndexSchema,A as registriesSchema,u as registryBaseColorSchema,p as registryChunkSchema,a as registryConfigItemSchema,b as registryConfigSchema,r as registryIndexSchema,m as registryItemCommonSchema,j as registryItemCssSchema,i as registryItemCssVarsSchema,k as registryItemEnvVarsSchema,g as registryItemFileSchema,l as registryItemFontSchema,n as registryItemSchema,h as registryItemTailwindSchema,f as registryItemTypeSchema,o as registryPaginationSchema,v as registryResolvedItemsTreeSchema,q as registrySchema,x as searchResultErrorSchema,w as searchResultItemSchema,y as searchResultsSchema,s as stylesSchema,e as workspaceConfigSchema}from'../chunk-4WBGNKSZ.js';
|