@flareapp/react-native-sourcemaps 2.12.0 → 2.12.1

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/bin.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_uploadSourcemaps = require('./uploadSourcemaps-BV__K2fF.cjs');
2
+ const require_uploadSourcemaps = require('./uploadSourcemaps-CUZm9-kQ.cjs');
3
3
  const require_version = require('./version-CoiIhPxt.cjs');
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as uploadSourcemaps } from "./uploadSourcemaps-kKVzBO2S.mjs";
2
+ import { t as uploadSourcemaps } from "./uploadSourcemaps-Dndrddba.mjs";
3
3
  import { r as LOG_PREFIX, t as resolveAutoVersion } from "./version-BvzhWgI1.mjs";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { dirname, join } from "node:path";
package/dist/expo.cjs CHANGED
@@ -65,7 +65,7 @@ function addUploadBuildPhase(project, shellScript) {
65
65
  var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
66
66
  module.exports = {
67
67
  "name": "@flareapp/react-native-sourcemaps",
68
- "version": "2.12.0",
68
+ "version": "2.12.1",
69
69
  "description": "Upload React Native (Metro) sourcemaps to Flare",
70
70
  "homepage": "https://flareapp.io",
71
71
  "bugs": "https://github.com/spatie/flare-client-js/issues",
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_uploadSourcemaps = require('./uploadSourcemaps-BV__K2fF.cjs');
2
+ const require_uploadSourcemaps = require('./uploadSourcemaps-CUZm9-kQ.cjs');
3
3
  const require_version = require('./version-CoiIhPxt.cjs');
4
4
  const require_babel = require('./babel.cjs');
5
5
 
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as uploadSourcemaps } from "./uploadSourcemaps-kKVzBO2S.mjs";
1
+ import { t as uploadSourcemaps } from "./uploadSourcemaps-Dndrddba.mjs";
2
2
  import { n as resolveVersion } from "./version-BvzhWgI1.mjs";
3
3
  import flareSourcemapsBabelPlugin from "./babel.mjs";
4
4
 
@@ -4,6 +4,29 @@ let node_path = require("node:path");
4
4
  let node_zlib = require("node:zlib");
5
5
 
6
6
  //#region ../flare-api/dist/index.mjs
7
+ async function settleWithConcurrency(items, concurrency, task) {
8
+ const results = Array.from({ length: items.length });
9
+ let nextIndex = 0;
10
+ async function worker() {
11
+ while (nextIndex < items.length) {
12
+ const index = nextIndex++;
13
+ try {
14
+ results[index] = {
15
+ status: "fulfilled",
16
+ value: await task(items[index])
17
+ };
18
+ } catch (reason) {
19
+ results[index] = {
20
+ status: "rejected",
21
+ reason
22
+ };
23
+ }
24
+ }
25
+ }
26
+ const workerCount = Math.min(concurrency, items.length);
27
+ await Promise.all(Array.from({ length: workerCount }, () => worker()));
28
+ return results;
29
+ }
7
30
  var FlareApiError = class extends Error {
8
31
  constructor(message) {
9
32
  super(message);
@@ -16,6 +39,7 @@ const RETRIABLE_STATUS_CODES = new Set([
16
39
  503,
17
40
  504
18
41
  ]);
42
+ const MAX_CONCURRENT_UPLOADS = 10;
19
43
  function describeNetworkError(error) {
20
44
  if (!(error instanceof Error)) return String(error);
21
45
  const cause = error.cause;
@@ -39,6 +63,9 @@ var FlareApi = class {
39
63
  sourcemap: base64GzipSourcemap
40
64
  });
41
65
  }
66
+ uploadSourcemaps(sourcemaps) {
67
+ return settleWithConcurrency(sourcemaps, MAX_CONCURRENT_UPLOADS, (sourcemap) => this.uploadSourcemap(sourcemap));
68
+ }
42
69
  async postWithRetry(data, maxRetries = 3) {
43
70
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
44
71
  try {
@@ -4,6 +4,29 @@ import { basename } from "node:path";
4
4
  import { deflateRawSync } from "node:zlib";
5
5
 
6
6
  //#region ../flare-api/dist/index.mjs
7
+ async function settleWithConcurrency(items, concurrency, task) {
8
+ const results = Array.from({ length: items.length });
9
+ let nextIndex = 0;
10
+ async function worker() {
11
+ while (nextIndex < items.length) {
12
+ const index = nextIndex++;
13
+ try {
14
+ results[index] = {
15
+ status: "fulfilled",
16
+ value: await task(items[index])
17
+ };
18
+ } catch (reason) {
19
+ results[index] = {
20
+ status: "rejected",
21
+ reason
22
+ };
23
+ }
24
+ }
25
+ }
26
+ const workerCount = Math.min(concurrency, items.length);
27
+ await Promise.all(Array.from({ length: workerCount }, () => worker()));
28
+ return results;
29
+ }
7
30
  var FlareApiError = class extends Error {
8
31
  constructor(message) {
9
32
  super(message);
@@ -16,6 +39,7 @@ const RETRIABLE_STATUS_CODES = new Set([
16
39
  503,
17
40
  504
18
41
  ]);
42
+ const MAX_CONCURRENT_UPLOADS = 10;
19
43
  function describeNetworkError(error) {
20
44
  if (!(error instanceof Error)) return String(error);
21
45
  const cause = error.cause;
@@ -39,6 +63,9 @@ var FlareApi = class {
39
63
  sourcemap: base64GzipSourcemap
40
64
  });
41
65
  }
66
+ uploadSourcemaps(sourcemaps) {
67
+ return settleWithConcurrency(sourcemaps, MAX_CONCURRENT_UPLOADS, (sourcemap) => this.uploadSourcemap(sourcemap));
68
+ }
42
69
  async postWithRetry(data, maxRetries = 3) {
43
70
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
44
71
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareapp/react-native-sourcemaps",
3
- "version": "2.12.0",
3
+ "version": "2.12.1",
4
4
  "description": "Upload React Native (Metro) sourcemaps to Flare",
5
5
  "homepage": "https://flareapp.io",
6
6
  "bugs": "https://github.com/spatie/flare-client-js/issues",