@deessejs/cli 0.0.3 → 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,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- var h=Object.create;var m=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var A=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of f(o))!v.call(e,n)&&n!==t&&m(e,n,{get:()=>o[n],enumerable:!(s=d(o,n))||s.enumerable});return e};var a=(e,o,t)=>(t=e!=null?h(y(e)):{},A(o||!e||!e.__esModule?m(t,"default",{value:e,enumerable:!0}):t,e));var p=require("commander"),r=a(require("picocolors")),l=require("child_process"),c=a(require("fs")),u=a(require("path")),i=new p.Command;i.name("deesse").description("Official Deessejs CLI - Proxy for Better Auth").version("0.1.0");var g=(e,o)=>new Promise(t=>{let s=(0,l.spawn)(e,o,{stdio:"inherit",shell:!0});s.on("exit",n=>{t(n)}),s.on("error",n=>{console.error(r.default.red(`Failed to start command: ${n.message}`)),t(1)})});i.command("generate").description("Generate Better Auth schema for your ORM").option("-o, --output <path>","Where to save the generated schema","./.deesse/schema.ts").option("-c, --config <path>","Path to your Deesse/Auth config file","src/deesse.config.ts").option("-y, --yes","Skip the confirmation prompt",!1).action(async e=>{console.log(r.default.cyan(`
3
- \u{1F6E0}\uFE0F Deesse: Preparing environment...`));let o=u.default.dirname(e.output);if(!c.default.existsSync(o))try{c.default.mkdirSync(o,{recursive:!0}),console.log(r.default.dim(` Created directory: ${o}`))}catch{console.error(r.default.red(` Failed to create directory ${o}`))}let t=["@better-auth/cli@latest","generate"];t.push("--output",e.output),t.push("--config",e.config),e.yes&&t.push("--yes"),console.log(r.default.cyan(`\u{1F4E1} Deesse: Running Better Auth generator...
4
- `)),await g("npx",t)});i.command("migrate").description("Apply the Better Auth schema to your database").option("-c, --config <path>","Path to your Deesse/Auth config file","src/deesse.config.ts").option("-y, --yes","Skip the confirmation prompt",!1).action(async e=>{console.log(r.default.yellow(`
5
- \u{1F680} Deesse: Preparing migration...`));let o=["@better-auth/cli@latest","migrate"];o.push("--config",e.config),e.yes&&o.push("--yes"),console.log(r.default.yellow(`\u{1F4E1} Deesse: Running Better Auth migration...
6
- `)),await g("npx",o)});i.on("command:*",()=>{console.error(r.default.red(`
7
- \u274C Invalid command.`)),console.log(`Run ${r.default.cyan("deesse --help")} for available commands.
8
- `),process.exit(1)});i.parse(process.argv);process.argv.slice(2).length||i.outputHelp();
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,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import{Command as m}from"commander";import t from"picocolors";import{spawn as p}from"child_process";import a from"fs";import l from"path";var n=new m;n.name("deesse").description("Official Deessejs CLI - Proxy for Better Auth").version("0.1.0");var c=(o,e)=>new Promise(r=>{let s=p(o,e,{stdio:"inherit",shell:!0});s.on("exit",i=>{r(i)}),s.on("error",i=>{console.error(t.red(`Failed to start command: ${i.message}`)),r(1)})});n.command("generate").description("Generate Better Auth schema for your ORM").option("-o, --output <path>","Where to save the generated schema","./.deesse/schema.ts").option("-c, --config <path>","Path to your Deesse/Auth config file","src/deesse.config.ts").option("-y, --yes","Skip the confirmation prompt",!1).action(async o=>{console.log(t.cyan(`
3
- \u{1F6E0}\uFE0F Deesse: Preparing environment...`));let e=l.dirname(o.output);if(!a.existsSync(e))try{a.mkdirSync(e,{recursive:!0}),console.log(t.dim(` Created directory: ${e}`))}catch{console.error(t.red(` Failed to create directory ${e}`))}let r=["@better-auth/cli@latest","generate"];r.push("--output",o.output),r.push("--config",o.config),o.yes&&r.push("--yes"),console.log(t.cyan(`\u{1F4E1} Deesse: Running Better Auth generator...
4
- `)),await c("npx",r)});n.command("migrate").description("Apply the Better Auth schema to your database").option("-c, --config <path>","Path to your Deesse/Auth config file","src/deesse.config.ts").option("-y, --yes","Skip the confirmation prompt",!1).action(async o=>{console.log(t.yellow(`
5
- \u{1F680} Deesse: Preparing migration...`));let e=["@better-auth/cli@latest","migrate"];e.push("--config",o.config),o.yes&&e.push("--yes"),console.log(t.yellow(`\u{1F4E1} Deesse: Running Better Auth migration...
6
- `)),await c("npx",e)});n.on("command:*",()=>{console.error(t.red(`
7
- \u274C Invalid command.`)),console.log(`Run ${t.cyan("deesse --help")} for available commands.
8
- `),process.exit(1)});n.parse(process.argv);process.argv.slice(2).length||n.outputHelp();
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.3",
3
+ "version": "0.0.5",
4
4
  "description": "DeesseJS CLI",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
@@ -19,6 +19,7 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "commander": "^14.0.2",
22
+ "dotenv": "^17.2.3",
22
23
  "picocolors": "^1.1.1"
23
24
  },
24
25
  "devDependencies": {