@flareapp/react-native-sourcemaps 2.12.0 → 2.12.2
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 +1 -1
- package/dist/bin.mjs +1 -1
- package/dist/expo.cjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{uploadSourcemaps-kKVzBO2S.mjs → uploadSourcemaps-Bpi03v9T.mjs} +29 -1
- package/dist/{uploadSourcemaps-BV__K2fF.cjs → uploadSourcemaps-i91l8DqO.cjs} +29 -1
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_uploadSourcemaps = require('./uploadSourcemaps-
|
|
2
|
+
const require_uploadSourcemaps = require('./uploadSourcemaps-i91l8DqO.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-
|
|
2
|
+
import { t as uploadSourcemaps } from "./uploadSourcemaps-Bpi03v9T.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.
|
|
68
|
+
"version": "2.12.2",
|
|
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-
|
|
2
|
+
const require_uploadSourcemaps = require('./uploadSourcemaps-i91l8DqO.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
|
@@ -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);
|
|
@@ -14,8 +37,10 @@ const RETRIABLE_STATUS_CODES = new Set([
|
|
|
14
37
|
429,
|
|
15
38
|
502,
|
|
16
39
|
503,
|
|
17
|
-
504
|
|
40
|
+
504,
|
|
41
|
+
525
|
|
18
42
|
]);
|
|
43
|
+
const MAX_CONCURRENT_UPLOADS = 10;
|
|
19
44
|
function describeNetworkError(error) {
|
|
20
45
|
if (!(error instanceof Error)) return String(error);
|
|
21
46
|
const cause = error.cause;
|
|
@@ -39,6 +64,9 @@ var FlareApi = class {
|
|
|
39
64
|
sourcemap: base64GzipSourcemap
|
|
40
65
|
});
|
|
41
66
|
}
|
|
67
|
+
uploadSourcemaps(sourcemaps) {
|
|
68
|
+
return settleWithConcurrency(sourcemaps, MAX_CONCURRENT_UPLOADS, (sourcemap) => this.uploadSourcemap(sourcemap));
|
|
69
|
+
}
|
|
42
70
|
async postWithRetry(data, maxRetries = 3) {
|
|
43
71
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
44
72
|
try {
|
|
@@ -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);
|
|
@@ -14,8 +37,10 @@ const RETRIABLE_STATUS_CODES = new Set([
|
|
|
14
37
|
429,
|
|
15
38
|
502,
|
|
16
39
|
503,
|
|
17
|
-
504
|
|
40
|
+
504,
|
|
41
|
+
525
|
|
18
42
|
]);
|
|
43
|
+
const MAX_CONCURRENT_UPLOADS = 10;
|
|
19
44
|
function describeNetworkError(error) {
|
|
20
45
|
if (!(error instanceof Error)) return String(error);
|
|
21
46
|
const cause = error.cause;
|
|
@@ -39,6 +64,9 @@ var FlareApi = class {
|
|
|
39
64
|
sourcemap: base64GzipSourcemap
|
|
40
65
|
});
|
|
41
66
|
}
|
|
67
|
+
uploadSourcemaps(sourcemaps) {
|
|
68
|
+
return settleWithConcurrency(sourcemaps, MAX_CONCURRENT_UPLOADS, (sourcemap) => this.uploadSourcemap(sourcemap));
|
|
69
|
+
}
|
|
42
70
|
async postWithRetry(data, maxRetries = 3) {
|
|
43
71
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
44
72
|
try {
|
package/package.json
CHANGED