@base44-preview/cli 0.0.36-pr.353.8cc7da8 → 0.0.36-pr.353.e1b512d

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
@@ -163321,168 +163321,6 @@ var require_dist2 = __commonJS((exports) => {
163321
163321
  __exportStar(require_legacy(), exports);
163322
163322
  });
163323
163323
 
163324
- // node_modules/lodash/isObject.js
163325
- var require_isObject = __commonJS((exports, module) => {
163326
- function isObject5(value) {
163327
- var type = typeof value;
163328
- return value != null && (type == "object" || type == "function");
163329
- }
163330
- module.exports = isObject5;
163331
- });
163332
-
163333
- // node_modules/lodash/now.js
163334
- var require_now = __commonJS((exports, module) => {
163335
- var root2 = require__root();
163336
- var now = function() {
163337
- return root2.Date.now();
163338
- };
163339
- module.exports = now;
163340
- });
163341
-
163342
- // node_modules/lodash/_trimmedEndIndex.js
163343
- var require__trimmedEndIndex = __commonJS((exports, module) => {
163344
- var reWhitespace = /\s/;
163345
- function trimmedEndIndex(string4) {
163346
- var index = string4.length;
163347
- while (index-- && reWhitespace.test(string4.charAt(index))) {}
163348
- return index;
163349
- }
163350
- module.exports = trimmedEndIndex;
163351
- });
163352
-
163353
- // node_modules/lodash/_baseTrim.js
163354
- var require__baseTrim = __commonJS((exports, module) => {
163355
- var trimmedEndIndex = require__trimmedEndIndex();
163356
- var reTrimStart = /^\s+/;
163357
- function baseTrim(string4) {
163358
- return string4 ? string4.slice(0, trimmedEndIndex(string4) + 1).replace(reTrimStart, "") : string4;
163359
- }
163360
- module.exports = baseTrim;
163361
- });
163362
-
163363
- // node_modules/lodash/toNumber.js
163364
- var require_toNumber = __commonJS((exports, module) => {
163365
- var baseTrim = require__baseTrim();
163366
- var isObject5 = require_isObject();
163367
- var isSymbol = require_isSymbol();
163368
- var NAN = 0 / 0;
163369
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
163370
- var reIsBinary = /^0b[01]+$/i;
163371
- var reIsOctal = /^0o[0-7]+$/i;
163372
- var freeParseInt = parseInt;
163373
- function toNumber(value) {
163374
- if (typeof value == "number") {
163375
- return value;
163376
- }
163377
- if (isSymbol(value)) {
163378
- return NAN;
163379
- }
163380
- if (isObject5(value)) {
163381
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
163382
- value = isObject5(other) ? other + "" : other;
163383
- }
163384
- if (typeof value != "string") {
163385
- return value === 0 ? value : +value;
163386
- }
163387
- value = baseTrim(value);
163388
- var isBinary = reIsBinary.test(value);
163389
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
163390
- }
163391
- module.exports = toNumber;
163392
- });
163393
-
163394
- // node_modules/lodash/debounce.js
163395
- var require_debounce = __commonJS((exports, module) => {
163396
- var isObject5 = require_isObject();
163397
- var now = require_now();
163398
- var toNumber = require_toNumber();
163399
- var FUNC_ERROR_TEXT = "Expected a function";
163400
- var nativeMax = Math.max;
163401
- var nativeMin = Math.min;
163402
- function debounce(func, wait, options8) {
163403
- var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
163404
- if (typeof func != "function") {
163405
- throw new TypeError(FUNC_ERROR_TEXT);
163406
- }
163407
- wait = toNumber(wait) || 0;
163408
- if (isObject5(options8)) {
163409
- leading = !!options8.leading;
163410
- maxing = "maxWait" in options8;
163411
- maxWait = maxing ? nativeMax(toNumber(options8.maxWait) || 0, wait) : maxWait;
163412
- trailing = "trailing" in options8 ? !!options8.trailing : trailing;
163413
- }
163414
- function invokeFunc(time3) {
163415
- var args = lastArgs, thisArg = lastThis;
163416
- lastArgs = lastThis = undefined;
163417
- lastInvokeTime = time3;
163418
- result = func.apply(thisArg, args);
163419
- return result;
163420
- }
163421
- function leadingEdge(time3) {
163422
- lastInvokeTime = time3;
163423
- timerId = setTimeout(timerExpired, wait);
163424
- return leading ? invokeFunc(time3) : result;
163425
- }
163426
- function remainingWait(time3) {
163427
- var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
163428
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
163429
- }
163430
- function shouldInvoke(time3) {
163431
- var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime;
163432
- return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
163433
- }
163434
- function timerExpired() {
163435
- var time3 = now();
163436
- if (shouldInvoke(time3)) {
163437
- return trailingEdge(time3);
163438
- }
163439
- timerId = setTimeout(timerExpired, remainingWait(time3));
163440
- }
163441
- function trailingEdge(time3) {
163442
- timerId = undefined;
163443
- if (trailing && lastArgs) {
163444
- return invokeFunc(time3);
163445
- }
163446
- lastArgs = lastThis = undefined;
163447
- return result;
163448
- }
163449
- function cancel() {
163450
- if (timerId !== undefined) {
163451
- clearTimeout(timerId);
163452
- }
163453
- lastInvokeTime = 0;
163454
- lastArgs = lastCallTime = lastThis = timerId = undefined;
163455
- }
163456
- function flush() {
163457
- return timerId === undefined ? result : trailingEdge(now());
163458
- }
163459
- function debounced() {
163460
- var time3 = now(), isInvoking = shouldInvoke(time3);
163461
- lastArgs = arguments;
163462
- lastThis = this;
163463
- lastCallTime = time3;
163464
- if (isInvoking) {
163465
- if (timerId === undefined) {
163466
- return leadingEdge(lastCallTime);
163467
- }
163468
- if (maxing) {
163469
- clearTimeout(timerId);
163470
- timerId = setTimeout(timerExpired, wait);
163471
- return invokeFunc(lastCallTime);
163472
- }
163473
- }
163474
- if (timerId === undefined) {
163475
- timerId = setTimeout(timerExpired, wait);
163476
- }
163477
- return result;
163478
- }
163479
- debounced.cancel = cancel;
163480
- debounced.flush = flush;
163481
- return debounced;
163482
- }
163483
- module.exports = debounce;
163484
- });
163485
-
163486
163324
  // node_modules/tmp/lib/tmp.js
163487
163325
  var require_tmp = __commonJS((exports, module) => {
163488
163326
  /*!
@@ -166327,6 +166165,168 @@ var require_nedb = __commonJS((exports, module) => {
166327
166165
  module.exports = Datastore;
166328
166166
  });
166329
166167
 
166168
+ // node_modules/lodash/isObject.js
166169
+ var require_isObject = __commonJS((exports, module) => {
166170
+ function isObject5(value) {
166171
+ var type = typeof value;
166172
+ return value != null && (type == "object" || type == "function");
166173
+ }
166174
+ module.exports = isObject5;
166175
+ });
166176
+
166177
+ // node_modules/lodash/now.js
166178
+ var require_now = __commonJS((exports, module) => {
166179
+ var root2 = require__root();
166180
+ var now = function() {
166181
+ return root2.Date.now();
166182
+ };
166183
+ module.exports = now;
166184
+ });
166185
+
166186
+ // node_modules/lodash/_trimmedEndIndex.js
166187
+ var require__trimmedEndIndex = __commonJS((exports, module) => {
166188
+ var reWhitespace = /\s/;
166189
+ function trimmedEndIndex(string4) {
166190
+ var index = string4.length;
166191
+ while (index-- && reWhitespace.test(string4.charAt(index))) {}
166192
+ return index;
166193
+ }
166194
+ module.exports = trimmedEndIndex;
166195
+ });
166196
+
166197
+ // node_modules/lodash/_baseTrim.js
166198
+ var require__baseTrim = __commonJS((exports, module) => {
166199
+ var trimmedEndIndex = require__trimmedEndIndex();
166200
+ var reTrimStart = /^\s+/;
166201
+ function baseTrim(string4) {
166202
+ return string4 ? string4.slice(0, trimmedEndIndex(string4) + 1).replace(reTrimStart, "") : string4;
166203
+ }
166204
+ module.exports = baseTrim;
166205
+ });
166206
+
166207
+ // node_modules/lodash/toNumber.js
166208
+ var require_toNumber = __commonJS((exports, module) => {
166209
+ var baseTrim = require__baseTrim();
166210
+ var isObject5 = require_isObject();
166211
+ var isSymbol = require_isSymbol();
166212
+ var NAN = 0 / 0;
166213
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
166214
+ var reIsBinary = /^0b[01]+$/i;
166215
+ var reIsOctal = /^0o[0-7]+$/i;
166216
+ var freeParseInt = parseInt;
166217
+ function toNumber(value) {
166218
+ if (typeof value == "number") {
166219
+ return value;
166220
+ }
166221
+ if (isSymbol(value)) {
166222
+ return NAN;
166223
+ }
166224
+ if (isObject5(value)) {
166225
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
166226
+ value = isObject5(other) ? other + "" : other;
166227
+ }
166228
+ if (typeof value != "string") {
166229
+ return value === 0 ? value : +value;
166230
+ }
166231
+ value = baseTrim(value);
166232
+ var isBinary = reIsBinary.test(value);
166233
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
166234
+ }
166235
+ module.exports = toNumber;
166236
+ });
166237
+
166238
+ // node_modules/lodash/debounce.js
166239
+ var require_debounce = __commonJS((exports, module) => {
166240
+ var isObject5 = require_isObject();
166241
+ var now = require_now();
166242
+ var toNumber = require_toNumber();
166243
+ var FUNC_ERROR_TEXT = "Expected a function";
166244
+ var nativeMax = Math.max;
166245
+ var nativeMin = Math.min;
166246
+ function debounce(func, wait, options8) {
166247
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
166248
+ if (typeof func != "function") {
166249
+ throw new TypeError(FUNC_ERROR_TEXT);
166250
+ }
166251
+ wait = toNumber(wait) || 0;
166252
+ if (isObject5(options8)) {
166253
+ leading = !!options8.leading;
166254
+ maxing = "maxWait" in options8;
166255
+ maxWait = maxing ? nativeMax(toNumber(options8.maxWait) || 0, wait) : maxWait;
166256
+ trailing = "trailing" in options8 ? !!options8.trailing : trailing;
166257
+ }
166258
+ function invokeFunc(time3) {
166259
+ var args = lastArgs, thisArg = lastThis;
166260
+ lastArgs = lastThis = undefined;
166261
+ lastInvokeTime = time3;
166262
+ result = func.apply(thisArg, args);
166263
+ return result;
166264
+ }
166265
+ function leadingEdge(time3) {
166266
+ lastInvokeTime = time3;
166267
+ timerId = setTimeout(timerExpired, wait);
166268
+ return leading ? invokeFunc(time3) : result;
166269
+ }
166270
+ function remainingWait(time3) {
166271
+ var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
166272
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
166273
+ }
166274
+ function shouldInvoke(time3) {
166275
+ var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime;
166276
+ return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
166277
+ }
166278
+ function timerExpired() {
166279
+ var time3 = now();
166280
+ if (shouldInvoke(time3)) {
166281
+ return trailingEdge(time3);
166282
+ }
166283
+ timerId = setTimeout(timerExpired, remainingWait(time3));
166284
+ }
166285
+ function trailingEdge(time3) {
166286
+ timerId = undefined;
166287
+ if (trailing && lastArgs) {
166288
+ return invokeFunc(time3);
166289
+ }
166290
+ lastArgs = lastThis = undefined;
166291
+ return result;
166292
+ }
166293
+ function cancel() {
166294
+ if (timerId !== undefined) {
166295
+ clearTimeout(timerId);
166296
+ }
166297
+ lastInvokeTime = 0;
166298
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
166299
+ }
166300
+ function flush() {
166301
+ return timerId === undefined ? result : trailingEdge(now());
166302
+ }
166303
+ function debounced() {
166304
+ var time3 = now(), isInvoking = shouldInvoke(time3);
166305
+ lastArgs = arguments;
166306
+ lastThis = this;
166307
+ lastCallTime = time3;
166308
+ if (isInvoking) {
166309
+ if (timerId === undefined) {
166310
+ return leadingEdge(lastCallTime);
166311
+ }
166312
+ if (maxing) {
166313
+ clearTimeout(timerId);
166314
+ timerId = setTimeout(timerExpired, wait);
166315
+ return invokeFunc(lastCallTime);
166316
+ }
166317
+ }
166318
+ if (timerId === undefined) {
166319
+ timerId = setTimeout(timerExpired, wait);
166320
+ }
166321
+ return result;
166322
+ }
166323
+ debounced.cancel = cancel;
166324
+ debounced.flush = flush;
166325
+ return debounced;
166326
+ }
166327
+ module.exports = debounce;
166328
+ });
166329
+
166330
166330
  // node_modules/socket.io/node_modules/accepts/node_modules/negotiator/lib/charset.js
166331
166331
  var require_charset2 = __commonJS((exports, module) => {
166332
166332
  module.exports = preferredCharsets;
@@ -241907,7 +241907,7 @@ var package_default = {
241907
241907
  "@types/ejs": "^3.1.5",
241908
241908
  "@types/express": "^5.0.6",
241909
241909
  "@types/json-schema": "^7.0.15",
241910
- "@types/lodash": "^4.17.16",
241910
+ "@types/lodash": "^4.17.24",
241911
241911
  "@types/node": "^22.10.5",
241912
241912
  "@types/multer": "^2.0.0",
241913
241913
  "@vercel/detect-agent": "^1.1.0",
@@ -241927,7 +241927,7 @@ var package_default = {
241927
241927
  json5: "^2.2.3",
241928
241928
  knip: "^5.83.1",
241929
241929
  ky: "^1.14.2",
241930
- lodash: "^4.17.21",
241930
+ lodash: "^4.17.23",
241931
241931
  multer: "^2.0.0",
241932
241932
  msw: "^2.12.10",
241933
241933
  nanoid: "^5.1.6",
@@ -243859,8 +243859,7 @@ function getTypesCommand(context) {
243859
243859
  }
243860
243860
 
243861
243861
  // src/cli/dev/dev-server/main.ts
243862
- import { watch } from "node:fs";
243863
- import { dirname as dirname12, join as join16 } from "node:path";
243862
+ import { dirname as dirname13, join as join16 } from "node:path";
243864
243863
  var import_cors = __toESM(require_lib4(), 1);
243865
243864
  var import_express4 = __toESM(require_express(), 1);
243866
243865
 
@@ -243980,7 +243979,6 @@ async function getPorts(options8) {
243980
243979
 
243981
243980
  // src/cli/dev/dev-server/main.ts
243982
243981
  var import_http_proxy_middleware2 = __toESM(require_dist2(), 1);
243983
- var import_debounce = __toESM(require_debounce(), 1);
243984
243982
 
243985
243983
  // node_modules/tmp-promise/index.js
243986
243984
  var { promisify: promisify11 } = __require("util");
@@ -244233,6 +244231,74 @@ class Database {
244233
244231
  }
244234
244232
  }
244235
244233
 
244234
+ // src/cli/dev/dev-server/dir-watcher.ts
244235
+ var import_debounce = __toESM(require_debounce(), 1);
244236
+ import { watch } from "node:fs";
244237
+ import { dirname as dirname12 } from "node:path";
244238
+ var WATCH_DEBOUNCE_MS = 300;
244239
+
244240
+ class DirWatcher {
244241
+ targetDir;
244242
+ onChange;
244243
+ logger;
244244
+ watcher = null;
244245
+ closed = false;
244246
+ constructor(targetDir, onChange, logger) {
244247
+ this.targetDir = targetDir;
244248
+ this.onChange = onChange;
244249
+ this.logger = logger;
244250
+ }
244251
+ async start() {
244252
+ if (await pathExists(this.targetDir)) {
244253
+ this.watchTarget();
244254
+ } else {
244255
+ this.watchParentForCreation();
244256
+ }
244257
+ }
244258
+ close() {
244259
+ this.closed = true;
244260
+ this.watcher?.close();
244261
+ this.watcher = null;
244262
+ }
244263
+ watchTarget() {
244264
+ if (this.closed) {
244265
+ return;
244266
+ }
244267
+ const handler = import_debounce.default(async () => {
244268
+ try {
244269
+ await this.onChange();
244270
+ } catch (error48) {
244271
+ this.handleError(error48);
244272
+ }
244273
+ }, WATCH_DEBOUNCE_MS);
244274
+ this.watcher = watch(this.targetDir, { recursive: true }, handler);
244275
+ }
244276
+ watchParentForCreation() {
244277
+ if (this.closed) {
244278
+ return;
244279
+ }
244280
+ const parentDir = dirname12(this.targetDir);
244281
+ const handler = import_debounce.default(async () => {
244282
+ if (this.closed)
244283
+ return;
244284
+ if (await pathExists(this.targetDir)) {
244285
+ this.watcher?.close();
244286
+ this.watcher = null;
244287
+ this.watchTarget();
244288
+ try {
244289
+ await this.onChange();
244290
+ } catch (error48) {
244291
+ this.handleError(error48);
244292
+ }
244293
+ }
244294
+ }, WATCH_DEBOUNCE_MS);
244295
+ this.watcher = watch(parentDir, handler);
244296
+ }
244297
+ handleError(error48) {
244298
+ this.logger.error(`[dev-server] Watch handler failed for ${this.targetDir}`, error48 instanceof Error ? error48 : undefined);
244299
+ }
244300
+ }
244301
+
244236
244302
  // node_modules/socket.io/wrapper.mjs
244237
244303
  var import_dist = __toESM(require_dist4(), 1);
244238
244304
  var { Server, Namespace, Socket } = import_dist.default;
@@ -244587,20 +244653,6 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
244587
244653
  // src/cli/dev/dev-server/main.ts
244588
244654
  var DEFAULT_PORT = 4400;
244589
244655
  var BASE44_APP_URL = "https://base44.app";
244590
- var WATCH_DEBOUNCE_MS = 300;
244591
- async function watchDir(dir, onChange, logger) {
244592
- if (!await pathExists(dir)) {
244593
- return null;
244594
- }
244595
- const debouncedOnChange = import_debounce.default(async () => {
244596
- try {
244597
- await onChange();
244598
- } catch (error48) {
244599
- logger.error(`[dev-server] Watch handler failed for ${dir}`, error48 instanceof Error ? error48 : undefined);
244600
- }
244601
- }, WATCH_DEBOUNCE_MS);
244602
- return watch(dir, { recursive: true }, debouncedOnChange);
244603
- }
244604
244656
  async function createDevServer(options8) {
244605
244657
  const { port: userPort } = options8;
244606
244658
  const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
@@ -244664,20 +244716,22 @@ async function createDevServer(options8) {
244664
244716
  emitEntityEvent = (appId, entityName, event) => {
244665
244717
  broadcastEntityEvent(io6, appId, entityName, event);
244666
244718
  };
244667
- const configDir = dirname12(project2.configPath);
244719
+ const configDir = dirname13(project2.configPath);
244668
244720
  const functionsDir = join16(configDir, project2.functionsDir);
244669
- const functionsWatcher = await watchDir(functionsDir, async () => {
244721
+ const functionsWatcher = new DirWatcher(functionsDir, async () => {
244670
244722
  const { functions: functions2 } = await options8.loadResources();
244723
+ const previousNamesLength = functionManager.getFunctionNames().length;
244671
244724
  functionManager.reload(functions2);
244672
244725
  const names = functionManager.getFunctionNames();
244673
244726
  if (names.length > 0) {
244674
244727
  devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
244675
- } else {
244728
+ } else if (previousNamesLength > 0) {
244676
244729
  devLogger.log("All functions removed");
244677
244730
  }
244678
244731
  }, devLogger);
244732
+ await functionsWatcher.start();
244679
244733
  const shutdown = () => {
244680
- functionsWatcher?.close();
244734
+ functionsWatcher.close();
244681
244735
  io6.close();
244682
244736
  functionManager.stopAll();
244683
244737
  server.close();
@@ -244833,7 +244887,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
244833
244887
  import { release, type } from "node:os";
244834
244888
 
244835
244889
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
244836
- import { dirname as dirname13, posix, sep } from "path";
244890
+ import { dirname as dirname14, posix, sep } from "path";
244837
244891
  function createModulerModifier() {
244838
244892
  const getModuleFromFileName = createGetModuleFromFilename();
244839
244893
  return async (frames) => {
@@ -244842,7 +244896,7 @@ function createModulerModifier() {
244842
244896
  return frames;
244843
244897
  };
244844
244898
  }
244845
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname13(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
244899
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname14(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
244846
244900
  const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
244847
244901
  return (filename) => {
244848
244902
  if (!filename)
@@ -249060,4 +249114,4 @@ export {
249060
249114
  CLIExitError
249061
249115
  };
249062
249116
 
249063
- //# debugId=85AAC033AD084DA464756E2164756E21
249117
+ //# debugId=ADA50D6B6C58BDA764756E2164756E21