@dataramen/cli 0.0.20 → 0.0.21
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/README.md +3 -6
- package/bin/run.js +2 -1
- package/dist/README.md +3 -6
- package/dist/code/cli.js +2 -1
- package/dist/code/client/assets/index-CBAZG-NN.js +310 -0
- package/dist/code/client/assets/index-Dfbw9I3p.css +1 -0
- package/dist/code/client/dataramen.png +0 -0
- package/dist/code/client/dataramen.svg +85 -0
- package/dist/code/client/index.html +17 -0
- package/dist/code/proxy.js +12 -12
- package/dist/code/web/assets/index-BqtLBd0k.js +310 -0
- package/dist/code/web/assets/index-Dfbw9I3p.css +1 -0
- package/dist/code/web/dataramen.png +0 -0
- package/dist/code/web/dataramen.svg +85 -0
- package/dist/code/web/index.html +17 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# 🍜 DataRamen CLI
|
|
2
2
|
|
|
3
|
-
Your cozy corner for exploring and working with SQL databases
|
|
3
|
+
Your cozy corner for exploring and working with SQL databases - no query writing required.
|
|
4
4
|
|
|
5
5
|
DataRamen CLI lets you launch a powerful, local database exploration app that connects effortlessly to MySQL and PostgreSQL databases. Browse schemas, follow relationships, insert data, and even write raw SQL — all from your browser.
|
|
6
6
|
|
|
7
7
|
## ✨ Features
|
|
8
8
|
|
|
9
9
|
- 🔌 **Connect to PostgreSQL & MySQL**
|
|
10
|
-
Securely plug in your credentials
|
|
10
|
+
Securely plug in your credentials - you're ready to explore.
|
|
11
11
|
|
|
12
12
|
- 🧭 **Visual Schema Explorer**
|
|
13
13
|
Instantly browse tables, columns, types, primary/foreign keys, and relationships.
|
|
@@ -19,14 +19,11 @@ DataRamen CLI lets you launch a powerful, local database exploration app that co
|
|
|
19
19
|
Click to expand related records like nested tables.
|
|
20
20
|
|
|
21
21
|
- ✏️ **Insert & Update Visually**
|
|
22
|
-
Add or modify rows with a visual editor
|
|
22
|
+
Add or modify rows with a visual editor - no SQL errors.
|
|
23
23
|
|
|
24
24
|
- 💾 **Save Queries**
|
|
25
25
|
Save your favorite views for quick access later.
|
|
26
26
|
|
|
27
|
-
- ⌨️ **Raw SQL Mode Available**
|
|
28
|
-
Prefer typing? Drop into SQL mode anytime and run your own queries.
|
|
29
|
-
|
|
30
27
|
## 🛠️ Installation
|
|
31
28
|
|
|
32
29
|
### 1. Install Node.js
|
package/bin/run.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var D=Object.create;var x=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var K=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!G.call(n,s)&&s!==e&&x(n,s,{get:()=>t[s],enumerable:!(o=q(t,s))||o.enumerable});return n};var m=(n,t,e)=>(e=n!=null?D(Y(n)):{},K(t||!n||!n.__esModule?x(e,"default",{value:n,enumerable:!0}):e,n));var B=m(require("yargs")),J=require("yargs/helpers");var S=require("node:os"),E=require("node:path"),Q=(0,S.homedir)();var i="@dataramen/local-server",r=(0,E.join)(Q,".dataramen",".runtime","server");var W=require("node:path"),L=m(require("fs-extra")),V=require("node:child_process");var R=m(require("fs-extra")),h=require("node:path");function _(n){let t;function e(){try{return t||(t=R.readJsonSync(n)),t}catch{return}}return e}var k=_((0,h.join)(__dirname,"..","package.json")),g=_((0,h.join)(r,"package.json"));var p=m(require("fs-extra")),a=require("node:path"),b=require("node:child_process"),A=require("node:util"),d=m(require("yocto-spinner")),f=(0,A.promisify)(b.exec);function O(){try{let n=g();if(!n)return!0;let t=p.readJsonSync((0,a.join)(__dirname,"..","dist","package.json"));return n.version!==t.version}catch{return!0}}async function j(){let n=(0,d.default)({text:"Checking if PM2 is installed"}).start();try{return await f("pm2 -v"),n.success("PM2 already installed"),!0}catch{return n.warning("PM2 not installed"),!1}}async function C(){let n=(0,d.default)({text:"Installing PM2"}).start();try{await f("npm i -g pm2"),n.success("Installed PM2")}catch{n.error("Failed to install PM2"),process.exit(1)}}async function y(){let n=(0,d.default)({text:"Stop running instances of "+i}).start();try{await f(`pm2 stop "${i}"`),n.warning("Stopped "+i)}catch{n.success("No running instances of "+i+" found")}}async function N(){let n=(0,d.default)({text:"Create local server"}).start();p.copySync((0,a.join)(__dirname,"..","dist","code"),(0,a.join)(r,"code")),p.copySync((0,a.join)(__dirname,"..","dist","env",".env.default"),(0,a.join)(r,"env",".env.default")),p.copySync((0,a.join)(__dirname,"..","dist","package.json"),(0,a.join)(r,"package.json")),n.text="Install local server dependencies",await f("npm i",{cwd:r}),n.success("Local server installed")}var I=m(require("yocto-spinner")),w=m(require("open"));var F=require("node:net");async function T(n){return new Promise(t=>{let e=(0,F.createServer)().once("error",()=>{t(!1)}).once("listening",()=>{e.close()}).once("close",()=>t(!0)).listen(n,"0.0.0.0")})}var $=require("fs-extra");var M=require("node:path");function U(...n){let t={};for(let e of n){let o=e.split(`
|
|
3
|
+
`);for(let s of o){let u=s.trim();if(!u||u.startsWith("#"))continue;let v=u.indexOf("=");if(v===-1)continue;let H=u.slice(0,v).trim(),c=u.slice(v+1).trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),t[H]=c}}return{getNumber:e=>nn(t[e]),getString:e=>tn(t[e]),getBoolean:e=>en(t[e])}}function X(n){let t=[];for(let e of n){let o=Z(e);o&&t.push(o)}return U(...t)}var P=X([".env.default",".env"]);function Z(n){try{return(0,$.readFileSync)((0,M.join)(r,"env",n),"utf-8")}catch{return}}function nn(n){if(!n)return;let t=Number(n);if(!isNaN(t)&&n.trim()!=="")return t;throw new Error("Wrong env value type")}function tn(n){if(n){if(typeof n=="string")return n;throw new Error("Wrong env value type")}}function en(n){if(!n)return;let t=n.toLowerCase();if(t==="true")return!0;if(t==="false")return!1;throw new Error("Wrong env value type")}async function rn(){await j()||await C(),await y();try{O()&&await N();let t=P.getNumber("PORT");if(!t)throw new Error("PORT env variable not found");if(!await T(t))throw new Error(`Port ${t} is occupied by another process`);let o=(0,I.default)({text:"Starting new instance of "+i}).start(),s=L.readJsonSync((0,W.join)(r,"package.json"));await f(`pm2 start "${s.main}" --name "${i}" --no-autorestart`,{cwd:r}),o.success("Local server will be available in a couple of seconds"),console.log("You can close this window"),await(0,w.default)(`http://localhost:${t}`),console.log(`App is running at http://localhost:${t} and https://app.dataramen.xyz`)}catch(t){console.error("Failed to start local server",t)}}async function on(){(0,V.execSync)(`pm2 logs ${i}`,{stdio:"inherit"})}async function sn(){await y()}function an(){console.log(`DataRamen CLI version: ${k().version}`),console.log(`DataRamen local server version: ${g().version}`)}async function cn(){let n=P.getNumber("PORT");await(0,w.default)(`http://localhost:${n}`)}var l={start:rn,logs:on,stop:sn,version:an,open:cn};(0,B.default)((0,J.hideBin)(process.argv)).command("start","Default command, start/restart the server",l.start).command(["logs"],"Listen for logs",l.logs).command("stop","Stop the server",l.stop).command("open","Stop the server",l.open).command(["version"],"Show version",l.version).parse();
|
package/dist/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# 🍜 DataRamen CLI
|
|
2
2
|
|
|
3
|
-
Your cozy corner for exploring and working with SQL databases
|
|
3
|
+
Your cozy corner for exploring and working with SQL databases - no query writing required.
|
|
4
4
|
|
|
5
5
|
DataRamen CLI lets you launch a powerful, local database exploration app that connects effortlessly to MySQL and PostgreSQL databases. Browse schemas, follow relationships, insert data, and even write raw SQL — all from your browser.
|
|
6
6
|
|
|
7
7
|
## ✨ Features
|
|
8
8
|
|
|
9
9
|
- 🔌 **Connect to PostgreSQL & MySQL**
|
|
10
|
-
Securely plug in your credentials
|
|
10
|
+
Securely plug in your credentials - you're ready to explore.
|
|
11
11
|
|
|
12
12
|
- 🧭 **Visual Schema Explorer**
|
|
13
13
|
Instantly browse tables, columns, types, primary/foreign keys, and relationships.
|
|
@@ -19,14 +19,11 @@ DataRamen CLI lets you launch a powerful, local database exploration app that co
|
|
|
19
19
|
Click to expand related records like nested tables.
|
|
20
20
|
|
|
21
21
|
- ✏️ **Insert & Update Visually**
|
|
22
|
-
Add or modify rows with a visual editor
|
|
22
|
+
Add or modify rows with a visual editor - no SQL errors.
|
|
23
23
|
|
|
24
24
|
- 💾 **Save Queries**
|
|
25
25
|
Save your favorite views for quick access later.
|
|
26
26
|
|
|
27
|
-
- ⌨️ **Raw SQL Mode Available**
|
|
28
|
-
Prefer typing? Drop into SQL mode anytime and run your own queries.
|
|
29
|
-
|
|
30
27
|
## 🛠️ Installation
|
|
31
28
|
|
|
32
29
|
### 1. Install Node.js
|
package/dist/code/cli.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var
|
|
2
|
+
var D=Object.create;var x=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var z=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var K=(n,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of z(t))!G.call(n,s)&&s!==e&&x(n,s,{get:()=>t[s],enumerable:!(o=q(t,s))||o.enumerable});return n};var m=(n,t,e)=>(e=n!=null?D(Y(n)):{},K(t||!n||!n.__esModule?x(e,"default",{value:n,enumerable:!0}):e,n));var B=m(require("yargs")),J=require("yargs/helpers");var S=require("node:os"),E=require("node:path"),Q=(0,S.homedir)();var i="@dataramen/local-server",r=(0,E.join)(Q,".dataramen",".runtime","server");var W=require("node:path"),L=m(require("fs-extra")),V=require("node:child_process");var R=m(require("fs-extra")),h=require("node:path");function _(n){let t;function e(){try{return t||(t=R.readJsonSync(n)),t}catch{return}}return e}var k=_((0,h.join)(__dirname,"..","package.json")),g=_((0,h.join)(r,"package.json"));var p=m(require("fs-extra")),a=require("node:path"),b=require("node:child_process"),A=require("node:util"),d=m(require("yocto-spinner")),f=(0,A.promisify)(b.exec);function O(){try{let n=g();if(!n)return!0;let t=p.readJsonSync((0,a.join)(__dirname,"..","dist","package.json"));return n.version!==t.version}catch{return!0}}async function j(){let n=(0,d.default)({text:"Checking if PM2 is installed"}).start();try{return await f("pm2 -v"),n.success("PM2 already installed"),!0}catch{return n.warning("PM2 not installed"),!1}}async function C(){let n=(0,d.default)({text:"Installing PM2"}).start();try{await f("npm i -g pm2"),n.success("Installed PM2")}catch{n.error("Failed to install PM2"),process.exit(1)}}async function y(){let n=(0,d.default)({text:"Stop running instances of "+i}).start();try{await f(`pm2 stop "${i}"`),n.warning("Stopped "+i)}catch{n.success("No running instances of "+i+" found")}}async function N(){let n=(0,d.default)({text:"Create local server"}).start();p.copySync((0,a.join)(__dirname,"..","dist","code"),(0,a.join)(r,"code")),p.copySync((0,a.join)(__dirname,"..","dist","env",".env.default"),(0,a.join)(r,"env",".env.default")),p.copySync((0,a.join)(__dirname,"..","dist","package.json"),(0,a.join)(r,"package.json")),n.text="Install local server dependencies",await f("npm i",{cwd:r}),n.success("Local server installed")}var I=m(require("yocto-spinner")),w=m(require("open"));var F=require("node:net");async function T(n){return new Promise(t=>{let e=(0,F.createServer)().once("error",()=>{t(!1)}).once("listening",()=>{e.close()}).once("close",()=>t(!0)).listen(n,"0.0.0.0")})}var $=require("fs-extra");var M=require("node:path");function U(...n){let t={};for(let e of n){let o=e.split(`
|
|
3
|
+
`);for(let s of o){let u=s.trim();if(!u||u.startsWith("#"))continue;let v=u.indexOf("=");if(v===-1)continue;let H=u.slice(0,v).trim(),c=u.slice(v+1).trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),t[H]=c}}return{getNumber:e=>nn(t[e]),getString:e=>tn(t[e]),getBoolean:e=>en(t[e])}}function X(n){let t=[];for(let e of n){let o=Z(e);o&&t.push(o)}return U(...t)}var P=X([".env.default",".env"]);function Z(n){try{return(0,$.readFileSync)((0,M.join)(r,"env",n),"utf-8")}catch{return}}function nn(n){if(!n)return;let t=Number(n);if(!isNaN(t)&&n.trim()!=="")return t;throw new Error("Wrong env value type")}function tn(n){if(n){if(typeof n=="string")return n;throw new Error("Wrong env value type")}}function en(n){if(!n)return;let t=n.toLowerCase();if(t==="true")return!0;if(t==="false")return!1;throw new Error("Wrong env value type")}async function rn(){await j()||await C(),await y();try{O()&&await N();let t=P.getNumber("PORT");if(!t)throw new Error("PORT env variable not found");if(!await T(t))throw new Error(`Port ${t} is occupied by another process`);let o=(0,I.default)({text:"Starting new instance of "+i}).start(),s=L.readJsonSync((0,W.join)(r,"package.json"));await f(`pm2 start "${s.main}" --name "${i}" --no-autorestart`,{cwd:r}),o.success("Local server will be available in a couple of seconds"),console.log("You can close this window"),await(0,w.default)(`http://localhost:${t}`),console.log(`App is running at http://localhost:${t} and https://app.dataramen.xyz`)}catch(t){console.error("Failed to start local server",t)}}async function on(){(0,V.execSync)(`pm2 logs ${i}`,{stdio:"inherit"})}async function sn(){await y()}function an(){console.log(`DataRamen CLI version: ${k().version}`),console.log(`DataRamen local server version: ${g().version}`)}async function cn(){let n=P.getNumber("PORT");await(0,w.default)(`http://localhost:${n}`)}var l={start:rn,logs:on,stop:sn,version:an,open:cn};(0,B.default)((0,J.hideBin)(process.argv)).command("start","Default command, start/restart the server",l.start).command(["logs"],"Listen for logs",l.logs).command("stop","Stop the server",l.stop).command("open","Stop the server",l.open).command(["version"],"Show version",l.version).parse();
|