@getexception/cli 0.1.12 → 0.1.13

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 (2) hide show
  1. package/dist/index.js +14 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -19441,6 +19441,7 @@ var receiptSchema = external_exports.object({
19441
19441
  })
19442
19442
  )
19443
19443
  });
19444
+ var uploadConcurrency = 8;
19444
19445
  async function uploadMaps(directory, address, project, token, transport = fetch) {
19445
19446
  const manifest = await readPrepared(directory);
19446
19447
  const api = projectApi(address, project, token, transport);
@@ -19452,6 +19453,7 @@ async function uploadMaps(directory, address, project, token, transport = fetch)
19452
19453
  return;
19453
19454
  }
19454
19455
  if (receipt.status === "receiving") {
19456
+ const pending = [];
19455
19457
  for (const entry of manifest.artifacts) {
19456
19458
  const remote = receipt.artifacts.find((item) => item.path === entry.path);
19457
19459
  if (!remote) {
@@ -19460,10 +19462,18 @@ async function uploadMaps(directory, address, project, token, transport = fetch)
19460
19462
  if (remote.uploaded) {
19461
19463
  continue;
19462
19464
  }
19463
- await request(
19464
- `/${receipt.uploadId}/${remote.id}`,
19465
- "PUT",
19466
- await readPreparedMap(directory, entry)
19465
+ pending.push({ entry, id: remote.id });
19466
+ }
19467
+ for (let start = 0; start < pending.length; start += uploadConcurrency) {
19468
+ const group = pending.slice(start, start + uploadConcurrency);
19469
+ await Promise.all(
19470
+ group.map(
19471
+ async ({ entry, id }) => request(
19472
+ `/${receipt.uploadId}/${id}`,
19473
+ "PUT",
19474
+ await readPreparedMap(directory, entry)
19475
+ )
19476
+ )
19467
19477
  );
19468
19478
  }
19469
19479
  await request(`/${receipt.uploadId}`, "POST");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getexception/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Private source map uploads for GetException",
5
5
  "type": "module",
6
6
  "license": "MIT",