@base44-preview/cli 0.1.7-pr.585.63c3afc → 0.1.7-pr.585.85db235

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
@@ -221220,7 +221220,7 @@ var require_dist5 = __commonJS((exports, module) => {
221220
221220
  determineAgent: () => determineAgent
221221
221221
  });
221222
221222
  module.exports = __toCommonJS2(src_exports);
221223
- var import_promises26 = __require("node:fs/promises");
221223
+ var import_promises25 = __require("node:fs/promises");
221224
221224
  var import_node_fs24 = __require("node:fs");
221225
221225
  var DEVIN_LOCAL_PATH = "/opt/.devin";
221226
221226
  var CURSOR2 = "cursor";
@@ -221278,7 +221278,7 @@ var require_dist5 = __commonJS((exports, module) => {
221278
221278
  return { isAgent: true, agent: { name: REPLIT } };
221279
221279
  }
221280
221280
  try {
221281
- await (0, import_promises26.access)(DEVIN_LOCAL_PATH, import_node_fs24.constants.F_OK);
221281
+ await (0, import_promises25.access)(DEVIN_LOCAL_PATH, import_node_fs24.constants.F_OK);
221282
221282
  return { isAgent: true, agent: { name: DEVIN } };
221283
221283
  } catch (error48) {}
221284
221284
  return { isAgent: false, agent: undefined };
@@ -248113,7 +248113,6 @@ var package_default = {
248113
248113
  nanoid: "^5.1.6",
248114
248114
  open: "^11.0.0",
248115
248115
  outdent: "^0.8.0",
248116
- "p-map": "^7.0.6",
248117
248116
  "p-wait-for": "^6.0.0",
248118
248117
  "posthog-node": "5.21.2",
248119
248118
  qs: "^6.12.3",
@@ -248418,145 +248417,21 @@ import { join as join16 } from "node:path";
248418
248417
 
248419
248418
  // src/core/site/upload.ts
248420
248419
  import { readFile as readFile3 } from "node:fs/promises";
248421
- import { setTimeout as sleep3 } from "node:timers/promises";
248422
-
248423
- // ../../node_modules/p-map/index.js
248424
- async function pMap(iterable, mapper, {
248425
- concurrency = Number.POSITIVE_INFINITY,
248426
- stopOnError = true,
248427
- signal
248428
- } = {}) {
248429
- return new Promise((resolve_, reject_) => {
248430
- if (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {
248431
- throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof iterable})`);
248432
- }
248433
- if (typeof mapper !== "function") {
248434
- throw new TypeError("Mapper function is required");
248435
- }
248436
- if (!(Number.isSafeInteger(concurrency) && concurrency >= 1 || concurrency === Number.POSITIVE_INFINITY)) {
248437
- throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${concurrency}\` (${typeof concurrency})`);
248438
- }
248439
- const result = [];
248440
- const errors4 = [];
248441
- const skippedIndexesMap = new Map;
248442
- let isRejected = false;
248443
- let isResolved = false;
248444
- let isIterableDone = false;
248445
- let resolvingCount = 0;
248446
- let currentIndex = 0;
248447
- const iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();
248448
- const signalListener = () => {
248449
- reject(signal.reason);
248450
- };
248451
- const cleanup = () => {
248452
- signal?.removeEventListener("abort", signalListener);
248453
- };
248454
- const resolve3 = (value) => {
248455
- resolve_(value);
248456
- cleanup();
248457
- };
248458
- const reject = (reason) => {
248459
- isRejected = true;
248460
- isResolved = true;
248461
- reject_(reason);
248462
- cleanup();
248463
- };
248464
- if (signal) {
248465
- if (signal.aborted) {
248466
- reject(signal.reason);
248467
- return;
248468
- }
248469
- signal.addEventListener("abort", signalListener, { once: true });
248470
- }
248471
- const next = async () => {
248472
- if (isResolved) {
248473
- return;
248474
- }
248475
- const nextItem = await iterator.next();
248476
- const index = currentIndex;
248477
- currentIndex++;
248478
- if (nextItem.done) {
248479
- isIterableDone = true;
248480
- if (resolvingCount === 0 && !isResolved) {
248481
- if (!stopOnError && errors4.length > 0) {
248482
- reject(new AggregateError(errors4));
248483
- return;
248484
- }
248485
- isResolved = true;
248486
- if (skippedIndexesMap.size === 0) {
248487
- resolve3(result);
248488
- return;
248489
- }
248490
- const pureResult = [];
248491
- for (const [index2, value] of result.entries()) {
248492
- if (skippedIndexesMap.get(index2) === pMapSkip) {
248493
- continue;
248494
- }
248495
- pureResult.push(value);
248496
- }
248497
- resolve3(pureResult);
248498
- }
248499
- return;
248500
- }
248501
- resolvingCount++;
248502
- (async () => {
248503
- try {
248504
- const element = await nextItem.value;
248505
- if (isResolved) {
248506
- return;
248507
- }
248508
- const value = await mapper(element, index);
248509
- if (value === pMapSkip) {
248510
- skippedIndexesMap.set(index, value);
248511
- }
248512
- result[index] = value;
248513
- resolvingCount--;
248514
- await next();
248515
- } catch (error48) {
248516
- if (stopOnError) {
248517
- reject(error48);
248518
- } else {
248519
- errors4.push(error48);
248520
- resolvingCount--;
248521
- try {
248522
- await next();
248523
- } catch (error49) {
248524
- reject(error49);
248525
- }
248526
- }
248527
- }
248528
- })();
248529
- };
248530
- (async () => {
248531
- for (let index = 0;index < concurrency; index++) {
248532
- try {
248533
- await next();
248534
- } catch (error48) {
248535
- reject(error48);
248536
- break;
248537
- }
248538
- if (isIterableDone || isRejected) {
248539
- break;
248540
- }
248541
- }
248542
- })();
248543
- });
248544
- }
248545
- var pMapSkip = Symbol("skip");
248546
-
248547
- // src/core/site/upload.ts
248548
- var DEFAULT_UPLOAD_CONCURRENCY = 3;
248549
- var MAX_UPLOAD_CONCURRENCY = 50;
248420
+ var UPLOAD_CONCURRENCY = 3;
248550
248421
  var MAX_ATTEMPTS_PER_UPLOAD = 3;
248551
248422
  var RETRY_BASE_DELAY_MS = 500;
248552
- async function uploadPresignedAssets(uploads, assets, options = {}) {
248553
- const { concurrency = DEFAULT_UPLOAD_CONCURRENCY, onProgress } = options;
248423
+ async function uploadPresignedAssets(uploads, assets, onProgress) {
248554
248424
  let uploadedFiles = 0;
248555
- await pMap(uploads, async (upload) => {
248556
- await uploadPresignedAssetWithRetry(upload, assets);
248557
- uploadedFiles++;
248558
- onProgress?.({ uploadedFiles, totalFiles: uploads.length });
248559
- }, { concurrency });
248425
+ let nextUpload = 0;
248426
+ const worker = async () => {
248427
+ while (nextUpload < uploads.length) {
248428
+ const upload = uploads[nextUpload++];
248429
+ await uploadPresignedAssetWithRetry(upload, assets);
248430
+ uploadedFiles++;
248431
+ onProgress?.({ uploadedFiles, totalFiles: uploads.length });
248432
+ }
248433
+ };
248434
+ await Promise.all(Array.from({ length: Math.min(UPLOAD_CONCURRENCY, uploads.length) }, worker));
248560
248435
  }
248561
248436
  async function uploadPresignedAssetWithRetry(upload, assets) {
248562
248437
  const entry = assets.manifest[upload.path];
@@ -248584,10 +248459,13 @@ async function uploadPresignedAssetWithRetry(upload, assets) {
248584
248459
  }
248585
248460
  throw await ApiError.fromHttpError(lastError, "uploading static assets");
248586
248461
  }
248462
+ function sleep3(ms) {
248463
+ return new Promise((resolve3) => setTimeout(resolve3, ms));
248464
+ }
248587
248465
 
248588
248466
  // src/core/site/static-site.ts
248589
248467
  async function deployStaticSite(options) {
248590
- const { outputDir, gitHash, concurrency, progress } = options;
248468
+ const { outputDir, gitHash, progress } = options;
248591
248469
  const assets = await buildAssetManifest(outputDir, getAppContext().id);
248592
248470
  if (!assets.manifest["/index.html"]) {
248593
248471
  throw new InvalidInputError(`No index.html found in "${outputDir}" — a static site needs one at the output directory root.`);
@@ -248601,10 +248479,7 @@ async function deployStaticSite(options) {
248601
248479
  newAssets: created.assetUploads?.uploads.length ?? 0
248602
248480
  });
248603
248481
  if (created.assetUploads) {
248604
- await uploadPresignedAssets(created.assetUploads.uploads, assets, {
248605
- concurrency,
248606
- onProgress: progress?.onAssetUpload
248607
- });
248482
+ await uploadPresignedAssets(created.assetUploads.uploads, assets, progress?.onAssetUpload);
248608
248483
  }
248609
248484
  const indexHtml = await readFile4(join16(outputDir, "index.html"));
248610
248485
  const finalized = await finalizeStaticDeployment(created.deploymentId, new Uint8Array(indexHtml));
@@ -259061,15 +258936,13 @@ async function deployAction2(ctx, options) {
259061
258936
  }
259062
258937
  await maybeBuildBeforeDeploy(ctx, project2, options.build);
259063
258938
  const outputDir = resolve11(project2.root, outputDirectory);
259064
- const { gitHash, concurrency } = options;
259065
- return gitHash ? await deployToDeploymentsApi(ctx, outputDir, gitHash, concurrency) : await deployTarball(ctx, outputDir);
258939
+ return options.gitHash ? await deployToDeploymentsApi(ctx, outputDir, options.gitHash) : await deployTarball(ctx, outputDir);
259066
258940
  }
259067
- async function deployToDeploymentsApi({ runTask: runTask2, log, jsonMode }, outputDir, gitHash, concurrency) {
258941
+ async function deployToDeploymentsApi({ runTask: runTask2, log, jsonMode }, outputDir, gitHash) {
259068
258942
  const progressLines = [];
259069
258943
  const { deploymentId } = await runTask2("Deploying site...", async (updateMessage) => await deployStaticSite({
259070
258944
  outputDir,
259071
258945
  gitHash,
259072
- concurrency,
259073
258946
  progress: {
259074
258947
  onAssets: ({ totalAssets, newAssets }) => {
259075
258948
  const line = `Found ${totalAssets} static assets (${newAssets} new)`;
@@ -259106,17 +258979,9 @@ function getSiteDeployCommand() {
259106
258979
  }
259107
258980
  return value;
259108
258981
  }));
259109
- command2.addOption(new Option("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency));
259110
258982
  }
259111
258983
  return command2.action(deployAction2);
259112
258984
  }
259113
- function parseConcurrency(value) {
259114
- const parsed = Number(value);
259115
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > MAX_UPLOAD_CONCURRENCY) {
259116
- throw new InvalidArgumentError(`Expected a whole number between 1 and ${MAX_UPLOAD_CONCURRENCY}.`);
259117
- }
259118
- return parsed;
259119
- }
259120
258985
 
259121
258986
  // src/cli/commands/site/open.ts
259122
258987
  async function openAction({
@@ -267909,4 +267774,4 @@ export {
267909
267774
  CLIExitError
267910
267775
  };
267911
267776
 
267912
- //# debugId=8D3A45157A4E22AA64756E2164756E21
267777
+ //# debugId=54C8BB5F436D9BDE64756E2164756E21