simpyui 0.2.2 → 0.2.3

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{existsSync as Y,mkdirSync as de,writeFileSync as me,readFileSync as fe}from"node:fs";import{join as M,dirname as ue}from"node:path";import{existsSync as g,readFileSync as B,writeFileSync as J,mkdirSync as se}from"node:fs";import{execSync as ie}from"node:child_process";import{join as a,dirname as re}from"node:path";var l=e=>`\x1B[1m${e}\x1B[0m`,f=e=>`\x1B[32m${e}\x1B[0m`,r=e=>`\x1B[36m${e}\x1B[0m`,S=e=>`\x1B[33m${e}\x1B[0m`,u=e=>`\x1B[31m${e}\x1B[0m`,t=e=>`\x1B[2m${e}\x1B[0m`;var W="components.json";function h(){let e=process.cwd();return g(a(e,"next.config.js"))||g(a(e,"next.config.mjs"))||g(a(e,"next.config.ts"))?"nextjs":g(a(e,"vite.config.js"))||g(a(e,"vite.config.ts"))||g(a(e,"vite.config.mjs"))?"vite":"unknown"}function U(){switch(h()){case"nextjs":return{componentDir:"components/ui",utilsDir:"lib",typescript:!0};case"vite":return{componentDir:"src/components/ui",utilsDir:"src/lib",typescript:!0};default:return{componentDir:"src/components/ui",utilsDir:"src/lib",typescript:!0}}}function F(){let e=a(process.cwd(),W);if(!g(e))return null;try{let o=JSON.parse(B(e,"utf-8"));if(!o.utilsDir){let n=h();o.utilsDir=n==="nextjs"?"lib":"src/lib"}return o}catch{return null}}function T(e){let o=a(process.cwd(),W);J(o,JSON.stringify(e,null,2)+`
2
+ import{existsSync as Y,mkdirSync as de,writeFileSync as me,readFileSync as fe}from"node:fs";import{join as M,dirname as ue}from"node:path";import{existsSync as g,readFileSync as B,writeFileSync as J,mkdirSync as se}from"node:fs";import{execSync as ie}from"node:child_process";import{join as a,dirname as re}from"node:path";var l=e=>`\x1B[1m${e}\x1B[0m`,f=e=>`\x1B[32m${e}\x1B[0m`,r=e=>`\x1B[36m${e}\x1B[0m`,S=e=>`\x1B[33m${e}\x1B[0m`,u=e=>`\x1B[31m${e}\x1B[0m`,t=e=>`\x1B[2m${e}\x1B[0m`;var W="components.json";function h(){let e=process.cwd();return g(a(e,"next.config.js"))||g(a(e,"next.config.mjs"))||g(a(e,"next.config.ts"))?"nextjs":g(a(e,"vite.config.js"))||g(a(e,"vite.config.ts"))||g(a(e,"vite.config.mjs"))?"vite":"unknown"}function U(){switch(h()){case"nextjs":return{componentDir:"src/components/ui",utilsDir:"src/lib",typescript:!0};case"vite":return{componentDir:"src/components/ui",utilsDir:"src/lib",typescript:!0};default:return{componentDir:"src/components/ui",utilsDir:"src/lib",typescript:!0}}}function F(){let e=a(process.cwd(),W);if(!g(e))return null;try{let o=JSON.parse(B(e,"utf-8"));if(!o.utilsDir){let n=h();o.utilsDir="src/lib"}return o}catch{return null}}function T(e){let o=a(process.cwd(),W);J(o,JSON.stringify(e,null,2)+`
3
3
  `)}function ce(){return g(a(process.cwd(),"package.json"))}function O(){ce()||(console.log(u(" \u2717 No package.json found in current directory.")),console.log(),console.log(t(" Run this inside a React project:")),console.log(r(" npx create-next-app@latest my-app")),console.log(t(" or")),console.log(r(" npm create vite@latest my-app")),console.log(),process.exit(1));let e=F();if(!e){let o=h(),n=U();return console.log(t(` Detected ${o==="nextjs"?"Next.js":o==="vite"?"Vite":"React"} project`)),console.log(t(" Creating components.json with defaults:")),console.log(t(` components \u2192 ${n.componentDir}`)),console.log(t(` utils \u2192 ${n.utilsDir}`)),console.log(t(` typescript \u2192 ${n.typescript}`)),console.log(),T(n),n}return e}var le=`import { clsx, type ClassValue } from "clsx"
4
4
  import { twMerge } from "tailwind-merge"
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simpyui",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "CLI to add SimpyUI components to your project",
5
5
  "type": "module",
6
6
  "bin": {