@superwall/cli 1.6.2 → 2.0.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.
- package/README.md +281 -34
- package/dist/apple-CkKlHBZ9.js +195 -0
- package/dist/auth.d.ts +4 -19
- package/dist/auth.js +4 -2
- package/dist/{actions-H7f6knyY.js → billing-XCZU_T46.js} +98 -28
- package/dist/{bind-BIzaGq8K.js → bind-drne__Ys.js} +38 -33
- package/dist/{build-B7BS1rF2.js → build-Gpdq5QXP.js} +20 -26
- package/dist/client-BZ1UbpXz.js +66 -0
- package/dist/client-DP6Rc0t_.js +176 -0
- package/dist/config-BO1Y87kV.js +105 -0
- package/dist/create-BBrtgUgS.js +969 -0
- package/dist/{create-CwnnNqv4.js → create-Cwc3SRWJ.js} +194 -168
- package/dist/create-Yvf2gStM.js +19 -0
- package/dist/doctor-C9ldpPFC.js +83 -0
- package/dist/{drivers-6RMOPIdn.js → drivers-DNrx4LWA.js} +185 -172
- package/dist/entry.d.ts +0 -5
- package/dist/entry.js +28083 -801
- package/dist/environment-DF1qKlny.js +58 -0
- package/dist/{existing-DHpPn1y6.js → existing-78LWSsqS.js} +12 -6
- package/dist/held-Cy8Wl4D1.js +1112 -0
- package/dist/held-Ddw1XSsr.js +16 -0
- package/dist/input-vi0bou04.js +42 -0
- package/dist/{integrate-BR2LR-EK.js → integrate-DcJhpXy8.js} +277 -253
- package/dist/kinds-GFXB3sYu.js +11 -0
- package/dist/log-NVhVe_oe.js +62 -0
- package/dist/login-B2TsCE2H.js +53 -0
- package/dist/login-BoBe8Psl.js +16 -0
- package/dist/{login-Bhxgqwtm.js → login-D0lh3_JI.js} +144 -66
- package/dist/lookup-D-nmmAbw.js +71 -0
- package/dist/migrate-Cfec564E.js +274 -0
- package/dist/notification-url-YDbq6FMA.js +100 -0
- package/dist/{open-studio-BnVD6tJ9.js → open-Ba2vBl1_.js} +34 -43
- package/dist/org-D0g_q3mv.js +35 -0
- package/dist/output-Ggzq5_-t.js +122 -0
- package/dist/paths-DxSLdpOI.js +29 -0
- package/dist/playbook-DIeb7hne.js +53 -0
- package/dist/{asc-products-Dvcyef3_.js → products-DH_fK9tY.js} +6 -39
- package/dist/promote-COD4fYdz.js +91 -0
- package/dist/push-CncywhkQ.js +482 -0
- package/dist/push-CtD4FZQV.js +22 -0
- package/dist/registry-DSrosOYs.js +10228 -0
- package/dist/{reports-DqMs9xNR.js → reports-DdPq4blM.js} +7 -6
- package/dist/{resources-Bf9O1JNM.js → resources-Dqr01Dep.js} +150 -55
- package/dist/{run-D-NbZLpj.js → run-C9qg_QlC.js} +16 -22
- package/dist/scan-Cv5uOwVY.js +4 -0
- package/dist/{scan-BmAW413l.js → scan-DLrsrFS9.js} +48 -37
- package/dist/scope-V336uz8j.js +198 -0
- package/dist/screenshot-file-0UETadF8.js +16 -0
- package/dist/{selection-BGi6GyxC.js → selection-Rdw-ZUoG.js} +94 -51
- package/dist/send-BxD9yf6F.js +150 -0
- package/dist/{dev-CgGAb5Al.js → server-D0tGG8C4.js} +82 -87
- package/dist/server-z1LH94R_.js +22 -0
- package/dist/session-1AV_Bs_d.js +6 -0
- package/dist/session-CFAmMhem.js +40 -0
- package/dist/session-D_nEWKXT.js +768 -0
- package/dist/skills/animate-onboarding/SKILL.md +467 -0
- package/dist/skills/animate-onboarding/references/engine.md +494 -0
- package/dist/skills/animate-onboarding/references/framework/Question.tsx +71 -0
- package/dist/skills/animate-onboarding/references/framework/README.md +40 -0
- package/dist/skills/animate-onboarding/references/framework/answers.ts +19 -0
- package/dist/skills/animate-onboarding/references/framework/flow.ts +80 -0
- package/dist/skills/animate-onboarding/references/framework/handoffs.ts +869 -0
- package/dist/skills/animate-onboarding/references/framework/layout.tsx +113 -0
- package/dist/skills/animate-onboarding/references/framework/motion.css +559 -0
- package/dist/skills/animate-onboarding/references/framework/useStoryRouter.ts +48 -0
- package/dist/skills/animate-onboarding/references/handoffs.md +375 -0
- package/dist/skills/animate-onboarding/references/imageReady.ts +92 -0
- package/dist/skills/animate-onboarding/references/morphFrame.ts +356 -0
- package/dist/skills/animate-onboarding/references/performance.md +41 -0
- package/dist/skills/animate-onboarding/references/web-runtime/README.md +17 -0
- package/dist/skills/animate-onboarding/references/web-runtime/handoffs.ts +858 -0
- package/dist/skills/animate-onboarding/references/web-runtime/story-motion.css +301 -0
- package/dist/skills/index.json +37 -0
- package/dist/skills/mobile-design/SKILL.md +447 -0
- package/dist/skills/mobile-design/references/responsive.md +162 -0
- package/dist/skills/onboarding-questions/SKILL.md +231 -0
- package/dist/skills/onboarding-questions/references/arpu-questions.md +139 -0
- package/dist/skills/onboarding-questions/references/craft.md +142 -0
- package/dist/skills/onboarding-questions/references/example-reflective.md +117 -0
- package/dist/skills/superwall/SKILL.md +82 -9
- package/dist/skills/superwall/references/api.md +153 -37
- package/dist/skills/superwall/references/apple-setup.md +316 -0
- package/dist/skills/superwall/references/asc.md +74 -38
- package/dist/skills/superwall/references/data-analytics.md +55 -21
- package/dist/skills/superwall/workflows/dashboard/playbook.md +3 -3
- package/dist/skills/superwall/workflows/dashboard/setup.md +8 -8
- package/dist/skills/superwall/workflows/migrate/adapty.md +6 -6
- package/dist/skills/superwall/workflows/migrate/playbook.md +4 -4
- package/dist/skills/superwall/workflows/migrate/qonversion.md +5 -5
- package/dist/skills/superwall/workflows/migrate/revenuecat.md +6 -6
- package/dist/skills/superwall/workflows/placements/android.md +2 -2
- package/dist/skills/superwall/workflows/placements/expo.md +2 -2
- package/dist/skills/superwall/workflows/placements/flutter.md +2 -2
- package/dist/skills/superwall/workflows/placements/ios.md +2 -2
- package/dist/skills/superwall/workflows/placements/playbook.md +2 -2
- package/dist/skills/superwall/workflows/placements/react-native.md +2 -2
- package/dist/skills/superwall/workflows/placements/strategy.md +2 -2
- package/dist/skills/superwall/workflows/review/playbook.md +1 -1
- package/dist/skills/superwall-editor/SKILL.md +61 -0
- package/dist/skills/superwall-editor/references/cli.md +135 -0
- package/dist/skills/superwall-editor/references/design.md +51 -0
- package/dist/skills/superwall-editor/references/native-elements.md +171 -0
- package/dist/skills/superwall-editor/references/workflow.md +65 -0
- package/dist/skills/superwall-editor/scripts/sw-editor.sh +662 -0
- package/dist/skills/superwall-framework/SKILL.md +78 -28
- package/dist/skills/superwall-framework/references/cli.md +58 -28
- package/dist/skills/superwall-framework/references/examples.md +4 -3
- package/dist/skills/superwall-framework/references/layout.md +30 -8
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +1 -1
- package/dist/skills/superwall-framework/references/onboarding-state.md +245 -0
- package/dist/skills/wwdc/SKILL.md +22 -0
- package/dist/skills/wwdc/references/docs.md +52 -0
- package/dist/skills/wwdc/scripts/wwdc.sh +266 -0
- package/dist/{skills-AxAf7bDB.js → skills-BvFOa4y6.js} +99 -122
- package/dist/skills-DMG4bpKk.js +14 -0
- package/dist/{spawn-DSoTXy_j.js → spawn-DmmmHIP-.js} +14 -12
- package/dist/spinner-CneRK5rk.js +294 -0
- package/dist/storage-DYvmIOHa.d.ts +16 -0
- package/dist/storage-s2Dnz-yl.js +31 -0
- package/dist/storekit-DafAnGkM.js +16 -0
- package/dist/storekit-yY_kS2iR.js +47 -0
- package/dist/telemetry-DtG92m5O.js +56 -0
- package/dist/theme-DUsCh-Vd.js +25 -0
- package/dist/timing-BVxPrYq3.js +5 -0
- package/dist/{token-BGAVPSQc.js → token-DzRh7dI1.js} +6 -38
- package/dist/tools.d.ts +96 -0
- package/dist/tools.js +11178 -0
- package/dist/ui-D_qf3Gvw.js +53 -0
- package/dist/upgrade-Bt4Ouw1y.js +117 -0
- package/dist/upgrade-Cqy5orjb.js +7 -0
- package/package.json +10 -5
- package/dist/api-Dv3LyZ5m.js +0 -151
- package/dist/api-output-aJNw7Syy.js +0 -20
- package/dist/app-mJC5NDtW.js +0 -189
- package/dist/asa-D6H7Pjae.js +0 -1194
- package/dist/asc-xCin0akG.js +0 -539
- package/dist/auth-ZlLL-Gko.js +0 -139
- package/dist/billing-C8kBge_S.js +0 -80
- package/dist/command-3fGYyC8r.js +0 -301
- package/dist/dev-Dx99K183.js +0 -22
- package/dist/doctor-CyUvut31.js +0 -88
- package/dist/feedback-RKyGuQ8_.js +0 -152
- package/dist/hosted-BeGVAntr.js +0 -32
- package/dist/migrate-C-4ISELN.js +0 -284
- package/dist/org-CQduIOic.js +0 -40
- package/dist/output-C-4UKMot.js +0 -136
- package/dist/params-l3CrvRtR.js +0 -51
- package/dist/pipeline-CHX0Syre.js +0 -977
- package/dist/print-skill-BiZLdCKv.js +0 -74
- package/dist/promote-Pgpz-3xl.js +0 -88
- package/dist/publish-BPeuc3lq.js +0 -35
- package/dist/push-DcSQ4odB.js +0 -35
- package/dist/query-CWLaZkdm.js +0 -53
- package/dist/resource-jwASPCrw.js +0 -483
- package/dist/skills-FK5aDuNV.js +0 -64
- package/dist/spinner-DFctF_Jw.js +0 -18
- package/dist/storekit-CC4gnTI6.js +0 -29
- package/dist/telemetry-Ch9cCTI-.js +0 -169
- package/dist/ui-4gLyfrgl.js +0 -27737
- package/dist/update-DIXbL-H9.js +0 -59
- package/dist/upgrade-De7JMI1g.js +0 -72
- /package/dist/{devtools-8EgLo86w.js → devtools-ByZ6XYnn.js} +0 -0
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { n as ui } from "./ui-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { _ as
|
|
8
|
-
import
|
|
9
|
-
import * as path from "node:path";
|
|
1
|
+
import { _ as VERSION } from "./environment-DF1qKlny.js";
|
|
2
|
+
import { t as ApiError } from "./client-DP6Rc0t_.js";
|
|
3
|
+
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
4
|
+
import { f as listApplications, w as versionProducts, x as pushPaywallVersion, y as promotePaywallVersion } from "./resources-Dqr01Dep.js";
|
|
5
|
+
import { i as openBrowser } from "./login-D0lh3_JI.js";
|
|
6
|
+
import { C as readLock, F as syncAssets, M as resolveFramework, N as assetBaseUrl, P as requireAssets, _ as collectProjectDeclarations, i as requireProject, j as frameworkVersion, l as LAYOUT_HINT, o as resolveProjectDirs, v as writeProjectTypes } from "./selection-Rdw-ZUoG.js";
|
|
7
|
+
import { _ as resolveBinding, d as projectForApplication, g as wantedPlatforms, i as pushSource, l as writeProjectScaffold, m as planTargets, n as requireApi, o as collectSourceFiles, s as warnNotPortable, u as listProjectProducts, y as resolveApps } from "./session-D_nEWKXT.js";
|
|
8
|
+
import { execFile } from "node:child_process";
|
|
10
9
|
import * as fs from "node:fs";
|
|
10
|
+
import * as path from "node:path";
|
|
11
|
+
import pc from "picocolors";
|
|
12
|
+
import { promisify } from "node:util";
|
|
11
13
|
import fg from "fast-glob";
|
|
12
14
|
import { renderUnicodeCompact } from "uqr";
|
|
13
15
|
|
|
14
16
|
//#region src/core/paywalls/project/scheme.ts
|
|
17
|
+
const run = promisify(execFile);
|
|
15
18
|
const IGNORED_SCHEMES = new Set([
|
|
16
19
|
"http",
|
|
17
20
|
"https",
|
|
@@ -151,21 +154,14 @@ const appScheme = async (roots, remote) => {
|
|
|
151
154
|
scheme: fromDashboard,
|
|
152
155
|
source: "dashboard"
|
|
153
156
|
};
|
|
154
|
-
const local = await detectLocalScheme(roots)
|
|
157
|
+
const local = await detectLocalScheme(roots);
|
|
155
158
|
return local === void 0 ? {} : {
|
|
156
159
|
scheme: local,
|
|
157
160
|
source: "app"
|
|
158
161
|
};
|
|
159
162
|
};
|
|
160
|
-
const plutilAvailable = async () =>
|
|
161
|
-
const { execFile } = await import("node:child_process");
|
|
162
|
-
const { promisify } = await import("node:util");
|
|
163
|
-
return promisify(execFile)("plutil", ["-help"]).then(() => true, () => false);
|
|
164
|
-
};
|
|
163
|
+
const plutilAvailable = async () => run("plutil", ["-help"]).then(() => true, () => false);
|
|
165
164
|
const allowLocalNetworking = async (plist) => {
|
|
166
|
-
const { execFile } = await import("node:child_process");
|
|
167
|
-
const { promisify } = await import("node:util");
|
|
168
|
-
const run = promisify(execFile);
|
|
169
165
|
if (!await plutilAvailable()) throw new Error("Editing an Info.plist needs `plutil`, which ships with macOS.");
|
|
170
166
|
if (!await run("plutil", [
|
|
171
167
|
"-extract",
|
|
@@ -194,7 +190,7 @@ const allowLocalNetworking = async (plist) => {
|
|
|
194
190
|
};
|
|
195
191
|
|
|
196
192
|
//#endregion
|
|
197
|
-
//#region src/
|
|
193
|
+
//#region src/core/paywalls/studio/actions.ts
|
|
198
194
|
const reason = (error) => error instanceof Error ? error.message : String(error);
|
|
199
195
|
const firstApp = (apps) => apps.ios ?? Object.values(apps)[0];
|
|
200
196
|
function createStudioActions(framework, project) {
|
|
@@ -239,7 +235,7 @@ function createStudioActions(framework, project) {
|
|
|
239
235
|
const [device, user, products] = await Promise.all([
|
|
240
236
|
client.get(`/v2/users/device-properties-sample${query}`).catch(() => void 0),
|
|
241
237
|
client.get(`/v2/users/properties-sample${query}`).catch(() => void 0),
|
|
242
|
-
projectForApplication(client, applicationId).then((projectId) => projectId ?
|
|
238
|
+
projectForApplication(client, applicationId).then((projectId) => projectId ? listProjectProducts(client, projectId) : void 0).catch((error) => {
|
|
243
239
|
unreachable = reason(error);
|
|
244
240
|
})
|
|
245
241
|
]);
|
|
@@ -325,6 +321,7 @@ function createStudioActions(framework, project) {
|
|
|
325
321
|
if (!collected.ok) throw new Error(collected.reason);
|
|
326
322
|
return pushSource({
|
|
327
323
|
api: client,
|
|
324
|
+
superwallDir: project.superwallDir,
|
|
328
325
|
paywallId: binding.paywallId,
|
|
329
326
|
applicationId: binding.applicationId,
|
|
330
327
|
version: pushed.version,
|
|
@@ -404,77 +401,75 @@ function createStudioActions(framework, project) {
|
|
|
404
401
|
}
|
|
405
402
|
|
|
406
403
|
//#endregion
|
|
407
|
-
//#region src/
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
superwallDir: project$1.superwallDir,
|
|
422
|
-
frameworkVersion: frameworkVersion(dir)
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
const project = projects[0];
|
|
426
|
-
if (!project) throw new Error("No project directories given.");
|
|
427
|
-
const requestedPort = Number(context.argv.port);
|
|
428
|
-
const host = String(context.argv.host);
|
|
429
|
-
const runtimeUrl = process.env.SUPERWALL_RUNTIME_URL?.replace(/\/+$/, "");
|
|
430
|
-
const studio = createStudioActions(framework, project);
|
|
431
|
-
const server = await framework.startPreviewServer(projects.map((one) => one.root), {
|
|
432
|
-
port: requestedPort,
|
|
433
|
-
host,
|
|
434
|
-
platformStylesheet: runtimeUrl ? `${runtimeUrl}/live.css` : void 0,
|
|
435
|
-
studio
|
|
404
|
+
//#region src/core/paywalls/studio/server.ts
|
|
405
|
+
async function runStudio(input, deps = {}) {
|
|
406
|
+
const dirs = resolveProjectDirs(input.dirs);
|
|
407
|
+
const dir = dirs[0] ?? process.cwd();
|
|
408
|
+
const framework = await resolveFramework(dir);
|
|
409
|
+
const projects = dirs.length === 1 ? [requireProject(framework.discoverProject(dir), dir)] : dirs.map((one) => framework.discoverProject(one)).filter((one) => Boolean(one.marker));
|
|
410
|
+
const project = projects[0];
|
|
411
|
+
if (!project) throw new Error(`No superwall projects found in ${dirs.length} directories.\nExpected a package.json in each (or in superwall/) that depends on superwall.`);
|
|
412
|
+
for (const one of projects) {
|
|
413
|
+
writeProjectTypes(one, (await collectProjectDeclarations(framework, one.root)).products);
|
|
414
|
+
writeProjectScaffold({
|
|
415
|
+
root: one.root,
|
|
416
|
+
superwallDir: one.superwallDir,
|
|
417
|
+
frameworkVersion: frameworkVersion(dir)
|
|
436
418
|
});
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
419
|
+
}
|
|
420
|
+
const requestedPort = input.port;
|
|
421
|
+
const runtimeUrl = process.env.SUPERWALL_RUNTIME_URL?.replace(/\/+$/, "");
|
|
422
|
+
const studio = createStudioActions(framework, project);
|
|
423
|
+
const server = await framework.startPreviewServer(projects.map((one) => one.root), {
|
|
424
|
+
port: requestedPort,
|
|
425
|
+
host: input.host,
|
|
426
|
+
platformStylesheet: runtimeUrl ? `${runtimeUrl}/live.css` : void 0,
|
|
427
|
+
studio
|
|
428
|
+
});
|
|
429
|
+
const url = server.resolvedUrls?.local[0] ?? `http://localhost:${requestedPort}/`;
|
|
430
|
+
const actualPort = Number(new URL(url).port);
|
|
431
|
+
ui.intro(`Superwall ${pc.dim(`v${VERSION}`)}`);
|
|
432
|
+
if (actualPort !== requestedPort) ui.warn(`Port ${requestedPort} was in use — moved to ${actualPort}.`);
|
|
433
|
+
const many = projects.length > 1;
|
|
434
|
+
const rows = projects.flatMap((one) => {
|
|
435
|
+
const prefix = many ? `${path.basename(one.root)}/` : "";
|
|
436
|
+
return [...many ? [pc.bold(path.basename(one.root))] : [], ...one.surfaces.map((surface) => `${many ? " " : ""}${surface.kind}/${pc.bold(surface.id)} ` + pc.dim(`${url}${prefix}${surface.kind}/${surface.id}`))];
|
|
437
|
+
});
|
|
438
|
+
ui.step([`Studio ${pc.green(url)}`, ...rows].join("\n"));
|
|
439
|
+
if (input.open !== void 0 && input.open !== "") {
|
|
440
|
+
const target = `${url}${input.open.replace(/^\//, "")}`;
|
|
441
|
+
(deps.openBrowser ?? openBrowser)(target).then((opened) => {
|
|
442
|
+
if (!opened) ui.warn(`Couldn't open a browser here. Open ${target} yourself.`);
|
|
446
443
|
});
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
444
|
+
}
|
|
445
|
+
const network = server.resolvedUrls?.network[0];
|
|
446
|
+
if (network) {
|
|
447
|
+
const deviceUrl = `${network}device`;
|
|
448
|
+
ui.step([
|
|
449
|
+
`Device ${pc.green(deviceUrl)}`,
|
|
450
|
+
pc.dim("Scan on a phone on the same wifi to preview on device:"),
|
|
451
|
+
"",
|
|
452
|
+
...renderUnicodeCompact(deviceUrl).split("\n")
|
|
453
|
+
].join("\n"));
|
|
454
|
+
}
|
|
455
|
+
const plist = (await studio.appScheme?.().catch(() => void 0))?.blocksLocalNetworking;
|
|
456
|
+
if (plist !== void 0) {
|
|
457
|
+
ui.warn("This app can't load paywalls from the dev server: App Transport Security blocks plain http.");
|
|
458
|
+
if ((input.interactive ? await ui.confirm({
|
|
459
|
+
message: `Allow local previewing in ${path.basename(plist)}? Development builds only.`,
|
|
460
|
+
initial: true
|
|
461
|
+
}) : null) === true) try {
|
|
462
|
+
await (deps.allowLocalNetworking ?? allowLocalNetworking)(plist);
|
|
463
|
+
ui.step(`Local previewing allowed in ${plist} — rebuild the app to pick it up.`);
|
|
464
|
+
} catch (error) {
|
|
465
|
+
ui.warn(`Could not edit ${plist}: ${error instanceof Error ? error.message : error}`);
|
|
458
466
|
}
|
|
459
|
-
|
|
460
|
-
if (plist !== void 0) {
|
|
461
|
-
ui.warn("This app can't load paywalls from the dev server: App Transport Security blocks plain http.");
|
|
462
|
-
if ((context.interactive ? await ui.confirm({
|
|
463
|
-
message: `Allow local previewing in ${path.basename(plist)}? Development builds only.`,
|
|
464
|
-
initial: true
|
|
465
|
-
}) : null) === true) try {
|
|
466
|
-
await allowLocalNetworking(plist);
|
|
467
|
-
ui.step(`Local previewing allowed in ${plist} — rebuild the app to pick it up.`);
|
|
468
|
-
} catch (error) {
|
|
469
|
-
ui.warn(`Could not edit ${plist}: ${error instanceof Error ? error.message : error}`);
|
|
470
|
-
}
|
|
471
|
-
else ui.warn(`Add to ${plist}, in your Debug configuration only:\n NSAppTransportSecurity → NSAllowsLocalNetworking = YES
|
|
467
|
+
else ui.warn(`Add to ${plist}, in your Debug configuration only:\n NSAppTransportSecurity → NSAllowsLocalNetworking = YES
|
|
472
468
|
→ NSAllowsArbitraryLoadsInWebContent = YES`);
|
|
473
|
-
}
|
|
474
|
-
for (const diagnostic of projects.flatMap((one) => one.diagnostics)) ui.warn(diagnostic);
|
|
475
|
-
if (projects.every((one) => one.surfaces.length === 0)) ui.warn(`Nothing to preview — ${LAYOUT_HINT}.`);
|
|
476
469
|
}
|
|
477
|
-
|
|
470
|
+
for (const diagnostic of projects.flatMap((one) => one.diagnostics)) ui.warn(diagnostic);
|
|
471
|
+
if (projects.every((one) => one.surfaces.length === 0)) ui.warn(`Nothing to preview — ${LAYOUT_HINT}.`);
|
|
472
|
+
}
|
|
478
473
|
|
|
479
474
|
//#endregion
|
|
480
|
-
export {
|
|
475
|
+
export { runStudio as t };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./token-DzRh7dI1.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-DF1qKlny.js";
|
|
4
|
+
import "./storage-s2Dnz-yl.js";
|
|
5
|
+
import "./client-DP6Rc0t_.js";
|
|
6
|
+
import "./config-BO1Y87kV.js";
|
|
7
|
+
import "./telemetry-DtG92m5O.js";
|
|
8
|
+
import "./spawn-DmmmHIP-.js";
|
|
9
|
+
import "./spinner-CneRK5rk.js";
|
|
10
|
+
import "./ui-D_qf3Gvw.js";
|
|
11
|
+
import "./scan-DLrsrFS9.js";
|
|
12
|
+
import "./paths-DxSLdpOI.js";
|
|
13
|
+
import "./resources-Dqr01Dep.js";
|
|
14
|
+
import "./lookup-D-nmmAbw.js";
|
|
15
|
+
import "./login-D0lh3_JI.js";
|
|
16
|
+
import "./skills-BvFOa4y6.js";
|
|
17
|
+
import "./selection-Rdw-ZUoG.js";
|
|
18
|
+
import "./session-D_nEWKXT.js";
|
|
19
|
+
import "./login-B2TsCE2H.js";
|
|
20
|
+
import { t as runStudio } from "./server-D0tGG8C4.js";
|
|
21
|
+
|
|
22
|
+
export { runStudio };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { a as sessionOrgName, i as serializeSession, n as removeSession, r as resolveApiHost, t as readSession } from "./storage-s2Dnz-yl.js";
|
|
2
|
+
|
|
3
|
+
//#region src/core/account/session.ts
|
|
4
|
+
function runWhoami(ctx) {
|
|
5
|
+
const s = readSession();
|
|
6
|
+
if (!s) {
|
|
7
|
+
if (ctx.json) return ctx.output.data({ authenticated: false });
|
|
8
|
+
ctx.ui.error("You aren't logged in yet. Run `superwall login` to sign in.");
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if (ctx.json) return ctx.output.data(serializeSession(s));
|
|
12
|
+
const credential = s.apiKey ? `API key sk_…${s.apiKey.slice(-4)}` : s.accessToken ? "OAuth session" : " - ";
|
|
13
|
+
ctx.ui.list({ items: [{
|
|
14
|
+
label: s.userEmail ?? "Logged in",
|
|
15
|
+
meta: sessionOrgName(s) ? `· ${sessionOrgName(s)}` : void 0,
|
|
16
|
+
children: [{
|
|
17
|
+
label: credential,
|
|
18
|
+
meta: resolveApiHost(s)
|
|
19
|
+
}]
|
|
20
|
+
}] });
|
|
21
|
+
}
|
|
22
|
+
async function runLogout(ctx) {
|
|
23
|
+
const s = readSession();
|
|
24
|
+
if (ctx.json) {
|
|
25
|
+
removeSession();
|
|
26
|
+
return ctx.output.data({
|
|
27
|
+
loggedOut: Boolean(s),
|
|
28
|
+
account: s ? serializeSession(s) : null
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
if (!s) return void ctx.ui.error("You aren't logged in yet.");
|
|
32
|
+
if (ctx.interactive) {
|
|
33
|
+
if (!await ctx.ui.confirm({ message: `Log out of Superwall${s.userEmail ? ` (\`${s.userEmail}\`)` : ""}?` })) return void ctx.ui.outro("Staying logged in.");
|
|
34
|
+
}
|
|
35
|
+
removeSession();
|
|
36
|
+
ctx.ui.success(`Logged out${s.userEmail ? ` (${s.userEmail})` : ""}.`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { runWhoami as n, runLogout as t };
|