sootsim 0.1.83 → 0.1.85
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/README.md +0 -1
- package/detox/colors.ts +54 -0
- package/detox/config-loader.ts +135 -0
- package/detox/element-types.ts +36 -0
- package/detox/expectations.ts +477 -0
- package/detox/gestures.ts +442 -0
- package/detox/index.ts +1403 -0
- package/detox/jest-environment.ts +86 -0
- package/detox/jest-preset.cjs +50 -0
- package/detox/matchers.ts +29 -0
- package/detox/navigation.ts +43 -0
- package/detox/run-test.ts +113 -0
- package/detox/screenshots/animated-color-test-rest-norngh.png +0 -0
- package/detox/screenshots/color-test-after-drag-norngh.png +0 -0
- package/detox/screenshots/color-test-rest-norngh.png +0 -0
- package/detox/screenshots/theme-blue-toggle.png +0 -0
- package/detox/screenshots/theme-blue.png +0 -0
- package/detox/screenshots/theme-red-toggle.png +0 -0
- package/detox/screenshots/theme-red.png +0 -0
- package/dist-cli/bin.js +3 -3
- package/dist-cli/chunks/{agent-MQ7GLVIB.js → agent-T3DUH5YJ.js} +2 -2
- package/dist-cli/chunks/{agent-wrapper-7KAFDQCN.js → agent-wrapper-NSBF4THI.js} +2 -2
- package/dist-cli/chunks/{assert-TV46GUNU.js → assert-X3F7TRCZ.js} +2 -2
- package/dist-cli/chunks/auto-bootstrap-47RN2V5G.js +2 -0
- package/dist-cli/chunks/beta-BRCGAF2N.js +2 -0
- package/dist-cli/chunks/chunk-36RPD6JI.js +2 -0
- package/dist-cli/chunks/{chunk-PM5NVKLP.js → chunk-3WGHC7JN.js} +2 -2
- package/dist-cli/chunks/chunk-4DBPNLGI.js +1 -0
- package/dist-cli/chunks/{chunk-J2GYISVJ.js → chunk-4EVSIUNB.js} +2 -2
- package/dist-cli/chunks/{chunk-JHJNODXN.js → chunk-4QZHZ6BC.js} +2 -2
- package/dist-cli/chunks/{chunk-F3HP444U.js → chunk-5DIGWOY7.js} +1 -1
- package/dist-cli/chunks/{chunk-DP7O5MHK.js → chunk-5N3V7OCG.js} +2 -2
- package/dist-cli/chunks/{chunk-Y4BUVURT.js → chunk-5S6D7K4L.js} +2 -2
- package/dist-cli/chunks/{chunk-ECJBV65H.js → chunk-7LKUN46F.js} +2 -2
- package/dist-cli/chunks/{chunk-WTKTOL3C.js → chunk-AC6QGW22.js} +2 -2
- package/dist-cli/chunks/{chunk-IBNRRAES.js → chunk-AFNDVS4E.js} +2 -2
- package/dist-cli/chunks/{chunk-6TNANCQC.js → chunk-BESAZ2HA.js} +2 -2
- package/dist-cli/chunks/{chunk-WN7M3QON.js → chunk-BHZJ6RIH.js} +2 -2
- package/dist-cli/chunks/{chunk-277XAALA.js → chunk-BZL6D4TV.js} +3 -3
- package/dist-cli/chunks/{chunk-CYV6Y6YV.js → chunk-CF2LPRXD.js} +2 -2
- package/dist-cli/chunks/chunk-DWTLRPEN.js +79 -0
- package/dist-cli/chunks/{chunk-CJY3AVI7.js → chunk-E2QE5FFP.js} +1 -1
- package/dist-cli/chunks/chunk-EBEL6TTJ.js +4 -0
- package/dist-cli/chunks/{chunk-DM6WT7QM.js → chunk-EFM53PZ5.js} +1 -1
- package/dist-cli/chunks/{chunk-YUELRHGB.js → chunk-EKXK3SWK.js} +2 -2
- package/dist-cli/chunks/{chunk-4LS5MZAI.js → chunk-G7CIZ5S3.js} +3 -3
- package/dist-cli/chunks/{chunk-6NN2D4EJ.js → chunk-GTAD6IUV.js} +1 -1
- package/dist-cli/chunks/{chunk-OYMFNU3M.js → chunk-H44IQHKZ.js} +1 -1
- package/dist-cli/chunks/{chunk-IP3QJLRH.js → chunk-HQDJ5BOF.js} +1 -1
- package/dist-cli/chunks/{chunk-5DJXZIFZ.js → chunk-KUSQ4NNJ.js} +1 -1
- package/dist-cli/chunks/{chunk-HAWOAQAG.js → chunk-MAO7F5PH.js} +3 -3
- package/dist-cli/chunks/{chunk-572VSFNP.js → chunk-NVTL3JQG.js} +1 -1
- package/dist-cli/chunks/{chunk-6XZOEBTZ.js → chunk-O6N2CEET.js} +2 -2
- package/dist-cli/chunks/{chunk-HNWEELAE.js → chunk-OISHLFON.js} +1 -1
- package/dist-cli/chunks/{chunk-2PY3UZVO.js → chunk-OUNLJM56.js} +2 -2
- package/dist-cli/chunks/chunk-OXOARRKR.js +67 -0
- package/dist-cli/chunks/{chunk-NXATOWWF.js → chunk-PHPXGLME.js} +1 -1
- package/dist-cli/chunks/{chunk-JQ7ZXOXJ.js → chunk-PQFFUJR6.js} +2 -2
- package/dist-cli/chunks/{chunk-KASUZ5XV.js → chunk-QLJNSOS7.js} +1 -1
- package/dist-cli/chunks/chunk-QQAECG5B.js +2 -0
- package/dist-cli/chunks/{chunk-FJYT7XL2.js → chunk-RZHREO3M.js} +2 -2
- package/dist-cli/chunks/{chunk-FRM355UL.js → chunk-SBGOUA6F.js} +2 -2
- package/dist-cli/chunks/chunk-SSCA2AEA.js +1 -0
- package/dist-cli/chunks/{chunk-Y2VJBRSP.js → chunk-UYRGCJ4N.js} +1 -1
- package/dist-cli/chunks/{chunk-2AWQ7OB2.js → chunk-WGDL5V6C.js} +1 -1
- package/dist-cli/chunks/{chunk-VMXWC2JO.js → chunk-Y5PLPEEU.js} +2 -2
- package/dist-cli/chunks/chunk-ZFAM4N5B.js +1 -0
- package/dist-cli/chunks/{chunk-RH4F2TF7.js → chunk-ZO3VHP6W.js} +1 -1
- package/dist-cli/chunks/cli-version-WPFDM2A6.js +2 -0
- package/dist-cli/chunks/{compat-QLLWBTS3.js → compat-PCXGGZBZ.js} +3 -3
- package/dist-cli/chunks/{config-2DSLDCXV.js → config-LULEVEYL.js} +2 -2
- package/dist-cli/chunks/control-6P6HY7UF.js +2 -0
- package/dist-cli/chunks/{cpu-profile-GEIKHCPC.js → cpu-profile-NOK73ZYW.js} +2 -2
- package/dist-cli/chunks/{daemon-4EBUFN4D.js → daemon-4A3DMUYL.js} +2 -2
- package/dist-cli/chunks/{debug-WGD6XWOF.js → debug-74BWB2ZG.js} +3 -3
- package/dist-cli/chunks/{detox-LNKGRZU6.js → detox-HEOMINSC.js} +2 -2
- package/dist-cli/chunks/{device-AYKXKVIQ.js → device-TTXXBJFZ.js} +2 -2
- package/dist-cli/chunks/{diagnose-TMXSDOOC.js → diagnose-QZ3GOHSE.js} +2 -2
- package/dist-cli/chunks/drivers-QRPWNOIT.js +2 -0
- package/dist-cli/chunks/{electron-QFPF7TBY.js → electron-QVOWV44R.js} +3 -3
- package/dist-cli/chunks/flow-QMA7GVN6.js +2 -0
- package/dist-cli/chunks/{hints-MXKRR4TG.js → hints-YKWRNMJC.js} +2 -2
- package/dist-cli/chunks/{home-paths-REMWQDAO.js → home-paths-SFADSTJM.js} +2 -2
- package/dist-cli/chunks/{inspect-XGSQNFV7.js → inspect-LEWGQCIU.js} +3 -3
- package/dist-cli/chunks/install-7N2N7Q32.js +2 -0
- package/dist-cli/chunks/{install-desktop-NQG3RZSA.js → install-desktop-22HYQZ2G.js} +3 -3
- package/dist-cli/chunks/{keys-5QZWXL3F.js → keys-3ZT3MICU.js} +2 -2
- package/dist-cli/chunks/{launch-SBXOZWKO.js → launch-ZXW2NFLG.js} +3 -3
- package/dist-cli/chunks/{login-EACQXE24.js → login-NJKJ7GZO.js} +4 -4
- package/dist-cli/chunks/{logout-IBQLMUML.js → logout-VMMQL7CB.js} +2 -2
- package/dist-cli/chunks/{maestro-LFYXUX7O.js → maestro-OJY4MTI7.js} +2 -2
- package/dist-cli/chunks/{preview-U4SBOEGQ.js → preview-QU2GXTEV.js} +2 -2
- package/dist-cli/chunks/{profile-GWS5ECMY.js → profile-7APWK47T.js} +2 -2
- package/dist-cli/chunks/{react-QDHLMVYL.js → react-RSVO5JZZ.js} +2 -2
- package/dist-cli/chunks/{record-BUEUWPDI.js → record-UWH4MDEO.js} +2 -2
- package/dist-cli/chunks/runtime-3FUENRHM.js +2 -0
- package/dist-cli/chunks/{runtime-delivery-G7L6RVZ7.js → runtime-delivery-QMKGRV7N.js} +2 -2
- package/dist-cli/chunks/{screenshot-T2HBA3VI.js → screenshot-43M27ALE.js} +2 -2
- package/dist-cli/chunks/{screenshot-mode-EG5HMIH3.js → screenshot-mode-EBYYN6TY.js} +2 -2
- package/dist-cli/chunks/{screenshots-S52AFHTV.js → screenshots-7TQZL6Z6.js} +2 -2
- package/dist-cli/chunks/{server-MFFVYUGG.js → server-VCFM25Z6.js} +2 -2
- package/dist-cli/chunks/setup-repo-HFH4VKJQ.js +2 -0
- package/dist-cli/chunks/{skills-HQGWBS2O.js → skills-RQA6EJQL.js} +2 -2
- package/dist-cli/chunks/{start-E3DRYY7W.js → start-ZT6MBYND.js} +4 -4
- package/dist-cli/chunks/store-BJBTDSZE.js +2 -0
- package/dist-cli/chunks/telemetry-ZZZKTILZ.js +2 -0
- package/dist-cli/chunks/{test-ZY3EF62K.js → test-RNRX5SWV.js} +3 -3
- package/dist-cli/chunks/{three-mode-WSPKQCJ5.js → three-mode-TQZH25ZO.js} +2 -2
- package/dist-cli/chunks/{timeline-3XAB5EWZ.js → timeline-GGN3AY6P.js} +2 -2
- package/dist-cli/chunks/{upgrade-WNENPFM5.js → upgrade-XT22D67C.js} +2 -2
- package/dist-cli/chunks/upload-NC2AYLC5.js +2 -0
- package/dist-cli/chunks/{web-D2AOZY44.js → web-KEHVF5MB.js} +2 -2
- package/dist-cli/chunks/{what-happened-F43KNSG6.js → what-happened-PATQRJ5T.js} +2 -2
- package/dist-cli/chunks/{whoami-T22VBR7C.js → whoami-CXVY26VV.js} +2 -2
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/agent-sessions.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +44 -0
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/cli-constants.cjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/detox/index.cjs +1770 -0
- package/dist-lib/detox/jest-preset.cjs +50 -0
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +1 -1
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/index.cjs +136 -138
- package/dist-lib/metro.cjs +31 -26
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/render-mode.cjs +1 -1
- package/dist-lib/scripts/demo-app-registry.cjs +809 -0
- package/dist-lib/scripts/dev-server-scanner.cjs +1269 -0
- package/dist-lib/skills.cjs +17766 -0
- package/dist-lib/vite.cjs +129 -39
- package/package.json +39 -14
- package/scripts/demo-app-registry.ts +989 -0
- package/scripts/dev-server-scanner.ts +674 -0
- package/src/agent-daemon-client.ts +390 -0
- package/src/agent-events.ts +71 -0
- package/src/agent-prompt.ts +71 -0
- package/src/agent-sessions.ts +572 -0
- package/src/attached-projects.ts +536 -0
- package/src/auth/shared-session.ts +199 -0
- package/src/backend-origin.ts +49 -0
- package/src/beta.ts +21 -0
- package/src/bridge-constants.ts +10 -0
- package/src/cli-constants.ts +1 -0
- package/src/cli-version.ts +30 -0
- package/src/codex-client.ts +215 -0
- package/src/config.ts +110 -0
- package/src/dev-bundle-resolution.ts +180 -0
- package/src/home-paths.ts +382 -0
- package/src/host/agent-host.ts +576 -0
- package/src/host/bridge-host.ts +2293 -0
- package/src/host/fetch-proxy-handler.ts +288 -0
- package/src/host/fetch-proxy-overrides.ts +39 -0
- package/src/host/open-url.ts +234 -0
- package/src/index.ts +9 -0
- package/src/metro-plugin.ts +139 -0
- package/src/native-dev-bundle-url.ts +62 -0
- package/src/native-seam-manifest.ts +313 -0
- package/src/profiles.ts +179 -0
- package/src/render-mode.ts +27 -0
- package/src/runtime-assets.ts +84 -0
- package/src/runtime-delivery.ts +334 -0
- package/src/screenshots/compose.ts +422 -0
- package/src/screenshots/frame-compose.ts +438 -0
- package/src/screenshots/orchestrate.ts +244 -0
- package/src/screenshots/registry.ts +58 -0
- package/src/screenshots/schema.ts +364 -0
- package/src/skills/builtin/a11y-review.ts +126 -0
- package/src/skills/builtin/compat-check.ts +104 -0
- package/src/skills/builtin/perf-profile.ts +84 -0
- package/src/skills/builtin/screenshot-all.ts +46 -0
- package/src/skills/builtin/test-flow.ts +118 -0
- package/src/skills/builtin/visual-diff.ts +94 -0
- package/src/skills/registry.ts +107 -0
- package/src/skills/types.ts +41 -0
- package/src/vite-plugin-one.ts +189 -0
- package/src/vite-plugin.ts +1381 -0
- package/src/worklets-babel.ts +132 -0
- package/dist-cli/chunks/auto-bootstrap-FQS4ZD2K.js +0 -2
- package/dist-cli/chunks/beta-VG7CDY2U.js +0 -2
- package/dist-cli/chunks/chunk-2OIBDYHW.js +0 -1
- package/dist-cli/chunks/chunk-6BNLVMXA.js +0 -1
- package/dist-cli/chunks/chunk-6XD6CBJM.js +0 -2
- package/dist-cli/chunks/chunk-CHQTO426.js +0 -1
- package/dist-cli/chunks/chunk-FAPYGVIU.js +0 -4
- package/dist-cli/chunks/chunk-PEHFE3LG.js +0 -64
- package/dist-cli/chunks/chunk-RXH2SLKF.js +0 -2
- package/dist-cli/chunks/chunk-UXQWC5ZR.js +0 -79
- package/dist-cli/chunks/chunk-XFQL74PF.js +0 -5
- package/dist-cli/chunks/cli-version-PWF6I6LY.js +0 -2
- package/dist-cli/chunks/control-UIOXGYXU.js +0 -2
- package/dist-cli/chunks/demo-app-registry-G3BDOFWC.js +0 -2
- package/dist-cli/chunks/drivers-IDQF34HP.js +0 -2
- package/dist-cli/chunks/flow-3JN3Y7RF.js +0 -2
- package/dist-cli/chunks/install-2N3YOOSN.js +0 -2
- package/dist-cli/chunks/runtime-PVB4VGUH.js +0 -2
- package/dist-cli/chunks/setup-repo-YOF7NV5D.js +0 -2
- package/dist-cli/chunks/store-MAI6D3UO.js +0 -2
- package/dist-cli/chunks/telemetry-RCQKCJTH.js +0 -2
- package/dist-cli/chunks/upload-YLJ4RA73.js +0 -2
- package/dist-lib/vite-base.cjs +0 -6937
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// jest preset for running existing detox suites against sootsim.
|
|
2
|
+
//
|
|
3
|
+
// users drop `preset: 'sootsim/detox/jest-preset'` into their jest config
|
|
4
|
+
// (or `sootsim-detox.config.cjs`) and their `import { by, device, element,
|
|
5
|
+
// expect, waitFor } from 'detox'` calls resolve to the sootsim driver.
|
|
6
|
+
|
|
7
|
+
const path = require('path')
|
|
8
|
+
|
|
9
|
+
// resolve the published driver entry so the mapping works from any cwd.
|
|
10
|
+
// `require.resolve('sootsim/detox')` honours the subpath export in the
|
|
11
|
+
// sootsim package.json.
|
|
12
|
+
const DRIVER_ENTRY = require.resolve('sootsim/detox')
|
|
13
|
+
const PACKAGE_ROOT = path.dirname(require.resolve('sootsim/package.json'))
|
|
14
|
+
|
|
15
|
+
/** @type {import('@jest/types').Config.InitialOptions} */
|
|
16
|
+
module.exports = {
|
|
17
|
+
testTimeout: 180000,
|
|
18
|
+
maxWorkers: 1,
|
|
19
|
+
watchman: false,
|
|
20
|
+
forceExit: true,
|
|
21
|
+
verbose: true,
|
|
22
|
+
testEnvironment: 'node',
|
|
23
|
+
transform: {
|
|
24
|
+
'^.+\\.tsx?$': [
|
|
25
|
+
'ts-jest',
|
|
26
|
+
{
|
|
27
|
+
isolatedModules: true,
|
|
28
|
+
tsconfig: {
|
|
29
|
+
module: 'commonjs',
|
|
30
|
+
target: 'es2020',
|
|
31
|
+
esModuleInterop: true,
|
|
32
|
+
jsx: 'react-jsx',
|
|
33
|
+
strict: false,
|
|
34
|
+
skipLibCheck: true,
|
|
35
|
+
moduleResolution: 'node',
|
|
36
|
+
allowJs: true,
|
|
37
|
+
resolveJsonModule: true,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
moduleNameMapper: {
|
|
43
|
+
'^detox$': DRIVER_ENTRY,
|
|
44
|
+
// shared utils some external detox suites import relatively.
|
|
45
|
+
'^\\.\\./utils/navigation$': path.join(PACKAGE_ROOT, 'detox', 'navigation.ts'),
|
|
46
|
+
'^\\.\\./utils/colors$': path.join(PACKAGE_ROOT, 'detox', 'colors.ts'),
|
|
47
|
+
'^\\./(utils/navigation)$': path.join(PACKAGE_ROOT, 'detox', 'navigation.ts'),
|
|
48
|
+
'^\\./(utils/colors)$': path.join(PACKAGE_ROOT, 'detox', 'colors.ts'),
|
|
49
|
+
},
|
|
50
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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;
|
|
@@ -40,11 +40,45 @@ __export(src_exports, {
|
|
|
40
40
|
module.exports = __toCommonJS(src_exports);
|
|
41
41
|
|
|
42
42
|
// src/vite-plugin-one.ts
|
|
43
|
+
var import_fs2 = __toESM(require("fs"), 1);
|
|
44
|
+
var import_path2 = __toESM(require("path"), 1);
|
|
45
|
+
|
|
46
|
+
// src/runtime-assets.ts
|
|
43
47
|
var import_fs = __toESM(require("fs"), 1);
|
|
44
48
|
var import_path = __toESM(require("path"), 1);
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var
|
|
49
|
+
|
|
50
|
+
// src/home-paths.ts
|
|
51
|
+
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
52
|
+
var import_node_os = require("node:os");
|
|
53
|
+
var import_node_path = __toESM(require("node:path"), 1);
|
|
54
|
+
var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
55
|
+
var ACTIVE_RUNTIME_FILE = "active";
|
|
56
|
+
function sootsimHomeDir() {
|
|
57
|
+
const override = process.env[SOOTSIM_HOME_ENV];
|
|
58
|
+
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
59
|
+
return import_node_path.default.join((0, import_node_os.homedir)(), ".sootsim");
|
|
60
|
+
}
|
|
61
|
+
function runtimesDir() {
|
|
62
|
+
return import_node_path.default.join(sootsimHomeDir(), "runtimes");
|
|
63
|
+
}
|
|
64
|
+
function runtimeDir(version) {
|
|
65
|
+
return import_node_path.default.join(runtimesDir(), version);
|
|
66
|
+
}
|
|
67
|
+
function activeRuntimeFile() {
|
|
68
|
+
return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
|
|
69
|
+
}
|
|
70
|
+
function readActiveRuntime() {
|
|
71
|
+
try {
|
|
72
|
+
const value = import_node_fs.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
73
|
+
return value.length > 0 ? value : null;
|
|
74
|
+
} catch {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
79
|
+
|
|
80
|
+
// src/runtime-assets.ts
|
|
81
|
+
var SOOTSIM_RUNTIME_MISSING_MESSAGE = "[sootsim] no engine runtime installed \u2014 run `sootsim setup-repo` in your project, or `sootsim runtime install`";
|
|
48
82
|
var MIME_TYPES = {
|
|
49
83
|
".js": "application/javascript",
|
|
50
84
|
".mjs": "application/javascript",
|
|
@@ -52,17 +86,64 @@ var MIME_TYPES = {
|
|
|
52
86
|
".html": "text/html",
|
|
53
87
|
".wasm": "application/wasm",
|
|
54
88
|
".json": "application/json",
|
|
89
|
+
".jpg": "image/jpeg",
|
|
90
|
+
".jpeg": "image/jpeg",
|
|
55
91
|
".png": "image/png",
|
|
56
92
|
".svg": "image/svg+xml",
|
|
93
|
+
".webp": "image/webp",
|
|
94
|
+
".glb": "model/gltf-binary",
|
|
57
95
|
".ttf": "font/ttf",
|
|
58
96
|
".otf": "font/otf",
|
|
59
97
|
".woff": "font/woff",
|
|
60
98
|
".woff2": "font/woff2",
|
|
61
99
|
".mp3": "audio/mpeg",
|
|
62
|
-
".wav": "audio/wav"
|
|
63
|
-
".jpg": "image/jpeg",
|
|
64
|
-
".webp": "image/webp"
|
|
100
|
+
".wav": "audio/wav"
|
|
65
101
|
};
|
|
102
|
+
var ROOT_RUNTIME_PATHS = [
|
|
103
|
+
"/assets/",
|
|
104
|
+
"/engine/",
|
|
105
|
+
"/engine-tenant/",
|
|
106
|
+
"/photos/",
|
|
107
|
+
"/three-mode/",
|
|
108
|
+
"/canvaskit.wasm",
|
|
109
|
+
"/fonts/",
|
|
110
|
+
"/icons/",
|
|
111
|
+
"/sounds/",
|
|
112
|
+
"/spike/",
|
|
113
|
+
"/test-wallpaper.jpg",
|
|
114
|
+
"/preview-sw.js"
|
|
115
|
+
];
|
|
116
|
+
function resolveActiveRuntimeRoot() {
|
|
117
|
+
const active = readActiveRuntime();
|
|
118
|
+
if (!active) return null;
|
|
119
|
+
const dir = runtimeDir(active);
|
|
120
|
+
if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
|
|
121
|
+
return dir;
|
|
122
|
+
}
|
|
123
|
+
function isRootRuntimeAssetPath(pathname) {
|
|
124
|
+
return ROOT_RUNTIME_PATHS.some((p) => pathname === p || pathname.startsWith(p));
|
|
125
|
+
}
|
|
126
|
+
function resolveRuntimeFilePath(runtimeRoot, pathname) {
|
|
127
|
+
if (!pathname.startsWith("/")) return null;
|
|
128
|
+
if (pathname.includes("\0") || pathname.includes("\\")) return null;
|
|
129
|
+
for (const segment of pathname.split("/")) {
|
|
130
|
+
if (segment === "..") return null;
|
|
131
|
+
}
|
|
132
|
+
const fullPath = import_path.default.resolve(runtimeRoot, pathname.replace(/^\/+/, ""));
|
|
133
|
+
const rootWithSep = runtimeRoot.endsWith(import_path.default.sep) ? runtimeRoot : runtimeRoot + import_path.default.sep;
|
|
134
|
+
if (!fullPath.startsWith(rootWithSep) && fullPath !== runtimeRoot) return null;
|
|
135
|
+
if (!import_fs.default.existsSync(fullPath) || !import_fs.default.statSync(fullPath).isFile()) return null;
|
|
136
|
+
return fullPath;
|
|
137
|
+
}
|
|
138
|
+
function serveRuntimeFile(res, fullPath) {
|
|
139
|
+
const ext = import_path.default.extname(fullPath);
|
|
140
|
+
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
141
|
+
res.setHeader("cache-control", "max-age=31536000,immutable");
|
|
142
|
+
import_fs.default.createReadStream(fullPath).pipe(res);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// src/vite-plugin-one.ts
|
|
146
|
+
var sootsimRoot = import_path2.default.resolve(import_path2.default.dirname(new URL(__sootsim_import_meta_url).pathname), "..");
|
|
66
147
|
function sootsimPlugin(options = {}) {
|
|
67
148
|
if (options.enabled === false) return [];
|
|
68
149
|
const prefix2 = options.prefix || "/__soot";
|
|
@@ -89,14 +170,27 @@ function sootsimPlugin(options = {}) {
|
|
|
89
170
|
});
|
|
90
171
|
server.middlewares.use((req, res, next) => {
|
|
91
172
|
const url = req.url || "";
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
173
|
+
const pathname = url.split("?")[0];
|
|
174
|
+
const runtimeRoot = resolveActiveRuntimeRoot();
|
|
175
|
+
if (!runtimeRoot) {
|
|
176
|
+
if (pathname === prefix2 || pathname === prefix2 + "/" || pathname.startsWith(prefix2 + "/")) {
|
|
95
177
|
res.statusCode = 500;
|
|
96
|
-
res.end(
|
|
178
|
+
res.end(SOOTSIM_RUNTIME_MISSING_MESSAGE);
|
|
97
179
|
return;
|
|
98
180
|
}
|
|
99
|
-
|
|
181
|
+
next();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (isRootRuntimeAssetPath(pathname)) {
|
|
185
|
+
const fullPath = resolveRuntimeFilePath(runtimeRoot, pathname);
|
|
186
|
+
if (fullPath) {
|
|
187
|
+
serveRuntimeFile(res, fullPath);
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (pathname === prefix2 || pathname === prefix2 + "/") {
|
|
192
|
+
const htmlPath = import_path2.default.join(runtimeRoot, "index.html");
|
|
193
|
+
let html = import_fs2.default.readFileSync(htmlPath, "utf8");
|
|
100
194
|
html = html.replace(
|
|
101
195
|
"</head>",
|
|
102
196
|
`<script>history.replaceState(null,'','${prefix2}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
@@ -105,31 +199,25 @@ function sootsimPlugin(options = {}) {
|
|
|
105
199
|
res.end(html);
|
|
106
200
|
return;
|
|
107
201
|
}
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
res
|
|
115
|
-
import_fs.default.createReadStream(fullPath).pipe(res);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const publicPath = import_path.default.join(publicDir, filePath);
|
|
119
|
-
if (import_fs.default.existsSync(publicPath) && import_fs.default.statSync(publicPath).isFile()) {
|
|
120
|
-
const ext = import_path.default.extname(publicPath);
|
|
121
|
-
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
122
|
-
import_fs.default.createReadStream(publicPath).pipe(res);
|
|
202
|
+
if (pathname.startsWith(prefix2 + "/")) {
|
|
203
|
+
const fullPath = resolveRuntimeFilePath(
|
|
204
|
+
runtimeRoot,
|
|
205
|
+
pathname.slice(prefix2.length)
|
|
206
|
+
);
|
|
207
|
+
if (fullPath) {
|
|
208
|
+
serveRuntimeFile(res, fullPath);
|
|
123
209
|
return;
|
|
124
210
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
211
|
+
const ext = import_path2.default.extname(pathname);
|
|
212
|
+
if (!ext) {
|
|
213
|
+
const htmlPath = import_path2.default.join(runtimeRoot, "index.html");
|
|
214
|
+
let html = import_fs2.default.readFileSync(htmlPath, "utf8");
|
|
215
|
+
html = html.replace(
|
|
216
|
+
"</head>",
|
|
217
|
+
`<script>history.replaceState(null,'','${prefix2}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
218
|
+
);
|
|
219
|
+
res.setHeader("content-type", "text/html");
|
|
220
|
+
res.end(html);
|
|
133
221
|
return;
|
|
134
222
|
}
|
|
135
223
|
}
|
|
@@ -138,7 +226,9 @@ function sootsimPlugin(options = {}) {
|
|
|
138
226
|
const port = server.config.server.port || 8081;
|
|
139
227
|
const sootsimUrl = `http://localhost:${port}${prefix2}/`;
|
|
140
228
|
console.log(`[sootsim] serving at ${sootsimUrl}`);
|
|
141
|
-
|
|
229
|
+
if (options.open !== false) {
|
|
230
|
+
openElectronApp(sootsimUrl);
|
|
231
|
+
}
|
|
142
232
|
}
|
|
143
233
|
}
|
|
144
234
|
];
|
|
@@ -154,10 +244,10 @@ async function openElectronApp(sootsimUrl) {
|
|
|
154
244
|
}
|
|
155
245
|
const candidates = [
|
|
156
246
|
"/Applications/sootsim.app",
|
|
157
|
-
|
|
158
|
-
|
|
247
|
+
import_path2.default.join(process.env.HOME || "", "Applications/sootsim.app"),
|
|
248
|
+
import_path2.default.join(sootsimRoot, "release/mac-arm64/sootsim.app")
|
|
159
249
|
];
|
|
160
|
-
let appPath = candidates.find((p) =>
|
|
250
|
+
let appPath = candidates.find((p) => import_fs2.default.existsSync(p));
|
|
161
251
|
if (!appPath) {
|
|
162
252
|
try {
|
|
163
253
|
const found = execSync(
|
|
@@ -177,95 +267,9 @@ async function openElectronApp(sootsimUrl) {
|
|
|
177
267
|
}
|
|
178
268
|
|
|
179
269
|
// src/metro-plugin.ts
|
|
180
|
-
var
|
|
181
|
-
var
|
|
182
|
-
|
|
183
|
-
// src/home-paths.ts
|
|
184
|
-
var import_node_fs = __toESM(require("node:fs"), 1);
|
|
185
|
-
var import_node_os = require("node:os");
|
|
186
|
-
var import_node_path = __toESM(require("node:path"), 1);
|
|
187
|
-
var SOOTSIM_HOME_ENV = "SOOTSIM_HOME";
|
|
188
|
-
var ACTIVE_RUNTIME_FILE = "active";
|
|
189
|
-
function sootsimHomeDir() {
|
|
190
|
-
const override = process.env[SOOTSIM_HOME_ENV];
|
|
191
|
-
if (override && override.length > 0) return import_node_path.default.resolve(override);
|
|
192
|
-
return import_node_path.default.join((0, import_node_os.homedir)(), ".sootsim");
|
|
193
|
-
}
|
|
194
|
-
function runtimesDir() {
|
|
195
|
-
return import_node_path.default.join(sootsimHomeDir(), "runtimes");
|
|
196
|
-
}
|
|
197
|
-
function runtimeDir(version) {
|
|
198
|
-
return import_node_path.default.join(runtimesDir(), version);
|
|
199
|
-
}
|
|
200
|
-
function activeRuntimeFile() {
|
|
201
|
-
return import_node_path.default.join(runtimesDir(), ACTIVE_RUNTIME_FILE);
|
|
202
|
-
}
|
|
203
|
-
function readActiveRuntime() {
|
|
204
|
-
try {
|
|
205
|
-
const value = import_node_fs.default.readFileSync(activeRuntimeFile(), "utf8").trim();
|
|
206
|
-
return value.length > 0 ? value : null;
|
|
207
|
-
} catch {
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
212
|
-
|
|
213
|
-
// src/metro-plugin.ts
|
|
270
|
+
var import_fs3 = __toESM(require("fs"), 1);
|
|
271
|
+
var import_path3 = __toESM(require("path"), 1);
|
|
214
272
|
var prefix = "/__soot";
|
|
215
|
-
function resolveRuntimeRoot() {
|
|
216
|
-
const active = readActiveRuntime();
|
|
217
|
-
if (!active) return null;
|
|
218
|
-
const dir = runtimeDir(active);
|
|
219
|
-
if (!import_fs2.default.existsSync(import_path2.default.join(dir, "index.html"))) return null;
|
|
220
|
-
return dir;
|
|
221
|
-
}
|
|
222
|
-
var RUNTIME_MISSING_MESSAGE = "[sootsim] no engine runtime installed \u2014 run `sootsim setup-repo` in your project, or `sootsim runtime install`";
|
|
223
|
-
var MIME_TYPES2 = {
|
|
224
|
-
".js": "application/javascript",
|
|
225
|
-
".css": "text/css",
|
|
226
|
-
".html": "text/html",
|
|
227
|
-
".wasm": "application/wasm",
|
|
228
|
-
".json": "application/json",
|
|
229
|
-
".jpg": "image/jpeg",
|
|
230
|
-
".jpeg": "image/jpeg",
|
|
231
|
-
".png": "image/png",
|
|
232
|
-
".svg": "image/svg+xml",
|
|
233
|
-
".webp": "image/webp",
|
|
234
|
-
".glb": "model/gltf-binary",
|
|
235
|
-
".ttf": "font/ttf",
|
|
236
|
-
".otf": "font/otf",
|
|
237
|
-
".mp3": "audio/mpeg",
|
|
238
|
-
".wav": "audio/wav"
|
|
239
|
-
};
|
|
240
|
-
var ROOT_RUNTIME_PATHS = [
|
|
241
|
-
"/assets/",
|
|
242
|
-
"/engine/",
|
|
243
|
-
"/engine-tenant/",
|
|
244
|
-
"/photos/",
|
|
245
|
-
"/three-mode/",
|
|
246
|
-
"/canvaskit.wasm",
|
|
247
|
-
"/fonts/",
|
|
248
|
-
"/icons/",
|
|
249
|
-
"/sounds/",
|
|
250
|
-
"/spike/",
|
|
251
|
-
"/test-wallpaper.jpg",
|
|
252
|
-
"/preview-sw.js"
|
|
253
|
-
];
|
|
254
|
-
function isRootRuntimeAssetPath(pathname) {
|
|
255
|
-
return ROOT_RUNTIME_PATHS.some((p) => pathname === p || pathname.startsWith(p));
|
|
256
|
-
}
|
|
257
|
-
function resolveRuntimeFilePath(runtimeRoot, pathname) {
|
|
258
|
-
if (!pathname.startsWith("/")) return null;
|
|
259
|
-
if (pathname.includes("\0") || pathname.includes("\\")) return null;
|
|
260
|
-
for (const segment of pathname.split("/")) {
|
|
261
|
-
if (segment === "..") return null;
|
|
262
|
-
}
|
|
263
|
-
const fullPath = import_path2.default.resolve(runtimeRoot, pathname.replace(/^\/+/, ""));
|
|
264
|
-
const rootWithSep = runtimeRoot.endsWith(import_path2.default.sep) ? runtimeRoot : runtimeRoot + import_path2.default.sep;
|
|
265
|
-
if (!fullPath.startsWith(rootWithSep) && fullPath !== runtimeRoot) return null;
|
|
266
|
-
if (!import_fs2.default.existsSync(fullPath) || !import_fs2.default.statSync(fullPath).isFile()) return null;
|
|
267
|
-
return fullPath;
|
|
268
|
-
}
|
|
269
273
|
function withSootsim(config, options = {}) {
|
|
270
274
|
if (options.enabled === false) return config;
|
|
271
275
|
const bundleUrl = options.bundleUrl || "/index.bundle?platform=ios&dev=true&hot=true&minify=false";
|
|
@@ -289,11 +293,11 @@ function withSootsim(config, options = {}) {
|
|
|
289
293
|
server.use((req, res, next) => {
|
|
290
294
|
const url = req.url || "";
|
|
291
295
|
const pathname = url.split("?")[0];
|
|
292
|
-
const runtimeRoot =
|
|
296
|
+
const runtimeRoot = resolveActiveRuntimeRoot();
|
|
293
297
|
if (!runtimeRoot) {
|
|
294
298
|
if (pathname === prefix || pathname === prefix + "/") {
|
|
295
299
|
res.statusCode = 500;
|
|
296
|
-
res.end(
|
|
300
|
+
res.end(SOOTSIM_RUNTIME_MISSING_MESSAGE);
|
|
297
301
|
return;
|
|
298
302
|
}
|
|
299
303
|
next();
|
|
@@ -317,10 +321,10 @@ function withSootsim(config, options = {}) {
|
|
|
317
321
|
}
|
|
318
322
|
}
|
|
319
323
|
if (pathname === prefix || pathname === prefix + "/" || pathname.startsWith(prefix + "/")) {
|
|
320
|
-
const ext =
|
|
324
|
+
const ext = import_path3.default.extname(pathname);
|
|
321
325
|
if (!ext) {
|
|
322
|
-
const htmlPath =
|
|
323
|
-
let html =
|
|
326
|
+
const htmlPath = import_path3.default.join(runtimeRoot, "index.html");
|
|
327
|
+
let html = import_fs3.default.readFileSync(htmlPath, "utf8");
|
|
324
328
|
html = html.replace(
|
|
325
329
|
"</head>",
|
|
326
330
|
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
@@ -340,12 +344,6 @@ function withSootsim(config, options = {}) {
|
|
|
340
344
|
return { ...config, server: serverConfig };
|
|
341
345
|
}
|
|
342
346
|
var metro_plugin_default = withSootsim;
|
|
343
|
-
function serveRuntimeFile(res, fullPath) {
|
|
344
|
-
const ext = import_path2.default.extname(fullPath);
|
|
345
|
-
res.setHeader("content-type", MIME_TYPES2[ext] || "application/octet-stream");
|
|
346
|
-
res.setHeader("cache-control", "max-age=31536000,immutable");
|
|
347
|
-
import_fs2.default.createReadStream(fullPath).pipe(res);
|
|
348
|
-
}
|
|
349
347
|
|
|
350
348
|
// src/bridge-constants.ts
|
|
351
349
|
var DEFAULT_SOOTSIM_BRIDGE_PORT = 7668;
|
package/dist-lib/metro.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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;
|
|
@@ -33,11 +33,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
33
33
|
var metro_plugin_exports = {};
|
|
34
34
|
__export(metro_plugin_exports, {
|
|
35
35
|
default: () => metro_plugin_default,
|
|
36
|
-
isRootRuntimeAssetPath: () => isRootRuntimeAssetPath,
|
|
37
|
-
resolveRuntimeFilePath: () => resolveRuntimeFilePath,
|
|
38
36
|
withSootsim: () => withSootsim
|
|
39
37
|
});
|
|
40
38
|
module.exports = __toCommonJS(metro_plugin_exports);
|
|
39
|
+
var import_fs2 = __toESM(require("fs"), 1);
|
|
40
|
+
var import_path2 = __toESM(require("path"), 1);
|
|
41
|
+
|
|
42
|
+
// src/runtime-assets.ts
|
|
41
43
|
var import_fs = __toESM(require("fs"), 1);
|
|
42
44
|
var import_path = __toESM(require("path"), 1);
|
|
43
45
|
|
|
@@ -71,18 +73,11 @@ function readActiveRuntime() {
|
|
|
71
73
|
}
|
|
72
74
|
var DAEMON_LOCKFILE_MAX_BYTES = 16 * 1024;
|
|
73
75
|
|
|
74
|
-
// src/
|
|
75
|
-
var
|
|
76
|
-
function resolveRuntimeRoot() {
|
|
77
|
-
const active = readActiveRuntime();
|
|
78
|
-
if (!active) return null;
|
|
79
|
-
const dir = runtimeDir(active);
|
|
80
|
-
if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
|
|
81
|
-
return dir;
|
|
82
|
-
}
|
|
83
|
-
var RUNTIME_MISSING_MESSAGE = "[sootsim] no engine runtime installed \u2014 run `sootsim setup-repo` in your project, or `sootsim runtime install`";
|
|
76
|
+
// src/runtime-assets.ts
|
|
77
|
+
var SOOTSIM_RUNTIME_MISSING_MESSAGE = "[sootsim] no engine runtime installed \u2014 run `sootsim setup-repo` in your project, or `sootsim runtime install`";
|
|
84
78
|
var MIME_TYPES = {
|
|
85
79
|
".js": "application/javascript",
|
|
80
|
+
".mjs": "application/javascript",
|
|
86
81
|
".css": "text/css",
|
|
87
82
|
".html": "text/html",
|
|
88
83
|
".wasm": "application/wasm",
|
|
@@ -95,6 +90,8 @@ var MIME_TYPES = {
|
|
|
95
90
|
".glb": "model/gltf-binary",
|
|
96
91
|
".ttf": "font/ttf",
|
|
97
92
|
".otf": "font/otf",
|
|
93
|
+
".woff": "font/woff",
|
|
94
|
+
".woff2": "font/woff2",
|
|
98
95
|
".mp3": "audio/mpeg",
|
|
99
96
|
".wav": "audio/wav"
|
|
100
97
|
};
|
|
@@ -112,6 +109,13 @@ var ROOT_RUNTIME_PATHS = [
|
|
|
112
109
|
"/test-wallpaper.jpg",
|
|
113
110
|
"/preview-sw.js"
|
|
114
111
|
];
|
|
112
|
+
function resolveActiveRuntimeRoot() {
|
|
113
|
+
const active = readActiveRuntime();
|
|
114
|
+
if (!active) return null;
|
|
115
|
+
const dir = runtimeDir(active);
|
|
116
|
+
if (!import_fs.default.existsSync(import_path.default.join(dir, "index.html"))) return null;
|
|
117
|
+
return dir;
|
|
118
|
+
}
|
|
115
119
|
function isRootRuntimeAssetPath(pathname) {
|
|
116
120
|
return ROOT_RUNTIME_PATHS.some((p) => pathname === p || pathname.startsWith(p));
|
|
117
121
|
}
|
|
@@ -127,6 +131,15 @@ function resolveRuntimeFilePath(runtimeRoot, pathname) {
|
|
|
127
131
|
if (!import_fs.default.existsSync(fullPath) || !import_fs.default.statSync(fullPath).isFile()) return null;
|
|
128
132
|
return fullPath;
|
|
129
133
|
}
|
|
134
|
+
function serveRuntimeFile(res, fullPath) {
|
|
135
|
+
const ext = import_path.default.extname(fullPath);
|
|
136
|
+
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
137
|
+
res.setHeader("cache-control", "max-age=31536000,immutable");
|
|
138
|
+
import_fs.default.createReadStream(fullPath).pipe(res);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// src/metro-plugin.ts
|
|
142
|
+
var prefix = "/__soot";
|
|
130
143
|
function withSootsim(config, options = {}) {
|
|
131
144
|
if (options.enabled === false) return config;
|
|
132
145
|
const bundleUrl = options.bundleUrl || "/index.bundle?platform=ios&dev=true&hot=true&minify=false";
|
|
@@ -150,11 +163,11 @@ function withSootsim(config, options = {}) {
|
|
|
150
163
|
server.use((req, res, next) => {
|
|
151
164
|
const url = req.url || "";
|
|
152
165
|
const pathname = url.split("?")[0];
|
|
153
|
-
const runtimeRoot =
|
|
166
|
+
const runtimeRoot = resolveActiveRuntimeRoot();
|
|
154
167
|
if (!runtimeRoot) {
|
|
155
168
|
if (pathname === prefix || pathname === prefix + "/") {
|
|
156
169
|
res.statusCode = 500;
|
|
157
|
-
res.end(
|
|
170
|
+
res.end(SOOTSIM_RUNTIME_MISSING_MESSAGE);
|
|
158
171
|
return;
|
|
159
172
|
}
|
|
160
173
|
next();
|
|
@@ -178,10 +191,10 @@ function withSootsim(config, options = {}) {
|
|
|
178
191
|
}
|
|
179
192
|
}
|
|
180
193
|
if (pathname === prefix || pathname === prefix + "/" || pathname.startsWith(prefix + "/")) {
|
|
181
|
-
const ext =
|
|
194
|
+
const ext = import_path2.default.extname(pathname);
|
|
182
195
|
if (!ext) {
|
|
183
|
-
const htmlPath =
|
|
184
|
-
let html =
|
|
196
|
+
const htmlPath = import_path2.default.join(runtimeRoot, "index.html");
|
|
197
|
+
let html = import_fs2.default.readFileSync(htmlPath, "utf8");
|
|
185
198
|
html = html.replace(
|
|
186
199
|
"</head>",
|
|
187
200
|
`<script>history.replaceState(null,'','${prefix}/?bundle=${encodeURIComponent(bundleUrl)}')</script></head>`
|
|
@@ -201,15 +214,7 @@ function withSootsim(config, options = {}) {
|
|
|
201
214
|
return { ...config, server: serverConfig };
|
|
202
215
|
}
|
|
203
216
|
var metro_plugin_default = withSootsim;
|
|
204
|
-
function serveRuntimeFile(res, fullPath) {
|
|
205
|
-
const ext = import_path.default.extname(fullPath);
|
|
206
|
-
res.setHeader("content-type", MIME_TYPES[ext] || "application/octet-stream");
|
|
207
|
-
res.setHeader("cache-control", "max-age=31536000,immutable");
|
|
208
|
-
import_fs.default.createReadStream(fullPath).pipe(res);
|
|
209
|
-
}
|
|
210
217
|
// Annotate the CommonJS export names for ESM import in node:
|
|
211
218
|
0 && (module.exports = {
|
|
212
|
-
isRootRuntimeAssetPath,
|
|
213
|
-
resolveRuntimeFilePath,
|
|
214
219
|
withSootsim
|
|
215
220
|
});
|
package/dist-lib/profiles.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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;
|
package/dist-lib/render-mode.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! sootsim v0.1.
|
|
1
|
+
/*! sootsim v0.1.85 | (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;
|