@base44-preview/cli 0.0.31-pr.226.22ace45 → 0.0.31-pr.226.2717a29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -138681,14 +138681,14 @@ Check the top-level render call using <` + parentName + ">.";
138681
138681
  var thenableResult = result;
138682
138682
  var wasAwaited = false;
138683
138683
  var thenable = {
138684
- then: function(resolve6, reject) {
138684
+ then: function(resolve5, reject) {
138685
138685
  wasAwaited = true;
138686
138686
  thenableResult.then(function(returnValue2) {
138687
138687
  popActScope(prevActScopeDepth);
138688
138688
  if (actScopeDepth === 0) {
138689
- recursivelyFlushAsyncActWork(returnValue2, resolve6, reject);
138689
+ recursivelyFlushAsyncActWork(returnValue2, resolve5, reject);
138690
138690
  } else {
138691
- resolve6(returnValue2);
138691
+ resolve5(returnValue2);
138692
138692
  }
138693
138693
  }, function(error49) {
138694
138694
  popActScope(prevActScopeDepth);
@@ -138717,20 +138717,20 @@ Check the top-level render call using <` + parentName + ">.";
138717
138717
  ReactCurrentActQueue.current = null;
138718
138718
  }
138719
138719
  var _thenable = {
138720
- then: function(resolve6, reject) {
138720
+ then: function(resolve5, reject) {
138721
138721
  if (ReactCurrentActQueue.current === null) {
138722
138722
  ReactCurrentActQueue.current = [];
138723
- recursivelyFlushAsyncActWork(returnValue, resolve6, reject);
138723
+ recursivelyFlushAsyncActWork(returnValue, resolve5, reject);
138724
138724
  } else {
138725
- resolve6(returnValue);
138725
+ resolve5(returnValue);
138726
138726
  }
138727
138727
  }
138728
138728
  };
138729
138729
  return _thenable;
138730
138730
  } else {
138731
138731
  var _thenable2 = {
138732
- then: function(resolve6, reject) {
138733
- resolve6(returnValue);
138732
+ then: function(resolve5, reject) {
138733
+ resolve5(returnValue);
138734
138734
  }
138735
138735
  };
138736
138736
  return _thenable2;
@@ -138746,7 +138746,7 @@ Check the top-level render call using <` + parentName + ">.";
138746
138746
  actScopeDepth = prevActScopeDepth;
138747
138747
  }
138748
138748
  }
138749
- function recursivelyFlushAsyncActWork(returnValue, resolve6, reject) {
138749
+ function recursivelyFlushAsyncActWork(returnValue, resolve5, reject) {
138750
138750
  {
138751
138751
  var queue = ReactCurrentActQueue.current;
138752
138752
  if (queue !== null) {
@@ -138755,16 +138755,16 @@ Check the top-level render call using <` + parentName + ">.";
138755
138755
  enqueueTask(function() {
138756
138756
  if (queue.length === 0) {
138757
138757
  ReactCurrentActQueue.current = null;
138758
- resolve6(returnValue);
138758
+ resolve5(returnValue);
138759
138759
  } else {
138760
- recursivelyFlushAsyncActWork(returnValue, resolve6, reject);
138760
+ recursivelyFlushAsyncActWork(returnValue, resolve5, reject);
138761
138761
  }
138762
138762
  });
138763
138763
  } catch (error49) {
138764
138764
  reject(error49);
138765
138765
  }
138766
138766
  } else {
138767
- resolve6(returnValue);
138767
+ resolve5(returnValue);
138768
138768
  }
138769
138769
  }
138770
138770
  }
@@ -164898,11 +164898,11 @@ var require_raw_body = __commonJS((exports, module) => {
164898
164898
  if (done) {
164899
164899
  return readStream(stream, encoding, length, limit, wrap(done));
164900
164900
  }
164901
- return new Promise(function executor(resolve6, reject) {
164901
+ return new Promise(function executor(resolve5, reject) {
164902
164902
  readStream(stream, encoding, length, limit, function onRead2(err, buf) {
164903
164903
  if (err)
164904
164904
  return reject(err);
164905
- resolve6(buf);
164905
+ resolve5(buf);
164906
164906
  });
164907
164907
  });
164908
164908
  }
@@ -177997,7 +177997,7 @@ var require_view = __commonJS((exports, module) => {
177997
177997
  var basename4 = path18.basename;
177998
177998
  var extname2 = path18.extname;
177999
177999
  var join13 = path18.join;
178000
- var resolve6 = path18.resolve;
178000
+ var resolve5 = path18.resolve;
178001
178001
  module.exports = View;
178002
178002
  function View(name2, options8) {
178003
178003
  var opts = options8 || {};
@@ -178031,7 +178031,7 @@ var require_view = __commonJS((exports, module) => {
178031
178031
  debug('lookup "%s"', name2);
178032
178032
  for (var i5 = 0;i5 < roots.length && !path19; i5++) {
178033
178033
  var root2 = roots[i5];
178034
- var loc = resolve6(root2, name2);
178034
+ var loc = resolve5(root2, name2);
178035
178035
  var dir = dirname10(loc);
178036
178036
  var file2 = basename4(loc);
178037
178037
  path19 = this.resolve(dir, file2);
@@ -178056,7 +178056,7 @@ var require_view = __commonJS((exports, module) => {
178056
178056
  });
178057
178057
  sync = false;
178058
178058
  };
178059
- View.prototype.resolve = function resolve7(dir, file2) {
178059
+ View.prototype.resolve = function resolve6(dir, file2) {
178060
178060
  var ext = this.ext;
178061
178061
  var path19 = join13(dir, file2);
178062
178062
  var stat2 = tryStat(path19);
@@ -180215,7 +180215,7 @@ var require_application = __commonJS((exports, module) => {
180215
180215
  var compileETag = require_utils10().compileETag;
180216
180216
  var compileQueryParser = require_utils10().compileQueryParser;
180217
180217
  var compileTrust = require_utils10().compileTrust;
180218
- var resolve6 = __require("node:path").resolve;
180218
+ var resolve5 = __require("node:path").resolve;
180219
180219
  var once9 = require_once();
180220
180220
  var Router = require_router();
180221
180221
  var slice = Array.prototype.slice;
@@ -180269,7 +180269,7 @@ var require_application = __commonJS((exports, module) => {
180269
180269
  this.mountpath = "/";
180270
180270
  this.locals.settings = this.settings;
180271
180271
  this.set("view", View);
180272
- this.set("views", resolve6("views"));
180272
+ this.set("views", resolve5("views"));
180273
180273
  this.set("jsonp callback name", "callback");
180274
180274
  if (env2 === "production") {
180275
180275
  this.enable("view cache");
@@ -181760,7 +181760,7 @@ var require_send = __commonJS((exports, module) => {
181760
181760
  var extname2 = path18.extname;
181761
181761
  var join13 = path18.join;
181762
181762
  var normalize = path18.normalize;
181763
- var resolve6 = path18.resolve;
181763
+ var resolve5 = path18.resolve;
181764
181764
  var sep = path18.sep;
181765
181765
  var BYTES_RANGE_REGEXP = /^ *bytes=/;
181766
181766
  var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1000;
@@ -181789,7 +181789,7 @@ var require_send = __commonJS((exports, module) => {
181789
181789
  this._maxage = opts.maxAge || opts.maxage;
181790
181790
  this._maxage = typeof this._maxage === "string" ? ms8(this._maxage) : Number(this._maxage);
181791
181791
  this._maxage = !isNaN(this._maxage) ? Math.min(Math.max(0, this._maxage), MAX_MAXAGE) : 0;
181792
- this._root = opts.root ? resolve6(opts.root) : null;
181792
+ this._root = opts.root ? resolve5(opts.root) : null;
181793
181793
  }
181794
181794
  util2.inherits(SendStream, Stream5);
181795
181795
  SendStream.prototype.error = function error48(status, err) {
@@ -181938,7 +181938,7 @@ var require_send = __commonJS((exports, module) => {
181938
181938
  return res;
181939
181939
  }
181940
181940
  parts = normalize(path19).split(sep);
181941
- path19 = resolve6(path19);
181941
+ path19 = resolve5(path19);
181942
181942
  }
181943
181943
  if (containsDotFile(parts)) {
181944
181944
  debug('%s dotfile "%s"', this._dotfiles, path19);
@@ -182266,7 +182266,7 @@ var require_response = __commonJS((exports, module) => {
182266
182266
  var cookie = require_cookie();
182267
182267
  var send = require_send();
182268
182268
  var extname2 = path18.extname;
182269
- var resolve6 = path18.resolve;
182269
+ var resolve5 = path18.resolve;
182270
182270
  var vary = require_vary();
182271
182271
  var { Buffer: Buffer7 } = __require("node:buffer");
182272
182272
  var res = Object.create(http.ServerResponse.prototype);
@@ -182475,7 +182475,7 @@ var require_response = __commonJS((exports, module) => {
182475
182475
  }
182476
182476
  opts = Object.create(opts);
182477
182477
  opts.headers = headers;
182478
- var fullPath = !opts.root ? resolve6(path19) : path19;
182478
+ var fullPath = !opts.root ? resolve5(path19) : path19;
182479
182479
  return this.sendFile(fullPath, opts, done);
182480
182480
  };
182481
182481
  res.contentType = res.type = function contentType(type) {
@@ -182736,7 +182736,7 @@ var require_serve_static = __commonJS((exports, module) => {
182736
182736
  var encodeUrl = require_encodeurl();
182737
182737
  var escapeHtml = require_escape_html();
182738
182738
  var parseUrl = require_parseurl();
182739
- var resolve6 = __require("path").resolve;
182739
+ var resolve5 = __require("path").resolve;
182740
182740
  var send = require_send();
182741
182741
  var url3 = __require("url");
182742
182742
  module.exports = serveStatic;
@@ -182755,7 +182755,7 @@ var require_serve_static = __commonJS((exports, module) => {
182755
182755
  throw new TypeError("option setHeaders must be function");
182756
182756
  }
182757
182757
  opts.maxage = opts.maxage || opts.maxAge || 0;
182758
- opts.root = resolve6(root2);
182758
+ opts.root = resolve5(root2);
182759
182759
  var onDirectory = redirect ? createRedirectDirectoryListener() : createNotFoundDirectoryListener();
182760
182760
  return function serveStatic2(req, res, next) {
182761
182761
  if (req.method !== "GET" && req.method !== "HEAD") {
@@ -218285,97 +218285,6 @@ function getTypesCommand(context) {
218285
218285
  return new Command("types").description("Manage TypeScript type generation").addCommand(getTypesGenerateCommand(context));
218286
218286
  }
218287
218287
 
218288
- // src/cli/commands/project/eject.ts
218289
- import { resolve as resolve5 } from "node:path";
218290
- var import_lodash2 = __toESM(require_lodash(), 1);
218291
- async function eject(options8) {
218292
- const projects = await listProjects();
218293
- const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
218294
- let selectedProject;
218295
- if (options8.projectId) {
218296
- const foundProject = ejectableProjects.find((p4) => p4.id === options8.projectId);
218297
- if (!foundProject) {
218298
- throw new InvalidInputError(`Project with ID "${options8.projectId}" not found or not ejectable`, {
218299
- hints: [
218300
- {
218301
- message: "Run 'base44 eject' without --project-id to see available projects"
218302
- }
218303
- ]
218304
- });
218305
- }
218306
- selectedProject = foundProject;
218307
- M2.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
218308
- } else {
218309
- const projectOptions = ejectableProjects.map((p4) => ({
218310
- value: p4,
218311
- label: p4.name,
218312
- hint: p4.userDescription ?? undefined
218313
- }));
218314
- const selected = await ve({
218315
- message: `Choose a project to download ${theme.styles.dim("(Note: this will clone the selected project)")}`,
218316
- options: projectOptions
218317
- });
218318
- if (pD(selected)) {
218319
- xe("Operation cancelled.");
218320
- throw new CLIExitError(0);
218321
- }
218322
- selectedProject = selected;
218323
- }
218324
- const projectId = selectedProject.id;
218325
- const suggestedPath = await isDirEmpty() ? `./` : `./${import_lodash2.default(selectedProject.name)}`;
218326
- const selectedPath = options8.path ?? await he({
218327
- message: "Where should we create your project?",
218328
- placeholder: suggestedPath,
218329
- initialValue: suggestedPath
218330
- });
218331
- if (pD(selectedPath)) {
218332
- xe("Operation cancelled.");
218333
- throw new CLIExitError(0);
218334
- }
218335
- const resolvedPath = resolve5(selectedPath);
218336
- await runTask("Downloading your project's code...", async (updateMessage) => {
218337
- await createProjectFilesForExistingProject({
218338
- projectId,
218339
- projectPath: resolvedPath
218340
- });
218341
- updateMessage("Creating a new project...");
218342
- const newProjectName = `${selectedProject.name} Copy`;
218343
- const { projectId: newProjectId } = await createProject(newProjectName, selectedProject.userDescription ?? undefined);
218344
- updateMessage("Linking the project...");
218345
- await writeAppConfig(resolvedPath, newProjectId);
218346
- await writeFile(`${resolvedPath}/.env.local`, `VITE_BASE44_APP_ID=${newProjectId}`);
218347
- setAppConfig({ id: newProjectId, projectRoot: resolvedPath });
218348
- }, {
218349
- successMessage: theme.colors.base44Orange("Project pulled successfully"),
218350
- errorMessage: "Failed to pull project"
218351
- });
218352
- const { project: project2 } = await readProjectConfig(resolvedPath);
218353
- const installCommand = project2.site?.installCommand;
218354
- const buildCommand = project2.site?.buildCommand;
218355
- if (installCommand && buildCommand) {
218356
- const shouldDeploy = options8.yes ? true : await ye({
218357
- message: "Would you like to deploy your project now?"
218358
- });
218359
- if (!pD(shouldDeploy) && shouldDeploy) {
218360
- await runTask("Installing dependencies...", async (updateMessage) => {
218361
- await execa({ cwd: resolvedPath, shell: true })`${installCommand}`;
218362
- updateMessage("Building project...");
218363
- await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
218364
- }, {
218365
- successMessage: theme.colors.base44Orange("Project built successfully"),
218366
- errorMessage: "Failed to build project"
218367
- });
218368
- await deployAction({ yes: true, projectRoot: resolvedPath });
218369
- }
218370
- }
218371
- return { outroMessage: "Your new project is set and ready to use" };
218372
- }
218373
- function getEjectCommand(context) {
218374
- return new Command("eject").description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8) => {
218375
- await runCommand(() => eject(options8), { requireAuth: true, requireAppConfig: false }, context);
218376
- });
218377
- }
218378
-
218379
218288
  // src/cli/commands/dev.ts
218380
218289
  var import_react26 = __toESM(require_react(), 1);
218381
218290
 
@@ -222116,8 +222025,8 @@ class Ink {
222116
222025
  }
222117
222026
  async waitUntilExit() {
222118
222027
  if (!this.exitPromise) {
222119
- this.exitPromise = new Promise((resolve6, reject) => {
222120
- this.resolveExitPromise = resolve6;
222028
+ this.exitPromise = new Promise((resolve5, reject) => {
222029
+ this.resolveExitPromise = resolve5;
222121
222030
  this.rejectExitPromise = reject;
222122
222031
  });
222123
222032
  }
@@ -222391,13 +222300,13 @@ async function createDevServer(logger) {
222391
222300
  app.use((req, res, next) => {
222392
222301
  return remoteProxy(req, res, next);
222393
222302
  });
222394
- return new Promise((resolve6, reject) => {
222303
+ return new Promise((resolve5, reject) => {
222395
222304
  const server = app.listen(port, () => {
222396
222305
  const cleanup = () => {
222397
222306
  logger.log("Shutting server down...");
222398
222307
  server.close();
222399
222308
  };
222400
- resolve6({
222309
+ resolve5({
222401
222310
  port,
222402
222311
  server,
222403
222312
  cleanup
@@ -222514,6 +222423,97 @@ function getDevCommand(context) {
222514
222423
  });
222515
222424
  }
222516
222425
 
222426
+ // src/cli/commands/project/eject.ts
222427
+ import { resolve as resolve5 } from "node:path";
222428
+ var import_lodash2 = __toESM(require_lodash(), 1);
222429
+ async function eject(options8) {
222430
+ const projects = await listProjects();
222431
+ const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
222432
+ let selectedProject;
222433
+ if (options8.projectId) {
222434
+ const foundProject = ejectableProjects.find((p4) => p4.id === options8.projectId);
222435
+ if (!foundProject) {
222436
+ throw new InvalidInputError(`Project with ID "${options8.projectId}" not found or not ejectable`, {
222437
+ hints: [
222438
+ {
222439
+ message: "Run 'base44 eject' without --project-id to see available projects"
222440
+ }
222441
+ ]
222442
+ });
222443
+ }
222444
+ selectedProject = foundProject;
222445
+ M2.info(`Selected project: ${theme.styles.bold(selectedProject.name)}`);
222446
+ } else {
222447
+ const projectOptions = ejectableProjects.map((p4) => ({
222448
+ value: p4,
222449
+ label: p4.name,
222450
+ hint: p4.userDescription ?? undefined
222451
+ }));
222452
+ const selected = await ve({
222453
+ message: `Choose a project to download ${theme.styles.dim("(Note: this will clone the selected project)")}`,
222454
+ options: projectOptions
222455
+ });
222456
+ if (pD(selected)) {
222457
+ xe("Operation cancelled.");
222458
+ throw new CLIExitError(0);
222459
+ }
222460
+ selectedProject = selected;
222461
+ }
222462
+ const projectId = selectedProject.id;
222463
+ const suggestedPath = await isDirEmpty() ? `./` : `./${import_lodash2.default(selectedProject.name)}`;
222464
+ const selectedPath = options8.path ?? await he({
222465
+ message: "Where should we create your project?",
222466
+ placeholder: suggestedPath,
222467
+ initialValue: suggestedPath
222468
+ });
222469
+ if (pD(selectedPath)) {
222470
+ xe("Operation cancelled.");
222471
+ throw new CLIExitError(0);
222472
+ }
222473
+ const resolvedPath = resolve5(selectedPath);
222474
+ await runTask("Downloading your project's code...", async (updateMessage) => {
222475
+ await createProjectFilesForExistingProject({
222476
+ projectId,
222477
+ projectPath: resolvedPath
222478
+ });
222479
+ updateMessage("Creating a new project...");
222480
+ const newProjectName = `${selectedProject.name} Copy`;
222481
+ const { projectId: newProjectId } = await createProject(newProjectName, selectedProject.userDescription ?? undefined);
222482
+ updateMessage("Linking the project...");
222483
+ await writeAppConfig(resolvedPath, newProjectId);
222484
+ await writeFile(`${resolvedPath}/.env.local`, `VITE_BASE44_APP_ID=${newProjectId}`);
222485
+ setAppConfig({ id: newProjectId, projectRoot: resolvedPath });
222486
+ }, {
222487
+ successMessage: theme.colors.base44Orange("Project pulled successfully"),
222488
+ errorMessage: "Failed to pull project"
222489
+ });
222490
+ const { project: project2 } = await readProjectConfig(resolvedPath);
222491
+ const installCommand = project2.site?.installCommand;
222492
+ const buildCommand = project2.site?.buildCommand;
222493
+ if (installCommand && buildCommand) {
222494
+ const shouldDeploy = options8.yes ? true : await ye({
222495
+ message: "Would you like to deploy your project now?"
222496
+ });
222497
+ if (!pD(shouldDeploy) && shouldDeploy) {
222498
+ await runTask("Installing dependencies...", async (updateMessage) => {
222499
+ await execa({ cwd: resolvedPath, shell: true })`${installCommand}`;
222500
+ updateMessage("Building project...");
222501
+ await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
222502
+ }, {
222503
+ successMessage: theme.colors.base44Orange("Project built successfully"),
222504
+ errorMessage: "Failed to build project"
222505
+ });
222506
+ await deployAction({ yes: true, projectRoot: resolvedPath });
222507
+ }
222508
+ }
222509
+ return { outroMessage: "Your new project is set and ready to use" };
222510
+ }
222511
+ function getEjectCommand(context) {
222512
+ return new Command("eject").description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8) => {
222513
+ await runCommand(() => eject(options8), { requireAuth: true, requireAppConfig: false }, context);
222514
+ });
222515
+ }
222516
+
222517
222517
  // src/cli/program.ts
222518
222518
  function createProgram(context) {
222519
222519
  const program2 = new Command;
@@ -226801,4 +226801,4 @@ export {
226801
226801
  CLIExitError
226802
226802
  };
226803
226803
 
226804
- //# debugId=E5EBFA26D376AE3A64756E2164756E21
226804
+ //# debugId=4720BBCFFE5C9F7964756E2164756E21