@promakeai/cli 0.5.2 → 0.5.4

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.js CHANGED
@@ -426,7 +426,7 @@ Google:`)),console.log(` ${C.dim("Site Verification:")} ${Q.googleVerification}
426
426
  Syncing SEO settings...`)),console.log(C.dim(` Source: ${J}`)),console.log(C.dim(` Target: ${Z}`));let Y=await yr(X);if(!Y.success)console.log(C.red(`
427
427
  Failed to apply SEO configuration`)),process.exit(1);if(Y.changes.length===0){console.log(C.yellow(`
428
428
  No changes to apply`));return}console.log(C.green(`
429
- SEO meta tags updated successfully:`)),Y.changes.forEach((Q)=>console.log(` ${C.cyan("✓")} ${Q}`))});import u4 from"fs/promises";import M8 from"path";async function Nx0(D){let X=M8.join(D,"package.json"),Z=M8.basename(D),J="npm",Y={};try{let Q=await u4.readFile(X,"utf-8"),$=JSON.parse(Q);Z=$.name||Z;let K={...$.dependencies,...$.devDependencies},G=["react","tailwindcss","react-router","typescript","vite","zustand"];for(let F of G)if(K[F])Y[F]=K[F].replace(/^\^|~/,"");let W=[{file:"bun.lockb",manager:"bun"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];for(let{file:F,manager:V}of W)try{await u4.access(M8.join(D,F)),J=V;break}catch{}}catch{}return{name:Z,path:D,packageManager:J,versions:Y}}async function Rx0(D){let X=M8.join(D,"src/components/ui"),Z=[];try{let J=await u4.readdir(X);for(let Y of J)if(Y.endsWith(".tsx"))Z.push(Y.replace(".tsx",""))}catch{}return Z.sort()}async function Ex0(D){let X=[M8.join(D,"src/constants/constants.json"),M8.join(D,"constants/constants.json")];for(let Z of X)try{let J=await u4.readFile(Z,"utf-8");return JSON.parse(J)}catch{}return null}function Tx0(D,X){let Z=[];if(D.react)Z.push(`React ${D.react}`);if(D.vite)Z.push(`Vite ${D.vite}`);if(D.tailwindcss)Z.push(`Tailwind v${D.tailwindcss.split(".")[0]}`);if(D.typescript)Z.push("TypeScript");if(D["react-router"])Z.push("React Router");if(D.zustand)Z.push("Zustand");if(X>0)Z.push(`shadcn/ui (${X})`);return Z.push("i18n"),Z}async function Ix0(D){let X=M8.join(D,"src/modules"),Z=["auth","api"],J=[];for(let Y of Z)try{await u4.access(M8.join(X,Y)),J.push(Y)}catch{}return J}async function jx0(D){let X=[M8.join(D,"src/constants/constants.json"),M8.join(D,"constants/constants.json")];for(let Z of X)try{let J=await u4.readFile(Z,"utf-8"),Y=JSON.parse(J);return{site:{name:Y.site?.name,tagline:Y.site?.tagline,description:Y.site?.description,language:Y.site?.defaultLanguage,currency:Y.site?.currency},seo:{title:Y.seo?.title,description:Y.seo?.description,author:Y.seo?.author},api:{baseUrl:Y.api?.baseUrl,endpoints:Y.api?.endpoints}}}catch{}return{site:{},seo:{},api:{}}}async function Cx0(D){let X=[M8.join(D,"src/router.tsx"),M8.join(D,"src/Router.tsx")];for(let Z of X)try{let J=await u4.readFile(Z,"utf-8"),Y=[],Q=/<Route\s+path=["']([^"']+)["']\s+element=\{<(\w+)/g,$;while(($=Q.exec(J))!==null)Y.push({path:$[1],component:$[2]});return Y}catch{}return[]}async function Px0(D){let X=[],Z=M8.join(D,"src"),J=M8.join(Z,"components");try{let $=(await u4.readdir(J)).filter((G)=>G.endsWith(".tsx")).map((G)=>G.replace(".tsx",""));if($.length>0)X.push({path:"src/components",description:$.join(", ")});let K=M8.join(J,"ui");try{await u4.access(K),X.push({path:"src/components/ui",description:"shadcn/ui components (see SHADCN/UI section)"})}catch{}}catch{}let Y=[{name:"modules",description:"Feature modules (promake add)"},{name:"pages",description:"Page components"},{name:"hooks",description:"Custom React hooks"},{name:"lib",description:"Utility functions"},{name:"lang",description:"i18n translations (en, tr, ...)"},{name:"constants",description:"App config (constants.json)"},{name:"contexts",description:"React context providers"},{name:"stores",description:"Zustand stores"},{name:"types",description:"TypeScript types"}];for(let Q of Y){let $=M8.join(Z,Q.name);try{if((await u4.stat($)).isDirectory())if(Q.name==="pages"||Q.name==="hooks"||Q.name==="contexts"||Q.name==="stores"){let W=(await u4.readdir($)).filter((F)=>F.endsWith(".tsx")||F.endsWith(".ts")).map((F)=>F.replace(/\.(tsx|ts)$/,""));if(W.length>0)X.push({path:`src/${Q.name}`,description:W.join(", ")});else X.push({path:`src/${Q.name}`,description:Q.description})}else X.push({path:`src/${Q.name}`,description:Q.description})}catch{}}return X}function wx0(D,X){if(!D?.modules)return[];return Object.entries(D.modules).map(([Z,J])=>({name:Z,path:J==="default"?`${X}/${Z}`:String(J)}))}var br=new $5("discover").description("Analyze project structure and configuration").option("--json","Output as JSON for machine parsing").option("-d, --detailed","Show full config file contents").option("--cwd <path>","Working directory").action(async(D)=>{let X=D.cwd||process.cwd(),Z=await Nx0(X),J=await T2(X),{site:Y,seo:Q,api:$}=await jx0(X),K=await Cx0(X),G=await Px0(X),W=await Rx0(X),F=await Ex0(X),V=await Ix0(X),z=J?.modulesPath||"src/modules",H=wx0(J,z),q=Tx0(Z.versions,W.length),U={preset:J?.theme?.preset,radius:J?.theme?.radius,font:J?.theme?.font},B={project:Z,overview:q,builtinModules:V,config:{modulesPath:z,routerFile:J?.routerFile||"src/router.tsx",envFile:J?.envFile||".env"},modules:H,shadcnComponents:W,theme:U,site:Y,seo:Q,api:$,routes:K,structure:G,promakeConfig:J,constantsConfig:F};if(D.json){console.log(JSON.stringify(B,null,2));return}if(console.log(C.bold(`
429
+ SEO meta tags updated successfully:`)),Y.changes.forEach((Q)=>console.log(` ${C.cyan("✓")} ${Q}`))});import u4 from"fs/promises";import M8 from"path";async function Nx0(D){let X=M8.join(D,"package.json"),Z=M8.basename(D),J="npm",Y={};try{let Q=await u4.readFile(X,"utf-8"),$=JSON.parse(Q);Z=$.name||Z;let K={...$.dependencies,...$.devDependencies},G=["react","tailwindcss","react-router","typescript","vite","zustand"];for(let F of G)if(K[F])Y[F]=K[F].replace(/^\^|~/,"");let W=[{file:"bun.lockb",manager:"bun"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];for(let{file:F,manager:V}of W)try{await u4.access(M8.join(D,F)),J=V;break}catch{}}catch{}return{name:Z,path:D,packageManager:J,versions:Y}}async function Rx0(D){let X=M8.join(D,"src/components/ui"),Z=[];try{let J=await u4.readdir(X);for(let Y of J)if(Y.endsWith(".tsx"))Z.push(Y.replace(".tsx",""))}catch{}return Z.sort()}async function Ex0(D){let X=[M8.join(D,"src/constants/constants.json"),M8.join(D,"constants/constants.json")];for(let Z of X)try{let J=await u4.readFile(Z,"utf-8");return JSON.parse(J)}catch{}return null}function Tx0(D,X){let Z=[];if(D.react)Z.push(`React ${D.react}`);if(D.vite)Z.push(`Vite ${D.vite}`);if(D.tailwindcss)Z.push(`Tailwind v${D.tailwindcss.split(".")[0]}`);if(D.typescript)Z.push("TypeScript");if(D["react-router"])Z.push("React Router");if(D.zustand)Z.push("Zustand");if(X>0)Z.push(`shadcn/ui (${X})`);return Z.push("i18n"),Z}async function Ix0(D){let X=M8.join(D,"src/modules"),Z=["auth-core","api"],J=[];for(let Y of Z)try{await u4.access(M8.join(X,Y)),J.push(Y)}catch{}return J}async function jx0(D){let X=[M8.join(D,"src/constants/constants.json"),M8.join(D,"constants/constants.json")];for(let Z of X)try{let J=await u4.readFile(Z,"utf-8"),Y=JSON.parse(J);return{site:{name:Y.site?.name,tagline:Y.site?.tagline,description:Y.site?.description,language:Y.site?.defaultLanguage,currency:Y.site?.currency},seo:{title:Y.seo?.title,description:Y.seo?.description,author:Y.seo?.author},api:{baseUrl:Y.api?.baseUrl,endpoints:Y.api?.endpoints}}}catch{}return{site:{},seo:{},api:{}}}async function Cx0(D){let X=[M8.join(D,"src/router.tsx"),M8.join(D,"src/Router.tsx")];for(let Z of X)try{let J=await u4.readFile(Z,"utf-8"),Y=[],Q=/<Route\s+path=["']([^"']+)["']\s+element=\{<(\w+)/g,$;while(($=Q.exec(J))!==null)Y.push({path:$[1],component:$[2]});return Y}catch{}return[]}async function Px0(D){let X=[],Z=M8.join(D,"src"),J=M8.join(Z,"components");try{let $=(await u4.readdir(J)).filter((G)=>G.endsWith(".tsx")).map((G)=>G.replace(".tsx",""));if($.length>0)X.push({path:"src/components",description:$.join(", ")});let K=M8.join(J,"ui");try{await u4.access(K),X.push({path:"src/components/ui",description:"shadcn/ui components (see SHADCN/UI section)"})}catch{}}catch{}let Y=[{name:"modules",description:"Feature modules (promake add)"},{name:"pages",description:"Page components"},{name:"hooks",description:"Custom React hooks"},{name:"lib",description:"Utility functions"},{name:"lang",description:"i18n translations (en, tr, ...)"},{name:"constants",description:"App config (constants.json)"},{name:"contexts",description:"React context providers"},{name:"stores",description:"Zustand stores"},{name:"types",description:"TypeScript types"}];for(let Q of Y){let $=M8.join(Z,Q.name);try{if((await u4.stat($)).isDirectory())if(Q.name==="pages"||Q.name==="hooks"||Q.name==="contexts"||Q.name==="stores"){let W=(await u4.readdir($)).filter((F)=>F.endsWith(".tsx")||F.endsWith(".ts")).map((F)=>F.replace(/\.(tsx|ts)$/,""));if(W.length>0)X.push({path:`src/${Q.name}`,description:W.join(", ")});else X.push({path:`src/${Q.name}`,description:Q.description})}else X.push({path:`src/${Q.name}`,description:Q.description})}catch{}}return X}function wx0(D,X){if(!D?.modules)return[];return Object.entries(D.modules).map(([Z,J])=>({name:Z,path:J==="default"?`${X}/${Z}`:String(J)}))}var br=new $5("discover").description("Analyze project structure and configuration").option("--json","Output as JSON for machine parsing").option("-d, --detailed","Show full config file contents").option("--cwd <path>","Working directory").action(async(D)=>{let X=D.cwd||process.cwd(),Z=await Nx0(X),J=await T2(X),{site:Y,seo:Q,api:$}=await jx0(X),K=await Cx0(X),G=await Px0(X),W=await Rx0(X),F=await Ex0(X),V=await Ix0(X),z=J?.modulesPath||"src/modules",H=wx0(J,z),q=Tx0(Z.versions,W.length),U={preset:J?.theme?.preset,radius:J?.theme?.radius,font:J?.theme?.font},B={project:Z,overview:q,builtinModules:V,config:{modulesPath:z,routerFile:J?.routerFile||"src/router.tsx",envFile:J?.envFile||".env"},modules:H,shadcnComponents:W,theme:U,site:Y,seo:Q,api:$,routes:K,structure:G,promakeConfig:J,constantsConfig:F};if(D.json){console.log(JSON.stringify(B,null,2));return}if(console.log(C.bold(`
430
430
  PROJECT`)),console.log(` ${Z.name} ${C.dim(`(${Z.packageManager})`)}`),console.log(` ${C.dim(Z.path)}`),console.log(C.bold(`
431
431
  STACK`)),console.log(` ${q.join(", ")}`),V.length>0)console.log(C.bold(`
432
432
  BUILT-IN MODULES`)),console.log(` ${V.join(", ")} ${C.dim("(included in template)")}`);if(console.log(C.bold(`
@@ -489,7 +489,7 @@ constants.json (full)`)),console.log(C.dim(JSON.stringify(B.constantsConfig,null
489
489
  `)),D6("promake create <name>","Create new project"),D6("promake add <modules...>","Add modules"),D6("promake add <page> --module-name <name>","Add page with custom name"),D6("promake remove <modules...>","Remove modules"),D6("promake sync","Sync from promake.json"),D6("promake theme --list","List theme options"),D6("promake theme --preset <name>","Apply color preset"),D6("promake list","List available modules"),D6("promake doctor","Check project health"),D6("promake doctor --runtime","Include runtime checks"),D6("promake discover --json","Project info for AI"),D6("promake seo","Sync SEO meta tags"),D6("promake usage","Show this guide"),D6("promake <command> --help","Command-specific help"),console.log()}var ur=new $5("info").description("Show detailed information about a module").argument("<module>","Module name").option("--json","Output as JSON").action(async(D,X)=>{let Z=E2(`Fetching ${D}...`).start();try{let J=await T4(D);if(Z.stop(),!J)console.error(C.red(`Module not found: ${D}`)),process.exit(1);if(X.json){console.log(JSON.stringify(J,null,2));return}if(console.log(""),console.log(C.bold.cyan(J.name)),console.log(C.dim("─".repeat(J.name.length+4))),J.title)console.log(`${C.gray("Title:")} ${J.title}`);if(console.log(`${C.gray("Type:")} ${J.type.replace("registry:","")}`),J.description)console.log(`${C.gray("Description:")} ${J.description}`);if(J.registryDependencies?.length)console.log(""),console.log(C.gray("Dependencies:")),J.registryDependencies.forEach((Y)=>{let $=!Y.includes("-")||["button","card","input","badge","dialog","sheet","dropdown-menu","accordion","tabs","select","checkbox","slider","separator","avatar","tooltip","popover","navigation-menu","scroll-area"].includes(Y)?C.dim("(shadcn)"):"";console.log(` ${C.yellow("•")} ${Y} ${$}`)});if(J.dependencies?.length)console.log(""),console.log(C.gray("NPM Packages:")),J.dependencies.forEach((Y)=>{console.log(` ${C.blue("•")} ${Y}`)});if(J.files?.length)console.log(""),console.log(C.gray("Files:")),J.files.forEach((Y)=>{console.log(` ${C.dim("•")} ${Y.path}`)});if(J.exports){if(console.log(""),console.log(C.gray("Exports:")),J.exports.types?.length)console.log(` ${C.magenta("Types:")} ${J.exports.types.join(", ")}`);if(J.exports.variables?.length)console.log(` ${C.green("Components:")} ${J.exports.variables.join(", ")}`)}if(J.route)console.log(""),console.log(C.gray("Route:")),console.log(` ${C.cyan("Path:")} ${J.route.path}`),console.log(` ${C.cyan("Component:")} ${J.route.componentName}`);if(J.usage)console.log(""),console.log(C.gray("Usage:")),console.log(C.dim("─".repeat(40))),console.log(J.usage);console.log("")}catch(J){if(Z.fail("Failed to fetch module info"),J instanceof Error)console.error(C.red(J.message));process.exit(1)}});import e91 from"path";var bK=k1(r8(),1);import{execSync as kx0}from"child_process";import fq from"path";async function tE(D,X=!1){let Z=Date.now(),J=[],Y=fq.join(D,"tsconfig.json");if(!await bK.default.pathExists(Y))return{name:"TypeScript",status:"skip",severity:"info",duration:Date.now()-Z,items:[],summary:"No tsconfig.json found"};let Q=fq.join(D,"package.json"),$=!1;if(await bK.default.pathExists(Q))$=!!(await bK.default.readJson(Q)).scripts?.check;let K=Z$(D),G=K==="npm"?"npm run":`${K} run`;try{let W=$?`${G} check 2>&1`:"npx tsc --noEmit 2>&1";if(!X)console.log(C.dim(` $ ${$?`${G} check`:"tsc --noEmit"}`));let F=kx0(W,{cwd:D,encoding:"utf-8",stdio:"pipe"});if(!X&&F.trim())console.log(C.dim(F));return{name:"TypeScript",status:"pass",severity:"error",duration:Date.now()-Z,items:[],summary:"No type errors"}}catch(W){let F=W.stdout||W.stderr||W.message||"";if(F.includes("This is not the tsc command")||F.includes("typescript"))return{name:"TypeScript",status:"skip",severity:"info",duration:Date.now()-Z,items:[],summary:"TypeScript not installed"};if(!X&&F.trim())console.log(C.dim(F));return J.push(...hx0(F,D)),{name:"TypeScript",status:"fail",severity:"error",duration:Date.now()-Z,items:J,summary:`${J.length} type error(s)`}}}function hx0(D,X){let Z=[],J=/^(.+)\((\d+),(\d+)\):\s*(error|warning)\s*(TS\d+):\s*(.+)$/gm,Y=/^(.+):(\d+):(\d+)\s*-\s*(error|warning)\s*(TS\d+):\s*(.+)$/gm;for(let $ of[J,Y]){let K;while((K=$.exec(D))!==null){let G=K[1].trim();Z.push({file:fq.isAbsolute(G)?fq.relative(X,G):G,line:parseInt(K[2]),column:parseInt(K[3]),code:K[5],message:K[6]})}}let Q=new Set;return Z.filter(($)=>{let K=`${$.file}:${$.line}:${$.column}:${$.message}`;if(Q.has(K))return!1;return Q.add(K),!0})}var rD=k1(r8(),1);import{execSync as xx0}from"child_process";import fK from"path";var yx0=["eslint.config.js","eslint.config.mjs","eslint.config.cjs",".eslintrc.js",".eslintrc.cjs",".eslintrc.json",".eslintrc.yml",".eslintrc.yaml",".eslintrc"];async function vx0(D){for(let Z of yx0)if(await rD.default.pathExists(fK.join(D,Z)))return!0;let X=fK.join(D,"package.json");if(await rD.default.pathExists(X))try{if((await rD.default.readJson(X)).eslintConfig)return!0}catch{}return!1}async function eE(D,X=!1,Z=!1){let J=Date.now();if(!await vx0(D))return{name:"ESLint",status:"skip",severity:"warning",duration:Date.now()-J,items:[],summary:"No ESLint config found"};let Y=fK.join(D,"package.json"),Q=!1;if(await rD.default.pathExists(Y))Q=!!(await rD.default.readJson(Y)).scripts?.lint;let $=Z$(D),K=$==="npm"?"npm run":`${$} run`,G=X?" -- --fix":"";try{let W=Q?`${K} lint${G} 2>&1`:`npx eslint .${X?" --fix":""} 2>&1`;if(!Z)console.log(C.dim(` $ ${Q?`${K} lint${G}`:`eslint .${X?" --fix":""}`}`));let F=xx0(W,{cwd:D,encoding:"utf-8",stdio:"pipe",maxBuffer:10485760});if(!Z&&F.trim())console.log(C.dim(F));return{name:"ESLint",status:"pass",severity:"warning",duration:Date.now()-J,items:[],summary:"No linting issues"}}catch(W){let F=W.stdout||W.stderr||W.message||"";if(F.includes("eslint: not found")||F.includes("'eslint' is not recognized"))return{name:"ESLint",status:"skip",severity:"info",duration:Date.now()-J,items:[],summary:"ESLint not installed"};if(!Z&&F.trim())console.log(C.dim(F));let V=bx0(F,D);if(V.length===0&&F.includes("error"))return{name:"ESLint",status:"fail",severity:"warning",duration:Date.now()-J,items:[{message:"ESLint encountered an error"}],summary:"ESLint error"};return{name:"ESLint",status:V.length>0?"fail":"pass",severity:"warning",duration:Date.now()-J,items:V,summary:V.length>0?`${V.length} linting issue(s)`:"No linting issues"}}}function bx0(D,X){let Z=[],J=/^([^\s].*\.(ts|tsx|js|jsx))$/gm,Y=/^\s+(\d+):(\d+)\s+(error|warning)\s+(.+?)\s{2,}(\S+)?$/gm,Q=null,$=D.split(`
490
490
  `);for(let K of $){let G=K.match(/^([^\s].*\.(ts|tsx|js|jsx))$/);if(G){Q=G[1];continue}let W=K.match(/^\s+(\d+):(\d+)\s+(error|warning)\s+(.+?)\s{2,}(\S+)?$/);if(W&&Q)Z.push({file:fK.isAbsolute(Q)?fK.relative(X,Q):Q,line:parseInt(W[1]),column:parseInt(W[2]),code:W[5]||void 0,message:W[4].trim()})}return Z}var gq=k1(r8(),1);import{execSync as fx0}from"child_process";import gK from"path";async function DT(D){let X=Date.now(),Z=["vite.config.ts","vite.config.js","vite.config.mjs"],J=!1;for(let Y of Z)if(await gq.default.pathExists(gK.join(D,Y))){J=!0;break}if(!J)return{name:"Build",status:"skip",severity:"error",duration:Date.now()-X,items:[],summary:"No vite.config found"};try{fx0("npx vite build 2>&1",{cwd:D,encoding:"utf-8",stdio:"pipe",env:{...process.env,NODE_ENV:"production"}});let Y=gK.join(D,"dist");if(await gq.default.pathExists(Y))await gq.default.remove(Y);return{name:"Build",status:"pass",severity:"error",duration:Date.now()-X,items:[],summary:"Build succeeded"}}catch(Y){let Q=Y.stdout||Y.stderr||Y.message||"",$=gx0(Q,D);return{name:"Build",status:"fail",severity:"error",duration:Date.now()-X,items:$.length>0?$:[{message:"Build failed"}],summary:"Build failed"}}}function gx0(D,X){let Z=[],J=D.split(`
491
491
  `),Y=[/^(.+):(\d+):(\d+):\s*(.+)$/,/\[vite\]:\s*Error:\s*(.+)/,/Error:\s*(.+?)\s+at\s+(.+):(\d+):(\d+)/,/Could not resolve ["']([^"']+)["']\s+from\s+["']([^"']+)["']/,/RollupError:\s*(.+)/];for(let $=0;$<J.length;$++){let K=J[$].trim();if(!K)continue;if(K.includes("building for production")||K.includes("transforming")||K.includes("rendering chunks")||K.includes("computing gzip")||K.startsWith("✓")||K.startsWith("vite v"))continue;for(let G of Y){let W=K.match(G);if(W){if(G.source.includes("Could not resolve"))Z.push({file:gK.relative(X,W[2]),message:`Cannot find module '${W[1]}'`,suggestion:"Check if the module is installed or the path is correct"});else if(W.length===5)Z.push({file:gK.isAbsolute(W[1]||W[2])?gK.relative(X,W[1]||W[2]):W[1]||W[2],line:parseInt(W[2]||W[3]),column:parseInt(W[3]||W[4]),message:W[4]||W[1]});else Z.push({message:W[1]||K});break}}if(Z.length===0&&(K.toLowerCase().includes("error")||K.toLowerCase().includes("failed")))Z.push({message:K})}let Q=new Set;return Z.filter(($)=>{let K=`${$.file}:${$.line}:${$.message}`;if(Q.has(K))return!1;return Q.add(K),!0})}var nS=k1(r8(),1);import XF from"path";var g91=[process.env["PROGRAMFILES(X86)"]&&XF.join(process.env["PROGRAMFILES(X86)"],"Google","Chrome","Application","chrome.exe"),process.env.PROGRAMFILES&&XF.join(process.env.PROGRAMFILES,"Google","Chrome","Application","chrome.exe"),process.env.LOCALAPPDATA&&XF.join(process.env.LOCALAPPDATA,"Google","Chrome","Application","chrome.exe"),process.env["PROGRAMFILES(X86)"]&&XF.join(process.env["PROGRAMFILES(X86)"],"Microsoft","Edge","Application","msedge.exe"),process.env.PROGRAMFILES&&XF.join(process.env.PROGRAMFILES,"Microsoft","Edge","Application","msedge.exe")].filter(Boolean),u91=["/Applications/Google Chrome.app/Contents/MacOS/Google Chrome","/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge","/Applications/Chromium.app/Contents/MacOS/Chromium"],m91=["/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/usr/bin/chromium-browser","/usr/bin/chromium","/snap/bin/chromium"];async function f$0(){let D=await c91();if(!D)return null;try{return{type:"chrome",browser:await(await Promise.resolve().then(() => (b$0(),v$0))).default.launch({executablePath:D,headless:!0,args:["--no-sandbox","--disable-setuid-sandbox","--disable-gpu"]})}}catch{return null}}async function c91(){if(process.env.CHROME_PATH){if(await nS.default.pathExists(process.env.CHROME_PATH))return process.env.CHROME_PATH}let D;switch(process.platform){case"win32":D=g91;break;case"darwin":D=u91;break;default:D=m91}for(let X of D)if(await nS.default.pathExists(X))return X;return null}async function g$0(D){try{await D.browser.close()}catch{}}async function oS(D,X,Z="/"){let J=Date.now();if(!await d91(D))return{name:"Runtime",status:"skip",severity:"error",duration:Date.now()-J,items:[{message:`No server running on port ${D}`,suggestion:"Start dev server first: npm run dev (or use --port to specify different port)"}],summary:`Skipped (no server on port ${D})`};let Q=null;try{Q=await f$0()}catch{}if(!Q)return{name:"Runtime",status:"skip",severity:"info",duration:Date.now()-J,items:[{message:"No browser available (Chrome/Chromium/Edge not found)",suggestion:"Set CHROME_PATH environment variable or install Chrome/Edge"}],summary:"Skipped (no browser)"};let $=[],{browser:K,type:G}=Q;try{let F=await K.newPage();F.on("console",(H)=>{let q=H.type();if(q==="error"||q==="warning"){let U=H.location();$.push({type:q==="warning"?"warning":"console",message:H.text(),fileName:U?.url,lineNumber:U?.lineNumber,columnNumber:U?.columnNumber})}}),F.on("pageerror",(H)=>{$.push({type:"error",message:H.message,stack:H.stack})});let V=Z.startsWith("/")?Z:`/${Z}`;await F.goto(`http://localhost:${D}${V}`,{waitUntil:"networkidle0",timeout:X}),await l91(3000);let z=await F.evaluate(()=>{return window.__earlyErrors||[]});$.push(...z)}catch(F){let V=F.message||"Unknown error";if(V.includes("timeout")||V.includes("Timeout"))$.push({type:"error",message:"Page load timeout - app may have crashed or is unresponsive"});else if(V.includes("net::ERR"))$.push({type:"error",message:`Network error: ${V}`});else $.push({type:"error",message:`Runtime check error: ${V}`})}finally{await g$0(Q)}let W=p91($);return{name:`Runtime (${G})`,status:W.length>0?"fail":"pass",severity:"error",duration:Date.now()-J,items:W,summary:W.length>0?`${W.length} runtime error(s)`:"No runtime errors"}}async function d91(D){try{let X=await fetch(`http://localhost:${D}`,{method:"HEAD",signal:AbortSignal.timeout(3000)});return X.ok||X.status<500}catch{return!1}}function l91(D){return new Promise((X)=>setTimeout(X,D))}function p91(D){return D.map((X)=>{let Z=[];for(let[J,Y]of Object.entries(X))if(Y!==void 0&&Y!==null)Z.push(`${J}: ${Y}`);return{message:Z.join(`
492
- `)}})}function rS(D,X){console.log(""),console.log(C.bold("Health Check")+C.dim(` (${t91(D.duration)})`)),console.log(C.dim("─".repeat(40)));for(let Z of D.checks)i91(Z,X);console.log(C.dim("─".repeat(40))),a91(D)}function i91(D,X){let Z=r91(D.status),J=s91(D.status,D.severity),Y=C.dim(`${D.duration}ms`);console.log(`${Z} ${J(D.name)} ${Y} ${C.dim("·")} ${C.dim(D.summary||"")}`);let Q=D.name.startsWith("Runtime"),$=X||Q?D.items:D.items.slice(0,3),K=D.items.length-$.length;for(let G of $)n91(G,D.severity);if(K>0)console.log(C.dim(` ... +${K} more (--verbose)`))}function n91(D,X){let Z=X==="error"?C.red:C.yellow,J=o91(D),Y=J?C.cyan(J)+" ":"";console.log(` ${Z("›")} ${Y}${D.message}`)}function o91(D){if(!D.file)return"";let X=D.file;if(D.line!==void 0){if(X+=`:${D.line}`,D.column!==void 0)X+=`:${D.column}`}return X}function r91(D){switch(D){case"pass":return C.green("✓");case"fail":return C.red("✗");case"skip":return C.dim("○");default:return C.dim("?")}}function s91(D,X){if(D==="fail")return X==="error"?C.red:C.yellow;if(D==="pass")return C.green;return C.dim}function a91(D){let{summary:X}=D,Z=[];if(X.passed>0)Z.push(C.green(`${X.passed} passed`));if(X.failed>0)Z.push(C.red(`${X.failed} failed`));if(X.skipped>0)Z.push(C.dim(`${X.skipped} skipped`));if(console.log(Z.join(C.dim(" · "))),X.errors>0)console.log(C.red(`${X.errors} error(s) need attention`));else if(X.warnings>0)console.log(C.yellow(`${X.warnings} warning(s) to review`));else console.log(C.green("All good!"))}function t91(D){if(D<1000)return`${D}ms`;return`${(D/1000).toFixed(1)}s`}var u$0=new $5("doctor").description("Analyze project for issues (TypeScript, ESLint, build, runtime)").option("--cwd <path>","Working directory").option("--port <number>","Vite dev server port","5174").option("--fix","Auto-fix ESLint issues where possible").option("--runtime","Run runtime error detection (requires running dev server)").option("--runtime-timeout <ms>","Runtime check timeout in ms","10000").option("--route <path>","Route path for runtime check","/").option("--json","Output as JSON (for CI/CD)").option("-v, --verbose","Show all details including all errors").option("-q, --quiet","Hide command output logs (only show summary)").option("--no-typecheck","Skip TypeScript type checking").option("--no-lint","Skip ESLint checking").option("--no-build","Skip Vite build checking").action(async(D)=>{let X=D.cwd||process.cwd(),Z=parseInt(D.port||"5173"),J=parseInt(D.runtimeTimeout||"10000"),Y=D.route||"/",Q=Date.now(),$=D.quiet||D.json||!1;if(!await T2(X)&&!D.json)console.log(C.yellow("Warning: No promake.json found. Running checks anyway..."));let G=D.json?null:E2("Running health checks...").start(),W=[];if(D.typecheck!==!1)W.push(()=>tE(X,$));if(D.lint!==!1)W.push(()=>eE(X,D.fix,$));if(D.build!==!1)W.push(()=>DT(X));if(D.runtime)W.push(()=>oS(Z,J,Y));let F=[];try{if(F=await D31(W,1),G)G.stop()}catch(z){if(G)G.fail("Health check failed");if(!D.json)console.error(C.red(z.message));process.exit(1)}let V={project:e91.basename(X),timestamp:new Date().toISOString(),duration:Date.now()-Q,checks:F,summary:{passed:F.filter((z)=>z.status==="pass").length,failed:F.filter((z)=>z.status==="fail").length,skipped:F.filter((z)=>z.status==="skip").length,errors:F.filter((z)=>z.status==="fail"&&z.severity==="error").reduce((z,H)=>z+H.items.length,0),warnings:F.filter((z)=>z.status==="fail"&&z.severity==="warning").reduce((z,H)=>z+H.items.length,0)}};if(D.json)console.log(JSON.stringify(V,null,2));else rS(V,D.verbose||!1);if(V.summary.errors>0)process.exit(1)});async function D31(D,X){let Z=[],J=0;async function Y(){let $=J++;if($>=D.length)return;Z[$]=await D[$](),await Y()}let Q=Array(Math.min(X,D.length)).fill(null).map(()=>Y());return await Promise.all(Q),Z}var m$0={name:"@promakeai/cli",version:"0.5.2",type:"module",bin:{promake:"dist/index.js"},files:["dist/index.js","dist/registry","template"],scripts:{dev:"bun run src/index.ts","dev:app":"cd dev && bun run dev","dev:populate":"bun run scripts/populate-dev.ts","dev:fresh":"bun run dev:populate && bun run dev:app","playground:create":"rm -rf playground && bun run dev -- create playground --template empty --pm bun","playground:reset":"bun run playground:create","playground:add":"cd playground && bun run ../src/index.ts add","playground:ecommerce":"rm -rf playground && bun run dev -- create playground --template ecommerce --pm bun",clean:"rimraf dist",build:"bun run clean && bun run build:cli && bun run build:registry","build:cli":"bun build src/index.ts --outdir dist --target node --minify","build:registry":"bun run scripts/build-registry.ts",typecheck:"tsc --noEmit",prepublishOnly:"bun run build",test:"bun test","test:watch":"bun test --watch","test:coverage":"bun test --coverage",release:"bun run build && npm publish --access public"},dependencies:{"adm-zip":"^0.5.16",archiver:"^7.0.1",chalk:"^5.3.0",commander:"^12.1.0",culori:"^4.0.2",dotenv:"^17.2.3","fs-extra":"^11.3.3",glob:"^11.0.0",ora:"^8.1.1",prompts:"^2.4.2","puppeteer-core":"^24.36.0"},devDependencies:{"@types/archiver":"^7.0.0","@types/bun":"^1.1.14","@types/culori":"^4.0.1","@types/fs-extra":"^11.0.4","@types/node":"^22.10.2","@types/prompts":"^2.4.9",rimraf:"6.0.1",typescript:"^5.7.2"}};var P8=new $5;P8.name("promake").description(`Modular React template CLI - Build React apps with pre-built components
492
+ `)}})}function rS(D,X){console.log(""),console.log(C.bold("Health Check")+C.dim(` (${t91(D.duration)})`)),console.log(C.dim("─".repeat(40)));for(let Z of D.checks)i91(Z,X);console.log(C.dim("─".repeat(40))),a91(D)}function i91(D,X){let Z=r91(D.status),J=s91(D.status,D.severity),Y=C.dim(`${D.duration}ms`);console.log(`${Z} ${J(D.name)} ${Y} ${C.dim("·")} ${C.dim(D.summary||"")}`);let Q=D.name.startsWith("Runtime"),$=X||Q?D.items:D.items.slice(0,3),K=D.items.length-$.length;for(let G of $)n91(G,D.severity);if(K>0)console.log(C.dim(` ... +${K} more (--verbose)`))}function n91(D,X){let Z=X==="error"?C.red:C.yellow,J=o91(D),Y=J?C.cyan(J)+" ":"";console.log(` ${Z("›")} ${Y}${D.message}`)}function o91(D){if(!D.file)return"";let X=D.file;if(D.line!==void 0){if(X+=`:${D.line}`,D.column!==void 0)X+=`:${D.column}`}return X}function r91(D){switch(D){case"pass":return C.green("✓");case"fail":return C.red("✗");case"skip":return C.dim("○");default:return C.dim("?")}}function s91(D,X){if(D==="fail")return X==="error"?C.red:C.yellow;if(D==="pass")return C.green;return C.dim}function a91(D){let{summary:X}=D,Z=[];if(X.passed>0)Z.push(C.green(`${X.passed} passed`));if(X.failed>0)Z.push(C.red(`${X.failed} failed`));if(X.skipped>0)Z.push(C.dim(`${X.skipped} skipped`));if(console.log(Z.join(C.dim(" · "))),X.errors>0)console.log(C.red(`${X.errors} error(s) need attention`));else if(X.warnings>0)console.log(C.yellow(`${X.warnings} warning(s) to review`));else console.log(C.green("All good!"))}function t91(D){if(D<1000)return`${D}ms`;return`${(D/1000).toFixed(1)}s`}var u$0=new $5("doctor").description("Analyze project for issues (TypeScript, ESLint, build, runtime)").option("--cwd <path>","Working directory").option("--port <number>","Vite dev server port","5174").option("--fix","Auto-fix ESLint issues where possible").option("--runtime","Run runtime error detection (requires running dev server)").option("--runtime-timeout <ms>","Runtime check timeout in ms","10000").option("--route <path>","Route path for runtime check","/").option("--json","Output as JSON (for CI/CD)").option("-v, --verbose","Show all details including all errors").option("-q, --quiet","Hide command output logs (only show summary)").option("--no-typecheck","Skip TypeScript type checking").option("--no-lint","Skip ESLint checking").option("--no-build","Skip Vite build checking").action(async(D)=>{let X=D.cwd||process.cwd(),Z=parseInt(D.port||"5173"),J=parseInt(D.runtimeTimeout||"10000"),Y=D.route||"/",Q=Date.now(),$=D.quiet||D.json||!1;if(!await T2(X)&&!D.json)console.log(C.yellow("Warning: No promake.json found. Running checks anyway..."));let G=D.json?null:E2("Running health checks...").start(),W=[];if(D.typecheck!==!1)W.push(()=>tE(X,$));if(D.lint!==!1)W.push(()=>eE(X,D.fix,$));if(D.build!==!1)W.push(()=>DT(X));if(D.runtime)W.push(()=>oS(Z,J,Y));let F=[];try{if(F=await D31(W,1),G)G.stop()}catch(z){if(G)G.fail("Health check failed");if(!D.json)console.error(C.red(z.message));process.exit(1)}let V={project:e91.basename(X),timestamp:new Date().toISOString(),duration:Date.now()-Q,checks:F,summary:{passed:F.filter((z)=>z.status==="pass").length,failed:F.filter((z)=>z.status==="fail").length,skipped:F.filter((z)=>z.status==="skip").length,errors:F.filter((z)=>z.status==="fail"&&z.severity==="error").reduce((z,H)=>z+H.items.length,0),warnings:F.filter((z)=>z.status==="fail"&&z.severity==="warning").reduce((z,H)=>z+H.items.length,0)}};if(D.json)console.log(JSON.stringify(V,null,2));else rS(V,D.verbose||!1);if(V.summary.errors>0)process.exit(1)});async function D31(D,X){let Z=[],J=0;async function Y(){let $=J++;if($>=D.length)return;Z[$]=await D[$](),await Y()}let Q=Array(Math.min(X,D.length)).fill(null).map(()=>Y());return await Promise.all(Q),Z}var m$0={name:"@promakeai/cli",version:"0.5.4",type:"module",bin:{promake:"dist/index.js"},files:["dist/index.js","dist/registry","template"],scripts:{dev:"bun run src/index.ts","dev:app":"cd dev && bun run dev","dev:populate":"bun run scripts/populate-dev.ts","dev:fresh":"bun run dev:populate && bun run dev:app","playground:create":"rm -rf playground && bun run dev -- create playground --template empty --pm bun","playground:reset":"bun run playground:create","playground:add":"cd playground && bun run ../src/index.ts add","playground:ecommerce":"rm -rf playground && bun run dev -- create playground --template ecommerce --pm bun",clean:"rimraf dist",build:"bun run clean && bun run build:cli && bun run build:registry","build:cli":"bun build src/index.ts --outdir dist --target node --minify","build:registry":"bun run scripts/build-registry.ts",typecheck:"tsc --noEmit",prepublishOnly:"bun run build",test:"bun test","test:watch":"bun test --watch","test:coverage":"bun test --coverage",release:"bun run build && npm publish --access public"},dependencies:{"adm-zip":"^0.5.16",archiver:"^7.0.1",chalk:"^5.3.0",commander:"^12.1.0",culori:"^4.0.2",dotenv:"^17.2.3","fs-extra":"^11.3.3",glob:"^11.0.0",ora:"^8.1.1",prompts:"^2.4.2","puppeteer-core":"^24.36.0"},devDependencies:{"@types/archiver":"^7.0.0","@types/bun":"^1.1.14","@types/culori":"^4.0.1","@types/fs-extra":"^11.0.4","@types/node":"^22.10.2","@types/prompts":"^2.4.9",rimraf:"6.0.1",typescript:"^5.7.2"}};var P8=new $5;P8.name("promake").description(`Modular React template CLI - Build React apps with pre-built components
493
493
 
494
494
  Quick Start:
495
495
  $ promake create my-app
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promakeai/cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "promake": "dist/index.js"
@@ -53,4 +53,4 @@
53
53
  "rimraf": "6.0.1",
54
54
  "typescript": "^5.7.2"
55
55
  }
56
- }
56
+ }
@@ -22,6 +22,10 @@ export default defineConfig([
22
22
  globals: globals.browser,
23
23
  },
24
24
  rules: {
25
+ '@typescript-eslint/consistent-type-imports': ['warn', {
26
+ prefer: 'type-imports',
27
+ fixStyle: 'inline-type-imports',
28
+ }],
25
29
  '@typescript-eslint/no-explicit-any': 'off',
26
30
  '@typescript-eslint/no-unused-vars': 'off',
27
31
  '@typescript-eslint/no-unused-expressions': 'off',
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@promakeai/template",
3
3
  "private": true,
4
- "version": "0.1.4",
4
+ "version": "0.1.5",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@hookform/resolvers": "^5.2.2",
18
- "@promakeai/dbreact": "^1.0.6",
18
+ "@promakeai/dbreact": "^1.0.7",
19
19
  "@promakeai/customer-backend-client": "^1.1.0",
20
20
  "@promakeai/inspector": "^1.7.4",
21
21
  "@radix-ui/react-accordion": "^1.2.12",
Binary file
Binary file
@@ -35,6 +35,7 @@ export function AppDbProvider({ children }: AppDbProviderProps) {
35
35
  const dbAdapter = new SqliteAdapter({
36
36
  schema,
37
37
  defaultLang: DEFAULT_LANG,
38
+ wasmPath: "/sql-wasm.wasm",
38
39
  });
39
40
 
40
41
  await dbAdapter.connect();