@superwall/cli 1.2.0 → 1.3.0-beta.4
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.
- package/README.md +6 -4
- package/dist/{actions-DYQTxMXS.js → actions-C0sUjLGZ.js} +2 -2
- package/dist/{api-B2Zsf08U.js → api-NEcc9ESi.js} +9 -9
- package/dist/{api-output-B5hh0q4V.js → api-output-D9ggXQIr.js} +1 -1
- package/dist/{app-rYAP19Jo.js → app-vECLIkWi.js} +11 -11
- package/dist/{asa-DlM6dlPD.js → asa-CZcmgOho.js} +11 -11
- package/dist/{asc-D6qBCfuj.js → asc-mJv5I7lW.js} +12 -12
- package/dist/{auth-BEnVvJlK.js → auth-BCsxGMUQ.js} +10 -10
- package/dist/auth.js +2 -2
- package/dist/{billing-DO-gNWvW.js → billing-KoxHLZzm.js} +1 -1
- package/dist/{bind-KZhPLTdC.js → bind-CBLvcdzo.js} +4 -4
- package/dist/{command-B12qooZb.js → command-Bav1fWvv.js} +93 -102
- package/dist/{create-BTEvRC1X.js → create-CA_s5fN9.js} +18 -18
- package/dist/{dev-CwfCGm36.js → dev-B1o8OCRT.js} +37 -19
- package/dist/{doctor-DIxs8i8A.js → doctor-CyiygODt.js} +10 -10
- package/dist/{drivers-D6Ka26e2.js → drivers-DSkM9kMJ.js} +2 -2
- package/dist/entry.js +523 -467
- package/dist/{existing-CECenoHS.js → existing-D7p2hnhq.js} +2 -2
- package/dist/{feedback-CV2coV73.js → feedback-BBIkn1Yp.js} +9 -9
- package/dist/{git-CCJwXufi.js → git-C0x00Urq.js} +10 -10
- package/dist/{hosted-BCwzTTEw.js → hosted-q7_n5udj.js} +3 -3
- package/dist/{integrate-Bhq0wkU0.js → integrate-DstRn_NP.js} +28 -27
- package/dist/{login-D5TjqsXJ.js → login-DGc6GQqT.js} +8 -7
- package/dist/{migrate-Cz7VqQNj.js → migrate-CcwiRU6G.js} +20 -20
- package/dist/{org-B2gy9Pmu.js → org-Cg25bcsj.js} +3 -3
- package/dist/output-DmEUd7Xa.js +123 -0
- package/dist/{params-Bvq0iqQK.js → params-B1zeElGa.js} +1 -2
- package/dist/{pipeline-ChRDxU9b.js → pipeline-B3c4tjfA.js} +105 -98
- package/dist/{print-skill-BPePCjy4.js → print-skill-DBEmY01G.js} +7 -7
- package/dist/{promote-C54bfsg3.js → promote-bg_Li4za.js} +18 -18
- package/dist/publish-lviGUOF8.js +35 -0
- package/dist/push-C8vuasQL.js +35 -0
- package/dist/{query-CXjrBFow.js → query-dO6QUMTQ.js} +10 -10
- package/dist/{resource-CM2bIB5v.js → resource-BZvGoZlY.js} +13 -13
- package/dist/{resources-CVrWwA1K.js → resources-s64mBHaC.js} +1 -0
- package/dist/{run-CAIDPbwe.js → run-BfI8NVh4.js} +2 -2
- package/dist/{scan-BrikLKx5.js → scan-HfLbAkLc.js} +2 -2
- package/dist/{skills-BwXcAVIf.js → skills-BDMwScz3.js} +4 -3
- package/dist/{skills-_TULXe09.js → skills-DuI61I8U.js} +8 -8
- package/dist/{spinner-gOxIMz-V.js → spinner-B9dT3DBY.js} +1 -1
- package/dist/{telemetry-CpIXSAbQ.js → telemetry-vvgwHwjA.js} +6 -41
- package/dist/{token-DHRH8cxi.js → token-CwKfB5Ic.js} +2 -2
- package/dist/{ui-C4ncRJqd.js → ui-Lqt_zFOr.js} +5 -1
- package/dist/update-DeK9OQ5x.js +59 -0
- package/dist/{upgrade-BNPbzr5V.js → upgrade-Dyxk8mwJ.js} +6 -6
- package/package.json +4 -4
- package/dist/json-C3hPIMkI.js +0 -7
- package/dist/publish-NUNSIKri.js +0 -35
- package/dist/push-BjEpY9-h.js +0 -35
- package/dist/update-BdcpwRu_.js +0 -137
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as ApiError } from "./command-
|
|
3
|
-
import { n as ui } from "./ui-
|
|
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-
|
|
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-
|
|
1
|
+
import { g as VERSION, o as ASSET_HOST } from "./output-DmEUd7Xa.js";
|
|
2
|
+
import { n as ApiError } from "./command-Bav1fWvv.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-C0x00Urq.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/
|
|
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 _,
|
|
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
|
|
2
|
-
import "./
|
|
3
|
-
import "./ui-
|
|
4
|
-
import { i as loadBundledSkill } from "./skills-
|
|
1
|
+
import "./output-DmEUd7Xa.js";
|
|
2
|
+
import { i as track, r as setTelemetryTags } from "./telemetry-vvgwHwjA.js";
|
|
3
|
+
import "./ui-Lqt_zFOr.js";
|
|
4
|
+
import { i as loadBundledSkill } from "./skills-BDMwScz3.js";
|
|
5
5
|
import "./spawn-DSoTXy_j.js";
|
|
6
|
-
import { t as scanProject } from "./scan-
|
|
7
|
-
import { n as FRAMEWORK_REF } from "./actions-
|
|
8
|
-
import { t as detectBilling } from "./billing-
|
|
6
|
+
import { t as scanProject } from "./scan-HfLbAkLc.js";
|
|
7
|
+
import { n as FRAMEWORK_REF } from "./actions-C0sUjLGZ.js";
|
|
8
|
+
import { t as detectBilling } from "./billing-KoxHLZzm.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 {
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { n as ApiError, t as defineCommand } from "./command-
|
|
6
|
-
import { n as ui } from "./ui-
|
|
7
|
-
import "./skills-
|
|
1
|
+
import { g as VERSION } from "./output-DmEUd7Xa.js";
|
|
2
|
+
import "./telemetry-vvgwHwjA.js";
|
|
3
|
+
import "./update-DeK9OQ5x.js";
|
|
4
|
+
import "./token-CwKfB5Ic.js";
|
|
5
|
+
import { n as ApiError, t as defineCommand } from "./command-Bav1fWvv.js";
|
|
6
|
+
import { n as ui } from "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./skills-BDMwScz3.js";
|
|
8
8
|
import "./spawn-DSoTXy_j.js";
|
|
9
|
-
import "./login-
|
|
10
|
-
import "./scan-
|
|
11
|
-
import "./hosted-
|
|
12
|
-
import "./spinner-
|
|
13
|
-
import { _ as livePaywallVersion, b as promotePaywallVersion } from "./resources-
|
|
14
|
-
import "./org-
|
|
15
|
-
import "./bind-
|
|
16
|
-
import { i as requireApi, u as resolveApps } from "./git-
|
|
17
|
-
import "./actions-
|
|
18
|
-
import "./app-
|
|
19
|
-
import { E as collectProjectDeclarations, T as loadFramework, _ as planTargets, b as resolveBinding, c as
|
|
9
|
+
import "./login-DGc6GQqT.js";
|
|
10
|
+
import "./scan-HfLbAkLc.js";
|
|
11
|
+
import "./hosted-q7_n5udj.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-CBLvcdzo.js";
|
|
16
|
+
import { i as requireApi, u as resolveApps } from "./git-C0x00Urq.js";
|
|
17
|
+
import "./actions-C0sUjLGZ.js";
|
|
18
|
+
import "./app-vECLIkWi.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-B3c4tjfA.js";
|
|
20
20
|
import pc from "picocolors";
|
|
21
21
|
|
|
22
22
|
//#region src/commands/paywalls/promote.ts
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "./output-DmEUd7Xa.js";
|
|
2
|
+
import "./telemetry-vvgwHwjA.js";
|
|
3
|
+
import "./update-DeK9OQ5x.js";
|
|
4
|
+
import "./token-CwKfB5Ic.js";
|
|
5
|
+
import { t as defineCommand } from "./command-Bav1fWvv.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./skills-BDMwScz3.js";
|
|
8
|
+
import "./spawn-DSoTXy_j.js";
|
|
9
|
+
import "./login-DGc6GQqT.js";
|
|
10
|
+
import "./scan-HfLbAkLc.js";
|
|
11
|
+
import "./hosted-q7_n5udj.js";
|
|
12
|
+
import "./spinner-B9dT3DBY.js";
|
|
13
|
+
import "./resources-s64mBHaC.js";
|
|
14
|
+
import "./org-Cg25bcsj.js";
|
|
15
|
+
import "./bind-CBLvcdzo.js";
|
|
16
|
+
import { i as requireApi } from "./git-C0x00Urq.js";
|
|
17
|
+
import "./actions-C0sUjLGZ.js";
|
|
18
|
+
import "./app-vECLIkWi.js";
|
|
19
|
+
import { n as runPushPipeline } from "./pipeline-B3c4tjfA.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-DmEUd7Xa.js";
|
|
2
|
+
import "./telemetry-vvgwHwjA.js";
|
|
3
|
+
import "./update-DeK9OQ5x.js";
|
|
4
|
+
import "./token-CwKfB5Ic.js";
|
|
5
|
+
import { t as defineCommand } from "./command-Bav1fWvv.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import "./skills-BDMwScz3.js";
|
|
8
|
+
import "./spawn-DSoTXy_j.js";
|
|
9
|
+
import "./login-DGc6GQqT.js";
|
|
10
|
+
import "./scan-HfLbAkLc.js";
|
|
11
|
+
import "./hosted-q7_n5udj.js";
|
|
12
|
+
import "./spinner-B9dT3DBY.js";
|
|
13
|
+
import "./resources-s64mBHaC.js";
|
|
14
|
+
import "./org-Cg25bcsj.js";
|
|
15
|
+
import "./bind-CBLvcdzo.js";
|
|
16
|
+
import { i as requireApi } from "./git-C0x00Urq.js";
|
|
17
|
+
import "./actions-C0sUjLGZ.js";
|
|
18
|
+
import "./app-vECLIkWi.js";
|
|
19
|
+
import { n as runPushPipeline } from "./pipeline-B3c4tjfA.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 "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import "./spinner-
|
|
8
|
-
import "./resources-
|
|
9
|
-
import { t as requireOrg } from "./org-
|
|
10
|
-
import { t as apiCall } from "./api-output-
|
|
1
|
+
import "./output-DmEUd7Xa.js";
|
|
2
|
+
import "./telemetry-vvgwHwjA.js";
|
|
3
|
+
import "./update-DeK9OQ5x.js";
|
|
4
|
+
import "./token-CwKfB5Ic.js";
|
|
5
|
+
import { t as defineCommand } from "./command-Bav1fWvv.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 {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import "./token-
|
|
5
|
-
import { n as ApiError, t as defineCommand } from "./command-
|
|
6
|
-
import "./ui-
|
|
7
|
-
import { t as scanProject } from "./scan-
|
|
8
|
-
import { t as detectExisting } from "./existing-
|
|
9
|
-
import "./spinner-
|
|
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-
|
|
11
|
-
import { t as requireOrg } from "./org-
|
|
12
|
-
import { t as platformForIntegration } from "./bind-
|
|
13
|
-
import { t as apiCall } from "./api-output-
|
|
1
|
+
import { r as formatJson, t as blocks } from "./output-DmEUd7Xa.js";
|
|
2
|
+
import { f as setDefaultApp, o as getDefaultApp } from "./telemetry-vvgwHwjA.js";
|
|
3
|
+
import "./update-DeK9OQ5x.js";
|
|
4
|
+
import "./token-CwKfB5Ic.js";
|
|
5
|
+
import { n as ApiError, t as defineCommand } from "./command-Bav1fWvv.js";
|
|
6
|
+
import "./ui-Lqt_zFOr.js";
|
|
7
|
+
import { t as scanProject } from "./scan-HfLbAkLc.js";
|
|
8
|
+
import { t as detectExisting } from "./existing-D7p2hnhq.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-CBLvcdzo.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 {
|
|
2
|
-
import { s as packagedDir } from "./skills-
|
|
1
|
+
import { l as DASHBOARD_URL } from "./output-DmEUd7Xa.js";
|
|
2
|
+
import { s as packagedDir } from "./skills-BDMwScz3.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 {
|
|
1
|
+
import { d as Integration } from "./output-DmEUd7Xa.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/
|
|
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 {
|
|
2
|
-
import {
|
|
1
|
+
import { g as VERSION } from "./output-DmEUd7Xa.js";
|
|
2
|
+
import { h as setSkillsSync, i as track, u as getSkillsSync } from "./telemetry-vvgwHwjA.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/
|
|
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 "./
|
|
2
|
-
import "./
|
|
3
|
-
import "./update-
|
|
4
|
-
import "./token-
|
|
5
|
-
import { t as defineCommand } from "./command-
|
|
6
|
-
import { n as ui } from "./ui-
|
|
7
|
-
import { a as skillsOutOfDate, o as syncSkills, r as fetchPublicSkills, t as SUPERWALL_SKILLS_SOURCE } from "./skills-
|
|
1
|
+
import "./output-DmEUd7Xa.js";
|
|
2
|
+
import "./telemetry-vvgwHwjA.js";
|
|
3
|
+
import "./update-DeK9OQ5x.js";
|
|
4
|
+
import "./token-CwKfB5Ic.js";
|
|
5
|
+
import { t as defineCommand } from "./command-Bav1fWvv.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-BDMwScz3.js";
|
|
8
8
|
import "./spawn-DSoTXy_j.js";
|
|
9
|
-
import { t as withSpinner } from "./spinner-
|
|
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,37 +1,12 @@
|
|
|
1
|
-
import {
|
|
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-DmEUd7Xa.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 {
|
|
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 {
|
|
1
|
+
import { p as SUPERWALL_HOME, r as formatJson } from "./output-DmEUd7Xa.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 {
|
|
27707
|
+
export { THEME as a, stripReport as i, ui as n, fg as o, useRenderer as r, selectRenderer as t };
|