shadcn 4.0.2-beta.0 → 4.0.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/LICENSE.md +21 -0
- package/dist/index.js +1 -1
- package/package.json +20 -20
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 shadcn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -155,4 +155,4 @@ args = ["shadcn@${xe}", "mcp"]`),b.break(),b.info("3. Restart Codex to load the
|
|
|
155
155
|
`).map(x=>{if(x.trim().startsWith("import "))return x;let v=x;return v=v.replace(/\b(asChild\s*\?\s*)Slot(\s*:)/g,"$1__SLOT_PLACEHOLDER__$2"),v=v.replace(/\bReact\.ComponentProps<typeof\s+Slot>/g,"React.ComponentProps<typeof __SLOT_PLACEHOLDER__>"),v=v.replace(/\bComponentProps<typeof\s+Slot>/g,"ComponentProps<typeof __SLOT_PLACEHOLDER__>"),v=v.replace(/(<\/?)Slot(\s*\/?>)/g,"$1__SLOT_PLACEHOLDER__$2"),v=v.replace(/\bSlot\b/g,(C,k,S)=>{let j=S.substring(0,k),fe=(j.match(/"/g)||[]).length,pe=(j.match(/'/g)||[]).length;return fe%2!==0||pe%2!==0?C:"__SLOT_PLACEHOLDER__"}),v=v.replace(/__SLOT_PLACEHOLDER__/g,"SlotPrimitive.Slot"),v}).join(`
|
|
156
156
|
`));let h=Array.from(new Set(i));return {content:c,replacedPackages:h}}var As=["sidebar.tsx","pagination.tsx","calendar.tsx"],Ds=`${c$1}/docs/rtl#manual-migration-optional`;async function eo(e,t={}){let r,n;if(t.path){if(n=e.resolvedPaths.cwd,t.path.includes("*"))r=await Zt(t.path,{cwd:n,onlyFiles:true,ignore:["**/node_modules/**"]});else {let f=Z__default.resolve(n,t.path),l=await promises.stat(f).catch(()=>null);if(!l)throw new Error(`File not found: ${t.path}`);if(l.isDirectory())n=f,r=await Zt("**/*.{js,ts,jsx,tsx}",{cwd:n,onlyFiles:true,ignore:["**/node_modules/**"]});else if(l.isFile())r=[t.path];else throw new Error(`Unsupported path type: ${t.path}`)}if(r.length===0)throw new Error(`No files found matching: ${t.path}`)}else {if(!e.resolvedPaths.ui)throw new Error("Could not find a valid `ui` path in your `components.json`. Please provide a path or glob pattern.");n=e.resolvedPaths.ui,r=await Zt("**/*.{js,ts,jsx,tsx}",{cwd:n,onlyFiles:true});}if(!t.yes){let a$1=t.path?t.path:`./${Z__default.relative(e.resolvedPaths.cwd,n)}`,{confirm:f}=await ae({type:"confirm",name:"confirm",initial:true,message:`We will migrate ${a.info(r.length)} file(s) in ${a.info(a$1)} to RTL. Continue?`});f||(b.info("Migration cancelled."),process.exit(0));}let i=w("Updating components.json...").start();try{let a=Z__default.resolve(e.resolvedPaths.cwd,"components.json"),f=JSON.parse(await promises.readFile(a,"utf-8"));f.rtl=!0,await promises.writeFile(a,JSON.stringify(f,null,2)+`
|
|
157
157
|
`),i.succeed("Updated components.json.");}catch{throw i.fail("Failed to update components.json."),new Error("Could not update components.json. Please manually set `rtl: true`.")}let o=w("Migrating files to RTL...").start(),s=0,c=[];if(await Promise.all(r.map(async a=>{o.text=`Migrating ${a}...`;let f=Z__default.join(n,a),l=await promises.readFile(f,"utf-8"),m=await e$1(l,true);m!==l&&(await promises.writeFile(f,m),s++);let d=Z__default.basename(a);As.includes(d)&&c.push(a);})),o.succeed(`Migration complete. ${s} file(s) transformed.`),c.length>0){b.break(),b.warn("The following components may need manual RTL adjustments:");for(let a of c)b.info(` - ${a}`);b.break(),b.info(`See ${a.info(Ds)} for more information.`);}}async function ro(e){let t={};if(!z$1.existsSync(e.cwd)||!z$1.existsSync(Z__default.resolve(e.cwd,"package.json")))return t["1"]=true,{errors:t,config:null};if(!z$1.existsSync(Z__default.resolve(e.cwd,"components.json")))return t["3"]=true,{errors:t,config:null};try{let r=await M$1(e.cwd);return {errors:t,config:r}}catch{b.break(),b.error(`An invalid ${a.info("components.json")} file was found at ${a.info(e.cwd)}.
|
|
158
|
-
Before you can run a migration, you must create a valid ${a.info("components.json")} file by running the ${a.info("init")} command.`),b.error(`Learn more at ${a.info(`${c$1}/docs/components-json`)}.`),b.break(),process.exit(1);}}var no=[{name:"icons",description:"migrate your ui components to a different icon library."},{name:"radix",description:"migrate to radix-ui."},{name:"rtl",description:"migrate your components to support RTL (right-to-left)."}],Ls=z.object({cwd:z.string(),list:z.boolean(),yes:z.boolean(),migration:z.string().refine(e=>e&&no.some(t=>t.name===e),{message:"You must specify a valid migration. Run `shadcn migrate --list` to see available migrations."}).optional(),path:z.string().optional()}),oo=new Command().name("migrate").description("run a migration.").argument("[migration]","the migration to run.").argument("[path]","optional path or glob pattern to migrate.").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-l, --list","list all migrations.",false).option("-y, --yes","skip confirmation prompt.",false).action(async(e,t,r)=>{try{let n=Ls.parse({cwd:Z__default.resolve(r.cwd),migration:e,path:t,list:r.list,yes:r.yes});if(n.list||!n.migration){b.info("Available migrations:");for(let s of no)b.info(`- ${s.name}: ${s.description}`);return}if(!n.migration)throw new Error("You must specify a migration. Run `shadcn migrate --list` to see available migrations.");let{errors:i,config:o}=await ro(n);if(i["1"]||i["3"])throw new Error("No `components.json` file found. Ensure you are at the root of your project.");if(!o)throw new Error("Something went wrong reading your `components.json` file. Please ensure you have a valid `components.json` file.");n.migration==="icons"&&await Zn(o),n.migration==="radix"&&await Qn(o,{yes:n.yes,path:n.path}),n.migration==="rtl"&&await eo(o,{yes:n.yes,path:n.path});}catch(n){b.break(),_$1(n);}});var Us=z.object({cwd:z.string(),silent:z.boolean()}),so=new Command().name("add").description("add registries to your project").argument("[registries...]","registries (@namespace) or registry URLs (@namespace=url)").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-s, --silent","mute output.",false).action(async(e,t)=>{try{let r=Us.parse({cwd:Z__default.resolve(t.cwd),silent:t.silent}),n=e.length>0?e:await Gs({silent:r.silent});await Bs(n,r.cwd,{silent:r.silent});}catch(r){b.break(),_$1(r);}});function zs(e){let[t,...r]=e.split("="),n=r.length>0?r.join("="):void 0;if(!t.startsWith("@"))throw new Error(`Invalid registry namespace: ${a.info(t)}. Registry names must start with @ (e.g., @acme).`);return {namespace:t,url:n}}function nr(e,t,r){return `${e} ${e===1?t:r}`}async function Bs(e,t,r){let n=Z__default.resolve(t,"components.json");if(!z$1.existsSync(n))throw new Error(`No ${a.info("components.json")} found. Run ${a.info("shadcn init")} first.`);let i=e.map(zs),o=i.filter(g=>!g.url),s=[];if(o.length>0){let g=w("Fetching registries.",{silent:r.silent}).start(),w$1=await la();if(!w$1)throw g.fail(),new Error("Failed to fetch registries.");g.succeed(),s=w$1;}let c={};for(let{namespace:g,url:w}of i){if(g in d){b.warn(`${a.info(g)} is a built-in registry and cannot be added.`);continue}if(w){if(!w.includes("{name}"))throw new Error(`Invalid registry URL for ${a.info(g)}. URL must include {name} placeholder. Example: ${a.info(`${g}=https://example.com/r/{name}.json`)}`);c[g]=w;}else {let x=s.find(v=>v.name===g);if(!x)throw new Error(`Registry ${a.info(g)} not found. Provide a URL: ${a.info(`${g}=https://.../{name}.json`)}`);c[g]=x.url;}}if(Object.keys(c).length===0)return {addedRegistries:[]};let a$1=await z$1.readJson(n),f=a$1.registries||{},l={},m=[];for(let[g,w]of Object.entries(c))f[g]?m.push(g):l[g]=w;if(Object.keys(l).length===0){if(m.length>0&&!r.silent){w(`Skipped ${nr(m.length,"registry","registries")}: (already configured)`,{silent:r.silent})?.info();for(let g of m)b.log(` - ${g}`);}else r.silent||b.info("No new registries to add.");return}let d$1={...a$1,registries:{...f,...l}},h=w("Updating components.json.",{silent:r.silent}).start();if(await z$1.writeJson(n,d$1,{spaces:2}),h.succeed(),!r.silent){let g=Object.keys(l);w(`Added ${nr(g.length,"registry","registries")}:`,{silent:r.silent})?.succeed();for(let w of g)b.log(` - ${w}`);if(m.length>0){w(`Skipped ${nr(m.length,"registry","registries")}: (already configured)`,{silent:r.silent})?.info();for(let w of m)b.log(` - ${w}`);}}}async function Gs(e){let t=w("Fetching registries.",{silent:e.silent}).start(),r=await la();if(!r)throw t.fail(),new Error("Failed to fetch registries.");t.succeed();let n=[...r].sort((o,s)=>o.name.localeCompare(s.name)),{selected:i}=await ae({type:"autocompleteMultiselect",name:"selected",message:"Which registries would you like to add?",hint:"Space to select. A to toggle all. Enter to submit.",instructions:false,choices:n.map(o=>({title:o.name,description:o.description,value:o.name}))});return i?.length||(b.warn("No registries selected. Exiting."),b.info(""),process.exit(1)),i}var ao=new Command().name("registry").description("manage registries").addCommand(so);var Ys=z.object({cwd:z.string(),query:z.string().optional(),limit:z.number().optional(),offset:z.number().optional()}),fo=new Command().name("search").alias("list").description("search items from registries").argument("<registries...>","the registry names or urls to search items from. Names must be prefixed with @.").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-q, --query <query>","query string").option("-l, --limit <number>","maximum number of items to display per registry","100").option("-o, --offset <number>","number of items to skip","0").action(async(e,t)=>{try{let r=Ys.parse({cwd:Z__default.resolve(t.cwd),query:t.query,limit:t.limit?parseInt(t.limit,10):void 0,offset:t.offset?parseInt(t.offset,10):void 0});await K(r.cwd);let n=S({style:"new-york",resolvedPaths:{cwd:r.cwd}}),i=T(n),o=Z__default.resolve(r.cwd,"components.json");if(z$1.existsSync(o)){let l=await z$1.readJson(o),m=c.partial().parse(l);i=T({...n,...m});}let s=i;try{let l=await M$1(r.cwd);l&&(s=T(l));}catch{}let{config:c$1,newRegistries:a}=await _(e.map(l=>`${l}/registry`),s,{silent:!0,writeFile:!1});a.length>0&&(s.registries=c$1.registries),V(e,s);let f=await ua(e,{query:r.query,limit:r.limit,offset:r.offset,config:s});console.log(JSON.stringify(f,null,2)),process.exit(0);}catch(r){_$1(r);}finally{U();}});var qs=z.object({cwd:z.string()}),go=new Command().name("view").description("view items from the registry").argument("<items...>","the item names or URLs to view").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).action(async(e,t)=>{try{let r=qs.parse({cwd:Z__default.resolve(t.cwd)});await K(r.cwd);let n=T({}),i=Z__default.resolve(r.cwd,"components.json");if(z$1.existsSync(i)){let f=await z$1.readJson(i),l=c.partial().parse(f);n=T(l);}let o=n;try{let f=await M$1(r.cwd);f&&(o=T(f));}catch{}let{config:s,newRegistries:c$1}=await _(e,o,{silent:!0,writeFile:!1});c$1.length>0&&(o.registries=s.registries),V(e,o);let a=await aa(e,{config:o});console.log(JSON.stringify(a,null,2)),process.exit(0);}catch(r){_$1(r);}finally{U();}});var ho={version:"4.0.2
|
|
158
|
+
Before you can run a migration, you must create a valid ${a.info("components.json")} file by running the ${a.info("init")} command.`),b.error(`Learn more at ${a.info(`${c$1}/docs/components-json`)}.`),b.break(),process.exit(1);}}var no=[{name:"icons",description:"migrate your ui components to a different icon library."},{name:"radix",description:"migrate to radix-ui."},{name:"rtl",description:"migrate your components to support RTL (right-to-left)."}],Ls=z.object({cwd:z.string(),list:z.boolean(),yes:z.boolean(),migration:z.string().refine(e=>e&&no.some(t=>t.name===e),{message:"You must specify a valid migration. Run `shadcn migrate --list` to see available migrations."}).optional(),path:z.string().optional()}),oo=new Command().name("migrate").description("run a migration.").argument("[migration]","the migration to run.").argument("[path]","optional path or glob pattern to migrate.").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-l, --list","list all migrations.",false).option("-y, --yes","skip confirmation prompt.",false).action(async(e,t,r)=>{try{let n=Ls.parse({cwd:Z__default.resolve(r.cwd),migration:e,path:t,list:r.list,yes:r.yes});if(n.list||!n.migration){b.info("Available migrations:");for(let s of no)b.info(`- ${s.name}: ${s.description}`);return}if(!n.migration)throw new Error("You must specify a migration. Run `shadcn migrate --list` to see available migrations.");let{errors:i,config:o}=await ro(n);if(i["1"]||i["3"])throw new Error("No `components.json` file found. Ensure you are at the root of your project.");if(!o)throw new Error("Something went wrong reading your `components.json` file. Please ensure you have a valid `components.json` file.");n.migration==="icons"&&await Zn(o),n.migration==="radix"&&await Qn(o,{yes:n.yes,path:n.path}),n.migration==="rtl"&&await eo(o,{yes:n.yes,path:n.path});}catch(n){b.break(),_$1(n);}});var Us=z.object({cwd:z.string(),silent:z.boolean()}),so=new Command().name("add").description("add registries to your project").argument("[registries...]","registries (@namespace) or registry URLs (@namespace=url)").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-s, --silent","mute output.",false).action(async(e,t)=>{try{let r=Us.parse({cwd:Z__default.resolve(t.cwd),silent:t.silent}),n=e.length>0?e:await Gs({silent:r.silent});await Bs(n,r.cwd,{silent:r.silent});}catch(r){b.break(),_$1(r);}});function zs(e){let[t,...r]=e.split("="),n=r.length>0?r.join("="):void 0;if(!t.startsWith("@"))throw new Error(`Invalid registry namespace: ${a.info(t)}. Registry names must start with @ (e.g., @acme).`);return {namespace:t,url:n}}function nr(e,t,r){return `${e} ${e===1?t:r}`}async function Bs(e,t,r){let n=Z__default.resolve(t,"components.json");if(!z$1.existsSync(n))throw new Error(`No ${a.info("components.json")} found. Run ${a.info("shadcn init")} first.`);let i=e.map(zs),o=i.filter(g=>!g.url),s=[];if(o.length>0){let g=w("Fetching registries.",{silent:r.silent}).start(),w$1=await la();if(!w$1)throw g.fail(),new Error("Failed to fetch registries.");g.succeed(),s=w$1;}let c={};for(let{namespace:g,url:w}of i){if(g in d){b.warn(`${a.info(g)} is a built-in registry and cannot be added.`);continue}if(w){if(!w.includes("{name}"))throw new Error(`Invalid registry URL for ${a.info(g)}. URL must include {name} placeholder. Example: ${a.info(`${g}=https://example.com/r/{name}.json`)}`);c[g]=w;}else {let x=s.find(v=>v.name===g);if(!x)throw new Error(`Registry ${a.info(g)} not found. Provide a URL: ${a.info(`${g}=https://.../{name}.json`)}`);c[g]=x.url;}}if(Object.keys(c).length===0)return {addedRegistries:[]};let a$1=await z$1.readJson(n),f=a$1.registries||{},l={},m=[];for(let[g,w]of Object.entries(c))f[g]?m.push(g):l[g]=w;if(Object.keys(l).length===0){if(m.length>0&&!r.silent){w(`Skipped ${nr(m.length,"registry","registries")}: (already configured)`,{silent:r.silent})?.info();for(let g of m)b.log(` - ${g}`);}else r.silent||b.info("No new registries to add.");return}let d$1={...a$1,registries:{...f,...l}},h=w("Updating components.json.",{silent:r.silent}).start();if(await z$1.writeJson(n,d$1,{spaces:2}),h.succeed(),!r.silent){let g=Object.keys(l);w(`Added ${nr(g.length,"registry","registries")}:`,{silent:r.silent})?.succeed();for(let w of g)b.log(` - ${w}`);if(m.length>0){w(`Skipped ${nr(m.length,"registry","registries")}: (already configured)`,{silent:r.silent})?.info();for(let w of m)b.log(` - ${w}`);}}}async function Gs(e){let t=w("Fetching registries.",{silent:e.silent}).start(),r=await la();if(!r)throw t.fail(),new Error("Failed to fetch registries.");t.succeed();let n=[...r].sort((o,s)=>o.name.localeCompare(s.name)),{selected:i}=await ae({type:"autocompleteMultiselect",name:"selected",message:"Which registries would you like to add?",hint:"Space to select. A to toggle all. Enter to submit.",instructions:false,choices:n.map(o=>({title:o.name,description:o.description,value:o.name}))});return i?.length||(b.warn("No registries selected. Exiting."),b.info(""),process.exit(1)),i}var ao=new Command().name("registry").description("manage registries").addCommand(so);var Ys=z.object({cwd:z.string(),query:z.string().optional(),limit:z.number().optional(),offset:z.number().optional()}),fo=new Command().name("search").alias("list").description("search items from registries").argument("<registries...>","the registry names or urls to search items from. Names must be prefixed with @.").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).option("-q, --query <query>","query string").option("-l, --limit <number>","maximum number of items to display per registry","100").option("-o, --offset <number>","number of items to skip","0").action(async(e,t)=>{try{let r=Ys.parse({cwd:Z__default.resolve(t.cwd),query:t.query,limit:t.limit?parseInt(t.limit,10):void 0,offset:t.offset?parseInt(t.offset,10):void 0});await K(r.cwd);let n=S({style:"new-york",resolvedPaths:{cwd:r.cwd}}),i=T(n),o=Z__default.resolve(r.cwd,"components.json");if(z$1.existsSync(o)){let l=await z$1.readJson(o),m=c.partial().parse(l);i=T({...n,...m});}let s=i;try{let l=await M$1(r.cwd);l&&(s=T(l));}catch{}let{config:c$1,newRegistries:a}=await _(e.map(l=>`${l}/registry`),s,{silent:!0,writeFile:!1});a.length>0&&(s.registries=c$1.registries),V(e,s);let f=await ua(e,{query:r.query,limit:r.limit,offset:r.offset,config:s});console.log(JSON.stringify(f,null,2)),process.exit(0);}catch(r){_$1(r);}finally{U();}});var qs=z.object({cwd:z.string()}),go=new Command().name("view").description("view items from the registry").argument("<items...>","the item names or URLs to view").option("-c, --cwd <cwd>","the working directory. defaults to the current directory.",process.cwd()).action(async(e,t)=>{try{let r=qs.parse({cwd:Z__default.resolve(t.cwd)});await K(r.cwd);let n=T({}),i=Z__default.resolve(r.cwd,"components.json");if(z$1.existsSync(i)){let f=await z$1.readJson(i),l=c.partial().parse(f);n=T(l);}let o=n;try{let f=await M$1(r.cwd);f&&(o=T(f));}catch{}let{config:s,newRegistries:c$1}=await _(e,o,{silent:!0,writeFile:!1});c$1.length>0&&(o.registries=s.registries),V(e,o);let a=await aa(e,{config:o});console.log(JSON.stringify(a,null,2)),process.exit(0);}catch(r){_$1(r);}finally{U();}});var ho={version:"4.0.2"};process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function Qs(){let e=new Command().name("shadcn").description("build your component library").version(ho.version,"-v, --version","display the version number");e.addCommand(Cn).addCommand(Dn).addCommand(zn).addCommand(Bn).addCommand(go).addCommand(fo).addCommand(oo).addCommand(Hn).addCommand(Wn).addCommand(qt).addCommand(ao),e.parse();}Qs();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shadcn",
|
|
3
|
-
"version": "4.0.2
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Add components to your apps.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -60,24 +60,6 @@
|
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
"bin": "./dist/index.js",
|
|
63
|
-
"scripts": {
|
|
64
|
-
"dev": "tsup --watch",
|
|
65
|
-
"build": "tsup",
|
|
66
|
-
"typecheck": "tsc --noEmit",
|
|
67
|
-
"clean": "rimraf dist && rimraf components",
|
|
68
|
-
"start:dev": "cross-env REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates node dist/index.js",
|
|
69
|
-
"start:prod": "cross-env REGISTRY_URL=https://ui.shadcn.com/r node dist/index.js",
|
|
70
|
-
"start": "node dist/index.js",
|
|
71
|
-
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
|
|
72
|
-
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache",
|
|
73
|
-
"release": "changeset version",
|
|
74
|
-
"pub:beta": "pnpm build && pnpm publish --no-git-checks --access public --tag beta",
|
|
75
|
-
"pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next",
|
|
76
|
-
"pub:release": "pnpm build && pnpm publish --access public",
|
|
77
|
-
"test": "vitest run",
|
|
78
|
-
"test:dev": "REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates vitest run",
|
|
79
|
-
"mcp:inspect": "pnpm dlx @modelcontextprotocol/inspector node dist/index.js mcp"
|
|
80
|
-
},
|
|
81
63
|
"dependencies": {
|
|
82
64
|
"@antfu/ni": "^25.0.0",
|
|
83
65
|
"@babel/core": "^7.28.0",
|
|
@@ -124,5 +106,23 @@
|
|
|
124
106
|
"tsup": "^8.5.0",
|
|
125
107
|
"type-fest": "^4.41.0",
|
|
126
108
|
"typescript": "^5.9.2"
|
|
109
|
+
},
|
|
110
|
+
"scripts": {
|
|
111
|
+
"dev": "tsup --watch",
|
|
112
|
+
"build": "tsup",
|
|
113
|
+
"typecheck": "tsc --noEmit",
|
|
114
|
+
"clean": "rimraf dist && rimraf components",
|
|
115
|
+
"start:dev": "cross-env REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates node dist/index.js",
|
|
116
|
+
"start:prod": "cross-env REGISTRY_URL=https://ui.shadcn.com/r node dist/index.js",
|
|
117
|
+
"start": "node dist/index.js",
|
|
118
|
+
"format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache",
|
|
119
|
+
"format:check": "prettier --check \"**/*.{ts,tsx,mdx}\" --cache",
|
|
120
|
+
"release": "changeset version",
|
|
121
|
+
"pub:beta": "pnpm build && pnpm publish --no-git-checks --access public --tag beta",
|
|
122
|
+
"pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next",
|
|
123
|
+
"pub:release": "pnpm build && pnpm publish --access public",
|
|
124
|
+
"test": "vitest run",
|
|
125
|
+
"test:dev": "REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates vitest run",
|
|
126
|
+
"mcp:inspect": "pnpm dlx @modelcontextprotocol/inspector node dist/index.js mcp"
|
|
127
127
|
}
|
|
128
|
-
}
|
|
128
|
+
}
|