stim 1.18.0 → 1.20.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.
Files changed (178) hide show
  1. package/README.md +21 -4
  2. package/dist/{activity-BxnkDZDi.mjs → activity-BrGh9EAI.mjs} +3 -3
  3. package/dist/{agent-device-usage-output-CZ66YA4T.mjs → agent-device-usage-output-DVyv_hWj.mjs} +7 -7
  4. package/dist/android-0vv-OruW.mjs +6 -0
  5. package/dist/android-Brx6EKvJ.mjs +1258 -0
  6. package/dist/{android-DC3ZLuw0.mjs → android-BsYNR81W.mjs} +103 -45
  7. package/dist/{android-CBwCNicO.mjs → android-CK3fpEyZ.mjs} +2 -2
  8. package/dist/{android-cas-BBFyr9CA.mjs → android-cas-DCAuXryb.mjs} +9 -5
  9. package/dist/android-cas-compiler.mjs +1 -1
  10. package/dist/api-run.mjs +159 -8
  11. package/dist/{api-D0VtFhqk.mjs → api-zuX3ynYN.mjs} +9 -7
  12. package/dist/api.d.mts +104 -4
  13. package/dist/api.mjs +1 -1
  14. package/dist/{app-install-D-PUENug.mjs → app-install-0LgaQRT7.mjs} +39 -18
  15. package/dist/artifact-CnC0mfov.mjs +807 -0
  16. package/dist/artifact-DClXJNWx.mjs +772 -0
  17. package/dist/artifact-lifecycle-DzPpBYvK.mjs +30 -0
  18. package/dist/{web-DTU0uiWj.mjs → browser-web-CzBmhmgs.mjs} +136 -174
  19. package/dist/{budget-DIhL2BKx.mjs → budget-BONq9vXY.mjs} +3096 -3244
  20. package/dist/build-BixRI6sB.mjs +462 -0
  21. package/dist/build-plan-CP0tckNU.mjs +553 -0
  22. package/dist/{cache-manifest-BI7ozfmH.mjs → cache-manifest-qA3dT2x2.mjs} +1 -1
  23. package/dist/cache-manifest.mjs +1 -1
  24. package/dist/ccache-CjHQ5F8g.mjs +142 -0
  25. package/dist/{chrome-DJnmnS5q.mjs → chrome-Dp2lMLBe.mjs} +1 -1
  26. package/dist/{cli-DNJMwADx.mjs → cli-B2R8wH1F.mjs} +20 -20
  27. package/dist/cli.mjs +1 -1
  28. package/dist/{client-DzhapoMB.mjs → client-BLy1Pw2V.mjs} +172 -165
  29. package/dist/collector-run.d.mts +10 -0
  30. package/dist/collector-run.mjs +7 -7
  31. package/dist/{command-output-CBtzyIgF.mjs → command-output-BjPN99ZB.mjs} +2 -2
  32. package/dist/{config-CgYMahz7.mjs → config-D0LhTY3S.mjs} +13 -13
  33. package/dist/{created-devices-DKbeWsiK.mjs → created-devices-HU_DAb_Q.mjs} +7 -6
  34. package/dist/{dependency-state-xKoOypBm.mjs → dependency-state-B2m8eqsS.mjs} +2 -2
  35. package/dist/{detached-entry-BLfcgc4O.mjs → detached-entry-BXq4fIl-.mjs} +1 -1
  36. package/dist/{dev-client-CLnIH02x.mjs → dev-client-ClATaJoH.mjs} +2 -2
  37. package/dist/{device-D7oCHGWi.mjs → device-B7lsC0K1.mjs} +8 -8
  38. package/dist/device-DVCwAFlX.mjs +727 -0
  39. package/dist/{device-capacity-EUOOYr8T.mjs → device-capacity-Ca_ke1LE.mjs} +25 -15
  40. package/dist/device-host-worker.mjs +38 -18
  41. package/dist/{device-ios-6MewKKnc.mjs → device-ios-CRUqPxKw.mjs} +12 -11
  42. package/dist/{device-lease-Co-EwifR.mjs → device-lease-DHOBXGgS.mjs} +135 -22
  43. package/dist/{device-lease-run-w1xhCqIW.mjs → device-lease-run-CvDeHTkG.mjs} +4 -4
  44. package/dist/{device-pool-F5WvRPtD.mjs → device-pool-L2-5GxMy.mjs} +3 -3
  45. package/dist/{device-remote-tHbd1fKy.mjs → device-remote-Bmg42063.mjs} +17 -69
  46. package/dist/doctor-C2MSuMMg.mjs +515 -0
  47. package/dist/{doctor-B9ckYUoU.mjs → doctor-DPAqhVCK.mjs} +334 -721
  48. package/dist/doctor-watchman-CB4NnVZm.mjs +260 -0
  49. package/dist/{simslim-EHBQ2R4G.mjs → eas-build-Dw_ec2Km.mjs} +6 -152
  50. package/dist/{stim-installations-aR_WsNOA.mjs → eas-session-ledger-DZlC-Fq3.mjs} +57 -4
  51. package/dist/{error-diagnostics-BRXOqDzG.mjs → error-diagnostics-Du7I_GuY.mjs} +17 -12
  52. package/dist/errors-DzkMYh8Q.mjs +205 -0
  53. package/dist/{exec-DWhCZDGm.mjs → exec-B81Qodjn.mjs} +69 -15
  54. package/dist/{gc-Dh6mXOKC.mjs → gc-PWp34zGb.mjs} +23 -22
  55. package/dist/{gradle-C6GKnunQ.mjs → gradle-C2OEKCCI.mjs} +50 -125
  56. package/dist/{guide-tm6igAaa.mjs → guide-Dai9lphv.mjs} +862 -538
  57. package/dist/{hosted-android-Bv285t_t.mjs → hosted-android-DQ-Agsd8.mjs} +5 -5
  58. package/dist/{hosted-client-C-rMtppF.mjs → hosted-client-Io01s5By.mjs} +9 -3
  59. package/dist/{hosted-ios-D5mNmtj4.mjs → hosted-ios-DIxFnYp-.mjs} +3 -3
  60. package/dist/{hosted-logs-DN8Iz4mJ.mjs → hosted-logs-DP-ABU_M.mjs} +8 -8
  61. package/dist/{hosted-macos-B-wEjlwG.mjs → hosted-macos-Aziw9T_9.mjs} +7 -6
  62. package/dist/{hosted-native-DeeOG8xZ.mjs → hosted-native-BdAQi21M.mjs} +23 -16
  63. package/dist/{idle-shutdown-jjtxAn5C.mjs → idle-shutdown-DdMqoSUB.mjs} +7 -7
  64. package/dist/ios-BZ9dg2Fr.mjs +9 -0
  65. package/dist/{ios-B3SbOWdw.mjs → ios-CXLIUxXJ.mjs} +180 -24
  66. package/dist/ios-CZuv6gRv.mjs +1112 -0
  67. package/dist/{ios-Bvbf0SGY.mjs → ios-VGvNdsv2.mjs} +1 -1
  68. package/dist/{ios-device-Bn7jWDB1.mjs → ios-device-B1B14xND.mjs} +1 -1
  69. package/dist/{ios-device-vOaByMhw.mjs → ios-device-BreZOpM0.mjs} +3 -3
  70. package/dist/ios-project-B9drt_aY.mjs +197 -0
  71. package/dist/{ios-state-B2pES6Vs.mjs → ios-state-CjrL2qv-.mjs} +1 -1
  72. package/dist/js-swap-C8icNYIY.mjs +432 -0
  73. package/dist/launch-DxH0THLP.mjs +745 -0
  74. package/dist/launch-YrbqaIFj.mjs +1530 -0
  75. package/dist/{launch-verify-hskNcWkZ.mjs → launch-verify-BzRdbuO1.mjs} +26 -7
  76. package/dist/{logs-1Ylc1Ri6.mjs → logs-DHaRNfg7.mjs} +11 -11
  77. package/dist/macos-C0iljhsN.mjs +2 -0
  78. package/dist/{macos-DF6C7wUU.mjs → macos-V_3Ui7g4.mjs} +125 -155
  79. package/dist/macos-run.mjs +1 -1
  80. package/dist/maintenance-run.mjs +13 -10
  81. package/dist/{metro-Dh8T4Ytd.mjs → metro-D_j9sN-B.mjs} +209 -43
  82. package/dist/{metro-gateway-CEUw9RMH.mjs → metro-gateway-BBJldOdi.mjs} +2 -2
  83. package/dist/miss-reason-BPAzZS0r.mjs +238 -0
  84. package/dist/{named-ports-BFIz1Shz.mjs → named-ports-C2lvoPsb.mjs} +12 -5
  85. package/dist/native-android-lHzaew7r.mjs +226 -0
  86. package/dist/native-gradle-inputs-BQnIdAlL.mjs +356 -0
  87. package/dist/{native-runtime-D_603JiC.mjs → native-runtime-BRmWL7ru.mjs} +9 -8
  88. package/dist/native-xcode-inputs-eutS19jU.mjs +307 -0
  89. package/dist/native-xcode-ios-DP3cHLwu.mjs +434 -0
  90. package/dist/{ndjson-LGZAMsqa.mjs → ndjson-GOnbyvso.mjs} +6 -6
  91. package/dist/offload-worker.d.mts +12 -6
  92. package/dist/offload-worker.mjs +409 -73
  93. package/dist/{ownership-D6Se7gg_.mjs → ownership-DXzMMSx6.mjs} +2 -2
  94. package/dist/{placement-log-BcPhRwR4.mjs → placement-log-reFbjqEr.mjs} +7 -3
  95. package/dist/plan-BDk2AeY_.mjs +260 -0
  96. package/dist/plan-placement-D_YYlE6N.mjs +73 -0
  97. package/dist/{ports-BLTtfBq-.mjs → ports-jzvAJXXL.mjs} +3 -3
  98. package/dist/{prebuild-juCyreaR.mjs → prebuild-Bw44QxVh.mjs} +4 -4
  99. package/dist/{preview-D5V07Nrl.mjs → preview-BaBJ72Al.mjs} +51 -34
  100. package/dist/project-B8_duAzW.mjs +1067 -0
  101. package/dist/project-plan-BPwbLwQu.mjs +10 -0
  102. package/dist/{pull-request-u4vp7zmK.mjs → pull-request-vOhLNmIb.mjs} +1 -1
  103. package/dist/pull-requests.mjs +1 -1
  104. package/dist/react-native-android-chm1DMlA.mjs +921 -0
  105. package/dist/react-native-build-oAw6gQeW.mjs +239 -0
  106. package/dist/react-native-doctor-DYXoh-6I.mjs +78 -0
  107. package/dist/react-native-ios-SCTK_CT5.mjs +595 -0
  108. package/dist/{recordings-BAWltsVt.mjs → recordings-Bk-VivUV.mjs} +1 -1
  109. package/dist/{reload-DvyWzVjJ.mjs → reload-D34GkY78.mjs} +17 -14
  110. package/dist/remote-BU9UyhCJ.mjs +192 -0
  111. package/dist/{remote-cache-BGg7aGIZ.mjs → remote-cache-Bsts6f6Y.mjs} +5 -5
  112. package/dist/result-BDoRk1k3.mjs +186 -0
  113. package/dist/{run-vhtDgpHO.mjs → run-qvff78hv.mjs} +3 -3
  114. package/dist/{server-bare-B9E7S1aR.mjs → server-bare-dWjAarki.mjs} +6 -6
  115. package/dist/server-command-7XIKlWtO.mjs +69 -0
  116. package/dist/{server-expo-DoBHhuzK.mjs → server-expo-CsYu2aKL.mjs} +107 -82
  117. package/dist/server-expo-DV43vep4.mjs +2 -0
  118. package/dist/settings-Bbztm4oV.mjs +1503 -0
  119. package/dist/{settings-Byp2AQ_E.mjs → settings-CT3E71-i.mjs} +6 -7
  120. package/dist/{state-lKh8shBp.d.mts → settings-vk3mJGSm.d.mts} +4 -2
  121. package/dist/settings.schema.json +156 -6
  122. package/dist/simslim-ChMfe8rg.mjs +149 -0
  123. package/dist/{slot-launch-C1nqh4mu.mjs → slot-launch-B9hn96wd.mjs} +6 -6
  124. package/dist/{stage-g_WqWeaE.mjs → stage-BNKKdDNc.mjs} +6 -3
  125. package/dist/start-CbQCSnXQ.mjs +2 -0
  126. package/dist/{start-D-IeOyoK.mjs → start-CdvcTaXr.mjs} +113 -77
  127. package/dist/{state-xnqpx3AD.mjs → state-Boo0IMJq.mjs} +4 -2
  128. package/dist/{state-BG-aAk4k.mjs → state-DI84A-uu.mjs} +29 -10
  129. package/dist/{stats-DY6ekz8F.mjs → stats-BIIDrjA8.mjs} +6 -6
  130. package/dist/{status-BEeL6IKz.mjs → status-BDGHwkCs.mjs} +3 -1
  131. package/dist/{status-DCjZeE-K.mjs → status-DARMkc9q.mjs} +80 -294
  132. package/dist/status-watch-DvmI3SmN.mjs +296 -0
  133. package/dist/{stim-desktop-Behws_fi.mjs → stim-desktop-8GQX2OV8.mjs} +1 -1
  134. package/dist/{stop-DIJtD2GL.mjs → stop-CCZS-C9m.mjs} +2 -2
  135. package/dist/stop-WQPQHLuy.mjs +72 -0
  136. package/dist/{stop-BTjs3xbc.mjs → stop-iNemHsJC.mjs} +81 -33
  137. package/dist/supervisor-run.d.mts +7 -2
  138. package/dist/supervisor-run.mjs +32 -20
  139. package/dist/{support-Bwvbrq5-.mjs → support-CnE_SIjt.mjs} +17 -7
  140. package/dist/{support-BaayeYCf.mjs → support-DCco5fut.mjs} +61 -8
  141. package/dist/swiftpm-macos-afeNUExW.mjs +119 -0
  142. package/dist/{native-run-B06FkmZx.mjs → tailnet-CoJUb2tB.mjs} +113 -6
  143. package/dist/toolchain-BIupIro1.mjs +2 -0
  144. package/dist/{toolchain-Bnyd_K3A.mjs → toolchain-DqyDXs30.mjs} +225 -315
  145. package/dist/{trigger-CJMhwXe8.mjs → trigger-C0MWBi8O.mjs} +3 -3
  146. package/dist/trigger-SHLOWJ4O.mjs +2 -0
  147. package/dist/{warm-progress-CjB-MP6H.mjs → warm-progress-C3ASD6z5.mjs} +134 -37
  148. package/dist/{status-Dcr0Qexd.mjs → watchman-CQl51YZu.mjs} +75 -7
  149. package/dist/web-B3eldHFH.mjs +123 -0
  150. package/dist/web-BLXpOe6b.mjs +2 -0
  151. package/dist/web-run.mjs +10 -10
  152. package/dist/{workspace-state-C59dqG-Z.mjs → workspace-state-CSIFuuDa.mjs} +33 -33
  153. package/dist/{workspaces-xXItD8Dj.mjs → workspaces-D2xSHBDY.mjs} +1297 -1211
  154. package/dist/{worktree-BSYlofkq.mjs → worktree-BxDqaTev.mjs} +102 -63
  155. package/dist/worktree-q7_OZNY0.mjs +2 -0
  156. package/package.json +8 -6
  157. package/shim/bundle-response.cjs +2 -1
  158. package/shim/bundle-response.d.cts +1 -1
  159. package/shim/expo-metro-config.cjs +1 -1
  160. package/shim/native-android.gradle +101 -0
  161. package/dist/android-BKA16DTf.mjs +0 -4
  162. package/dist/android-BvwuMUJ9.mjs +0 -3572
  163. package/dist/guide-status-Bhf9SJXc.mjs +0 -125
  164. package/dist/ios-CPdkoKaa.mjs +0 -3953
  165. package/dist/ios-DNpdygiv.mjs +0 -7
  166. package/dist/macos-Ck7OBMNY.mjs +0 -2
  167. package/dist/metro-store-BAHFcJm6.mjs +0 -106
  168. package/dist/plan-placement-CtxkCO54.mjs +0 -1859
  169. package/dist/project-C3ChRLZy.mjs +0 -212
  170. package/dist/projects-DD7dBTCj.mjs +0 -92
  171. package/dist/server-expo-Db9HBUoa.mjs +0 -2
  172. package/dist/settings-CQyMElEP.mjs +0 -701
  173. package/dist/start-NTc1Ifqs.mjs +0 -2
  174. package/dist/stop-BGhKMOuH.mjs +0 -48
  175. package/dist/trigger-DWAq9hkw.mjs +0 -2
  176. package/dist/web-B6_bFDn7.mjs +0 -2
  177. package/dist/worktree-BJfnU6r5.mjs +0 -2
  178. package/dist/worktree-CsKYexJM.mjs +0 -753
@@ -1,212 +0,0 @@
1
- import { _ as loadConfig$1, g as isPathPrefix, l as findEnclosingWorktreeRoot, p as getProject } from "./config-CgYMahz7.mjs";
2
- import { y as repoRoot } from "./worktree-CsKYexJM.mjs";
3
- import { basename, dirname, join, resolve } from "path";
4
- import { findProjectRoot, findProjectRoot as findProjectRoot$1 } from "@stim-cli/core/state";
5
- import { existsSync, readFileSync, realpathSync } from "fs";
6
- //#region src/workspace/project.ts
7
- /**
8
- * The realpath of `name`'s package.json in the nearest `node_modules` at or above `projectRoot`.
9
- * Unlike `require.resolve`, it ignores `NODE_PATH`, which pnpm's bin shims point at the workspace's
10
- * hidden hoist directory holding every member's dependencies.
11
- */
12
- function resolvePackageJson(projectRoot, name) {
13
- for (let dir = resolve(projectRoot);; dir = dirname(dir)) {
14
- const candidate = join(dir, "node_modules", name, "package.json");
15
- if (existsSync(candidate)) return realpathSync(candidate);
16
- if (dirname(dir) === dir) return null;
17
- }
18
- }
19
- function isPackageResolvable(projectRoot, name) {
20
- return resolvePackageJson(projectRoot, name) !== null;
21
- }
22
- function projectShortcut(path, proj) {
23
- if (proj?.label) return proj.label;
24
- const rootPath = findEnclosingWorktreeRoot(path);
25
- if (rootPath && rootPath !== path) return `${projectShortcut(rootPath, getProject(rootPath))}/${path.split("/").pop() || path}`;
26
- return path.split("/").pop() || path;
27
- }
28
- function ownedDeviceLabel(projectPath) {
29
- const app = realpathSync(projectPath);
30
- const root = repoRoot(app);
31
- const appLabel = basename(app);
32
- if (!root) return appLabel;
33
- const worktreeLabel = basename(realpathSync(root));
34
- return worktreeLabel === appLabel ? appLabel : `${worktreeLabel}-${appLabel}`;
35
- }
36
- const NO_PROJECT_REFUSAL = {
37
- code: "STIM_NO_PROJECT",
38
- message: "Not in a React Native project (no package.json found).",
39
- remedy: "Run this from the app directory -- the one holding package.json."
40
- };
41
- function findServerWorkspace(startDir) {
42
- const nearest = findProjectRoot(startDir);
43
- if (!nearest) return null;
44
- if (existsSync(join(nearest, "Package.swift"))) return {
45
- root: nearest,
46
- from: null
47
- };
48
- if (appProjectProblem(nearest)?.kind !== "not-an-app") return {
49
- root: nearest,
50
- from: null
51
- };
52
- if (Object.keys(getProject(nearest)?.ports ?? {}).length) return {
53
- root: nearest,
54
- from: null
55
- };
56
- const top = repoRoot(nearest);
57
- if (!top) return {
58
- root: nearest,
59
- from: null
60
- };
61
- const worktree = expandedRealpath(top);
62
- const apps = Object.keys(loadConfig$1()?.projects ?? {}).filter((path) => {
63
- if (path === nearest || !isPathPrefix(worktree, expandedRealpath(path)) || appProjectProblem(path) !== null) return false;
64
- const owner = repoRoot(path);
65
- return owner !== null && expandedRealpath(owner) === worktree;
66
- });
67
- return apps.length === 1 ? {
68
- root: apps[0],
69
- from: nearest
70
- } : {
71
- root: nearest,
72
- from: null
73
- };
74
- }
75
- function findCommandWorkspace(startDir, note = (line) => console.error(line)) {
76
- const workspace = findServerWorkspace(startDir);
77
- if (workspace?.from) note(`Using the Stim workspace ${workspace.root}: ${workspace.from} is not a React Native or Expo app.`);
78
- return workspace?.root ?? null;
79
- }
80
- function expandedRealpath(path) {
81
- try {
82
- return realpathSync.native(path);
83
- } catch {
84
- return resolve(path);
85
- }
86
- }
87
- function loadPackageJson(projectRoot) {
88
- const p = join(projectRoot, "package.json");
89
- if (!existsSync(p)) return {
90
- pkg: null,
91
- parseError: null
92
- };
93
- try {
94
- return {
95
- pkg: JSON.parse(readFileSync(p, "utf-8")),
96
- parseError: null
97
- };
98
- } catch (error) {
99
- return {
100
- pkg: null,
101
- parseError: error?.message || String(error)
102
- };
103
- }
104
- }
105
- function readPackageJson(projectRoot) {
106
- return loadPackageJson(projectRoot).pkg;
107
- }
108
- const APP_DEPENDENCIES = ["react-native", "expo"];
109
- function declaresAppDependency(pkg) {
110
- if (!pkg || typeof pkg !== "object") return false;
111
- const { dependencies, devDependencies } = pkg;
112
- const deps = {
113
- ...dependencies,
114
- ...devDependencies
115
- };
116
- return APP_DEPENDENCIES.some((name) => name in deps);
117
- }
118
- function appProjectProblem(projectRoot) {
119
- const file = join(projectRoot, "package.json");
120
- const { pkg, parseError } = loadPackageJson(projectRoot);
121
- if (parseError) return {
122
- kind: "unreadable",
123
- message: `${file} is not valid JSON (${parseError}), so Stim cannot tell whether this is a React Native or Expo app.`,
124
- remedy: `Fix the JSON in ${file} -- an unfinished edit or a merge conflict leaves it unparseable -- then run the command again.`
125
- };
126
- if (declaresAppDependency(pkg)) return null;
127
- return {
128
- kind: "not-an-app",
129
- message: `${file} depends on neither react-native nor expo, so this is not a React Native or Expo app.`,
130
- remedy: "Run this from the app directory -- the one whose package.json depends on react-native or expo -- or from that directory inside a worktree."
131
- };
132
- }
133
- function detectIsExpo(projectRoot) {
134
- const pkg = readPackageJson(projectRoot);
135
- const iosScript = pkg?.scripts?.ios;
136
- if (typeof iosScript === "string") {
137
- if (/\bexpo\s+run:ios\b/.test(iosScript)) return true;
138
- if (/\breact-native\s+run-ios\b/.test(iosScript)) return false;
139
- }
140
- if (!pkg) return false;
141
- const hasExpoDep = "expo" in {
142
- ...pkg.dependencies,
143
- ...pkg.devDependencies
144
- };
145
- const resolvable = () => isPackageResolvable(projectRoot, "expo");
146
- if (!hasExpoDep && !resolvable()) return false;
147
- const appJson = readAppJson(projectRoot);
148
- if (appJson?.expo) return true;
149
- const text = readAppConfigText(projectRoot);
150
- if (text && /\b(?:from\s+['"]expo['"]|expo\/config|ExpoConfig)\b/.test(text)) return true;
151
- if (hasExpoDep && resolvable()) return true;
152
- if (looksLikeExpoConfig(appJson)) return true;
153
- if (podfileUsesExpoModules(projectRoot)) return true;
154
- return false;
155
- }
156
- function detectTutorial(appJson) {
157
- const extra = appJson?.expo?.extra;
158
- const version = typeof extra === "object" && extra !== null ? extra.stimTutorial : null;
159
- return typeof version === "number" && Number.isInteger(version) && version > 0 ? { version } : void 0;
160
- }
161
- function looksLikeExpoConfig(appJson) {
162
- if (!appJson || typeof appJson !== "object" || Array.isArray(appJson)) return false;
163
- if (appJson.expo) return true;
164
- if ([
165
- "slug",
166
- "plugins",
167
- "sdkVersion",
168
- "experiments",
169
- "runtimeVersion",
170
- "updates",
171
- "buildCacheProvider",
172
- "assetBundlePatterns",
173
- "splash",
174
- "orientation",
175
- "userInterfaceStyle"
176
- ].some((key) => appJson[key] !== void 0)) return true;
177
- return Boolean(appJson.extra && typeof appJson.extra === "object" && appJson.extra.eas);
178
- }
179
- function podfileUsesExpoModules(projectRoot) {
180
- const p = join(projectRoot, "ios", "Podfile");
181
- if (!existsSync(p)) return false;
182
- try {
183
- return /^[^#\n]*use_expo_modules!/m.test(readFileSync(p, "utf-8"));
184
- } catch {
185
- return false;
186
- }
187
- }
188
- function readAppJson(projectRoot) {
189
- const p = join(projectRoot, "app.json");
190
- if (!existsSync(p)) return null;
191
- try {
192
- return JSON.parse(readFileSync(p, "utf-8"));
193
- } catch {
194
- return null;
195
- }
196
- }
197
- function readAppConfigText(projectRoot) {
198
- for (const name of [
199
- "app.config.js",
200
- "app.config.ts",
201
- "app.config.cjs",
202
- "app.config.mjs"
203
- ]) {
204
- const p = join(projectRoot, name);
205
- if (existsSync(p)) try {
206
- return readFileSync(p, "utf-8");
207
- } catch {}
208
- }
209
- return null;
210
- }
211
- //#endregion
212
- export { detectTutorial as a, findServerWorkspace as c, projectShortcut as d, readAppConfigText as f, resolvePackageJson as h, detectIsExpo as i, isPackageResolvable as l, readPackageJson as m, appProjectProblem as n, findCommandWorkspace as o, readAppJson as p, declaresAppDependency as r, findProjectRoot$1 as s, NO_PROJECT_REFUSAL as t, ownedDeviceLabel as u };
@@ -1,92 +0,0 @@
1
- import { f as readAppConfigText, i as detectIsExpo, l as isPackageResolvable, m as readPackageJson, p as readAppJson, r as declaresAppDependency } from "./project-C3ChRLZy.mjs";
2
- import { Ft as MODE_BARE, It as MODE_EXPO } from "./budget-DIhL2BKx.mjs";
3
- import { B as settingValueAt, W as webSettings } from "./settings-CQyMElEP.mjs";
4
- import { existsSync, readdirSync } from "node:fs";
5
- import { join } from "node:path";
6
- //#region src/integrations/projects.ts
7
- const expo = {
8
- mode: MODE_EXPO,
9
- loadDevServer: async () => (await import("./server-expo-Db9HBUoa.mjs")).startExpoServer,
10
- platforms(root) {
11
- const appJson = readAppJson(root);
12
- const config = appJson?.expo ?? appJson;
13
- const text = readAppConfigText(root);
14
- const explicit = (text ? literalPlatforms(text) : null) ?? config?.platforms;
15
- if (Array.isArray(explicit)) return explicit.filter((platform) => platform === "ios" || platform === "android" || platform === "web");
16
- const pkg = readPackageJson(root);
17
- return [
18
- "ios",
19
- "android",
20
- ..."react-native-web" in {
21
- ...pkg?.dependencies,
22
- ...pkg?.devDependencies
23
- } || isPackageResolvable(root, "react-native-web") ? ["web"] : []
24
- ];
25
- }
26
- };
27
- const reactNative = {
28
- mode: MODE_BARE,
29
- loadDevServer: async () => (await import("./server-bare-B9E7S1aR.mjs")).startBareServer,
30
- platforms(root) {
31
- if (!declaresAppDependency(readPackageJson(root))) return [];
32
- const platforms = [];
33
- let ios = [];
34
- try {
35
- ios = readdirSync(join(root, "ios"));
36
- } catch {}
37
- if (ios.some((name) => name.endsWith(".xcodeproj") || name.endsWith(".xcworkspace"))) platforms.push("ios");
38
- if ([
39
- "build.gradle",
40
- "build.gradle.kts",
41
- "settings.gradle",
42
- "settings.gradle.kts"
43
- ].some((name) => existsSync(join(root, "android", name)))) platforms.push("android");
44
- return platforms;
45
- }
46
- };
47
- const swiftPackage = { platforms(root, settings) {
48
- return existsSync(join(root, "Package.swift")) && settingValueAt(settings, "macos.product") && settingValueAt(settings, "macos.infoPlist") ? ["macos"] : [];
49
- } };
50
- const configuredWeb = { platforms(_root, settings) {
51
- return webSettings(settings).url !== null ? ["web"] : [];
52
- } };
53
- function nativeProjectIntegration(root, isExpo = detectIsExpo) {
54
- return isExpo(root) ? expo : reactNative;
55
- }
56
- function detectPlatforms(root, settings) {
57
- const integrations = [
58
- nativeProjectIntegration(root),
59
- swiftPackage,
60
- configuredWeb
61
- ];
62
- const platforms = new Set(integrations.flatMap((integration) => integration.platforms(root, settings)));
63
- return [
64
- "ios",
65
- "android",
66
- "macos",
67
- "web"
68
- ].filter((platform) => platforms.has(platform));
69
- }
70
- function literalPlatforms(text) {
71
- const tokens = text.match(/\/\*[\s\S]*?\*\/|\/\/[^\n]*|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`|[A-Za-z_$][\w$]*|[^\s]/g)?.filter((token) => !token.startsWith("//") && !token.startsWith("/*")) ?? [];
72
- let open = 0;
73
- const index = tokens.findIndex((token, i) => {
74
- if (token === "[") open++;
75
- else if (token === "]") open--;
76
- return open === 0 && (token === "platforms" || token === "\"platforms\"" || token === "'platforms'") && tokens[i + 1] === ":";
77
- });
78
- if (index < 0 || tokens[index + 2] !== "[") return null;
79
- const platforms = [];
80
- let i = index + 3;
81
- while (tokens[i] !== "]") {
82
- const value = tokens[i]?.match(/^(['"])([a-z]+)\1$/)?.[2];
83
- if (value === void 0) return null;
84
- platforms.push(value);
85
- i++;
86
- if (tokens[i] === ",") i++;
87
- else if (tokens[i] !== "]") return null;
88
- }
89
- return tokens[i + 1] === "," || tokens[i + 1] === "}" ? platforms : null;
90
- }
91
- //#endregion
92
- export { nativeProjectIntegration as n, detectPlatforms as t };
@@ -1,2 +0,0 @@
1
- import { p as startExpoServer } from "./server-expo-DoBHhuzK.mjs";
2
- export { startExpoServer };