@superwall/cli 2.6.0-beta.2 → 2.6.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 +47 -16
- package/dist/{apple-Dc5pOPms.js → apple-D-rfsuDA.js} +17 -19
- package/dist/{approve-BSbdmOez.js → approve-aPc5RoXB.js} +9 -11
- package/dist/{assets-C_RjojkK.js → assets-PyuXe45Y.js} +3 -3
- package/dist/auth.d.ts +11 -4
- package/dist/auth.js +4 -5
- package/dist/base-CAU0hWoI.js +82 -0
- package/dist/{billing-B6HK-F_a.js → billing-Dt6L_l9R.js} +3 -3
- package/dist/{build-DK88pTMW.js → build-CY5FnMNY.js} +35 -16
- package/dist/{client-x08fpvay.js → config-DOp5oChe.js} +162 -15
- package/dist/{create-B6-Dr3GZ.js → create-BZL5VH4L.js} +41 -41
- package/dist/{create-kpqEhqkk.js → create-D6w3UL0m.js} +9 -9
- package/dist/create-DM5Y1Pyk.js +18 -0
- package/dist/{doctor-DYbm8IKQ.js → doctor-C9FR0qw3.js} +50 -10
- package/dist/entry.js +45 -40
- package/dist/{environment-BFNzLLPN.js → environment-sE2wZYdg.js} +1 -1
- package/dist/{drivers-Dyi-y9Jn.js → existing--peXpOZj.js} +305 -8
- package/dist/framework-DW5fqjh4.js +65 -0
- package/dist/{source-BccdO4aL.js → git-Hf9Wc7Hp.js} +34 -92
- package/dist/{held-sKq3xrsT.js → held-CUBCOCGP.js} +8 -8
- package/dist/held-DVxvPMSG.js +15 -0
- package/dist/{install-DsIsif39.js → install-C5d82gZF.js} +15 -17
- package/dist/{integrate-B8eA676b.js → integrate-D8J_X1bj.js} +33 -38
- package/dist/{login-Blhxi20A.js → login-C6X7JrhM.js} +8 -9
- package/dist/{login-BlpfYapG.js → login-DXhm9L0F.js} +3 -3
- package/dist/login-et319ESO.js +13 -0
- package/dist/{lookup-Dg55W9S7.js → lookup-DqmIbUkv.js} +28 -4
- package/dist/{migrate-DoRb9jmA.js → migrate-BYF6hKZ2.js} +66 -45
- package/dist/{notification-url-D82msWF5.js → notification-url-Bo54nkXv.js} +4 -4
- package/dist/{open-BAqLpTSI.js → open-xdgXUzaF.js} +2 -2
- package/dist/{org-C4G7WjTV.js → org-BD8U3D1_.js} +4 -4
- package/dist/{organization-CmuQwcKN.js → organization-D-ZlB3qU.js} +4 -4
- package/dist/{orgs-1OzwUtpT.js → orgs-DQQJ3sw_.js} +1 -2
- package/dist/{paths-gBbqgkS7.js → paths-CIlyzF2I.js} +1 -1
- package/dist/{playbook-BKqlv77S.js → playbook-ecggWGFi.js} +10 -14
- package/dist/{products-Cqq59DBQ.js → products-CJq_iXv5.js} +1 -1
- package/dist/{promote-D0i8A0CO.js → promote-QVMLGYlU.js} +27 -28
- package/dist/{pull-DgQ_UmGv.js → pull-CCXhb2a7.js} +72 -26
- package/dist/{pull-CiIrJ5ik.js → pull-CrdsfsAl.js} +33 -39
- package/dist/pull-h71pL3r_.js +30 -0
- package/dist/push-BIq6R8Ro.js +29 -0
- package/dist/push-D6pJM_vv.js +21 -0
- package/dist/{push-7N4XIVtg.js → push-DJMGG7zW.js} +23 -12
- package/dist/{push-BWsXO7FN.js → push-DiMDwGfe.js} +8 -7
- package/dist/{registry-aAR_8VOw.js → registry-BSnQXft4.js} +1286 -901
- package/dist/registry-YwzTfCNc.js +22 -0
- package/dist/{resolve-CcOpO_5s.js → resolve-DO7bPota.js} +4 -4
- package/dist/{resources-DNwvf8rg.js → resources-XwvXA20E.js} +15 -2
- package/dist/{run-tVYJ3V5j.js → run-B-YvxfRc.js} +15 -17
- package/dist/scan-B36wkZmI.js +4 -0
- package/dist/{scan-dv0rrY4C.js → scan-ViBhmrB7.js} +1 -1
- package/dist/{scope-BXoQo30_.js → scope-BLLUxbrA.js} +24 -18
- package/dist/{scope-ehZ7L1nj.js → scope-Cg1AdAfO.js} +33 -3
- package/dist/screenshot-file-Dix2Qynm.js +127 -0
- package/dist/{sdk-DEfQttek.js → sdk-BFunw4Hc.js} +1 -1
- package/dist/{framework-JFLjmD5Y.js → selection-C07e_GGY.js} +4 -54
- package/dist/{series-D2ZpZ8cx.js → series-B8NJK4yS.js} +1 -1
- package/dist/{server-CcZGdYjE.js → server-CBtHzl9y.js} +40 -18
- package/dist/server-CZwSfzKe.js +33 -0
- package/dist/{base-83ZTv6up.js → session-BfVx50iA.js} +8 -83
- package/dist/{session-dHBtgSN0.js → session-BlrwAdGN.js} +1 -1
- package/dist/session-Cip4j99n.js +5 -0
- package/dist/{migration-BUedsREQ.js → setup-a4B72xJ8.js} +290 -28
- package/dist/skills/superwall/SKILL.md +37 -10
- package/dist/skills/superwall/references/api.md +66 -21
- package/dist/skills/superwall/references/asa.md +109 -64
- package/dist/skills/superwall/references/dashboard-links.md +65 -28
- package/dist/skills/superwall/references/data-analytics.md +1 -1
- package/dist/skills/superwall/workflows/dashboard/setup.md +15 -5
- package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
- package/dist/skills/superwall-framework/SKILL.md +197 -14
- package/dist/skills/superwall-framework/references/cli.md +98 -7
- package/dist/skills/superwall-framework/references/examples.md +2 -2
- package/dist/skills/superwall-framework/references/migrate-from-editor.md +5 -0
- package/dist/skills/superwall-framework/references/migrate-from-native.md +5 -0
- package/dist/{skills-Q7xB784d.js → skills-BB1uIt8t.js} +139 -9
- package/dist/{skills-Bqz2l_bx.js → skills-SnxFa2in.js} +8 -12
- package/dist/source-DQs6iLtC.js +82 -0
- package/dist/{source-push-CG948HrX.js → source-push-w7miTr6m.js} +38 -14
- package/dist/{spinner-IA6hV8nI.js → spinner-BQp7fQvK.js} +7 -5
- package/dist/{starter-BtUUQWhd.js → starter-BlJ_InZJ.js} +2 -2
- package/dist/{status-CB_MrFu5.js → status-DxsIw9zq.js} +9 -11
- package/dist/{output-Ggzq5_-t.js → storage-BR6imSqm.js} +40 -1
- package/dist/storekit-BqyujKQ_.js +203 -0
- package/dist/storekit-ELVCMF0X.js +15 -0
- package/dist/{bind-DcWIIPgk.js → theme-Ed0gz6hr.js} +29 -6
- package/dist/token-CWQ6tdva.js +100 -0
- package/dist/tools-skills/animate-onboarding/SKILL.md +1 -1
- package/dist/tools-skills/mobile-design/SKILL.md +1 -1
- package/dist/tools-skills/onboarding-questions/SKILL.md +1 -1
- package/dist/tools-skills/superwall/SKILL.md +43 -17
- package/dist/tools-skills/superwall/references/api.md +74 -24
- package/dist/tools-skills/superwall/references/asa.md +109 -64
- package/dist/tools-skills/superwall/references/dashboard-links.md +65 -28
- package/dist/tools-skills/superwall/references/data-analytics.md +1 -1
- package/dist/tools-skills/superwall/workflows/dashboard/playbook.md +4 -3
- package/dist/tools-skills/superwall/workflows/dashboard/setup.md +21 -8
- package/dist/tools-skills/superwall/workflows/integrate/flutter.md +9 -7
- package/dist/tools-skills/superwall/workflows/migrate/adapty.md +4 -3
- package/dist/tools-skills/superwall/workflows/migrate/playbook.md +2 -2
- package/dist/tools-skills/superwall/workflows/migrate/qonversion.md +4 -3
- package/dist/tools-skills/superwall/workflows/migrate/revenuecat.md +4 -3
- package/dist/tools-skills/superwall-editor/SKILL.md +2 -3
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +1230 -745
- package/dist/{try-CS3jLyoP.js → try-C3HW3hPZ.js} +17 -19
- package/dist/{lock-DgSx-p8Y.js → types-Dc9U_4kp.js} +86 -80
- package/dist/upgrade-Cw9jVt-r.js +348 -0
- package/dist/upgrade-DVsonzDF.js +27 -0
- package/package.json +11 -3
- package/dist/config-CGcG7GOt.js +0 -113
- package/dist/create-Du8Fx7W5.js +0 -20
- package/dist/existing-WQ3pz94o.js +0 -97
- package/dist/held-DmOhszHR.js +0 -17
- package/dist/log-C0MDCfA2.js +0 -62
- package/dist/login-D9jfRO8w.js +0 -17
- package/dist/pull-CO5HlqBe.js +0 -36
- package/dist/push-BIhGDNpL.js +0 -30
- package/dist/push-BgqTddLA.js +0 -22
- package/dist/run-B-YoyB-a.js +0 -100
- package/dist/scan-BU41gcQY.js +0 -4
- package/dist/screenshot-file-XAS0Xy0e.js +0 -16
- package/dist/server-BemmM1FV.js +0 -29
- package/dist/session-4aITGsF1.js +0 -6
- package/dist/setup-m94dpT3t.js +0 -217
- package/dist/spawn-DmmmHIP-.js +0 -71
- package/dist/storage-pR0Wb0d9.js +0 -41
- package/dist/storekit-BMxyYAHj.js +0 -17
- package/dist/storekit-CQnwlpKV.js +0 -47
- package/dist/telemetry-DU56L7Cy.js +0 -56
- package/dist/theme-DUsCh-Vd.js +0 -25
- package/dist/token-BbUeExGJ.js +0 -70
- package/dist/upgrade-CKn88PZD.js +0 -206
- package/dist/upgrade-DfD3-ClG.js +0 -7
- /package/dist/{browser-Bp3yRKlU.js → browser-BVjaf98V.js} +0 -0
- /package/dist/{client-BJQXl62Q.js → client-BwYhzITp.js} +0 -0
- /package/dist/{design-lint-CiFc78aM.js → design-lint-mgO-2SGS.js} +0 -0
- /package/dist/{devtools-ByZ6XYnn.js → devtools-B6Vp6HMy.js} +0 -0
- /package/dist/{input-MDd67UIp.js → input-DOT_2Zvb.js} +0 -0
- /package/dist/{project-NoMtbMyl.js → project-BomArwSj.js} +0 -0
- /package/dist/{reports-HYVp169R.js → reports-hbxsd3Zo.js} +0 -0
- /package/dist/{storage-Bdz5AmqS.d.ts → storage-Bh3wT1Rn.d.ts} +0 -0
- /package/dist/{timing-Ca0TXY-A.js → timing-BKEEIBij.js} +0 -0
- /package/dist/{ui-D_qf3Gvw.js → ui-hFgji1e8.js} +0 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./token-CWQ6tdva.js";
|
|
2
|
+
import "./storage-BR6imSqm.js";
|
|
3
|
+
import "./environment-sE2wZYdg.js";
|
|
4
|
+
import "./config-DOp5oChe.js";
|
|
5
|
+
import "./held-CUBCOCGP.js";
|
|
6
|
+
import "./resources-XwvXA20E.js";
|
|
7
|
+
import "./orgs-DQQJ3sw_.js";
|
|
8
|
+
import "./ui-hFgji1e8.js";
|
|
9
|
+
import "./spinner-BQp7fQvK.js";
|
|
10
|
+
import "./org-BD8U3D1_.js";
|
|
11
|
+
import "./theme-Ed0gz6hr.js";
|
|
12
|
+
import "./lookup-DqmIbUkv.js";
|
|
13
|
+
import { n as listGroups, t as GROUPS } from "./registry-BSnQXft4.js";
|
|
14
|
+
import "./session-BlrwAdGN.js";
|
|
15
|
+
import "./scope-BLLUxbrA.js";
|
|
16
|
+
import "./client-BwYhzITp.js";
|
|
17
|
+
import "./products-CJq_iXv5.js";
|
|
18
|
+
import "./input-DOT_2Zvb.js";
|
|
19
|
+
import "./timing-BKEEIBij.js";
|
|
20
|
+
import "./notification-url-Bo54nkXv.js";
|
|
21
|
+
|
|
22
|
+
export { GROUPS, listGroups };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as DASHBOARD_ORIGIN_OVERRIDE } from "./environment-
|
|
2
|
-
import { a as orgProjects, n as listOrganizations } from "./orgs-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { u as DASHBOARD_ORIGIN_OVERRIDE } from "./environment-sE2wZYdg.js";
|
|
2
|
+
import { a as orgProjects, n as listOrganizations } from "./orgs-DQQJ3sw_.js";
|
|
3
|
+
import { n as ARTIFACT_FILE } from "./scope-Cg1AdAfO.js";
|
|
4
|
+
import { t as ArtifactError } from "./project-BomArwSj.js";
|
|
5
5
|
import * as fs from "node:fs";
|
|
6
6
|
import * as path from "node:path";
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as listReachableProjects } from "./orgs-
|
|
1
|
+
import { b as ApiUnreachableError, y as ApiError } from "./config-DOp5oChe.js";
|
|
2
|
+
import { r as listReachableProjects } from "./orgs-DQQJ3sw_.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/json.ts
|
|
5
5
|
function isRecord(value) {
|
|
@@ -80,6 +80,7 @@ function createProduct(api, scope, identifier, opts = {}) {
|
|
|
80
80
|
return api.post("/v2/products", {
|
|
81
81
|
project_id: scope.projectId,
|
|
82
82
|
...opts.applicationId ? { application_id: opts.applicationId } : {},
|
|
83
|
+
...opts.store ? { store: opts.store } : {},
|
|
83
84
|
identifier,
|
|
84
85
|
...opts.name ? { name: opts.name } : {},
|
|
85
86
|
...opts.price ? { price: opts.price } : {},
|
|
@@ -244,15 +245,27 @@ function versionProducts(products, platform, stores = {}, billingPlans = {}) {
|
|
|
244
245
|
});
|
|
245
246
|
}
|
|
246
247
|
function pushPaywallVersion(api, paywallId, opts) {
|
|
248
|
+
const frameworkVersion = selectFrameworkVersion(opts.frameworkVersion);
|
|
247
249
|
return api.post(`/v2/paywalls/${encodeURIComponent(paywallId)}/versions`, {
|
|
248
250
|
html: opts.html,
|
|
249
251
|
...opts.surface ? { surface: opts.surface } : {},
|
|
250
252
|
...opts.assets && opts.assets.length > 0 ? { assets: opts.assets } : {},
|
|
251
253
|
...opts.products && opts.products.length > 0 ? { products: opts.products } : {},
|
|
252
254
|
...opts.locales && opts.locales.length > 0 ? { locales: opts.locales } : {},
|
|
255
|
+
...frameworkVersion ? { framework_version: frameworkVersion } : {},
|
|
256
|
+
...opts.teleportPages && opts.teleportPages.length > 0 ? { teleport_pages: opts.teleportPages.map(({ key, html }) => ({
|
|
257
|
+
key,
|
|
258
|
+
html
|
|
259
|
+
})) } : {},
|
|
253
260
|
...opts.settings ?? {}
|
|
254
261
|
});
|
|
255
262
|
}
|
|
263
|
+
const FRAMEWORK_VERSION_MAX_LENGTH = 64;
|
|
264
|
+
function selectFrameworkVersion(version) {
|
|
265
|
+
const trimmed = version?.trim();
|
|
266
|
+
if (!trimmed || trimmed === "unknown" || trimmed.length > FRAMEWORK_VERSION_MAX_LENGTH) return void 0;
|
|
267
|
+
return trimmed;
|
|
268
|
+
}
|
|
256
269
|
const ASSET_MANIFEST_CHUNK = 100;
|
|
257
270
|
async function pushPaywallAssets(api, paywallId, assets) {
|
|
258
271
|
const resolved = [];
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
import "./token-
|
|
2
|
-
import "./
|
|
3
|
-
import "./environment-
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
12
|
-
import { a as findEntrypoint, o as readManifest, s as readProject, t as ArtifactError } from "./project-
|
|
13
|
-
import "./
|
|
14
|
-
import { n as
|
|
15
|
-
import { C as TRIGGER_HEADER, S as READOUT_LIMITS, b as MOUNT_LOAD_TIMEOUT_MS, c as defaultRange, d as resolveWranglerPackage, f as API_HOST, g as CONTEXT_HEADER, h as BRIDGE_PROTOCOL, i as seriesProblem, l as parseContextJson, m as ARTIFACT_HEADER_PREFIX, o as SLOTS, p as ARTIFACT_COMPATIBILITY_DATE, r as readoutProblem, s as buildContext, t as checkMetricQuery, u as bundleArtifact, v as ENTRYPOINT_HEADER, w as isInternalPath, x as PLATFORM_HOST, y as METRIC_LIMITS } from "./series-D2ZpZ8cx.js";
|
|
16
|
-
import { n as resolveOrganization, t as resolveAppScope } from "./organization-CmuQwcKN.js";
|
|
1
|
+
import "./token-CWQ6tdva.js";
|
|
2
|
+
import "./storage-BR6imSqm.js";
|
|
3
|
+
import "./environment-sE2wZYdg.js";
|
|
4
|
+
import { y as ApiError } from "./config-DOp5oChe.js";
|
|
5
|
+
import "./resources-XwvXA20E.js";
|
|
6
|
+
import "./orgs-DQQJ3sw_.js";
|
|
7
|
+
import "./ui-hFgji1e8.js";
|
|
8
|
+
import "./spinner-BQp7fQvK.js";
|
|
9
|
+
import "./lookup-DqmIbUkv.js";
|
|
10
|
+
import "./types-Dc9U_4kp.js";
|
|
11
|
+
import { n as ARTIFACT_FILE } from "./scope-Cg1AdAfO.js";
|
|
12
|
+
import { a as findEntrypoint, o as readManifest, s as readProject, t as ArtifactError } from "./project-BomArwSj.js";
|
|
13
|
+
import { C as TRIGGER_HEADER, S as READOUT_LIMITS, b as MOUNT_LOAD_TIMEOUT_MS, c as defaultRange, d as resolveWranglerPackage, f as API_HOST, g as CONTEXT_HEADER, h as BRIDGE_PROTOCOL, i as seriesProblem, l as parseContextJson, m as ARTIFACT_HEADER_PREFIX, o as SLOTS, p as ARTIFACT_COMPATIBILITY_DATE, r as readoutProblem, s as buildContext, t as checkMetricQuery, u as bundleArtifact, v as ENTRYPOINT_HEADER, w as isInternalPath, x as PLATFORM_HOST, y as METRIC_LIMITS } from "./series-B8NJK4yS.js";
|
|
14
|
+
import { n as resolveOrganization, t as resolveAppScope } from "./organization-D-ZlB3qU.js";
|
|
17
15
|
import "./download-DhGd4hOB.js";
|
|
18
|
-
import { i as warnIfSdkBehind } from "./sdk-
|
|
16
|
+
import { i as warnIfSdkBehind } from "./sdk-BFunw4Hc.js";
|
|
19
17
|
import { createRequire } from "node:module";
|
|
20
18
|
import * as fs from "node:fs";
|
|
21
19
|
import * as path from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as Integration } from "./environment-
|
|
1
|
+
import { h as Integration } from "./environment-sE2wZYdg.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";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { f as writeDefaultApp, r as readDefaultApp } from "./config-
|
|
2
|
-
import {
|
|
3
|
-
import { i as orgIdOf, o as organizationOf, t as listOrgGroups } from "./orgs-
|
|
4
|
-
import {
|
|
5
|
-
import { t as chooseOrgOfApps } from "./org-
|
|
6
|
-
import { n as findApplication, r as
|
|
1
|
+
import { f as writeDefaultApp, r as readDefaultApp } from "./config-DOp5oChe.js";
|
|
2
|
+
import { l as findPaywall, m as listProjects, y as platformLabel } from "./resources-XwvXA20E.js";
|
|
3
|
+
import { i as orgIdOf, o as organizationOf, t as listOrgGroups } from "./orgs-DQQJ3sw_.js";
|
|
4
|
+
import { t as apiCall, u as currentHost } from "./spinner-BQp7fQvK.js";
|
|
5
|
+
import { t as chooseOrgOfApps } from "./org-BD8U3D1_.js";
|
|
6
|
+
import { i as findProject, n as findApplication, r as findCustomStore, t as appNotFound } from "./lookup-DqmIbUkv.js";
|
|
7
7
|
|
|
8
8
|
//#region src/core/account/scope.ts
|
|
9
9
|
function moveFirst(items, match) {
|
|
@@ -54,11 +54,11 @@ async function resolveLockAppId(api, lock) {
|
|
|
54
54
|
if (!lock?.paywallId) return void 0;
|
|
55
55
|
return (await findPaywall(api, lock.paywallId).catch(() => void 0))?.applicationId;
|
|
56
56
|
}
|
|
57
|
-
async function pickScope(context, api, appScoped) {
|
|
57
|
+
async function pickScope(context, api, appScoped, options = {}) {
|
|
58
58
|
const projects = await apiCall(context, "Loading projects", () => listProjects(api));
|
|
59
59
|
const appFlag = context.target.app;
|
|
60
60
|
let bound;
|
|
61
|
-
if (appFlag) bound = await namedApp(context, api, projects, appFlag);
|
|
61
|
+
if (appFlag) bound = await namedApp(context, api, projects, appFlag, options);
|
|
62
62
|
else bound = await lockBoundScope(context, api, projects);
|
|
63
63
|
if (bound) return {
|
|
64
64
|
projectId: String(bound.project.id),
|
|
@@ -75,7 +75,7 @@ async function pickScope(context, api, appScoped) {
|
|
|
75
75
|
const apps = project.applications ?? [];
|
|
76
76
|
let app;
|
|
77
77
|
if (appScoped) {
|
|
78
|
-
const remembered = apps.find((candidate) => String(candidate.id) === readDefaultApp(projectId));
|
|
78
|
+
const remembered$1 = apps.find((candidate) => String(candidate.id) === readDefaultApp(projectId));
|
|
79
79
|
const [first] = apps;
|
|
80
80
|
if (!first || apps.length === 1) app = first;
|
|
81
81
|
else if (!context.interactive) throw new Error(`${project.name ?? projectId} has ${apps.length} apps - pass --app <id>:\n` + candidates(apps.map((a) => [
|
|
@@ -84,7 +84,7 @@ async function pickScope(context, api, appScoped) {
|
|
|
84
84
|
a.name ?? ""
|
|
85
85
|
].filter(Boolean).join(" "))));
|
|
86
86
|
else {
|
|
87
|
-
app = await chooseApp(context, apps, remembered ?? first);
|
|
87
|
+
app = await chooseApp(context, apps, remembered$1 ?? first);
|
|
88
88
|
writeDefaultApp(projectId, String(app.id));
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -124,20 +124,26 @@ async function pickOrganization(context, api) {
|
|
|
124
124
|
}
|
|
125
125
|
return chooseOrgOfApps(api, "Whose apps?");
|
|
126
126
|
}
|
|
127
|
-
async function namedApp(context, api, projects, appFlag) {
|
|
128
|
-
let found;
|
|
127
|
+
async function namedApp(context, api, projects, appFlag, options = {}) {
|
|
129
128
|
if (context.target.project) {
|
|
130
129
|
const project = await pickProject(context, api, projects);
|
|
131
130
|
const app = project.applications?.find((candidate) => String(candidate.id) === appFlag || candidate.name === appFlag);
|
|
132
|
-
if (
|
|
133
|
-
found = {
|
|
131
|
+
if (app) return remembered({
|
|
134
132
|
project,
|
|
135
133
|
app
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
});
|
|
135
|
+
const store$1 = options.customStores ? await findCustomStore(api, appFlag, [project]) : void 0;
|
|
136
|
+
if (store$1) return store$1;
|
|
137
|
+
throw new Error(`No app ${appFlag} in ${project.name ?? project.id}.`);
|
|
140
138
|
}
|
|
139
|
+
const found = await findApplication(api, appFlag, projects);
|
|
140
|
+
if (found) return remembered(found);
|
|
141
|
+
const store = options.customStores ? await findCustomStore(api, appFlag, projects) : void 0;
|
|
142
|
+
if (store) return store;
|
|
143
|
+
throw appNotFound(appFlag);
|
|
144
|
+
}
|
|
145
|
+
/** A custom store is never remembered as the project's app: app-scoped commands can't use one. */
|
|
146
|
+
function remembered(found) {
|
|
141
147
|
writeDefaultApp(String(found.project.id), String(found.app.id));
|
|
142
148
|
return found;
|
|
143
149
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as NewerLockError, l as originKey, o as formatLock, t as TYPES_FILE, u as parseLock } from "./types-Dc9U_4kp.js";
|
|
2
2
|
|
|
3
3
|
//#region src/core/paywalls/source/scope.ts
|
|
4
4
|
const LOCK_FILE = "superwall.lock";
|
|
@@ -56,9 +56,37 @@ function mergeLockText(theirs, mine, scope, options = {}) {
|
|
|
56
56
|
if (!options.replaceUnreadable) throw new SourceLockUnreadableError(read.reason);
|
|
57
57
|
return formatLock(scoped(own.lock, scope));
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
const base = options.base === void 0 ? void 0 : readable(options.base);
|
|
60
|
+
return mergeLocks(read.lock, own.lock, scope, base && "lock" in base ? base.lock : void 0, options.application);
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
const SECTIONS = ["paywalls", "funnels"];
|
|
63
|
+
const sameBindings = (a, b) => {
|
|
64
|
+
const platforms = Object.keys(a);
|
|
65
|
+
return platforms.length === Object.keys(b).length && platforms.every((platform) => a[platform]?.paywallId === b[platform]?.paywallId && a[platform]?.snapshot === b[platform]?.snapshot && a[platform]?.sourcePending === b[platform]?.sourcePending);
|
|
66
|
+
};
|
|
67
|
+
function dropRemoved(merged, own, base, application) {
|
|
68
|
+
const pulled = (platform) => own.apps[platform] === application && base.apps[platform] === application;
|
|
69
|
+
for (const key of SECTIONS) {
|
|
70
|
+
const bound = new Set(Object.values(own[key]).flatMap((bindings) => Object.values(bindings).map((binding) => binding.paywallId)));
|
|
71
|
+
for (const [id, synced] of Object.entries(base[key])) {
|
|
72
|
+
const theirs = merged[key][id];
|
|
73
|
+
if (id in own[key] || theirs === void 0 || !sameBindings(theirs, synced)) continue;
|
|
74
|
+
if (!Object.keys(synced).every(pulled)) continue;
|
|
75
|
+
if (Object.values(synced).some((binding) => bound.has(binding.paywallId))) continue;
|
|
76
|
+
delete merged[key][id];
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function dropFormerNames(section, surfaceId, entry) {
|
|
81
|
+
for (const [id, bindings] of Object.entries(section)) {
|
|
82
|
+
if (id === surfaceId) continue;
|
|
83
|
+
const kept = Object.entries(bindings).filter(([platform, binding]) => entry[platform]?.paywallId !== binding.paywallId);
|
|
84
|
+
if (kept.length === Object.keys(bindings).length) continue;
|
|
85
|
+
if (kept.length > 0) section[id] = Object.fromEntries(kept);
|
|
86
|
+
else delete section[id];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function mergeLocks(other, own, scope, base, application) {
|
|
62
90
|
const section = (lock) => scope.kind === "paywall" ? lock.paywalls : lock.funnels;
|
|
63
91
|
const conflicting = new Set(Object.entries(own.apps).filter(([platform, app]) => other.apps[platform] !== void 0 && other.apps[platform] !== app).map(([platform]) => platform));
|
|
64
92
|
const ownApps = Object.fromEntries(Object.entries(own.apps).filter(([platform]) => !conflicting.has(platform)));
|
|
@@ -71,6 +99,7 @@ function mergeLocks(other, own, scope) {
|
|
|
71
99
|
paywalls: { ...other.paywalls },
|
|
72
100
|
funnels: { ...other.funnels }
|
|
73
101
|
};
|
|
102
|
+
if (base && application !== void 0) dropRemoved(merged, own, base, application);
|
|
74
103
|
if (scope.kind === "project") {
|
|
75
104
|
if (other.origins) merged.origins = other.origins;
|
|
76
105
|
return formatLock(merged);
|
|
@@ -81,6 +110,7 @@ function mergeLocks(other, own, scope) {
|
|
|
81
110
|
const entry = Object.fromEntries([...Object.entries(theirEntry).filter(([platform]) => conflicting.has(platform)), ...Object.entries(mineEntry).filter(([platform]) => !conflicting.has(platform))]);
|
|
82
111
|
if (Object.keys(entry).length > 0) target[scope.id] = entry;
|
|
83
112
|
else delete target[scope.id];
|
|
113
|
+
dropFormerNames(target, scope.id, entry);
|
|
84
114
|
const key = originKey(scope.kind, scope.id);
|
|
85
115
|
const origins = { ...other.origins };
|
|
86
116
|
const mineOrigin = own.origins?.[key];
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { basename, extname } from "node:path";
|
|
3
|
+
import { createHash } from "node:crypto";
|
|
4
|
+
|
|
5
|
+
//#region src/core/app-store-connect/resources/screenshot-file.ts
|
|
6
|
+
const EXTENSIONS = {
|
|
7
|
+
".png": "png",
|
|
8
|
+
".jpg": "jpeg",
|
|
9
|
+
".jpeg": "jpeg"
|
|
10
|
+
};
|
|
11
|
+
const PNG_SIGNATURE = [
|
|
12
|
+
137,
|
|
13
|
+
80,
|
|
14
|
+
78,
|
|
15
|
+
71,
|
|
16
|
+
13,
|
|
17
|
+
10,
|
|
18
|
+
26,
|
|
19
|
+
10
|
|
20
|
+
];
|
|
21
|
+
const JPEG_FRAME_MARKERS = new Set([
|
|
22
|
+
192,
|
|
23
|
+
193,
|
|
24
|
+
194,
|
|
25
|
+
195,
|
|
26
|
+
197,
|
|
27
|
+
198,
|
|
28
|
+
199,
|
|
29
|
+
201,
|
|
30
|
+
202,
|
|
31
|
+
203,
|
|
32
|
+
205,
|
|
33
|
+
206,
|
|
34
|
+
207
|
|
35
|
+
]);
|
|
36
|
+
const JPEG_STANDALONE_MARKERS = new Set([
|
|
37
|
+
1,
|
|
38
|
+
208,
|
|
39
|
+
209,
|
|
40
|
+
210,
|
|
41
|
+
211,
|
|
42
|
+
212,
|
|
43
|
+
213,
|
|
44
|
+
214,
|
|
45
|
+
215,
|
|
46
|
+
216
|
|
47
|
+
]);
|
|
48
|
+
function startsWith(bytes, prefix) {
|
|
49
|
+
return prefix.every((byte, index) => bytes[index] === byte);
|
|
50
|
+
}
|
|
51
|
+
function uint16(bytes, offset) {
|
|
52
|
+
return bytes[offset] << 8 | bytes[offset + 1];
|
|
53
|
+
}
|
|
54
|
+
function uint32(bytes, offset) {
|
|
55
|
+
return (bytes[offset] << 24 | bytes[offset + 1] << 16 | bytes[offset + 2] << 8 | bytes[offset + 3]) >>> 0;
|
|
56
|
+
}
|
|
57
|
+
function formatOf(bytes) {
|
|
58
|
+
if (startsWith(bytes, PNG_SIGNATURE)) return "png";
|
|
59
|
+
if (startsWith(bytes, [
|
|
60
|
+
255,
|
|
61
|
+
216,
|
|
62
|
+
255
|
|
63
|
+
])) return "jpeg";
|
|
64
|
+
}
|
|
65
|
+
function pngDimensions(bytes) {
|
|
66
|
+
if (bytes.length < 24) return void 0;
|
|
67
|
+
if (String.fromCharCode(...bytes.slice(12, 16)) !== "IHDR") return void 0;
|
|
68
|
+
return {
|
|
69
|
+
width: uint32(bytes, 16),
|
|
70
|
+
height: uint32(bytes, 20)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function jpegDimensions(bytes) {
|
|
74
|
+
let offset = 2;
|
|
75
|
+
while (offset + 1 < bytes.length) {
|
|
76
|
+
if (bytes[offset] !== 255) return void 0;
|
|
77
|
+
const marker = bytes[offset + 1];
|
|
78
|
+
if (marker === 255) {
|
|
79
|
+
offset += 1;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (JPEG_STANDALONE_MARKERS.has(marker)) {
|
|
83
|
+
offset += 2;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (offset + 4 > bytes.length) return void 0;
|
|
87
|
+
const length = uint16(bytes, offset + 2);
|
|
88
|
+
if (length < 2) return void 0;
|
|
89
|
+
if (JPEG_FRAME_MARKERS.has(marker)) {
|
|
90
|
+
if (offset + 9 > bytes.length) return void 0;
|
|
91
|
+
return {
|
|
92
|
+
height: uint16(bytes, offset + 5),
|
|
93
|
+
width: uint16(bytes, offset + 7)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
offset += 2 + length;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function inspectScreenshot(name, bytes) {
|
|
100
|
+
const expected = EXTENSIONS[extname(name).toLowerCase()];
|
|
101
|
+
if (!expected) throw new Error(`${name} isn't a .png, .jpg or .jpeg file. App Store review screenshots must be PNG or JPEG.`);
|
|
102
|
+
const format = formatOf(bytes);
|
|
103
|
+
if (!format) throw new Error(`${name} isn't a PNG or JPEG image. Export it again as PNG or JPEG.`);
|
|
104
|
+
if (format !== expected) {
|
|
105
|
+
const actual = format === "png" ? "PNG" : "JPEG";
|
|
106
|
+
throw new Error(`${name} holds a ${actual} image but its extension says otherwise. Rename it to .${format === "png" ? "png" : "jpg"}.`);
|
|
107
|
+
}
|
|
108
|
+
const dimensions = format === "png" ? pngDimensions(bytes) : jpegDimensions(bytes);
|
|
109
|
+
if (!dimensions || dimensions.width === 0 || dimensions.height === 0) throw new Error(`${name} is damaged or cut short: its image size can't be read. Export it again.`);
|
|
110
|
+
return {
|
|
111
|
+
format,
|
|
112
|
+
...dimensions
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function readScreenshotFile(path) {
|
|
116
|
+
const name = basename(path);
|
|
117
|
+
const bytes = new Uint8Array(readFileSync(path));
|
|
118
|
+
return {
|
|
119
|
+
name,
|
|
120
|
+
bytes,
|
|
121
|
+
checksum: createHash("md5").update(bytes).digest("hex"),
|
|
122
|
+
...inspectScreenshot(name, bytes)
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
export { inspectScreenshot, readScreenshotFile };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { n as billingPlanOf } from "./resources-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { join, resolve } from "node:path";
|
|
5
|
-
import { pathToFileURL } from "node:url";
|
|
1
|
+
import { n as billingPlanOf } from "./resources-XwvXA20E.js";
|
|
2
|
+
import { globSync, statSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
6
4
|
import pc from "picocolors";
|
|
7
5
|
|
|
8
6
|
//#region src/core/paywalls/pipeline/output.ts
|
|
@@ -128,52 +126,4 @@ function needsWork(built, pushed, live) {
|
|
|
128
126
|
}
|
|
129
127
|
|
|
130
128
|
//#endregion
|
|
131
|
-
|
|
132
|
-
var FrameworkNotFoundError = class extends Error {
|
|
133
|
-
constructor(dir) {
|
|
134
|
-
super(`No superwall framework found from ${dir}.\nInstall it in the project (\`npm i superwall\` / \`bun add superwall\`) and make sure you run this inside a project with a superwall/ directory.`);
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
async function importSubpath(packageDir, subpath) {
|
|
138
|
-
return import(pathToFileURL(createRequire(join(packageDir, "package.json")).resolve(subpath)).href);
|
|
139
|
-
}
|
|
140
|
-
function fn(mod, name, subpath) {
|
|
141
|
-
const candidate = mod[name];
|
|
142
|
-
if (typeof candidate !== "function") throw new Error(`This project's superwall version does not export ${name} from ${subpath} — update the project's superwall dependency.`);
|
|
143
|
-
return candidate;
|
|
144
|
-
}
|
|
145
|
-
function resolveFrameworkDir(cwd) {
|
|
146
|
-
for (const anchor of [join(cwd, "superwall", "package.json"), join(cwd, "package.json")]) try {
|
|
147
|
-
return join(createRequire(anchor).resolve("superwall/package.json"), "..");
|
|
148
|
-
} catch {
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
throw new FrameworkNotFoundError(cwd);
|
|
152
|
-
}
|
|
153
|
-
function frameworkVersion(cwd) {
|
|
154
|
-
try {
|
|
155
|
-
const { version } = JSON.parse(readFileSync(join(resolveFrameworkDir(cwd), "package.json"), "utf8"));
|
|
156
|
-
if (typeof version === "string" && version !== "") return version;
|
|
157
|
-
} catch {
|
|
158
|
-
return "unknown";
|
|
159
|
-
}
|
|
160
|
-
return "unknown";
|
|
161
|
-
}
|
|
162
|
-
async function resolveFramework(cwd) {
|
|
163
|
-
const dir = resolveFrameworkDir(cwd);
|
|
164
|
-
const [discover, build, preview] = await Promise.all([
|
|
165
|
-
importSubpath(dir, "superwall/discover"),
|
|
166
|
-
importSubpath(dir, "superwall/build"),
|
|
167
|
-
importSubpath(dir, "superwall/preview")
|
|
168
|
-
]);
|
|
169
|
-
const studioProject = typeof preview.buildStudioProject === "function" ? preview.buildStudioProject : void 0;
|
|
170
|
-
return {
|
|
171
|
-
discoverProject: fn(discover, "discoverProject", "superwall/discover"),
|
|
172
|
-
buildSnapshot: fn(build, "buildSnapshot", "superwall/build"),
|
|
173
|
-
startPreviewServer: fn(preview, "startPreviewServer", "superwall/preview"),
|
|
174
|
-
studioProject
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
//#endregion
|
|
179
|
-
export { took as _, requireClean as a, resolveProjectDirs as c, BIND_VERB as d, LAYOUT_HINT as f, resolveNote as g, pushedLine as h, parseIds as i, selectSurfaces as l, pendingPromoteWarning as m, resolveFramework as n, requireProject as o, kb as p, needsWork as r, resolveProjectDir as s, frameworkVersion as t, storesDiffer as u, transition as v, weight as y };
|
|
129
|
+
export { weight as _, resolveProjectDir as a, storesDiffer as c, kb as d, pendingPromoteWarning as f, transition as g, took as h, requireProject as i, BIND_VERB as l, resolveNote as m, parseIds as n, resolveProjectDirs as o, pushedLine as p, requireClean as r, selectSurfaces as s, needsWork as t, LAYOUT_HINT as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as bundleDir, n as MANIFEST_FILE, o as readManifest, t as ArtifactError } from "./project-
|
|
1
|
+
import { i as bundleDir, n as MANIFEST_FILE, o as readManifest, t as ArtifactError } from "./project-BomArwSj.js";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { execFile } from "node:child_process";
|
|
4
4
|
import * as fs from "node:fs";
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { x as VERSION } from "./environment-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { x as VERSION } from "./environment-sE2wZYdg.js";
|
|
2
|
+
import { y as ApiError } from "./config-DOp5oChe.js";
|
|
3
|
+
import { C as pushPaywallVersion, D as versionProducts, p as listApplications, x as promotePaywallVersion } from "./resources-XwvXA20E.js";
|
|
4
|
+
import { n as ui } from "./ui-hFgji1e8.js";
|
|
5
|
+
import { f as readLock, n as collectProjectDeclarations, r as writeProjectTypes } from "./types-Dc9U_4kp.js";
|
|
6
|
+
import { i as writeProjectScaffold, l as resolveApps, n as requireApi } from "./session-BfVx50iA.js";
|
|
7
|
+
import { i as resolveFramework, n as frameworkVersion } from "./framework-DW5fqjh4.js";
|
|
8
|
+
import { n as openBrowser } from "./browser-BVjaf98V.js";
|
|
9
|
+
import { c as renderUpdateNotice, l as resolveUpdate, s as refreshUpdateCheck } from "./upgrade-Cw9jVt-r.js";
|
|
10
|
+
import { i as planTargets, s as wantedPlatforms } from "./base-CAU0hWoI.js";
|
|
11
|
+
import { i as requireProject, o as resolveProjectDirs, u as LAYOUT_HINT } from "./selection-C07e_GGY.js";
|
|
12
|
+
import { t as collectSourceFiles } from "./source-DQs6iLtC.js";
|
|
13
|
+
import { n as requireAssets, r as syncAssets, t as assetBaseUrl } from "./assets-PyuXe45Y.js";
|
|
14
|
+
import { a as listApplicationCatalogue, c as projectForApplication, i as warnNotPortable, o as listProjectCatalogue, r as pushSource, s as productListings, u as resolveBinding } from "./source-push-w7miTr6m.js";
|
|
12
15
|
import { execFile } from "node:child_process";
|
|
13
16
|
import * as fs from "node:fs";
|
|
14
17
|
import * as path from "node:path";
|
|
@@ -238,7 +241,11 @@ const resolveScreenshots = (session) => {
|
|
|
238
241
|
};
|
|
239
242
|
const reason = (error) => error instanceof Error ? error.message : String(error);
|
|
240
243
|
const firstApp = (apps) => apps.ios ?? Object.values(apps)[0];
|
|
241
|
-
function
|
|
244
|
+
function selectServedVersion(dir) {
|
|
245
|
+
const served = frameworkVersion(dir);
|
|
246
|
+
return served === "unknown" ? VERSION : served;
|
|
247
|
+
}
|
|
248
|
+
function createStudioActions(framework, project, dir = project.root) {
|
|
242
249
|
let api;
|
|
243
250
|
const ensureApi = async () => api ??= await requireApi(false);
|
|
244
251
|
const readPreviewImages = async (surface) => {
|
|
@@ -288,17 +295,18 @@ function createStudioActions(framework, project) {
|
|
|
288
295
|
if (applicationId === void 0) return { unreachable: "This project is not bound to an app yet." };
|
|
289
296
|
const query = `?application_id=${encodeURIComponent(applicationId)}`;
|
|
290
297
|
let unreachable;
|
|
291
|
-
const [device, user,
|
|
298
|
+
const [device, user, catalogue] = await Promise.all([
|
|
292
299
|
client.get(`/v2/users/device-properties-sample${query}`).catch(() => void 0),
|
|
293
300
|
client.get(`/v2/users/properties-sample${query}`).catch(() => void 0),
|
|
294
|
-
projectForApplication(client, applicationId).then((projectId) => projectId ?
|
|
301
|
+
projectForApplication(client, applicationId).then((projectId) => projectId ? listProjectCatalogue(client, projectId) : void 0).catch((error) => {
|
|
295
302
|
unreachable = reason(error);
|
|
296
303
|
})
|
|
297
304
|
]);
|
|
298
305
|
return {
|
|
299
306
|
device: device?.properties,
|
|
300
307
|
user: user?.properties,
|
|
301
|
-
products,
|
|
308
|
+
products: catalogue?.variables,
|
|
309
|
+
catalog: catalogue && productListings(catalogue),
|
|
302
310
|
live: {
|
|
303
311
|
device: device?.live === true,
|
|
304
312
|
user: user?.live === true
|
|
@@ -345,6 +353,7 @@ function createStudioActions(framework, project) {
|
|
|
345
353
|
};
|
|
346
354
|
}
|
|
347
355
|
const collected = await collectSourceFiles(project.superwallDir);
|
|
356
|
+
const installed = frameworkVersion(project.root);
|
|
348
357
|
let version = 0;
|
|
349
358
|
const external = /* @__PURE__ */ new Set();
|
|
350
359
|
for (const target of targets) {
|
|
@@ -373,7 +382,8 @@ function createStudioActions(framework, project) {
|
|
|
373
382
|
surface: surface.id,
|
|
374
383
|
assets: synced.assets,
|
|
375
384
|
products: versionProducts(built.products, target.platform, catalogue.stores, built.billingPlans),
|
|
376
|
-
settings: built.settings
|
|
385
|
+
settings: built.settings,
|
|
386
|
+
frameworkVersion: installed
|
|
377
387
|
}));
|
|
378
388
|
await step("source", async () => {
|
|
379
389
|
if (!collected.ok) throw new Error(collected.reason);
|
|
@@ -384,7 +394,7 @@ function createStudioActions(framework, project) {
|
|
|
384
394
|
applicationId: binding.applicationId,
|
|
385
395
|
version: pushed.version,
|
|
386
396
|
files: collected.files,
|
|
387
|
-
framework:
|
|
397
|
+
framework: installed,
|
|
388
398
|
surface: surface.id,
|
|
389
399
|
kind: surface.kind,
|
|
390
400
|
snapshotId: built.snapshotId,
|
|
@@ -452,12 +462,23 @@ function createStudioActions(framework, project) {
|
|
|
452
462
|
} catch (error) {
|
|
453
463
|
return { unreachable: reason(error) };
|
|
454
464
|
}
|
|
465
|
+
},
|
|
466
|
+
update() {
|
|
467
|
+
return resolveUpdate(dir, selectServedVersion(project.root));
|
|
455
468
|
}
|
|
456
469
|
};
|
|
457
470
|
}
|
|
458
471
|
|
|
459
472
|
//#endregion
|
|
460
473
|
//#region src/core/paywalls/studio/server.ts
|
|
474
|
+
function printDevUpdate(dir) {
|
|
475
|
+
const served = selectServedVersion(dir);
|
|
476
|
+
refreshUpdateCheck(served);
|
|
477
|
+
const update = resolveUpdate(dir, served);
|
|
478
|
+
if (!update) return;
|
|
479
|
+
if (update.kind === "major") ui.warn(renderUpdateNotice(update));
|
|
480
|
+
else ui.info(renderUpdateNotice(update));
|
|
481
|
+
}
|
|
461
482
|
async function runStudio(input, deps = {}) {
|
|
462
483
|
const dirs = resolveProjectDirs(input.dirs);
|
|
463
484
|
const dir = dirs[0] ?? process.cwd();
|
|
@@ -475,7 +496,7 @@ async function runStudio(input, deps = {}) {
|
|
|
475
496
|
}
|
|
476
497
|
const requestedPort = input.port;
|
|
477
498
|
const runtimeUrl = process.env.SUPERWALL_RUNTIME_URL?.replace(/\/+$/, "");
|
|
478
|
-
const studio = createStudioActions(framework, project);
|
|
499
|
+
const studio = createStudioActions(framework, project, dir);
|
|
479
500
|
const server = await framework.startPreviewServer(projects.map((one) => one.root), {
|
|
480
501
|
port: requestedPort,
|
|
481
502
|
host: input.host,
|
|
@@ -485,6 +506,7 @@ async function runStudio(input, deps = {}) {
|
|
|
485
506
|
const url = server.resolvedUrls?.local[0] ?? `http://localhost:${requestedPort}/`;
|
|
486
507
|
const actualPort = Number(new URL(url).port);
|
|
487
508
|
ui.intro(`Superwall ${pc.dim(`v${VERSION}`)}`);
|
|
509
|
+
printDevUpdate(dir);
|
|
488
510
|
if (actualPort !== requestedPort) ui.warn(`Port ${requestedPort} was in use — moved to ${actualPort}.`);
|
|
489
511
|
const many = projects.length > 1;
|
|
490
512
|
const rows = projects.flatMap((one) => {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "./token-CWQ6tdva.js";
|
|
2
|
+
import "./storage-BR6imSqm.js";
|
|
3
|
+
import "./environment-sE2wZYdg.js";
|
|
4
|
+
import "./config-DOp5oChe.js";
|
|
5
|
+
import "./skills-BB1uIt8t.js";
|
|
6
|
+
import "./scan-ViBhmrB7.js";
|
|
7
|
+
import "./resources-XwvXA20E.js";
|
|
8
|
+
import "./orgs-DQQJ3sw_.js";
|
|
9
|
+
import "./ui-hFgji1e8.js";
|
|
10
|
+
import "./spinner-BQp7fQvK.js";
|
|
11
|
+
import "./org-BD8U3D1_.js";
|
|
12
|
+
import "./theme-Ed0gz6hr.js";
|
|
13
|
+
import "./lookup-DqmIbUkv.js";
|
|
14
|
+
import "./types-Dc9U_4kp.js";
|
|
15
|
+
import "./session-BfVx50iA.js";
|
|
16
|
+
import "./existing--peXpOZj.js";
|
|
17
|
+
import "./paths-CIlyzF2I.js";
|
|
18
|
+
import "./setup-a4B72xJ8.js";
|
|
19
|
+
import "./framework-DW5fqjh4.js";
|
|
20
|
+
import "./login-C6X7JrhM.js";
|
|
21
|
+
import "./browser-BVjaf98V.js";
|
|
22
|
+
import "./login-DXhm9L0F.js";
|
|
23
|
+
import "./git-Hf9Wc7Hp.js";
|
|
24
|
+
import "./scope-Cg1AdAfO.js";
|
|
25
|
+
import "./upgrade-Cw9jVt-r.js";
|
|
26
|
+
import "./base-CAU0hWoI.js";
|
|
27
|
+
import "./selection-C07e_GGY.js";
|
|
28
|
+
import "./source-DQs6iLtC.js";
|
|
29
|
+
import "./assets-PyuXe45Y.js";
|
|
30
|
+
import "./source-push-w7miTr6m.js";
|
|
31
|
+
import { t as runStudio } from "./server-CBtHzl9y.js";
|
|
32
|
+
|
|
33
|
+
export { runStudio };
|