@superwall/cli 1.1.1 → 1.3.0-beta.3

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 (52) hide show
  1. package/README.md +37 -4
  2. package/dist/{actions-I5gVO5jN.js → actions-DvHycH3X.js} +2 -2
  3. package/dist/{api-emImQnVy.js → api-B50i89j0.js} +9 -9
  4. package/dist/{api-output-B5hh0q4V.js → api-output-D9ggXQIr.js} +1 -1
  5. package/dist/{app-DE9lxNNV.js → app-FiC9SQVp.js} +11 -11
  6. package/dist/asa-B5hrBL3t.js +1194 -0
  7. package/dist/{asc-DYc_Yo9e.js → asc-CRtRYv17.js} +13 -13
  8. package/dist/{auth-Bir_Un8l.js → auth-CYognaF4.js} +10 -10
  9. package/dist/auth.js +2 -2
  10. package/dist/{billing-CW0diI2X.js → billing-CSOUhWso.js} +1 -1
  11. package/dist/{bind-DO11eXrR.js → bind-BbzBenoP.js} +4 -4
  12. package/dist/{command-CmJMNVVz.js → command-B7Te31wp.js} +96 -101
  13. package/dist/{create-CwDgWW16.js → create--Q8nPgoa.js} +18 -18
  14. package/dist/{dev-OnmMOsgK.js → dev-Dr6gXH-o.js} +37 -19
  15. package/dist/{doctor-CpYkDfdC.js → doctor-Cf0qNjbq.js} +10 -10
  16. package/dist/{drivers-Cweb9bWA.js → drivers-ItOmKzrw.js} +2 -2
  17. package/dist/entry.js +531 -279
  18. package/dist/{existing-p-hX-Nxc.js → existing-B-e22WOr.js} +2 -2
  19. package/dist/{feedback-CV4JnRuk.js → feedback-C3UtAxye.js} +9 -9
  20. package/dist/{git-BrTxQ7ui.js → git-2wRxiwOc.js} +10 -10
  21. package/dist/{hosted-CbNJSJAC.js → hosted-vk05ZF6w.js} +3 -3
  22. package/dist/{integrate-DOLvHr1D.js → integrate-Cv8r_i2l.js} +30 -29
  23. package/dist/{login-B7fSpJKc.js → login-DOES7Kup.js} +8 -7
  24. package/dist/{migrate-Bn5btm_H.js → migrate-C7R29RPH.js} +20 -20
  25. package/dist/{org-B2gy9Pmu.js → org-Cg25bcsj.js} +3 -3
  26. package/dist/output-D2Ax_hHL.js +123 -0
  27. package/dist/{params-Bvq0iqQK.js → params-B1zeElGa.js} +1 -2
  28. package/dist/{pipeline-COr4sB6U.js → pipeline-BVeUA6Ig.js} +106 -173
  29. package/dist/{print-skill-D0j2D6tw.js → print-skill-D-R81bno.js} +7 -7
  30. package/dist/{promote-UmKZySRx.js → promote-CV_Lsmqd.js} +18 -18
  31. package/dist/publish-CSnNvHHi.js +35 -0
  32. package/dist/push-sjnRI6iL.js +35 -0
  33. package/dist/{query-CbGfXmKu.js → query-CdcWSinl.js} +10 -10
  34. package/dist/{resource-m6yz1jwE.js → resource-PVg0uzSK.js} +14 -14
  35. package/dist/{resources-CVrWwA1K.js → resources-s64mBHaC.js} +1 -0
  36. package/dist/{run-BTLaOoKK.js → run-XIkrFIgw.js} +2 -2
  37. package/dist/{scan-BfoeYW1v.js → scan-Dk0ZlCY6.js} +2 -2
  38. package/dist/{skills-HlIKA9xR.js → skills-B-mR2CqM.js} +4 -3
  39. package/dist/{skills-C4Yzl64N.js → skills-CoEIW0mE.js} +8 -8
  40. package/dist/{spinner-gOxIMz-V.js → spinner-B9dT3DBY.js} +1 -1
  41. package/dist/{telemetry-CLi7mjDP.js → telemetry-yJs7t0rt.js} +6 -41
  42. package/dist/{token-DHRH8cxi.js → token-GcbyH6G8.js} +2 -2
  43. package/dist/{ui-C4ncRJqd.js → ui-Lqt_zFOr.js} +5 -1
  44. package/dist/update-B4hoLAN-.js +59 -0
  45. package/dist/{upgrade-Cbh-7q_o.js → upgrade-ByCYDXgb.js} +6 -6
  46. package/package.json +4 -3
  47. package/dist/json-C3hPIMkI.js +0 -7
  48. package/dist/publish-BVnG2UOU.js +0 -35
  49. package/dist/push-hHtVTZ1m.js +0 -35
  50. package/dist/update-CxP4fmMe.js +0 -137
  51. /package/dist/{asc-products-YQ6Oc6YO.js → asc-products-C6MvSy8H.js} +0 -0
  52. /package/dist/{storekit-Ddvs4Ynw.js → storekit-DPonXSwe.js} +0 -0
@@ -1,15 +1,15 @@
1
- import "./telemetry-CLi7mjDP.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-CxP4fmMe.js";
4
- import "./token-DHRH8cxi.js";
5
- import { t as defineCommand } from "./command-CmJMNVVz.js";
6
- import "./ui-C4ncRJqd.js";
7
- import "./spinner-gOxIMz-V.js";
8
- import { C as rowName } from "./resources-CVrWwA1K.js";
9
- import { t as requireOrg } from "./org-B2gy9Pmu.js";
10
- import { t as parseParams } from "./params-Bvq0iqQK.js";
11
- import { n as emitJson, t as apiCall } from "./api-output-B5hh0q4V.js";
12
- import { a as ascProxy, c as listAscConfigs, i as listAscApps, n as fetchUnimportedAscProducts, o as createAscConfig, r as findAscAppId, s as deleteAscConfig, t as ascTypeDisplay } from "./asc-products-YQ6Oc6YO.js";
1
+ import { p as SUPERWALL_HOME } from "./output-D2Ax_hHL.js";
2
+ import "./telemetry-yJs7t0rt.js";
3
+ import "./update-B4hoLAN-.js";
4
+ import "./token-GcbyH6G8.js";
5
+ import { t as defineCommand } from "./command-B7Te31wp.js";
6
+ import "./ui-Lqt_zFOr.js";
7
+ import "./spinner-B9dT3DBY.js";
8
+ import { C as rowName } from "./resources-s64mBHaC.js";
9
+ import { t as requireOrg } from "./org-Cg25bcsj.js";
10
+ import { t as parseParams } from "./params-B1zeElGa.js";
11
+ import { n as emitJson, t as apiCall } from "./api-output-D9ggXQIr.js";
12
+ import { a as ascProxy, c as listAscConfigs, i as listAscApps, n as fetchUnimportedAscProducts, o as createAscConfig, r as findAscAppId, s as deleteAscConfig, t as ascTypeDisplay } from "./asc-products-C6MvSy8H.js";
13
13
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
14
14
  import { homedir } from "node:os";
15
15
  import { dirname, join } from "node:path";
@@ -20,7 +20,7 @@ import { inflateRawSync } from "node:zlib";
20
20
  const SPEC_URL = "https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip";
21
21
  const REFRESH_TTL_MS = 10080 * 60 * 1e3;
22
22
  function cachePath() {
23
- return process.env.SUPERWALL_ASC_INDEX_PATH ?? join(homedir(), ".superwall", "asc-index.json");
23
+ return process.env.SUPERWALL_ASC_INDEX_PATH ?? join(SUPERWALL_HOME() ?? join(homedir(), ".superwall"), "asc-index.json");
24
24
  }
25
25
  let mem;
26
26
  function readCachedIndex() {
@@ -1,13 +1,13 @@
1
- import { i as track, y as API_HOST } from "./telemetry-CLi7mjDP.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-CxP4fmMe.js";
4
- import { i as loadSession, r as clearSession } from "./token-DHRH8cxi.js";
5
- import { t as defineCommand } from "./command-CmJMNVVz.js";
6
- import "./ui-C4ncRJqd.js";
7
- import { n as ensureSkillsCurrent } from "./skills-HlIKA9xR.js";
1
+ import { a as API_HOST } from "./output-D2Ax_hHL.js";
2
+ import { i as track } from "./telemetry-yJs7t0rt.js";
3
+ import "./update-B4hoLAN-.js";
4
+ import { i as loadSession, r as clearSession } from "./token-GcbyH6G8.js";
5
+ import { t as defineCommand } from "./command-B7Te31wp.js";
6
+ import "./ui-Lqt_zFOr.js";
7
+ import { n as ensureSkillsCurrent } from "./skills-B-mR2CqM.js";
8
8
  import "./spawn-DSoTXy_j.js";
9
- import { n as performLogin, r as onboardingHooks, t as loginWithApiKey } from "./login-B7fSpJKc.js";
10
- import { t as scanProject } from "./scan-BfoeYW1v.js";
9
+ import { n as performLogin, r as onboardingHooks, t as loginWithApiKey } from "./login-DOES7Kup.js";
10
+ import { t as scanProject } from "./scan-Dk0ZlCY6.js";
11
11
 
12
12
  //#region src/commands/account/auth.ts
13
13
  const runLogin = defineCommand({
@@ -119,7 +119,7 @@ const runWhoami = defineCommand({
119
119
  }
120
120
  });
121
121
  function effectiveHost(session) {
122
- return process.env.SUPERWALL_API_HOST ?? session.host ?? API_HOST;
122
+ return process.env.SUPERWALL_API_HOST ?? session.host ?? API_HOST();
123
123
  }
124
124
  function sessionOutput(session) {
125
125
  return {
package/dist/auth.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./json-C3hPIMkI.js";
2
- import { n as resolveAuthToken, o as NotLoggedInError, t as getOAuthAccessToken } from "./token-DHRH8cxi.js";
1
+ import "./output-D2Ax_hHL.js";
2
+ import { n as resolveAuthToken, o as NotLoggedInError, t as getOAuthAccessToken } from "./token-GcbyH6G8.js";
3
3
 
4
4
  export { NotLoggedInError, getOAuthAccessToken, resolveAuthToken };
@@ -1,4 +1,4 @@
1
- import { n as allDeps, r as readPackageJson } from "./scan-BfoeYW1v.js";
1
+ import { n as allDeps, r as readPackageJson } from "./scan-Dk0ZlCY6.js";
2
2
  import { readFileSync } from "node:fs";
3
3
  import fg from "fast-glob";
4
4
 
@@ -1,7 +1,7 @@
1
- import { T as Integration } from "./telemetry-CLi7mjDP.js";
2
- import { n as ui } from "./ui-C4ncRJqd.js";
3
- import { m as listProjects, n as createApplication, s as createProject, y as platformLabel } from "./resources-CVrWwA1K.js";
4
- import { t as requireOrg } from "./org-B2gy9Pmu.js";
1
+ import { d as Integration } from "./output-D2Ax_hHL.js";
2
+ import { n as ui } from "./ui-Lqt_zFOr.js";
3
+ import { m as listProjects, n as createApplication, s as createProject, y as platformLabel } from "./resources-s64mBHaC.js";
4
+ import { t as requireOrg } from "./org-Cg25bcsj.js";
5
5
 
6
6
  //#region src/core/account/bind.ts
7
7
  const NEW = "__new__";
@@ -1,7 +1,8 @@
1
- import { i as track, n as maybeShowTelemetryNotice, o as isNonInteractive, y as API_HOST } from "./telemetry-CLi7mjDP.js";
2
- import { a as refreshUpdateCheck, c as writeJson, i as maybeNotifyUpdate, s as createCommandOutput } from "./update-CxP4fmMe.js";
3
- import { a as saveSession, i as loadSession, n as resolveAuthToken, o as NotLoggedInError } from "./token-DHRH8cxi.js";
4
- import { t as selectRenderer } from "./ui-C4ncRJqd.js";
1
+ import { a as API_HOST, i as writeJson, n as createCommandOutput, v as isNonInteractive } from "./output-D2Ax_hHL.js";
2
+ import { i as track, n as maybeShowTelemetryNotice } from "./telemetry-yJs7t0rt.js";
3
+ import { a as refreshUpdateCheck, i as maybeNotifyUpdate } from "./update-B4hoLAN-.js";
4
+ import { a as saveSession, i as loadSession, n as resolveAuthToken, o as NotLoggedInError } from "./token-GcbyH6G8.js";
5
+ import { r as useRenderer, t as selectRenderer } from "./ui-Lqt_zFOr.js";
5
6
  import pc from "picocolors";
6
7
  import { resolve } from "node:path";
7
8
 
@@ -57,54 +58,33 @@ var ApiUnreachableError = class extends Error {
57
58
  this.cause = cause;
58
59
  }
59
60
  };
60
- var SuperwallApi = class SuperwallApi {
61
- constructor(session) {
62
- this.session = session;
63
- }
64
- static of(session) {
65
- return new SuperwallApi(session);
66
- }
67
- static fromSession() {
68
- const session = loadSession();
69
- if (!session) throw new NotLoggedInError();
70
- return new SuperwallApi(session);
71
- }
72
- get org() {
73
- const override = process.env.SUPERWALL_ORG_ID;
74
- return {
75
- id: override ?? this.session.orgId,
76
- name: override ? void 0 : this.session.orgName,
77
- count: this.session.orgCount ?? 1
78
- };
79
- }
80
- get userEmail() {
81
- return this.session.userEmail;
82
- }
83
- setOrg(org) {
84
- this.session = {
85
- ...this.session,
86
- orgId: org.id,
87
- orgName: org.name
88
- };
89
- saveSession(this.session);
90
- }
91
- get host() {
92
- return process.env.SUPERWALL_API_HOST ?? this.session.host ?? API_HOST;
93
- }
94
- base() {
95
- return this.host;
96
- }
97
- async request(method, path, body) {
98
- const { token, session } = await resolveAuthToken(this.session);
99
- this.session = session;
100
- const res = await this.fetch(`${this.base()}${path}`, {
61
+ const PAGE_LIMIT = 50;
62
+ const createSuperwallApi = (initial) => {
63
+ let session = initial;
64
+ const host = () => process.env.SUPERWALL_API_HOST ?? session.host ?? API_HOST();
65
+ const send = async (url, init) => {
66
+ try {
67
+ return await fetch(url, init);
68
+ } catch (error) {
69
+ throw new ApiUnreachableError(host(), error);
70
+ }
71
+ };
72
+ const authorized = async () => {
73
+ const resolved = await resolveAuthToken(session);
74
+ session = resolved.session;
75
+ return resolved.token;
76
+ };
77
+ const request = async (method, path, body, options = {}) => {
78
+ const token = await authorized();
79
+ const res = await send(`${host()}${path}`, {
101
80
  method,
102
81
  headers: {
82
+ ...options.headers,
103
83
  authorization: `Bearer ${token}`,
104
84
  accept: "application/json",
105
- ...body ? { "content-type": "application/json" } : {}
85
+ ...body !== void 0 ? { "content-type": "application/json" } : {}
106
86
  },
107
- ...body ? { body: JSON.stringify(body) } : {}
87
+ ...body !== void 0 ? { body: JSON.stringify(body) } : {}
108
88
  });
109
89
  if (!res.ok) {
110
90
  const text = await res.text().catch(() => "");
@@ -112,58 +92,73 @@ var SuperwallApi = class SuperwallApi {
112
92
  }
113
93
  if (res.status === 204) return void 0;
114
94
  return await res.json();
115
- }
116
- async fetch(url, init) {
117
- try {
118
- return await fetch(url, init);
119
- } catch (error) {
120
- throw new ApiUnreachableError(this.base(), error);
121
- }
122
- }
123
- get(path) {
124
- return this.request("GET", path);
125
- }
126
- post(path, body) {
127
- return this.request("POST", path, body);
128
- }
129
- patch(path, body) {
130
- return this.request("PATCH", path, body);
131
- }
132
- del(path) {
133
- return this.request("DELETE", path);
134
- }
135
- async postText(path, body) {
136
- const { token, session } = await resolveAuthToken(this.session);
137
- this.session = session;
138
- const res = await this.fetch(`${this.base()}${path}`, {
139
- method: "POST",
140
- headers: {
141
- authorization: `Bearer ${token}`,
142
- accept: "text/plain",
143
- "content-type": "text/plain; charset=utf-8"
144
- },
145
- body
146
- });
147
- if (!res.ok) {
148
- const text = await res.text().catch(() => "");
149
- throw new ApiError(`POST ${path}`, res.status, text);
150
- }
151
- return res.text();
152
- }
153
- async list(path) {
154
- const out = [];
155
- let after;
156
- for (let i = 0; i < 50; i++) {
157
- const url = `${path}${path.includes("?") ? "&" : "?"}limit=100${after ? `&starting_after=${after}` : ""}`;
158
- const page = await this.get(url);
159
- out.push(...page.data);
160
- if (!page.has_more || page.data.length === 0) break;
161
- const last = page.data[page.data.length - 1];
162
- if (last?.id == null) break;
163
- after = String(last.id);
95
+ };
96
+ const api = {
97
+ get org() {
98
+ const override = process.env.SUPERWALL_ORG_ID;
99
+ return {
100
+ id: override ?? session.orgId,
101
+ name: override ? void 0 : session.orgName,
102
+ count: session.orgCount ?? 1
103
+ };
104
+ },
105
+ get userEmail() {
106
+ return session.userEmail;
107
+ },
108
+ get host() {
109
+ return host();
110
+ },
111
+ setOrg(org) {
112
+ session = {
113
+ ...session,
114
+ orgId: org.id,
115
+ orgName: org.name
116
+ };
117
+ saveSession(session);
118
+ },
119
+ get: (path, options) => request("GET", path, void 0, options),
120
+ post: (path, body, options) => request("POST", path, body, options),
121
+ put: (path, body, options) => request("PUT", path, body, options),
122
+ patch: (path, body, options) => request("PATCH", path, body, options),
123
+ del: (path, options) => request("DELETE", path, void 0, options),
124
+ async postText(path, body) {
125
+ const token = await authorized();
126
+ const res = await send(`${host()}${path}`, {
127
+ method: "POST",
128
+ headers: {
129
+ authorization: `Bearer ${token}`,
130
+ accept: "text/plain",
131
+ "content-type": "text/plain; charset=utf-8"
132
+ },
133
+ body
134
+ });
135
+ if (!res.ok) {
136
+ const text = await res.text().catch(() => "");
137
+ throw new ApiError(`POST ${path}`, res.status, text);
138
+ }
139
+ return res.text();
140
+ },
141
+ async list(path) {
142
+ const out = [];
143
+ let after;
144
+ for (let page = 0; page < PAGE_LIMIT; page++) {
145
+ const url = `${path}${path.includes("?") ? "&" : "?"}limit=100${after ? `&starting_after=${after}` : ""}`;
146
+ const batch = await api.get(url);
147
+ out.push(...batch.data);
148
+ if (!batch.has_more || batch.data.length === 0) break;
149
+ const last = batch.data[batch.data.length - 1];
150
+ if (last?.id == null) break;
151
+ after = String(last.id);
152
+ }
153
+ return out;
164
154
  }
165
- return out;
166
- }
155
+ };
156
+ return api;
157
+ };
158
+ const superwallApi = () => {
159
+ const session = loadSession();
160
+ if (!session) throw new NotLoggedInError();
161
+ return createSuperwallApi(session);
167
162
  };
168
163
 
169
164
  //#endregion
@@ -180,7 +175,7 @@ async function executeCommand(definition, argv, runtime = {}) {
180
175
  const outputMode = json ? "json" : environmentNonInteractive ? "text" : "rich";
181
176
  const interactive = definition.interaction !== "none" && !json && !explicitNonInteractive && !environmentNonInteractive;
182
177
  const installDir = resolve(argv.installDir ?? process.cwd());
183
- const ui = runtime.renderer?.(outputMode) ?? selectRenderer({ mode: outputMode });
178
+ const ui = runtime.renderer ? useRenderer(runtime.renderer(outputMode)) : selectRenderer({ mode: outputMode });
184
179
  const stdout = runtime.stdout ?? process.stdout;
185
180
  const output = createCommandOutput(outputMode, ui, { stdout });
186
181
  if (json && definition.output !== "json" && definition.output !== "both") {
@@ -199,7 +194,7 @@ async function executeCommand(definition, argv, runtime = {}) {
199
194
  track("workflow started", { workflow: definition.name });
200
195
  }
201
196
  try {
202
- const api = resolveApi(definition.auth ?? "none", runtime.api ?? SuperwallApi.fromSession);
197
+ const api = resolveApi(definition.auth ?? "none", runtime.api ?? superwallApi);
203
198
  const context = {
204
199
  argv,
205
200
  ui,
@@ -280,4 +275,4 @@ function normalizeError(error) {
280
275
  }
281
276
 
282
277
  //#endregion
283
- export { ApiError as n, SuperwallApi as r, defineCommand as t };
278
+ export { superwallApi as i, ApiError as n, createSuperwallApi as r, defineCommand as t };
@@ -1,22 +1,22 @@
1
- import "./telemetry-CLi7mjDP.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-CxP4fmMe.js";
4
- import "./token-DHRH8cxi.js";
5
- import { t as defineCommand } from "./command-CmJMNVVz.js";
6
- import "./ui-C4ncRJqd.js";
7
- import "./skills-HlIKA9xR.js";
1
+ import "./output-D2Ax_hHL.js";
2
+ import "./telemetry-yJs7t0rt.js";
3
+ import "./update-B4hoLAN-.js";
4
+ import "./token-GcbyH6G8.js";
5
+ import { t as defineCommand } from "./command-B7Te31wp.js";
6
+ import "./ui-Lqt_zFOr.js";
7
+ import "./skills-B-mR2CqM.js";
8
8
  import "./spawn-DSoTXy_j.js";
9
- import "./login-B7fSpJKc.js";
10
- import { n as allDeps, r as readPackageJson, t as scanProject } from "./scan-BfoeYW1v.js";
11
- import "./hosted-CbNJSJAC.js";
12
- import { t as detectExisting } from "./existing-p-hX-Nxc.js";
13
- import "./spinner-gOxIMz-V.js";
14
- import { f as listApplications, m as listProjects, n as createApplication, y as platformLabel } from "./resources-CVrWwA1K.js";
15
- import "./org-B2gy9Pmu.js";
16
- import { r as resolveScopeFromKey } from "./bind-DO11eXrR.js";
17
- import { a as projectPackageName, i as requireApi, l as requirePlatform, m as writeApp, r as LoginRequiredError, t as gitAvailable } from "./git-BrTxQ7ui.js";
18
- import "./actions-I5gVO5jN.js";
19
- import "./app-DE9lxNNV.js";
9
+ import "./login-DOES7Kup.js";
10
+ import { n as allDeps, r as readPackageJson, t as scanProject } from "./scan-Dk0ZlCY6.js";
11
+ import "./hosted-vk05ZF6w.js";
12
+ import { t as detectExisting } from "./existing-B-e22WOr.js";
13
+ import "./spinner-B9dT3DBY.js";
14
+ import { f as listApplications, m as listProjects, n as createApplication, y as platformLabel } from "./resources-s64mBHaC.js";
15
+ import "./org-Cg25bcsj.js";
16
+ import { r as resolveScopeFromKey } from "./bind-BbzBenoP.js";
17
+ import { a as projectPackageName, i as requireApi, l as requirePlatform, m as writeApp, r as LoginRequiredError, t as gitAvailable } from "./git-2wRxiwOc.js";
18
+ import "./actions-DvHycH3X.js";
19
+ import "./app-FiC9SQVp.js";
20
20
  import pc from "picocolors";
21
21
  import { promisify } from "node:util";
22
22
  import * as fs from "node:fs";
@@ -1,22 +1,22 @@
1
- import { k as VERSION } from "./telemetry-CLi7mjDP.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-CxP4fmMe.js";
4
- import "./token-DHRH8cxi.js";
5
- import { t as defineCommand } from "./command-CmJMNVVz.js";
6
- import { n as ui } from "./ui-C4ncRJqd.js";
7
- import "./skills-HlIKA9xR.js";
1
+ import { g as VERSION } from "./output-D2Ax_hHL.js";
2
+ import "./telemetry-yJs7t0rt.js";
3
+ import "./update-B4hoLAN-.js";
4
+ import "./token-GcbyH6G8.js";
5
+ import { t as defineCommand } from "./command-B7Te31wp.js";
6
+ import { n as ui } from "./ui-Lqt_zFOr.js";
7
+ import "./skills-B-mR2CqM.js";
8
8
  import "./spawn-DSoTXy_j.js";
9
- import "./login-B7fSpJKc.js";
10
- import "./scan-BfoeYW1v.js";
11
- import "./hosted-CbNJSJAC.js";
12
- import "./spinner-gOxIMz-V.js";
13
- import { S as pushPaywallVersion, T as versionProducts, b as promotePaywallVersion, f as listApplications } from "./resources-CVrWwA1K.js";
14
- import "./org-B2gy9Pmu.js";
15
- import "./bind-DO11eXrR.js";
16
- import { f as readLock, i as requireApi, o as writeProjectScaffold, u as resolveApps } from "./git-BrTxQ7ui.js";
17
- import "./actions-I5gVO5jN.js";
18
- import "./app-DE9lxNNV.js";
19
- import { C as syncAssets, D as writeProjectTypes, E as collectProjectDeclarations, S as requireAssets, T as loadFramework, _ as planTargets, a as requireProject, b as resolveBinding, d as pushSource, f as collectSourceFiles, h as projectForApplication, i as projectDirs, m as fetchProducts, p as warnNotPortable, r as projectDir, t as LAYOUT_HINT, w as frameworkVersion, x as assetBaseUrl, y as wantedPlatforms } from "./pipeline-COr4sB6U.js";
9
+ import "./login-DOES7Kup.js";
10
+ import "./scan-Dk0ZlCY6.js";
11
+ import "./hosted-vk05ZF6w.js";
12
+ import "./spinner-B9dT3DBY.js";
13
+ import { S as pushPaywallVersion, T as versionProducts, b as promotePaywallVersion, f as listApplications } from "./resources-s64mBHaC.js";
14
+ import "./org-Cg25bcsj.js";
15
+ import "./bind-BbzBenoP.js";
16
+ import { f as readLock, i as requireApi, o as writeProjectScaffold, u as resolveApps } from "./git-2wRxiwOc.js";
17
+ import "./actions-DvHycH3X.js";
18
+ import "./app-FiC9SQVp.js";
19
+ import { C as syncAssets, D as writeProjectTypes, E as collectProjectDeclarations, S as requireAssets, T as loadFramework, _ as planTargets, a as projectDir, b as resolveBinding, d as pushSource, f as collectSourceFiles, h as projectForApplication, l as LAYOUT_HINT, m as fetchProducts, o as projectDirs, p as warnNotPortable, s as requireProject, w as frameworkVersion, x as assetBaseUrl, y as wantedPlatforms } from "./pipeline-BVeUA6Ig.js";
20
20
  import pc from "picocolors";
21
21
  import * as fs from "node:fs";
22
22
  import * as path from "node:path";
@@ -132,11 +132,29 @@ const detectLocalScheme = async (roots) => {
132
132
  }
133
133
  }
134
134
  };
135
+ const APP_MARKERS = [
136
+ "package.json",
137
+ "app.json",
138
+ "app.config.json",
139
+ "Podfile",
140
+ "ios",
141
+ "android",
142
+ ".git"
143
+ ];
144
+ const looksLikeAppRoot = (dir) => {
145
+ if (APP_MARKERS.some((marker) => fs.existsSync(path.join(dir, marker)))) return true;
146
+ try {
147
+ return fs.readdirSync(dir).some((entry) => entry.endsWith(".xcodeproj") || entry.endsWith(".xcworkspace"));
148
+ } catch {
149
+ return false;
150
+ }
151
+ };
135
152
  const schemeSearchRoots = (project) => {
136
153
  const root = path.resolve(project.root);
137
154
  const superwallDir = path.resolve(project.superwallDir);
138
155
  const roots = [root];
139
- if (root === superwallDir) roots.push(path.dirname(root));
156
+ const parent = path.dirname(root);
157
+ if (root === superwallDir && parent !== root && looksLikeAppRoot(parent)) roots.push(parent);
140
158
  return roots;
141
159
  };
142
160
  const appScheme = async (roots, remote) => {
@@ -1,14 +1,14 @@
1
- import { a as apiKeyFromEnv } from "./telemetry-CLi7mjDP.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-CxP4fmMe.js";
4
- import { i as loadSession } from "./token-DHRH8cxi.js";
5
- import { t as defineCommand } from "./command-CmJMNVVz.js";
6
- import { a as fg, i as THEME, n as ui } from "./ui-C4ncRJqd.js";
1
+ import { _ as apiKeyFromEnv } from "./output-D2Ax_hHL.js";
2
+ import "./telemetry-yJs7t0rt.js";
3
+ import "./update-B4hoLAN-.js";
4
+ import { i as loadSession } from "./token-GcbyH6G8.js";
5
+ import { t as defineCommand } from "./command-B7Te31wp.js";
6
+ import { a as THEME, n as ui, o as fg } from "./ui-Lqt_zFOr.js";
7
7
  import "./spawn-DSoTXy_j.js";
8
- import { t as scanProject } from "./scan-BfoeYW1v.js";
9
- import { t as detectDrivers } from "./drivers-Cweb9bWA.js";
10
- import "./hosted-CbNJSJAC.js";
11
- import { t as detectExisting } from "./existing-p-hX-Nxc.js";
8
+ import { t as scanProject } from "./scan-Dk0ZlCY6.js";
9
+ import { t as detectDrivers } from "./drivers-ItOmKzrw.js";
10
+ import "./hosted-vk05ZF6w.js";
11
+ import { t as detectExisting } from "./existing-B-e22WOr.js";
12
12
 
13
13
  //#region src/commands/account/doctor.ts
14
14
  const runDoctor = defineCommand({
@@ -1,6 +1,6 @@
1
- import { k as VERSION } from "./telemetry-CLi7mjDP.js";
1
+ import { g as VERSION } from "./output-D2Ax_hHL.js";
2
2
  import { n as readVersion, r as spawnStream, t as onPath } from "./spawn-DSoTXy_j.js";
3
- import { n as getHostedAuthToken, r as getHostedStatus, t as getHostedAnthropicBaseUrl } from "./hosted-CbNJSJAC.js";
3
+ import { n as getHostedAuthToken, r as getHostedStatus, t as getHostedAnthropicBaseUrl } from "./hosted-vk05ZF6w.js";
4
4
  import { tmpdir } from "node:os";
5
5
  import { basename, join } from "node:path";
6
6
  import { readFile, rm } from "node:fs/promises";