untitledui 0.1.28 → 0.1.30
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/index.mjs +24 -24
- package/package.json +3 -8
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as n3}from"commander";import r0 from"async-retry";import N from"chalk";import{Command as
|
|
3
|
-
`),process.exit(1)},i0=new
|
|
2
|
+
import{Command as n3}from"commander";import r0 from"async-retry";import N from"chalk";import{Command as v3}from"commander";import{execa as K0}from"execa";import*as F from"fs";import Z0 from"ora";import R3 from"os";import*as D from"path";import $0 from"prompts";import{Project as u3}from"ts-morph";import h0 from"node-fetch";import{Readable as q3,pipeline as X3}from"stream";import{x as B3}from"tar";import{promisify as U3}from"util";var b3=U3(X3);async function f0(Q,W){try{let z=await J3(W);await b3(z,B3({cwd:Q,strip:1}))}catch(z){throw new Error(`Failed to download or extract repository from API: ${z instanceof Error?z.message:z}`)}}async function J3(Q){let W=`https://www.untitledui.com/react/api/download-repo?template=${Q.template}`;try{let z=await h0(W,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/octet-stream"}});if(z.status===403||z.status===404)throw new Error("Repository not found");if(!z.ok)throw new Error(`Failed to download from API. Status: ${z.status} ${z.statusText}`);if(!z.body)throw new Error("Response body is empty");return q3.from(z.body)}catch(z){throw new Error(`Error downloading tarball: ${z instanceof Error?z.message:z}`)}}async function i(Q){let W=`https://www.untitledui.com/react/api/validate-key?key=${Q}`;try{return(await h0(W)).status===200}catch{return!1}}import K3 from"node-fetch";var m0={invalid_key:"Invalid key provided",no_components_found:"No components found",no_components_provided:"No components provided"};async function I0(Q,W,z){try{let Z=await K3("https://www.untitledui.com/react/api/components",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({type:Q,components:W,key:z})});if(!Z.ok)console.log(m0?.[Z.statusText]||m0.no_components_found),process.exit(1);return await Z.json()}catch(Z){return null}}import N0 from"node-fetch";var p={invalid_key:"Invalid key provided",no_components_found:"No components found",no_components_provided:"No components provided"};async function c0(Q,W=""){let z=`https://www.untitledui.com/react/api/components/list?key=${W}&type=${Q}`;try{let X=await N0(z),Z=await X.json();if(!X.ok)console.log(p?.[X.statusText]||p.no_components_found),process.exit(1);if(!Z?.components?.length)return null;return Z}catch(X){return console.error(X),null}}async function l0(Q,W="",z){let X=`https://www.untitledui.com/react/api/components/list?key=${W}&type=${Q}&subfolders=${z.join(",")}`;try{let Z=await N0(X);if(!Z.ok)console.log(p?.[Z.statusText]||p.no_components_found),process.exit(1);let b=await Z.json();if(!b?.components?.length)return null;return b}catch(Z){return console.error(Z),null}}async function a0(Q=""){let W=`https://www.untitledui.com/react/api/components/list?key=${Q}`;try{let z=await N0(W);if(!z.ok)console.log(p?.[z.statusText]||p.no_components_found),process.exit(1);let X=await z.json();if(!X?.types?.length)return null;return X}catch(z){return console.error(z),null}}import j3 from"fast-glob";import*as E0 from"path";import{Project as V1}from"ts-morph";import{loadConfig as G3}from"tsconfig-paths";import $1 from"prettier";import b0 from"fast-glob";import*as B0 from"fs";import*as U0 from"path";import{loadConfig as V3}from"tsconfig-paths";var h=["**/node_modules/**",".next","public","dist","build"],s0={"next-app":"Next.js (App)","next-pages":"Next.js (Pages)",vite:"Vite",other:"Other"};async function o(Q){let W=B0.existsSync(U0.resolve(Q,"src")),z=B0.existsSync(U0.resolve(Q,`${W?"src/":""}app`)),[X,Z,b,L]=await Promise.all([b0.glob("**/{next,vite,astro}.config.*|gatsby-config.*",{cwd:Q,deep:2,ignore:h}),L3(Q),M3(Q),H3(Q)]),H={framework:"other",isTsx:Z,tailwindFile:b||null,aliasPrefix:L,isSrcDir:W,isUsingAppDir:z};if(X.find((V)=>V.startsWith("next.config."))?.length)return H.framework=z?"next-app":"next-pages",H;else if(X.find((V)=>V.startsWith("vite.config."))?.length)return H.framework="vite",H;else if(X?.length||B0.existsSync(U0.resolve(Q,"package.json")))return H.framework="other",H;return null}async function L3(Q){return(await b0.glob("tsconfig.*",{cwd:Q,deep:2,ignore:h})).length>0}async function M3(Q){let W=await b0.glob("tailwind.config.*",{cwd:Q,deep:2,ignore:h});if(!W.length)return null;return W[0]}async function H3(Q){let W=await V3(Q);if(W?.resultType==="failed"||!Object.keys(W.paths).length)return null;let z={};for(let[X,Z]of Object.entries(W.paths)){let b=X.replace(/\/\*$/,"/");if(Z.some((L)=>L.includes("/app/*")))z.appPrefix=b;else if(Z.some((L)=>L.includes("/components/*")))z.componentsPrefix=b;else if(Z.some((L)=>L.includes("/utils/*")))z.utilsPrefix=b;else if(Z.some((L)=>L.includes("/styles/*")))z.stylesPrefix=b;else if(Z.some((L)=>L.includes("./*")||L.includes("/src/*")))z.srcPrefix=b}return z||null}function t(Q){let W=G3(Q),z=j3.sync(["tailwind.config.*","**/globals.css","**/{layout,_app,main}.tsx","package.json"],{cwd:Q,deep:4,absolute:!0,onlyFiles:!0,ignore:h}),X={tailwindFile:z.find((Z)=>Z.includes("tailwind.config.")),cssFile:z.find((Z)=>Z.includes("globals.css")),layoutFile:z.find((Z)=>Z.includes("layout")),appFile:z.find((Z)=>Z.includes("_app")),mainFile:z.find((Z)=>Z.includes("main")),packageJson:z.find((Z)=>Z.includes("package.json")),tsConfig:W?.resultType==="success"?W?.configFileAbsolutePath:void 0};if(W.resultType==="failed")throw new Error(`Failed to load tsconfig.json. ${W.message??""}`.trim());return X}function e(Q,W,z={},X=""){if(Q.includes("components")){if(z?.componentsPrefix)return Q.replace(/@\/components\//,E0.posix.join(z?.componentsPrefix,W?W.replace(/components\//,""):"","/"));if(W){let Z=z?.srcPrefix?E0.posix.join(z?.srcPrefix,W,"/"):X;return Q.replace(/@\/components\//,Z)}}if(Q.includes("app")&&z?.appPrefix)return Q.replace(/^@\/app\//,z?.appPrefix);if(Q.includes("utils")&&z?.utilsPrefix)return Q.replace(/^@\/utils\//,z?.utilsPrefix);if(Q.includes("styles")&&z?.stylesPrefix)return Q.replace(/^@\/styles\//,z?.stylesPrefix);if(z?.srcPrefix)return Q.replace(/^@\//,z?.srcPrefix);return Q}function C(){if("bun/1.2.15 npm/? node/v22.6.0 darwin arm64".startsWith("yarn"))return"yarn";if("bun/1.2.15 npm/? node/v22.6.0 darwin arm64".startsWith("pnpm"))return"pnpm";if("bun/1.2.15 npm/? node/v22.6.0 darwin arm64".startsWith("bun"))return"bun";return"npm"}function z0(){switch(C()){case"yarn":return"yarn";case"pnpm":return"pnpx";case"bun":return"bunx";default:return"npx"}}function n0(){switch(C()){case"yarn":return"yarn dev";case"pnpm":return"pnpm dev";case"bun":return"bun dev";default:return"npm run dev"}}function J0(Q){return Q.replace(/^[ \t]*\/\/\s*(TODO:|collapse-(start|end)).*\r?\n?|[ \t]*{\s*\/\*\s*(TODO:|collapse-(start|end)).*?\*\/\s*}\r?\n?/gm,"")}var I3=D.join(R3.homedir(),".untitledui"),c=D.join(I3,"config.json"),U={components:[],path:"",type:void 0,license:""};if(F.existsSync(c)){let Q=JSON.parse(F.readFileSync(c,"utf-8"));U.license=Q.license}var V0=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
|
|
3
|
+
`),process.exit(1)},i0=new v3().name("add").description("add a component to your project").argument("[components...]","the components to add").option("-a, --all","add all available components",!1).option("-o, --overwrite","overwrite existing files.",!1).option("-p, --path <path>","the path to add the component to.").option("-d, --dir <directory>","the directory where the project is located.").option("-t, --type <base|marketing|shared-assets|application|foundations>","the type of the component to add.").action(async(Q,W)=>{if(Q)U.components=Q;if(W)U.all=W.all,U.dir=W.dir,U.path=W.path,U.overwrite=W.overwrite,U.license=W.license||U.license;try{await A0(U)}catch(z){console.error(N.red(z))}});async function A0(Q){if(Q)U={...U,...Q};let W=Z0().start(),z=D.posix.join(process.cwd(),U.dir||"");if(!F.existsSync(D.resolve(z,"package.json")))W.warn("This command should be run in a project directory."),process.exit(1);let Z=await o(z);if(U.license){if(!await i(U.license))W.fail("Invalid license key"),process.exit(1);if(!F.existsSync(c)){let q=D.dirname(c);F.mkdirSync(q,{recursive:!0}),F.writeFileSync(c,JSON.stringify({license:U.license},null,2))}if(JSON.parse(F.readFileSync(c,"utf-8")).license!==U.license)F.writeFileSync(c,JSON.stringify({license:U.license},null,2),"utf-8")}W.stop();let b=[];if(U.components.length){let $=await I0(U.type,U.components,U.license);if($&&$.pro&&$.pro.length>0){if(console.log(),$.pro.length===1){let Y=$.pro[0]?.split("/")[1]||$.pro[0];console.log(N.yellow(`\uD83D\uDD12 The ${N.cyan(Y)} component requires PRO access.`))}else console.log(N.yellow("\uD83D\uDD12 The following components require PRO access:")),$.pro.forEach((Y)=>{let q=Y?.split("/")[1]||Y;console.log(` • ${N.cyan(q)}`)});console.log(),console.log("To access PRO components:"),console.log(` ${N.green("→")} If you've already purchased: ${N.cyan(`${z0()} untitledui@latest login`)}`),console.log(` ${N.green("→")} To purchase PRO components: ${N.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(!$?.components.length)console.log("No components found"),process.exit(1);b.push(...$.components)}if(!U?.type&&!U?.components.length){let $=await a0(U.license);if(!$)console.log("No component types found"),process.exit(1);let Y=await $0({type:"select",name:"type",onState:V0,message:`What type of ${N.cyan("component")} are you adding?`,choices:$?.types.map((q)=>({title:q,value:q}))});U.type=Y.type}if(!U?.path){let $=await $0({type:"text",name:"path",onState:V0,message:`Where would you like to add the ${N.cyan("components")}?`,initial:"components"});U.path=$.path}if(!U?.components.length){let $=await c0(U?.type,U.license);if(!$)console.log("No components found"),process.exit(1);let Y=await $0({type:"multiselect",name:"components",onState:V0,message:`Which ${N.cyan("components")} would you like to add?`,choices:$?.components?.map((K)=>({title:K?.name+(K?.count?` (${K?.count} variants)`:"")||"example",value:K||"example",selected:U.components.includes(K.name)})),instructions:!1,hint:"- Space to select. Return to submit"});if(!Y.components||!Y.components.length)console.log("No option selected. Exiting..."),process.exit(1);let q=Y.components.filter((K)=>K?.type==="file").map((K)=>K.name),J=Y.components.filter((K)=>K?.type==="dir").map((K)=>K.name),S=[];if(J.length){let K=await l0(U?.type,U.license,J);if(K&&K.components.length)for(let x of K.components){let[I,g]=Object.entries(x)[0]||[],u=await $0({type:"select",name:"component",onState:V0,message:`Which ${N.cyan("variant")} from ${N.cyan(I)} would you like to add?`,choices:g?.map((A)=>({title:A?.name||"example",value:A?.name||"example",selected:U.components.includes(A.name)})),instructions:!1,hint:"- Space to select. Return to submit"});if(!u.component)console.log("No variant selected for "+N.cyan(I));S.push(I+"/"+u.component)}else console.log("No variants found")}U.components=[...S,...q]}if(!U.components?.length)W.warn("No components selected. Exiting."),process.exit(1);let L=t(z),H=new Set,V=new Set,E=new Set,T=new u3({tsConfigFilePath:L?.tsConfig});if(U.type&&U.components.length){let $=await I0(U.type,U.components,U.license);if(!$?.components.length)console.log("No components found"),process.exit(1);b.push(...$.components)}if(b.forEach(($)=>{let Y=Z0(`Adding ${$.name}...`).start(),q=$.files;$.dependencies.forEach((J)=>V.add(J)),$.devDependencies.forEach((J)=>E.add(J));try{if(q?.forEach(async({path:J,code:S})=>{let K=D.posix.join(z,`${Z?.isSrcDir&&"src"}`,J.replace(/components\//,U.path+"/")),x=Z?.framework==="vite"?S.replace(`"use client";
|
|
4
4
|
|
|
5
|
-
`,""):S,I=J0(x),g=D.dirname(K);if(F.existsSync(K)&&!
|
|
6
|
-
Failed to add the component ${N.red($.name)}`),console.error(N.red(J)),process.exit(1)}}),H.size&&!
|
|
7
|
-
Following files already exist in the directory.`),H.forEach((Y)=>{console.log(N.green(`- ${D.relative(z,Y.path)}`))}),(await $0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let Y=Z0("Overwriting files").start();H.forEach((q)=>{let J=D.relative(D.resolve(z,`${Z?.isSrcDir&&"src"}`,
|
|
5
|
+
`,""):S,I=J0(x),g=D.dirname(K);if(F.existsSync(K)&&!U.overwrite){if(F.readFileSync(K,"utf-8")!==I)H.add({code:I,path:K})}else{F.mkdirSync(g,{recursive:!0}),F.writeFileSync(K,I);let u=D.relative(D.resolve(z,`${Z?.isSrcDir&&"src"}`,U.path),K).split("/").length,A=u===1?"./":"../".repeat(u-1),k=T.addSourceFileAtPath(D.resolve(K));k.getImportDeclarations().forEach((P)=>{let Y0=P.getModuleSpecifierValue();P.setModuleSpecifier(e(Y0,U.path,Z?.aliasPrefix,A))}),await k.save()}}),H.size)Y.warn(`Some files of ${N.yellow($.name)} already exist`);else Y.succeed(`${N.green($.name)} is added successfully`)}catch(J){Y.fail(`
|
|
6
|
+
Failed to add the component ${N.red($.name)}`),console.error(N.red(J)),process.exit(1)}}),H.size&&!U?.overwrite)if(console.log(`
|
|
7
|
+
Following files already exist in the directory.`),H.forEach((Y)=>{console.log(N.green(`- ${D.relative(z,Y.path)}`))}),(await $0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let Y=Z0("Overwriting files").start();H.forEach((q)=>{let J=D.relative(D.resolve(z,`${Z?.isSrcDir&&"src"}`,U.path),q.path).split("/").length,S=J===1?"./":"../".repeat(J-1),K=T.addSourceFileAtPath(D.resolve(q.path));K.replaceWithText(q.code),K.getImportDeclarations().forEach((x)=>{let I=x.getModuleSpecifierValue();x.setModuleSpecifier(e(I,U.path,Z?.aliasPrefix,S))}),K.saveSync()}),Y.succeed("Files are overwritten")}else console.log(`Use ${N.cyan("--overwrite")} or ${N.cyan("-o")} to overwrite existing files, or refer to the documentation ${N.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`),process.exit(1);let R=C();if(V?.size){let $=Z0("Installing component dependencies").start();await r0(()=>K0(R,[R==="npm"?"install":"add",...V],{cwd:z}).catch(async(Y)=>{if(Y.message.includes("peer"))$.warn("Component dependencies conflict detected. Retrying with --legacy-peer-deps..."),$.start("Installing component dependencies with --legacy-peer-deps flag"),await K0(R,[R==="npm"?"install":"add",...V,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),$.succeed("Component dependencies are installed")}if(E?.size){let $=Z0("Installing component devDependencies").start();await r0(()=>K0(R,[R==="npm"?"install":"add","-D",...E],{cwd:z}).catch(async(Y)=>{if(Y.message.includes("peer"))$.warn("Component devDependencies conflict detected. Retrying with --legacy-peer-deps..."),$.start("Installing component devDependencies with --legacy-peer-deps flag"),await K0(R,[R==="npm"?"install":"add","-D",...E,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),$.succeed("Component devDependencies are installed")}if(U.message)console.log(U.message);process.exit(0)}import D0 from"chalk";import{Command as _3}from"commander";import*as f from"fs";import y3 from"http";import D3 from"open";import w3 from"ora";import T3 from"os";import*as T0 from"path";import{URL as S3}from"url";import*as L0 from"fs";import*as l from"path";import{fileURLToPath as N3}from"url";var E3=N3(import.meta.url),_0=l.dirname(E3);function A3(){let Q=[l.join(_0,"..","templates","auth-template.html"),l.join(_0,"templates","auth-template.html"),l.join(process.cwd(),"node_modules","untitledui","templates","auth-template.html"),l.join(_0,"..","..","templates","auth-template.html")];for(let W of Q)if(L0.existsSync(W))return W;throw new Error("Auth template file not found. Please ensure the CLI package is properly installed.")}function p0(){try{let Q=A3();return L0.readFileSync(Q,"utf-8")}catch(Q){return console.warn("Warning: Using fallback auth template. Some styling may be missing."),`<!doctype html>
|
|
8
8
|
<html lang="en">
|
|
9
9
|
<head>
|
|
10
10
|
<meta charset="UTF-8" />
|
|
@@ -50,29 +50,29 @@ Following files already exist in the directory.`),H.forEach((Y)=>{console.log(N.
|
|
|
50
50
|
{{AUTO_CLOSE_SCRIPT}}
|
|
51
51
|
</div>
|
|
52
52
|
</body>
|
|
53
|
-
</html>`}}function o0(){return p0().replace("{{TITLE}}","Authentication successful").replace("{{HEADING}}","Authentication successful").replace("{{DESCRIPTION}}","You can now close this tab and return to your terminal.").replace("{{AUTO_CLOSE_SCRIPT}}","<script>setTimeout(() => window.close(), 10000);</script>")}function M0(Q){return p0().replace("{{TITLE}}","Authentication failed").replace("{{HEADING}}","Authentication failed").replace("{{DESCRIPTION}}",Q).replace("{{AUTO_CLOSE_SCRIPT}}","")}var w0=T0.join(T3.homedir(),".untitledui"),
|
|
54
|
-
✨ You can now access PRO components with the CLI!`)),process.exit(0)}catch(W){Q.fail(`Authentication failed: ${W instanceof Error?W.message:W}`),process.exit(1)}});async function x3(Q){return new Promise((W,z)=>{let X=
|
|
53
|
+
</html>`}}function o0(){return p0().replace("{{TITLE}}","Authentication successful").replace("{{HEADING}}","Authentication successful").replace("{{DESCRIPTION}}","You can now close this tab and return to your terminal.").replace("{{AUTO_CLOSE_SCRIPT}}","<script>setTimeout(() => window.close(), 10000);</script>")}function M0(Q){return p0().replace("{{TITLE}}","Authentication failed").replace("{{HEADING}}","Authentication failed").replace("{{DESCRIPTION}}",Q).replace("{{AUTO_CLOSE_SCRIPT}}","")}var w0=T0.join(T3.homedir(),".untitledui"),y0=T0.join(w0,"config.json"),t0=new _3().name("login").description("authenticate with Untitled UI to access PRO components").action(async()=>{let Q=w3("Starting authentication...").start();try{await x3(Q),Q.succeed("Authentication completed successfully!"),console.log(D0.green(`
|
|
54
|
+
✨ You can now access PRO components with the CLI!`)),process.exit(0)}catch(W){Q.fail(`Authentication failed: ${W instanceof Error?W.message:W}`),process.exit(1)}});async function x3(Q){return new Promise((W,z)=>{let X=y3.createServer((Z,b)=>{let L=new S3(Z.url,"http://localhost");if(L.pathname==="/callback"){let H=L.searchParams.get("apiKey"),V=L.searchParams.get("error");if(V){b.writeHead(400,{"Content-Type":"text/html"}),b.end(M0(decodeURIComponent(V))),X.close(),z(new Error(decodeURIComponent(V)));return}if(!H){b.writeHead(400,{"Content-Type":"text/html"}),b.end(M0("No Access Token received")),X.close(),z(new Error("No Access Token received"));return}try{C3(H),b.writeHead(200,{"Content-Type":"text/html"}),b.end(o0()),X.close(),W()}catch(E){b.writeHead(500,{"Content-Type":"text/html"}),b.end(M0("Failed to save authentication data")),X.close(),z(E)}}else b.writeHead(404),b.end("Not found")});X.listen(0,"localhost",()=>{let L=`https://www.untitledui.com/react/api/cli-auth?port=${X.address().port}`;Q.text="Opening browser for authentication...",D3(L).catch((H)=>{console.log(D0.yellow(`
|
|
55
55
|
Failed to open browser automatically: ${H.message}`)),console.log(D0.cyan(`Please manually open: ${L}
|
|
56
|
-
`))}),Q.text="Waiting for authentication in browser..."}),setTimeout(()=>{X.close(),z(new Error("Authentication timeout. Please try again."))},300000)})}function C3(Q){if(!f.existsSync(w0))f.mkdirSync(w0,{recursive:!0});let W={};if(f.existsSync(
|
|
57
|
-
`),process.exit(1)},Z3=new k3().name("init").description("initialize a new project or adjust an existing one").argument("[directory]").usage("[directory] [options]").helpOption("-h, --help","display this help message.").option("--vite","initialize a Vite project.",!1).option("--next","initialize a Next.js project.",!1).option("-o, --overwrite","overwrite existing files.",!1).option("--colors-list","show the colors list.",!1).option("-c, --color <color-name>","specify a color for the project.").action(async(Q,W)=>{if(Q)d=Q;if(W){if(j.color=W.color,j.template=W.template,j.overwrite=W.overwrite,j.colorsList=W.colorsList,j.license=W.license||j.license,j.vite=W.vite,j.next=W.next,W.vite)j.framework=W3;if(W.next)j.framework=Y3}try{await P0(W),process.exit(0)}catch(z){console.error(
|
|
58
|
-
Creating a new project in ${
|
|
56
|
+
`))}),Q.text="Waiting for authentication in browser..."}),setTimeout(()=>{X.close(),z(new Error("Authentication timeout. Please try again."))},300000)})}function C3(Q){if(!f.existsSync(w0))f.mkdirSync(w0,{recursive:!0});let W={};if(f.existsSync(y0))try{W=JSON.parse(f.readFileSync(y0,"utf-8"))}catch{W={}}W.license=Q,f.writeFileSync(y0,JSON.stringify(W,null,2),"utf-8")}import g0 from"async-retry";import M from"chalk";import{Command as f3}from"commander";import{execa as u0}from"execa";import*as w from"fs";import X0 from"ora";import m3 from"os";import*as G from"path";import n from"prompts";import{Project as c3}from"ts-morph";import F3 from"node-fetch";async function H0(Q,W){try{let X=await F3("https://www.untitledui.com/react/api/components/example",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({example:Q,key:W})});if(!X.ok){if(X.status===401||X.status===403)return{type:"error",status:X.status,message:"PRO access required"};return console.error(`API error: ${X.status} - ${X.statusText}`),null}return await X.json()}catch(X){return console.error(X?.message||"Error fetching example data."),null}}import q0 from"async-retry";import _ from"chalk";import{Command as k3}from"commander";import{execa as a}from"execa";import v0 from"fast-glob";import y from"fs";import Q0 from"ora";import P3 from"os";import*as v from"path";import R0 from"prompts";import{Project as g3}from"ts-morph";import{fileURLToPath as O3}from"url";import*as j0 from"fs";import*as e0 from"path";function S0(Q,W){let z=e0.join(Q,"package.json");if(!j0.existsSync(z))return W;let X=JSON.parse(j0.readFileSync(z,"utf-8")),Z={...X.dependencies,...X.devDependencies},b=[];for(let L of W){let H=Z[L];if(!H){b.push(L);continue}if(L==="tailwindcss"){let V=H.match(/\d+/);if((V?parseInt(V[0],10):0)<4)b.push(L)}}return b}import x0 from"chalk";import*as m from"fs";import*as G0 from"path";function C0(Q){if(!m.existsSync(G0.resolve(Q)))console.log(x0.red(`Error: CSS file not found at ${Q}`)),process.exit(1);let W=m.readFileSync(G0.resolve(Q),"utf-8"),z=/(--color-[a-zA-Z-]+-\d{1,3}):\s*(rgb\([^)]+\))/g,X={},Z;while((Z=z.exec(W))!==null)if(Z[1]&&Z[2])X[Z[1]]=Z[2];return X}function F0(Q,W,z){let X=G0.resolve(z);if(!m.existsSync(X)){console.log(x0.red(`Error: CSS file not found at ${X}`));return}let Z=m.readFileSync(X,"utf-8"),b=C0(z),L={},H={};for(let[E,T]of Object.entries(b))if(E.startsWith(`--color-${Q}-`)){let R=E.replace(`--color-${Q}-`,"");L[R]=E}else if(E.startsWith(`--color-${W}-`)){let R=E.replace(`--color-${W}-`,"");H[R]=T}let V=!1;for(let[E,T]of Object.entries(L))if(H[E]){let R=H[E],$=new RegExp(`(${T}):\\s*rgb\\([^)]*\\);?`,"g");if($.test(Z))Z=Z.replace($,`$1: ${R};`),V=!0;else console.log(x0.yellow(`No match found for ${T}`))}if(V)m.writeFileSync(X,Z,"utf-8")}var d3=O3(import.meta.url),z3=v.dirname(d3),h3=v.join(P3.homedir(),".untitledui"),s=v.join(h3,"config.json"),W3="vite",Y3="nextjs",Q3={[Y3]:"Next.js",[W3]:"Vite"},d="",j={color:"",template:"",framework:void 0};if(y.existsSync(s)){let Q=JSON.parse(y.readFileSync(s,"utf-8"));j.license=Q.license}var k0=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
|
|
57
|
+
`),process.exit(1)},Z3=new k3().name("init").description("initialize a new project or adjust an existing one").argument("[directory]").usage("[directory] [options]").helpOption("-h, --help","display this help message.").option("--vite","initialize a Vite project.",!1).option("--next","initialize a Next.js project.",!1).option("-o, --overwrite","overwrite existing files.",!1).option("--colors-list","show the colors list.",!1).option("-c, --color <color-name>","specify a color for the project.").action(async(Q,W)=>{if(Q)d=Q;if(W){if(j.color=W.color,j.template=W.template,j.overwrite=W.overwrite,j.colorsList=W.colorsList,j.license=W.license||j.license,j.vite=W.vite,j.next=W.next,W.vite)j.framework=W3;if(W.next)j.framework=Y3}try{await P0(W),process.exit(0)}catch(z){console.error(_.red(z)),process.exit(1)}});async function P0(Q,W=null){let z=process.cwd(),X=y.existsSync(v.resolve(z,"package.json")),Z=v.resolve(v.join(z3,"../config/styles","theme.css")),b=C0(Z??""),L=Array.from(new Set(Object.keys(b).map(($)=>$?.split("--color-")?.[1]?.replace(/-\d{1,3}/,"")))),H=Q0().start(),V=await o(z),E=X?v0.sync(["**/**/theme.css"],{cwd:z,absolute:!0,onlyFiles:!0,ignore:h}):[],T=E?.[0]&&y.readFileSync(E[0],"utf-8").match(/(--color-brand+-\d{1,3}):\s*(rgb\([^)]+\))/g)?.[1]||void 0;if(j.license){if(!await i(j.license))H.fail("Invalid license key"),process.exit(1);if(!y.existsSync(s)){let q=v.dirname(s);y.mkdirSync(q,{recursive:!0}),y.writeFileSync(s,JSON.stringify({license:j.license},null,2))}if(JSON.parse(y.readFileSync(s,"utf-8")).license!==j.license)y.writeFileSync(s,JSON.stringify({license:j.license},null,2))}if(!X){if(H.stop(),!d){let $=await R0({onState:k0,type:"text",name:"path",message:"What is your project named?",initial:"untitled-ui"});if(typeof $.path==="string")d=$.path.trim()}if(W)W.projectPath=d;if(y.existsSync(v.resolve(v.posix.join(z,d))))H.fail(_.red("Directory already exists!")),process.exit(1);if(j.vite&&j.next||!j.framework){let $=await R0({type:"select",name:"framework",onState:k0,message:`Which ${_.cyan("framework")} would you like to use?`,choices:Object.entries(Q3).map(([Y,q])=>({title:q,value:Y}))});j.framework=$.framework}H.succeed("Framework is selected: "+_.green(Q3[j.framework]))}else if(V?.framework==="other")H.fail("Unsupported project framework"),console.log(`Please refer to the documentation ${_.cyan("https://www.untitled.com/docs")} for supported frameworks or proceed with manual installation.`),process.exit(1);else if(V?.framework.startsWith("next")||V?.framework.startsWith("vite"))if(!W&&!T)H.succeed(_.yellow(`Detected ${s0[V.framework]} project, proceeding with the setup...`));else H.stop();if(j.colorsList||!j.color&&!T){let $=await R0({type:"select",name:"color",onState:k0,initial:Q.color??"",message:`Which ${_.cyan("color")} would you like to use as the ${_.cyanBright("brand")} color?`,choices:L.map((Y)=>({title:Y,value:Y}))});j.color=$.color}let R=v.posix.join(z,d||"");if(d&&!X){let $=v.resolve(d);console.log(`
|
|
58
|
+
Creating a new project in ${_.blue(d)}`);let Y=Q0("Downloading and extracting the repository...").start();try{y.mkdirSync($,{recursive:!0}),await q0(()=>f0($,{template:j.framework}),{retries:2}),Y.succeed("Files are downloaded and extracted successfully!");let q=Q0({text:"Installing dependencies..."}).start(),J=v0.sync(["**/styles/theme.css"],{cwd:$,absolute:!0,onlyFiles:!0})[0];if(F0("brand",j.color||"",J??""),await q0(()=>a(C(),["install"],{cwd:R}).catch(async(S)=>{if(S.message.includes("peer"))q.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),q.start("Installing dependencies with --legacy-peer-deps flag"),await a(C(),["install","--legacy-peer-deps"],{cwd:R})}),{retries:1}),await q0(()=>a("git",["init"],{cwd:R}),{retries:1}),q.succeed("Dependencies are installed"),!W)console.log(`
|
|
59
59
|
Your project is ready, to get started run the following commands:
|
|
60
60
|
|
|
61
|
-
cd ${
|
|
62
|
-
${
|
|
61
|
+
cd ${_.cyan(d)}
|
|
62
|
+
${_.cyan(n0())}`)}catch(q){if(Y.fail(_.red(`
|
|
63
63
|
Failed to download and extract the repository`)),q instanceof Error)console.error(q.message);else console.error(`
|
|
64
|
-
`);
|
|
65
|
-
`),$.fail("Following files already exist in the directory."),Y.forEach((A)=>{console.log(`- ${
|
|
64
|
+
`);y.rmdirSync($,{recursive:!0}),process.exit(1)}}else{let $=Q0(),Y=new Set,q=t(z),J=v.resolve(v.join(z3,"../config")),S=v0.sync(["**"],{cwd:J,onlyFiles:!0,ignore:h}),K=S0(z,["tailwindcss","tailwindcss-animate","@tailwindcss/typography","tailwindcss-react-aria-components"]),x=S0(z,["@tailwindcss/postcss","postcss"]);if(!W&&!T)$.start("Copying files to the project directory");if(S.forEach((u)=>{let A=u.includes("postcss.config"),k=v.resolve(v.posix.join(J),u),P=v.resolve(z,A?u:`${V?.isSrcDir?"src":""}/${u}`);if(y.existsSync(P)){if(j?.overwrite)y.copyFileSync(k,P);else{let Y0=y.readFileSync(P,"utf-8"),O=y.readFileSync(k,"utf-8");if(Y0!==O){if(u.endsWith("theme.css")&&T)return;Y.add({targetFile:P,sourceFile:k})}}return}y.mkdirSync(v.dirname(P),{recursive:!0}),y.writeFileSync(P,""),y.copyFileSync(k,P)}),$.stop(),Y.size&&!j?.overwrite)if(console.log(`
|
|
65
|
+
`),$.fail("Following files already exist in the directory."),Y.forEach((A)=>{console.log(`- ${_.green(A.targetFile)}`)}),(await R0({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let A=Q0("Overwriting files").start();Y.forEach((k)=>{y.copyFileSync(k.sourceFile,k.targetFile)}),A.succeed("Files are overwritten")}else console.log(`Use ${_.cyan("--overwrite")} or ${_.cyan("-o")} to overwrite existing files, or refer to the documentation ${_.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`);if(q?.tailwindFile)console.log(`
|
|
66
66
|
Tailwind config file exists in the project directory. You can add it to your globals.css as follows:`),console.log(`
|
|
67
|
-
${
|
|
67
|
+
${_.cyan(`@config "../${V?.isSrcDir&&"../"}${v.relative(z,q.tailwindFile)}";`)}
|
|
68
68
|
`);let I=q?.layoutFile||q?.appFile||V?.framework==="vite"&&q?.mainFile||"";if(!I)console.log(`Import following files to your main file:
|
|
69
|
-
`),S.forEach((
|
|
70
|
-
Ensure that the ${
|
|
71
|
-
Your project is ready, you can now start adding components.`)}}var l3=
|
|
72
|
-
`),process.exit(1)},$3=new f3().name("example").description("add an example to the project").argument("[example]","the example to add").option("-o, --overwrite","overwrite existing files.",!1).option("-p, --path <path>","the path to add the component to.").option("-e, --example-path <example-path>","the path to add the example file to.").action(async(Q,W)=>{if(Q)
|
|
69
|
+
`),S.forEach((u)=>{console.log(_.cyan(u))});else{let A=new g3({tsConfigFilePath:v.resolve(q?.tsConfig||"")}).addSourceFileAtPath(v.resolve(I)),k="globals.css";A.getImportDeclarations().filter((O)=>O.getModuleSpecifierValue().includes("globals.css")).forEach((O)=>O.remove());let P=v.relative(v.resolve(z,`${V?.isSrcDir&&"src"}`),I).split("/").length,Y0=V?.aliasPrefix?.stylesPrefix||V?.aliasPrefix?.srcPrefix||(P===1?"./":"../".repeat(P-1));A.addImportDeclarations(S.filter((O)=>O.includes("globals.css")).map((O)=>({moduleSpecifier:`${Y0}${V?.aliasPrefix?.stylesPrefix?O?.split("styles/")[1]:O}`}))),A.saveSync()}let g=v0.sync(["**/styles/theme.css"],{cwd:z,absolute:!0,onlyFiles:!0,ignore:h});if(!g?.length)return $.fail(`Failed to copy ${_.cyan("theme.css")} file.
|
|
70
|
+
Ensure that the ${_.cyan("theme.css")} file exists in the project directory under ${_.yellow("styles/")} folder.`);if((j.color||!T)&&F0("brand",j.color||"brand",g[0]??""),K.length||x.length){let u=Q0().start("Installing dependencies");K.length&&await q0(()=>a(C(),[C()==="npm"?"install":"add",...K],{cwd:R}).catch(async(A)=>{if(A.message.includes("peer"))u.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),u.start("Installing dependencies with --legacy-peer-deps flag"),await a(C(),[C()==="npm"?"install":"add",...K,"--legacy-peer-deps"],{cwd:R})}),{retries:1}),x.length&&await q0(()=>a(C(),[C()==="npm"?"install":"add","-D",...x],{cwd:R}).catch(async(A)=>{if(A.message.includes("peer"))u.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),u.start("Installing dependencies with --legacy-peer-deps flag"),await a(C(),[C()==="npm"?"install":"add","-D",...x,"--legacy-peer-deps"],{cwd:R})}),{retries:1}),u.succeed("Dependencies are installed")}if(!W&&!T)$.succeed(_.green("Project setup is completed!"));if(W&&X)return;else console.log(`
|
|
71
|
+
Your project is ready, you can now start adding components.`)}}var l3=G.join(m3.homedir(),".untitledui"),r=G.join(l3,"config.json"),B={path:"",example:"",license:"",components:[]},O0={};if(w.existsSync(r)){let Q=JSON.parse(w.readFileSync(r,"utf-8"));B.license=Q.license}var W0=(Q)=>{if(Q.aborted)process.stdout.write("\x1B[?25h"),process.stdout.write(`
|
|
72
|
+
`),process.exit(1)},$3=new f3().name("example").description("add an example to the project").argument("[example]","the example to add").option("-o, --overwrite","overwrite existing files.",!1).option("-p, --path <path>","the path to add the component to.").option("-e, --example-path <example-path>","the path to add the example file to.").action(async(Q,W)=>{if(Q)B.example=Q;if(W)B.path=W.path,B.overwrite=W.overwrite,B.examplePath=W.examplePath,B.license=W.license||B.license;try{await P0(W,O0),await a3(B)}catch(z){console.error(M.red(z))}});async function a3(Q){let W=X0().start(),z=G.posix.join(process.cwd(),O0?.projectPath||"");if(!w.existsSync(G.posix.join(G.resolve(z,"package.json"))))W.warn("This command should be run in a project directory."),process.exit(1);let Z=await o(z);if(B.license){if(!await i(B.license))W.fail("Invalid license key"),process.exit(1);if(!w.existsSync(r)){let J=G.dirname(r);w.mkdirSync(J,{recursive:!0}),w.writeFileSync(r,JSON.stringify({license:B.license},null,2))}if(JSON.parse(w.readFileSync(r,"utf-8")).license!==B.license)w.writeFileSync(r,JSON.stringify({license:B.license},null,2),"utf-8")}if(W.stop(),!B.example){let Y=await n({type:"select",name:"example",onState:W0,message:"Select which type of example you want to add",choices:[{title:"Application",value:"application"},{title:"Marketing",value:"marketing"}]});B.example=Y.example}let b=null;if(B.example){let Y=await H0(B.example,B.license);if(Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(M.yellow(`\uD83D\uDD12 The ${M.cyan(B.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${M.green("→")} If you've already purchased: ${M.cyan(`${z0()} untitledui@latest login`)}`),console.log(` ${M.green("→")} To purchase PRO examples: ${M.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1);if(Y?.type==="directory"){let q=await n({type:"select",name:"example",onState:W0,message:`Select a folder or file in "${B.example}"`,choices:Y.results.map((J)=>({title:J,value:J}))});if(!q.example)return;if(B.example=q.example,Y=await H0(q.example,B.license),Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(M.yellow(`\uD83D\uDD12 The ${M.cyan(q.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${M.green("→")} If you've already purchased: ${M.cyan(`${z0()} untitledui@latest login`)}`),console.log(` ${M.green("→")} To purchase PRO examples: ${M.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(Y?.type==="json-files"){let q=await n({type:"select",name:"example",onState:W0,message:`Select which example you want to add from "${B.example}"`,choices:Y.results.map((J)=>({title:J,value:`${B.example}/${J}`}))});if(!q.example)return;if(B.example=q.example,Y=await H0(q.example,B.license),Y?.type==="error"&&(Y.status===401||Y.status===403))console.log(),console.log(M.yellow(`\uD83D\uDD12 The ${M.cyan(q.example)} example requires PRO access.`)),console.log(),console.log("To access PRO examples:"),console.log(` ${M.green("→")} If you've already purchased: ${M.cyan(`${z0()} untitledui@latest login`)}`),console.log(` ${M.green("→")} To purchase PRO examples: ${M.cyan("https://www.untitledui.com/buy/react")}`),console.log(),process.exit(1)}if(Y?.type==="json-file")b=Y.content}if(!b)W.fail("No example found"),process.exit(1);if(!B?.examplePath){let Y=Z?.isUsingAppDir?"app":"pages",q=Z?.isSrcDir?G.posix.join("src",Y):Y,J=await n({type:"text",name:"examplePath",onState:W0,message:`Where would you like to add the ${M.cyan(B?.example)} example?`,initial:q});B.examplePath=J.examplePath}else if(!w.existsSync(G.posix.join(z,B.examplePath)))w.mkdirSync(G.posix.join(z,B.examplePath),{recursive:!0}),console.log(M.green(`Created directory ${B.examplePath}`));if(!B?.path){let Y=await n({type:"text",name:"path",onState:W0,message:`Where would you like to add the ${M.cyan("components")}?`,initial:"components"});B.path=Y.path}let L=b.components.filter((Y)=>!w.existsSync(G.posix.join(z,`${Z?.isSrcDir&&"src"}`,Y?.path?.replace(/components\//,B.path+"/"))));if(L?.length){let Y=await n({type:"multiselect",name:"components",onState:W0,message:`Select which components you want to add from ${M.cyan(b.name)} example`,choices:L.map((q)=>({title:q?.name,value:q?.name,selected:!0})),instructions:!1,hint:"- Space to select. Return to submit"});if(B.components=Y.components,!L.length&&!Y.components?.length)W.warn("No components selected")}let H=t(z),V=new Set,E=new c3({tsConfigFilePath:H?.tsConfig}),T=X0(`Adding ${B?.example}...`).start(),R="";try{if(b.files?.forEach(async({path:Y,code:q})=>{let J=G.posix.join(z,`${Z?.isSrcDir&&"src"}`,Y.replace(/components\//,B.path+"/")),S=Z?.framework==="vite"?q.replace(`"use client";
|
|
73
73
|
|
|
74
|
-
`,""):q,K=J0(S);if(Y.includes("examples")){let I=
|
|
75
|
-
Failed to add the component ${M.red(
|
|
76
|
-
Following files already exist in the directory.`),V.forEach((q)=>{console.log(M.green(`- ${
|
|
77
|
-
\uD83C\uDF89 Example ${M.green(
|
|
78
|
-
\uD83C\uDF89 Example ${M.green(
|
|
74
|
+
`,""):q,K=J0(S);if(Y.includes("examples")){let I=G.basename(Y);J=G.posix.join(z,B?.examplePath??"",I),R=G.posix.join(B?.examplePath??"",I)}let x=G.dirname(J);if(w.existsSync(J)&&!B.overwrite){if(w.readFileSync(J,"utf-8")!==K)V.add({code:K,path:J})}else{w.mkdirSync(x,{recursive:!0}),w.writeFileSync(J,K);let I=G.relative(G.resolve(z,`${Z?.isSrcDir&&"src"}`,B.path),J).split("/").length,g=I===1?"./":"../".repeat(I-1),u=E.addSourceFileAtPath(G.resolve(J));u.getImportDeclarations().forEach((A)=>{let k=A.getModuleSpecifierValue();A.setModuleSpecifier(e(k,B.path,Z?.aliasPrefix,g))}),await u.save()}}),V.size)T.warn(`Some files of ${M.yellow(B?.example)} already exist`);else T.succeed(`${M.green(B?.example)} is added successfully`)}catch(Y){T.fail(`
|
|
75
|
+
Failed to add the component ${M.red(B?.example)}`),console.error(M.red(Y)),process.exit(1)}if(V.size&&!B?.overwrite)if(console.log(`
|
|
76
|
+
Following files already exist in the directory.`),V.forEach((q)=>{console.log(M.green(`- ${G.relative(z,q.path)}`))}),(await n({type:"confirm",name:"overwrite",message:"Do you want to overwrite the existing files?",initial:!0})).overwrite){let q=X0("Overwriting files").start();V.forEach((J)=>{let S=G.relative(G.resolve(z,`${Z?.isSrcDir&&"src"}`,B.path),J.path).split("/").length,K=S===1?"./":"../".repeat(S-1),x=E.addSourceFileAtPath(G.resolve(J.path));x.replaceWithText(J.code),x.getImportDeclarations().forEach((I)=>{let g=I.getModuleSpecifierValue();I.setModuleSpecifier(e(g,B.path,Z?.aliasPrefix,K))}),x.saveSync()}),q.succeed("Files are overwritten")}else console.log(`Use ${M.cyan("--overwrite")} or ${M.cyan("-o")} to overwrite existing files, or refer to the documentation ${M.cyan("https://www.untitled.com/docs")} for manual installation. The rest of the files are added.`),process.exit(1);let $=C();if(b?.dependencies?.length){let Y=X0("Installing example dependencies").start();await g0(()=>u0($,[$==="npm"?"install":"add",...b.dependencies],{cwd:z}).catch(async(q)=>{if(q.message.includes("peer"))Y.warn("Dependency conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing dependencies with --legacy-peer-deps flag"),await u0($,[$==="npm"?"install":"add",...b.dependencies,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),Y.succeed("Example dependencies are installed")}if(b?.devDependencies?.length){let Y=X0("Installing example devDependencies").start();await g0(()=>u0($,[$==="npm"?"install":"add","-D",...b.devDependencies],{cwd:z}).catch(async(q)=>{if(q.message.includes("peer"))Y.warn("DevDependency conflict detected. Retrying with --legacy-peer-deps..."),Y.start("Installing devDependencies with --legacy-peer-deps flag"),await u0($,[$==="npm"?"install":"add","-D",...b.devDependencies,"--legacy-peer-deps"],{cwd:z})}),{retries:1}),Y.succeed("Example devDependencies are installed")}if(B?.components?.length)await g0(()=>A0({components:B.components,dir:O0?.projectPath||"",path:B.path,message:`
|
|
77
|
+
\uD83C\uDF89 Example ${M.green(B.example)} has been added to ${M.green(R)}`}),{retries:1});console.log(`
|
|
78
|
+
\uD83C\uDF89 Example ${M.green(B.example)} has been added to ${M.green(R)}`),process.exit(0)}var d0={name:"untitledui",version:"0.1.30",main:"dist/index.mjs",description:"The Untitled UI CLI tool helps you quickly scaffold projects with Untitled UI React and add components and page examples to your existing projects with an interactive interface in seconds.",type:"module",publishConfig:{access:"public"},scripts:{test:'echo "Error: no test specified" && exit 1',dev:"bun build --entrypoints ./index.ts --entry-naming=[name].mjs --outdir=dist --target=node --minify --packages=external --env=inline --define=process.env.API_URL=http://localhost:3000/react/api --watch",build:"bun build --entrypoints ./index.ts --entry-naming=[name].mjs --outdir=dist --target=node --minify --packages=external --env=inline --define=process.env.API_URL=https://www.untitledui.com/react/api","publish:npm":"bun run build && npm publish --access public",start:"node dist/index.mjs"},bugs:{url:"https://github.com/untitleduico/react/issues"},homepage:"https://github.com/untitleduico/react#readme",keywords:["untitledui","untitled-ui","untitledui","untitledui-cli","untitledui-react","untitledui-components","untitledui-examples","untitledui-vite","untitledui-nextjs","cli","tailwindcss","nextjs","react","components","examples","vite"],files:["dist","config","templates","README.md"],author:{name:"Untitled UI",url:"https://www.untitledui.com/react"},contributors:[{name:"Dilshod Turobov",url:"https://x.com/deebovv"},{name:"Jordan Hughes",url:"https://x.com/jordanphughes"}],license:"MIT",bin:{untitledui:"dist/index.mjs"},exports:"./dist/index.mjs",dependencies:{"async-retry":"^1.3.3",chalk:"^5.4.1",commander:"^13.1.0",execa:"^7.0.0","fast-glob":"^3.3.3","node-fetch":"^3.3.2",open:"^10.1.0",ora:"^8.2.0",prettier:"^3.5.3",prompts:"^2.4.2",tar:"^7.4.3","ts-morph":"^25.0.1","tsconfig-paths":"^4.2.0","update-check":"^1.5.4"},devDependencies:{"@types/async-retry":"^1.4.9","@types/prompts":"^2.4.9","@types/tar":"^6.1.13","type-fest":"^4.37.0",typescript:"^5.8.2"}};process.on("SIGINT",()=>process.exit(0));process.on("SIGTERM",()=>process.exit(0));async function r3(){let Q=new n3().name(d0.name).version(d0.version);Q.addCommand(Z3).addCommand(i0).addCommand($3).addCommand(t0),Q.parse()}r3();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "untitledui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"main": "dist/index.mjs",
|
|
5
5
|
"description": "The Untitled UI CLI tool helps you quickly scaffold projects with Untitled UI React and add components and page examples to your existing projects with an interactive interface in seconds.",
|
|
6
6
|
"type": "module",
|
|
@@ -14,14 +14,10 @@
|
|
|
14
14
|
"publish:npm": "bun run build && npm publish --access public",
|
|
15
15
|
"start": "node dist/index.mjs"
|
|
16
16
|
},
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "https://github.com/untitledui/cli.git"
|
|
20
|
-
},
|
|
21
17
|
"bugs": {
|
|
22
|
-
"url": "https://github.com/
|
|
18
|
+
"url": "https://github.com/untitleduico/react/issues"
|
|
23
19
|
},
|
|
24
|
-
"homepage": "https://github.com/
|
|
20
|
+
"homepage": "https://github.com/untitleduico/react#readme",
|
|
25
21
|
"keywords": [
|
|
26
22
|
"untitledui",
|
|
27
23
|
"untitled-ui",
|
|
@@ -53,7 +49,6 @@
|
|
|
53
49
|
"contributors": [
|
|
54
50
|
{
|
|
55
51
|
"name": "Dilshod Turobov",
|
|
56
|
-
"email": "dilshod@untitledui.com",
|
|
57
52
|
"url": "https://x.com/deebovv"
|
|
58
53
|
},
|
|
59
54
|
{
|