@superwall/cli 1.6.1 → 1.7.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 (65) hide show
  1. package/README.md +116 -3
  2. package/dist/{actions-BdZ-7BJd.js → actions-B7ym3oVS.js} +2 -2
  3. package/dist/{api-FjrCPu6r.js → api-CZzirVMj.js} +8 -8
  4. package/dist/{app-YeJj35Ia.js → app-DH6U8yuI.js} +11 -10
  5. package/dist/{asa-4nk7HHy8.js → asa-C-sQzPPn.js} +10 -10
  6. package/dist/{asc-2TZOQuK1.js → asc-1ZBJ6DwS.js} +282 -43
  7. package/dist/asc-Bf7zBbyS.js +65 -0
  8. package/dist/{asc-products-1e1DoGeL.js → asc-products-9JXtDxI4.js} +2 -35
  9. package/dist/{auth-QUYfKdwk.js → auth-YRhlV3DE.js} +11 -10
  10. package/dist/auth.js +2 -2
  11. package/dist/{billing-BK7bpv1t.js → billing-CCYHdApx.js} +1 -1
  12. package/dist/{bind-Ch4VR2EY.js → bind-YrJvuRF9.js} +3 -3
  13. package/dist/build-DLoCW5Ri.js +87 -0
  14. package/dist/bundle-id-CKxl_026.js +121 -0
  15. package/dist/{command-BJ_6850A.js → command-CMIz81Da.js} +5 -5
  16. package/dist/{create-vSQxQlEP.js → create-pkANt1Gs.js} +22 -21
  17. package/dist/dev-DZy6pOnB.js +22 -0
  18. package/dist/{dev-DEss5dwo.js → dev-DmB3XqaJ.js} +16 -8
  19. package/dist/{doctor-BYTfekBr.js → doctor-H-hf-Yww.js} +10 -10
  20. package/dist/{drivers-DGml3OlF.js → drivers-Qx9LxmRN.js} +2 -2
  21. package/dist/entry.js +453 -43
  22. package/dist/{existing-DgSo639M.js → existing-AVEfZu2A.js} +2 -2
  23. package/dist/feedback-CKf-rpBW.js +152 -0
  24. package/dist/{hosted-DqGp6oV2.js → hosted-CXe9TrWx.js} +2 -2
  25. package/dist/{integrate-Cl9eKHoF.js → integrate-brmhPG-S.js} +23 -22
  26. package/dist/{login-DS3MPeW2.js → login-Do4wFuLv.js} +31 -16
  27. package/dist/{migrate-WiTO71PE.js → migrate-C9ERDR6y.js} +24 -23
  28. package/dist/notification-url-DuKF2659.js +1273 -0
  29. package/dist/{open-studio-CbMUL5Va.js → open-studio-DOw-6ydc.js} +17 -14
  30. package/dist/{org-CV8c849b.js → org-sj7uyvp-.js} +2 -2
  31. package/dist/{output-XKuoEEjP.js → output-C4o2gJ1K.js} +12 -2
  32. package/dist/{pipeline-J9-nENTS.js → pipeline-BqzqZhX1.js} +10 -495
  33. package/dist/{print-skill-BOGm5Szi.js → print-skill-ZojRSybs.js} +7 -7
  34. package/dist/{promote-Ci085QxU.js → promote-BG8X4Nv_.js} +17 -16
  35. package/dist/publish-sxLh-G4G.js +35 -0
  36. package/dist/push-bQ6Vxtg8.js +35 -0
  37. package/dist/{query-BZStoGLM.js → query-_FbybaH-.js} +9 -9
  38. package/dist/{resource-ClLHSXi6.js → resource-CGIwSd29.js} +17 -177
  39. package/dist/revenue-provider-ebsRINY8.js +100 -0
  40. package/dist/{run-CiaWn78U.js → run-DsVZ5snL.js} +2 -2
  41. package/dist/{scan-DEgX5HxV.js → scan-zKsddO72.js} +1 -1
  42. package/dist/scope-BvzD-kO4.js +223 -0
  43. package/dist/selection-CxZoX4NT.js +496 -0
  44. package/dist/setup-Bxj22rYi.js +189 -0
  45. package/dist/skills/superwall-framework/SKILL.md +109 -36
  46. package/dist/skills/superwall-framework/references/cli.md +45 -5
  47. package/dist/skills/superwall-framework/references/mobile-design.md +60 -181
  48. package/dist/{skills-DsBAVRTE.js → skills-DPzlnfCK.js} +78 -9
  49. package/dist/{skills-DjPCmUMU.js → skills-D_R-lEsK.js} +8 -8
  50. package/dist/{spinner-DFctF_Jw.js → spinner-TWa0hia6.js} +1 -1
  51. package/dist/{telemetry-EzV7cA7s.js → telemetry-DeA1mvnT.js} +1 -1
  52. package/dist/{token-r5g876aI.js → token-C0it-Xh7.js} +1 -1
  53. package/dist/{ui-4gLyfrgl.js → ui-Dy0b-9L8.js} +4 -3
  54. package/dist/{update-Cz3Q3MFj.js → update-B2fWIc4q.js} +2 -2
  55. package/dist/{upgrade-BA_4sdnh.js → upgrade-BmzkTKrh.js} +6 -6
  56. package/package.json +2 -2
  57. package/dist/dev-B9qmPH1W.js +0 -21
  58. package/dist/feedback-4LsBpZZx.js +0 -73
  59. package/dist/publish--TV-j8Zd.js +0 -34
  60. package/dist/push-CpGetsJF.js +0 -34
  61. package/dist/skills/superwall-framework/references/responsive.md +0 -162
  62. /package/dist/{api-output-CEhN-U_N.js → api-output-aJNw7Syy.js} +0 -0
  63. /package/dist/{params-BxgTuCzr.js → params-l3CrvRtR.js} +0 -0
  64. /package/dist/{reports-C0xHCLnt.js → reports-CfJqoava.js} +0 -0
  65. /package/dist/{storekit-Dlpbq5Wv.js → storekit-Cj9Cpjcz.js} +0 -0
@@ -1,9 +1,10 @@
1
- import { a as AGENT_SKILLS_DIR, l as CHANNEL, u as CHANNELS, y as VERSION } from "./output-XKuoEEjP.js";
2
- import { h as setSkillsSync, i as track, u as getSkillsSync } from "./telemetry-EzV7cA7s.js";
3
- import { n as ui } from "./ui-4gLyfrgl.js";
1
+ import { a as AGENT_SKILLS_DIR, l as CHANNEL, u as CHANNELS, x as VERSION } from "./output-C4o2gJ1K.js";
2
+ import { h as setSkillsSync, i as track, u as getSkillsSync } from "./telemetry-DeA1mvnT.js";
3
+ import { n as ui } from "./ui-Dy0b-9L8.js";
4
4
  import { r as spawnStream } from "./spawn-DSoTXy_j.js";
5
5
  import { dirname, join } from "node:path";
6
- import { existsSync, readFileSync } from "node:fs";
6
+ import { tmpdir } from "node:os";
7
+ import { existsSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
7
8
  import { fileURLToPath } from "node:url";
8
9
 
9
10
  //#region src/packaged.ts
@@ -187,17 +188,85 @@ async function fetchSkillSummary(name) {
187
188
  }
188
189
  }
189
190
  async function installPublicSkills(opts = {}) {
190
- const args = [
191
+ const selection = opts.skills?.length ? ["--skill", ...opts.skills] : ["--skill", "*"];
192
+ const remote = [
191
193
  "-y",
192
194
  "skills@latest",
193
195
  "add",
194
196
  SKILLS_INSTALL_SOURCE(),
195
197
  "--global",
196
- "--yes"
198
+ "--yes",
199
+ ...selection
197
200
  ];
198
- if (opts.skills?.length) args.push("--skill", ...opts.skills);
199
- else args.push("--skill", "*");
200
- return runInstall(args, opts);
201
+ if (opts.dryRun) return runInstall(remote, opts);
202
+ const checkout = await clonePublicSkills(opts.cwd);
203
+ if (!checkout) return runInstall(remote, opts);
204
+ try {
205
+ normalizeSkillsDir(join(checkout, "skills"));
206
+ return await runInstall([
207
+ "-y",
208
+ "skills@latest",
209
+ "add",
210
+ join(checkout, "skills"),
211
+ "--global",
212
+ "--yes",
213
+ ...selection,
214
+ "--copy"
215
+ ], opts);
216
+ } finally {
217
+ rmSync(checkout, {
218
+ recursive: true,
219
+ force: true
220
+ });
221
+ }
222
+ }
223
+ async function clonePublicSkills(cwd) {
224
+ const dir = mkdtempSync(join(tmpdir(), "superwall-skills-"));
225
+ const { code } = await spawnStream({
226
+ bin: "git",
227
+ args: [
228
+ "clone",
229
+ "--quiet",
230
+ "--depth",
231
+ "1",
232
+ "--branch",
233
+ SKILLS_REF(),
234
+ `https://github.com/${SUPERWALL_SKILLS_SOURCE}.git`,
235
+ dir
236
+ ],
237
+ cwd: cwd ?? process.cwd(),
238
+ onStdoutLine: () => {}
239
+ }).catch(() => ({ code: 1 }));
240
+ if (code === 0 && existsSync(join(dir, "skills"))) return dir;
241
+ rmSync(dir, {
242
+ recursive: true,
243
+ force: true
244
+ });
245
+ return null;
246
+ }
247
+ function normalizeSkillsDir(dir) {
248
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
249
+ if (!entry.isDirectory()) continue;
250
+ const file = join(dir, entry.name, "SKILL.md");
251
+ if (!existsSync(file)) continue;
252
+ const md = readFileSync(file, "utf8");
253
+ const normalized = normalizeSkillFrontmatter(md);
254
+ if (normalized !== md) writeFileSync(file, normalized);
255
+ }
256
+ }
257
+ function normalizeSkillFrontmatter(md) {
258
+ const lines = md.split("\n");
259
+ if (lines[0]?.trim() !== "---") return md;
260
+ const end = lines.indexOf("---", 1);
261
+ if (end < 0) return md;
262
+ for (let i = 1; i < end; i++) {
263
+ const match = lines[i].match(/^([A-Za-z0-9_-]+):[ \t]+(.+?)\s*$/);
264
+ if (!match) continue;
265
+ const [, key, value] = match;
266
+ if (/^["']/.test(value) || /^[|>][+-]?\d*$/.test(value)) continue;
267
+ if (/: |\s#/.test(value) || /^[`@%&*!?{}[\],]/.test(value) || value.endsWith(":")) lines[i] = `${key}: ${JSON.stringify(value)}`;
268
+ }
269
+ return lines.join("\n");
201
270
  }
202
271
  async function installBundledSkills(opts = {}) {
203
272
  return runInstall([
@@ -1,12 +1,12 @@
1
- import "./output-XKuoEEjP.js";
2
- import "./telemetry-EzV7cA7s.js";
3
- import "./update-Cz3Q3MFj.js";
4
- import "./token-r5g876aI.js";
5
- import { t as defineCommand } from "./command-BJ_6850A.js";
6
- import { n as ui } from "./ui-4gLyfrgl.js";
7
- import { a as skillsOutOfDate, o as syncSkills, r as fetchPublicSkills, t as SKILLS_INSTALL_SOURCE } from "./skills-DsBAVRTE.js";
1
+ import "./output-C4o2gJ1K.js";
2
+ import "./telemetry-DeA1mvnT.js";
3
+ import "./update-B2fWIc4q.js";
4
+ import "./token-C0it-Xh7.js";
5
+ import { t as defineCommand } from "./command-CMIz81Da.js";
6
+ import { n as ui } from "./ui-Dy0b-9L8.js";
7
+ import { a as skillsOutOfDate, o as syncSkills, r as fetchPublicSkills, t as SKILLS_INSTALL_SOURCE } from "./skills-DPzlnfCK.js";
8
8
  import "./spawn-DSoTXy_j.js";
9
- import { t as withSpinner } from "./spinner-DFctF_Jw.js";
9
+ import { t as withSpinner } from "./spinner-TWa0hia6.js";
10
10
 
11
11
  //#region src/commands/account/skills.ts
12
12
  const runSkills = defineCommand({
@@ -1,4 +1,4 @@
1
- import { n as ui } from "./ui-4gLyfrgl.js";
1
+ import { n as ui } from "./ui-Dy0b-9L8.js";
2
2
 
3
3
  //#region src/ui/spinner.ts
4
4
  async function withSpinner(label, work) {
@@ -1,4 +1,4 @@
1
- import { _ as TELEMETRY_HOST, g as SUPERWALL_HOME, r as formatJson, v as TELEMETRY_KEY, x as isNonInteractive, y as VERSION } from "./output-XKuoEEjP.js";
1
+ import { b as TELEMETRY_KEY, r as formatJson, v as SUPERWALL_HOME, w as isNonInteractive, x as VERSION, y as TELEMETRY_HOST } from "./output-C4o2gJ1K.js";
2
2
  import { join } from "node:path";
3
3
  import { homedir } from "node:os";
4
4
  import { randomUUID } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import { g as SUPERWALL_HOME, r as formatJson } from "./output-XKuoEEjP.js";
1
+ import { r as formatJson, v as SUPERWALL_HOME } from "./output-C4o2gJ1K.js";
2
2
  import { join } from "node:path";
3
3
  import { homedir } from "node:os";
4
4
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
@@ -27427,7 +27427,7 @@ function ConfirmView({ active: active$1 }) {
27427
27427
  function TextView({ active: active$1 }) {
27428
27428
  use_input_default((input, key) => {
27429
27429
  if (key.return) {
27430
- const v$2 = active$1.value.trim();
27430
+ const v$2 = active$1.secret ? active$1.value : active$1.value.trim();
27431
27431
  if (active$1.validate) {
27432
27432
  const err$1 = active$1.validate(v$2);
27433
27433
  if (err$1) {
@@ -27437,7 +27437,7 @@ function TextView({ active: active$1 }) {
27437
27437
  }
27438
27438
  const resolve = active$1.resolve;
27439
27439
  if (active$1.transient) setActive(null);
27440
- else finish(active$1.message, v$2 || "(empty)");
27440
+ else finish(active$1.message, active$1.secret ? "•".repeat(8) : v$2 || "(empty)");
27441
27441
  resolve(v$2);
27442
27442
  } else if (key.escape) {
27443
27443
  const resolve = active$1.resolve;
@@ -27470,7 +27470,7 @@ function TextView({ active: active$1 }) {
27470
27470
  children: "│ "
27471
27471
  }),
27472
27472
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: " " }),
27473
- active$1.value ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: active$1.value }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
27473
+ active$1.value ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { children: active$1.secret ? "•".repeat(active$1.value.length) : active$1.value }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
27474
27474
  color: PRIMARY,
27475
27475
  children: "▏"
27476
27476
  })] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
@@ -27607,6 +27607,7 @@ const inkRenderer = {
27607
27607
  value: o.initialValue ?? "",
27608
27608
  footer: o.footer,
27609
27609
  transient: o.transient,
27610
+ secret: o.secret,
27610
27611
  validate: o.validate,
27611
27612
  resolve
27612
27613
  }));
@@ -1,5 +1,5 @@
1
- import { y as VERSION } from "./output-XKuoEEjP.js";
2
- import { d as getUpdateCheck, g as setUpdateCheck } from "./telemetry-EzV7cA7s.js";
1
+ import { x as VERSION } from "./output-C4o2gJ1K.js";
2
+ import { d as getUpdateCheck, g as setUpdateCheck } from "./telemetry-DeA1mvnT.js";
3
3
  import pc from "picocolors";
4
4
 
5
5
  //#region src/core/update.ts
@@ -1,9 +1,9 @@
1
- import { y as VERSION } from "./output-XKuoEEjP.js";
2
- import { g as setUpdateCheck } from "./telemetry-EzV7cA7s.js";
3
- import { r as isNewerVersion, t as fetchLatestVersion } from "./update-Cz3Q3MFj.js";
4
- import "./token-r5g876aI.js";
5
- import { t as defineCommand } from "./command-BJ_6850A.js";
6
- import "./ui-4gLyfrgl.js";
1
+ import { x as VERSION } from "./output-C4o2gJ1K.js";
2
+ import { g as setUpdateCheck } from "./telemetry-DeA1mvnT.js";
3
+ import { r as isNewerVersion, t as fetchLatestVersion } from "./update-B2fWIc4q.js";
4
+ import "./token-C0it-Xh7.js";
5
+ import { t as defineCommand } from "./command-CMIz81Da.js";
6
+ import "./ui-Dy0b-9L8.js";
7
7
  import { r as spawnStream } from "./spawn-DSoTXy_j.js";
8
8
 
9
9
  //#region src/commands/account/upgrade.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superwall/cli",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "The official CLI for managing Superwall from your terminal or coding agent.",
5
5
  "keywords": [
6
6
  "agent",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "dependencies": {
61
61
  "@anthropic-ai/claude-agent-sdk": "0.3.201",
62
- "@superwall/studio": "1.6.1",
62
+ "@superwall/studio": "1.7.0",
63
63
  "ansi-escapes": "^7.3.0",
64
64
  "fast-glob": "^3.3.3",
65
65
  "ink": "^5.2.1",
@@ -1,21 +0,0 @@
1
- import "./output-XKuoEEjP.js";
2
- import "./telemetry-EzV7cA7s.js";
3
- import "./update-Cz3Q3MFj.js";
4
- import "./token-r5g876aI.js";
5
- import "./command-BJ_6850A.js";
6
- import "./ui-4gLyfrgl.js";
7
- import "./skills-DsBAVRTE.js";
8
- import "./spawn-DSoTXy_j.js";
9
- import "./login-DS3MPeW2.js";
10
- import "./scan-DEgX5HxV.js";
11
- import "./hosted-DqGp6oV2.js";
12
- import "./spinner-DFctF_Jw.js";
13
- import "./resources-Bf9O1JNM.js";
14
- import "./org-CV8c849b.js";
15
- import "./bind-Ch4VR2EY.js";
16
- import "./pipeline-J9-nENTS.js";
17
- import "./actions-BdZ-7BJd.js";
18
- import "./app-YeJj35Ia.js";
19
- import { t as runDev } from "./dev-DEss5dwo.js";
20
-
21
- export { runDev };
@@ -1,73 +0,0 @@
1
- import { _ as TELEMETRY_HOST, v as TELEMETRY_KEY, y as VERSION } from "./output-XKuoEEjP.js";
2
- import { a as getAnonymousId } from "./telemetry-EzV7cA7s.js";
3
- import "./update-Cz3Q3MFj.js";
4
- import { i as loadSession } from "./token-r5g876aI.js";
5
- import { t as defineCommand } from "./command-BJ_6850A.js";
6
- import "./ui-4gLyfrgl.js";
7
-
8
- //#region src/core/feedback.ts
9
- function buildFeedbackEvent(message, via, distinctId, session) {
10
- return {
11
- api_key: TELEMETRY_KEY(),
12
- event: "feedback submitted",
13
- distinct_id: distinctId,
14
- timestamp: (/* @__PURE__ */ new Date()).toISOString(),
15
- properties: {
16
- $process_person_profile: false,
17
- message,
18
- via,
19
- cli_version: VERSION,
20
- platform: process.platform,
21
- email: session?.userEmail ?? null,
22
- org_id: session?.orgId ?? null,
23
- org_name: session?.orgName ?? null
24
- }
25
- };
26
- }
27
- async function submitFeedback(message, via) {
28
- if (!TELEMETRY_KEY()) return false;
29
- const payload = buildFeedbackEvent(message, via, getAnonymousId(), loadSession());
30
- try {
31
- return (await fetch(`${TELEMETRY_HOST()}/capture/`, {
32
- method: "POST",
33
- headers: { "content-type": "application/json" },
34
- body: JSON.stringify(payload),
35
- signal: AbortSignal.timeout(8e3)
36
- })).ok;
37
- } catch {
38
- return false;
39
- }
40
- }
41
-
42
- //#endregion
43
- //#region src/commands/account/feedback.ts
44
- const runFeedback = defineCommand({
45
- name: "feedback",
46
- output: "both",
47
- async run(ctx) {
48
- const { ui, json, interactive, argv } = ctx;
49
- let message = argv.message?.trim();
50
- if (!message && interactive) {
51
- ui.intro("Superwall feedback");
52
- const answer = await ui.text({
53
- message: "What's your feedback on the Superwall CLI?",
54
- placeholder: "What worked, what didn't, what's missing...",
55
- validate: (v) => v?.trim() ? void 0 : "Required"
56
- });
57
- if (answer === null) return void ui.warn("Cancelled.");
58
- message = answer.trim();
59
- }
60
- if (!message) throw new Error("Usage: superwall feedback \"<message>\"");
61
- const via = interactive ? "human" : "agent";
62
- const spin = interactive ? ui.spinner() : null;
63
- spin?.start("Sending your feedback");
64
- const ok = await submitFeedback(message, via);
65
- spin?.stop(ok ? "Sent" : "Failed to send");
66
- if (json) return ctx.output.data({ submitted: ok });
67
- if (!ok) throw new Error("Couldn't send your feedback - check your connection and try again.");
68
- ui.success("Thank you! We've received your feedback and will read through it. Really appreciate you helping us make the CLI better.");
69
- }
70
- });
71
-
72
- //#endregion
73
- export { runFeedback };
@@ -1,34 +0,0 @@
1
- import "./output-XKuoEEjP.js";
2
- import "./telemetry-EzV7cA7s.js";
3
- import "./update-Cz3Q3MFj.js";
4
- import "./token-r5g876aI.js";
5
- import { t as defineCommand } from "./command-BJ_6850A.js";
6
- import "./ui-4gLyfrgl.js";
7
- import "./skills-DsBAVRTE.js";
8
- import "./spawn-DSoTXy_j.js";
9
- import "./login-DS3MPeW2.js";
10
- import "./scan-DEgX5HxV.js";
11
- import "./hosted-DqGp6oV2.js";
12
- import "./spinner-DFctF_Jw.js";
13
- import "./resources-Bf9O1JNM.js";
14
- import "./org-CV8c849b.js";
15
- import "./bind-Ch4VR2EY.js";
16
- import { A as requireApi, n as runPushPipeline } from "./pipeline-J9-nENTS.js";
17
- import "./actions-BdZ-7BJd.js";
18
- import "./app-YeJj35Ia.js";
19
-
20
- //#region src/commands/paywalls/publish.ts
21
- const runPublish = defineCommand({
22
- name: "publish",
23
- output: "human",
24
- async run(context) {
25
- const api = await requireApi(context.interactive);
26
- await runPushPipeline({
27
- ...context,
28
- api
29
- }, { promote: true });
30
- }
31
- });
32
-
33
- //#endregion
34
- export { runPublish };
@@ -1,34 +0,0 @@
1
- import "./output-XKuoEEjP.js";
2
- import "./telemetry-EzV7cA7s.js";
3
- import "./update-Cz3Q3MFj.js";
4
- import "./token-r5g876aI.js";
5
- import { t as defineCommand } from "./command-BJ_6850A.js";
6
- import "./ui-4gLyfrgl.js";
7
- import "./skills-DsBAVRTE.js";
8
- import "./spawn-DSoTXy_j.js";
9
- import "./login-DS3MPeW2.js";
10
- import "./scan-DEgX5HxV.js";
11
- import "./hosted-DqGp6oV2.js";
12
- import "./spinner-DFctF_Jw.js";
13
- import "./resources-Bf9O1JNM.js";
14
- import "./org-CV8c849b.js";
15
- import "./bind-Ch4VR2EY.js";
16
- import { A as requireApi, n as runPushPipeline } from "./pipeline-J9-nENTS.js";
17
- import "./actions-BdZ-7BJd.js";
18
- import "./app-YeJj35Ia.js";
19
-
20
- //#region src/commands/paywalls/push.ts
21
- const runPush = defineCommand({
22
- name: "push",
23
- output: "human",
24
- async run(context) {
25
- const api = await requireApi(context.interactive);
26
- await runPushPipeline({
27
- ...context,
28
- api
29
- }, { promote: false });
30
- }
31
- });
32
-
33
- //#endregion
34
- export { runPush };
@@ -1,162 +0,0 @@
1
- # Responsive — every screen the paywall ships to
2
-
3
- A paywall is designed at one size and shipped to dozens. The studio's
4
- device presets are the contract: a paywall is finished when it is right
5
- on every one of them, in both schemes, in the presentation style its
6
- `config.ts` declares. This file says what "right" means at each size and
7
- how to get there without a second design.
8
-
9
- ## The sizes that matter
10
-
11
- | Preset | Logical size | What it tests |
12
- | --- | --- | --- |
13
- | iPhone SE | 375 × 667, no cutout | The shortest phone: does the pinned CTA still leave room for the content? 20px status bar, no home indicator |
14
- | Responsive at 320 | 320 wide (drag the frame's edge or type the width) | Narrowest width in the wild (older phones, split view). Nothing may overflow; display type must have shrunk. Keep dragging narrower and taller to find where the layout breaks |
15
- | iPhone 17 / Air / Pro Max | 402–440 × 874–956, island | The default. The tallest phones: does the layout use the height or leave a void above the CTA? |
16
- | Pixel 10 / Galaxy S25 | 412 × 915 / 360 × 780, Android | Android conventions, 24px status-bar floor, no bottom inset, 360-wide Galaxy is the second-narrowest common width |
17
- | iPad mini / iPad Pro 11″ | 744 × 1133 / 834 × 1194 | Tablet: a phone layout stretched to 800px is wrong; a centered column or a two-column reflow is right |
18
- | Desktop (web only) | 1440 × 900 | A web funnel in a browser: a phone-width column, centered; hover states; real keyboard focus |
19
- | Landscape | any preset rotated | Only where the app allows it. Cutout on the sides, 21px indicator, no status bar |
20
-
21
- The studio also switches what the paywall is *told* — platform, model,
22
- OS — so the inset floors and any `data-sw-*`-keyed CSS follow the preset.
23
-
24
- ## Width
25
-
26
- - **Fluid by default.** `width: 100%`, `max-width` for the reading
27
- column, `padding-inline: 20px` (16px at 320 if the design is tight).
28
- Never a fixed pixel width on anything wider than an icon.
29
- - **Type scales with `clamp()`**: a 40px display size on the reference is
30
- `clamp(2rem, 8vw, 2.5rem)` — 32px at 320, 40px at 393+, capped on
31
- tablets. Body text does not scale; it stays 15–17px everywhere.
32
- - **Rows of options** (plan cards, feature bullets) stack vertically on
33
- phones; side-by-side plan cards fit three across at 393 only when each
34
- is under 110px wide — check 320 and 360, where they usually can't.
35
- - **Pills and badges** ("Most popular", "Save 40%") wrap or truncate
36
- before they push the row wider; give them `white-space: nowrap` and
37
- the row `min-width: 0`, and check the longest locale.
38
- - `min-width: 0` on flex children with text, or a long product name
39
- breaks the row instead of wrapping.
40
-
41
- ## Height — the short phone is the hard one
42
-
43
- The iPhone SE's 667px, minus 20 status bar, minus a 120px pinned footer,
44
- leaves under 530px for everything else. Design for that, and the tall
45
- phones get more air, not a different layout.
46
-
47
- - **Content scrolls; the CTA never does.** With the footer sticky at the
48
- page's end, a page that doesn't fit simply scrolls under it. That is
49
- the entire strategy for short screens; do not shrink the CTA or hide
50
- the legal links to "make it fit".
51
- - **The shell is `flex: 1 1 auto`, never a viewport-height box.** The
52
- framework's wrapper is the one element sized to the viewport (with
53
- `100dvh`, so Safari's collapsing toolbar can't make it taller than what
54
- is visible); a shell with `min-height: 100dvh` of its own overflows the
55
- insets and scrolls.
56
- - **Vertical rhythm compresses before content is cut**: `gap`s of
57
- 24→16, a hero of `clamp(160px, 30dvh, 280px)` rather than a fixed 280,
58
- feature lists that lose a row of *spacing* at 667 rather than a
59
- feature. `@media (max-height: 700px)` is the switch for that.
60
- - A tall phone should not end with a void above the CTA: `margin-top:
61
- auto` on the actions block, or a hero that grows with `dvh`, uses the
62
- height.
63
- - A **short page** (three lines and a button) centers its content or
64
- pins it to the top by design; it does not stretch a card to fill the
65
- screen.
66
-
67
- ## Tablets
68
-
69
- - An iPad is not a big phone. Either **center a column** (`max-width:
70
- 34rem`, the same layout as the phone with more margin) or **reflow**
71
- (hero beside the copy, plan cards in a row) — the design reference
72
- decides; the column is the safe default when it says nothing.
73
- - Insets are small (24px top, 20px bottom) and a `modal` floats in the
74
- middle with 0 on every side; the framework sets both, so the phone CSS
75
- usually just works.
76
- - Tap targets can stay 44px; type does not grow much (cap display at the
77
- reference size); images do grow, so ship a 2× asset that survives
78
- 834px wide or cap the hero's width.
79
- - `data-sw-idiom="tablet"` on `:root` is the hook for tablet-only rules
80
- when a media query on width isn't the right question (a narrow iPad
81
- split view is still a tablet).
82
-
83
- ## Landscape
84
-
85
- Most apps lock portrait; `useDevice().orientation` says which state the
86
- paywall is in, live. Where landscape is allowed:
87
-
88
- - **The cutout moves to the sides** and the framework moves the insets
89
- with it (44/59px on both sides, top 0, bottom 21px), so the paywall's
90
- padding already clears the camera. Only a full-bleed design
91
- (`insets: "none"`) has to handle it, with `--sw-safe-area-inset-left`
92
- and `-right` on the chrome over the bleed.
93
- - Reflow to **two columns** (hero left, copy and CTA right) rather than
94
- shrinking the portrait layout; the `orientation` example is the
95
- reference.
96
- - Keep the CTA pinned; in landscape there is even less height, and the
97
- content scrolls in its column.
98
-
99
- ## Sheets, drawers and popups
100
-
101
- `presentation.style` changes the viewport the paywall lives in, and the
102
- studio shows it that way:
103
-
104
- - **`modal`** rises as a sheet below the status bar on phones, so the
105
- framework's top inset is 0 and the sheet's own grabber sits at the top:
106
- leave 16–20px above the first element, and don't draw a close button
107
- where the grabber is unless the design does. On iPad the sheet floats,
108
- and both insets are 0.
109
- - **`drawer`** takes the height you declared (`drawer.height`, a
110
- percentage); the paywall's viewport is that drawer, not the screen.
111
- Design for the declared height and check the tallest locale's copy
112
- fits or scrolls inside it.
113
- - **`popup`** is centered with the declared width and height and inset by
114
- the SDK; the framework's insets are 0 and the page is the popup's
115
- interior.
116
- No pinned footer with a gradient here — the popup is short enough that
117
- the CTA is simply the last element.
118
- - **Fullscreen and push** are the full screen: everything in
119
- [mobile-design.md](mobile-design.md) applies as written.
120
-
121
- ## Dynamic type and font scale
122
-
123
- - The host reports `fontScale` (Android) and
124
- `preferredContentSizeCategory` (iOS) in `useDevice()`. A paywall does
125
- not have to honor them — a webview doesn't scale text on its own — but
126
- a design that wants to should use `rem` for type and scale the root
127
- with the reported value, clamped to the range the layout survives
128
- (0.85–1.3 is a safe band).
129
- - Whatever the strategy, the pinned CTA keeps its height and the legal
130
- text stays legible; if anything gives, it is the hero.
131
-
132
- ## Locales are a responsive axis
133
-
134
- German and Finnish run 30% longer than English; Japanese runs shorter
135
- but taller. The studio's locale switch is part of the size matrix:
136
-
137
- - Buttons wrap to two lines rather than clip; set `min-height`, not
138
- `height`, on every button.
139
- - Plan cards with a price and a period per line need the longest
140
- formatted price (`$1,299.99/year`) checked, not `$9.99`.
141
- - Never `text-overflow: ellipsis` on a price, a CTA label or a legal
142
- line.
143
-
144
- ## The verification matrix
145
-
146
- Before hand-off, in the studio, walk every cell. Each takes seconds; a
147
- device bug found after promote takes a release.
148
-
149
- | | iPhone SE | 320 wide | Island phone | Pixel / Galaxy | iPad | Landscape\* | Desktop\*\* |
150
- | --- | --- | --- | --- | --- | --- | --- | --- |
151
- | Light | | | | | | | |
152
- | Dark | | | | | | | |
153
- | Longest locale | | | | | | | |
154
- | Configured presentation | | | | | | | |
155
- | Trial toggle (if any) | | | | | | | |
156
-
157
- \* where the app allows rotation · \*\* web platforms only
158
-
159
- What to look at in each cell: the close/back control against the bar and
160
- cutout, the CTA against the bottom edge, horizontal overflow, the last
161
- content row scrolling clear of the footer, and the unpriced state if the
162
- products aren't resolving.
File without changes