From 17cd40e1d5223a2d35ce1e7c4aaf318e83eba111 Mon Sep 17 00:00:00 2001 From: Oskar Dudycz Date: Tue, 1 Oct 2024 12:43:59 +0200 Subject: [PATCH] Added Pongo shell --- samples/simple-ts/package-lock.json | 665 +++--------------- samples/simple-ts/package.json | 5 +- src/package-lock.json | 175 +++-- src/package.json | 8 +- src/packages/dumbo/package.json | 2 +- .../dumbo/src/core/serializer/index.ts | 5 +- src/packages/pongo/package.json | 12 +- src/packages/pongo/src/cli.ts | 3 +- src/packages/pongo/src/commandLine/index.ts | 1 + src/packages/pongo/src/commandLine/shell.ts | 131 ++++ 10 files changed, 356 insertions(+), 651 deletions(-) create mode 100644 src/packages/pongo/src/commandLine/shell.ts diff --git a/samples/simple-ts/package-lock.json b/samples/simple-ts/package-lock.json index 88b0dd8..2cbe85e 100644 --- a/samples/simple-ts/package-lock.json +++ b/samples/simple-ts/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "dependencies": { - "@event-driven-io/pongo": "0.14.4" + "@event-driven-io/pongo": "0.15.0-alpha.1" }, "devDependencies": { "@types/node": "^20.11.30", @@ -27,260 +27,14 @@ "typescript": "5.3.3" } }, - "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "aix" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", - "cpu": [ - "loong64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", - "cpu": [ - "mips64el" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", - "cpu": [ - "s390x" - ], - "dev": true, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", "optional": true, - "os": [ - "linux" - ], + "peer": true, "engines": { - "node": ">=12" + "node": ">=0.1.90" } }, "node_modules/@esbuild/linux-x64": { @@ -299,102 +53,6 @@ "node": ">=12" } }, - "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "netbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "openbsd" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "sunos" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, - "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -474,8 +132,8 @@ } }, "node_modules/@event-driven-io/dumbo": { - "version": "0.10.0", - "resolved": "https://registry.npmjs.org/@event-driven-io/dumbo/-/dumbo-0.10.0.tgz", + "version": "0.11.0-alpha.1", + "resolved": "https://registry.npmjs.org/@event-driven-io/dumbo/-/dumbo-0.11.0-alpha.1.tgz", "integrity": "sha512-c0yXK+AWatyAliq9Xw5aircWOeHduAIDl5yWm173XFoYSPhI7a5kK+fMfnFz39bFZ6UiDJ3JrUWhKFve0eJsnA==", "peer": true, "peerDependencies": { @@ -487,22 +145,22 @@ } }, "node_modules/@event-driven-io/pongo": { - "version": "0.14.4", - "resolved": "https://registry.npmjs.org/@event-driven-io/pongo/-/pongo-0.14.4.tgz", - "integrity": "sha512-VVX3Esm/9kyZWCbMLOvxlnDM6qiJaIm/u9Hajt0FZqvtJAboLyIfjqodCNg/g69qx6XF6wURhw1xJoA0O9lhFg==", - "dependencies": { - "pg-connection-string": "^2.6.4" - }, + "version": "0.15.0-alpha.1", + "resolved": "https://registry.npmjs.org/@event-driven-io/pongo/-/pongo-0.15.0-alpha.1.tgz", + "integrity": "sha512-6tjSGfG2LVRlFvTTl9OEtY/x7fahaV2xeo4xuXgLWcbeyT+lVpRCeris81U1GUa3O36oRhN/nosF9xjLE2Gdiw==", "bin": { "pongo": "dist/cli.js" }, "peerDependencies": { - "@event-driven-io/dumbo": "0.10.0", + "@event-driven-io/dumbo": "0.11.0-alpha.1", "@types/mongodb": "^4.0.7", "@types/pg": "^8.11.6", "@types/uuid": "^10.0.0", + "chalk": "^5.3.0", + "cli-table3": "^0.6.5", "commander": "^12.1.0", "pg": "^8.12.0", + "pg-connection-string": "^2.6.4", "uuid": "^10.0.0" } }, @@ -721,149 +379,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz", - "integrity": "sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-android-arm64": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz", - "integrity": "sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ] - }, - "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz", - "integrity": "sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz", - "integrity": "sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz", - "integrity": "sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz", - "integrity": "sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz", - "integrity": "sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz", - "integrity": "sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz", - "integrity": "sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==", - "cpu": [ - "ppc64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz", - "integrity": "sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==", - "cpu": [ - "riscv64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz", - "integrity": "sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==", - "cpu": [ - "s390x" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, "node_modules/@rollup/rollup-linux-x64-gnu": { "version": "4.20.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz", @@ -890,45 +405,6 @@ "linux" ] }, - "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz", - "integrity": "sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz", - "integrity": "sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.20.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz", - "integrity": "sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -1234,7 +710,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -1370,16 +845,12 @@ } }, "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "peer": true, "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" @@ -1421,6 +892,41 @@ "node": ">= 6" } }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "peer": true, + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-table3/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "peer": true + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1712,6 +1218,22 @@ "concat-map": "0.0.1" } }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1780,7 +1302,7 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/execa": { @@ -1955,20 +1477,6 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/get-stream": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", @@ -2155,14 +1663,13 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -2176,7 +1683,7 @@ "is-extglob": "^2.1.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/is-number": { @@ -2387,7 +1894,7 @@ "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", "dev": true, "engines": { - "node": ">= 0.10.0" + "node": ">= 0.11.0-alpha.1" } }, "node_modules/merge-stream": { @@ -2545,7 +2052,7 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/npm-normalize-package-bin": { @@ -2612,7 +2119,7 @@ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/obuf": { @@ -2719,7 +2226,7 @@ "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/path-key": { @@ -2793,7 +2300,8 @@ "node_modules/pg-connection-string": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.4.tgz", - "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==" + "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==", + "peer": true }, "node_modules/pg-int8": { "version": "1.0.1", @@ -2877,7 +2385,7 @@ "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/pg/node_modules/postgres-date": { @@ -2886,7 +2394,7 @@ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/pg/node_modules/postgres-interval": { @@ -2898,7 +2406,7 @@ "xtend": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/pgpass": { @@ -3137,7 +2645,7 @@ "dev": true, "engines": { "iojs": ">=1.0.0", - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/rimraf": { @@ -3445,7 +2953,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -3837,7 +3344,7 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/wrap-ansi": { diff --git a/samples/simple-ts/package.json b/samples/simple-ts/package.json index 47dbc3f..08d1599 100644 --- a/samples/simple-ts/package.json +++ b/samples/simple-ts/package.json @@ -25,7 +25,8 @@ "test:unit:watch": "glob -d -c \"node --import tsx --test --watch\" **/*.unit.spec.ts", "test:int:watch": "glob -d -c \"node --import tsx --test --watch\" **/*.int.spec.ts", "test:e2e:watch": "glob -d -c \"node --import tsx --test --watch\" **/*.e2e.spec.ts", - "migrate": "pongo migrate run --config ./dist/pongo.config.js --connectionString postgresql://postgres:postgres@localhost:5432/postgres" + "migrate": "pongo migrate run --config ./dist/pongo.config.js --connectionString postgresql://postgres:postgres@localhost:5432/postgres", + "shell": "pongo shell" }, "repository": { "type": "git", @@ -62,6 +63,6 @@ "dist" ], "dependencies": { - "@event-driven-io/pongo": "0.14.4" + "@event-driven-io/pongo": "0.15.0-alpha.1" } } diff --git a/src/package-lock.json b/src/package-lock.json index 2843e43..7cb0036 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1,12 +1,12 @@ { "name": "@event-driven-io/pongo-core", - "version": "0.14.4", + "version": "0.15.0-alpha.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@event-driven-io/pongo-core", - "version": "0.14.4", + "version": "0.15.0-alpha.1", "workspaces": [ "packages/dumbo", "packages/pongo" @@ -15,7 +15,6 @@ "@types/benchmark": "^2.1.5", "0x": "^4.1.4", "benchmark": "^2.1.4", - "commander": "^12.1.0", "cpy-cli": "^5.0.0", "dotenv": "^16.4.5" }, @@ -48,6 +47,9 @@ "node": ">=20.11.1" }, "peerDependencies": { + "chalk": "^5.3.0", + "cli-table3": "^0.6.5", + "commander": "^12.1.0", "pg": "^8.12.0", "pg-connection-string": "^2.6.4" } @@ -298,6 +300,16 @@ "integrity": "sha512-wMue2Sy4GAVTk6Ic4tJVcnfdau+gx2EnG7S+uAEe+TWJFqE4YoWN4/H8MSLj4eYJKxGg26lZwboEniNiNwZQ6Q==", "dev": true }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", @@ -1686,7 +1698,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, "engines": { "node": ">=8" } @@ -2170,7 +2181,7 @@ "shell-quote": "^1.6.1", "stream-browserify": "^2.0.0", "stream-http": "^2.0.0", - "string_decoder": "~0.10.0", + "string_decoder": "~0.11.0-alpha.1", "subarg": "^1.0.0", "syntax-error": "^1.1.1", "through2": "^2.0.0", @@ -2338,6 +2349,11 @@ "util-deprecate": "~1.0.1" } }, + "node_modules/browserify/node_modules/concat-stream/node_modules/string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + }, "node_modules/browserify/node_modules/events": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", @@ -2410,9 +2426,9 @@ "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, "node_modules/browserify/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.11.10.tgz", + "integrity": "sha512-zUJCCW4PWae2PJ4G80jGK1ITuaZsp/6pUmo4n47Jko8Mq/A0yXLyyb+xntKKTPxYzWa2eZMVwMOLRMu1myE/WQ==" }, "node_modules/bson": { "version": "6.8.0", @@ -2501,7 +2517,7 @@ "integrity": "sha512-s6webAy+R4SR8XVuJWt2V2rGvhnrhxN+9S15GNuTK3wKPOXFF6RNc+8ug2XhH+2s4f+uudG4kUVYmYOQWL2g0Q==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/cac": { @@ -2555,16 +2571,12 @@ } }, "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "peer": true, "engines": { - "node": ">=10" + "node": "^12.17.0 || ^14.13 || >=16.0.0" }, "funding": { "url": "https://github.com/chalk/chalk?sponsor=1" @@ -2646,12 +2658,47 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-table3": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", + "integrity": "sha512-+W/5efTR7y5HRD7gACw9yQjqMVvEMLBHmboM/kPWam+H+Hmyrgjh6YncVKK122YZkXrLudzTuAukUw9FnMf7IQ==", + "peer": true, + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, + "node_modules/cli-table3/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "peer": true + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "peer": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/code-point-at": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/color-convert": { @@ -2688,13 +2735,14 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/commander": { "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "peer": true, "engines": { "node": ">=18" } @@ -3784,6 +3832,22 @@ "concat-map": "0.0.1" } }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, "node_modules/eslint/node_modules/eslint-visitor-keys": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", @@ -3887,7 +3951,7 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/event-target-shim": { @@ -4302,7 +4366,7 @@ "ansi-regex": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/has-ansi/node_modules/ansi-regex": { @@ -4310,7 +4374,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/has-flag": { @@ -4544,7 +4608,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/insert-module-globals": { @@ -4613,14 +4677,13 @@ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true, "engines": { "node": ">=8" } @@ -4633,7 +4696,7 @@ "is-extglob": "^2.1.1" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/is-number": { @@ -5066,7 +5129,7 @@ "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", "dev": true, "engines": { - "node": ">= 0.10.0" + "node": ">= 0.11.0-alpha.1" } }, "node_modules/meow": { @@ -5093,7 +5156,7 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/merge-stream": { @@ -5463,7 +5526,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/nanobench/node_modules/ansi-styles": { @@ -5471,7 +5534,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/nanobench/node_modules/chalk": { @@ -5486,7 +5549,7 @@ "supports-color": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/nanobench/node_modules/escape-string-regexp": { @@ -5505,7 +5568,7 @@ "ansi-regex": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/nanobench/node_modules/supports-color": { @@ -5590,7 +5653,7 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/npm-normalize-package-bin": { @@ -5656,7 +5719,7 @@ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/object-assign": { @@ -5665,7 +5728,7 @@ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/object-inspect": { @@ -5933,7 +5996,7 @@ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/path-key": { @@ -6073,7 +6136,8 @@ "node_modules/pg-connection-string": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.4.tgz", - "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==" + "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==", + "peer": true }, "node_modules/pg-int8": { "version": "1.0.1", @@ -6153,7 +6217,7 @@ "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/pg/node_modules/postgres-date": { @@ -6162,7 +6226,7 @@ "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", "peer": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/pg/node_modules/postgres-interval": { @@ -6174,7 +6238,7 @@ "xtend": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/pgpass": { @@ -6764,7 +6828,7 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "engines": { "iojs": ">=1.0.0", - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/rfdc": { @@ -7028,7 +7092,7 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==", "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/single-line-log/node_modules/is-fullwidth-code-point": { @@ -7039,7 +7103,7 @@ "number-is-nan": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/single-line-log/node_modules/string-width": { @@ -7052,7 +7116,7 @@ "strip-ansi": "^3.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/single-line-log/node_modules/strip-ansi": { @@ -7063,7 +7127,7 @@ "ansi-regex": "^2.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/slash": { @@ -7093,7 +7157,7 @@ "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/source-map/node_modules/tr46": { @@ -7142,7 +7206,7 @@ "integrity": "sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/split-ca": { @@ -7442,7 +7506,6 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -8438,7 +8501,7 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=0.11.0-alpha.1" } }, "node_modules/wrap-ansi": { @@ -8597,7 +8660,7 @@ }, "packages/dumbo": { "name": "@event-driven-io/dumbo", - "version": "0.10.0", + "version": "0.11.0-alpha.2", "devDependencies": { "@types/node": "22.4.1" }, @@ -8611,10 +8674,7 @@ }, "packages/pongo": { "name": "@event-driven-io/pongo", - "version": "0.14.4", - "dependencies": { - "pg-connection-string": "^2.6.4" - }, + "version": "0.15.0-alpha.1", "bin": { "pongo": "dist/cli.js" }, @@ -8622,12 +8682,15 @@ "@types/node": "22.4.1" }, "peerDependencies": { - "@event-driven-io/dumbo": "0.10.0", + "@event-driven-io/dumbo": "0.11.0-alpha.2", "@types/mongodb": "^4.0.7", "@types/pg": "^8.11.6", "@types/uuid": "^10.0.0", + "chalk": "^5.3.0", + "cli-table3": "^0.6.5", "commander": "^12.1.0", "pg": "^8.12.0", + "pg-connection-string": "^2.6.4", "uuid": "^10.0.0" } } diff --git a/src/package.json b/src/package.json index 49808f6..92bd007 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "@event-driven-io/pongo-core", - "version": "0.14.4", + "version": "0.15.0-alpha.2", "description": "Pongo - Mongo with strong consistency on top of Postgres", "type": "module", "engines": { @@ -89,13 +89,15 @@ }, "peerDependencies": { "pg": "^8.12.0", - "pg-connection-string": "^2.6.4" + "pg-connection-string": "^2.6.4", + "chalk": "^5.3.0", + "cli-table3": "^0.6.5", + "commander": "^12.1.0" }, "dependencies": { "@types/benchmark": "^2.1.5", "0x": "^4.1.4", "benchmark": "^2.1.4", - "commander": "^12.1.0", "cpy-cli": "^5.0.0", "dotenv": "^16.4.5" }, diff --git a/src/packages/dumbo/package.json b/src/packages/dumbo/package.json index aaa1d37..e9cc6d8 100644 --- a/src/packages/dumbo/package.json +++ b/src/packages/dumbo/package.json @@ -1,6 +1,6 @@ { "name": "@event-driven-io/dumbo", - "version": "0.10.0", + "version": "0.11.0-alpha.2", "description": "Dumbo - tools for dealing with PostgreSQL", "type": "module", "scripts": { diff --git a/src/packages/dumbo/src/core/serializer/index.ts b/src/packages/dumbo/src/core/serializer/index.ts index 034aa98..9696117 100644 --- a/src/packages/dumbo/src/core/serializer/index.ts +++ b/src/packages/dumbo/src/core/serializer/index.ts @@ -1,4 +1,4 @@ -interface Serializer< +export interface Serializer< Payload, SerializeOptions = never, DeserializeOptions = SerializeOptions, @@ -7,10 +7,9 @@ interface Serializer< deserialize(payload: Payload, options?: DeserializeOptions): T; } -interface ObjectCodec { +export interface ObjectCodec { encode(object: T): Payload; decode(payload: Payload): T; } export * from './json'; -export { type ObjectCodec, type Serializer }; diff --git a/src/packages/pongo/package.json b/src/packages/pongo/package.json index ee02bbe..89d52f2 100644 --- a/src/packages/pongo/package.json +++ b/src/packages/pongo/package.json @@ -1,6 +1,6 @@ { "name": "@event-driven-io/pongo", - "version": "0.14.4", + "version": "0.15.0-alpha.2", "description": "Pongo - Mongo with strong consistency on top of Postgres", "type": "module", "scripts": { @@ -87,18 +87,18 @@ "pongo": "./dist/cli.js" }, "peerDependencies": { - "@event-driven-io/dumbo": "0.10.0", + "@event-driven-io/dumbo": "0.11.0-alpha.2", "@types/mongodb": "^4.0.7", "@types/pg": "^8.11.6", "@types/uuid": "^10.0.0", "pg": "^8.12.0", "uuid": "^10.0.0", - "commander": "^12.1.0" + "chalk": "^5.3.0", + "cli-table3": "^0.6.5", + "commander": "^12.1.0", + "pg-connection-string": "^2.6.4" }, "devDependencies": { "@types/node": "22.4.1" - }, - "dependencies": { - "pg-connection-string": "^2.6.4" } } diff --git a/src/packages/pongo/src/cli.ts b/src/packages/pongo/src/cli.ts index 880236b..db4daca 100644 --- a/src/packages/pongo/src/cli.ts +++ b/src/packages/pongo/src/cli.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node import { Command } from 'commander'; -import { configCommand, migrateCommand } from './commandLine'; +import { configCommand, migrateCommand, shellCommand } from './commandLine'; const program = new Command(); @@ -8,6 +8,7 @@ program.name('pongo').description('CLI tool for Pongo'); program.addCommand(configCommand); program.addCommand(migrateCommand); +program.addCommand(shellCommand); program.parse(process.argv); diff --git a/src/packages/pongo/src/commandLine/index.ts b/src/packages/pongo/src/commandLine/index.ts index 24df716..5c77462 100644 --- a/src/packages/pongo/src/commandLine/index.ts +++ b/src/packages/pongo/src/commandLine/index.ts @@ -1,2 +1,3 @@ export * from './configFile'; export * from './migrate'; +export * from './shell'; diff --git a/src/packages/pongo/src/commandLine/shell.ts b/src/packages/pongo/src/commandLine/shell.ts new file mode 100644 index 0000000..c735a88 --- /dev/null +++ b/src/packages/pongo/src/commandLine/shell.ts @@ -0,0 +1,131 @@ +import chalk from 'chalk'; +import Table from 'cli-table3'; +import { Command } from 'commander'; +import repl from 'node:repl'; +import { pongoClient, pongoSchema } from '../core'; + +const calculateColumnWidths = ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + results: any[], + columnNames: string[], +): number[] => { + const columnWidths = columnNames.map((col) => { + const maxWidth = Math.max( + col.length, // Header size + ...results.map((result) => + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + result[col] ? String(result[col]).length : 0, + ), + ); + return maxWidth + 2; // Add padding + }); + return columnWidths; +}; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +const displayResultsAsTable = (results: any[]) => { + if (results.length === 0) { + console.log(chalk.yellow('No documents found.')); + return; + } + + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + const columnNames = Object.keys(results[0]); + + const columnWidths = calculateColumnWidths(results, columnNames); + + const table = new Table({ + head: columnNames.map((col) => chalk.cyan(col)), + colWidths: columnWidths, + }); + + results.forEach((result) => { + table.push( + columnNames.map((col) => + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + result[col] !== undefined ? String(result[col]) : '', + ), + ); + }); + + console.log(table.toString()); +}; + +const startRepl = (options: { + schema: { + database: string; + collections: string[]; + }; + connectionString: string; +}) => { + const r = repl.start({ + prompt: chalk.green('pongo> '), + useGlobal: true, + }); + + const schema = + options.schema.collections.length > 0 + ? pongoSchema.client({ + database: pongoSchema.db({ + users: pongoSchema.collection(options.schema.database), + }), + }) + : undefined; + + const pongo = pongoClient(options.connectionString, { + ...(schema ? { schema: { definition: schema } } : {}), + }); + + // Expose the db object to the REPL context + r.context.db = schema ? pongo.database : pongo.db(options.schema.database); + + // Handle default output formatting + r.context.displayResults = displayResultsAsTable; + + // Intercept REPL output to display results as a table if they are arrays + r.on('exit', () => { + console.log(chalk.yellow('Exiting Pongo Shell...')); + process.exit(); + }); +}; + +interface ShellOptions { + database: string; + collection: string[]; + connectionString: string; +} + +const shellCommand = new Command('shell') + .description('Start an interactive Pongo shell') + .option( + '-cs, --connectionString ', + 'Connection string for the database', + 'postgresql://postgres:postgres@localhost:5432/postgres', + ) + .option('-db, --database ', 'Database name to connect', 'postgres') + .option( + '-col, --collection ', + 'Specify the collection name', + (value: string, previous: string[]) => { + // Accumulate collection names into an array (explicitly typing `previous` as `string[]`) + return previous.concat([value]); + }, + [] as string[], + ) + .action((options: ShellOptions) => { + const { collection, database } = options; + const connectionString = + options.connectionString ?? process.env.DB_CONNECTION_STRING; + + console.log( + chalk.green( + 'Starting Pongo Shell. Use db..() to query.', + ), + ); + startRepl({ + schema: { collections: collection, database }, + connectionString, + }); + }); + +export { shellCommand };