@superwall/cli 1.2.0 → 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 (50) hide show
  1. package/README.md +6 -4
  2. package/dist/{actions-DYQTxMXS.js → actions-DvHycH3X.js} +2 -2
  3. package/dist/{api-B2Zsf08U.js → api-B50i89j0.js} +9 -9
  4. package/dist/{api-output-B5hh0q4V.js → api-output-D9ggXQIr.js} +1 -1
  5. package/dist/{app-rYAP19Jo.js → app-FiC9SQVp.js} +11 -11
  6. package/dist/{asa-DlM6dlPD.js → asa-B5hrBL3t.js} +11 -11
  7. package/dist/{asc-D6qBCfuj.js → asc-CRtRYv17.js} +12 -12
  8. package/dist/{auth-BEnVvJlK.js → auth-CYognaF4.js} +10 -10
  9. package/dist/auth.js +2 -2
  10. package/dist/{billing-DO-gNWvW.js → billing-CSOUhWso.js} +1 -1
  11. package/dist/{bind-KZhPLTdC.js → bind-BbzBenoP.js} +4 -4
  12. package/dist/{command-B12qooZb.js → command-B7Te31wp.js} +93 -102
  13. package/dist/{create-BTEvRC1X.js → create--Q8nPgoa.js} +18 -18
  14. package/dist/{dev-CwfCGm36.js → dev-Dr6gXH-o.js} +37 -19
  15. package/dist/{doctor-DIxs8i8A.js → doctor-Cf0qNjbq.js} +10 -10
  16. package/dist/{drivers-D6Ka26e2.js → drivers-ItOmKzrw.js} +2 -2
  17. package/dist/entry.js +523 -467
  18. package/dist/{existing-CECenoHS.js → existing-B-e22WOr.js} +2 -2
  19. package/dist/{feedback-CV2coV73.js → feedback-C3UtAxye.js} +9 -9
  20. package/dist/{git-CCJwXufi.js → git-2wRxiwOc.js} +10 -10
  21. package/dist/{hosted-BCwzTTEw.js → hosted-vk05ZF6w.js} +3 -3
  22. package/dist/{integrate-Bhq0wkU0.js → integrate-Cv8r_i2l.js} +28 -27
  23. package/dist/{login-D5TjqsXJ.js → login-DOES7Kup.js} +8 -7
  24. package/dist/{migrate-Cz7VqQNj.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-ChRDxU9b.js → pipeline-BVeUA6Ig.js} +105 -98
  29. package/dist/{print-skill-BPePCjy4.js → print-skill-D-R81bno.js} +7 -7
  30. package/dist/{promote-C54bfsg3.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-CXjrBFow.js → query-CdcWSinl.js} +10 -10
  34. package/dist/{resource-CM2bIB5v.js → resource-PVg0uzSK.js} +13 -13
  35. package/dist/{resources-CVrWwA1K.js → resources-s64mBHaC.js} +1 -0
  36. package/dist/{run-CAIDPbwe.js → run-XIkrFIgw.js} +2 -2
  37. package/dist/{scan-BrikLKx5.js → scan-Dk0ZlCY6.js} +2 -2
  38. package/dist/{skills-BwXcAVIf.js → skills-B-mR2CqM.js} +4 -3
  39. package/dist/{skills-_TULXe09.js → skills-CoEIW0mE.js} +8 -8
  40. package/dist/{spinner-gOxIMz-V.js → spinner-B9dT3DBY.js} +1 -1
  41. package/dist/{telemetry-CpIXSAbQ.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-BNPbzr5V.js → upgrade-ByCYDXgb.js} +6 -6
  46. package/package.json +4 -4
  47. package/dist/json-C3hPIMkI.js +0 -7
  48. package/dist/publish-NUNSIKri.js +0 -35
  49. package/dist/push-BjEpY9-h.js +0 -35
  50. package/dist/update-BdcpwRu_.js +0 -137
@@ -1,8 +1,8 @@
1
- import { b as ASSET_HOST, k as VERSION } from "./telemetry-CpIXSAbQ.js";
2
- import { n as ApiError } from "./command-B12qooZb.js";
3
- import { n as ui } from "./ui-C4ncRJqd.js";
4
- import { S as pushPaywallVersion, T as versionProducts, a as createHeadlessPaywall, b as promotePaywallVersion, d as listAppPaywalls, g as livePaywall, m as listProjects, u as linkSourceCommit, v as mintSourceAccess, x as pushPaywallAssets, y as platformLabel } from "./resources-CVrWwA1K.js";
5
- import { _ as writeSnapshot, c as platformFor, d as describeBindings, f as readLock, g as writeBindings, h as writeBinding, n as pushSourceTree, o as writeProjectScaffold, p as removeBinding, s as describePlatforms, t as gitAvailable, u as resolveApps } from "./git-CCJwXufi.js";
1
+ import { g as VERSION, o as ASSET_HOST } from "./output-D2Ax_hHL.js";
2
+ import { n as ApiError } from "./command-B7Te31wp.js";
3
+ import { n as ui } from "./ui-Lqt_zFOr.js";
4
+ import { S as pushPaywallVersion, T as versionProducts, a as createHeadlessPaywall, b as promotePaywallVersion, d as listAppPaywalls, g as livePaywall, m as listProjects, u as linkSourceCommit, v as mintSourceAccess, x as pushPaywallAssets, y as platformLabel } from "./resources-s64mBHaC.js";
5
+ import { _ as writeSnapshot, c as platformFor, d as describeBindings, f as readLock, g as writeBindings, h as writeBinding, n as pushSourceTree, o as writeProjectScaffold, p as removeBinding, s as describePlatforms, t as gitAvailable, u as resolveApps } from "./git-2wRxiwOc.js";
6
6
  import { createRequire } from "node:module";
7
7
  import pc from "picocolors";
8
8
  import * as fs from "node:fs";
@@ -145,7 +145,7 @@ async function loadFramework(cwd) {
145
145
 
146
146
  //#endregion
147
147
  //#region src/core/paywalls/assets.ts
148
- const assetBaseUrl = (applicationId) => `${ASSET_HOST}/${applicationId}`;
148
+ const assetBaseUrl = (applicationId) => `${ASSET_HOST()}/${applicationId}`;
149
149
  function requireAssets(built) {
150
150
  if (!Array.isArray(built.assets)) throw new AssetSyncError("This project's superwall version builds snapshots without hosted assets — update the project's superwall dependency to push.");
151
151
  return built.assets;
@@ -561,66 +561,7 @@ async function resolveRenames(input) {
561
561
  }
562
562
 
563
563
  //#endregion
564
- //#region src/commands/paywalls/pick-app.ts
565
- async function pickApplicationOption(apps, platform) {
566
- const picked = await ui.select({
567
- message: platform ? `Which ${platformLabel(platform)} app do these paywalls push to? The choice is saved under apps in superwall.lock.` : "Which app do these paywalls belong to?",
568
- options: apps.map((app) => ({
569
- value: String(app.id),
570
- label: app.name ?? app.bundle_id ?? String(app.id),
571
- hint: platformLabel(app.platform)
572
- }))
573
- });
574
- if (!picked) return null;
575
- return apps.find((app) => String(app.id) === picked) ?? null;
576
- }
577
-
578
- //#endregion
579
- //#region src/commands/paywalls/pick-rename.ts
580
- const CREATE = "__create__";
581
- async function pickRenameOption(input) {
582
- const picked = await ui.select({
583
- message: `\`${input.newcomer.id}\` is not in superwall.lock. Is it a new ${input.newcomer.kind}, or renamed?`,
584
- options: [...input.orphans.map((orphan) => ({
585
- value: orphan.id,
586
- label: `Renamed from ${orphan.id}`,
587
- hint: describeBindings(orphan.bindings)
588
- })), {
589
- value: CREATE,
590
- label: `Create a new ${input.newcomer.kind}`
591
- }]
592
- });
593
- if (picked === null) throw new RenameError("Cancelled — superwall.lock is unchanged and nothing was pushed.");
594
- return picked === CREATE ? { kind: "create" } : {
595
- kind: "rename",
596
- orphanId: picked
597
- };
598
- }
599
-
600
- //#endregion
601
- //#region src/commands/paywalls/pick-stale.ts
602
- const REMOVE = "__remove__";
603
- const KEEP = "__keep__";
604
- async function pickStaleOption(orphan) {
605
- const picked = await ui.select({
606
- message: `\`${orphan.id}\` is bound to ${describeBindings(orphan.bindings)} but no longer exists on disk. Removing only forgets it locally — the paywall stays on Superwall, keeps its campaigns, and keeps serving devices.`,
607
- options: [{
608
- value: REMOVE,
609
- label: "Remove the binding",
610
- hint: "restoring the directory re-binds it on the next push"
611
- }, {
612
- value: KEEP,
613
- label: "Keep it",
614
- hint: "superwall.lock is left as it is"
615
- }],
616
- initialValue: REMOVE
617
- });
618
- if (picked === null) throw new RenameError("Cancelled — superwall.lock is unchanged and nothing was pushed.");
619
- return picked === REMOVE ? "remove" : "keep";
620
- }
621
-
622
- //#endregion
623
- //#region src/commands/paywalls/pipeline.ts
564
+ //#region src/commands/paywalls/pipeline/report.ts
624
565
  const kb = (bytes) => `${(bytes / 1024).toFixed(1)} kB`;
625
566
  const weight = (bytes) => bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).toFixed(1)} MB` : kb(bytes);
626
567
  const SHORT_SHA = 7;
@@ -643,6 +584,39 @@ const BIND_VERB = {
643
584
  renamed: "Rebound after rename to"
644
585
  };
645
586
  const LAYOUT_HINT = "expected superwall/{paywalls,funnels}/<id>/ with config.ts and app/index.tsx";
587
+ const NOTE_LIMIT = 2e3;
588
+ const PENDING_NAMES = 10;
589
+ function pendingPromoteWarning(pending, multi = false) {
590
+ if (pending.length === 0) return void 0;
591
+ const entries = pending.map((entry) => typeof entry === "string" ? { id: entry } : entry);
592
+ const ids = [...new Set(entries.map((entry) => entry.id))];
593
+ const platforms = new Set(entries.flatMap((entry) => entry.platform ? [entry.platform] : []));
594
+ const platformFlag = multi && platforms.size === 1 ? ` --platform ${[...platforms][0]}` : "";
595
+ const command = `superwall promote --id ${ids.join(",")}${platformFlag}`;
596
+ const labels = entries.map((entry) => multi && entry.platform ? `${entry.id} · ${entry.platform}` : entry.id);
597
+ if (labels.length === 1) return `${labels[0]} is pushed but not live — run \`${command}\` to publish it.`;
598
+ const shown = labels.slice(0, PENDING_NAMES).map((label) => ` ${label}`);
599
+ const rest = labels.length - shown.length;
600
+ return [
601
+ `These ${labels.length} paywalls are pushed but not live:`,
602
+ ...shown,
603
+ ...rest > 0 ? [` …and ${rest} more`] : [],
604
+ "",
605
+ ` ${command}`
606
+ ].join("\n");
607
+ }
608
+ function resolveNote(message) {
609
+ if (typeof message !== "string") return void 0;
610
+ if (message.length > NOTE_LIMIT) throw new Error(`Publish note is ${message.length} characters (limit ${NOTE_LIMIT}).`);
611
+ return message;
612
+ }
613
+ const took = (since) => {
614
+ const seconds = (Date.now() - since) / 1e3;
615
+ return pc.dim(seconds < 10 ? `(${seconds.toFixed(1)}s)` : `(${Math.round(seconds)}s)`);
616
+ };
617
+
618
+ //#endregion
619
+ //#region src/commands/paywalls/pipeline/selection.ts
646
620
  function projectDir(context) {
647
621
  const [first] = projectDirs(context);
648
622
  return first ?? process.cwd();
@@ -701,6 +675,68 @@ function requireClean(surfaces) {
701
675
  function needsWork(built, pushed, live) {
702
676
  return built !== pushed && built !== live;
703
677
  }
678
+
679
+ //#endregion
680
+ //#region src/commands/paywalls/pick-app.ts
681
+ async function pickApplicationOption(apps, platform) {
682
+ const picked = await ui.select({
683
+ message: platform ? `Which ${platformLabel(platform)} app do these paywalls push to? The choice is saved under apps in superwall.lock.` : "Which app do these paywalls belong to?",
684
+ options: apps.map((app) => ({
685
+ value: String(app.id),
686
+ label: app.name ?? app.bundle_id ?? String(app.id),
687
+ hint: platformLabel(app.platform)
688
+ }))
689
+ });
690
+ if (!picked) return null;
691
+ return apps.find((app) => String(app.id) === picked) ?? null;
692
+ }
693
+
694
+ //#endregion
695
+ //#region src/commands/paywalls/pick-rename.ts
696
+ const CREATE = "__create__";
697
+ async function pickRenameOption(input) {
698
+ const picked = await ui.select({
699
+ message: `\`${input.newcomer.id}\` is not in superwall.lock. Is it a new ${input.newcomer.kind}, or renamed?`,
700
+ options: [...input.orphans.map((orphan) => ({
701
+ value: orphan.id,
702
+ label: `Renamed from ${orphan.id}`,
703
+ hint: describeBindings(orphan.bindings)
704
+ })), {
705
+ value: CREATE,
706
+ label: `Create a new ${input.newcomer.kind}`
707
+ }]
708
+ });
709
+ if (picked === null) throw new RenameError("Cancelled — superwall.lock is unchanged and nothing was pushed.");
710
+ return picked === CREATE ? { kind: "create" } : {
711
+ kind: "rename",
712
+ orphanId: picked
713
+ };
714
+ }
715
+
716
+ //#endregion
717
+ //#region src/commands/paywalls/pick-stale.ts
718
+ const REMOVE = "__remove__";
719
+ const KEEP = "__keep__";
720
+ async function pickStaleOption(orphan) {
721
+ const picked = await ui.select({
722
+ message: `\`${orphan.id}\` is bound to ${describeBindings(orphan.bindings)} but no longer exists on disk. Removing only forgets it locally — the paywall stays on Superwall, keeps its campaigns, and keeps serving devices.`,
723
+ options: [{
724
+ value: REMOVE,
725
+ label: "Remove the binding",
726
+ hint: "restoring the directory re-binds it on the next push"
727
+ }, {
728
+ value: KEEP,
729
+ label: "Keep it",
730
+ hint: "superwall.lock is left as it is"
731
+ }],
732
+ initialValue: REMOVE
733
+ });
734
+ if (picked === null) throw new RenameError("Cancelled — superwall.lock is unchanged and nothing was pushed.");
735
+ return picked === REMOVE ? "remove" : "keep";
736
+ }
737
+
738
+ //#endregion
739
+ //#region src/commands/paywalls/pipeline/index.ts
704
740
  async function pooled(items, limit, work) {
705
741
  const results = new Array(items.length);
706
742
  let cursor = 0;
@@ -715,36 +751,6 @@ async function pooled(items, limit, work) {
715
751
  await Promise.all(runners);
716
752
  return results;
717
753
  }
718
- const NOTE_LIMIT = 2e3;
719
- const PENDING_NAMES = 10;
720
- function pendingPromoteWarning(pending, multi = false) {
721
- if (pending.length === 0) return void 0;
722
- const entries = pending.map((entry) => typeof entry === "string" ? { id: entry } : entry);
723
- const ids = [...new Set(entries.map((entry) => entry.id))];
724
- const platforms = new Set(entries.flatMap((entry) => entry.platform ? [entry.platform] : []));
725
- const platformFlag = multi && platforms.size === 1 ? ` --platform ${[...platforms][0]}` : "";
726
- const command = `superwall promote --id ${ids.join(",")}${platformFlag}`;
727
- const labels = entries.map((entry) => multi && entry.platform ? `${entry.id} · ${entry.platform}` : entry.id);
728
- if (labels.length === 1) return `${labels[0]} is pushed but not live — run \`${command}\` to publish it.`;
729
- const shown = labels.slice(0, PENDING_NAMES).map((label) => ` ${label}`);
730
- const rest = labels.length - shown.length;
731
- return [
732
- `These ${labels.length} paywalls are pushed but not live:`,
733
- ...shown,
734
- ...rest > 0 ? [` …and ${rest} more`] : [],
735
- "",
736
- ` ${command}`
737
- ].join("\n");
738
- }
739
- function resolveNote(message) {
740
- if (typeof message !== "string") return void 0;
741
- if (message.length > NOTE_LIMIT) throw new Error(`Publish note is ${message.length} characters (limit ${NOTE_LIMIT}).`);
742
- return message;
743
- }
744
- const took = (since) => {
745
- const seconds = (Date.now() - since) / 1e3;
746
- return pc.dim(seconds < 10 ? `(${seconds.toFixed(1)}s)` : `(${Math.round(seconds)}s)`);
747
- };
748
754
  async function timed(work) {
749
755
  const at = Date.now();
750
756
  return {
@@ -930,7 +936,8 @@ async function runPushPipeline(context, options) {
930
936
  surface: surface.id,
931
937
  assets: synced.value.assets,
932
938
  products: versionProducts(build.products, target.platform),
933
- settings: build.settings
939
+ settings: build.settings,
940
+ locales: build.locales
934
941
  }));
935
942
  version = push.value.version;
936
943
  writeSnapshot(project.superwallDir, surface.kind, surface.id, target.platform, build.snapshotId);
@@ -979,4 +986,4 @@ async function runPushPipeline(context, options) {
979
986
  }
980
987
 
981
988
  //#endregion
982
- export { syncAssets as C, writeProjectTypes as D, collectProjectDeclarations as E, requireAssets as S, loadFramework as T, planTargets as _, requireProject as a, resolveBinding as b, timed as c, pushSource as d, collectSourceFiles as f, parsePlatformFlags as g, projectForApplication as h, projectDirs as i, transition as l, fetchProducts as m, group as n, runPushPipeline as o, warnNotPortable as p, projectDir as r, selectSurfaces as s, LAYOUT_HINT as t, pickApplicationOption as u, targetLabel as v, frameworkVersion as w, assetBaseUrl as x, wantedPlatforms as y };
989
+ export { syncAssets as C, writeProjectTypes as D, collectProjectDeclarations as E, requireAssets as S, loadFramework as T, planTargets as _, projectDir as a, resolveBinding as b, selectSurfaces as c, pushSource as d, collectSourceFiles as f, parsePlatformFlags as g, projectForApplication as h, pickApplicationOption as i, LAYOUT_HINT as l, fetchProducts as m, runPushPipeline as n, projectDirs as o, warnNotPortable as p, timed as r, requireProject as s, group as t, transition as u, targetLabel as v, frameworkVersion as w, assetBaseUrl as x, wantedPlatforms as y };
@@ -1,11 +1,11 @@
1
- import { i as track, r as setTelemetryTags } from "./telemetry-CpIXSAbQ.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./ui-C4ncRJqd.js";
4
- import { i as loadBundledSkill } from "./skills-BwXcAVIf.js";
1
+ import "./output-D2Ax_hHL.js";
2
+ import { i as track, r as setTelemetryTags } from "./telemetry-yJs7t0rt.js";
3
+ import "./ui-Lqt_zFOr.js";
4
+ import { i as loadBundledSkill } from "./skills-B-mR2CqM.js";
5
5
  import "./spawn-DSoTXy_j.js";
6
- import { t as scanProject } from "./scan-BrikLKx5.js";
7
- import { n as FRAMEWORK_REF } from "./actions-DYQTxMXS.js";
8
- import { t as detectBilling } from "./billing-DO-gNWvW.js";
6
+ import { t as scanProject } from "./scan-Dk0ZlCY6.js";
7
+ import { n as FRAMEWORK_REF } from "./actions-DvHycH3X.js";
8
+ import { t as detectBilling } from "./billing-CSOUhWso.js";
9
9
  import { resolve } from "node:path";
10
10
 
11
11
  //#region src/commands/workflow/print-skill.ts
@@ -1,22 +1,22 @@
1
- import { k as VERSION } from "./telemetry-CpIXSAbQ.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-BdcpwRu_.js";
4
- import "./token-DHRH8cxi.js";
5
- import { n as ApiError, t as defineCommand } from "./command-B12qooZb.js";
6
- import { n as ui } from "./ui-C4ncRJqd.js";
7
- import "./skills-BwXcAVIf.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 { n as ApiError, 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-D5TjqsXJ.js";
10
- import "./scan-BrikLKx5.js";
11
- import "./hosted-BCwzTTEw.js";
12
- import "./spinner-gOxIMz-V.js";
13
- import { _ as livePaywallVersion, b as promotePaywallVersion } from "./resources-CVrWwA1K.js";
14
- import "./org-B2gy9Pmu.js";
15
- import "./bind-KZhPLTdC.js";
16
- import { i as requireApi, u as resolveApps } from "./git-CCJwXufi.js";
17
- import "./actions-DYQTxMXS.js";
18
- import "./app-rYAP19Jo.js";
19
- import { E as collectProjectDeclarations, T as loadFramework, _ as planTargets, b as resolveBinding, c as timed, g as parsePlatformFlags, l as transition, n as group, r as projectDir, s as selectSurfaces, u as pickApplicationOption, v as targetLabel, y as wantedPlatforms } from "./pipeline-ChRDxU9b.js";
9
+ import "./login-DOES7Kup.js";
10
+ import "./scan-Dk0ZlCY6.js";
11
+ import "./hosted-vk05ZF6w.js";
12
+ import "./spinner-B9dT3DBY.js";
13
+ import { _ as livePaywallVersion, b as promotePaywallVersion } from "./resources-s64mBHaC.js";
14
+ import "./org-Cg25bcsj.js";
15
+ import "./bind-BbzBenoP.js";
16
+ import { i as requireApi, u as resolveApps } from "./git-2wRxiwOc.js";
17
+ import "./actions-DvHycH3X.js";
18
+ import "./app-FiC9SQVp.js";
19
+ import { E as collectProjectDeclarations, T as loadFramework, _ as planTargets, a as projectDir, b as resolveBinding, c as selectSurfaces, g as parsePlatformFlags, i as pickApplicationOption, r as timed, t as group, u as transition, v as targetLabel, y as wantedPlatforms } from "./pipeline-BVeUA6Ig.js";
20
20
  import pc from "picocolors";
21
21
 
22
22
  //#region src/commands/paywalls/promote.ts
@@ -0,0 +1,35 @@
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
+ import "./spawn-DSoTXy_j.js";
9
+ import "./login-DOES7Kup.js";
10
+ import "./scan-Dk0ZlCY6.js";
11
+ import "./hosted-vk05ZF6w.js";
12
+ import "./spinner-B9dT3DBY.js";
13
+ import "./resources-s64mBHaC.js";
14
+ import "./org-Cg25bcsj.js";
15
+ import "./bind-BbzBenoP.js";
16
+ import { i as requireApi } from "./git-2wRxiwOc.js";
17
+ import "./actions-DvHycH3X.js";
18
+ import "./app-FiC9SQVp.js";
19
+ import { n as runPushPipeline } from "./pipeline-BVeUA6Ig.js";
20
+
21
+ //#region src/commands/paywalls/publish.ts
22
+ const runPublish = defineCommand({
23
+ name: "publish",
24
+ output: "human",
25
+ async run(context) {
26
+ const api = await requireApi(context.interactive);
27
+ await runPushPipeline({
28
+ ...context,
29
+ api
30
+ }, { promote: true });
31
+ }
32
+ });
33
+
34
+ //#endregion
35
+ export { runPublish };
@@ -0,0 +1,35 @@
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
+ import "./spawn-DSoTXy_j.js";
9
+ import "./login-DOES7Kup.js";
10
+ import "./scan-Dk0ZlCY6.js";
11
+ import "./hosted-vk05ZF6w.js";
12
+ import "./spinner-B9dT3DBY.js";
13
+ import "./resources-s64mBHaC.js";
14
+ import "./org-Cg25bcsj.js";
15
+ import "./bind-BbzBenoP.js";
16
+ import { i as requireApi } from "./git-2wRxiwOc.js";
17
+ import "./actions-DvHycH3X.js";
18
+ import "./app-FiC9SQVp.js";
19
+ import { n as runPushPipeline } from "./pipeline-BVeUA6Ig.js";
20
+
21
+ //#region src/commands/paywalls/push.ts
22
+ const runPush = defineCommand({
23
+ name: "push",
24
+ output: "human",
25
+ async run(context) {
26
+ const api = await requireApi(context.interactive);
27
+ await runPushPipeline({
28
+ ...context,
29
+ api
30
+ }, { promote: false });
31
+ }
32
+ });
33
+
34
+ //#endregion
35
+ export { runPush };
@@ -1,13 +1,13 @@
1
- import "./telemetry-CpIXSAbQ.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-BdcpwRu_.js";
4
- import "./token-DHRH8cxi.js";
5
- import { t as defineCommand } from "./command-B12qooZb.js";
6
- import "./ui-C4ncRJqd.js";
7
- import "./spinner-gOxIMz-V.js";
8
- import "./resources-CVrWwA1K.js";
9
- import { t as requireOrg } from "./org-B2gy9Pmu.js";
10
- import { t as apiCall } from "./api-output-B5hh0q4V.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 "./spinner-B9dT3DBY.js";
8
+ import "./resources-s64mBHaC.js";
9
+ import { t as requireOrg } from "./org-Cg25bcsj.js";
10
+ import { t as apiCall } from "./api-output-D9ggXQIr.js";
11
11
  import { readFileSync } from "node:fs";
12
12
 
13
13
  //#region src/commands/platform/query.ts
@@ -1,16 +1,16 @@
1
- import { c as getDefaultApp, m as setDefaultApp } from "./telemetry-CpIXSAbQ.js";
2
- import { t as formatJson } from "./json-C3hPIMkI.js";
3
- import { o as blocks } from "./update-BdcpwRu_.js";
4
- import "./token-DHRH8cxi.js";
5
- import { n as ApiError, t as defineCommand } from "./command-B12qooZb.js";
6
- import "./ui-C4ncRJqd.js";
7
- import { t as scanProject } from "./scan-BrikLKx5.js";
8
- import { t as detectExisting } from "./existing-CECenoHS.js";
9
- import "./spinner-gOxIMz-V.js";
10
- import { C as rowName, c as getPaywallApplicationId, h as listResource, i as createEntitlement, l as isAppScoped, m as listProjects, n as createApplication, o as createProduct, p as listOrganizations, r as createCampaign, s as createProject, t as addPlacement, w as titleCase, y as platformLabel } from "./resources-CVrWwA1K.js";
11
- import { t as requireOrg } from "./org-B2gy9Pmu.js";
12
- import { t as platformForIntegration } from "./bind-KZhPLTdC.js";
13
- import { t as apiCall } from "./api-output-B5hh0q4V.js";
1
+ import { r as formatJson, t as blocks } from "./output-D2Ax_hHL.js";
2
+ import { f as setDefaultApp, o as getDefaultApp } from "./telemetry-yJs7t0rt.js";
3
+ import "./update-B4hoLAN-.js";
4
+ import "./token-GcbyH6G8.js";
5
+ import { n as ApiError, t as defineCommand } from "./command-B7Te31wp.js";
6
+ import "./ui-Lqt_zFOr.js";
7
+ import { t as scanProject } from "./scan-Dk0ZlCY6.js";
8
+ import { t as detectExisting } from "./existing-B-e22WOr.js";
9
+ import "./spinner-B9dT3DBY.js";
10
+ import { C as rowName, c as getPaywallApplicationId, h as listResource, i as createEntitlement, l as isAppScoped, m as listProjects, n as createApplication, o as createProduct, p as listOrganizations, r as createCampaign, s as createProject, t as addPlacement, w as titleCase, y as platformLabel } from "./resources-s64mBHaC.js";
11
+ import { t as requireOrg } from "./org-Cg25bcsj.js";
12
+ import { t as platformForIntegration } from "./bind-BbzBenoP.js";
13
+ import { t as apiCall } from "./api-output-D9ggXQIr.js";
14
14
  import { t as generateStoreKit } from "./storekit-DPonXSwe.js";
15
15
  import * as fs from "node:fs";
16
16
  import { writeFileSync } from "node:fs";
@@ -179,6 +179,7 @@ function pushPaywallVersion(api, paywallId, opts) {
179
179
  ...opts.surface ? { surface: opts.surface } : {},
180
180
  ...opts.assets && opts.assets.length > 0 ? { assets: opts.assets } : {},
181
181
  ...opts.products && opts.products.length > 0 ? { products: opts.products } : {},
182
+ ...opts.locales && opts.locales.length > 0 ? { locales: opts.locales } : {},
182
183
  ...opts.settings ?? {}
183
184
  });
184
185
  }
@@ -1,5 +1,5 @@
1
- import { C as DASHBOARD_URL } from "./telemetry-CpIXSAbQ.js";
2
- import { s as packagedDir } from "./skills-BwXcAVIf.js";
1
+ import { l as DASHBOARD_URL } from "./output-D2Ax_hHL.js";
2
+ import { s as packagedDir } from "./skills-B-mR2CqM.js";
3
3
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
5
 
@@ -1,4 +1,4 @@
1
- import { T as Integration } from "./telemetry-CpIXSAbQ.js";
1
+ import { d as Integration } from "./output-D2Ax_hHL.js";
2
2
  import { existsSync, readFileSync } from "node:fs";
3
3
  import { basename, dirname, join, relative, sep } from "node:path";
4
4
  import fg from "fast-glob";
@@ -45,7 +45,7 @@ const supportedNames = Object.values(frameworkByIntegration).filter((f) => f.sup
45
45
  const SUPPORTED_LABEL = supportedNames.length > 1 ? `${supportedNames.slice(0, -1).join(", ")}, or ${supportedNames.at(-1)}` : supportedNames[0] ?? "";
46
46
 
47
47
  //#endregion
48
- //#region src/util/fs.ts
48
+ //#region src/core/project/package.ts
49
49
  function readPackageJson(dir) {
50
50
  try {
51
51
  return JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
@@ -1,11 +1,12 @@
1
- import { _ as setSkillsSync, f as getSkillsSync, i as track, k as VERSION } from "./telemetry-CpIXSAbQ.js";
2
- import { n as ui } from "./ui-C4ncRJqd.js";
1
+ import { g as VERSION } from "./output-D2Ax_hHL.js";
2
+ import { h as setSkillsSync, i as track, u as getSkillsSync } from "./telemetry-yJs7t0rt.js";
3
+ import { n as ui } from "./ui-Lqt_zFOr.js";
3
4
  import { r as spawnStream } from "./spawn-DSoTXy_j.js";
4
5
  import { existsSync, readFileSync } from "node:fs";
5
6
  import { dirname, join } from "node:path";
6
7
  import { fileURLToPath } from "node:url";
7
8
 
8
- //#region src/util/assets.ts
9
+ //#region src/packaged.ts
9
10
  const moduleDir = dirname(fileURLToPath(import.meta.url));
10
11
  let root;
11
12
  /** The package root: nearest ancestor with a package.json (repo in dev, install dir in prod). */
@@ -1,12 +1,12 @@
1
- import "./telemetry-CpIXSAbQ.js";
2
- import "./json-C3hPIMkI.js";
3
- import "./update-BdcpwRu_.js";
4
- import "./token-DHRH8cxi.js";
5
- import { t as defineCommand } from "./command-B12qooZb.js";
6
- import { n as ui } from "./ui-C4ncRJqd.js";
7
- import { a as skillsOutOfDate, o as syncSkills, r as fetchPublicSkills, t as SUPERWALL_SKILLS_SOURCE } from "./skills-BwXcAVIf.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 { n as ui } from "./ui-Lqt_zFOr.js";
7
+ import { a as skillsOutOfDate, o as syncSkills, r as fetchPublicSkills, t as SUPERWALL_SKILLS_SOURCE } from "./skills-B-mR2CqM.js";
8
8
  import "./spawn-DSoTXy_j.js";
9
- import { t as withSpinner } from "./spinner-gOxIMz-V.js";
9
+ import { t as withSpinner } from "./spinner-B9dT3DBY.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-C4ncRJqd.js";
1
+ import { n as ui } from "./ui-Lqt_zFOr.js";
2
2
 
3
3
  //#region src/ui/spinner.ts
4
4
  async function withSpinner(label, work) {
@@ -1,37 +1,12 @@
1
- import { t as formatJson } from "./json-C3hPIMkI.js";
1
+ import { g as VERSION, h as TELEMETRY_KEY, m as TELEMETRY_HOST, p as SUPERWALL_HOME, r as formatJson, v as isNonInteractive } from "./output-D2Ax_hHL.js";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
4
4
  import { homedir } from "node:os";
5
5
  import { join } from "node:path";
6
6
 
7
- //#region package.json
8
- var version = "1.2.0";
9
-
10
- //#endregion
11
- //#region src/constants.ts
12
- const VERSION = version;
13
- const DASHBOARD_URL = "https://superwall.com/dashboard";
14
- const ENV_API_KEY = "SUPERWALL_API_KEY";
15
- const AUTH_HOST = process.env.SUPERWALL_AUTH_HOST ?? "https://auth.superwall.com";
16
- const ASSET_HOST = process.env.SUPERWALL_ASSET_HOST ?? "https://user-content.superwalleditor.com/user-content/hl";
17
- const API_HOST = process.env.SUPERWALL_API_HOST ?? "https://api.superwall.com";
18
- const CLI_CLIENT_ID = process.env.SUPERWALL_CLI_CLIENT_ID ?? "client_01KWEWM154D2T28NZAS02B8MWT";
19
- const OAUTH_SCOPE = "openid profile email offline_access";
20
- const TELEMETRY_HOST = process.env.SUPERWALL_TELEMETRY_HOST ?? "https://us.i.posthog.com";
21
- const TELEMETRY_KEY = process.env.SUPERWALL_TELEMETRY_KEY ?? "phc_obWpK8cuSfhNkZUKmDByATHp928RHPRD5DoMEDreAHS6";
22
- let Integration = /* @__PURE__ */ function(Integration$1) {
23
- Integration$1["swift"] = "swift";
24
- Integration$1["expo"] = "expo";
25
- Integration$1["reactNative"] = "react-native";
26
- Integration$1["flutter"] = "flutter";
27
- Integration$1["web"] = "web";
28
- return Integration$1;
29
- }({});
30
-
31
- //#endregion
32
7
  //#region src/core/state/config.ts
33
8
  function dir() {
34
- return join(homedir(), ".superwall");
9
+ return SUPERWALL_HOME() ?? join(homedir(), ".superwall");
35
10
  }
36
11
  function file() {
37
12
  return join(dir(), "config.json");
@@ -133,16 +108,6 @@ function setTelemetryNoticeShown() {
133
108
  write(config);
134
109
  }
135
110
 
136
- //#endregion
137
- //#region src/util/env.ts
138
- function apiKeyFromEnv() {
139
- const v = process.env[ENV_API_KEY];
140
- return v && v.trim() ? v.trim() : void 0;
141
- }
142
- function isNonInteractive() {
143
- return !process.stdout.isTTY || !process.stdin.isTTY || process.env.CI === "true";
144
- }
145
-
146
111
  //#endregion
147
112
  //#region src/core/telemetry.ts
148
113
  const tags = {};
@@ -154,7 +119,7 @@ function isTelemetryEnabled(env, key) {
154
119
  return Boolean(key) && !env.DO_NOT_TRACK && !env.SUPERWALL_TELEMETRY_DISABLED && !env.NODE_TEST_CONTEXT;
155
120
  }
156
121
  function telemetryEnabled() {
157
- return isTelemetryEnabled(process.env, TELEMETRY_KEY);
122
+ return isTelemetryEnabled(process.env, TELEMETRY_KEY());
158
123
  }
159
124
  /**
160
125
  * Fully anonymous by design: distinct_id is a random persisted UUID never
@@ -163,7 +128,7 @@ function telemetryEnabled() {
163
128
  */
164
129
  function buildEvent(event, props, distinctId) {
165
130
  return {
166
- api_key: TELEMETRY_KEY,
131
+ api_key: TELEMETRY_KEY(),
167
132
  event,
168
133
  distinct_id: distinctId,
169
134
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
@@ -182,7 +147,7 @@ function track(event, props = {}) {
182
147
  if (!telemetryEnabled()) return;
183
148
  try {
184
149
  const payload = buildEvent(event, props, getAnonymousId());
185
- pending.push(fetch(`${TELEMETRY_HOST}/capture/`, {
150
+ pending.push(fetch(`${TELEMETRY_HOST()}/capture/`, {
186
151
  method: "POST",
187
152
  headers: { "content-type": "application/json" },
188
153
  body: JSON.stringify(payload),
@@ -201,4 +166,4 @@ function maybeShowTelemetryNotice(ui) {
201
166
  }
202
167
 
203
168
  //#endregion
204
- export { DASHBOARD_URL as C, TELEMETRY_HOST as D, OAUTH_SCOPE as E, TELEMETRY_KEY as O, CLI_CLIENT_ID as S, Integration as T, setSkillsSync as _, apiKeyFromEnv as a, ASSET_HOST as b, getDefaultApp as c, getOnboardingIdempotencyKey as d, getSkillsSync as f, setOnboardedOrg as g, setOnboardedApp as h, track as i, VERSION as k, getOnboardedApp as l, setDefaultApp as m, maybeShowTelemetryNotice as n, isNonInteractive as o, getUpdateCheck as p, setTelemetryTags as r, getAnonymousId as s, flushTelemetry as t, getOnboardedOrg as u, setUpdateCheck as v, ENV_API_KEY as w, AUTH_HOST as x, API_HOST as y };
169
+ export { getAnonymousId as a, getOnboardedOrg as c, getUpdateCheck as d, setDefaultApp as f, setUpdateCheck as g, setSkillsSync as h, track as i, getOnboardingIdempotencyKey as l, setOnboardedOrg as m, maybeShowTelemetryNotice as n, getDefaultApp as o, setOnboardedApp as p, setTelemetryTags as r, getOnboardedApp as s, flushTelemetry as t, getSkillsSync as u };
@@ -1,4 +1,4 @@
1
- import { t as formatJson } from "./json-C3hPIMkI.js";
1
+ import { p as SUPERWALL_HOME, r as formatJson } from "./output-D2Ax_hHL.js";
2
2
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { join } from "node:path";
@@ -14,7 +14,7 @@ var NotLoggedInError = class extends Error {
14
14
  //#endregion
15
15
  //#region src/core/auth/storage.ts
16
16
  function dir() {
17
- return join(homedir(), ".superwall");
17
+ return SUPERWALL_HOME() ?? join(homedir(), ".superwall");
18
18
  }
19
19
  function file() {
20
20
  return join(dir(), "auth.json");
@@ -27656,6 +27656,10 @@ function selectRenderer(opts) {
27656
27656
  active = mode === "rich" ? inkRenderer : mode === "json" ? silentRenderer : plainRenderer;
27657
27657
  return active;
27658
27658
  }
27659
+ function useRenderer(renderer$1) {
27660
+ active = renderer$1;
27661
+ return renderer$1;
27662
+ }
27659
27663
  const silentRenderer = {
27660
27664
  start: () => {},
27661
27665
  stop: () => {},
@@ -27700,4 +27704,4 @@ const ui = {
27700
27704
  };
27701
27705
 
27702
27706
  //#endregion
27703
- export { fg as a, THEME as i, ui as n, stripReport as r, selectRenderer as t };
27707
+ export { THEME as a, stripReport as i, ui as n, fg as o, useRenderer as r, selectRenderer as t };