peachsim 0.1.755 → 0.1.757

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 (77) hide show
  1. package/cli/app-config.ts +4 -29
  2. package/cli/commands/telemetry.ts +5 -2
  3. package/cli/privacy.ts +10 -2
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/agent-identity.cjs +1 -1
  7. package/dist-lib/agent-sessions.cjs +1 -1
  8. package/dist-lib/attached-projects.cjs +1 -1
  9. package/dist-lib/auth/shared-session.cjs +1 -1
  10. package/dist-lib/backend-origin.cjs +1 -1
  11. package/dist-lib/beta.cjs +1 -1
  12. package/dist-lib/beta.mjs +1 -1
  13. package/dist-lib/bridge-constants.cjs +1 -1
  14. package/dist-lib/bridge-contract-input.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.mjs +1 -1
  16. package/dist-lib/bridge-contract.cjs +1 -1
  17. package/dist-lib/bridge-contract.mjs +1 -1
  18. package/dist-lib/capture-contract.cjs +1 -1
  19. package/dist-lib/capture-contract.mjs +1 -1
  20. package/dist-lib/cli-constants.cjs +1 -1
  21. package/dist-lib/cloud-contract.cjs +1 -1
  22. package/dist-lib/cloud-contract.mjs +1 -1
  23. package/dist-lib/cloud-test-args.cjs +1 -1
  24. package/dist-lib/cloud-test-args.mjs +1 -1
  25. package/dist-lib/cloud.cjs +1 -1
  26. package/dist-lib/cloud.mjs +1 -1
  27. package/dist-lib/config.cjs +88 -1
  28. package/dist-lib/detox/index.cjs +1 -1
  29. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  30. package/dist-lib/home-paths.cjs +1 -1
  31. package/dist-lib/host/bridge-host.cjs +47 -36
  32. package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  34. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  35. package/dist-lib/host/replacement-module-handler.cjs +13 -5
  36. package/dist-lib/host/websocket-proxy.cjs +1 -1
  37. package/dist-lib/index.cjs +2551 -2220
  38. package/dist-lib/jump-to-source-babel.cjs +1 -1
  39. package/dist-lib/jump-to-source-native.cjs +1 -1
  40. package/dist-lib/kotlin-host.cjs +1 -1
  41. package/dist-lib/menu.cjs +1 -1
  42. package/dist-lib/menu.mjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  44. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  45. package/dist-lib/metro-production-bundle.cjs +1 -1
  46. package/dist-lib/metro-production-bundle.mjs +1 -1
  47. package/dist-lib/metro.cjs +914 -584
  48. package/dist-lib/native-app-identity.cjs +1 -1
  49. package/dist-lib/native-app-identity.mjs +1 -1
  50. package/dist-lib/native-firebase-metadata.cjs +1 -1
  51. package/dist-lib/native-firebase-metadata.mjs +1 -1
  52. package/dist-lib/plist.cjs +1 -1
  53. package/dist-lib/plist.mjs +1 -1
  54. package/dist-lib/profiles.cjs +1 -1
  55. package/dist-lib/public-brand.cjs +1 -1
  56. package/dist-lib/react-native-host-modules.cjs +1 -1
  57. package/dist-lib/react-native-host-modules.mjs +1 -1
  58. package/dist-lib/render-mode.cjs +1 -1
  59. package/dist-lib/scripts/dev-server-scanner.cjs +4 -4
  60. package/dist-lib/sdk.cjs +1 -1
  61. package/dist-lib/sdk.mjs +1 -1
  62. package/dist-lib/skills.cjs +104 -69
  63. package/dist-lib/swift-compile.cjs +1 -1
  64. package/dist-lib/swift-compile.mjs +1 -1
  65. package/dist-lib/swift-package.cjs +1 -1
  66. package/dist-lib/swift-package.mjs +1 -1
  67. package/dist-lib/swift-submit.cjs +1 -1
  68. package/dist-lib/swift-submit.mjs +1 -1
  69. package/dist-lib/swift-toolchain.cjs +1 -1
  70. package/dist-lib/swift.cjs +1 -1
  71. package/dist-lib/vite-swift.cjs +1 -1
  72. package/dist-lib/vite.cjs +10 -4
  73. package/package.json +1 -1
  74. package/src/config.ts +92 -0
  75. package/src/configured-bundle-producer.ts +110 -0
  76. package/src/host/replacement-module-handler.ts +8 -2
  77. package/src/metro-plugin.ts +27 -0
package/cli/app-config.ts CHANGED
@@ -1,40 +1,12 @@
1
1
  import { createRequire } from 'node:module'
2
2
  import path from 'node:path'
3
- import { isValidRuntimeVersion } from '@contrast/runtime-delivery'
4
3
  import { createJiti } from 'jiti'
4
+ import { isPeachConfig, type PeachConfig } from '../src/config'
5
5
  import { rnxPublicBrand } from '../src/public-brand'
6
6
  import { resolveAppProject, type ResolvedAppProject } from './app-project'
7
- import type { PeachConfig } from '../src/config'
8
7
 
9
8
  const require = createRequire(import.meta.url)
10
9
 
11
- function isOptionalRecord(value: unknown): boolean {
12
- return (
13
- value === undefined ||
14
- (value !== null && typeof value === 'object' && !Array.isArray(value))
15
- )
16
- }
17
-
18
- function isPeachConfig(value: unknown): value is PeachConfig {
19
- if (!value || typeof value !== 'object' || Array.isArray(value)) return false
20
- const runtimeVersion = Reflect.get(value, 'runtimeVersion')
21
- const network = Reflect.get(value, 'network')
22
- return (
23
- (runtimeVersion === undefined ||
24
- (typeof runtimeVersion === 'string' &&
25
- runtimeVersion === runtimeVersion.trim() &&
26
- isValidRuntimeVersion(runtimeVersion))) &&
27
- isOptionalRecord(Reflect.get(value, 'modules')) &&
28
- isOptionalRecord(Reflect.get(value, 'turboModules')) &&
29
- isOptionalRecord(Reflect.get(value, 'nativeModules')) &&
30
- isOptionalRecord(Reflect.get(value, 'nativeViews')) &&
31
- isOptionalRecord(Reflect.get(value, 'env')) &&
32
- isOptionalRecord(network) &&
33
- isOptionalRecord(Reflect.get(value, 'settings')) &&
34
- isOptionalRecord(Reflect.get(value, 'initialState'))
35
- )
36
- }
37
-
38
10
  // `{ file }` entries are relative to the config file; the engine loads them by
39
11
  // absolute path from the runtime's replacement-module endpoint.
40
12
  function resolveFileEntries<T>(
@@ -76,6 +48,9 @@ export async function loadRNXAppConfig(
76
48
  try {
77
49
  const jiti = createJiti(import.meta.url, {
78
50
  interopDefault: true,
51
+ // metro serializes repeatedly in one process; edits must reload the config.
52
+ moduleCache: false,
53
+ tryNative: false,
79
54
  alias: {
80
55
  [`${rnxPublicBrand.packageName}/config`]: require.resolve(
81
56
  `${rnxPublicBrand.packageName}/config`,
@@ -10,7 +10,7 @@ import {
10
10
  readPrivacyPreferences,
11
11
  writePrivacyPreferences,
12
12
  } from '../../src/home-paths'
13
- import { PRIVACY_NOTICE } from '../privacy'
13
+ import { PRIVACY_CONTENTS } from '../privacy'
14
14
  import { rnxExit } from '../run-rnx'
15
15
 
16
16
  function printStatus(): void {
@@ -18,7 +18,10 @@ function printStatus(): void {
18
18
  console.log(
19
19
  ` bounded diagnostics are ${preferences.productAnalytics ? 'ON' : 'OFF'}, automatic crash reports are ${preferences.crashReports ? 'ON' : 'OFF'}`,
20
20
  )
21
- for (const line of PRIVACY_NOTICE) console.log(` ${line}`)
21
+ for (const line of PRIVACY_CONTENTS) console.log(` ${line}`)
22
+ console.log(
23
+ ' change with `peach config telemetry on|off`; DO_NOT_TRACK=1 turns both off for one run',
24
+ )
22
25
  console.log(` config: ${configFilePath()}`)
23
26
  const doNotTrack = process.env.DO_NOT_TRACK
24
27
  if (doNotTrack === '1' || doNotTrack === 'true') {
package/cli/privacy.ts CHANGED
@@ -34,9 +34,17 @@ export function crashReportsAllowedForCurrentProcess(
34
34
  return !doNotTrack() && preferences.crashReports
35
35
  }
36
36
 
37
- export const PRIVACY_NOTICE = [
38
- 'Anonymous diagnostics and crash reports are on: CLI/runtime versions, OS/arch, command name and exit code, a random install ID, package incompatibilities, and error class with the first line of the message (300 characters, paths redacted).',
37
+ // what is sent, without claiming whether it is on: `peach config telemetry
38
+ // status` prints this under the stored state, which may be off.
39
+ export const PRIVACY_CONTENTS = [
40
+ 'Anonymous diagnostics and crash reports send CLI/runtime versions, OS/arch, command name and exit code, a random install ID, package incompatibilities, and error class with the first line of the message (300 characters, paths redacted).',
39
41
  'They never include arguments, stacks, source, environment, or app data.',
42
+ ]
43
+
44
+ // shown before the choice is recorded, when both are on by default.
45
+ export const PRIVACY_NOTICE = [
46
+ 'Anonymous diagnostics and crash reports are on.',
47
+ ...PRIVACY_CONTENTS,
40
48
  'Turn them off with `peach config telemetry off`, or DO_NOT_TRACK=1 for one run.',
41
49
  ]
42
50
 
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
package/dist-lib/beta.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/beta.ts
4
4
  var IS_BETA = true;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var SIM_LONG_PRESS_MAX_MS = 5e3;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/bridge-contract.ts
4
4
  var REFUSED_PERFORM_STEP_TYPES = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/capture-contract.ts
4
4
  var RNX_SCREEN_CAPTURE_VERSION = 1;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-contract.ts
4
4
  var RNX_CLOUD_MAX_ARTIFACT_BYTES = 20 * 1024 * 1024;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/cloud-test-args.ts
4
4
  var CLOUD_TEST_ARGS_MAX_COUNT = 32;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -22,15 +22,95 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
22
22
  // src/config.ts
23
23
  var config_exports = {};
24
24
  __export(config_exports, {
25
+ PEACH_CONFIGURED_FILES_HOOK: () => PEACH_CONFIGURED_FILES_HOOK,
25
26
  PEACH_CONFIG_QUERY_PARAM: () => PEACH_CONFIG_QUERY_PARAM,
26
27
  applyPeachConfigToUrl: () => applyPeachConfigToUrl,
28
+ collectConfiguredFileModules: () => collectConfiguredFileModules,
29
+ createPeachBundleConfigFooter: () => createPeachBundleConfigFooter,
27
30
  defineConfig: () => defineConfig,
31
+ detachPeachBundleConfigFooter: () => detachPeachBundleConfigFooter,
28
32
  hasPeachConfig: () => hasPeachConfig,
33
+ isPeachConfig: () => isPeachConfig,
29
34
  mergePeachConfig: () => mergePeachConfig,
35
+ readPeachBundleConfig: () => readPeachBundleConfig,
36
+ readPeachBundleConfigFooter: () => readPeachBundleConfigFooter,
30
37
  readPeachConfigFromSearchParams: () => readPeachConfigFromSearchParams
31
38
  });
32
39
  module.exports = __toCommonJS(config_exports);
40
+
41
+ // ../contrast-runtime-delivery/src/version.ts
42
+ function isValidRuntimeVersion(value) {
43
+ return value.length <= 100 && /^[0-9A-Za-z][0-9A-Za-z._+-]*$/.test(value);
44
+ }
45
+
46
+ // src/is-record.ts
47
+ function isRecord(value) {
48
+ return typeof value === "object" && value !== null && !Array.isArray(value);
49
+ }
50
+
51
+ // src/config.ts
33
52
  var PEACH_CONFIG_QUERY_PARAM = "peachConfig";
53
+ function collectConfiguredFileModules(config) {
54
+ return [
55
+ ...new Set(
56
+ ["modules", "turboModules", "nativeModules", "nativeViews"].flatMap((key) => {
57
+ const entries = config && Reflect.get(config, key);
58
+ if (!isRecord(entries)) return [];
59
+ return Object.values(entries).flatMap(
60
+ (entry) => isRecord(entry) && typeof entry.file === "string" ? [entry.file] : []
61
+ );
62
+ })
63
+ )
64
+ ];
65
+ }
66
+ function isPeachConfig(value) {
67
+ if (!isRecord(value)) return false;
68
+ return (value.runtimeVersion === void 0 || typeof value.runtimeVersion === "string" && value.runtimeVersion === value.runtimeVersion.trim() && isValidRuntimeVersion(value.runtimeVersion)) && [
69
+ "modules",
70
+ "turboModules",
71
+ "nativeModules",
72
+ "nativeViews",
73
+ "env",
74
+ "network",
75
+ "settings",
76
+ "initialState"
77
+ ].every((key) => value[key] === void 0 || isRecord(value[key]));
78
+ }
79
+ var BUNDLE_CONFIG_PREFIX = "globalThis.__peachBundleConfig=";
80
+ var PEACH_CONFIGURED_FILES_HOOK = "__peachInstallConfiguredFiles";
81
+ function readPeachBundleConfig(value) {
82
+ if (value === void 0 || value === null) return null;
83
+ if (!isRecord(value) || !isPeachConfig(value.config) || !Array.isArray(value.runtimePackages) || !value.runtimePackages.every((name) => typeof name === "string")) {
84
+ throw new Error("configured bundle metadata is malformed");
85
+ }
86
+ return { config: value.config, runtimePackages: [...value.runtimePackages] };
87
+ }
88
+ function readPeachBundleConfigFooter(source) {
89
+ const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
90
+ if (start < 0) return null;
91
+ const end = source.indexOf("\n", start + 1);
92
+ const line = source.slice(start + 1, end < 0 ? void 0 : end);
93
+ if (!line.endsWith(";")) throw new Error("configured bundle footer is truncated");
94
+ const result = readPeachBundleConfig(
95
+ JSON.parse(line.slice(BUNDLE_CONFIG_PREFIX.length, -1))
96
+ );
97
+ if (!result) throw new Error("configured bundle footer is empty");
98
+ return result;
99
+ }
100
+ function createPeachBundleConfigFooter(config) {
101
+ const json = JSON.stringify(config).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/<\//g, "<\\/");
102
+ return "\n" + BUNDLE_CONFIG_PREFIX + json + ";";
103
+ }
104
+ function detachPeachBundleConfigFooter(source) {
105
+ const configuredBundle = readPeachBundleConfigFooter(source);
106
+ if (!configuredBundle) return { source, configuredBundle };
107
+ const start = source.lastIndexOf("\n" + BUNDLE_CONFIG_PREFIX);
108
+ const end = source.indexOf("\n", start + 1);
109
+ return {
110
+ source: source.slice(0, start) + source.slice(end < 0 ? source.length : end),
111
+ configuredBundle
112
+ };
113
+ }
34
114
  function defineConfig(config) {
35
115
  return config;
36
116
  }
@@ -88,10 +168,17 @@ function applyPeachConfigToUrl(url, config) {
88
168
  }
89
169
  // Annotate the CommonJS export names for ESM import in node:
90
170
  0 && (module.exports = {
171
+ PEACH_CONFIGURED_FILES_HOOK,
91
172
  PEACH_CONFIG_QUERY_PARAM,
92
173
  applyPeachConfigToUrl,
174
+ collectConfiguredFileModules,
175
+ createPeachBundleConfigFooter,
93
176
  defineConfig,
177
+ detachPeachBundleConfigFooter,
94
178
  hasPeachConfig,
179
+ isPeachConfig,
95
180
  mergePeachConfig,
181
+ readPeachBundleConfig,
182
+ readPeachBundleConfigFooter,
96
183
  readPeachConfigFromSearchParams
97
184
  });
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.755 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.757 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;