@superwall/cli 2.4.0 → 2.5.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 (109) hide show
  1. package/dist/{apple-Bx_fm5M-.js → apple-Dyr7OFBx.js} +16 -15
  2. package/dist/approve-Czs1-JO9.js +186 -0
  3. package/dist/{assets-W5yvyf0V.js → assets-BrB9jQPQ.js} +3 -3
  4. package/dist/auth.d.ts +1 -1
  5. package/dist/auth.js +3 -3
  6. package/dist/{billing-C4lXR0xG.js → billing-D5qqIlVb.js} +3 -3
  7. package/dist/{bind-82oTpHZ3.js → bind-B3eEcRyp.js} +4 -4
  8. package/dist/browser-Bp3yRKlU.js +36 -0
  9. package/dist/{build-7_8cBgBm.js → build-DD9pSwHX.js} +9 -7
  10. package/dist/{client-ltxxHuxn.js → client-AI9H4GGB.js} +3 -3
  11. package/dist/{create-Dk8U_B49.js → create-B4m-IKlr.js} +8 -8
  12. package/dist/create-CJljlkJK.js +20 -0
  13. package/dist/{create-DEyveHS6.js → create-ChfgWpiM.js} +39 -67
  14. package/dist/{doctor-Df2GwS4K.js → doctor-XtXW6tKE.js} +6 -6
  15. package/dist/download-2Zu2I_Og.js +58 -0
  16. package/dist/{drivers-CTyYdBL7.js → drivers-CMEL13gp.js} +3 -3
  17. package/dist/entry.js +25 -24
  18. package/dist/{environment-djS0ik60.js → environment-BWT2S4qC.js} +3 -2
  19. package/dist/{existing-Das3PHGG.js → existing-b0GxFcnc.js} +2 -2
  20. package/dist/{session-CV0P8BjK.js → git-D7AVdugb.js} +96 -334
  21. package/dist/held-CX7Zf8u-.js +17 -0
  22. package/dist/{held-B8EFWDEc.js → held-D3PUNky2.js} +7 -7
  23. package/dist/install-CVUXsx8c.js +103 -0
  24. package/dist/{integrate-Cz48dm_h.js → integrate-qvKd9pVW.js} +27 -25
  25. package/dist/{login-girc324T.js → login-COmGHrU5.js} +2 -1
  26. package/dist/login-ClnJi1Ea.js +17 -0
  27. package/dist/{login-CiK5T4w8.js → login-PMoXUGqq.js} +8 -41
  28. package/dist/{lookup-us5vu5od.js → lookup-gjcKIZvh.js} +3 -2
  29. package/dist/{migrate-DaVwhdov.js → migrate-SkkLLdmr.js} +30 -25
  30. package/dist/{migration-cS6UGeUj.js → migration-DS44-3Zr.js} +9 -9
  31. package/dist/{notification-url-Hg42tAbW.js → notification-url-BjQPLf4-.js} +4 -4
  32. package/dist/{open-BIuOZ9ka.js → open-DQpm2yVs.js} +2 -2
  33. package/dist/{org-BrR4HGvl.js → org-C04eAO-j.js} +3 -2
  34. package/dist/organization-BOECL3vZ.js +39 -0
  35. package/dist/orgs-D6Kk96mG.js +81 -0
  36. package/dist/{paths-CdwjySxK.js → paths-REb-GrbX.js} +1 -1
  37. package/dist/{playbook-BJ3opYIS.js → playbook-Du4Oydbf.js} +10 -10
  38. package/dist/{products-DH_fK9tY.js → products-Cqq59DBQ.js} +1 -1
  39. package/dist/project-CP6hiHra.js +47 -0
  40. package/dist/{promote-BQO-1ScY.js → promote-Dm2_b1WK.js} +23 -18
  41. package/dist/pull-DsdOoG-D.js +36 -0
  42. package/dist/{pull-BhRswq6x.js → pull-F6pvO4To.js} +9 -28
  43. package/dist/pull-zYAbqo9n.js +106 -0
  44. package/dist/{push-CR110qRh.js → push-BIFLhAiO.js} +8 -6
  45. package/dist/push-CJVfvFZq.js +29 -0
  46. package/dist/push-D_l9KJZN.js +290 -0
  47. package/dist/push-SVzv7fzE.js +22 -0
  48. package/dist/{registry-DZsWoWqH.js → registry-DIJB0mJa.js} +687 -64
  49. package/dist/resolve--GsHj0Q1.js +171 -0
  50. package/dist/{resources-BMspgZO1.js → resources-BaP3p_LY.js} +3 -80
  51. package/dist/{run-D4V6mq8_.js → run-C5OPwhvS.js} +2 -2
  52. package/dist/run-CgLmD2vR.js +1345 -0
  53. package/dist/{scan-CRexsHOE.js → scan-Bj5y0zTZ.js} +1 -1
  54. package/dist/scan-v_WTE722.js +4 -0
  55. package/dist/{scope-Ct0_HoNq.js → scope-Bp_zwJOo.js} +5 -4
  56. package/dist/scope-CCb_7UvN.js +89 -0
  57. package/dist/sdk-TvT0p_nO.js +71 -0
  58. package/dist/selection-BltBpyp5.js +179 -0
  59. package/dist/series-TAixFBWW.js +685 -0
  60. package/dist/{server-Dv1VwbNh.js → server-CdVIboQn.js} +10 -8
  61. package/dist/server-CvJVusw3.js +29 -0
  62. package/dist/session-B8JNXkwN.js +6 -0
  63. package/dist/session-D3fgXQBt.js +219 -0
  64. package/dist/{session-UiPlLFn6.js → session-Ywim-P8M.js} +1 -1
  65. package/dist/{setup-UWLhQG3M.js → setup-zzjtTy8k.js} +9 -8
  66. package/dist/skills/index.json +5 -0
  67. package/dist/skills/superwall/SKILL.md +48 -30
  68. package/dist/skills/superwall/references/api.md +3 -2
  69. package/dist/skills/superwall-editor/SKILL.md +7 -5
  70. package/dist/skills/superwall-framework/SKILL.md +7 -5
  71. package/dist/skills/superwall-workspaces/SKILL.md +313 -0
  72. package/dist/skills/superwall-workspaces/references/cli.md +174 -0
  73. package/dist/skills/superwall-workspaces/references/slots.md +103 -0
  74. package/dist/{skills-CiWxt6vS.js → skills-2qYaUXGE.js} +4 -4
  75. package/dist/{skills-DzOvse9L.js → skills-8um2fBPS.js} +8 -8
  76. package/dist/{source-push-CX_k_yZD.js → source-push-kAep4gPe.js} +6 -5
  77. package/dist/{spinner-1uuKKZMc.js → spinner-BANVLncC.js} +16 -4
  78. package/dist/starter-CiLrp1cN.js +190 -0
  79. package/dist/status-CoYMK7QL.js +139 -0
  80. package/dist/{storage-CrXGgIbS.js → storage-DzP22xKn.js} +1 -1
  81. package/dist/storekit-D5eopLM0.js +17 -0
  82. package/dist/{storekit-CptdG4RJ.js → storekit-n1x0bWkQ.js} +4 -4
  83. package/dist/{telemetry-BqaPbM0k.js → telemetry-CXN6f-ZX.js} +1 -1
  84. package/dist/{token-zjjlkNDF.js → token-FmeHywYt.js} +1 -1
  85. package/dist/tools-skills/superwall/SKILL.md +49 -31
  86. package/dist/tools-skills/superwall/references/api.md +3 -2
  87. package/dist/tools-skills/superwall-editor/SKILL.md +7 -5
  88. package/dist/tools.d.ts +1 -1
  89. package/dist/tools.js +452 -27
  90. package/dist/try-BWbzgelb.js +120 -0
  91. package/dist/{selection-CgZJJ3FD.js → types-JdxmnCko.js} +1 -178
  92. package/dist/{upgrade-BBnmcyY2.js → upgrade-Bk5boOgW.js} +2 -2
  93. package/dist/{upgrade-AdyF7wXk.js → upgrade-CoWCEnoi.js} +2 -2
  94. package/package.json +5 -3
  95. package/dist/create-CBCDWuyo.js +0 -19
  96. package/dist/held-BL4oizD6.js +0 -16
  97. package/dist/login-DdrOmi6m.js +0 -16
  98. package/dist/push-B3Onn_mL.js +0 -24
  99. package/dist/scan-DUQjxOZf.js +0 -4
  100. package/dist/server-Cv-Ug9JF.js +0 -24
  101. package/dist/session-BCQuMcQ0.js +0 -6
  102. package/dist/storekit-B675ZNiA.js +0 -16
  103. /package/dist/{client-BZ1UbpXz.js → client-BJQXl62Q.js} +0 -0
  104. /package/dist/{devtools-pBl_vt03.js → devtools-ByZ6XYnn.js} +0 -0
  105. /package/dist/{input-vi0bou04.js → input-MDd67UIp.js} +0 -0
  106. /package/dist/{reports-CwwKLUh0.js → reports-CuhB1_ub.js} +0 -0
  107. /package/dist/{screenshot-file-tVBfUEIi.js → screenshot-file-XAS0Xy0e.js} +0 -0
  108. /package/dist/{storage-gRyQetN9.d.ts → storage-BjQCiTuz.d.ts} +0 -0
  109. /package/dist/{timing-BVxPrYq3.js → timing-Ca0TXY-A.js} +0 -0
@@ -0,0 +1,120 @@
1
+ import "./token-FmeHywYt.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-BWT2S4qC.js";
4
+ import "./storage-DzP22xKn.js";
5
+ import { t as ApiError } from "./client-AI9H4GGB.js";
6
+ import "./config-CGcG7GOt.js";
7
+ import "./spinner-BANVLncC.js";
8
+ import "./ui-D_qf3Gvw.js";
9
+ import "./orgs-D6Kk96mG.js";
10
+ import "./resources-BaP3p_LY.js";
11
+ import "./lookup-gjcKIZvh.js";
12
+ import { n as openBrowser } from "./browser-Bp3yRKlU.js";
13
+ import "./types-JdxmnCko.js";
14
+ import "./scope-CCb_7UvN.js";
15
+ import "./download-2Zu2I_Og.js";
16
+ import { n as dashboardOrigin } from "./resolve--GsHj0Q1.js";
17
+ import { a as findEntrypoint, r as WorkspaceError, s as readProject } from "./project-CP6hiHra.js";
18
+ import { a as summarizeSeries, c as defaultRange, h as DRAFT_MODULE_MAX_BYTES, n as parseFilters, u as bundleWorkspace } from "./series-TAixFBWW.js";
19
+ import { n as resolveOrganization, t as resolveAppScope } from "./organization-BOECL3vZ.js";
20
+ import { i as warnIfSdkBehind } from "./sdk-TvT0p_nO.js";
21
+
22
+ //#region src/core/workspaces/try.ts
23
+ async function postDraft(ctx, path, body) {
24
+ try {
25
+ return await ctx.api.post(path, body);
26
+ } catch (error) {
27
+ if (error instanceof ApiError && error.status === 400) throw new WorkspaceError(error.message);
28
+ throw error;
29
+ }
30
+ }
31
+ async function uploadDraft(ctx, project, organizationId, wrangler) {
32
+ const { module, bytes } = await bundleWorkspace(project.root, wrangler);
33
+ if (bytes > DRAFT_MODULE_MAX_BYTES) throw new WorkspaceError(`The bundle is ${bytes} bytes; a draft can be ${DRAFT_MODULE_MAX_BYTES} at most.`);
34
+ return postDraft(ctx, "/v2/workspaces/drafts", {
35
+ organization_id: Number(organizationId),
36
+ manifest: project.manifest,
37
+ module
38
+ });
39
+ }
40
+ async function tryMetric(ctx, project, entrypoint, input, wrangler) {
41
+ if (input.app === void 0) throw new WorkspaceError("A metric runs for one app. Say which with --app <id>.");
42
+ const { organizationId, applicationId } = await resolveAppScope(ctx.api, input.app, input.org);
43
+ if (organizationId === void 0) throw new WorkspaceError(`Couldn't find the organization of app ${input.app}. Say which with --org <id>.`);
44
+ const range = defaultRange(input.days);
45
+ const filters = parseFilters(input.filter);
46
+ const draft = await uploadDraft(ctx, project, organizationId, wrangler);
47
+ const run = await postDraft(ctx, `/v2/workspaces/drafts/${encodeURIComponent(draft.id)}/metric`, {
48
+ organization_id: Number(organizationId),
49
+ application_id: Number(applicationId),
50
+ entrypoint_id: entrypoint.id,
51
+ from: input.from ?? range.from,
52
+ to: input.to ?? range.to,
53
+ interval: input.interval,
54
+ ...input.breakdown === void 0 ? {} : { breakdown: input.breakdown },
55
+ ...input.filter.length === 0 ? {} : { filters }
56
+ });
57
+ const summary = summarizeSeries(run.series);
58
+ if (ctx.json) {
59
+ ctx.output.data({
60
+ draft_id: draft.id,
61
+ expires_at: draft.expires_at,
62
+ requested_scopes: draft.requested_scopes,
63
+ entrypoint_id: entrypoint.id,
64
+ summary,
65
+ series: run.series
66
+ });
67
+ return;
68
+ }
69
+ ctx.ui.success(`Ran \`${entrypoint.id}\` on the real runtime, as you. Only you can reach this draft, until ${draft.expires_at}.`);
70
+ ctx.ui.list({
71
+ empty: "It returned no points.",
72
+ items: summary.map((series) => ({
73
+ label: series.name,
74
+ meta: `${series.points} points, sum ${round(series.sum)}, latest ${round(series.last)} at ${series.lastAt}`
75
+ }))
76
+ });
77
+ if (input.points) ctx.ui.list({ items: run.series.points.map((point) => ({
78
+ label: point.t,
79
+ meta: `${point.breakdown ?? ""} ${round(point.value)}`.trim()
80
+ })) });
81
+ }
82
+ const round = (value) => Math.round(value * 1e3) / 1e3;
83
+ async function tryFrame(ctx, project, entrypoint, input, seams) {
84
+ const scope = input.app === void 0 ? { organizationId: await resolveOrganization(ctx, input.org) } : await resolveAppScope(ctx.api, input.app, input.org);
85
+ if (scope.organizationId === void 0) throw new WorkspaceError(`Couldn't find the organization of app ${input.app}. Say which with --org <id>.`);
86
+ const draft = await uploadDraft(ctx, project, scope.organizationId, seams.wrangler);
87
+ const search = new URLSearchParams({ entrypoint: entrypoint.id });
88
+ if (scope.applicationId !== void 0) search.set("app", scope.applicationId);
89
+ if (input.campaign !== void 0) search.set("campaign", input.campaign);
90
+ if (input.user !== void 0) search.set("user", input.user);
91
+ if (input.environment !== void 0) search.set("environment", input.environment);
92
+ const url = `${dashboardOrigin(ctx.api.host)}/${scope.organizationId}/workspace-drafts/${draft.id}?${search}`;
93
+ if (ctx.json) {
94
+ ctx.output.data({
95
+ draft_id: draft.id,
96
+ expires_at: draft.expires_at,
97
+ requested_scopes: draft.requested_scopes,
98
+ entrypoint_id: entrypoint.id,
99
+ url
100
+ });
101
+ return;
102
+ }
103
+ ctx.ui.success(`Uploaded a draft of \`${entrypoint.id}\`. It runs as you, and only you can reach it, until ${draft.expires_at}.`);
104
+ ctx.ui.info(`Open ${url}`);
105
+ if (input.open && ctx.outputMode === "rich") await (seams.open ?? openBrowser)(url);
106
+ }
107
+ function tryReadout(entrypoint) {
108
+ throw new WorkspaceError(`\`${entrypoint.id}\` (${entrypoint.slot}) is a readout, and readouts can't be tried on the real runtime yet. Run \`superwall workspaces dev\` to run it locally.`);
109
+ }
110
+ async function runWorkspaceTry(ctx, input, seams = {}) {
111
+ const project = readProject(input.dir);
112
+ const entrypoint = findEntrypoint(project.manifest, input.entrypoint);
113
+ await warnIfSdkBehind(ctx.ui, project.root);
114
+ if (entrypoint.slot === "chart.source@1") return tryMetric(ctx, project, entrypoint, input, seams.wrangler);
115
+ if (entrypoint.slot === "campaign.metric@1") return tryReadout(entrypoint);
116
+ return tryFrame(ctx, project, entrypoint, input, seams);
117
+ }
118
+
119
+ //#endregion
120
+ export { runWorkspaceTry };
@@ -1,60 +1,6 @@
1
- import { n as billingPlanOf } from "./resources-BMspgZO1.js";
2
- import { createRequire } from "node:module";
3
1
  import * as fs from "node:fs";
4
- import { globSync, readFileSync, statSync } from "node:fs";
5
2
  import * as path from "node:path";
6
- import { join, resolve } from "node:path";
7
- import { pathToFileURL } from "node:url";
8
- import pc from "picocolors";
9
3
 
10
- //#region src/core/paywalls/project/framework.ts
11
- var FrameworkNotFoundError = class extends Error {
12
- constructor(dir) {
13
- super(`No superwall framework found from ${dir}.\nInstall it in the project (\`npm i superwall\` / \`bun add superwall\`) and make sure you run this inside a project with a superwall/ directory.`);
14
- }
15
- };
16
- async function importSubpath(packageDir, subpath) {
17
- return import(pathToFileURL(createRequire(join(packageDir, "package.json")).resolve(subpath)).href);
18
- }
19
- function fn(mod, name, subpath) {
20
- const candidate = mod[name];
21
- if (typeof candidate !== "function") throw new Error(`This project's superwall version does not export ${name} from ${subpath} — update the project's superwall dependency.`);
22
- return candidate;
23
- }
24
- function resolveFrameworkDir(cwd) {
25
- for (const anchor of [join(cwd, "superwall", "package.json"), join(cwd, "package.json")]) try {
26
- return join(createRequire(anchor).resolve("superwall/package.json"), "..");
27
- } catch {
28
- continue;
29
- }
30
- throw new FrameworkNotFoundError(cwd);
31
- }
32
- function frameworkVersion(cwd) {
33
- try {
34
- const { version } = JSON.parse(readFileSync(join(resolveFrameworkDir(cwd), "package.json"), "utf8"));
35
- if (typeof version === "string" && version !== "") return version;
36
- } catch {
37
- return "unknown";
38
- }
39
- return "unknown";
40
- }
41
- async function resolveFramework(cwd) {
42
- const dir = resolveFrameworkDir(cwd);
43
- const [discover, build, preview] = await Promise.all([
44
- importSubpath(dir, "superwall/discover"),
45
- importSubpath(dir, "superwall/build"),
46
- importSubpath(dir, "superwall/preview")
47
- ]);
48
- const studioProject = typeof preview.buildStudioProject === "function" ? preview.buildStudioProject : void 0;
49
- return {
50
- discoverProject: fn(discover, "discoverProject", "superwall/discover"),
51
- buildSnapshot: fn(build, "buildSnapshot", "superwall/build"),
52
- startPreviewServer: fn(preview, "startPreviewServer", "superwall/preview"),
53
- studioProject
54
- };
55
- }
56
-
57
- //#endregion
58
4
  //#region src/core/paywalls/project/lock.ts
59
5
  const isScreenOrigin = (origin) => "path" in origin;
60
6
  const isFileName = (value) => typeof value === "string" && value !== "" && !/[\\/]/.test(value) && !value.startsWith(".");
@@ -339,127 +285,4 @@ function writeProjectTypes(project, products = {}) {
339
285
  }
340
286
 
341
287
  //#endregion
342
- //#region src/core/paywalls/pipeline/output.ts
343
- const kb = (bytes) => `${(bytes / 1024).toFixed(1)} kB`;
344
- const weight = (bytes) => bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1)} MB` : kb(bytes);
345
- const SHORT_SHA = 7;
346
- const shortSha = (sha) => typeof sha === "string" && sha.length >= SHORT_SHA ? sha.slice(0, SHORT_SHA) : void 0;
347
- function pushedLine(input) {
348
- const sha = shortSha(input.snapshotId);
349
- const pushed = `Pushed ${input.promoting ? `version ${input.version}` : pc.yellow(`version ${input.version}`)}${sha ? ` ${pc.dim(`(${sha})`)}` : ""}`;
350
- return input.promoting || input.live === void 0 ? pushed : `${pushed} · ${pc.dim(`live ${input.live}`)}`;
351
- }
352
- function transition(before, after) {
353
- if (before === void 0) return `Promoted ${pc.green(`version ${after}`)}`;
354
- if (before === after) return `Version ${pc.green(String(after))} already live`;
355
- if (after < before) return `Rolled back ${pc.green(`version ${before} → ${after}`)}`;
356
- return `Promoted ${pc.green(`version ${before} → ${after}`)}`;
357
- }
358
- const BIND_VERB = {
359
- lock: "Linked to",
360
- matched: "Linked to",
361
- created: "Created",
362
- renamed: "Rebound after rename to"
363
- };
364
- const LAYOUT_HINT = "expected superwall/{paywalls,funnels}/<id>/ with config.ts and app/index.tsx";
365
- const NOTE_LIMIT = 2e3;
366
- const PENDING_NAMES = 10;
367
- function pendingPromoteWarning(pending, multi = false) {
368
- if (pending.length === 0) return void 0;
369
- const entries = pending.map((entry) => typeof entry === "string" ? { id: entry } : entry);
370
- const ids = [...new Set(entries.map((entry) => entry.id))];
371
- const platforms = new Set(entries.flatMap((entry) => entry.platform ? [entry.platform] : []));
372
- const platformFlag = multi && platforms.size === 1 ? ` --platform ${[...platforms][0]}` : "";
373
- const command = `superwall promote --id ${ids.join(",")}${platformFlag}`;
374
- const labels = entries.map((entry) => multi && entry.platform ? `${entry.id} · ${entry.platform}` : entry.id);
375
- if (labels.length === 1) return `${labels[0]} is pushed but not live — run \`${command}\` to publish it.`;
376
- const shown = labels.slice(0, PENDING_NAMES).map((label) => ` ${label}`);
377
- const rest = labels.length - shown.length;
378
- return [
379
- `These ${labels.length} paywalls are pushed but not live:`,
380
- ...shown,
381
- ...rest > 0 ? [` …and ${rest} more`] : [],
382
- "",
383
- ` ${command}`
384
- ].join("\n");
385
- }
386
- function resolveNote(message) {
387
- if (message === void 0) return void 0;
388
- if (message.length > NOTE_LIMIT) throw new Error(`Publish note is ${message.length} characters (limit ${NOTE_LIMIT}).`);
389
- return message;
390
- }
391
- const took = (since) => {
392
- const seconds = (Date.now() - since) / 1e3;
393
- return pc.dim(seconds < 10 ? `(${seconds.toFixed(1)}s)` : `(${Math.round(seconds)}s)`);
394
- };
395
-
396
- //#endregion
397
- //#region src/core/paywalls/pipeline/selection.ts
398
- function resolveProjectDir(dir) {
399
- const [first] = resolveProjectDirs(dir === void 0 ? [] : [dir]);
400
- return first ?? process.cwd();
401
- }
402
- function resolveProjectDirs(dirs) {
403
- const list = dirs.filter((entry) => entry.length > 0);
404
- if (list.length === 0) return [process.cwd()];
405
- const expanded = list.flatMap((entry) => entry.includes("*") ? expandGlob(entry) : [entry]);
406
- return [...new Set(expanded.map((entry) => resolve(entry)))];
407
- }
408
- function expandGlob(pattern) {
409
- try {
410
- return [...globSync(pattern)].filter((entry) => statSync(entry, { throwIfNoEntry: false })?.isDirectory() ?? false).sort();
411
- } catch {
412
- return [pattern];
413
- }
414
- }
415
- function requireProject(project, dir) {
416
- if (!project.marker) throw new Error(`Not a superwall project: ${dir}\nExpected a package.json here (or in superwall/) that depends on superwall.`);
417
- if (project.packageName === "superwall") throw new Error(`${project.superwallDir}/package.json is named "superwall".\nNode resolves every bare \`import "superwall"\` inside a package to that package itself, so the framework can never load. Rename it to your project's name.`);
418
- return project;
419
- }
420
- function parseIds(values) {
421
- return values.flatMap((entry) => entry.split(",")).map((entry) => entry.trim()).filter((entry) => entry.length > 0);
422
- }
423
- function selectSurfaces(project, ids) {
424
- const wanted = parseIds(ids);
425
- const known = project.surfaces.map((surface) => surface.id).join(", ");
426
- if (wanted.length === 0) {
427
- if (project.surfaces.length === 0) throw new Error(`No paywalls or funnels found — ${LAYOUT_HINT}.`);
428
- return [...project.surfaces];
429
- }
430
- const selected = [];
431
- for (const id of wanted) {
432
- const matches = project.surfaces.filter((surface$1) => surface$1.id === id);
433
- if (matches.length === 0) throw new Error(`No paywall or funnel named "${id}"` + (known ? ` — this project has: ${known}.` : ` — ${LAYOUT_HINT}.`));
434
- if (matches.length > 1) {
435
- const kinds = matches.map((surface$1) => `${surface$1.kind}/${surface$1.id}`).join(" and ");
436
- throw new Error(`"${id}" is ambiguous — this project has ${kinds}.`);
437
- }
438
- const surface = matches[0];
439
- if (surface && !selected.includes(surface)) selected.push(surface);
440
- }
441
- return selected;
442
- }
443
- function requireClean(surfaces) {
444
- const problems = surfaces.flatMap((surface) => surface.diagnostics ?? []);
445
- if (problems.length === 0) return;
446
- throw new Error([
447
- ...problems,
448
- "",
449
- "Publishing is immutable — fix these first, then push again."
450
- ].join("\n"));
451
- }
452
- function storesDiffer(products, live, comparePlans = true) {
453
- return products.some((product) => {
454
- const pushed = live?.find((ref) => ref.reference === product.reference_name && ref.identifier === product.identifier);
455
- if (pushed === void 0) return false;
456
- if (pushed.store !== void 0 && pushed.store !== product.store) return true;
457
- return comparePlans && pushed.billingPlan !== billingPlanOf(product.billing_plan_type);
458
- });
459
- }
460
- function needsWork(built, pushed, live) {
461
- return built !== pushed && built !== live;
462
- }
463
-
464
- //#endregion
465
- export { removeBinding as A, formatLock as C, parseLock as D, originKey as E, writeOrigin as F, writeSnapshot as I, writeSources as L, writeBinding as M, writeBindings as N, parseSources as O, writeLock as P, frameworkVersion as R, describeBindings as S, isScreenOrigin as T, weight as _, resolveProjectDir as a, writeProjectTypes as b, storesDiffer as c, kb as d, pendingPromoteWarning as f, transition as g, took as h, requireProject as i, writeApp as j, readLock as k, BIND_VERB as l, resolveNote as m, parseIds as n, resolveProjectDirs as o, pushedLine as p, requireClean as r, selectSurfaces as s, needsWork as t, LAYOUT_HINT as u, TYPES_FILE as v, formatSharedLock as w, NewerLockError as x, collectProjectDeclarations as y, resolveFramework as z };
288
+ export { writeLock as _, describeBindings as a, writeSources as b, isScreenOrigin as c, parseSources as d, readLock as f, writeBindings as g, writeBinding as h, NewerLockError as i, originKey as l, writeApp as m, collectProjectDeclarations as n, formatLock as o, removeBinding as p, writeProjectTypes as r, formatSharedLock as s, TYPES_FILE as t, parseLock as u, writeOrigin as v, writeSnapshot as y };
@@ -1,4 +1,4 @@
1
- import { a as AUTO_UPDATE, b as VERSION, g as RUNNING_VIA_NPX } from "./environment-djS0ik60.js";
1
+ import { _ as RUNNING_VIA_NPX, a as AUTO_UPDATE, x as VERSION } from "./environment-BWT2S4qC.js";
2
2
  import { c as readSkillsSync, d as writeAutoUpdate, l as readUpdateCheck, n as readAutoUpdate, v as writeUpdateCheck } from "./config-CGcG7GOt.js";
3
3
  import { r as spawnStream } from "./spawn-DmmmHIP-.js";
4
4
  import { execFileSync } from "node:child_process";
@@ -111,7 +111,7 @@ async function updateAgentSkills(ctx, work) {
111
111
  return skills;
112
112
  }
113
113
  async function updateSkillsInProcess() {
114
- const { updateSkills } = await import("./skills-DzOvse9L.js");
114
+ const { updateSkills } = await import("./skills-8um2fBPS.js");
115
115
  return updateSkills();
116
116
  }
117
117
  async function updateSkillsWithInstalledCli(version) {
@@ -1,7 +1,7 @@
1
1
  import "./output-Ggzq5_-t.js";
2
- import "./environment-djS0ik60.js";
2
+ import "./environment-BWT2S4qC.js";
3
3
  import "./config-CGcG7GOt.js";
4
4
  import "./spawn-DmmmHIP-.js";
5
- import { a as printAutoUpdate, c as runUpgrade, i as maybeNotifyUpdate, l as selectAutoUpdate, n as isGlobalInstall, o as recordAutoUpdate, r as isNewerVersion, s as refreshUpdateCheck, t as flushUpdateCheck } from "./upgrade-BBnmcyY2.js";
5
+ import { a as printAutoUpdate, c as runUpgrade, i as maybeNotifyUpdate, l as selectAutoUpdate, n as isGlobalInstall, o as recordAutoUpdate, r as isNewerVersion, s as refreshUpdateCheck, t as flushUpdateCheck } from "./upgrade-Bk5boOgW.js";
6
6
 
7
7
  export { flushUpdateCheck, isGlobalInstall, isNewerVersion, maybeNotifyUpdate, printAutoUpdate, recordAutoUpdate, refreshUpdateCheck, runUpgrade, selectAutoUpdate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superwall/cli",
3
- "version": "2.4.0",
3
+ "version": "2.5.0",
4
4
  "description": "The official CLI for managing Superwall from your terminal or coding agent.",
5
5
  "keywords": [
6
6
  "agent",
@@ -64,7 +64,7 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "@anthropic-ai/claude-agent-sdk": "0.3.201",
67
- "@superwall/studio": "2.4.0",
67
+ "@superwall/studio": "2.5.0",
68
68
  "ansi-escapes": "^7.3.0",
69
69
  "fast-glob": "^3.3.3",
70
70
  "ink": "^5.2.1",
@@ -80,9 +80,11 @@
80
80
  "@types/react": "^18.3.31",
81
81
  "@types/yargs": "^17.0.33",
82
82
  "ink-testing-library": "^4.0.0",
83
+ "react-dom": "^18.3.1",
83
84
  "tsdown": "^0.15.0",
84
85
  "tsx": "^4.19.0",
85
- "typescript": "^5.7.0"
86
+ "typescript": "^5.7.0",
87
+ "wrangler": "4.157.0"
86
88
  },
87
89
  "engines": {
88
90
  "node": ">=20.0.0"
@@ -1,19 +0,0 @@
1
- import "./token-zjjlkNDF.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-djS0ik60.js";
4
- import "./storage-CrXGgIbS.js";
5
- import "./client-ltxxHuxn.js";
6
- import "./held-B8EFWDEc.js";
7
- import "./config-CGcG7GOt.js";
8
- import "./spinner-1uuKKZMc.js";
9
- import "./ui-D_qf3Gvw.js";
10
- import "./paths-CdwjySxK.js";
11
- import "./resources-BMspgZO1.js";
12
- import "./org-BrR4HGvl.js";
13
- import "./lookup-us5vu5od.js";
14
- import "./scope-Ct0_HoNq.js";
15
- import "./client-BZ1UbpXz.js";
16
- import "./timing-BVxPrYq3.js";
17
- import { i as runAscKeysCreate, n as keyAccess, r as keyRole, t as createAndSaveKey } from "./create-Dk8U_B49.js";
18
-
19
- export { createAndSaveKey, keyAccess, keyRole, runAscKeysCreate };
@@ -1,16 +0,0 @@
1
- import "./token-zjjlkNDF.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-djS0ik60.js";
4
- import "./storage-CrXGgIbS.js";
5
- import "./client-ltxxHuxn.js";
6
- import { t as upsertHeldKey } from "./held-B8EFWDEc.js";
7
- import "./config-CGcG7GOt.js";
8
- import "./spinner-1uuKKZMc.js";
9
- import "./ui-D_qf3Gvw.js";
10
- import "./resources-BMspgZO1.js";
11
- import "./org-BrR4HGvl.js";
12
- import "./lookup-us5vu5od.js";
13
- import "./scope-Ct0_HoNq.js";
14
- import "./client-BZ1UbpXz.js";
15
-
16
- export { upsertHeldKey };
@@ -1,16 +0,0 @@
1
- import "./token-zjjlkNDF.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-djS0ik60.js";
4
- import "./storage-CrXGgIbS.js";
5
- import "./client-ltxxHuxn.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-BqaPbM0k.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-1uuKKZMc.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import "./scan-CRexsHOE.js";
12
- import "./paths-CdwjySxK.js";
13
- import { i as startLogin, n as pollLogin, r as runLogin, t as performLogin } from "./login-CiK5T4w8.js";
14
- import "./skills-CiWxt6vS.js";
15
-
16
- export { performLogin, pollLogin, runLogin, startLogin };
@@ -1,24 +0,0 @@
1
- import "./token-zjjlkNDF.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-djS0ik60.js";
4
- import "./storage-CrXGgIbS.js";
5
- import "./client-ltxxHuxn.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-BqaPbM0k.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-1uuKKZMc.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import "./scan-CRexsHOE.js";
12
- import "./paths-CdwjySxK.js";
13
- import "./resources-BMspgZO1.js";
14
- import "./lookup-us5vu5od.js";
15
- import "./login-CiK5T4w8.js";
16
- import "./skills-CiWxt6vS.js";
17
- import "./assets-W5yvyf0V.js";
18
- import "./selection-CgZJJ3FD.js";
19
- import "./session-CV0P8BjK.js";
20
- import "./source-push-CX_k_yZD.js";
21
- import { i as timed, n as runPush, r as runPushPipeline, t as group } from "./push-CR110qRh.js";
22
- import "./login-girc324T.js";
23
-
24
- export { group, runPush, runPushPipeline, timed };
@@ -1,4 +0,0 @@
1
- import "./environment-djS0ik60.js";
2
- import { t as scanProject } from "./scan-CRexsHOE.js";
3
-
4
- export { scanProject };
@@ -1,24 +0,0 @@
1
- import "./token-zjjlkNDF.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-djS0ik60.js";
4
- import "./storage-CrXGgIbS.js";
5
- import "./client-ltxxHuxn.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./telemetry-BqaPbM0k.js";
8
- import "./spawn-DmmmHIP-.js";
9
- import "./spinner-1uuKKZMc.js";
10
- import "./ui-D_qf3Gvw.js";
11
- import "./scan-CRexsHOE.js";
12
- import "./paths-CdwjySxK.js";
13
- import "./resources-BMspgZO1.js";
14
- import "./lookup-us5vu5od.js";
15
- import "./login-CiK5T4w8.js";
16
- import "./skills-CiWxt6vS.js";
17
- import "./assets-W5yvyf0V.js";
18
- import "./selection-CgZJJ3FD.js";
19
- import "./session-CV0P8BjK.js";
20
- import "./source-push-CX_k_yZD.js";
21
- import "./login-girc324T.js";
22
- import { t as runStudio } from "./server-Dv1VwbNh.js";
23
-
24
- export { runStudio };
@@ -1,6 +0,0 @@
1
- import "./output-Ggzq5_-t.js";
2
- import "./environment-djS0ik60.js";
3
- import "./storage-CrXGgIbS.js";
4
- import { n as runWhoami, t as runLogout } from "./session-UiPlLFn6.js";
5
-
6
- export { runLogout, runWhoami };
@@ -1,16 +0,0 @@
1
- import "./token-zjjlkNDF.js";
2
- import "./output-Ggzq5_-t.js";
3
- import "./environment-djS0ik60.js";
4
- import "./storage-CrXGgIbS.js";
5
- import "./client-ltxxHuxn.js";
6
- import "./config-CGcG7GOt.js";
7
- import "./spinner-1uuKKZMc.js";
8
- import "./ui-D_qf3Gvw.js";
9
- import "./resources-BMspgZO1.js";
10
- import "./org-BrR4HGvl.js";
11
- import "./lookup-us5vu5od.js";
12
- import "./scope-Ct0_HoNq.js";
13
- import "./input-vi0bou04.js";
14
- import { n as writeStoreKit, t as generateStoreKit } from "./storekit-CptdG4RJ.js";
15
-
16
- export { generateStoreKit, writeStoreKit };
File without changes
File without changes
File without changes