@deessejs/cli 0.0.1 → 0.0.3
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 +7 -7
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
\u{
|
|
4
|
-
`))});
|
|
5
|
-
\u{
|
|
6
|
-
`))});
|
|
7
|
-
\u274C
|
|
8
|
-
`),process.exit(1)});
|
|
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();
|
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as
|
|
3
|
-
\u{
|
|
4
|
-
`))});n.command("
|
|
5
|
-
\u{
|
|
6
|
-
`))});n.on("command:*",()=>{console.error(
|
|
7
|
-
\u274C
|
|
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
8
|
`),process.exit(1)});n.parse(process.argv);process.argv.slice(2).length||n.outputHelp();
|