@deessejs/cli 0.0.4 → 0.0.5

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
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
- var f=Object.create;var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var b=(e,s,o,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let t of v(s))!D.call(e,t)&&t!==o&&m(e,t,{get:()=>s[t],enumerable:!(r=y(s,t))||r.enumerable});return e};var i=(e,s,o)=>(o=e!=null?f(A(e)):{},b(s||!e||!e.__esModule?m(o,"default",{value:e,enumerable:!0}):o,e));var d=require("commander"),n=i(require("picocolors")),u=require("child_process"),a=i(require("fs")),p=i(require("path")),h=i(require("dotenv"));h.config();var c=new d.Command;c.name("deesse").description("Deessejs CLI - Zero Config migrations").version("0.1.0");var g=(e,s)=>new Promise(o=>{(0,u.spawn)(e,s,{stdio:"inherit",shell:!0}).on("exit",t=>o(t))});function S(e){return e.startsWith("postgres")||e.startsWith("postgresql")?"postgresql":e.startsWith("mysql")?"mysql":"sqlite"}c.command("generate").description("Generate Better Auth schema").option("-o, --output <path>","Where to save","./.deesse/schema.ts").option("-c, --config <path>","Config file","src/deesse.config.ts").option("-y, --yes","Skip prompt",!1).action(async e=>{let s=p.default.dirname(e.output);a.default.existsSync(s)||a.default.mkdirSync(s,{recursive:!0}),console.log(n.default.cyan("\u{1F6E0}\uFE0F Deesse: Proxying generate to Better Auth...")),await g("npx",["@better-auth/cli@latest","generate","--output",e.output,"--config",e.config,e.yes?"--yes":""])});c.command("migrate").description("Push schema to database without drizzle.config.ts").option("-s, --schema <path>","Your app schema file","./src/db/schema.ts").option("-u, --url <url>","Database URL (defaults to DATABASE_URL env)",process.env.DATABASE_URL).action(async e=>{let s=e.url;s||(console.error(n.default.red(`
3
- \u274C Error: DATABASE_URL not found in .env and no --url provided.`)),process.exit(1));let o=S(s),r="./.deesse/schema.ts",t=a.default.existsSync(e.schema)?e.schema:null;console.log(n.default.yellow(`
4
- \u{1F4E6} Deesse: Migrating to ${n.default.bold(o)}...`));let l=["drizzle-kit","push",`--dialect=${o}`,`--url=${s}`,`--schema=${r}`];t?(l.push(`--schema=${t}`),console.log(n.default.dim(` Including user schema: ${t}`))):console.log(n.default.dim(` User schema not found at ${e.schema}, only pushing auth schema.`)),console.log(n.default.dim(` Targeting: ${s.split("@")[1]||"local db"}
5
- `)),await g("npx",l),console.log(n.default.green(`
6
- \u2705 Database is now in sync.`))});c.parse(process.argv);
2
+ var f=Object.create;var m=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var D=(e,s,o,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of $(s))!x.call(e,n)&&n!==o&&m(e,n,{get:()=>s[n],enumerable:!(r=y(s,n))||r.enumerable});return e};var a=(e,s,o)=>(o=e!=null?f(v(e)):{},D(s||!e||!e.__esModule?m(o,"default",{value:e,enumerable:!0}):o,e));var d=require("commander"),t=a(require("picocolors")),p=require("child_process"),i=a(require("fs")),u=a(require("path")),h=a(require("dotenv"));h.config();var c=new d.Command;c.name("deesse").description("Deessejs CLI - Zero Config migrations").version("0.1.1");var g=e=>new Promise(s=>{(0,p.spawn)(e,{stdio:"inherit",shell:!0}).on("exit",r=>s(r))});function S(e){return e.startsWith("postgres")||e.startsWith("postgresql")?"postgresql":e.startsWith("mysql")?"mysql":"sqlite"}c.command("generate").description("Generate Better Auth schema").option("-o, --output <path>","Where to save","./.deesse/schema.ts").option("-c, --config <path>","Config file","src/deesse.config.ts").option("-y, --yes","Skip prompt",!1).action(async e=>{let s=u.default.dirname(e.output);i.default.existsSync(s)||i.default.mkdirSync(s,{recursive:!0}),console.log(t.default.cyan("\u{1F6E0}\uFE0F Deesse: Preparing schema generation..."));let o=`npx @better-auth/cli@latest generate --output "${e.output}" --config "${e.config}" ${e.yes?"--yes":""}`;await g(o)});c.command("migrate").description("Push schema to database").option("-s, --schema <path>","Your app schema file","./.deesse/schema.ts").option("-u, --url <url>","Database URL",process.env.DATABASE_URL).action(async e=>{let s=e.url;s||(console.error(t.default.red(`
3
+ \u274C Error: DATABASE_URL not found in .env and no --url provided.`)),process.exit(1));let o=S(s),r="./.deesse/schema.ts";i.default.existsSync(r)||(console.error(t.default.red(`
4
+ \u274C Error: Generated schema not found at ${r}.`)),console.log(t.default.yellow(`\u{1F449} Run 'deesse generate' first.
5
+ `)),process.exit(1));let n=i.default.existsSync(e.schema)?e.schema:null;console.log(t.default.yellow(`
6
+ \u{1F4E6} Deesse: Migrating to ${t.default.bold(o)}...`));let l=`npx drizzle-kit push --dialect=${o} --url="${s}" --schema="${r}"`;n?(l+=` --schema="${n}"`,console.log(t.default.dim(` Including user schema: ${n}`))):console.log(t.default.dim(` User schema not found at ${e.schema}, only pushing auth schema.`)),console.log(t.default.dim(" Targeting database...")),await g(l)===0?console.log(t.default.green(`
7
+ \u2705 Database is now in sync.`)):console.error(t.default.red(`
8
+ \u274C Drizzle Kit failed to sync.`))});c.parse(process.argv);
package/dist/index.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import{Command as d}from"commander";import t from"picocolors";import{spawn as u}from"child_process";import i from"fs";import p from"path";import*as l from"dotenv";l.config();var r=new d;r.name("deesse").description("Deessejs CLI - Zero Config migrations").version("0.1.0");var m=(e,s)=>new Promise(n=>{u(e,s,{stdio:"inherit",shell:!0}).on("exit",o=>n(o))});function h(e){return e.startsWith("postgres")||e.startsWith("postgresql")?"postgresql":e.startsWith("mysql")?"mysql":"sqlite"}r.command("generate").description("Generate Better Auth schema").option("-o, --output <path>","Where to save","./.deesse/schema.ts").option("-c, --config <path>","Config file","src/deesse.config.ts").option("-y, --yes","Skip prompt",!1).action(async e=>{let s=p.dirname(e.output);i.existsSync(s)||i.mkdirSync(s,{recursive:!0}),console.log(t.cyan("\u{1F6E0}\uFE0F Deesse: Proxying generate to Better Auth...")),await m("npx",["@better-auth/cli@latest","generate","--output",e.output,"--config",e.config,e.yes?"--yes":""])});r.command("migrate").description("Push schema to database without drizzle.config.ts").option("-s, --schema <path>","Your app schema file","./src/db/schema.ts").option("-u, --url <url>","Database URL (defaults to DATABASE_URL env)",process.env.DATABASE_URL).action(async e=>{let s=e.url;s||(console.error(t.red(`
3
- \u274C Error: DATABASE_URL not found in .env and no --url provided.`)),process.exit(1));let n=h(s),a="./.deesse/schema.ts",o=i.existsSync(e.schema)?e.schema:null;console.log(t.yellow(`
4
- \u{1F4E6} Deesse: Migrating to ${t.bold(n)}...`));let c=["drizzle-kit","push",`--dialect=${n}`,`--url=${s}`,`--schema=${a}`];o?(c.push(`--schema=${o}`),console.log(t.dim(` Including user schema: ${o}`))):console.log(t.dim(` User schema not found at ${e.schema}, only pushing auth schema.`)),console.log(t.dim(` Targeting: ${s.split("@")[1]||"local db"}
5
- `)),await m("npx",c),console.log(t.green(`
6
- \u2705 Database is now in sync.`))});r.parse(process.argv);
2
+ import{Command as d}from"commander";import s from"picocolors";import{spawn as p}from"child_process";import r from"fs";import u from"path";import*as l from"dotenv";l.config();var i=new d;i.name("deesse").description("Deessejs CLI - Zero Config migrations").version("0.1.1");var m=e=>new Promise(t=>{p(e,{stdio:"inherit",shell:!0}).on("exit",n=>t(n))});function h(e){return e.startsWith("postgres")||e.startsWith("postgresql")?"postgresql":e.startsWith("mysql")?"mysql":"sqlite"}i.command("generate").description("Generate Better Auth schema").option("-o, --output <path>","Where to save","./.deesse/schema.ts").option("-c, --config <path>","Config file","src/deesse.config.ts").option("-y, --yes","Skip prompt",!1).action(async e=>{let t=u.dirname(e.output);r.existsSync(t)||r.mkdirSync(t,{recursive:!0}),console.log(s.cyan("\u{1F6E0}\uFE0F Deesse: Preparing schema generation..."));let o=`npx @better-auth/cli@latest generate --output "${e.output}" --config "${e.config}" ${e.yes?"--yes":""}`;await m(o)});i.command("migrate").description("Push schema to database").option("-s, --schema <path>","Your app schema file","./.deesse/schema.ts").option("-u, --url <url>","Database URL",process.env.DATABASE_URL).action(async e=>{let t=e.url;t||(console.error(s.red(`
3
+ \u274C Error: DATABASE_URL not found in .env and no --url provided.`)),process.exit(1));let o=h(t),n="./.deesse/schema.ts";r.existsSync(n)||(console.error(s.red(`
4
+ \u274C Error: Generated schema not found at ${n}.`)),console.log(s.yellow(`\u{1F449} Run 'deesse generate' first.
5
+ `)),process.exit(1));let a=r.existsSync(e.schema)?e.schema:null;console.log(s.yellow(`
6
+ \u{1F4E6} Deesse: Migrating to ${s.bold(o)}...`));let c=`npx drizzle-kit push --dialect=${o} --url="${t}" --schema="${n}"`;a?(c+=` --schema="${a}"`,console.log(s.dim(` Including user schema: ${a}`))):console.log(s.dim(` User schema not found at ${e.schema}, only pushing auth schema.`)),console.log(s.dim(" Targeting database...")),await m(c)===0?console.log(s.green(`
7
+ \u2705 Database is now in sync.`)):console.error(s.red(`
8
+ \u274C Drizzle Kit failed to sync.`))});i.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deessejs/cli",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "DeesseJS CLI",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {