@deessejs/cli 0.0.8 → 0.0.10
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 -9
- package/dist/index.mjs +5 -9
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
3
|
-
\u274C Error: DATABASE_URL not found in .env`)),process.exit(1));let
|
|
4
|
-
\
|
|
5
|
-
|
|
6
|
-
\
|
|
7
|
-
\u2705 Database is now in sync.`)):(console.error(o.default.red(`
|
|
8
|
-
\u274C Migration failed.`)),m||(console.log(o.default.yellow(`
|
|
9
|
-
\u{1F4A1} Tip: To avoid npx isolation issues, try installing drizzle-kit locally:`)),console.log(o.default.cyan(` pnpm add -D drizzle-kit
|
|
10
|
-
`))))});d.parse(process.argv);
|
|
2
|
+
var v=Object.create;var p=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var D=(e,t,s,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of $(t))!x.call(e,n)&&n!==s&&p(e,n,{get:()=>t[n],enumerable:!(o=q(t,n))||o.enumerable});return e};var l=(e,t,s)=>(s=e!=null?v(k(e)):{},D(t||!e||!e.__esModule?p(s,"default",{value:e,enumerable:!0}):s,e));var z=()=>typeof document>"u"?new URL(`file:${__filename}`).href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"?document.currentScript.src:new URL("main.js",document.baseURI).href,u=z();var f=require("commander"),r=l(require("picocolors")),h=require("child_process"),i=l(require("fs")),c=l(require("path")),g=require("module"),y=l(require("dotenv")),S=typeof require<"u"?require:(0,g.createRequire)(u);y.config();var m=new f.Command;m.name("deesse").description("Deessejs CLI - Zero Config migrations").version("0.1.6");function U(){try{let e=S.resolve("drizzle-kit/package.json"),t=c.default.dirname(e),s=JSON.parse(i.default.readFileSync(e,"utf-8")),o=typeof s.bin=="string"?s.bin:s.bin["drizzle-kit"],n=c.default.resolve(t,o);if(i.default.existsSync(n))return n}catch{}return null}var b=e=>new Promise(t=>{let s=c.default.join(c.default.dirname(S.resolve("@deessejs/cli/package.json")),"node_modules");(0,h.spawn)(e,{stdio:"inherit",shell:!0,env:{...process.env,NODE_PATH:s}}).on("exit",n=>t(n))});function w(e){return e.startsWith("postgres")||e.startsWith("postgresql")?"postgresql":e.startsWith("mysql")?"mysql":"sqlite"}m.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=c.default.dirname(e.output);i.default.existsSync(t)||i.default.mkdirSync(t,{recursive:!0}),console.log(r.default.cyan("\u{1F6E0}\uFE0F Deesse: Generating schema...")),await b(`npx -y @better-auth/cli@latest generate --output "${e.output}" --config "${e.config}" ${e.yes?"--yes":""}`)});m.command("migrate").description("Push schema to database").option("-s, --schema <path>","Your app schema file","./src/db/schema.ts").option("-u, --url <url>","Database URL",process.env.DATABASE_URL).action(async e=>{let t=e.url;t||(console.error(r.default.red(`
|
|
3
|
+
\u274C Error: DATABASE_URL not found in .env`)),process.exit(1));let s=w(t),o="./.deesse/schema.ts",n=i.default.existsSync(e.schema)?e.schema:null;console.log(r.default.yellow(`
|
|
4
|
+
\u{1F4E6} Deesse: Syncing database...`));let d=U(),a="";d?a=`node "${d}" push --dialect=${s} --url="${t}" --schema="${o}"`:(console.log(r.default.dim(" Using npx fallback...")),a=`npx -y drizzle-kit push --dialect=${s} --url="${t}" --schema="${o}"`),n&&(a+=` --schema="${n}"`),await b(a)===0?console.log(r.default.green(`
|
|
5
|
+
\u2705 Database is now in sync.`)):console.error(r.default.red(`
|
|
6
|
+
\u274C Migration failed.`))});m.parse(process.argv);
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as
|
|
3
|
-
\u274C Error: DATABASE_URL not found in .env`)),process.exit(1));let t=
|
|
4
|
-
\
|
|
5
|
-
|
|
6
|
-
\
|
|
7
|
-
\u2705 Database is now in sync.`)):(console.error(s.red(`
|
|
8
|
-
\u274C Migration failed.`)),d||(console.log(s.yellow(`
|
|
9
|
-
\u{1F4A1} Tip: To avoid npx isolation issues, try installing drizzle-kit locally:`)),console.log(s.cyan(` pnpm add -D drizzle-kit
|
|
10
|
-
`))))});l.parse(process.argv);
|
|
2
|
+
var m=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(s,t)=>(typeof require<"u"?require:s)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});import{Command as g}from"commander";import o from"picocolors";import{spawn as f}from"child_process";import i from"fs";import a from"path";import{createRequire as y}from"module";import*as p from"dotenv";var u=typeof m<"u"?m:y(import.meta.url);p.config();var l=new g;l.name("deesse").description("Deessejs CLI - Zero Config migrations").version("0.1.6");function b(){try{let e=u.resolve("drizzle-kit/package.json"),s=a.dirname(e),t=JSON.parse(i.readFileSync(e,"utf-8")),r=typeof t.bin=="string"?t.bin:t.bin["drizzle-kit"],n=a.resolve(s,r);if(i.existsSync(n))return n}catch{}return null}var h=e=>new Promise(s=>{let t=a.join(a.dirname(u.resolve("@deessejs/cli/package.json")),"node_modules");f(e,{stdio:"inherit",shell:!0,env:{...process.env,NODE_PATH:t}}).on("exit",n=>s(n))});function v(e){return e.startsWith("postgres")||e.startsWith("postgresql")?"postgresql":e.startsWith("mysql")?"mysql":"sqlite"}l.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=a.dirname(e.output);i.existsSync(s)||i.mkdirSync(s,{recursive:!0}),console.log(o.cyan("\u{1F6E0}\uFE0F Deesse: Generating schema...")),await h(`npx -y @better-auth/cli@latest generate --output "${e.output}" --config "${e.config}" ${e.yes?"--yes":""}`)});l.command("migrate").description("Push schema to database").option("-s, --schema <path>","Your app schema file","./src/db/schema.ts").option("-u, --url <url>","Database URL",process.env.DATABASE_URL).action(async e=>{let s=e.url;s||(console.error(o.red(`
|
|
3
|
+
\u274C Error: DATABASE_URL not found in .env`)),process.exit(1));let t=v(s),r="./.deesse/schema.ts",n=i.existsSync(e.schema)?e.schema:null;console.log(o.yellow(`
|
|
4
|
+
\u{1F4E6} Deesse: Syncing database...`));let d=b(),c="";d?c=`node "${d}" push --dialect=${t} --url="${s}" --schema="${r}"`:(console.log(o.dim(" Using npx fallback...")),c=`npx -y drizzle-kit push --dialect=${t} --url="${s}" --schema="${r}"`),n&&(c+=` --schema="${n}"`),await h(c)===0?console.log(o.green(`
|
|
5
|
+
\u2705 Database is now in sync.`)):console.error(o.red(`
|
|
6
|
+
\u274C Migration failed.`))});l.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deessejs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "DeesseJS CLI",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
"access": "public"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
|
-
"build": "tsup src/index.ts --format cjs,esm --clean --minify",
|
|
16
|
+
"build": "tsup src/index.ts --format cjs,esm --clean --minify --shims",
|
|
17
17
|
"dev": "tsup src/index.ts --format esm --watch",
|
|
18
18
|
"prepublishOnly": "pnpm build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"commander": "^14.0.2",
|
|
22
22
|
"dotenv": "^17.2.3",
|
|
23
|
+
"drizzle-kit": "^0.31.8",
|
|
24
|
+
"drizzle-orm": "^0.45.1",
|
|
23
25
|
"picocolors": "^1.1.1"
|
|
24
26
|
},
|
|
25
27
|
"devDependencies": {
|