vibingbase 0.12.38 → 0.12.39

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.
@@ -12,7 +12,9 @@ import {
12
12
  ScrollRestoration,
13
13
  } from "react-router";
14
14
 
15
- export const meta: Route.MetaFunction = () => [{ title: "Vibingbase" }];
15
+ export const meta: Route.MetaFunction = () => [
16
+ { title: "<%= name %>" },
17
+ ];
16
18
 
17
19
  export function Layout({ children }: PropsWithChildren) {
18
20
  return (
@@ -114,9 +114,9 @@ dependencies = [
114
114
 
115
115
  [[package]]
116
116
  name = "async-lock"
117
- version = "3.4.1"
117
+ version = "3.4.2"
118
118
  source = "registry+https://github.com/rust-lang/crates.io-index"
119
- checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc"
119
+ checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
120
120
  dependencies = [
121
121
  "event-listener",
122
122
  "event-listener-strategy",
@@ -12,7 +12,9 @@ import {
12
12
  ScrollRestoration,
13
13
  } from "react-router";
14
14
 
15
- export const meta: Route.MetaFunction = () => [{ title: "Vibingbase" }];
15
+ export const meta: Route.MetaFunction = () => [
16
+ { title: "<%= name %>" },
17
+ ];
16
18
 
17
19
  export function Layout({ children }: PropsWithChildren) {
18
20
  return (
@@ -114,9 +114,9 @@ dependencies = [
114
114
 
115
115
  [[package]]
116
116
  name = "async-lock"
117
- version = "3.4.1"
117
+ version = "3.4.2"
118
118
  source = "registry+https://github.com/rust-lang/crates.io-index"
119
- checksum = "5fd03604047cee9b6ce9de9f70c6cd540a0520c813cbd49bae61f33ab80ed1dc"
119
+ checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
120
120
  dependencies = [
121
121
  "event-listener",
122
122
  "event-listener-strategy",
package/dist/index.js CHANGED
@@ -1,2 +1,7 @@
1
- import*as t from"@clack/prompts";import{capitalCase as W}from"change-case";import{Command as q}from"commander";import{existsSync as E}from"node:fs";import{rm as L}from"node:fs/promises";import d from"node:path";import _ from"picocolors";function w(){let e=process.env.npm_config_user_agent??"";return e.startsWith("pnpm")?"pnpm":e.startsWith("yarn")?"yarn":e.startsWith("bun")?"bun":"npm"}import{exec as M}from"node:child_process";import{promisify as I}from"node:util";var m=I(M);import{customAlphabet as V}from"nanoid";var A="0123456789abcdefghijklmnopqrstuvwxyz",x=V(A);function D(e){switch(e){case"install":case"start":return!1;default:return!0}}function y(e,r){let a=e==="npm"&&D(r)?`run ${r}`:r;return`${e} ${a}`}function v(e){switch(e){case"npm":return"npx";case"pnpm":return"pnpm exec";case"yarn":return"yarn";case"bun":return"bunx"}}import N from"ejs";import{copyFile as T,mkdir as $,readdir as F,readFile as S,writeFile as z}from"node:fs/promises";import h from"node:path";var k=".template";async function u(e,r,a){await $(r,{recursive:!0});let i=await F(e,{withFileTypes:!0});await Promise.all(i.map(async n=>{let c=n.name.endsWith(k),l=h.join(e,n.name),p=h.join(r,c?n.name.slice(0,-k.length):n.name);if(n.isDirectory())await u(l,p,a);else if(c){let s=await S(l,"utf8");await z(p,N.render(s,a))}else await T(l,p)}))}function P(e){if(!e)return"App name is required";if(e.includes(" "))return"No double spaces allowed"}function C(e){if(!e)return"Directory name is required"}var g={name:"vibingbase",version:"0.12.38",description:"CLI for creating Vibingbase apps",keywords:["vibingbase","vibe-coding","ai-coding","low-code","no-code"],homepage:"https://www.vibingbase.com",bugs:{url:"https://github.com/vibingbase/apps/issues",email:"team@vibingbase.com"},license:"MIT",author:{name:"Vibingbase",email:"team@vibingbase.com"},type:"module",imports:{"#./*":"./*"},exports:{".":{development:"./lib/index.ts",import:"./dist/index.js"}},bin:"./bin/index.js",dependencies:{"@clack/prompts":"^0.11.0","change-case":"^5.4.4",commander:"^14.0.2",ejs:"^3.1.10",nanoid:"^5.1.6",picocolors:"^1.1.1"},devDependencies:{"@types/ejs":"^3.1.5","eslint-config-base":"workspace:^"}};var f=new q;f.name(g.name).version(g.version).description(g.description);var j="Create a new Vibingbase app";f.command("create",{isDefault:!0}).description(j).action(async()=>{t.intro(_.bold(j));let e="my-app",r=await t.text({message:"Directory name:",placeholder:e,defaultValue:e,initialValue:e,validate:C});t.isCancel(r)&&process.exit(0);let a=r.trim(),i=d.isAbsolute(a)?a:d.join(process.cwd(),a);if(E(i)){let b=await t.confirm({message:"Overwrite existing directory?",initialValue:!1});(t.isCancel(b)||!b)&&process.exit(0),await L(i,{recursive:!0,force:!0})}let n=W(d.basename(a)),c=await t.text({message:"App name:",placeholder:n,defaultValue:n,initialValue:n,validate:P});t.isCancel(c)&&process.exit(0);let l=c.trim(),p=await t.confirm({message:"Use Tailwind CSS?",initialValue:!0});t.isCancel(p)&&process.exit(0);let s=await t.select({message:"Package manager:",initialValue:w(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:"yarn"},{value:"bun",label:"bun"}]});t.isCancel(s)&&process.exit(0);let o=t.spinner();o.start("Generating project files..."),await u(d.join(import.meta.dirname,"..","assets",p?"tailwind":"default"),i,{name:l,id:x(),version:"1.0.0",exec:v(s),websiteURL:"https://www.vibingbase.com"}),o.stop("Generated project files!"),o.start(`Installing ${s} dependencies...`),await m(`${s} install`,{cwd:i}),o.stop(`Installed ${s} dependencies!`),o.start("Installing cargo dependencies..."),await m("cargo fetch",{cwd:d.join(i,"src-tauri")}),o.stop("Installed cargo dependencies!"),o.start("Initializing Git..."),await m("git init",{cwd:i}),await m("git add .",{cwd:i}),await m('git commit -m "Initialize repository with Vibingbase CLI"',{cwd:i}),o.stop("Initialized Git!"),t.note(`cd ${a}
2
- ${y(s,"dev")}`,"Next steps"),t.outro("Happy coding!")});await f.parseAsync();
1
+ import{Command as Et}from"commander";import*as i from"@clack/prompts";import{capitalCase as ht}from"change-case";import{existsSync as wt}from"node:fs";import{rm as bt}from"node:fs/promises";import S from"node:path";import yt from"picocolors";var k="Create a new Vibingbase app";function M(){let t=process.env.npm_config_user_agent??"";return t.startsWith("pnpm")?"pnpm":t.startsWith("yarn")?"yarn":t.startsWith("bun")?"bun":"npm"}import{exec as nt}from"node:child_process";import{promisify as at}from"node:util";var h=at(nt);import*as L from"@clack/prompts";var u="Thanks for using Vibingbase!";function m(){L.outro(u),process.exit(0)}import{customAlphabet as st}from"nanoid";var mt="0123456789abcdefghijklmnopqrstuvwxyz",R=st(mt);function pt(t){switch(t){case"install":case"start":return!1;default:return!0}}function U(t,o){let e=t==="npm"&&pt(o)?`run ${o}`:o;return`${t} ${e}`}function z(t){switch(t){case"npm":return"npx";case"pnpm":return"pnpm exec";case"yarn":return"yarn";case"bun":return"bunx"}}import ct from"ejs";import{copyFile as ut,mkdir as lt,readdir as ft,readFile as dt,writeFile as gt}from"node:fs/promises";import _ from"node:path";var W=".template";async function D(t,o,e){await lt(o,{recursive:!0});let n=await ft(t,{withFileTypes:!0});await Promise.all(n.map(async r=>{let a=r.name.endsWith(W),f=_.join(t,r.name),c=_.join(o,a?r.name.slice(0,-W.length):r.name);if(r.isDirectory())await D(f,c,e);else if(a){let d=await dt(f,"utf8");await gt(c,ct.render(d,e))}else await ut(f,c)}))}function G(t){if(!t)return"App name is required";if(t.includes(" "))return"No double spaces allowed"}function H(t){if(!t)return"Directory name is required"}var J=process.env.NODE_ENV==="production"?"https://www.vibingbase.com":"http://localhost:59971";async function q(){i.intro(yt.bold(k));let t="my-app",o=await i.text({message:"Directory name:",placeholder:t,defaultValue:t,initialValue:t,validate:H});i.isCancel(o)&&m();let e=o.trim(),n=S.isAbsolute(e)?e:S.join(process.cwd(),e);if(wt(n)){let E=await i.confirm({message:"Overwrite existing directory?",initialValue:!1});(i.isCancel(E)||!E)&&m(),await bt(n,{recursive:!0,force:!0})}let r=ht(S.basename(e)),a=await i.text({message:"App name:",placeholder:r,defaultValue:r,initialValue:r,validate:G});i.isCancel(a)&&m();let f=a.trim(),c=await i.confirm({message:"Use Tailwind CSS?",initialValue:!0});i.isCancel(c)&&m();let d=await i.select({message:"Package manager:",initialValue:M(),options:[{value:"npm",label:"npm"},{value:"pnpm",label:"pnpm"},{value:"yarn",label:"yarn"},{value:"bun",label:"bun"}]});i.isCancel(d)&&m();let g=i.spinner();g.start("Generating project files..."),await D(S.join(import.meta.dirname,"..","assets",c?"tailwind":"default"),n,{websiteURL:J,name:f,id:R(),version:"1.0.0",exec:z(d)}),g.stop("Generated project files!"),g.start(`Installing ${d} dependencies...`),await h(`${d} install`,{cwd:n}),g.stop(`Installed ${d} dependencies!`),g.start("Installing cargo dependencies..."),await h("cargo fetch",{cwd:S.join(n,"src-tauri")}),g.stop("Installed cargo dependencies!"),g.start("Initializing Git..."),await h("git init",{cwd:n}),await h("git add .",{cwd:n}),await h('git commit -m "Initialize repository with Vibingbase CLI"',{cwd:n}),g.stop("Initialized Git!"),i.note(`cd ${e}
2
+ ${U(d,"dev")}`,"Next steps"),i.outro(u)}import*as p from"@clack/prompts";import Ot from"picocolors";import{createAuthClient as Pt}from"better-auth/client";import{adminClient as At,organizationClient as Tt}from"better-auth/client/plugins";var B=process.env.NODE_ENV==="production"?"https://api.vibingbase.com":"http://localhost:23588";import{readFile as vt}from"node:fs/promises";import kt from"node:path";import{homedir as xt}from"node:os";import St from"node:path";var v=St.join(xt(),".vibingbase");var w=kt.join(v,"auth.json");import{z as Y}from"zod";var C=Y.object({token:Y.string().nullish()});async function I(){try{let t=await vt(w,"utf8");return C.parse(JSON.parse(t))}catch{return{}}}async function K(){return((await I()).token??"")||void 0}import{mkdir as Ct,writeFile as It}from"node:fs/promises";async function Q(t){await Ct(v,{recursive:!0}),await It(w,JSON.stringify(t))}async function P(t){let o=await I();await Q({...o,token:t})}var l=Pt({baseURL:B,basePath:"/v1/auth",plugins:[At(),Tt()],fetchOptions:{throw:!0,auth:{type:"Bearer",token:K},onSuccess:async({response:t})=>{let o=t.headers.get("set-auth-token");o&&await P(o)}}});import{rm as Nt}from"node:fs/promises";async function A(){await Nt(w,{force:!0})}var T="Sign in to your Vibingbase account";import*as ot from"@clack/prompts";import jt from"open";var X=process.env.NODE_ENV==="production"?"https://app.vibingbase.com":"http://localhost:1420";import*as Z from"@clack/prompts";function N(t){Z.note(`
3
+ Email: ${t.user.email}
4
+ Name: ${t.user.name}
5
+ `.trim(),"Account details")}import{createServer as Vt}from"node:http";function tt(){return new Promise(t=>{let o,e=new Promise(r=>{o=r}),n=Vt((r,a)=>{if(r.method==="OPTIONS"){a.writeHead(204,{"access-control-allow-origin":"*","access-control-allow-methods":"POST, OPTIONS","access-control-allow-headers":"content-type"}),a.end();return}if(r.method==="POST"){let f="";r.on("data",c=>{f+=c.toString()}),r.on("end",()=>{try{let{token:c}=C.parse(JSON.parse(f));if(!c)throw new Error("Failed to get auth token");a.writeHead(200,{"access-control-allow-origin":"*"}),a.end("OK"),n.close(),o(c)}catch{a.writeHead(400,{"access-control-allow-origin":"*"}),a.end("Bad Request")}});return}a.writeHead(405,{"access-control-allow-origin":"*"}),a.end("Method Not Allowed")});n.listen(0,"localhost",()=>{let r=n.address();if(typeof r!="object"||!r)throw new Error("Failed to start auth server");t({port:r.port,waitForToken:()=>e})})})}async function V(t){t.start("Opening browser for authentication...");let{port:o,waitForToken:e}=await tt(),n=`${X}/authorize-cli?port=${o}`;await jt(n),t.stop("Opened browser for authentication!"),ot.note(`
6
+ URL: ${n}
7
+ `.trim(),"Authentication details"),t.start("Waiting for authentication...");let r=await e();await P(r);let a=await l.getSession();if(!a)throw new Error("Failed to sign in");return t.stop("Signed in!"),N(a),a}async function et(){p.intro(Ot.bold(T));let t=await l.getSession();if(t){p.log.warn(`You're already signed in as ${t.user.email}!`);let e=await p.confirm({message:"Sign in with a different account?",initialValue:!1});(p.isCancel(e)||!e)&&m(),await l.signOut(),await A()}let o=p.spinner();await V(o),p.outro(u)}import*as s from"@clack/prompts";import $t from"picocolors";import*as b from"@clack/prompts";async function j(t,o){let e=await l.getSession();if(e)return[e,!0];if(!o)return[void 0,!1];b.log.warn("You're currently not signed in!");let n=await b.confirm({message:"Sign in to continue?",initialValue:!0});return(b.isCancel(n)||!n)&&m(),[await V(t),!1]}var O="Sign out of your Vibingbase account";async function rt(){s.intro($t.bold(O));let t=s.spinner(),[o]=await j(t,!1);if(!o){s.log.info("You're already signed out!"),s.outro(u);return}let e=await s.confirm({message:`Sign out of ${o.user.email}?`,initialValue:!1});(s.isCancel(e)||!e)&&m(),t.start("Signing out..."),await l.signOut(),await A(),t.stop("Signed out!"),s.outro(u)}import*as y from"@clack/prompts";import Ft from"picocolors";var $="Show your current Vibingbase account";async function it(){y.intro(Ft.bold($));let t=y.spinner(),[o,e]=await j(t,!0);e&&N(o),y.outro(u)}var F={name:"vibingbase",version:"0.12.39",description:"CLI for creating Vibingbase apps",keywords:["vibingbase","vibe-coding","ai-coding","low-code","no-code"],homepage:"https://www.vibingbase.com",bugs:{url:"https://github.com/vibingbase/apps/issues",email:"team@vibingbase.com"},license:"MIT",author:{name:"Vibingbase",email:"team@vibingbase.com"},type:"module",imports:{"#./*":"./*"},exports:{".":{development:"./lib/index.ts",import:"./dist/index.js"}},bin:"./bin/index.js",dependencies:{"@clack/prompts":"^0.11.0","better-auth":"^1.4.7","change-case":"^5.4.4",commander:"^14.0.2",ejs:"^3.1.10",nanoid:"^5.1.6",open:"^11.0.0",picocolors:"^1.1.1",zod:"^4.2.1"},devDependencies:{"@types/ejs":"^3.1.5","eslint-config-base":"workspace:^"}};var x=new Et;x.name(F.name).version(F.version).description(F.description);x.command("create",{isDefault:!0}).description(k).action(q);x.command("login").description(T).action(et);x.command("logout").description(O).action(rt);x.command("whoami").description($).action(it);await x.parseAsync();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibingbase",
3
- "version": "0.12.38",
3
+ "version": "0.12.39",
4
4
  "description": "CLI for creating Vibingbase apps",
5
5
  "keywords": [
6
6
  "vibingbase",
@@ -31,11 +31,14 @@
31
31
  "bin": "./bin/index.js",
32
32
  "dependencies": {
33
33
  "@clack/prompts": "^0.11.0",
34
+ "better-auth": "^1.4.7",
34
35
  "change-case": "^5.4.4",
35
36
  "commander": "^14.0.2",
36
37
  "ejs": "^3.1.10",
37
38
  "nanoid": "^5.1.6",
38
- "picocolors": "^1.1.1"
39
+ "open": "^11.0.0",
40
+ "picocolors": "^1.1.1",
41
+ "zod": "^4.2.1"
39
42
  },
40
43
  "files": [
41
44
  "assets",