@flareapp/react-native-sourcemaps 2.7.0 → 2.9.0

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/babel.cjs CHANGED
@@ -1,14 +1,12 @@
1
- const require_version = require('./version-Z9pawNvw.cjs');
1
+ const require_version = require('./version-DS96fXWD.cjs');
2
2
 
3
3
  //#region src/babel.ts
4
4
  const RUNTIME_SOURCE = "@flareapp/react-native-sourcemaps/runtime";
5
5
  const EXPORT_NAME = "flareSourcemapVersion";
6
6
  /**
7
- * Babel plugin that inlines `flareSourcemapVersion` (imported from
8
- * `@flareapp/react-native-sourcemaps/runtime`) with the resolved version string at
9
- * bundle time, then removes the now-dead import so nothing of this package ships at
10
- * runtime. The version is resolved once per file (lazily, only when the import is
11
- * present) via the shared `resolveVersion()`.
7
+ * Babel plugin that inlines `flareSourcemapVersion` (imported from `.../runtime`) with the resolved
8
+ * version string at bundle time, then removes the now-dead import so nothing of this package ships at
9
+ * runtime. Version resolved once per file, lazily (only when the import is present).
12
10
  */
13
11
  function flareSourcemapsBabelPlugin({ types: t }) {
14
12
  let version;
package/dist/babel.d.cts CHANGED
@@ -4,11 +4,9 @@ import * as Babel from "@babel/core";
4
4
  //#region src/babel.d.ts
5
5
  type Types = typeof index_legacy_d_exports;
6
6
  /**
7
- * Babel plugin that inlines `flareSourcemapVersion` (imported from
8
- * `@flareapp/react-native-sourcemaps/runtime`) with the resolved version string at
9
- * bundle time, then removes the now-dead import so nothing of this package ships at
10
- * runtime. The version is resolved once per file (lazily, only when the import is
11
- * present) via the shared `resolveVersion()`.
7
+ * Babel plugin that inlines `flareSourcemapVersion` (imported from `.../runtime`) with the resolved
8
+ * version string at bundle time, then removes the now-dead import so nothing of this package ships at
9
+ * runtime. Version resolved once per file, lazily (only when the import is present).
12
10
  */
13
11
  declare function flareSourcemapsBabelPlugin({
14
12
  types: t
package/dist/babel.d.mts CHANGED
@@ -4,11 +4,9 @@ import * as Babel from "@babel/core";
4
4
  //#region src/babel.d.ts
5
5
  type Types = typeof index_legacy_d_exports;
6
6
  /**
7
- * Babel plugin that inlines `flareSourcemapVersion` (imported from
8
- * `@flareapp/react-native-sourcemaps/runtime`) with the resolved version string at
9
- * bundle time, then removes the now-dead import so nothing of this package ships at
10
- * runtime. The version is resolved once per file (lazily, only when the import is
11
- * present) via the shared `resolveVersion()`.
7
+ * Babel plugin that inlines `flareSourcemapVersion` (imported from `.../runtime`) with the resolved
8
+ * version string at bundle time, then removes the now-dead import so nothing of this package ships at
9
+ * runtime. Version resolved once per file, lazily (only when the import is present).
12
10
  */
13
11
  declare function flareSourcemapsBabelPlugin({
14
12
  types: t
package/dist/babel.mjs CHANGED
@@ -1,14 +1,12 @@
1
- import { n as resolveVersion } from "./version-DnFqflPl.mjs";
1
+ import { n as resolveVersion } from "./version-DizeDGRU.mjs";
2
2
 
3
3
  //#region src/babel.ts
4
4
  const RUNTIME_SOURCE = "@flareapp/react-native-sourcemaps/runtime";
5
5
  const EXPORT_NAME = "flareSourcemapVersion";
6
6
  /**
7
- * Babel plugin that inlines `flareSourcemapVersion` (imported from
8
- * `@flareapp/react-native-sourcemaps/runtime`) with the resolved version string at
9
- * bundle time, then removes the now-dead import so nothing of this package ships at
10
- * runtime. The version is resolved once per file (lazily, only when the import is
11
- * present) via the shared `resolveVersion()`.
7
+ * Babel plugin that inlines `flareSourcemapVersion` (imported from `.../runtime`) with the resolved
8
+ * version string at bundle time, then removes the now-dead import so nothing of this package ships at
9
+ * runtime. Version resolved once per file, lazily (only when the import is present).
12
10
  */
13
11
  function flareSourcemapsBabelPlugin({ types: t }) {
14
12
  let version;
package/dist/bin.cjs CHANGED
@@ -1,30 +1,18 @@
1
1
  #!/usr/bin/env node
2
- const require_uploadSourcemaps = require('./uploadSourcemaps-D6J5FWDO.cjs');
3
- const require_version = require('./version-Z9pawNvw.cjs');
2
+ const require_uploadSourcemaps = require('./uploadSourcemaps-DmFyPNoM.cjs');
3
+ const require_version = require('./version-DS96fXWD.cjs');
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
 
7
7
  //#region src/banner.ts
8
8
  const BORDER = "=".repeat(60);
9
- /**
10
- * Mask an API key for display in a build log, which CI commonly archives. A key
11
- * long enough to stay unguessable keeps a short head/tail so the user can still
12
- * recognise WHICH key it was; a short key is fully masked. Never returns the key
13
- * in full, so the secret cannot leak through the failure banner.
14
- */
9
+ /** CI commonly archives build logs. A long key keeps a head/tail hint so it stays recognisable; a short
10
+ * one is masked completely. Never returns the key in full. */
15
11
  function maskApiKey(apiKey) {
16
12
  if (apiKey.length <= 12) return "*".repeat(apiKey.length);
17
13
  return `${apiKey.slice(0, 4)}${"*".repeat(8)}${apiKey.slice(-4)}`;
18
14
  }
19
- /**
20
- * The deliberately large failure banner. A one-line "failed to upload" is too easy
21
- * to miss in a long native-build log, so this is a bordered block surrounded by
22
- * blank lines. Resolved values are interpolated into the re-run command so the
23
- * user can copy-paste it; unknown values show a labelled placeholder (in the
24
- * version-unset case `version` stays a placeholder — it is the value to supply).
25
- * The API key is the one exception: it is MASKED, never printed in full, because
26
- * this banner lands in the native build log.
27
- */
15
+ /** Deliberately large: a one-line "failed to upload" is too easy to miss in a native build log. */
28
16
  function formatFailureBanner(info) {
29
17
  const sourcemap = info.sourcemap ?? "<path-to-map>";
30
18
  const bundleFilename = info.bundleFilename ?? "<bundle-filename>";
@@ -53,12 +41,10 @@ function printFailureBanner(info) {
53
41
  //#endregion
54
42
  //#region src/config.ts
55
43
  /**
56
- * Read flare.json from an EXPLICIT path. The hooks run from android/ or ios/, so
57
- * resolving relative to process.cwd() would read the wrong file callers always
58
- * pass --config. Missing or malformed file empty config, so resolution falls
59
- * through to env, then to the no-key skip-with-banner. Any `version` key is
60
- * deliberately ignored: in the auto path the version flows only through
61
- * FLARE_SOURCEMAP_VERSION (see resolveAutoVersion / the design doc).
44
+ * Read flare.json from an explicit path. Hooks run from android/ or ios/, so resolving relative to
45
+ * cwd would read the wrong file; callers always pass --config. Missing or malformed file yields an
46
+ * empty config, so resolution falls through to env then to the no-key skip-with-banner. Any `version`
47
+ * key is ignored: in the auto path version flows only through FLARE_SOURCEMAP_VERSION.
62
48
  */
63
49
  function readFlareConfig(configPath) {
64
50
  if (!configPath) return {};
@@ -82,22 +68,14 @@ function asString(value) {
82
68
  //#region src/env.ts
83
69
  const ENV_FILES = [".env.local", ".env"];
84
70
  /**
85
- * Load FLARE_* variables from .env.local / .env in `rootDir` into process.env,
86
- * without overwriting anything already set.
71
+ * Load FLARE_* variables into process.env without overwriting anything already set.
87
72
  *
88
- * The native build hooks run in a fresh process whose environment often does NOT
89
- * carry the upload key: the app's .env files are loaded by Metro at JS runtime, not
90
- * at native build time, and a build launched from an IDE or served by a reused
91
- * Gradle daemon with a stale environment — won't see a key you exported in your
92
- * shell. Reading the key from the FILE here makes "drop FLARE_API_KEY in .env.local"
93
- * work the way developers expect, on both platforms, without re-exporting it per
94
- * build.
73
+ * Native build hooks run in a fresh process that usually lacks the upload key: Metro loads .env at JS
74
+ * runtime, not native build time, and an IDE build or a reused Gradle daemon never sees a key exported in
75
+ * your shell. Reading the file makes "drop FLARE_API_KEY in .env.local" work on both platforms.
95
76
  *
96
- * Only FLARE_-prefixed keys are read, so this never pulls unrelated secrets from the
97
- * file into the process. Minimal parser (no dependency): `KEY=value`, an optional
98
- * `export ` prefix, surrounding single/double quotes stripped, blank and `#` comment
99
- * lines ignored. Inline comments are NOT stripped (a `#` is treated as part of the
100
- * value), which is fine for the alphanumeric keys Flare issues.
77
+ * Only FLARE_-prefixed keys are read, never unrelated secrets. The parser is minimal to avoid a
78
+ * dependency; it does not strip inline comments, which is fine for the keys Flare issues.
101
79
  */
102
80
  function loadEnvFiles(rootDir) {
103
81
  for (const file of ENV_FILES) {
@@ -192,11 +170,10 @@ async function runCli(argv) {
192
170
  });
193
171
  }
194
172
  /**
195
- * The build-hook upload path. It NEVER throws and NEVER sets a non-zero exit code
196
- * (a Gradle doLast / Xcode run-script phase would abort the build on a non-zero
197
- * child). Every failure mode no key, unresolved version, upload error prints the
198
- * loud banner and returns, leaving the build green. Only arg misuse (handled in
199
- * runCli before we get here) exits non-zero.
173
+ * Build-hook upload path. Never throws and never sets a non-zero exit code (a Gradle doLast / Xcode
174
+ * run-script phase aborts the build on a non-zero child). Every failure (no key, unresolved version,
175
+ * upload error) prints the banner and returns, leaving the build green. Only arg misuse (handled in
176
+ * runCli before here) exits non-zero.
200
177
  */
201
178
  async function runAutoUpload(options) {
202
179
  const { apiKey, sourcemap, bundleFilename, apiEndpoint } = options;
package/dist/bin.mjs CHANGED
@@ -1,30 +1,18 @@
1
1
  #!/usr/bin/env node
2
- import { t as uploadSourcemaps } from "./uploadSourcemaps-C2EGBxe1.mjs";
3
- import { r as LOG_PREFIX, t as resolveAutoVersion } from "./version-DnFqflPl.mjs";
2
+ import { t as uploadSourcemaps } from "./uploadSourcemaps-ChmgzzNm.mjs";
3
+ import { r as LOG_PREFIX, t as resolveAutoVersion } from "./version-DizeDGRU.mjs";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { dirname, join } from "node:path";
6
6
 
7
7
  //#region src/banner.ts
8
8
  const BORDER = "=".repeat(60);
9
- /**
10
- * Mask an API key for display in a build log, which CI commonly archives. A key
11
- * long enough to stay unguessable keeps a short head/tail so the user can still
12
- * recognise WHICH key it was; a short key is fully masked. Never returns the key
13
- * in full, so the secret cannot leak through the failure banner.
14
- */
9
+ /** CI commonly archives build logs. A long key keeps a head/tail hint so it stays recognisable; a short
10
+ * one is masked completely. Never returns the key in full. */
15
11
  function maskApiKey(apiKey) {
16
12
  if (apiKey.length <= 12) return "*".repeat(apiKey.length);
17
13
  return `${apiKey.slice(0, 4)}${"*".repeat(8)}${apiKey.slice(-4)}`;
18
14
  }
19
- /**
20
- * The deliberately large failure banner. A one-line "failed to upload" is too easy
21
- * to miss in a long native-build log, so this is a bordered block surrounded by
22
- * blank lines. Resolved values are interpolated into the re-run command so the
23
- * user can copy-paste it; unknown values show a labelled placeholder (in the
24
- * version-unset case `version` stays a placeholder — it is the value to supply).
25
- * The API key is the one exception: it is MASKED, never printed in full, because
26
- * this banner lands in the native build log.
27
- */
15
+ /** Deliberately large: a one-line "failed to upload" is too easy to miss in a native build log. */
28
16
  function formatFailureBanner(info) {
29
17
  const sourcemap = info.sourcemap ?? "<path-to-map>";
30
18
  const bundleFilename = info.bundleFilename ?? "<bundle-filename>";
@@ -53,12 +41,10 @@ function printFailureBanner(info) {
53
41
  //#endregion
54
42
  //#region src/config.ts
55
43
  /**
56
- * Read flare.json from an EXPLICIT path. The hooks run from android/ or ios/, so
57
- * resolving relative to process.cwd() would read the wrong file callers always
58
- * pass --config. Missing or malformed file empty config, so resolution falls
59
- * through to env, then to the no-key skip-with-banner. Any `version` key is
60
- * deliberately ignored: in the auto path the version flows only through
61
- * FLARE_SOURCEMAP_VERSION (see resolveAutoVersion / the design doc).
44
+ * Read flare.json from an explicit path. Hooks run from android/ or ios/, so resolving relative to
45
+ * cwd would read the wrong file; callers always pass --config. Missing or malformed file yields an
46
+ * empty config, so resolution falls through to env then to the no-key skip-with-banner. Any `version`
47
+ * key is ignored: in the auto path version flows only through FLARE_SOURCEMAP_VERSION.
62
48
  */
63
49
  function readFlareConfig(configPath) {
64
50
  if (!configPath) return {};
@@ -82,22 +68,14 @@ function asString(value) {
82
68
  //#region src/env.ts
83
69
  const ENV_FILES = [".env.local", ".env"];
84
70
  /**
85
- * Load FLARE_* variables from .env.local / .env in `rootDir` into process.env,
86
- * without overwriting anything already set.
71
+ * Load FLARE_* variables into process.env without overwriting anything already set.
87
72
  *
88
- * The native build hooks run in a fresh process whose environment often does NOT
89
- * carry the upload key: the app's .env files are loaded by Metro at JS runtime, not
90
- * at native build time, and a build launched from an IDE or served by a reused
91
- * Gradle daemon with a stale environment — won't see a key you exported in your
92
- * shell. Reading the key from the FILE here makes "drop FLARE_API_KEY in .env.local"
93
- * work the way developers expect, on both platforms, without re-exporting it per
94
- * build.
73
+ * Native build hooks run in a fresh process that usually lacks the upload key: Metro loads .env at JS
74
+ * runtime, not native build time, and an IDE build or a reused Gradle daemon never sees a key exported in
75
+ * your shell. Reading the file makes "drop FLARE_API_KEY in .env.local" work on both platforms.
95
76
  *
96
- * Only FLARE_-prefixed keys are read, so this never pulls unrelated secrets from the
97
- * file into the process. Minimal parser (no dependency): `KEY=value`, an optional
98
- * `export ` prefix, surrounding single/double quotes stripped, blank and `#` comment
99
- * lines ignored. Inline comments are NOT stripped (a `#` is treated as part of the
100
- * value), which is fine for the alphanumeric keys Flare issues.
77
+ * Only FLARE_-prefixed keys are read, never unrelated secrets. The parser is minimal to avoid a
78
+ * dependency; it does not strip inline comments, which is fine for the keys Flare issues.
101
79
  */
102
80
  function loadEnvFiles(rootDir) {
103
81
  for (const file of ENV_FILES) {
@@ -192,11 +170,10 @@ async function runCli(argv) {
192
170
  });
193
171
  }
194
172
  /**
195
- * The build-hook upload path. It NEVER throws and NEVER sets a non-zero exit code
196
- * (a Gradle doLast / Xcode run-script phase would abort the build on a non-zero
197
- * child). Every failure mode no key, unresolved version, upload error prints the
198
- * loud banner and returns, leaving the build green. Only arg misuse (handled in
199
- * runCli before we get here) exits non-zero.
173
+ * Build-hook upload path. Never throws and never sets a non-zero exit code (a Gradle doLast / Xcode
174
+ * run-script phase aborts the build on a non-zero child). Every failure (no key, unresolved version,
175
+ * upload error) prints the banner and returns, leaving the build green. Only arg misuse (handled in
176
+ * runCli before here) exits non-zero.
200
177
  */
201
178
  async function runAutoUpload(options) {
202
179
  const { apiKey, sourcemap, bundleFilename, apiEndpoint } = options;
package/dist/expo.cjs CHANGED
@@ -10,26 +10,27 @@ let _expo_config_plugins = require("@expo/config-plugins");
10
10
  const FLARE_GRADLE_MARKER = "@flareapp/react-native-sourcemaps Expo config plugin";
11
11
  const SOURCEMAP_FILE_LINE = "export SOURCEMAP_FILE=\"$TARGET_TEMP_DIR/main.jsbundle.map\"";
12
12
  const GITIGNORE_ENTRY = "flare.json";
13
- /** Serialise the plugin props into the flare.json the native hooks read. Absent
14
- * props are omitted so the CLI applies its own defaults (endpoint) and env fallback
15
- * (FLARE_API_KEY). No `version` key — version flows only through FLARE_SOURCEMAP_VERSION. */
13
+ /** Absent props are omitted so the CLI applies its own defaults and its FLARE_API_KEY fallback. No
14
+ * `version` key: that flows only through FLARE_SOURCEMAP_VERSION. */
16
15
  function flareJsonContents(props) {
17
16
  const config = {};
18
17
  if (props.apiKey) config.apiKey = props.apiKey;
19
18
  if (props.apiEndpoint) config.apiEndpoint = props.apiEndpoint;
20
19
  return `${JSON.stringify(config, null, 4)}\n`;
21
20
  }
22
- /** Append `apply from: "<path>"` to android/app/build.gradle. Idempotent via a marker
23
- * comment, so a re-prebuild without --clean does not duplicate it. */
21
+ /**
22
+ * Append `apply from: "<path>"` to android/app/build.gradle. Idempotent via a marker comment, so a
23
+ * re-prebuild without --clean does not duplicate it.
24
+ */
24
25
  function addFlareGradleApply(buildGradle, applyFromPath) {
25
26
  if (buildGradle.includes(FLARE_GRADLE_MARKER)) return buildGradle;
26
27
  return `${buildGradle.endsWith("\n") ? buildGradle : `${buildGradle}\n`}\n// ${FLARE_GRADLE_MARKER}\napply from: ${JSON.stringify(applyFromPath)}\n`;
27
28
  }
28
- /** Ensure ios/.xcode.env exports SOURCEMAP_FILE so the stock bundle phase emits the
29
- * composed map. Idempotent, and treats a missing file (empty string) as valid input.
30
- * The guard is line-based and ignores comments, so a commented-out `# SOURCEMAP_FILE=`
31
- * does not suppress injection while a real `export SOURCEMAP_FILE=`/`SOURCEMAP_FILE=`
32
- * (a user's custom map path) is left untouched. */
29
+ /**
30
+ * Exports SOURCEMAP_FILE so the stock bundle phase emits the composed map. Idempotent, and treats a
31
+ * missing file as valid input. The guard is line-based and ignores comments, so a commented-out
32
+ * `# SOURCEMAP_FILE=` does not suppress injection while a real one is left untouched.
33
+ */
33
34
  function addSourcemapFileEnv(xcodeEnv) {
34
35
  if (xcodeEnv.split("\n").some((line) => {
35
36
  const trimmed = line.trim();
@@ -37,13 +38,12 @@ function addSourcemapFileEnv(xcodeEnv) {
37
38
  })) return xcodeEnv;
38
39
  return `${xcodeEnv.length === 0 || xcodeEnv.endsWith("\n") ? xcodeEnv : `${xcodeEnv}\n`}# Flare: emit the composed Hermes sourcemap so the upload phase can find it\n${SOURCEMAP_FILE_LINE}\n`;
39
40
  }
40
- /** Append `flare.json` to .gitignore once (the file is generated from app.json props). */
41
+ /** Append `flare.json` to .gitignore once (it is generated from app.json props). */
41
42
  function ensureGitignored(gitignore, entry = GITIGNORE_ENTRY) {
42
43
  if (gitignore.split("\n").some((line) => line.trim() === entry)) return gitignore;
43
44
  return `${gitignore.length === 0 || gitignore.endsWith("\n") ? gitignore : `${gitignore}\n`}${entry}\n`;
44
45
  }
45
- /** The shell body of the iOS "Upload Flare sourcemaps" phase: source RN's
46
- * with-environment.sh (so SOURCEMAP_FILE/FLARE_* are present), then run flare-xcode.sh. */
46
+ /** Sources RN's with-environment.sh first, so SOURCEMAP_FILE and FLARE_* are present. */
47
47
  function flareXcodeShellScript(withEnvironmentPath, flareXcodePath) {
48
48
  return [
49
49
  "set -e",
@@ -53,8 +53,7 @@ function flareXcodeShellScript(withEnvironmentPath, flareXcodePath) {
53
53
  ""
54
54
  ].join("\n");
55
55
  }
56
- /** path.relative, normalised to forward slashes (Gradle/Xcode script paths are posix
57
- * even when prebuild runs on Windows). */
56
+ /** path.relative normalised to forward slashes (Gradle/Xcode paths are posix even on Windows). */
58
57
  function toPosixRelative(fromDir, target) {
59
58
  return (0, node_path.relative)(fromDir, target).split(node_path.sep).join("/");
60
59
  }
@@ -64,11 +63,8 @@ function toPosixRelative(fromDir, target) {
64
63
  const FLARE_PHASE_NAME = "Upload Flare sourcemaps";
65
64
  const ALWAYS_OUT_OF_DATE = 1;
66
65
  /**
67
- * Append an "Upload Flare sourcemaps" shell-script phase to the app target. The phase
68
- * is APPENDED (so it always runs after the JS bundle phase, whatever that phase is
69
- * named or wherever it sits across Expo SDKs). Idempotency guard: skip if a phase with
70
- * our name already exists. Note this mutates `project` in place (the `xcode` lib's
71
- * contract) and returns the same instance for convenience.
66
+ * Appended rather than positioned, so it runs after the JS bundle phase whatever that phase is named and
67
+ * wherever it sits across Expo SDKs. Mutates `project` in place, per the `xcode` lib's contract.
72
68
  */
73
69
  function addUploadBuildPhase(project, shellScript) {
74
70
  const internal = project;
@@ -87,7 +83,7 @@ function addUploadBuildPhase(project, shellScript) {
87
83
  var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
88
84
  module.exports = {
89
85
  "name": "@flareapp/react-native-sourcemaps",
90
- "version": "2.7.0",
86
+ "version": "2.9.0",
91
87
  "description": "Upload React Native (Metro) sourcemaps to Flare",
92
88
  "homepage": "https://flareapp.io",
93
89
  "bugs": "https://github.com/spatie/flare-client-js/issues",
@@ -100,6 +96,7 @@ var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
100
96
  "name": "Spatie",
101
97
  "email": "info@spatie.be"
102
98
  },
99
+ "contributors": ["Dries Heyninck <dries@spatie.be>"],
103
100
  "files": [
104
101
  "dist",
105
102
  "flare.gradle",
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_uploadSourcemaps = require('./uploadSourcemaps-D6J5FWDO.cjs');
3
- const require_version = require('./version-Z9pawNvw.cjs');
2
+ const require_uploadSourcemaps = require('./uploadSourcemaps-DmFyPNoM.cjs');
3
+ const require_version = require('./version-DS96fXWD.cjs');
4
4
  const require_babel = require('./babel.cjs');
5
5
 
6
6
  exports.flareSourcemapsBabelPlugin = require_babel;
package/dist/index.d.cts CHANGED
@@ -20,10 +20,9 @@ type ResolveVersionOptions = {
20
20
  cwd?: string;
21
21
  };
22
22
  /**
23
- * Resolve the sourcemap version shared by the Babel plugin and the CLI.
24
- * Precedence: explicit `version` > `FLARE_SOURCEMAP_VERSION` env > package.json
25
- * `version` (with a warning). Never a random value a random default would
26
- * silently desync the inlined runtime value from the uploaded `version_id`.
23
+ * Resolve the sourcemap version shared by the Babel plugin and the CLI. Precedence: explicit
24
+ * `version` > `FLARE_SOURCEMAP_VERSION` env > package.json `version` (with a warning). Never random: a
25
+ * random default would silently put the inlined runtime value out of sync with the uploaded `version_id`.
27
26
  */
28
27
  declare function resolveVersion({
29
28
  version,
package/dist/index.d.mts CHANGED
@@ -20,10 +20,9 @@ type ResolveVersionOptions = {
20
20
  cwd?: string;
21
21
  };
22
22
  /**
23
- * Resolve the sourcemap version shared by the Babel plugin and the CLI.
24
- * Precedence: explicit `version` > `FLARE_SOURCEMAP_VERSION` env > package.json
25
- * `version` (with a warning). Never a random value a random default would
26
- * silently desync the inlined runtime value from the uploaded `version_id`.
23
+ * Resolve the sourcemap version shared by the Babel plugin and the CLI. Precedence: explicit
24
+ * `version` > `FLARE_SOURCEMAP_VERSION` env > package.json `version` (with a warning). Never random: a
25
+ * random default would silently put the inlined runtime value out of sync with the uploaded `version_id`.
27
26
  */
28
27
  declare function resolveVersion({
29
28
  version,
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as uploadSourcemaps } from "./uploadSourcemaps-C2EGBxe1.mjs";
2
- import { n as resolveVersion } from "./version-DnFqflPl.mjs";
1
+ import { t as uploadSourcemaps } from "./uploadSourcemaps-ChmgzzNm.mjs";
2
+ import { n as resolveVersion } from "./version-DizeDGRU.mjs";
3
3
  import flareSourcemapsBabelPlugin from "./babel.mjs";
4
4
 
5
5
  export { flareSourcemapsBabelPlugin, resolveVersion, uploadSourcemaps };
package/dist/runtime.cjs CHANGED
@@ -2,15 +2,13 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  //#region src/runtime.ts
4
4
  /**
5
- * The build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
5
+ * Build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
6
6
  *
7
- * `@flareapp/react-native-sourcemaps/babel` replaces every reference to this
8
- * binding with the resolved version string literal at bundle time, then drops the
9
- * import. Without that Babel plugin it stays an empty string (meaning "no version"),
10
- * which is harmless because sourcemaps are only uploaded for release builds.
7
+ * The `.../babel` plugin replaces every reference to this binding with the resolved version literal, then
8
+ * drops the import. Without that plugin it stays an empty string, which is harmless because sourcemaps
9
+ * are only uploaded for release builds.
11
10
  *
12
- * This module is runtime-safe: it has no Node imports, so it is safe to import into
13
- * app code that Metro bundles (unlike the package root, which pulls in the uploader).
11
+ * No Node imports, unlike the package root, so this is safe to pull into Metro-bundled app code.
14
12
  */
15
13
  const flareSourcemapVersion = "";
16
14
 
@@ -1,14 +1,12 @@
1
1
  //#region src/runtime.d.ts
2
2
  /**
3
- * The build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
3
+ * Build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
4
4
  *
5
- * `@flareapp/react-native-sourcemaps/babel` replaces every reference to this
6
- * binding with the resolved version string literal at bundle time, then drops the
7
- * import. Without that Babel plugin it stays an empty string (meaning "no version"),
8
- * which is harmless because sourcemaps are only uploaded for release builds.
5
+ * The `.../babel` plugin replaces every reference to this binding with the resolved version literal, then
6
+ * drops the import. Without that plugin it stays an empty string, which is harmless because sourcemaps
7
+ * are only uploaded for release builds.
9
8
  *
10
- * This module is runtime-safe: it has no Node imports, so it is safe to import into
11
- * app code that Metro bundles (unlike the package root, which pulls in the uploader).
9
+ * No Node imports, unlike the package root, so this is safe to pull into Metro-bundled app code.
12
10
  */
13
11
  declare const flareSourcemapVersion: string;
14
12
  //#endregion
@@ -1,14 +1,12 @@
1
1
  //#region src/runtime.d.ts
2
2
  /**
3
- * The build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
3
+ * Build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
4
4
  *
5
- * `@flareapp/react-native-sourcemaps/babel` replaces every reference to this
6
- * binding with the resolved version string literal at bundle time, then drops the
7
- * import. Without that Babel plugin it stays an empty string (meaning "no version"),
8
- * which is harmless because sourcemaps are only uploaded for release builds.
5
+ * The `.../babel` plugin replaces every reference to this binding with the resolved version literal, then
6
+ * drops the import. Without that plugin it stays an empty string, which is harmless because sourcemaps
7
+ * are only uploaded for release builds.
9
8
  *
10
- * This module is runtime-safe: it has no Node imports, so it is safe to import into
11
- * app code that Metro bundles (unlike the package root, which pulls in the uploader).
9
+ * No Node imports, unlike the package root, so this is safe to pull into Metro-bundled app code.
12
10
  */
13
11
  declare const flareSourcemapVersion: string;
14
12
  //#endregion
package/dist/runtime.mjs CHANGED
@@ -1,14 +1,12 @@
1
1
  //#region src/runtime.ts
2
2
  /**
3
- * The build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
3
+ * Build-time sourcemap version, for `flare.configure({ sourcemapVersionId })`.
4
4
  *
5
- * `@flareapp/react-native-sourcemaps/babel` replaces every reference to this
6
- * binding with the resolved version string literal at bundle time, then drops the
7
- * import. Without that Babel plugin it stays an empty string (meaning "no version"),
8
- * which is harmless because sourcemaps are only uploaded for release builds.
5
+ * The `.../babel` plugin replaces every reference to this binding with the resolved version literal, then
6
+ * drops the import. Without that plugin it stays an empty string, which is harmless because sourcemaps
7
+ * are only uploaded for release builds.
9
8
  *
10
- * This module is runtime-safe: it has no Node imports, so it is safe to import into
11
- * app code that Metro bundles (unlike the package root, which pulls in the uploader).
9
+ * No Node imports, unlike the package root, so this is safe to pull into Metro-bundled app code.
12
10
  */
13
11
  const flareSourcemapVersion = "";
14
12
 
@@ -1,4 +1,4 @@
1
- import { n as resolveVersion, r as LOG_PREFIX } from "./version-DnFqflPl.mjs";
1
+ import { n as resolveVersion, r as LOG_PREFIX } from "./version-DizeDGRU.mjs";
2
2
  import { readFileSync } from "node:fs";
3
3
  import { basename } from "node:path";
4
4
  import { deflateRawSync } from "node:zlib";
@@ -16,6 +16,14 @@ const RETRIABLE_STATUS_CODES = new Set([
16
16
  503,
17
17
  504
18
18
  ]);
19
+ function describeNetworkError(error) {
20
+ if (!(error instanceof Error)) return String(error);
21
+ const cause = error.cause;
22
+ if (!(cause instanceof Error)) return error.message;
23
+ const code = cause.code;
24
+ const detail = typeof code === "string" ? `${code}: ${cause.message}` : cause.message;
25
+ return detail ? `${error.message} (${detail})` : error.message;
26
+ }
19
27
  var FlareApi = class {
20
28
  constructor(endpoint, key, version) {
21
29
  this.endpoint = endpoint;
@@ -47,10 +55,7 @@ var FlareApi = class {
47
55
  if (attempt === maxRetries) throw new FlareApiError(`Flare API returned ${response.status} after ${maxRetries} attempts`);
48
56
  } catch (error) {
49
57
  if (error instanceof FlareApiError) throw error;
50
- if (attempt === maxRetries) {
51
- const message = error instanceof Error ? error.message : String(error);
52
- throw new Error(`Network error after ${maxRetries} attempts: ${message}`, { cause: error });
53
- }
58
+ if (attempt === maxRetries) throw new Error(`Network error after ${maxRetries} attempts: ${describeNetworkError(error)}`, { cause: error });
54
59
  }
55
60
  await this.delay(Math.pow(2, attempt - 1) * 1e3);
56
61
  }
@@ -1,4 +1,4 @@
1
- const require_version = require('./version-Z9pawNvw.cjs');
1
+ const require_version = require('./version-DS96fXWD.cjs');
2
2
  let node_fs = require("node:fs");
3
3
  let node_path = require("node:path");
4
4
  let node_zlib = require("node:zlib");
@@ -16,6 +16,14 @@ const RETRIABLE_STATUS_CODES = new Set([
16
16
  503,
17
17
  504
18
18
  ]);
19
+ function describeNetworkError(error) {
20
+ if (!(error instanceof Error)) return String(error);
21
+ const cause = error.cause;
22
+ if (!(cause instanceof Error)) return error.message;
23
+ const code = cause.code;
24
+ const detail = typeof code === "string" ? `${code}: ${cause.message}` : cause.message;
25
+ return detail ? `${error.message} (${detail})` : error.message;
26
+ }
19
27
  var FlareApi = class {
20
28
  constructor(endpoint, key, version) {
21
29
  this.endpoint = endpoint;
@@ -47,10 +55,7 @@ var FlareApi = class {
47
55
  if (attempt === maxRetries) throw new FlareApiError(`Flare API returned ${response.status} after ${maxRetries} attempts`);
48
56
  } catch (error) {
49
57
  if (error instanceof FlareApiError) throw error;
50
- if (attempt === maxRetries) {
51
- const message = error instanceof Error ? error.message : String(error);
52
- throw new Error(`Network error after ${maxRetries} attempts: ${message}`, { cause: error });
53
- }
58
+ if (attempt === maxRetries) throw new Error(`Network error after ${maxRetries} attempts: ${describeNetworkError(error)}`, { cause: error });
54
59
  }
55
60
  await this.delay(Math.pow(2, attempt - 1) * 1e3);
56
61
  }
@@ -7,10 +7,9 @@ const LOG_PREFIX = "@flareapp/react-native-sourcemaps";
7
7
  //#endregion
8
8
  //#region src/version.ts
9
9
  /**
10
- * Resolve the sourcemap version shared by the Babel plugin and the CLI.
11
- * Precedence: explicit `version` > `FLARE_SOURCEMAP_VERSION` env > package.json
12
- * `version` (with a warning). Never a random value a random default would
13
- * silently desync the inlined runtime value from the uploaded `version_id`.
10
+ * Resolve the sourcemap version shared by the Babel plugin and the CLI. Precedence: explicit
11
+ * `version` > `FLARE_SOURCEMAP_VERSION` env > package.json `version` (with a warning). Never random: a
12
+ * random default would silently put the inlined runtime value out of sync with the uploaded `version_id`.
14
13
  */
15
14
  function resolveVersion({ version, cwd = process.cwd() } = {}) {
16
15
  if (version) return version;
@@ -24,13 +23,12 @@ function resolveVersion({ version, cwd = process.cwd() } = {}) {
24
23
  throw new Error(`${LOG_PREFIX}: Could not resolve a sourcemap version. Pass --version, set FLARE_SOURCEMAP_VERSION, or ensure package.json has a "version".`);
25
24
  }
26
25
  /**
27
- * Version resolution for the AUTOMATIC native upload path. Unlike resolveVersion it
28
- * NEVER falls back to package.json: the hook runs in android/ or ios/, a different
29
- * cwd than Metro, so a package.json fallback would read a different (or missing)
30
- * file and silently desync from the version the Babel plugin inlined. The only
31
- * input guaranteed identical to both halves is FLARE_SOURCEMAP_VERSION. Returns
32
- * null when unresolved so the caller can skip-with-banner rather than upload a
33
- * guaranteed-mismatched map.
26
+ * Version resolution for the automatic native upload path. Unlike resolveVersion, never falls back to
27
+ * package.json: the hook runs in android/ or ios/ (a different cwd than Metro), so a package.json
28
+ * fallback would read a different or missing file and end up out of sync with the version the Babel
29
+ * plugin inlined. FLARE_SOURCEMAP_VERSION is the only input both halves are guaranteed to see the same
30
+ * way. Returns null
31
+ * when unresolved so the caller can skip-with-banner rather than upload a mismatched map.
34
32
  */
35
33
  function resolveAutoVersion(version) {
36
34
  if (version) return version;
@@ -7,10 +7,9 @@ const LOG_PREFIX = "@flareapp/react-native-sourcemaps";
7
7
  //#endregion
8
8
  //#region src/version.ts
9
9
  /**
10
- * Resolve the sourcemap version shared by the Babel plugin and the CLI.
11
- * Precedence: explicit `version` > `FLARE_SOURCEMAP_VERSION` env > package.json
12
- * `version` (with a warning). Never a random value a random default would
13
- * silently desync the inlined runtime value from the uploaded `version_id`.
10
+ * Resolve the sourcemap version shared by the Babel plugin and the CLI. Precedence: explicit
11
+ * `version` > `FLARE_SOURCEMAP_VERSION` env > package.json `version` (with a warning). Never random: a
12
+ * random default would silently put the inlined runtime value out of sync with the uploaded `version_id`.
14
13
  */
15
14
  function resolveVersion({ version, cwd = process.cwd() } = {}) {
16
15
  if (version) return version;
@@ -24,13 +23,12 @@ function resolveVersion({ version, cwd = process.cwd() } = {}) {
24
23
  throw new Error(`${LOG_PREFIX}: Could not resolve a sourcemap version. Pass --version, set FLARE_SOURCEMAP_VERSION, or ensure package.json has a "version".`);
25
24
  }
26
25
  /**
27
- * Version resolution for the AUTOMATIC native upload path. Unlike resolveVersion it
28
- * NEVER falls back to package.json: the hook runs in android/ or ios/, a different
29
- * cwd than Metro, so a package.json fallback would read a different (or missing)
30
- * file and silently desync from the version the Babel plugin inlined. The only
31
- * input guaranteed identical to both halves is FLARE_SOURCEMAP_VERSION. Returns
32
- * null when unresolved so the caller can skip-with-banner rather than upload a
33
- * guaranteed-mismatched map.
26
+ * Version resolution for the automatic native upload path. Unlike resolveVersion, never falls back to
27
+ * package.json: the hook runs in android/ or ios/ (a different cwd than Metro), so a package.json
28
+ * fallback would read a different or missing file and end up out of sync with the version the Babel
29
+ * plugin inlined. FLARE_SOURCEMAP_VERSION is the only input both halves are guaranteed to see the same
30
+ * way. Returns null
31
+ * when unresolved so the caller can skip-with-banner rather than upload a mismatched map.
34
32
  */
35
33
  function resolveAutoVersion(version) {
36
34
  if (version) return version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareapp/react-native-sourcemaps",
3
- "version": "2.7.0",
3
+ "version": "2.9.0",
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",
@@ -13,6 +13,9 @@
13
13
  "name": "Spatie",
14
14
  "email": "info@spatie.be"
15
15
  },
16
+ "contributors": [
17
+ "Dries Heyninck <dries@spatie.be>"
18
+ ],
16
19
  "files": [
17
20
  "dist",
18
21
  "flare.gradle",