ui-thing 0.0.24 → 0.0.26

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/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # Changelog
2
2
 
3
+ ## v0.0.26
4
+
5
+ [compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.0.25...v0.0.26)
6
+
7
+ ### 🩹 Fixes
8
+
9
+ - **multiselect:** Change the way css is imported ([c9c37a4](https://github.com/BayBreezy/ui-thing-cli/commit/c9c37a4))
10
+
11
+ ### 🏡 Chore
12
+
13
+ - Update deps ([e1d6110](https://github.com/BayBreezy/ui-thing-cli/commit/e1d6110))
14
+
15
+ ### ❤️ Contributors
16
+
17
+ - BayBreezy <behon.baker@yahoo.com>
18
+
19
+ ## v0.0.25
20
+
21
+ [compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.0.24...v0.0.25)
22
+
23
+ ### 🩹 Fixes
24
+
25
+ - Update logic that determines if the deps should be installed ([ada954a](https://github.com/BayBreezy/ui-thing-cli/commit/ada954a))
26
+
27
+ ### ❤️ Contributors
28
+
29
+ - BayBreezy <behon.baker@yahoo.com>
30
+
3
31
  ## v0.0.24
4
32
 
5
33
  [compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.0.23...v0.0.24)
package/dist/index.js CHANGED
@@ -8809,6 +8809,9 @@ export { toast, useToast };
8809
8809
 
8810
8810
  <script setup lang="ts">
8811
8811
  import Multiselect from "@vueform/multiselect";
8812
+
8813
+ import "@vueform/multiselect/themes/default.css";
8814
+
8812
8815
  import { useId } from "radix-vue";
8813
8816
 
8814
8817
  const multiselect = shallowRef<InstanceType<typeof Multiselect> | null>(null);
@@ -8868,7 +8871,6 @@ export { toast, useToast };
8868
8871
  });
8869
8872
  </script>
8870
8873
 
8871
- <style src="@vueform/multiselect/themes/default.css"></style>
8872
8874
  <style>
8873
8875
  :root {
8874
8876
  --ms-font-size: theme("fontSize.sm");
@@ -9409,7 +9411,7 @@ strict-peer-dependencies=false
9409
9411
  strict-peer-dependencies=false
9410
9412
  `)}else e=(await wp({configFile:dr.replace(".ts","")})).config;return Cp.isEmpty(e)&&await Ie({force:!0}),Ep(e),e},Ep=r=>{r.tailwindCSSLocation&&Se.ensureFileSync(r.tailwindConfigLocation),r.tailwindConfigLocation&&Se.ensureFileSync(r.tailwindCSSLocation),r.componentsLocation&&Se.ensureDirSync(r.componentsLocation),r.composablesLocation&&Se.ensureDirSync(r.composablesLocation),r.utilsLocation&&Se.ensureDirSync(r.utilsLocation)},Pt=(r,n)=>(typeof n=="string"&&(n=[n]),n.forEach(e=>ga(r,e)),r),Tt=async(r,n="nuxt.config.ts")=>{await ma(r.$ast,n)};var $n=async()=>{let r=await Ie(),n={theme:"string",tailwindCSSLocation:"string",tailwindConfigLocation:"string",componentsLocation:"string",composablesLocation:"string",utilsLocation:"string",force:!0,useDefaultFilename:!0,packageManager:"string"},e=[];for(let t of Object.keys(n))r[t]===void 0&&e.push(t);return!(e.length>0)};import hr from"node:fs";var nt=async r=>{try{return await hr.promises.access(r,hr.constants.F_OK||hr.constants.W_OK),!0}catch{return!1}};import*as Wn from"fs";import*as wa from"path";import{execa as fr}from"execa";import qn from"lodash";import Ap from"ora";function kp(){let r=wa.join(process.cwd(),"package.json"),n=!1;if(Wn.existsSync(r)){let e=Wn.readFileSync(r,"utf-8");JSON.parse(e).scripts?.postinstall&&(n=!0)}return n}var Ge=async(r,n,e)=>{typeof n=="string"&&(n=[n]),typeof e=="string"&&(e=[e]);let t=Ap("Installing dependencies...").start();!qn.isUndefined(n)&&!qn.isEmpty(n)&&await fr(r,[r==="yarn"?"add":"install",...n]),t.text="Installing dev dependencies...",!qn.isUndefined(e)&&!qn.isEmpty(e)&&await fr(r,[r==="yarn"?"add":"install","-D",...e]),kp()&&(t.text="Running postinstall script...",await fr(r,["run","postinstall"])),t.succeed("Installed dependencies!")};import Np from"boxen";import Mp from"figlet";var de=(r,n,e)=>{console.log(`
9411
9413
  `),console.log(Np(Mp.textSync(r),{borderColor:"greenBright",padding:1,borderStyle:"round",titleAlignment:"center",...n})),e&&console.log(`
9412
- ${e}`)};import Dp from"prompts";var Ca=async()=>{let{components:r}=await Dp({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:an.map(n=>({title:n.name,value:n.value})),onRender(n){this.msg=n.bgCyan(" Choose components ")+" Select the components you want to add"}});return r};import mr from"node:fs";import Lp from"node:path";var Zt=async(r,n)=>{if(!await nt(r)){let t=Lp.dirname(r);mr.existsSync(t)||mr.mkdirSync(t,{recursive:!0})}mr.writeFileSync(r,n)};var nn=process.cwd(),Hn=r=>an.find(n=>n.value.toLowerCase()===r.toLowerCase()),Sa=new Op().name("add").command("add").description("Add a list of components to your project.").argument("[componentNames...]","Components that you want to add.").action(async r=>{let n=await xt(),e=await Ie();await $n()||(e=await Ie({force:!0})),tn.isEmpty(e)&&(me.info("Config file not set. Exiting..."),process.exit(0));let s=r;if(s.length===0){let p=await Ca();(p&&p.length===0||!p)&&(me.info("No components selected. Exiting..."),process.exit(0)),s=p}let i=[];s.forEach(p=>{Hn(p)||i.push(p)}),i.length>0&&me.error(`The following components were not found: ${oe.bgRed(i.join(", "))}`);let a=[];s.forEach(p=>{Hn(p)&&a.push(Hn(p))});for(let p=0;p<a.length;p++){let u=a[p];if(u.components)for(let h=0;h<u.components.length;h++){let m=u.components[h];a.find(d=>d.value===m)||a.push(Hn(m))}}for(let p=0;p<a.length;p++){let u=a[p];e:for(let h=0;h<u.files.length;h++){let m=u.files[h],d=m.fileName,g=e.componentsLocation,f=en.join(nn,g,d);if(!e.useDefaultFilename){let P=await wt({type:"text",name:"value",message:"Where should we add the file",initial:g,onRender(S){this.msg=S.bgCyan(" Location ")+` Where should we add the file ${S.cyan(`${d}`)} `}});P.value&&(g=P.value,f=en.join(nn,P.value,d))}if(await nt(f)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The file that we are trying to add ${oe.bold(d)} to is already taken. Overwrite?`,initial:!1})).value){me.info(`We will not overwrite the file for ${oe.cyan(d)}`);continue e}await Zt(f,m.fileContent),u.value==="vue-sonner"&&(n.defaultExport.imports||={},n.defaultExport.build||={},n.defaultExport.imports.imports||=[],n.defaultExport.build.transpile||=[],n.defaultExport.imports.imports.find(x=>x.from==="vue-sonner"&&x.name==="toast")||n.defaultExport.imports.imports.push({from:"vue-sonner",name:"toast",as:"useSonner"}),n.defaultExport.build.transpile.find(x=>"vue-sonner")||n.defaultExport.build.transpile.push("vue-sonner")),u.value==="datatable"&&(n.defaultExport.app||={},n.defaultExport.app.head||={},n.defaultExport.app.head.script||=[],n.defaultExport.app.head.script.find(x=>x.src==="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js")||n.defaultExport.app.head.script.push({src:"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js",defer:!0}),n.defaultExport.app.head.script.find(x=>x.src==="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.min.js")||n.defaultExport.app.head.script.push({src:"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.min.js",defer:!0}));t:for(let P=0;P<u.utils.length;P++){let S=u.utils[P],x=en.join(nn,e.utilsLocation,S.fileName);if(await nt(x)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The utils file that we are trying to add ${oe.bold(S.fileName)} already exists. Overwrite?`,initial:!0})).value){me.info(`We will not overwrite the file for ${oe.cyan(S.fileName)}`);continue t}await Zt(x,S.fileContent)}t:for(let P=0;P<u.composables.length;P++){let S=u.composables[P],x=en.join(nn,e.composablesLocation,S.fileName);if(await nt(x)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The composables file that we are trying to add ${oe.bold(S.fileName)} already exists. Overwrite?`,initial:!0})).value){me.info(`We will not overwrite the file for ${oe.cyan(S.fileName)}`);continue t}await Zt(x,S.fileContent)}t:for(let P=0;P<u.plugins.length;P++){let S=u.plugins[P],x=en.join(nn,S.dirPath,S.fileName);if(await nt(x)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The plugins file that we are trying to add ${oe.bold(S.fileName)} already exists. Overwrite?`,initial:!0})).value){me.info(`We will not overwrite the file for ${oe.cyan(S.fileName)}`);continue t}await Zt(x,S.fileContent)}}}Pt(n.nuxtConfig,tn.uniq(a.map(p=>p.nuxtModules||[]).flat())),await Tt(n.nuxtConfig,"nuxt.config.ts");let o=tn.uniq(a.map(p=>p.deps||[]).flat()),l=tn.uniq(a.map(p=>p.devDeps||[]).flat());if(o.length!==0&&l.length!==0){let{confirmInstall:p}=await wt({type:"confirm",name:"confirmInstall",message:`Do you want to install the following packages: ${oe.cyan(o.join(", "))} ${oe.cyan(l.join(", "))}`,initial:!0});p&&await Ge(e.packageManager,o,l)}de("All Done!",{title:"Components Added"},`Run the ${oe.cyan("ui-thing@latest --help")} command to learn more.
9414
+ ${e}`)};import Dp from"prompts";var Ca=async()=>{let{components:r}=await Dp({type:"autocompleteMultiselect",name:"components",message:"Select the components you want to add",choices:an.map(n=>({title:n.name,value:n.value})),onRender(n){this.msg=n.bgCyan(" Choose components ")+" Select the components you want to add"}});return r};import mr from"node:fs";import Lp from"node:path";var Zt=async(r,n)=>{if(!await nt(r)){let t=Lp.dirname(r);mr.existsSync(t)||mr.mkdirSync(t,{recursive:!0})}mr.writeFileSync(r,n)};var nn=process.cwd(),Hn=r=>an.find(n=>n.value.toLowerCase()===r.toLowerCase()),Sa=new Op().name("add").command("add").description("Add a list of components to your project.").argument("[componentNames...]","Components that you want to add.").action(async r=>{let n=await xt(),e=await Ie();await $n()||(e=await Ie({force:!0})),tn.isEmpty(e)&&(me.info("Config file not set. Exiting..."),process.exit(0));let s=r;if(s.length===0){let p=await Ca();(p&&p.length===0||!p)&&(me.info("No components selected. Exiting..."),process.exit(0)),s=p}let i=[];s.forEach(p=>{Hn(p)||i.push(p)}),i.length>0&&me.error(`The following components were not found: ${oe.bgRed(i.join(", "))}`);let a=[];s.forEach(p=>{Hn(p)&&a.push(Hn(p))});for(let p=0;p<a.length;p++){let u=a[p];if(u.components)for(let h=0;h<u.components.length;h++){let m=u.components[h];a.find(d=>d.value===m)||a.push(Hn(m))}}for(let p=0;p<a.length;p++){let u=a[p];e:for(let h=0;h<u.files.length;h++){let m=u.files[h],d=m.fileName,g=e.componentsLocation,f=en.join(nn,g,d);if(!e.useDefaultFilename){let P=await wt({type:"text",name:"value",message:"Where should we add the file",initial:g,onRender(S){this.msg=S.bgCyan(" Location ")+` Where should we add the file ${S.cyan(`${d}`)} `}});P.value&&(g=P.value,f=en.join(nn,P.value,d))}if(await nt(f)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The file that we are trying to add ${oe.bold(d)} to is already taken. Overwrite?`,initial:!1})).value){me.info(`We will not overwrite the file for ${oe.cyan(d)}`);continue e}await Zt(f,m.fileContent),u.value==="vue-sonner"&&(n.defaultExport.imports||={},n.defaultExport.build||={},n.defaultExport.imports.imports||=[],n.defaultExport.build.transpile||=[],n.defaultExport.imports.imports.find(x=>x.from==="vue-sonner"&&x.name==="toast")||n.defaultExport.imports.imports.push({from:"vue-sonner",name:"toast",as:"useSonner"}),n.defaultExport.build.transpile.find(x=>"vue-sonner")||n.defaultExport.build.transpile.push("vue-sonner")),u.value==="datatable"&&(n.defaultExport.app||={},n.defaultExport.app.head||={},n.defaultExport.app.head.script||=[],n.defaultExport.app.head.script.find(x=>x.src==="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js")||n.defaultExport.app.head.script.push({src:"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js",defer:!0}),n.defaultExport.app.head.script.find(x=>x.src==="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.min.js")||n.defaultExport.app.head.script.push({src:"https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.min.js",defer:!0}));t:for(let P=0;P<u.utils.length;P++){let S=u.utils[P],x=en.join(nn,e.utilsLocation,S.fileName);if(await nt(x)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The utils file that we are trying to add ${oe.bold(S.fileName)} already exists. Overwrite?`,initial:!0})).value){me.info(`We will not overwrite the file for ${oe.cyan(S.fileName)}`);continue t}await Zt(x,S.fileContent)}t:for(let P=0;P<u.composables.length;P++){let S=u.composables[P],x=en.join(nn,e.composablesLocation,S.fileName);if(await nt(x)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The composables file that we are trying to add ${oe.bold(S.fileName)} already exists. Overwrite?`,initial:!0})).value){me.info(`We will not overwrite the file for ${oe.cyan(S.fileName)}`);continue t}await Zt(x,S.fileContent)}t:for(let P=0;P<u.plugins.length;P++){let S=u.plugins[P],x=en.join(nn,S.dirPath,S.fileName);if(await nt(x)&&!e.force&&!(await wt({type:"confirm",name:"value",message:`The plugins file that we are trying to add ${oe.bold(S.fileName)} already exists. Overwrite?`,initial:!0})).value){me.info(`We will not overwrite the file for ${oe.cyan(S.fileName)}`);continue t}await Zt(x,S.fileContent)}}}Pt(n.nuxtConfig,tn.uniq(a.map(p=>p.nuxtModules||[]).flat())),await Tt(n.nuxtConfig,"nuxt.config.ts");let o=tn.uniq(a.map(p=>p.deps||[]).flat()),l=tn.uniq(a.map(p=>p.devDeps||[]).flat());if(o.length>0||l.length>0){let{confirmInstall:p}=await wt({type:"confirm",name:"confirmInstall",message:`Do you want to install the following packages: ${oe.cyan(o.join(", "))} ${oe.cyan(l.join(", "))}`,initial:!0});p&&await Ge(e.packageManager,o,l)}de("All Done!",{title:"Components Added"},`Run the ${oe.cyan("ui-thing@latest --help")} command to learn more.
9413
9415
  `);let c=a.map(p=>p.instructions).flat();tn.remove(c,p=>!p),c.length>0&&(console.log(""),console.log(oe.bgCyan(" Instructions ")),c.forEach(p=>{console.log(`${oe.cyan("-")} ${p}`)}))});import{Command as Yp}from"commander";import{defu as br}from"defu";import Na from"fs-extra";import Zp from"kleur";var Fp=`@import url("https://rsms.me/inter/inter.css");
9414
9416
 
9415
9417
  @tailwind base;