@base44-preview/cli 0.0.38-pr.357.643fc18 → 0.0.38-pr.362.5d9aeb5

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.
Files changed (33) hide show
  1. package/bin/binary-entry.ts +40 -0
  2. package/dist/{deno-runtime → assets/deno-runtime}/main.js.map +1 -1
  3. package/dist/cli/index.js +123 -251
  4. package/dist/cli/index.js.map +12 -14
  5. package/package.json +4 -3
  6. package/dist/deno-runtime/exec.ts +0 -55
  7. /package/dist/{deno-runtime → assets/deno-runtime}/main.js +0 -0
  8. /package/dist/{templates → assets/templates}/backend-and-client/.nvmrc +0 -0
  9. /package/dist/{templates → assets/templates}/backend-and-client/README.md +0 -0
  10. /package/dist/{templates → assets/templates}/backend-and-client/base44/agents/task_manager.jsonc +0 -0
  11. /package/dist/{templates → assets/templates}/backend-and-client/base44/app.jsonc.ejs +0 -0
  12. /package/dist/{templates → assets/templates}/backend-and-client/base44/config.jsonc.ejs +0 -0
  13. /package/dist/{templates → assets/templates}/backend-and-client/base44/entities/task.jsonc +0 -0
  14. /package/dist/{templates → assets/templates}/backend-and-client/components.json +0 -0
  15. /package/dist/{templates → assets/templates}/backend-and-client/gitignore.ejs +0 -0
  16. /package/dist/{templates → assets/templates}/backend-and-client/index.html +0 -0
  17. /package/dist/{templates → assets/templates}/backend-and-client/jsconfig.json +0 -0
  18. /package/dist/{templates → assets/templates}/backend-and-client/package.json +0 -0
  19. /package/dist/{templates → assets/templates}/backend-and-client/postcss.config.js +0 -0
  20. /package/dist/{templates → assets/templates}/backend-and-client/src/App.jsx +0 -0
  21. /package/dist/{templates → assets/templates}/backend-and-client/src/api/base44Client.js.ejs +0 -0
  22. /package/dist/{templates → assets/templates}/backend-and-client/src/components/Base44Logo.jsx +0 -0
  23. /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/button.jsx +0 -0
  24. /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/checkbox.jsx +0 -0
  25. /package/dist/{templates → assets/templates}/backend-and-client/src/components/ui/input.jsx +0 -0
  26. /package/dist/{templates → assets/templates}/backend-and-client/src/index.css +0 -0
  27. /package/dist/{templates → assets/templates}/backend-and-client/src/main.jsx +0 -0
  28. /package/dist/{templates → assets/templates}/backend-and-client/tailwind.config.js +0 -0
  29. /package/dist/{templates → assets/templates}/backend-and-client/vite.config.js +0 -0
  30. /package/dist/{templates → assets/templates}/backend-only/base44/app.jsonc.ejs +0 -0
  31. /package/dist/{templates → assets/templates}/backend-only/base44/config.jsonc.ejs +0 -0
  32. /package/dist/{templates → assets/templates}/backend-only/base44/gitignore.ejs +0 -0
  33. /package/dist/{templates → assets/templates}/templates.json +0 -0
package/dist/cli/index.js CHANGED
@@ -164408,8 +164408,8 @@ var require_executor = __commonJS((exports, module) => {
164408
164408
  }
164409
164409
  resetBuffer() {
164410
164410
  this.buffer = new Waterfall;
164411
- this.buffer.chain(new Promise((resolve7) => {
164412
- this._triggerBuffer = resolve7;
164411
+ this.buffer.chain(new Promise((resolve6) => {
164412
+ this._triggerBuffer = resolve6;
164413
164413
  }));
164414
164414
  if (this.ready)
164415
164415
  this._triggerBuffer();
@@ -165429,7 +165429,7 @@ var require_storage = __commonJS((exports, module) => {
165429
165429
  throw e8;
165430
165430
  }
165431
165431
  };
165432
- var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve7, reject) => {
165432
+ var writeFileLinesAsync = (filename, lines, mode = DEFAULT_FILE_MODE) => new Promise((resolve6, reject) => {
165433
165433
  try {
165434
165434
  const stream = writeFileStream(filename, { mode });
165435
165435
  const readable2 = Readable6.from(lines);
@@ -165446,7 +165446,7 @@ var require_storage = __commonJS((exports, module) => {
165446
165446
  if (err)
165447
165447
  reject(err);
165448
165448
  else
165449
- resolve7();
165449
+ resolve6();
165450
165450
  });
165451
165451
  });
165452
165452
  readable2.on("error", (err) => {
@@ -165617,7 +165617,7 @@ var require_persistence = __commonJS((exports, module) => {
165617
165617
  return { data: tdata, indexes };
165618
165618
  }
165619
165619
  treatRawStreamAsync(rawStream) {
165620
- return new Promise((resolve7, reject) => {
165620
+ return new Promise((resolve6, reject) => {
165621
165621
  const dataById = {};
165622
165622
  const indexes = {};
165623
165623
  let corruptItems = 0;
@@ -165660,7 +165660,7 @@ var require_persistence = __commonJS((exports, module) => {
165660
165660
  }
165661
165661
  }
165662
165662
  const data = Object.values(dataById);
165663
- resolve7({ data, indexes });
165663
+ resolve6({ data, indexes });
165664
165664
  });
165665
165665
  lineStream.on("error", function(err) {
165666
165666
  reject(err, null);
@@ -191271,13 +191271,13 @@ var require_broadcast_operator = __commonJS((exports) => {
191271
191271
  return true;
191272
191272
  }
191273
191273
  emitWithAck(ev2, ...args) {
191274
- return new Promise((resolve7, reject) => {
191274
+ return new Promise((resolve6, reject) => {
191275
191275
  args.push((err, responses) => {
191276
191276
  if (err) {
191277
191277
  err.responses = responses;
191278
191278
  return reject(err);
191279
191279
  } else {
191280
- return resolve7(responses);
191280
+ return resolve6(responses);
191281
191281
  }
191282
191282
  });
191283
191283
  this.emit(ev2, ...args);
@@ -191465,12 +191465,12 @@ var require_socket2 = __commonJS((exports) => {
191465
191465
  }
191466
191466
  emitWithAck(ev2, ...args) {
191467
191467
  const withErr = this.flags.timeout !== undefined;
191468
- return new Promise((resolve7, reject) => {
191468
+ return new Promise((resolve6, reject) => {
191469
191469
  args.push((arg1, arg2) => {
191470
191470
  if (withErr) {
191471
- return arg1 ? reject(arg1) : resolve7(arg2);
191471
+ return arg1 ? reject(arg1) : resolve6(arg2);
191472
191472
  } else {
191473
- return resolve7(arg1);
191473
+ return resolve6(arg1);
191474
191474
  }
191475
191475
  });
191476
191476
  this.emit(ev2, ...args);
@@ -191925,13 +191925,13 @@ var require_namespace = __commonJS((exports) => {
191925
191925
  return true;
191926
191926
  }
191927
191927
  serverSideEmitWithAck(ev2, ...args) {
191928
- return new Promise((resolve7, reject) => {
191928
+ return new Promise((resolve6, reject) => {
191929
191929
  args.push((err, responses) => {
191930
191930
  if (err) {
191931
191931
  err.responses = responses;
191932
191932
  return reject(err);
191933
191933
  } else {
191934
- return resolve7(responses);
191934
+ return resolve6(responses);
191935
191935
  }
191936
191936
  });
191937
191937
  this.serverSideEmit(ev2, ...args);
@@ -192615,7 +192615,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192615
192615
  return localSockets;
192616
192616
  }
192617
192617
  const requestId = randomId();
192618
- return new Promise((resolve7, reject) => {
192618
+ return new Promise((resolve6, reject) => {
192619
192619
  const timeout3 = setTimeout(() => {
192620
192620
  const storedRequest2 = this.requests.get(requestId);
192621
192621
  if (storedRequest2) {
@@ -192625,7 +192625,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192625
192625
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
192626
192626
  const storedRequest = {
192627
192627
  type: MessageType.FETCH_SOCKETS,
192628
- resolve: resolve7,
192628
+ resolve: resolve6,
192629
192629
  timeout: timeout3,
192630
192630
  current: 0,
192631
192631
  expected: expectedResponseCount,
@@ -192835,7 +192835,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192835
192835
  return localSockets;
192836
192836
  }
192837
192837
  const requestId = randomId();
192838
- return new Promise((resolve7, reject) => {
192838
+ return new Promise((resolve6, reject) => {
192839
192839
  const timeout3 = setTimeout(() => {
192840
192840
  const storedRequest2 = this.customRequests.get(requestId);
192841
192841
  if (storedRequest2) {
@@ -192845,7 +192845,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192845
192845
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
192846
192846
  const storedRequest = {
192847
192847
  type: MessageType.FETCH_SOCKETS,
192848
- resolve: resolve7,
192848
+ resolve: resolve6,
192849
192849
  timeout: timeout3,
192850
192850
  missingUids: new Set([...this.nodesMap.keys()]),
192851
192851
  responses: localSockets
@@ -193574,13 +193574,13 @@ var require_dist4 = __commonJS((exports, module) => {
193574
193574
  this.engine.close();
193575
193575
  (0, uws_1.restoreAdapter)();
193576
193576
  if (this.httpServer) {
193577
- return new Promise((resolve7) => {
193577
+ return new Promise((resolve6) => {
193578
193578
  this.httpServer.close((err) => {
193579
193579
  fn9 && fn9(err);
193580
193580
  if (err) {
193581
193581
  debug("server was not running");
193582
193582
  }
193583
- resolve7();
193583
+ resolve6();
193584
193584
  });
193585
193585
  });
193586
193586
  } else {
@@ -206944,7 +206944,7 @@ var require_buffer_list = __commonJS((exports, module) => {
206944
206944
  }
206945
206945
  }, {
206946
206946
  key: "join",
206947
- value: function join16(s5) {
206947
+ value: function join15(s5) {
206948
206948
  if (this.length === 0)
206949
206949
  return "";
206950
206950
  var p4 = this.head;
@@ -208299,14 +208299,14 @@ var require_async_iterator = __commonJS((exports, module) => {
208299
208299
  };
208300
208300
  }
208301
208301
  function readAndResolve(iter) {
208302
- var resolve7 = iter[kLastResolve];
208303
- if (resolve7 !== null) {
208302
+ var resolve6 = iter[kLastResolve];
208303
+ if (resolve6 !== null) {
208304
208304
  var data = iter[kStream].read();
208305
208305
  if (data !== null) {
208306
208306
  iter[kLastPromise] = null;
208307
208307
  iter[kLastResolve] = null;
208308
208308
  iter[kLastReject] = null;
208309
- resolve7(createIterResult(data, false));
208309
+ resolve6(createIterResult(data, false));
208310
208310
  }
208311
208311
  }
208312
208312
  }
@@ -208314,13 +208314,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208314
208314
  process.nextTick(readAndResolve, iter);
208315
208315
  }
208316
208316
  function wrapForNext(lastPromise, iter) {
208317
- return function(resolve7, reject) {
208317
+ return function(resolve6, reject) {
208318
208318
  lastPromise.then(function() {
208319
208319
  if (iter[kEnded]) {
208320
- resolve7(createIterResult(undefined, true));
208320
+ resolve6(createIterResult(undefined, true));
208321
208321
  return;
208322
208322
  }
208323
- iter[kHandlePromise](resolve7, reject);
208323
+ iter[kHandlePromise](resolve6, reject);
208324
208324
  }, reject);
208325
208325
  };
208326
208326
  }
@@ -208339,12 +208339,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208339
208339
  return Promise.resolve(createIterResult(undefined, true));
208340
208340
  }
208341
208341
  if (this[kStream].destroyed) {
208342
- return new Promise(function(resolve7, reject) {
208342
+ return new Promise(function(resolve6, reject) {
208343
208343
  process.nextTick(function() {
208344
208344
  if (_this[kError]) {
208345
208345
  reject(_this[kError]);
208346
208346
  } else {
208347
- resolve7(createIterResult(undefined, true));
208347
+ resolve6(createIterResult(undefined, true));
208348
208348
  }
208349
208349
  });
208350
208350
  });
@@ -208367,13 +208367,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208367
208367
  return this;
208368
208368
  }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
208369
208369
  var _this2 = this;
208370
- return new Promise(function(resolve7, reject) {
208370
+ return new Promise(function(resolve6, reject) {
208371
208371
  _this2[kStream].destroy(null, function(err) {
208372
208372
  if (err) {
208373
208373
  reject(err);
208374
208374
  return;
208375
208375
  }
208376
- resolve7(createIterResult(undefined, true));
208376
+ resolve6(createIterResult(undefined, true));
208377
208377
  });
208378
208378
  });
208379
208379
  }), _Object$setPrototypeO), AsyncIteratorPrototype);
@@ -208395,15 +208395,15 @@ var require_async_iterator = __commonJS((exports, module) => {
208395
208395
  value: stream._readableState.endEmitted,
208396
208396
  writable: true
208397
208397
  }), _defineProperty(_Object$create, kHandlePromise, {
208398
- value: function value(resolve7, reject) {
208398
+ value: function value(resolve6, reject) {
208399
208399
  var data = iterator[kStream].read();
208400
208400
  if (data) {
208401
208401
  iterator[kLastPromise] = null;
208402
208402
  iterator[kLastResolve] = null;
208403
208403
  iterator[kLastReject] = null;
208404
- resolve7(createIterResult(data, false));
208404
+ resolve6(createIterResult(data, false));
208405
208405
  } else {
208406
- iterator[kLastResolve] = resolve7;
208406
+ iterator[kLastResolve] = resolve6;
208407
208407
  iterator[kLastReject] = reject;
208408
208408
  }
208409
208409
  },
@@ -208422,12 +208422,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208422
208422
  iterator[kError] = err;
208423
208423
  return;
208424
208424
  }
208425
- var resolve7 = iterator[kLastResolve];
208426
- if (resolve7 !== null) {
208425
+ var resolve6 = iterator[kLastResolve];
208426
+ if (resolve6 !== null) {
208427
208427
  iterator[kLastPromise] = null;
208428
208428
  iterator[kLastResolve] = null;
208429
208429
  iterator[kLastReject] = null;
208430
- resolve7(createIterResult(undefined, true));
208430
+ resolve6(createIterResult(undefined, true));
208431
208431
  }
208432
208432
  iterator[kEnded] = true;
208433
208433
  });
@@ -208439,7 +208439,7 @@ var require_async_iterator = __commonJS((exports, module) => {
208439
208439
 
208440
208440
  // node_modules/readable-stream/lib/internal/streams/from.js
208441
208441
  var require_from = __commonJS((exports, module) => {
208442
- function asyncGeneratorStep(gen, resolve7, reject, _next, _throw, key2, arg) {
208442
+ function asyncGeneratorStep(gen, resolve6, reject, _next, _throw, key2, arg) {
208443
208443
  try {
208444
208444
  var info = gen[key2](arg);
208445
208445
  var value = info.value;
@@ -208448,7 +208448,7 @@ var require_from = __commonJS((exports, module) => {
208448
208448
  return;
208449
208449
  }
208450
208450
  if (info.done) {
208451
- resolve7(value);
208451
+ resolve6(value);
208452
208452
  } else {
208453
208453
  Promise.resolve(value).then(_next, _throw);
208454
208454
  }
@@ -208456,13 +208456,13 @@ var require_from = __commonJS((exports, module) => {
208456
208456
  function _asyncToGenerator(fn9) {
208457
208457
  return function() {
208458
208458
  var self2 = this, args = arguments;
208459
- return new Promise(function(resolve7, reject) {
208459
+ return new Promise(function(resolve6, reject) {
208460
208460
  var gen = fn9.apply(self2, args);
208461
208461
  function _next(value) {
208462
- asyncGeneratorStep(gen, resolve7, reject, _next, _throw, "next", value);
208462
+ asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "next", value);
208463
208463
  }
208464
208464
  function _throw(err) {
208465
- asyncGeneratorStep(gen, resolve7, reject, _next, _throw, "throw", err);
208465
+ asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "throw", err);
208466
208466
  }
208467
208467
  _next(undefined);
208468
208468
  });
@@ -210590,7 +210590,7 @@ var require_dist5 = __commonJS((exports, module) => {
210590
210590
  });
210591
210591
  module.exports = __toCommonJS(src_exports);
210592
210592
  var import_promises22 = __require("node:fs/promises");
210593
- var import_node_fs22 = __require("node:fs");
210593
+ var import_node_fs21 = __require("node:fs");
210594
210594
  var DEVIN_LOCAL_PATH = "/opt/.devin";
210595
210595
  var CURSOR2 = "cursor";
210596
210596
  var CURSOR_CLI = "cursor-cli";
@@ -210647,7 +210647,7 @@ var require_dist5 = __commonJS((exports, module) => {
210647
210647
  return { isAgent: true, agent: { name: REPLIT } };
210648
210648
  }
210649
210649
  try {
210650
- await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs22.constants.F_OK);
210650
+ await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
210651
210651
  return { isAgent: true, agent: { name: DEVIN } };
210652
210652
  } catch (error48) {}
210653
210653
  return { isAgent: false, agent: undefined };
@@ -226217,11 +226217,18 @@ function getBase44GlobalDir() {
226217
226217
  function getAuthFilePath() {
226218
226218
  return join(getBase44GlobalDir(), "auth", "auth.json");
226219
226219
  }
226220
- function getTemplatesDir() {
226221
- return join(__dirname2, "../templates");
226220
+ function getTemplatesDir(assetsDir) {
226221
+ if (assetsDir)
226222
+ return join(assetsDir, "templates");
226223
+ return join(__dirname2, "../assets/templates");
226222
226224
  }
226223
- function getTemplatesIndexPath() {
226224
- return join(getTemplatesDir(), "templates.json");
226225
+ function getTemplatesIndexPath(assetsDir) {
226226
+ return join(getTemplatesDir(assetsDir), "templates.json");
226227
+ }
226228
+ function getDenoWrapperPath(assetsDir) {
226229
+ if (assetsDir)
226230
+ return join(assetsDir, "deno-runtime", "main.js");
226231
+ return join(__dirname2, "../assets/deno-runtime/main.js");
226225
226232
  }
226226
226233
  function getAppConfigPath(projectRoot) {
226227
226234
  return join(projectRoot, PROJECT_SUBDIR, ".app.jsonc");
@@ -234224,16 +234231,17 @@ async function readAppConfig(projectRoot) {
234224
234231
  var import_ejs = __toESM(require_ejs(), 1);
234225
234232
  var import_front_matter = __toESM(require_front_matter(), 1);
234226
234233
  import { dirname as dirname7, join as join7 } from "node:path";
234227
- async function listTemplates() {
234228
- const parsed = await readJsonFile(getTemplatesIndexPath());
234234
+ async function listTemplates(assetsDir) {
234235
+ const indexPath = getTemplatesIndexPath(assetsDir);
234236
+ const parsed = await readJsonFile(indexPath);
234229
234237
  const result = TemplatesConfigSchema.safeParse(parsed);
234230
234238
  if (!result.success) {
234231
- throw new SchemaValidationError("Invalid templates configuration", result.error, getTemplatesIndexPath());
234239
+ throw new SchemaValidationError("Invalid templates configuration", result.error, indexPath);
234232
234240
  }
234233
234241
  return result.data.templates;
234234
234242
  }
234235
- async function renderTemplate(template, destPath, data) {
234236
- const templateDir = join7(getTemplatesDir(), template.path);
234243
+ async function renderTemplate(template, destPath, data, assetsDir) {
234244
+ const templateDir = join7(getTemplatesDir(assetsDir), template.path);
234237
234245
  const files = await globby("**/*", {
234238
234246
  cwd: templateDir,
234239
234247
  dot: true,
@@ -234270,14 +234278,10 @@ async function assertProjectNotExists(dirPath) {
234270
234278
  }
234271
234279
  }
234272
234280
  async function createProjectFiles(options) {
234273
- const { name: name2, description, path: basePath, template } = options;
234281
+ const { name: name2, description, path: basePath, template, assetsDir } = options;
234274
234282
  await assertProjectNotExists(basePath);
234275
234283
  const { projectId } = await createProject(name2, description);
234276
- await renderTemplate(template, basePath, {
234277
- name: name2,
234278
- description,
234279
- projectId
234280
- });
234284
+ await renderTemplate(template, basePath, { name: name2, description, projectId }, assetsDir);
234281
234285
  return {
234282
234286
  projectId,
234283
234287
  projectDir: basePath
@@ -241948,8 +241952,8 @@ var package_default = {
241948
241952
  "bin"
241949
241953
  ],
241950
241954
  scripts: {
241951
- build: "bun run clean && cp -r templates dist/ && bun run infra/build.ts",
241952
- "build:watch": "bun run clean && cp -r templates dist/ && bun run infra/build.ts --watch",
241955
+ build: "bun run clean && mkdir -p dist/assets && cp -r templates dist/assets/ && bun run infra/build.ts",
241956
+ "build:watch": "bun run clean && mkdir -p dist/assets && cp -r templates dist/assets/ && bun run infra/build.ts --watch",
241953
241957
  typecheck: "tsc --noEmit",
241954
241958
  dev: "./bin/dev.ts",
241955
241959
  start: "./bin/run.js",
@@ -241958,6 +241962,7 @@ var package_default = {
241958
241962
  "lint:fix": "biome check --write src tests",
241959
241963
  test: "vitest run",
241960
241964
  "test:watch": "vitest",
241965
+ "build:binaries": "bun run infra/build-binaries.ts",
241961
241966
  knip: "knip",
241962
241967
  "knip:fix": "knip --fix"
241963
241968
  },
@@ -243135,8 +243140,8 @@ function getFunctionsDeployCommand(context) {
243135
243140
  import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
243136
243141
  var import_kebabCase = __toESM(require_kebabCase(), 1);
243137
243142
  var DEFAULT_TEMPLATE_ID = "backend-only";
243138
- async function getTemplateById(templateId) {
243139
- const templates = await listTemplates();
243143
+ async function getTemplateById(templateId, assetsDir) {
243144
+ const templates = await listTemplates(assetsDir);
243140
243145
  const template2 = templates.find((t) => t.id === templateId);
243141
243146
  if (!template2) {
243142
243147
  const validIds = templates.map((t) => t.id).join(", ");
@@ -243152,8 +243157,8 @@ function validateNonInteractiveFlags(command) {
243152
243157
  command.error("Non-interactive mode requires all flags: --name, --path");
243153
243158
  }
243154
243159
  }
243155
- async function createInteractive(options) {
243156
- const templates = await listTemplates();
243160
+ async function createInteractive(options, assetsDir) {
243161
+ const templates = await listTemplates(assetsDir);
243157
243162
  const templateOptions = templates.map((t) => ({
243158
243163
  value: t,
243159
243164
  label: t.name,
@@ -243194,10 +243199,10 @@ async function createInteractive(options) {
243194
243199
  deploy: options.deploy,
243195
243200
  skills: options.skills,
243196
243201
  isInteractive: true
243197
- });
243202
+ }, assetsDir);
243198
243203
  }
243199
- async function createNonInteractive(options) {
243200
- const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
243204
+ async function createNonInteractive(options, assetsDir) {
243205
+ const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID, assetsDir);
243201
243206
  return await executeCreate({
243202
243207
  template: template2,
243203
243208
  name: options.name,
@@ -243205,7 +243210,7 @@ async function createNonInteractive(options) {
243205
243210
  deploy: options.deploy,
243206
243211
  skills: options.skills,
243207
243212
  isInteractive: false
243208
- });
243213
+ }, assetsDir);
243209
243214
  }
243210
243215
  async function executeCreate({
243211
243216
  template: template2,
@@ -243215,7 +243220,7 @@ async function executeCreate({
243215
243220
  deploy: deploy5,
243216
243221
  skills,
243217
243222
  isInteractive
243218
- }) {
243223
+ }, assetsDir) {
243219
243224
  const name2 = rawName.trim();
243220
243225
  const resolvedPath = resolve2(projectPath);
243221
243226
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -243223,7 +243228,8 @@ async function executeCreate({
243223
243228
  name: name2,
243224
243229
  description: description?.trim(),
243225
243230
  path: resolvedPath,
243226
- template: template2
243231
+ template: template2,
243232
+ assetsDir
243227
243233
  });
243228
243234
  }, {
243229
243235
  successMessage: theme.colors.base44Orange("Project created successfully"),
@@ -243301,9 +243307,9 @@ function getCreateCommand(context) {
243301
243307
  return new Command("create").description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").hook("preAction", validateNonInteractiveFlags).action(async (name2, options) => {
243302
243308
  const isNonInteractive = !!(options.name ?? name2) && !!options.path;
243303
243309
  if (isNonInteractive) {
243304
- await runCommand(() => createNonInteractive({ name: options.name ?? name2, ...options }), { requireAuth: true, requireAppConfig: false }, context);
243310
+ await runCommand(() => createNonInteractive({ name: options.name ?? name2, ...options }, context.assetsDir), { requireAuth: true, requireAppConfig: false }, context);
243305
243311
  } else {
243306
- await runCommand(() => createInteractive({ name: name2, ...options }), { fullBanner: true, requireAuth: true, requireAppConfig: false }, context);
243312
+ await runCommand(() => createInteractive({ name: name2, ...options }, context.assetsDir), { fullBanner: true, requireAuth: true, requireAppConfig: false }, context);
243307
243313
  }
243308
243314
  });
243309
243315
  }
@@ -243940,7 +243946,7 @@ function getTypesCommand(context) {
243940
243946
  }
243941
243947
 
243942
243948
  // src/cli/dev/dev-server/main.ts
243943
- import { dirname as dirname15, join as join18 } from "node:path";
243949
+ import { dirname as dirname14, join as join17 } from "node:path";
243944
243950
  var import_cors = __toESM(require_lib4(), 1);
243945
243951
  var import_express4 = __toESM(require_express(), 1);
243946
243952
 
@@ -244066,7 +244072,6 @@ var { promisify: promisify11 } = __require("util");
244066
244072
  var tmp = require_tmp();
244067
244073
  var $fileSync = tmp.fileSync;
244068
244074
  var fileWithOptions = promisify11((options8, cb2) => tmp.file(options8, (err, path18, fd, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, fd, cleanup: promisify11(cleanup) })));
244069
- var $file = async (options8) => fileWithOptions(options8);
244070
244075
  var $dirSync = tmp.dirSync;
244071
244076
  var dirWithOptions = promisify11((options8, cb2) => tmp.dir(options8, (err, path18, cleanup) => err ? cb2(err) : cb2(undefined, { path: path18, cleanup: promisify11(cleanup) })));
244072
244077
  var $dir = async (options8) => dirWithOptions(options8);
@@ -244099,89 +244104,7 @@ function createDevLogger() {
244099
244104
  }
244100
244105
 
244101
244106
  // src/cli/dev/dev-server/function-manager.ts
244102
- import { spawn as spawn3 } from "node:child_process";
244103
- import { dirname as dirname12, join as join15 } from "node:path";
244104
- import { fileURLToPath as fileURLToPath7 } from "node:url";
244105
-
244106
- // src/core/exec/run-script.ts
244107
244107
  import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
244108
- import { copyFileSync, writeFileSync as writeFileSync2 } from "node:fs";
244109
- import { resolve as resolve6 } from "node:path";
244110
- function verifyDenoInstalled() {
244111
- const result = spawnSync2("deno", ["--version"]);
244112
- if (result.error) {
244113
- throw new DependencyNotFoundError("Deno is required to run scripts with exec", {
244114
- hints: [
244115
- {
244116
- message: "Install Deno: https://docs.deno.com/runtime/getting_started/installation/"
244117
- }
244118
- ]
244119
- });
244120
- }
244121
- }
244122
- async function getUserAppToken() {
244123
- try {
244124
- const response = await getAppClient().get("auth/token").json();
244125
- return response.token;
244126
- } catch (error48) {
244127
- throw await ApiError.fromHttpError(error48, "exchanging platform token for app user token");
244128
- }
244129
- }
244130
- async function runScript(options8) {
244131
- const { filePath, code: code2, extraArgs = [], execWrapperPath } = options8;
244132
- verifyDenoInstalled();
244133
- const cleanupFns = [];
244134
- let scriptPath;
244135
- if (filePath) {
244136
- scriptPath = `file://${resolve6(filePath)}`;
244137
- } else if (code2 !== undefined) {
244138
- const tempScript = await $file({ postfix: ".ts" });
244139
- cleanupFns.push(tempScript.cleanup);
244140
- writeFileSync2(tempScript.path, code2, "utf-8");
244141
- scriptPath = `file://${tempScript.path}`;
244142
- } else {
244143
- throw new Error("Either filePath or code must be provided");
244144
- }
244145
- const appConfig = getAppConfig();
244146
- const [appUserToken, appBaseUrl] = await Promise.all([
244147
- getUserAppToken(),
244148
- getSiteUrl()
244149
- ]);
244150
- const tempWrapper = await $file({ postfix: ".ts" });
244151
- cleanupFns.push(tempWrapper.cleanup);
244152
- copyFileSync(execWrapperPath, tempWrapper.path);
244153
- try {
244154
- const exitCode = await new Promise((resolvePromise) => {
244155
- const child = spawn2("deno", [
244156
- "run",
244157
- "--allow-all",
244158
- "--node-modules-dir=auto",
244159
- tempWrapper.path,
244160
- ...extraArgs
244161
- ], {
244162
- env: {
244163
- ...process.env,
244164
- SCRIPT_PATH: scriptPath,
244165
- BASE44_APP_ID: appConfig.id,
244166
- BASE44_ACCESS_TOKEN: appUserToken,
244167
- BASE44_APP_BASE_URL: appBaseUrl
244168
- },
244169
- stdio: "inherit"
244170
- });
244171
- child.on("close", (code3) => {
244172
- resolvePromise(code3 ?? 1);
244173
- });
244174
- });
244175
- return { exitCode };
244176
- } finally {
244177
- for (const cleanup of cleanupFns) {
244178
- cleanup();
244179
- }
244180
- }
244181
- }
244182
- // src/cli/dev/dev-server/function-manager.ts
244183
- var __dirname5 = dirname12(fileURLToPath7(import.meta.url));
244184
- var WRAPPER_PATH = join15(__dirname5, "../deno-runtime/main.js");
244185
244108
  var READY_TIMEOUT = 30000;
244186
244109
 
244187
244110
  class FunctionManager {
@@ -244189,11 +244112,21 @@ class FunctionManager {
244189
244112
  running = new Map;
244190
244113
  starting = new Map;
244191
244114
  logger;
244192
- constructor(functions, logger) {
244115
+ wrapperPath;
244116
+ constructor(functions, logger, wrapperPath) {
244193
244117
  this.functions = new Map(functions.map((f7) => [f7.name, f7]));
244194
244118
  this.logger = logger;
244119
+ this.wrapperPath = wrapperPath;
244195
244120
  if (functions.length > 0) {
244196
- verifyDenoInstalled();
244121
+ this.verifyDenoIsInstalled();
244122
+ }
244123
+ }
244124
+ verifyDenoIsInstalled() {
244125
+ const result = spawnSync2("deno", ["--version"]);
244126
+ if (result.error) {
244127
+ throw new DependencyNotFoundError("Deno is required to run functions", {
244128
+ hints: [{ message: "Install Deno from https://deno.com/download" }]
244129
+ });
244197
244130
  }
244198
244131
  }
244199
244132
  getFunctionNames() {
@@ -244256,7 +244189,7 @@ class FunctionManager {
244256
244189
  }
244257
244190
  spawnFunction(func, port) {
244258
244191
  this.logger.log(`Spawning function "${func.name}" on port ${port}`);
244259
- const process21 = spawn3("deno", ["run", "--allow-all", WRAPPER_PATH], {
244192
+ const process21 = spawn2("deno", ["run", "--allow-all", this.wrapperPath], {
244260
244193
  env: {
244261
244194
  ...globalThis.process.env,
244262
244195
  FUNCTION_PATH: func.entryPath,
@@ -244294,7 +244227,7 @@ class FunctionManager {
244294
244227
  });
244295
244228
  }
244296
244229
  waitForReady(name2, runningFunc) {
244297
- return new Promise((resolve7, reject) => {
244230
+ return new Promise((resolve6, reject) => {
244298
244231
  runningFunc.process.on("exit", (code2) => {
244299
244232
  if (!runningFunc.ready) {
244300
244233
  clearTimeout(timeout3);
@@ -244317,7 +244250,7 @@ class FunctionManager {
244317
244250
  runningFunc.ready = true;
244318
244251
  clearTimeout(timeout3);
244319
244252
  runningFunc.process.stdout?.off("data", onData);
244320
- resolve7(runningFunc.port);
244253
+ resolve6(runningFunc.port);
244321
244254
  }
244322
244255
  };
244323
244256
  runningFunc.process.stdout?.on("data", onData);
@@ -245477,9 +245410,9 @@ class NodeFsHandler {
245477
245410
  if (this.fsw.closed) {
245478
245411
  return;
245479
245412
  }
245480
- const dirname14 = sp2.dirname(file2);
245413
+ const dirname13 = sp2.dirname(file2);
245481
245414
  const basename5 = sp2.basename(file2);
245482
- const parent = this.fsw._getWatchedDir(dirname14);
245415
+ const parent = this.fsw._getWatchedDir(dirname13);
245483
245416
  let prevStats = stats;
245484
245417
  if (parent.has(basename5))
245485
245418
  return;
@@ -245506,7 +245439,7 @@ class NodeFsHandler {
245506
245439
  prevStats = newStats2;
245507
245440
  }
245508
245441
  } catch (error48) {
245509
- this.fsw._remove(dirname14, basename5);
245442
+ this.fsw._remove(dirname13, basename5);
245510
245443
  }
245511
245444
  } else if (parent.has(basename5)) {
245512
245445
  const at13 = newStats.atimeMs;
@@ -245595,7 +245528,7 @@ class NodeFsHandler {
245595
245528
  this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
245596
245529
  }
245597
245530
  }).on(EV.ERROR, this._boundHandleError);
245598
- return new Promise((resolve8, reject) => {
245531
+ return new Promise((resolve7, reject) => {
245599
245532
  if (!stream)
245600
245533
  return reject();
245601
245534
  stream.once(STR_END, () => {
@@ -245604,7 +245537,7 @@ class NodeFsHandler {
245604
245537
  return;
245605
245538
  }
245606
245539
  const wasThrottled = throttler ? throttler.clear() : false;
245607
- resolve8(undefined);
245540
+ resolve7(undefined);
245608
245541
  previous.getChildren().filter((item) => {
245609
245542
  return item !== directory && !current.has(item);
245610
245543
  }).forEach((item) => {
@@ -246467,7 +246400,7 @@ async function createDevServer(options8) {
246467
246400
  next();
246468
246401
  });
246469
246402
  const devLogger = createDevLogger();
246470
- const functionManager = new FunctionManager(functions, devLogger);
246403
+ const functionManager = new FunctionManager(functions, devLogger, options8.denoWrapperPath);
246471
246404
  const functionRoutes = createFunctionRouter(functionManager, devLogger);
246472
246405
  app.use("/api/apps/:appId/functions", functionRoutes);
246473
246406
  if (functionManager.getFunctionNames().length > 0) {
@@ -246491,7 +246424,7 @@ async function createDevServer(options8) {
246491
246424
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
246492
246425
  remoteProxy(req, res, next);
246493
246426
  });
246494
- const server = await new Promise((resolve9, reject) => {
246427
+ const server = await new Promise((resolve8, reject) => {
246495
246428
  const s5 = app.listen(port, "127.0.0.1", (err) => {
246496
246429
  if (err) {
246497
246430
  if ("code" in err && err.code === "EADDRINUSE") {
@@ -246500,7 +246433,7 @@ async function createDevServer(options8) {
246500
246433
  reject(err);
246501
246434
  }
246502
246435
  } else {
246503
- resolve9(s5);
246436
+ resolve8(s5);
246504
246437
  }
246505
246438
  });
246506
246439
  });
@@ -246509,8 +246442,8 @@ async function createDevServer(options8) {
246509
246442
  broadcastEntityEvent(io6, appId, entityName, event);
246510
246443
  };
246511
246444
  const base44ConfigWatcher = new WatchBase44({
246512
- functions: join18(dirname15(project2.configPath), project2.functionsDir),
246513
- entities: join18(dirname15(project2.configPath), project2.entitiesDir)
246445
+ functions: join17(dirname14(project2.configPath), project2.functionsDir),
246446
+ entities: join17(dirname14(project2.configPath), project2.entitiesDir)
246514
246447
  }, devLogger);
246515
246448
  base44ConfigWatcher.on("change", async (name2) => {
246516
246449
  try {
@@ -246554,10 +246487,11 @@ async function createDevServer(options8) {
246554
246487
  }
246555
246488
 
246556
246489
  // src/cli/commands/dev.ts
246557
- async function devAction(options8) {
246490
+ async function devAction(options8, context) {
246558
246491
  const port = options8.port ? Number(options8.port) : undefined;
246559
246492
  const { port: resolvedPort } = await createDevServer({
246560
246493
  port,
246494
+ denoWrapperPath: getDenoWrapperPath(context.assetsDir),
246561
246495
  loadResources: async () => {
246562
246496
  const { functions, entities, project: project2 } = await readProjectConfig();
246563
246497
  return { functions, entities, project: project2 };
@@ -246569,77 +246503,12 @@ async function devAction(options8) {
246569
246503
  }
246570
246504
  function getDevCommand(context) {
246571
246505
  return new Command("dev").description("Start the development server").option("-p, --port <number>", "Port for the development server").action(async (options8) => {
246572
- await runCommand(() => devAction(options8), { requireAuth: true }, context);
246506
+ await runCommand(() => devAction(options8, context), { requireAuth: true }, context);
246573
246507
  });
246574
246508
  }
246575
246509
 
246576
- // src/cli/commands/exec.ts
246577
- import { dirname as dirname16, join as join19 } from "node:path";
246578
- import { fileURLToPath as fileURLToPath8 } from "node:url";
246579
- var __dirname6 = dirname16(fileURLToPath8(import.meta.url));
246580
- var EXEC_WRAPPER_PATH = join19(__dirname6, "../deno-runtime/exec.ts");
246581
- function readStdin() {
246582
- return new Promise((resolve9, reject) => {
246583
- let data = "";
246584
- process.stdin.setEncoding("utf-8");
246585
- process.stdin.on("data", (chunk) => {
246586
- data += chunk;
246587
- });
246588
- process.stdin.on("end", () => resolve9(data));
246589
- process.stdin.on("error", reject);
246590
- });
246591
- }
246592
- function validateInput2(command) {
246593
- const [scriptArg] = command.args;
246594
- const { eval: evalCode } = command.opts();
246595
- const hasStdin = scriptArg === "-";
246596
- const hasFile = scriptArg !== undefined && !hasStdin;
246597
- const hasEval = evalCode !== undefined;
246598
- const inputCount = [hasFile, hasEval, hasStdin].filter(Boolean).length;
246599
- if (inputCount > 1) {
246600
- throw new InvalidInputError("Cannot use more than one input mode. Provide only one of: file path, -e, or -.");
246601
- }
246602
- if (inputCount === 0) {
246603
- throw new InvalidInputError("No script provided. Pass a file path, use -e for inline code, or - for stdin.", {
246604
- hints: [
246605
- { message: "File: base44 exec ./script.ts" },
246606
- { message: 'Eval: base44 exec -e "console.log(1)"' },
246607
- { message: "Stdin: echo 'code' | base44 exec -" }
246608
- ]
246609
- });
246610
- }
246611
- }
246612
- async function execAction(scriptArg, options8, extraArgs) {
246613
- const hasStdin = scriptArg === "-";
246614
- const hasFile = scriptArg !== undefined && !hasStdin;
246615
- let code2;
246616
- if (hasStdin) {
246617
- code2 = await readStdin();
246618
- } else if (options8.eval !== undefined) {
246619
- code2 = options8.eval;
246620
- }
246621
- const { exitCode } = await runScript({
246622
- filePath: hasFile ? scriptArg : undefined,
246623
- code: code2,
246624
- extraArgs,
246625
- execWrapperPath: EXEC_WRAPPER_PATH
246626
- });
246627
- if (exitCode !== 0) {
246628
- process.exitCode = exitCode;
246629
- }
246630
- return {};
246631
- }
246632
- function getExecCommand(context) {
246633
- const cmd = new Command("exec").description("Run a script with the Base44 SDK pre-authenticated as the current user").argument("[script]", "Path to a .ts/.js file, or - for stdin").option("-e, --eval <code>", "Evaluate inline code").allowUnknownOption(true).hook("preAction", validateInput2).action(async (script, options8) => {
246634
- const dashIndex = process.argv.indexOf("--");
246635
- const extraArgs = dashIndex !== -1 ? process.argv.slice(dashIndex + 1) : [];
246636
- await runCommand(() => execAction(script, options8, extraArgs), { requireAuth: true }, context);
246637
- });
246638
- return cmd;
246639
- }
246640
-
246641
246510
  // src/cli/commands/project/eject.ts
246642
- import { resolve as resolve9 } from "node:path";
246511
+ import { resolve as resolve8 } from "node:path";
246643
246512
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
246644
246513
  async function eject(options8) {
246645
246514
  const projects = await listProjects();
@@ -246688,7 +246557,7 @@ async function eject(options8) {
246688
246557
  Ne("Operation cancelled.");
246689
246558
  throw new CLIExitError(0);
246690
246559
  }
246691
- const resolvedPath = resolve9(selectedPath);
246560
+ const resolvedPath = resolve8(selectedPath);
246692
246561
  await runTask("Downloading your project's code...", async (updateMessage) => {
246693
246562
  await createProjectFilesForExistingProject({
246694
246563
  projectId,
@@ -246754,7 +246623,6 @@ function createProgram(context) {
246754
246623
  program2.addCommand(getSecretsCommand(context));
246755
246624
  program2.addCommand(getSiteCommand(context));
246756
246625
  program2.addCommand(getTypesCommand(context));
246757
- program2.addCommand(getExecCommand(context));
246758
246626
  program2.addCommand(getDevCommand(context), { hidden: true });
246759
246627
  program2.addCommand(getLogsCommand(context), { hidden: true });
246760
246628
  return program2;
@@ -246765,7 +246633,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
246765
246633
  import { release, type } from "node:os";
246766
246634
 
246767
246635
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
246768
- import { dirname as dirname17, posix, sep } from "path";
246636
+ import { dirname as dirname15, posix, sep } from "path";
246769
246637
  function createModulerModifier() {
246770
246638
  const getModuleFromFileName = createGetModuleFromFilename();
246771
246639
  return async (frames) => {
@@ -246774,7 +246642,7 @@ function createModulerModifier() {
246774
246642
  return frames;
246775
246643
  };
246776
246644
  }
246777
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246645
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246778
246646
  const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
246779
246647
  return (filename) => {
246780
246648
  if (!filename)
@@ -249052,14 +248920,14 @@ async function addSourceContext(frames) {
249052
248920
  return frames;
249053
248921
  }
249054
248922
  function getContextLinesFromFile(path19, ranges, output) {
249055
- return new Promise((resolve10) => {
248923
+ return new Promise((resolve9) => {
249056
248924
  const stream = createReadStream2(path19);
249057
248925
  const lineReaded = createInterface2({
249058
248926
  input: stream
249059
248927
  });
249060
248928
  function destroyStreamAndResolve() {
249061
248929
  stream.destroy();
249062
- resolve10();
248930
+ resolve9();
249063
248931
  }
249064
248932
  let lineNumber = 0;
249065
248933
  let currentRangeIndex = 0;
@@ -250171,15 +250039,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
250171
250039
  return true;
250172
250040
  if (this.featureFlagsPoller === undefined)
250173
250041
  return false;
250174
- return new Promise((resolve10) => {
250042
+ return new Promise((resolve9) => {
250175
250043
  const timeout3 = setTimeout(() => {
250176
250044
  cleanup();
250177
- resolve10(false);
250045
+ resolve9(false);
250178
250046
  }, timeoutMs);
250179
250047
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
250180
250048
  clearTimeout(timeout3);
250181
250049
  cleanup();
250182
- resolve10(count2 > 0);
250050
+ resolve9(count2 > 0);
250183
250051
  });
250184
250052
  });
250185
250053
  }
@@ -250963,11 +250831,15 @@ function addCommandInfoToErrorReporter(program2, errorReporter) {
250963
250831
  });
250964
250832
  }
250965
250833
  // src/cli/index.ts
250966
- async function runCLI() {
250834
+ async function runCLI(options8) {
250967
250835
  const errorReporter = new ErrorReporter;
250968
250836
  errorReporter.registerProcessErrorHandlers();
250969
250837
  const isNonInteractive = !process.stdin.isTTY || !process.stdout.isTTY;
250970
- const context = { errorReporter, isNonInteractive };
250838
+ const context = {
250839
+ errorReporter,
250840
+ isNonInteractive,
250841
+ assetsDir: options8?.assetsDir
250842
+ };
250971
250843
  const program2 = createProgram(context);
250972
250844
  try {
250973
250845
  const userInfo = await readAuth();
@@ -250992,4 +250864,4 @@ export {
250992
250864
  CLIExitError
250993
250865
  };
250994
250866
 
250995
- //# debugId=36A3D3D037267E4264756E2164756E21
250867
+ //# debugId=D0A2D98BCA9348F864756E2164756E21