From ba1a0a3c2715aba1a77a9bc4f6396265be4e02ce Mon Sep 17 00:00:00 2001 From: Kfir Strikovsky Date: Wed, 14 Jan 2026 10:58:22 +0200 Subject: [PATCH 1/5] bundle the CLI to one file --- package-lock.json | 92 +++++++++++++++++++++++++++++++++++--------- package.json | 26 ++++++------- src/core/utils/fs.ts | 21 ++-------- tsdown.config.mjs | 2 + 4 files changed, 92 insertions(+), 49 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a01b96b..79e67682 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,36 +9,37 @@ "version": "0.0.1", "license": "ISC", "dependencies": { - "@clack/prompts": "^0.11.0", - "chalk": "^5.6.2", - "commander": "^12.1.0", - "dotenv": "^17.2.3", - "ejs": "^3.1.10", - "globby": "^16.1.0", - "jsonc-parser": "^3.3.1", - "ky": "^1.14.2", - "lodash.kebabcase": "^4.1.1", - "p-wait-for": "^6.0.0", - "zod": "^4.3.5" + "jsonc-parser": "^3.3.1" }, "bin": { "base44": "dist/cli/index.js" }, "devDependencies": { + "@clack/prompts": "^0.11.0", "@stylistic/eslint-plugin": "^5.6.1", "@types/ejs": "^3.1.5", "@types/lodash.kebabcase": "^4.1.9", "@types/node": "^22.10.5", "@typescript-eslint/eslint-plugin": "^8.51.0", "@typescript-eslint/parser": "^8.51.0", + "chalk": "^5.6.2", + "commander": "^12.1.0", + "dotenv": "^17.2.3", + "ejs": "^3.1.10", "eslint": "^9.39.2", "eslint-plugin-import": "^2.32.0", "eslint-plugin-unicorn": "^62.0.0", + "globby": "^16.1.0", + "json5": "^2.2.3", + "ky": "^1.14.2", + "lodash.kebabcase": "^4.1.1", + "p-wait-for": "^6.0.0", "tsdown": "^0.12.4", "tsx": "^4.19.2", "typescript": "^5.7.2", "typescript-eslint": "^8.52.0", - "vitest": "^4.0.16" + "vitest": "^4.0.16", + "zod": "^4.3.5" }, "engines": { "node": ">=20.19.0" @@ -115,6 +116,7 @@ "version": "0.5.0", "resolved": "https://registry.npmjs.org/@clack/core/-/core-0.5.0.tgz", "integrity": "sha512-p3y0FIOwaYRUPRcMO7+dlmLh8PSRcrjuTndsiA0WAFbWES0mLZlrjVoBRZ9DzkPFJZG6KGkJmoEAY0ZcVWTkow==", + "dev": true, "license": "MIT", "dependencies": { "picocolors": "^1.0.0", @@ -125,6 +127,7 @@ "version": "0.11.0", "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-0.11.0.tgz", "integrity": "sha512-pMN5FcrEw9hUkZA4f+zLlzivQSeQf5dRGJjSUbvVYDLvpKCdQx5OaknvKzgbtXOizhP+SJJJjqEbOe55uKKfAw==", + "dev": true, "license": "MIT", "dependencies": { "@clack/core": "0.5.0", @@ -922,6 +925,7 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", @@ -935,6 +939,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -944,6 +949,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", @@ -1565,6 +1571,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-4.0.0.tgz", "integrity": "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -2242,6 +2249,7 @@ "version": "3.2.6", "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, "license": "MIT" }, "node_modules/async-function": { @@ -2274,6 +2282,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, "license": "MIT" }, "node_modules/baseline-browser-mapping": { @@ -2300,6 +2309,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -2309,6 +2319,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, "license": "MIT", "dependencies": { "fill-range": "^7.1.1" @@ -2469,6 +2480,7 @@ "version": "5.6.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, "license": "MIT", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" @@ -2563,6 +2575,7 @@ "version": "12.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", + "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -2753,6 +2766,7 @@ "version": "17.2.3", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-17.2.3.tgz", "integrity": "sha512-JVUnt+DUIzu87TABbhPmNfVdBDt18BLOWjMUFJMSi/Qqg7NTYtabbvSNJGOJ7afbRuv9D/lngizHtP7QyLQ+9w==", + "dev": true, "license": "BSD-2-Clause", "engines": { "node": ">=12" @@ -2801,6 +2815,7 @@ "version": "3.1.10", "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, "license": "Apache-2.0", "dependencies": { "jake": "^10.8.5" @@ -3463,6 +3478,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -3479,6 +3495,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, "license": "ISC", "dependencies": { "is-glob": "^4.0.1" @@ -3505,6 +3522,7 @@ "version": "1.20.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, "license": "ISC", "dependencies": { "reusify": "^1.0.4" @@ -3545,6 +3563,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, "license": "Apache-2.0", "dependencies": { "minimatch": "^5.0.1" @@ -3554,6 +3573,7 @@ "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" @@ -3566,6 +3586,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" @@ -3824,6 +3845,7 @@ "version": "16.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-16.1.0.tgz", "integrity": "sha512-+A4Hq7m7Ze592k9gZRy4gJ27DrXRNnC1vPjxTt1qQxEY8RxagBkBxivkCwg7FxSTG0iLLEMaUx13oOr0R2/qcQ==", + "dev": true, "license": "MIT", "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", @@ -3958,6 +3980,7 @@ "version": "7.0.5", "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, "license": "MIT", "engines": { "node": ">= 4" @@ -4173,6 +4196,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -4218,6 +4242,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" @@ -4256,6 +4281,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.12.0" @@ -4282,6 +4308,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dev": true, "license": "MIT", "engines": { "node": ">=12" @@ -4453,6 +4480,7 @@ "version": "10.9.4", "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.4.tgz", "integrity": "sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA==", + "dev": true, "license": "Apache-2.0", "dependencies": { "async": "^3.2.6", @@ -4524,16 +4552,16 @@ "license": "MIT" }, "node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", "dev": true, "license": "MIT", - "dependencies": { - "minimist": "^1.2.0" - }, "bin": { "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" } }, "node_modules/jsonc-parser": { @@ -4556,6 +4584,7 @@ "version": "1.14.2", "resolved": "https://registry.npmjs.org/ky/-/ky-1.14.2.tgz", "integrity": "sha512-q3RBbsO5A5zrPhB6CaCS8ZUv+NWCXv6JJT4Em0i264G9W0fdPB8YRfnnEi7Dm7X7omAkBIPojzYJ2D1oHTHqug==", + "dev": true, "license": "MIT", "engines": { "node": ">=18" @@ -4598,6 +4627,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", + "dev": true, "license": "MIT" }, "node_modules/lodash.merge": { @@ -4631,6 +4661,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, "license": "MIT", "engines": { "node": ">= 8" @@ -4640,6 +4671,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, "license": "MIT", "dependencies": { "braces": "^3.0.3", @@ -4653,6 +4685,7 @@ "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, "license": "MIT", "engines": { "node": ">=8.6" @@ -4907,6 +4940,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-6.0.0.tgz", "integrity": "sha512-2kKzMtjS8TVcpCOU/gr3vZ4K/WIyS1AsEFXFWapM/0lERCdyTbB6ZeuCIp+cL1aeLZfQoMdZFCBTHiK4I9UtOw==", + "dev": true, "license": "MIT", "engines": { "node": ">=20" @@ -4966,6 +5000,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, "license": "ISC" }, "node_modules/picomatch": { @@ -5071,6 +5106,7 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, "funding": [ { "type": "github", @@ -5213,6 +5249,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, "license": "MIT", "engines": { "iojs": ">=1.0.0", @@ -5340,6 +5377,7 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, "funding": [ { "type": "github", @@ -5586,12 +5624,14 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, "license": "MIT" }, "node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "dev": true, "license": "MIT", "engines": { "node": ">=14.16" @@ -5807,6 +5847,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, "license": "MIT", "dependencies": { "is-number": "^7.0.0" @@ -5841,6 +5882,19 @@ "strip-bom": "^3.0.0" } }, + "node_modules/tsconfig-paths/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/tsdown": { "version": "0.12.9", "resolved": "https://registry.npmjs.org/tsdown/-/tsdown-0.12.9.tgz", @@ -6114,6 +6168,7 @@ "version": "0.4.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.4.0.tgz", "integrity": "sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==", + "dev": true, "license": "MIT", "engines": { "node": ">=20" @@ -6465,6 +6520,7 @@ "version": "4.3.5", "resolved": "https://registry.npmjs.org/zod/-/zod-4.3.5.tgz", "integrity": "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g==", + "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index 9b0339b0..ccb70763 100644 --- a/package.json +++ b/package.json @@ -32,34 +32,32 @@ "type": "git", "url": "https://github.com/base44/cli" }, - "dependencies": { - "@clack/prompts": "^0.11.0", - "chalk": "^5.6.2", - "commander": "^12.1.0", - "dotenv": "^17.2.3", - "ejs": "^3.1.10", - "globby": "^16.1.0", - "jsonc-parser": "^3.3.1", - "ky": "^1.14.2", - "lodash.kebabcase": "^4.1.1", - "p-wait-for": "^6.0.0", - "zod": "^4.3.5" - }, "devDependencies": { + "@clack/prompts": "^0.11.0", "@stylistic/eslint-plugin": "^5.6.1", "@types/ejs": "^3.1.5", "@types/lodash.kebabcase": "^4.1.9", "@types/node": "^22.10.5", "@typescript-eslint/eslint-plugin": "^8.51.0", "@typescript-eslint/parser": "^8.51.0", + "chalk": "^5.6.2", + "commander": "^12.1.0", + "dotenv": "^17.2.3", + "ejs": "^3.1.10", "eslint": "^9.39.2", "eslint-plugin-import": "^2.32.0", "eslint-plugin-unicorn": "^62.0.0", + "globby": "^16.1.0", + "json5": "^2.2.3", + "ky": "^1.14.2", + "lodash.kebabcase": "^4.1.1", + "p-wait-for": "^6.0.0", "tsdown": "^0.12.4", "tsx": "^4.19.2", "typescript": "^5.7.2", "typescript-eslint": "^8.52.0", - "vitest": "^4.0.16" + "vitest": "^4.0.16", + "zod": "^4.3.5" }, "engines": { "node": ">=20.19.0" diff --git a/src/core/utils/fs.ts b/src/core/utils/fs.ts index 7d4c51b8..471724de 100644 --- a/src/core/utils/fs.ts +++ b/src/core/utils/fs.ts @@ -7,8 +7,7 @@ import { access, } from "node:fs/promises"; import { dirname } from "node:path"; -import type { ParseError } from "jsonc-parser"; -import { parse, printParseErrorCode } from "jsonc-parser"; +import JSON5 from "json5"; export async function pathExists(path: string): Promise { try { @@ -45,22 +44,10 @@ export async function readJsonFile(filePath: string): Promise { try { const fileContent = await fsReadFile(filePath, "utf-8"); - const errors: ParseError[] = []; - const result = parse(fileContent, errors, { allowTrailingComma: true }); - - if (errors.length > 0) { - const errorMessages = errors - .map((e) => `${printParseErrorCode(e.error)} at offset ${e.offset}`) - .join(", "); - throw new Error( - `File contains invalid JSONC: ${filePath} (${errorMessages})` - ); - } - - return result; + return JSON5.parse(fileContent); } catch (error) { - if (error instanceof Error && error.message.includes("invalid JSONC")) { - throw error; + if (error instanceof SyntaxError) { + throw new Error(`File contains invalid JSON: ${filePath} (${error.message})`); } throw new Error( `Failed to read file ${filePath}: ${ diff --git a/tsdown.config.mjs b/tsdown.config.mjs index 85e87974..fa9f0592 100644 --- a/tsdown.config.mjs +++ b/tsdown.config.mjs @@ -8,4 +8,6 @@ export default defineConfig({ clean: true, tsconfig: "tsconfig.json", copy: ["templates"], + // Bundle all dependencies into a single file for zero-dependency distribution + noExternal: [/.*/], }); From b3f1186924bc0747d030060b79035f1667e96b61 Mon Sep 17 00:00:00 2001 From: Kfir Strikovsky Date: Wed, 14 Jan 2026 11:15:07 +0200 Subject: [PATCH 2/5] no need to no external --- tsdown.config.mjs | 2 -- 1 file changed, 2 deletions(-) diff --git a/tsdown.config.mjs b/tsdown.config.mjs index fa9f0592..85e87974 100644 --- a/tsdown.config.mjs +++ b/tsdown.config.mjs @@ -8,6 +8,4 @@ export default defineConfig({ clean: true, tsconfig: "tsconfig.json", copy: ["templates"], - // Bundle all dependencies into a single file for zero-dependency distribution - noExternal: [/.*/], }); From 22e9c75dd23c4746af5302da2fdc1309b207efb8 Mon Sep 17 00:00:00 2001 From: Kfir Strikovsky Date: Wed, 14 Jan 2026 11:28:56 +0200 Subject: [PATCH 3/5] update readmes --- AGENTS.md | 8 ++++++++ README.md | 2 ++ plan.md | 59 ++++++++++++++++++++++++++----------------------------- 3 files changed, 38 insertions(+), 31 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 05066777..099bce1d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,9 +10,16 @@ The Base44 CLI is a TypeScript-based command-line tool built with: - **Commander.js** - CLI framework for command parsing - **@clack/prompts** - Interactive user prompts and UI components - **Zod** - Schema validation for API responses, config files, and user inputs +- **JSON5** - Parsing JSONC/JSON5 config files (supports comments and trailing commas) - **TypeScript** - Primary language - **tsdown** - Bundler (powered by Rolldown, the Rust-based Rollup successor) +### Distribution Strategy +The CLI is distributed as a **zero-dependency package**. All runtime dependencies are bundled into a single JavaScript file. This means: +- Users only download the bundled code +- No dependency resolution or node_modules installation +- Faster install times and no version conflicts + ### Project Structure - **Package**: `base44` - Single package published to npm - **Core Module**: `src/core/` - Resources, utilities, errors, and config @@ -244,6 +251,7 @@ import { base44Client } from "@core/api/index.js"; 7. **Task wrapper** - Use `runTask()` for async operations with spinners 8. **consts.ts has no imports** - Keep `consts.ts` dependency-free to avoid circular deps 9. **Keep AGENTS.md updated** - Update this file when architecture changes +10. **Zero-dependency distribution** - All packages go in `devDependencies`; they get bundled at build time ## Development diff --git a/README.md b/README.md index adc2ce5d..48fb0b9b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ A unified command-line interface for managing Base44 applications, entities, functions, deployments, and related services. +**Zero dependencies** - installs in seconds with no dependency resolution. + ## Installation ```bash diff --git a/plan.md b/plan.md index 07d3d6a4..31c73d24 100644 --- a/plan.md +++ b/plan.md @@ -195,20 +195,26 @@ Generate a comprehensive CLI tool that provides a unified interface for managing 2. **Build Process & Configuration** - Set up TypeScript configuration (`tsconfig.json`) - - Set up source maps for debugging - - Configure output directory structure (`dist/`) + - Configure output directory structure (`dist/cli/`) - **ES Modules**: Package uses `"type": "module"` for ES module support - - **Development**: Use `tsx` for development/watch mode (not just `tsc`) - - **Production**: Use `tsc` for production builds + - **Development**: Use `tsx` for development/watch mode + - **Production**: Use `tsdown` to bundle all code and dependencies into single file + - **Zero Dependencies**: All packages bundled via `noExternal: [/.*/]` in tsdown config 3. **Package.json Setup** - **Package** (`base44`): - - Install all dependencies: + - All dependencies in `devDependencies` (bundled at build time): - `zod` - Schema validation - `commander` - CLI framework - `@clack/prompts` - User prompts and UI components - `chalk` - Terminal colors (Base44 brand color: #E86B3C) - - Set up bin entry point for CLI executable (`./dist/index.js`) + - `json5` - JSONC/JSON5 config parsing + - `ky` - HTTP client + - `ejs` - Template rendering + - `globby` - File globbing + - `dotenv` - Environment variables + - Zero runtime `dependencies` - everything bundled + - Set up bin entry point for CLI executable (`./dist/cli/index.js`) - Set up build and dev scripts - **Shebang**: Main entry point (`src/cli/index.ts`) includes `#!/usr/bin/env node` @@ -301,11 +307,12 @@ Generate a comprehensive CLI tool that provides a unified interface for managing ### Build & Distribution - **Project Structure** - Single package with `core` and `cli` modules -- **TypeScript Compiler** - `tsc` for type-checked builds - **ES Modules** - Package uses `"type": "module"` for native ES module support +- **Zero-Dependency Distribution** - All runtime dependencies bundled into single JS file - **Build Tools**: - - Production: `tsc` (TypeScript compiler) for type-checked builds + - Production: `tsdown` bundles all code and dependencies into `dist/cli/index.js` - Development: `tsx` for fast watch mode and direct TypeScript execution + - Type checking: `tsc --noEmit` for validation without emitting files - **CLI Entry Point**: `src/cli/index.ts` includes shebang (`#!/usr/bin/env node`) - GitHub Actions for automated builds and npm releases @@ -363,33 +370,23 @@ Generate a comprehensive CLI tool that provides a unified interface for managing ## Dependencies -### Core CLI +### Core CLI (bundled - zero runtime dependencies) +All dependencies are bundled into a single file at build time using tsdown. + - **commander** - CLI framework for command parsing and help generation - **@clack/prompts** - Beautiful, accessible prompts and UI components - **chalk** - Terminal colors (Base44 brand color: #E86B3C) -- **typescript** - TypeScript compiler and type system -- **tsx** - TypeScript execution for development/watch mode - -### API & HTTP -- **axios** or **node-fetch** - HTTP client for API communication -- **zod** - **Primary schema validation library** for: - - API response validation - - Configuration file validation - - Input validation - - File schema validation - - Type inference for TypeScript - -### Configuration -- **cosmiconfig** or **conf** - Configuration file management -- **js-yaml** or **toml** - YAML/TOML parsing for config files - -### Security & Storage -- **keytar** or **@napi-rs/keyring** - Secure credential storage (OS keychain) -- **crypto** (Node.js built-in) - Encryption for secrets - -### Utilities -- **fs-extra** - Enhanced file system operations +- **json5** - JSONC/JSON5 config file parsing (supports comments and trailing commas) +- **zod** - Schema validation for API responses, config files, and inputs +- **ky** - HTTP client for API communication +- **ejs** - Template rendering for project scaffolding +- **globby** - File globbing for resource discovery +- **dotenv** - Environment variable loading ### Development +- **typescript** - TypeScript compiler and type system +- **tsx** - TypeScript execution for development/watch mode +- **tsdown** - Bundler (powered by Rolldown) for zero-dependency distribution +- **vitest** - Testing framework - **@types/node** - TypeScript definitions for Node.js From bb4414b4787b900ff3cc358736d29a06c0ea0e0c Mon Sep 17 00:00:00 2001 From: Kfir Strikovsky Date: Wed, 14 Jan 2026 11:30:33 +0200 Subject: [PATCH 4/5] update package-lock --- package-lock.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 79e67682..c29d033b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,9 +8,6 @@ "name": "base44", "version": "0.0.1", "license": "ISC", - "dependencies": { - "jsonc-parser": "^3.3.1" - }, "bin": { "base44": "dist/cli/index.js" }, @@ -4564,12 +4561,6 @@ "node": ">=6" } }, - "node_modules/jsonc-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", - "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", - "license": "MIT" - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", From 3a03ab2bda66931d812e4698fa4593dc063902ed Mon Sep 17 00:00:00 2001 From: Kfir Strikovsky Date: Wed, 14 Jan 2026 11:31:24 +0200 Subject: [PATCH 5/5] remove noexternal from test --- plan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plan.md b/plan.md index 31c73d24..edb9d136 100644 --- a/plan.md +++ b/plan.md @@ -199,7 +199,7 @@ Generate a comprehensive CLI tool that provides a unified interface for managing - **ES Modules**: Package uses `"type": "module"` for ES module support - **Development**: Use `tsx` for development/watch mode - **Production**: Use `tsdown` to bundle all code and dependencies into single file - - **Zero Dependencies**: All packages bundled via `noExternal: [/.*/]` in tsdown config + - **Zero Dependencies**: All packages bundled 3. **Package.json Setup** - **Package** (`base44`):