@superwall/cli 2.2.1 → 2.3.1

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 (87) hide show
  1. package/README.md +24 -11
  2. package/dist/{apple-DaqaI4vD.js → apple-z2qjOzIZ.js} +13 -13
  3. package/dist/assets-DXXegdDt.js +89 -0
  4. package/dist/auth.d.ts +1 -1
  5. package/dist/auth.js +3 -3
  6. package/dist/{billing-DyKr2kmd.js → billing-B8tOjsnY.js} +3 -3
  7. package/dist/{bind-BpxebZf4.js → bind-Bx9K6LwP.js} +4 -4
  8. package/dist/{build-DzbdRThf.js → build-Bu2kkzRe.js} +7 -6
  9. package/dist/{client-BF9rCULI.js → client-DOgk9gAS.js} +3 -3
  10. package/dist/{create-D7AZHYGH.js → create-B03MAuPe.js} +6 -6
  11. package/dist/create-BdZS_T68.js +19 -0
  12. package/dist/{create-B55V99TD.js → create-DzC_89gq.js} +28 -226
  13. package/dist/{doctor-B2mPKiaJ.js → doctor-BGZSKY_B.js} +6 -6
  14. package/dist/{drivers-DOMky8Ug.js → drivers-DqLgQxkC.js} +3 -3
  15. package/dist/entry.js +19 -19
  16. package/dist/{environment-DBwo79dy.js → environment-i8BhiBDB.js} +1 -1
  17. package/dist/{existing-B4VK4BCL.js → existing-BPOG5zLO.js} +2 -2
  18. package/dist/{held-DjcZPCwn.js → held-C56PYMRH.js} +6 -6
  19. package/dist/held-DSNUY-NZ.js +16 -0
  20. package/dist/{integrate-B8oHbvwz.js → integrate-DZ4Qvoch.js} +22 -22
  21. package/dist/login-Blrkm6oi.js +16 -0
  22. package/dist/{login-DfhqWY9C.js → login-ONZdK8vN.js} +6 -6
  23. package/dist/{login-B8hgMLhS.js → login-p9GVEKzD.js} +1 -1
  24. package/dist/{lookup-r8p6H2ZC.js → lookup-flTi0at0.js} +2 -2
  25. package/dist/{migrate-DQf2Fosc.js → migrate-DnXpbhL1.js} +25 -22
  26. package/dist/{open-CrEnSL4v.js → migration-DJ1uNKhk.js} +11 -49
  27. package/dist/{notification-url-BxPTEmkv.js → notification-url-CCDeS5S-.js} +2 -2
  28. package/dist/open-QdsZ_N47.js +41 -0
  29. package/dist/{org-Cc2WGvl1.js → org-BiFPjoHD.js} +2 -2
  30. package/dist/{paths-BcNbJfpw.js → paths-yRgm5Jpa.js} +1 -1
  31. package/dist/{playbook-D9J8frkE.js → playbook-B-pRKNa4.js} +10 -10
  32. package/dist/{promote-C8T7DCFF.js → promote-Djzk4C81.js} +18 -16
  33. package/dist/pull-BLA9XwHj.js +303 -0
  34. package/dist/push-BkMgOT6X.js +24 -0
  35. package/dist/{push-Bzs1l_5C.js → push-gSBxGDik.js} +8 -6
  36. package/dist/{registry-CpxZbmxp.js → registry-D3xmWk9p.js} +230 -115
  37. package/dist/{resources-Bo6i7wBi.js → resources-BTnczJCA.js} +21 -7
  38. package/dist/{run-BUp4r8Kk.js → run-C1SoizcJ.js} +2 -2
  39. package/dist/{scan-8cxu2fx0.js → scan-Dwk_lT5q.js} +1 -1
  40. package/dist/scan-Kp-MAutK.js +4 -0
  41. package/dist/{scope-CPG_wWXL.js → scope-Db7blD-l.js} +5 -4
  42. package/dist/{selection-CMA4aG4V.js → selection-u2KiKu_d.js} +16 -96
  43. package/dist/{server-Xb3wp-mx.js → server-Cb2N75JL.js} +9 -7
  44. package/dist/server-psYghr9K.js +24 -0
  45. package/dist/{session-eZeXR9xU.js → session-BDLQUJyV.js} +444 -243
  46. package/dist/session-CehHJWZk.js +6 -0
  47. package/dist/{session-DOZV1TP6.js → session-CnDJp_HO.js} +1 -1
  48. package/dist/setup-BLahHpgy.js +216 -0
  49. package/dist/skills/animate-onboarding/SKILL.md +1 -1
  50. package/dist/skills/mobile-design/SKILL.md +1 -1
  51. package/dist/skills/onboarding-questions/SKILL.md +1 -1
  52. package/dist/skills/superwall/SKILL.md +6 -7
  53. package/dist/skills/superwall/references/api.md +8 -3
  54. package/dist/skills/superwall/workflows/dashboard/playbook.md +4 -3
  55. package/dist/skills/superwall/workflows/dashboard/setup.md +7 -4
  56. package/dist/skills/superwall/workflows/migrate/adapty.md +4 -3
  57. package/dist/skills/superwall/workflows/migrate/playbook.md +2 -2
  58. package/dist/skills/superwall/workflows/migrate/qonversion.md +4 -3
  59. package/dist/skills/superwall/workflows/migrate/revenuecat.md +4 -3
  60. package/dist/skills/superwall-editor/SKILL.md +2 -3
  61. package/dist/skills/superwall-framework/SKILL.md +83 -13
  62. package/dist/skills/superwall-framework/references/cli.md +92 -21
  63. package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -1
  64. package/dist/{skills-BI19OGlS.js → skills-DDV4zcLR.js} +8 -8
  65. package/dist/{skills-DDf10ufO.js → skills-zebMTZyr.js} +4 -4
  66. package/dist/source-push-DxuJuwEf.js +205 -0
  67. package/dist/{spinner-BClMQGGN.js → spinner-BN3U1CVB.js} +3 -3
  68. package/dist/{storage-Po9E-CHL.js → storage-VagEaaJC.js} +1 -1
  69. package/dist/storekit-BcBb2jXB.js +16 -0
  70. package/dist/{storekit-Cbn9DBLA.js → storekit-CoOf4Rvh.js} +3 -3
  71. package/dist/{telemetry-s6dag6tb.js → telemetry-CM0BDwCK.js} +1 -1
  72. package/dist/{token-CPplNMVa.js → token-lUUOkTJA.js} +1 -1
  73. package/dist/tools.d.ts +1 -1
  74. package/dist/tools.js +215 -89
  75. package/dist/{upgrade-1OYm5NQU.js → upgrade-CpTJv_M7.js} +2 -2
  76. package/dist/{upgrade-ahapZeex.js → upgrade-DZbKb67W.js} +1 -1
  77. package/package.json +2 -2
  78. package/dist/create-BYAPuhhf.js +0 -19
  79. package/dist/held-C9FqvNbn.js +0 -16
  80. package/dist/login-D-a7oS_8.js +0 -16
  81. package/dist/push-snV3SrnH.js +0 -22
  82. package/dist/scan-nUeXs9a1.js +0 -4
  83. package/dist/server-Boqa8jh_.js +0 -22
  84. package/dist/session-DtBpdlF-.js +0 -6
  85. package/dist/storekit-BU6Eq_UO.js +0 -16
  86. /package/dist/{reports-D_qbl7_u.js → reports-CwwKLUh0.js} +0 -0
  87. /package/dist/{storage-BbJF7z3l.d.ts → storage-gRyQetN9.d.ts} +0 -0
@@ -0,0 +1,303 @@
1
+ import "./token-lUUOkTJA.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import { v as VERSION } from "./environment-i8BhiBDB.js";
4
+ import "./storage-VagEaaJC.js";
5
+ import "./client-DOgk9gAS.js";
6
+ import "./config-BO1Y87kV.js";
7
+ import "./telemetry-CM0BDwCK.js";
8
+ import "./spawn-DmmmHIP-.js";
9
+ import "./spinner-BN3U1CVB.js";
10
+ import { n as ui } from "./ui-D_qf3Gvw.js";
11
+ import "./theme-DUsCh-Vd.js";
12
+ import "./log-NVhVe_oe.js";
13
+ import "./scan-Dwk_lT5q.js";
14
+ import "./existing-BPOG5zLO.js";
15
+ import "./paths-yRgm5Jpa.js";
16
+ import { f as listAppPaywalls, v as mintSourceAccess } from "./resources-BTnczJCA.js";
17
+ import "./org-BiFPjoHD.js";
18
+ import { n as findApplication, t as appNotFound } from "./lookup-flTi0at0.js";
19
+ import "./bind-Bx9K6LwP.js";
20
+ import "./login-ONZdK8vN.js";
21
+ import "./skills-zebMTZyr.js";
22
+ import { D as parseLock, P as writeLock, a as resolveProjectDir, b as writeProjectTypes, i as requireProject, k as readLock, v as TYPES_FILE, x as NewerLockError, y as collectProjectDeclarations, z as resolveFramework } from "./selection-u2KiKu_d.js";
23
+ import { _ as requirePlatform, c as writeSourceBase, f as parsePlatformFlags, g as PLATFORMS, i as pullSourceTree, l as collectSourceFiles, n as requireApi, o as statIfPresent, s as readSourceBase } from "./session-BDLQUJyV.js";
24
+ import "./login-p9GVEKzD.js";
25
+ import "./run-C1SoizcJ.js";
26
+ import "./drivers-DqLgQxkC.js";
27
+ import "./migration-DJ1uNKhk.js";
28
+ import { a as devCommand, i as detectPackageManager } from "./setup-BLahHpgy.js";
29
+ import * as fs from "node:fs";
30
+ import * as path from "node:path";
31
+ import pc from "picocolors";
32
+
33
+ //#region src/core/paywalls/pull.ts
34
+ function appsToPull(lock, only) {
35
+ for (const platform of only) if (!PLATFORMS.some((known) => known === platform)) throw new Error(`"${platform}" is not a platform — use one of ${PLATFORMS.join(", ")}.`);
36
+ const byApp = /* @__PURE__ */ new Map();
37
+ for (const [platform, applicationId] of Object.entries(lock.apps)) {
38
+ if (only.length > 0 && !only.includes(platform)) continue;
39
+ byApp.set(applicationId, [...byApp.get(applicationId) ?? [], platform]);
40
+ }
41
+ return [...byApp].map(([applicationId, platforms]) => ({
42
+ applicationId,
43
+ platforms
44
+ }));
45
+ }
46
+ function boundPaywall(lock, platforms) {
47
+ for (const section of [lock.paywalls, lock.funnels]) for (const bindings of Object.values(section)) for (const platform of platforms) {
48
+ const binding = bindings[platform];
49
+ if (binding) return binding.paywallId;
50
+ }
51
+ }
52
+ const mergeSection = (local, remote) => {
53
+ const merged = {};
54
+ for (const id of new Set([...Object.keys(remote), ...Object.keys(local)])) {
55
+ const mine = local[id] ?? {};
56
+ const theirs = remote[id] ?? {};
57
+ const bindings = {};
58
+ for (const platform of new Set([...Object.keys(theirs), ...Object.keys(mine)])) {
59
+ const own = mine[platform];
60
+ const other = theirs[platform];
61
+ const chosen = !other || own && (own.sourcePending !== void 0 || own.paywallId !== other.paywallId) ? own : other;
62
+ if (chosen) bindings[platform] = chosen;
63
+ }
64
+ merged[id] = bindings;
65
+ }
66
+ return merged;
67
+ };
68
+ function sharedPlatforms(local, remote, platforms) {
69
+ const shared = /* @__PURE__ */ new Set();
70
+ for (const [platform, applicationId] of Object.entries(remote.apps)) {
71
+ if (platforms !== void 0 && !platforms.includes(platform)) continue;
72
+ const mine = local.apps[platform];
73
+ if (mine !== void 0 && mine !== applicationId) continue;
74
+ shared.add(platform);
75
+ }
76
+ return shared;
77
+ }
78
+ const onlyPlatforms = (section, allowed) => {
79
+ const kept = {};
80
+ for (const [id, bindings] of Object.entries(section)) {
81
+ const entries = Object.entries(bindings).filter(([platform]) => allowed.has(platform));
82
+ if (entries.length > 0) kept[id] = Object.fromEntries(entries);
83
+ }
84
+ return kept;
85
+ };
86
+ function mergePulledLock(local, remoteText, platforms) {
87
+ if (remoteText === void 0) return local;
88
+ let remote;
89
+ try {
90
+ remote = parseLock(remoteText, "The source repo's superwall.lock");
91
+ } catch (error) {
92
+ if (error instanceof NewerLockError) throw error;
93
+ ui.warn(`The source repo's superwall.lock can't be read (${error instanceof Error ? error.message : String(error)}) — kept your bindings as they are.`);
94
+ return local;
95
+ }
96
+ const allowed = sharedPlatforms(local, remote, platforms);
97
+ const merged = {
98
+ version: 1,
99
+ apps: {
100
+ ...Object.fromEntries(Object.entries(remote.apps).filter(([platform]) => allowed.has(platform))),
101
+ ...local.apps
102
+ },
103
+ paywalls: mergeSection(local.paywalls, onlyPlatforms(remote.paywalls, allowed)),
104
+ funnels: mergeSection(local.funnels, onlyPlatforms(remote.funnels, allowed))
105
+ };
106
+ const origins = {
107
+ ...remote.origins,
108
+ ...local.origins
109
+ };
110
+ if (Object.keys(origins).length > 0) merged.origins = origins;
111
+ if (local.sources) merged.sources = local.sources;
112
+ return merged;
113
+ }
114
+ var PullPathError = class extends Error {};
115
+ function assertInside(superwallDir, relative$1) {
116
+ const parts = relative$1.split("/");
117
+ if (parts.some((part) => part === "" || part === "." || part === "..")) throw new PullPathError(`The source repo has an unsafe path, ${relative$1} — nothing was pulled.`);
118
+ for (let depth = 1; depth <= parts.length; depth++) {
119
+ const at = path.join(superwallDir, ...parts.slice(0, depth));
120
+ const stat = fs.lstatSync(at, { throwIfNoEntry: false });
121
+ if (stat === void 0) return;
122
+ if (!stat.isSymbolicLink() && !stat.isDirectory()) return;
123
+ if (stat.isSymbolicLink()) throw new PullPathError(`${parts.slice(0, depth).join("/")} is a symlink in this project, so the CLI won't write ${relative$1} through it — nothing was pulled. Replace the symlink with a folder, then pull again.`);
124
+ }
125
+ }
126
+ function pruneEmpty(superwallDir, from) {
127
+ let dir = path.dirname(from);
128
+ while (dir.startsWith(superwallDir + path.sep) && fs.existsSync(dir) && fs.readdirSync(dir).length === 0) {
129
+ fs.rmdirSync(dir);
130
+ dir = path.dirname(dir);
131
+ }
132
+ }
133
+ function blockedByFile(superwallDir, relative$1, deleting) {
134
+ const parts = relative$1.split("/");
135
+ for (let depth = 1; depth < parts.length; depth++) {
136
+ const prefix = parts.slice(0, depth).join("/");
137
+ const stat = statIfPresent(path.join(superwallDir, prefix));
138
+ if (stat === void 0) return false;
139
+ if (stat.isDirectory()) continue;
140
+ return !deleting.has(prefix);
141
+ }
142
+ return false;
143
+ }
144
+ function applyPulledChanges(superwallDir, changes, tracked) {
145
+ for (const change of changes) assertInside(superwallDir, change.path);
146
+ const skipped = [];
147
+ const planned = [];
148
+ const removing = new Set(changes.filter((change) => change.content === void 0 && tracked.has(change.path)).map((change) => change.path));
149
+ const cleared = (relative$1) => fs.readdirSync(path.join(superwallDir, relative$1), {
150
+ recursive: true,
151
+ withFileTypes: true
152
+ }).filter((entry) => !entry.isDirectory()).every((entry) => removing.has(path.relative(superwallDir, path.join(entry.parentPath, entry.name)).split(path.sep).join("/")));
153
+ for (const change of changes) {
154
+ const existing = statIfPresent(path.join(superwallDir, change.path));
155
+ if (!tracked.has(change.path) && existing !== void 0 && !(existing.isDirectory() && change.content !== void 0 && cleared(change.path))) skipped.push(change.path);
156
+ else planned.push(change);
157
+ }
158
+ const deleting = new Set(planned.filter((change) => change.content === void 0).map((change) => change.path));
159
+ const applied = planned.filter((change) => {
160
+ if (!blockedByFile(superwallDir, change.path, deleting)) return true;
161
+ skipped.push(change.path);
162
+ return false;
163
+ });
164
+ const ordered = [...applied.filter((change) => change.content === void 0), ...applied.filter((change) => change.content !== void 0)];
165
+ const written = [];
166
+ for (const change of ordered) {
167
+ const target = path.join(superwallDir, change.path);
168
+ if (change.content === void 0) {
169
+ fs.rmSync(target, { force: true });
170
+ pruneEmpty(superwallDir, target);
171
+ } else {
172
+ if (statIfPresent(target)?.isDirectory()) fs.rmSync(target, { recursive: true });
173
+ fs.mkdirSync(path.dirname(target), { recursive: true });
174
+ fs.writeFileSync(target, change.content);
175
+ }
176
+ written.push(change.path);
177
+ }
178
+ return {
179
+ written: written.sort(),
180
+ skipped: skipped.sort()
181
+ };
182
+ }
183
+ async function paywallFor(api, lock, app) {
184
+ const bound = boundPaywall(lock, app.platforms);
185
+ if (bound) return bound;
186
+ return (await firstHeadlessPaywall(api, app.applicationId))?.id;
187
+ }
188
+ async function firstHeadlessPaywall(api, applicationId) {
189
+ return (await listAppPaywalls(api, applicationId)).find((paywall) => paywall.metadata.headless === "true");
190
+ }
191
+ const SHOWN = 8;
192
+ const describeChanges = (files) => [...files.slice(0, SHOWN).map((file) => ` ${pc.dim(file)}`), ...files.length > SHOWN ? [` ${pc.dim(`and ${files.length - SHOWN} more`)}`] : []];
193
+ const LOCK_FILE = "superwall.lock";
194
+ function cloneTarget(root) {
195
+ if (fs.existsSync(path.join(root, LOCK_FILE))) throw new Error(`\`${root}\` is already a superwall project — run \`superwall pull\` there without --app.`);
196
+ const superwallDir = path.join(root, "superwall");
197
+ if (fs.existsSync(superwallDir) && fs.readdirSync(superwallDir).length > 0) throw new Error(fs.existsSync(path.join(superwallDir, LOCK_FILE)) ? `\`${superwallDir}\` is already a superwall project — run \`superwall pull\` there without --app.` : `\`${superwallDir}\` already has files — pull --app only fills an empty folder; pick another directory.`);
198
+ return superwallDir;
199
+ }
200
+ async function pullInto(superwallDir, access, theirs, platforms) {
201
+ const collected = await collectSourceFiles(superwallDir);
202
+ if (!collected.ok) throw new Error(collected.reason);
203
+ const { files } = collected;
204
+ const pulled = await pullSourceTree({
205
+ access,
206
+ files,
207
+ base: readSourceBase(superwallDir, access.repo),
208
+ theirs
209
+ });
210
+ if (pulled.status === "empty") return void 0;
211
+ const lock = mergePulledLock(readLock(superwallDir), pulled.lock, platforms);
212
+ const applied = applyPulledChanges(superwallDir, pulled.changes, new Set(files.map((file) => file.path)));
213
+ writeLock(superwallDir, lock);
214
+ writeSourceBase(superwallDir, access.repo, pulled.head);
215
+ return applied;
216
+ }
217
+ async function cloneInto(superwallDir, access, apps) {
218
+ const pulled = await pullSourceTree({
219
+ access,
220
+ files: []
221
+ });
222
+ if (pulled.status === "empty") return void 0;
223
+ const lock = mergePulledLock({
224
+ version: 1,
225
+ apps,
226
+ paywalls: {},
227
+ funnels: {}
228
+ }, pulled.lock);
229
+ const created = !fs.existsSync(superwallDir);
230
+ fs.mkdirSync(superwallDir, { recursive: true });
231
+ let written;
232
+ try {
233
+ ({written} = applyPulledChanges(superwallDir, pulled.changes, /* @__PURE__ */ new Set()));
234
+ } catch (error) {
235
+ if (created) fs.rmSync(superwallDir, {
236
+ recursive: true,
237
+ force: true
238
+ });
239
+ else for (const entry of fs.readdirSync(superwallDir)) fs.rmSync(path.join(superwallDir, entry), {
240
+ recursive: true,
241
+ force: true
242
+ });
243
+ throw error;
244
+ }
245
+ if (pulled.types !== void 0) fs.writeFileSync(path.join(superwallDir, TYPES_FILE), pulled.types);
246
+ writeLock(superwallDir, lock);
247
+ writeSourceBase(superwallDir, access.repo, pulled.head);
248
+ return written;
249
+ }
250
+ async function runClone(appRef, root, flags, api) {
251
+ if (flags.theirs || flags.platform.length > 0) throw new Error("--app sets up a new folder from the app's source — drop --theirs and --platform.");
252
+ const superwallDir = cloneTarget(root);
253
+ const found = await findApplication(api, appRef);
254
+ if (!found) throw appNotFound(appRef);
255
+ const applicationId = String(found.app.id);
256
+ const platform = requirePlatform(found.app);
257
+ const paywall = await firstHeadlessPaywall(api, applicationId);
258
+ if (!paywall) throw new Error(`App ${applicationId} has no code paywall on Superwall yet, so it has no source to pull — start one with \`superwall create --app ${applicationId}\`.`);
259
+ ui.intro(`Superwall ${pc.dim(`v${VERSION}`)}`);
260
+ const written = await cloneInto(superwallDir, await mintSourceAccess(api, paywall.id), { [platform]: applicationId });
261
+ if (written === void 0) throw new Error(`App ${applicationId}'s source repo is empty — nobody has pushed from code yet. Start a project with \`superwall create --app ${applicationId}\`.`);
262
+ const manager = await detectPackageManager(superwallDir);
263
+ const where = path.relative(process.cwd(), superwallDir) || ".";
264
+ ui.info([`${pc.bold(`${platform} app ${applicationId}`)} pulled ${written.length} ${written.length === 1 ? "file" : "files"} into ${where}`, ...describeChanges(written)].join("\n"));
265
+ ui.outro(`Next: cd ${where} && ${manager} install && ${devCommand(manager)}`);
266
+ }
267
+ async function runPull(ctx, { args, flags }) {
268
+ const api = await requireApi(ctx.interactive);
269
+ const dir = resolveProjectDir(args.dir);
270
+ if (flags.app !== void 0) return runClone(flags.app, dir, flags, api);
271
+ const framework = await resolveFramework(dir);
272
+ const { superwallDir } = requireProject(framework.discoverProject(dir), dir);
273
+ const apps = appsToPull(readLock(superwallDir), parsePlatformFlags(flags.platform));
274
+ if (apps.length === 0) throw new Error(flags.platform.length > 0 ? `superwall.lock binds no app for ${parsePlatformFlags(flags.platform).join(", ")} — drop --platform or push to it first.` : "superwall.lock binds no app yet, so there is no source repo to pull from — push once to connect one.");
275
+ ui.intro(`Superwall ${pc.dim(`v${VERSION}`)}`);
276
+ let changed = false;
277
+ for (const app of apps) {
278
+ const label = `${app.platforms.join(", ")} app ${app.applicationId}`;
279
+ const paywallId = await paywallFor(api, readLock(superwallDir), app);
280
+ if (!paywallId) {
281
+ ui.step(`${label}: no code paywall on Superwall yet — nothing to pull`);
282
+ continue;
283
+ }
284
+ const pulled = await pullInto(superwallDir, await mintSourceAccess(api, paywallId), flags.theirs, flags.platform.length > 0 ? app.platforms : void 0);
285
+ if (pulled === void 0) {
286
+ ui.step(`${label}: its source repo is empty — nothing to pull yet`);
287
+ continue;
288
+ }
289
+ const { written, skipped } = pulled;
290
+ if (written.length > 0) changed = true;
291
+ if (skipped.length > 0) ui.warn(`Left ${skipped.join(", ")} as they are: they're ignored here and would overwrite your local copies.`);
292
+ if (written.length === 0) ui.step(`${label}: already up to date`);
293
+ else ui.info([`${pc.bold(label)} pulled ${written.length} ${written.length === 1 ? "file" : "files"}`, ...describeChanges(written)].join("\n"));
294
+ }
295
+ if (changed) {
296
+ const refreshed = framework.discoverProject(dir);
297
+ writeProjectTypes(refreshed, (await collectProjectDeclarations(framework, refreshed.root)).products);
298
+ }
299
+ ui.outro("Pulled. Publish from here: your next push merges on top of what you pulled.");
300
+ }
301
+
302
+ //#endregion
303
+ export { PullPathError, applyPulledChanges, appsToPull, boundPaywall, cloneInto, cloneTarget, mergePulledLock, pullInto, runPull };
@@ -0,0 +1,24 @@
1
+ import "./token-lUUOkTJA.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-i8BhiBDB.js";
4
+ import "./storage-VagEaaJC.js";
5
+ import "./client-DOgk9gAS.js";
6
+ import "./config-BO1Y87kV.js";
7
+ import "./telemetry-CM0BDwCK.js";
8
+ import "./spawn-DmmmHIP-.js";
9
+ import "./spinner-BN3U1CVB.js";
10
+ import "./ui-D_qf3Gvw.js";
11
+ import "./scan-Dwk_lT5q.js";
12
+ import "./paths-yRgm5Jpa.js";
13
+ import "./resources-BTnczJCA.js";
14
+ import "./lookup-flTi0at0.js";
15
+ import "./login-ONZdK8vN.js";
16
+ import "./skills-zebMTZyr.js";
17
+ import "./assets-DXXegdDt.js";
18
+ import "./selection-u2KiKu_d.js";
19
+ import "./session-BDLQUJyV.js";
20
+ import "./source-push-DxuJuwEf.js";
21
+ import { i as timed, n as runPush, r as runPushPipeline, t as group } from "./push-gSBxGDik.js";
22
+ import "./login-p9GVEKzD.js";
23
+
24
+ export { group, runPush, runPushPipeline, timed };
@@ -1,8 +1,10 @@
1
- import { v as VERSION } from "./environment-DBwo79dy.js";
1
+ import { v as VERSION } from "./environment-i8BhiBDB.js";
2
2
  import { n as ui } from "./ui-D_qf3Gvw.js";
3
- import { C as pushedProducts, E as versionProducts, S as pushPaywallVersion, b as promotePaywallVersion, h as livePaywall, v as platformLabel, y as platformStore } from "./resources-Bo6i7wBi.js";
4
- import { A as writeSnapshot, F as requireAssets, I as syncAssets, M as frameworkVersion, N as resolveFramework, O as writeBindings, P as assetBaseUrl, T as removeBinding, _ as weight, a as resolveProjectDir, b as describeBindings, c as storesDiffer, d as kb, f as pendingPromoteWarning, g as transition, h as took, i as requireProject, l as BIND_VERB, m as resolveNote, p as pushedLine, r as requireClean, s as selectSurfaces, t as needsWork, v as collectProjectDeclarations, w as readLock, y as writeProjectTypes } from "./selection-CMA4aG4V.js";
5
- import { _ as targetLabel, d as listProjectCatalogue, g as planTargets, h as parsePlatformFlags, i as pushSource, l as writeProjectScaffold, m as requireProducts, n as requireApi, o as collectSourceFiles, p as projectForApplication, r as assertGit, s as warnNotPortable, v as wantedPlatforms, x as resolveApps, y as resolveBinding } from "./session-eZeXR9xU.js";
3
+ import { C as pushPaywallVersion, D as versionProducts, b as platformStore, g as livePaywall, w as pushedProducts, x as promotePaywallVersion, y as platformLabel } from "./resources-BTnczJCA.js";
4
+ import { n as requireAssets, r as syncAssets, t as assetBaseUrl } from "./assets-DXXegdDt.js";
5
+ import { A as removeBinding, I as writeSnapshot, N as writeBindings, R as frameworkVersion, S as describeBindings, _ as weight, a as resolveProjectDir, b as writeProjectTypes, c as storesDiffer, d as kb, f as pendingPromoteWarning, g as transition, h as took, i as requireProject, k as readLock, l as BIND_VERB, m as resolveNote, p as pushedLine, r as requireClean, s as selectSurfaces, t as needsWork, y as collectProjectDeclarations, z as resolveFramework } from "./selection-u2KiKu_d.js";
6
+ import { d as writeProjectScaffold, f as parsePlatformFlags, h as wantedPlatforms, l as collectSourceFiles, m as targetLabel, n as requireApi, p as planTargets, v as resolveApps } from "./session-BDLQUJyV.js";
7
+ import { a as listProjectCatalogue, c as requireProducts, l as resolveBinding, n as pushSource, r as warnNotPortable, s as projectForApplication, t as assertGit } from "./source-push-DxuJuwEf.js";
6
8
  import pc from "picocolors";
7
9
  import { cpus } from "node:os";
8
10
 
@@ -308,7 +310,7 @@ async function prepare(context, input) {
308
310
  const stores = catalogueOf(target)?.stores ?? {};
309
311
  const unsourced = recorded?.snapshot === build.snapshotId ? recorded.sourcePending : void 0;
310
312
  const stale = needsWork(build.snapshotId, recorded?.snapshot, live.snapshotId);
311
- const storesChanged = !stale && storesDiffer(versionProducts(build.products, target.platform, stores), await pushedProducts(context.api, bind.paywallId, build.snapshotId));
313
+ const storesChanged = !stale && storesDiffer(versionProducts(build.products, target.platform, stores, build.billingPlans), await pushedProducts(context.api, bind.paywallId, build.snapshotId), build.billingPlans !== void 0);
312
314
  const changed = unsourced !== void 0 || stale || storesChanged;
313
315
  return {
314
316
  target,
@@ -346,7 +348,7 @@ async function pushVersion(context, input, lines, note) {
346
348
  const noun = assets.length === 1 ? "asset" : "assets";
347
349
  lines.push(synced.value.uploaded > 0 ? `${assets.length} ${noun} ${pc.dim(`(${weight(synced.value.totalBytes)})`)}, ${synced.value.uploaded} uploaded ${synced.took}` : `Assets up to date ${pc.dim(`(${assets.length} ${noun})`)} ${synced.took}`);
348
350
  }
349
- const products = versionProducts(build.products, target.platform, input.stores);
351
+ const products = versionProducts(build.products, target.platform, input.stores, build.billingPlans);
350
352
  const elsewhere = products.filter((product) => product.store !== platformStore(target.platform));
351
353
  if (elsewhere.length > 0) lines.push(`Products ${pc.dim(elsewhere.map((product) => `${product.reference_name} → ${product.store}`).join(", "))}`);
352
354
  note("Pushing");