Skip to content

Commit 2bb7629

Browse files
committed
fix: build
1 parent 6ad0bc6 commit 2bb7629

File tree

19 files changed

+23
-28
lines changed

19 files changed

+23
-28
lines changed

packages/saas-ui-chakra-preset/src/theme/slot-recipes/sidebar.recipe.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ export const sidebarSlotRecipe = defineSlotRecipe({
8181
fontSize: 'xs',
8282
transitionProperty: 'common',
8383
transitionDuration: 'fast',
84-
// @ts-expect-error
8584
_groupCollapsible: {
8685
cursor: 'button',
8786
userSelect: 'none',
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/usr/bin/env node
2-
import{a as o,b as s}from"./chunk-CZWRGVAR.js";import{proposeCompletions as r}from"@stricli/core";var p=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&p.push("");await r(o,p,s(process));
2+
import{a as o,b as s}from"./chunk-GPLVQ7EL.js";import{proposeCompletions as r}from"@stricli/core";var p=process.argv.slice(3);process.env.COMP_LINE?.endsWith(" ")&&p.push("");await r(o,p,s(process));

packages/saas-ui-cli/lib/chunk-6AJQJYHM.js renamed to packages/saas-ui-cli/lib/chunk-2BSYSWUK.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{b as C,c as L,d as V,e as E,f as R,g as O,h as G,i as Y,j as K}from"./chunk-T2TS6VDY.js";import{a as l,b as r,c as N,e as z,f as B,g as H}from"./chunk-R6YFGHTG.js";import{b as P}from"./chunk-FNCPVRC6.js";import{promises as ae}from"fs";import W from"path";import S from"prompts";import{z as k}from"zod";import F from"fs-extra";import U from"path";import ge from"prompts";import X from"fast-glob";import T from"fs-extra";import _ from"path";import{loadConfig as le}from"tsconfig-paths";var v={"next-app":{name:"next-app",label:"Next.js",links:{installation:"https://saas-ui.dev/docs/core/installation/nextjs-guide"}},"next-pages":{name:"next-pages",label:"Next.js",links:{installation:"https://saas-ui.dev/docs/core/installation/nextjs-pages-guide"}},"tanstack-start":{name:"tanstack-start",label:"Remix",links:{installation:"https://saas-ui.dev/docs/core/installation/tanstack-start-guide"}},vite:{name:"vite",label:"Vite",links:{installation:"https://saas-ui.dev/docs/core/installation/vite-guide"}},manual:{name:"manual",label:"Manual"}};import ce from"fs";import pe from"path";function Q(e="",t=!0){let n=pe.join(e,"package.json"),o=ce.readFileSync(n,"utf8");try{return JSON.parse(o)}catch(i){if(t)throw i}return null}var Z=["**/node_modules/**",".next","public","dist","build"];async function x(e){let[t,n,o,i,a]=await Promise.all([X.glob("**/{next,vite,astro}.config.*|gatsby-config.*|composer.json",{cwd:e,deep:3,ignore:Z}),T.pathExists(_.resolve(e,"src")),ue(e),me(e),Q(e,!1)]),d=await T.pathExists(_.resolve(e,`${n?"src/":""}app`)),p={framework:v.manual,system:null,isSrcDir:n,isRSC:!1,isTsx:o,aliasPrefix:i??null};return Object.keys(a?.dependencies??{}).find(f=>f.startsWith("@chakra-ui/"))&&(p.system=C.chakra),Object.keys(a?.devDependencies??{}).find(f=>f.startsWith("@pandacss/dev"))&&(p.system=C.panda),t.find(f=>f.startsWith("next.config."))?.length?(p.framework=d?v["next-app"]:v["next-pages"],p.isRSC=d,p):Object.keys(a?.dependencies??{}).find(f=>f.startsWith("@tanstack/react-start"))?(p.framework=v["tanstack-start"],p):(t.find(f=>f.startsWith("vite.config."))?.length&&(p.framework=v.vite),p)}async function me(e){let t=await le(e);if(t?.resultType==="failed"||!t?.paths)return null;for(let[n,o]of Object.entries(t.paths))if(o.includes("./*")||o.includes("./src/*")||o.includes("./app/*")||o.includes("./resources/js/*"))return n.at(0)??null;return null}async function ue(e){return(await X.glob("tsconfig.*",{cwd:e,deep:1,ignore:Z})).length>0}async function ee(e=process.cwd()){try{let t=_.resolve(e,"tsconfig.json"),n=await T.readJSON(t);if(!n)throw new Error("tsconfig.json is missing");return n}catch{return null}}async function te(e,t=null){let[n,o]=await Promise.all([R(e),t?Promise.resolve(t):x(e)]);if(n)return n;if(!o)return null;let i={$schema:P,rsc:o.isRSC,tsx:o.isTsx,system:o.system?.name??C.chakra.name,style:"default",aliases:{components:`${o.aliasPrefix}components`,ui:`${o.aliasPrefix}components/ui`,hooks:`${o.aliasPrefix}hooks`,lib:`${o.aliasPrefix}lib`,utils:`${o.aliasPrefix}lib/utils`}};return await O(e,i)}import fe from"ora";function g(e,t){return fe({text:e,isSilent:t?.silent})}async function ne(e){let t={};if(!F.existsSync(e.cwd))return t["1"]=!0,{errors:t,projectInfo:null};let n=g("Preflight checks.",{silent:e.silent}).start();F.existsSync(U.resolve(e.cwd,"components.json"))&&!e.force&&(n?.fail(),r.break(),r.error(`A ${l.info("components.json")} file already exists at ${l.info(e.cwd)}.
1+
import{b as C,c as L,d as V,e as E,f as R,g as O,h as G,i as Y,j as K}from"./chunk-MXTTWN24.js";import{a as l,b as r,c as N,e as z,f as B,g as H}from"./chunk-ORH6WNMM.js";import{b as P}from"./chunk-L2P4AKXB.js";import{promises as ae}from"fs";import W from"path";import S from"prompts";import{z as k}from"zod";import F from"fs-extra";import U from"path";import ge from"prompts";import X from"fast-glob";import T from"fs-extra";import _ from"path";import{loadConfig as le}from"tsconfig-paths";var v={"next-app":{name:"next-app",label:"Next.js",links:{installation:"https://saas-ui.dev/docs/core/installation/nextjs-guide"}},"next-pages":{name:"next-pages",label:"Next.js",links:{installation:"https://saas-ui.dev/docs/core/installation/nextjs-pages-guide"}},"tanstack-start":{name:"tanstack-start",label:"Remix",links:{installation:"https://saas-ui.dev/docs/core/installation/tanstack-start-guide"}},vite:{name:"vite",label:"Vite",links:{installation:"https://saas-ui.dev/docs/core/installation/vite-guide"}},manual:{name:"manual",label:"Manual"}};import ce from"fs";import pe from"path";function Q(e="",t=!0){let n=pe.join(e,"package.json"),o=ce.readFileSync(n,"utf8");try{return JSON.parse(o)}catch(i){if(t)throw i}return null}var Z=["**/node_modules/**",".next","public","dist","build"];async function x(e){let[t,n,o,i,a]=await Promise.all([X.glob("**/{next,vite,astro}.config.*|gatsby-config.*|composer.json",{cwd:e,deep:3,ignore:Z}),T.pathExists(_.resolve(e,"src")),ue(e),me(e),Q(e,!1)]),d=await T.pathExists(_.resolve(e,`${n?"src/":""}app`)),p={framework:v.manual,system:null,isSrcDir:n,isRSC:!1,isTsx:o,aliasPrefix:i??null};return Object.keys(a?.dependencies??{}).find(f=>f.startsWith("@chakra-ui/"))&&(p.system=C.chakra),Object.keys(a?.devDependencies??{}).find(f=>f.startsWith("@pandacss/dev"))&&(p.system=C.panda),t.find(f=>f.startsWith("next.config."))?.length?(p.framework=d?v["next-app"]:v["next-pages"],p.isRSC=d,p):Object.keys(a?.dependencies??{}).find(f=>f.startsWith("@tanstack/react-start"))?(p.framework=v["tanstack-start"],p):(t.find(f=>f.startsWith("vite.config."))?.length&&(p.framework=v.vite),p)}async function me(e){let t=await le(e);if(t?.resultType==="failed"||!t?.paths)return null;for(let[n,o]of Object.entries(t.paths))if(o.includes("./*")||o.includes("./src/*")||o.includes("./app/*")||o.includes("./resources/js/*"))return n.at(0)??null;return null}async function ue(e){return(await X.glob("tsconfig.*",{cwd:e,deep:1,ignore:Z})).length>0}async function ee(e=process.cwd()){try{let t=_.resolve(e,"tsconfig.json"),n=await T.readJSON(t);if(!n)throw new Error("tsconfig.json is missing");return n}catch{return null}}async function te(e,t=null){let[n,o]=await Promise.all([R(e),t?Promise.resolve(t):x(e)]);if(n)return n;if(!o)return null;let i={$schema:P,rsc:o.isRSC,tsx:o.isTsx,system:o.system?.name??C.chakra.name,style:"default",aliases:{components:`${o.aliasPrefix}components`,ui:`${o.aliasPrefix}components/ui`,hooks:`${o.aliasPrefix}hooks`,lib:`${o.aliasPrefix}lib`,utils:`${o.aliasPrefix}lib/utils`}};return await O(e,i)}import fe from"ora";function g(e,t){return fe({text:e,isSilent:t?.silent})}async function ne(e){let t={};if(!F.existsSync(e.cwd))return t["1"]=!0,{errors:t,projectInfo:null};let n=g("Preflight checks.",{silent:e.silent}).start();F.existsSync(U.resolve(e.cwd,"components.json"))&&!e.force&&(n?.fail(),r.break(),r.error(`A ${l.info("components.json")} file already exists at ${l.info(e.cwd)}.
22
To start over, remove the ${l.info("components.json")} file and run ${l.info("init")} again.`),r.break(),process.exit(1)),n?.succeed();let o=g("Verifying framework.",{silent:e.silent}).start(),i=await x(e.cwd);(!i||i?.framework.name==="manual")&&(t["6"]=!0,o?.fail(),r.break(),i&&"links"in i.framework&&i.framework.links.installation&&r.error(`We could not detect a supported framework at ${l.info(e.cwd)}.
33
Visit ${l.info(i?.framework.links.installation)} to manually configure your project.
44
Once configured, you can use the cli to add components.`),r.break(),process.exit(1)),o?.succeed(`Verifying framework. Found ${l.info(i.framework.label)}.`);let a=g("Validating import alias.",{silent:e.silent}).start();if(i?.aliasPrefix)a?.succeed();else{a?.fail(),r.break(),r.warn("No import alias found in your tsconfig.json file."),r.break();let p=await F.pathExists(U.resolve(e.cwd,"src"))?"./src/*":"./*",{aliasPrefix:f}=await ge({type:"select",name:"aliasPrefix",message:"Which import alias would you like to use?",choices:[{title:l.info("#*"),description:`Maps to ${p}`,value:"#*"},{title:l.info("@/*"),description:`Maps to ${p}`,value:"@/*"}],initial:0});f||(r.break(),r.error("Import alias is required to continue."),r.break(),process.exit(1));let s=U.resolve(e.cwd,"tsconfig.json"),u=await ee(e.cwd);u||(r.break(),r.error("Unable to read tsconfig.json"),r.break(),process.exit(1)),u.compilerOptions||(u.compilerOptions={}),u.compilerOptions.paths||(u.compilerOptions.paths={}),u.compilerOptions.paths[f]=[p],await F.writeJSON(s,u,{spaces:2});let{execa:y}=await import("execa");try{await y("npx",["prettier","--write",s],{cwd:e.cwd})}catch{}r.break(),r.success(`Added ${l.info(f)} to tsconfig.json paths.`),r.break(),a?.succeed()}return Object.keys(t).length>0&&(r.break(),process.exit(1)),{errors:t,projectInfo:i}}import{execa as we}from"execa";import{detect as he}from"@antfu/ni";async function j(e,{withFallback:t}={withFallback:!1}){let n=await he({programmatic:!0,cwd:e}),[o,i="0.0.0"]=n?.split("@")??["","0.0.0"];if(o==="yarn")return{packageManager:"yarn",version:i};if(o==="pnpm")return{packageManager:"pnpm",version:i};if(o==="bun")return{packageManager:"bun",version:i};if(!t)return{packageManager:"npm",version:"0.0.0"};let a=process.env.npm_config_user_agent||"";return a.startsWith("yarn")?{packageManager:"yarn",version:"0.0.0"}:a.startsWith("pnpm")?{packageManager:"pnpm",version:"0.0.0"}:a.startsWith("bun")?{packageManager:"bun",version:"0.0.0"}:{packageManager:"npm",version:"0.0.0"}}async function ie(e,t,n){if(e=Array.from(new Set(e)),!e?.length)return;n={silent:!1,...n};let o=g("Installing dependencies.",{silent:n.silent})?.start(),{packageManager:i}=await j(t.resolvedPaths.cwd);await we(i,[i==="npm"?"install":"add",...e],{cwd:t.resolvedPaths.cwd}),o?.succeed()}import{ensureFileSync as ye}from"fs-extra";import{existsSync as A,promises as oe}from"fs";import w,{basename as $}from"path";import ke from"prompts";import{Project as xe}from"ts-morph";function be(e,t,n){return n.startsWith("~/")?w.join(t.resolvedPaths.cwd,n.replace("~/","")):e?.isSrcDir?w.join(t.resolvedPaths.cwd,"src",n):w.join(t.resolvedPaths.cwd,n)}async function re(e,t,n){if(!e?.length)return;n={overwrite:!1,force:!1,silent:!1,...n};let o=g("Updating files.",{silent:n.silent})?.start(),[i]=await Promise.all([x(t.resolvedPaths.cwd)]),a=[],d=[],p=[];for(let s of e){if(!s.content)continue;let u=B(s,t);s.path.startsWith($(u))&&(u=w.join(u,w.dirname(s.path.replace($(u),""))));let y=$(s.path),h=w.join(u,y);s.target&&(h=be(i,t,s.target),u=w.dirname(h)),t.tsx||(h=h.replace(/\.tsx?$/,b=>b===".tsx"?".jsx":".js"));let I=A(h);if(I&&!n.overwrite){o.stop();let{overwrite:b}=await ke({type:"confirm",name:"overwrite",message:`The file ${l.info(y)} already exists. Would you like to overwrite?`,initial:!1});if(!b){p.push(w.relative(t.resolvedPaths.cwd,h));continue}o?.start()}A(u)||await oe.mkdir(u,{recursive:!0});let M=await K({filename:s.path,raw:s.content,config:t,transformJsx:!t.tsx},[G,Y]);await oe.writeFile(h,M,"utf-8"),I?d.push(w.relative(t.resolvedPaths.cwd,h)):a.push(w.relative(t.resolvedPaths.cwd,h))}if(!(a.length||d.length)&&!p.length&&o?.info("No files updated."),a.length){if(o?.succeed(`Created ${a.length} ${a.length===1?"file":"files"}:`),!n.silent)for(let u of a)r.log(` - ${u}`);let s=a.filter(u=>u.includes("icons/"));s.length&&ve(s,t)}else o?.stop();if(d.length&&(g(`Updated ${d.length} ${d.length===1?"file":"files"}:`,{silent:n.silent})?.info(),!n.silent))for(let s of d)r.log(` - ${s}`);if(p.length&&(g(`Skipped ${p.length} ${d.length===1?"file":"files"}:`,{silent:n.silent})?.info(),!n.silent))for(let s of p)r.log(` - ${s}`);n.silent||r.break()}async function ve(e,t){let n=w.join(t.resolvedPaths.icons,"index.ts");A(n)||ye(n);let i=new xe().addSourceFileAtPath(n);for(let a of e){let d=$(a),p=d.replace(/\.tsx$/,"").replace(/-([a-z])/g,s=>s[1].toUpperCase()).replace(/^./,s=>s.toUpperCase()),f=`./${d}`;i.getExportDeclarations().some(s=>s.getNamedExports().some(u=>u.getName()===p))||i.addExportDeclaration({moduleSpecifier:f,namedExports:[p]})}await i.save()}async function se(e,t,n){n={overwrite:!1,silent:!1,isNewProject:!1,...n};let o=g("Checking registry.",{silent:n.silent})?.start(),i=await H(e,t);if(!i)return o?.fail(),N(new Error("Failed to fetch components from registry."));o?.succeed(),await ie(i.dependencies,t,{silent:n.silent}),await re(i.files,t,{overwrite:n.overwrite,silent:n.silent}),i.docs&&r.info(i.docs)}import{execa as Se}from"execa";import{promises as m}from"fs";import c from"path";async function J(e){let{cwd:t,name:n,packageManager:o="pnpm",packageManagerVersion:i="0.0.0",typescript:a=!0,skipInstall:d=!1}=e,p=c.join(t,n),f=g("Creating monorepo structure...").start();try{if(await m.mkdir(p,{recursive:!0}),await je(p,{packageManager:o,packageManagerVersion:i,typescript:a}),f.succeed("Monorepo structure created"),!d){let s=g("Installing dependencies...").start();try{await Se(o,["install"],{cwd:p}),s.succeed("Dependencies installed")}catch{s.fail("Failed to install dependencies"),r.warn(`You can manually install dependencies by running ${l.info(`cd ${n} && ${o} install`)}`)}}r.break(),r.success("Monorepo created successfully!"),r.break(),r.info("Next steps:"),r.info(` 1. ${l.info(`cd ${n}`)}`),r.info(` 2. ${l.info(`${o} ${o==="npm"?"run":""} dev`)}`),r.break()}catch(s){throw f.fail("Failed to create monorepo"),s}}async function je(e,t){let{packageManager:n,packageManagerVersion:o,typescript:i}=t;await Promise.all([m.mkdir(c.join(e,"apps","web"),{recursive:!0}),m.mkdir(c.join(e,"packages","ui"),{recursive:!0}),m.mkdir(c.join(e,"packages","config"),{recursive:!0})]),await m.writeFile(c.join(e,"package.json"),JSON.stringify({name:c.basename(e),private:!0,packageManager:`${n}@${o}`,workspaces:n==="pnpm"?void 0:["apps/*","packages/*"],scripts:{dev:"turbo dev",build:"turbo build",lint:"turbo lint",clean:"turbo clean"},devDependencies:{turbo:"^2.5.8",typescript:i?"^5.9.3":void 0}},null,2)),n==="pnpm"&&await m.writeFile(c.join(e,"pnpm-workspace.yaml"),`packages:

packages/saas-ui-cli/lib/chunk-FNCPVRC6.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)