@deessejs/cli 0.0.12 → 0.0.15
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 +5 -6
- package/dist/index.mjs +5 -6
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
\u2705 Database
|
|
6
|
-
\u274C
|
|
7
|
-
\u274C Critical Error: Could not find 'drizzle-kit' inside the CLI package.`)),console.log(r.default.dim("Please try to reinstall the CLI.")),process.exit(1)});m.parse(process.argv);
|
|
2
|
+
var u=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var v=(e,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of f(t))!y.call(e,n)&&n!==r&&c(e,n,{get:()=>t[n],enumerable:!(a=g(t,n))||a.enumerable});return e};var m=(e,t,r)=>(r=e!=null?u(A(e)):{},v(t||!e||!e.__esModule?c(r,"default",{value:e,enumerable:!0}):r,e));var l=require("commander"),i=require("execa"),s=m(require("picocolors")),d=m(require("dotenv"));d.config();var o=new l.Command;o.name("deesse").description("CLI for the DeesseJS framework").version("1.0.0");async function h(){return(process.env.npm_config_user_agent||"").includes("pnpm")?"pnpx":"npx"}async function p(e){console.log(s.default.blue("\u2728 Generating Better Auth schema..."));try{await(0,i.execa)(e,["@better-auth/cli","generate","--output","./.deesse/schema.ts","--config","./src/deesse.config.ts","--yes"],{stdio:"inherit"}),console.log(s.default.green("\u2705 Better Auth schema generated in ./.deesse/schema.ts"))}catch{console.error(s.default.red("\u274C Failed to generate Better Auth schema")),process.exit(1)}}o.command("generate").description("Generate the Better Auth schema").action(async()=>{let e=await h();await p(e)});o.command("migrate").description("Push the schema to the database (Drizzle Push)").option("--dialect <dialect>","Database dialect (postgresql, mysql, sqlite)","postgresql").action(async e=>{let t=await h();console.log(s.default.cyan(`
|
|
3
|
+
Step 1: Synchronizing framework schema...`)),await p(t),console.log(s.default.cyan(`
|
|
4
|
+
Step 2: Pushing schema to database via Drizzle...`));let r=process.env.DATABASE_URL;r||(console.error(s.default.red("\u274C Error: DATABASE_URL environment variable is missing in .env")),process.exit(1));try{await(0,i.execa)(t,["drizzle-kit","push",`--dialect=${e.dialect}`,"--schema=./.deesse/schema.ts",`--url=${r}`],{stdio:"inherit"}),console.log(s.default.green(`
|
|
5
|
+
\u2705 Database migration (push) completed successfully!`))}catch{console.error(s.default.red(`
|
|
6
|
+
\u274C Failed to push schema via Drizzle.`)),process.exit(1)}});o.parse();
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
\u2705 Database
|
|
6
|
-
\u274C
|
|
7
|
-
\u274C Critical Error: Could not find 'drizzle-kit' inside the CLI package.`)),console.log(s.dim("Please try to reinstall the CLI.")),process.exit(1)});l.parse(process.argv);
|
|
2
|
+
import{Command as m}from"commander";import{execa as o}from"execa";import e from"picocolors";import*as a from"dotenv";a.config();var s=new m;s.name("deesse").description("CLI for the DeesseJS framework").version("1.0.0");async function i(){return(process.env.npm_config_user_agent||"").includes("pnpm")?"pnpx":"npx"}async function c(t){console.log(e.blue("\u2728 Generating Better Auth schema..."));try{await o(t,["@better-auth/cli","generate","--output","./.deesse/schema.ts","--config","./src/deesse.config.ts","--yes"],{stdio:"inherit"}),console.log(e.green("\u2705 Better Auth schema generated in ./.deesse/schema.ts"))}catch{console.error(e.red("\u274C Failed to generate Better Auth schema")),process.exit(1)}}s.command("generate").description("Generate the Better Auth schema").action(async()=>{let t=await i();await c(t)});s.command("migrate").description("Push the schema to the database (Drizzle Push)").option("--dialect <dialect>","Database dialect (postgresql, mysql, sqlite)","postgresql").action(async t=>{let r=await i();console.log(e.cyan(`
|
|
3
|
+
Step 1: Synchronizing framework schema...`)),await c(r),console.log(e.cyan(`
|
|
4
|
+
Step 2: Pushing schema to database via Drizzle...`));let n=process.env.DATABASE_URL;n||(console.error(e.red("\u274C Error: DATABASE_URL environment variable is missing in .env")),process.exit(1));try{await o(r,["drizzle-kit","push",`--dialect=${t.dialect}`,"--schema=./.deesse/schema.ts",`--url=${n}`],{stdio:"inherit"}),console.log(e.green(`
|
|
5
|
+
\u2705 Database migration (push) completed successfully!`))}catch{console.error(e.red(`
|
|
6
|
+
\u274C Failed to push schema via Drizzle.`)),process.exit(1)}});s.parse();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deessejs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"description": "DeesseJS CLI",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dotenv": "^17.2.3",
|
|
23
23
|
"drizzle-kit": "^0.31.8",
|
|
24
24
|
"drizzle-orm": "^0.45.1",
|
|
25
|
+
"execa": "^9.6.1",
|
|
25
26
|
"picocolors": "^1.1.1"
|
|
26
27
|
},
|
|
27
28
|
"devDependencies": {
|