@superwall/cli 2.4.0 → 2.5.1
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 +7 -0
- package/dist/{apple-Bx_fm5M-.js → apple-BSKxY7Gx.js} +16 -15
- package/dist/approve-DbwsYO4s.js +190 -0
- package/dist/{assets-W5yvyf0V.js → assets-CqpFg5mM.js} +3 -3
- package/dist/auth.d.ts +1 -1
- package/dist/auth.js +3 -3
- package/dist/{billing-C4lXR0xG.js → billing-BopwIhR3.js} +3 -3
- package/dist/{bind-82oTpHZ3.js → bind-DOF3o3FR.js} +4 -4
- package/dist/browser-Bp3yRKlU.js +36 -0
- package/dist/{build-7_8cBgBm.js → build-BF22vVdV.js} +11 -7
- package/dist/{client-ltxxHuxn.js → client-DHlsTaP1.js} +3 -3
- package/dist/{create-DEyveHS6.js → create-CboPfAlN.js} +39 -67
- package/dist/{create-Dk8U_B49.js → create-CiZzZrru.js} +8 -8
- package/dist/create-DAkNdEzt.js +20 -0
- package/dist/design-lint-CvgcSzVg.js +158 -0
- package/dist/{doctor-Df2GwS4K.js → doctor-BqZGaQE5.js} +6 -6
- package/dist/download-F8OtTJze.js +58 -0
- package/dist/{drivers-CTyYdBL7.js → drivers-DkboeR1c.js} +3 -3
- package/dist/entry.js +25 -24
- package/dist/{environment-djS0ik60.js → environment-FR3bcq0D.js} +5 -4
- package/dist/{existing-Das3PHGG.js → existing-C6TTT6c4.js} +2 -2
- package/dist/{session-CV0P8BjK.js → git-DqDPnldI.js} +109 -338
- package/dist/{held-B8EFWDEc.js → held-C2IjAyg6.js} +7 -7
- package/dist/held-KVcYIplR.js +17 -0
- package/dist/install-DoSYCwLL.js +109 -0
- package/dist/{integrate-Cz48dm_h.js → integrate-BSqd2wgI.js} +27 -25
- package/dist/login-BiwaQkXS.js +17 -0
- package/dist/{login-CiK5T4w8.js → login-C6FcBQZg.js} +8 -41
- package/dist/{login-girc324T.js → login-dRPPnGr7.js} +2 -1
- package/dist/{lookup-us5vu5od.js → lookup-D23dAOz6.js} +3 -2
- package/dist/{migrate-DaVwhdov.js → migrate-CDdUCTH3.js} +30 -25
- package/dist/{migration-cS6UGeUj.js → migration-r9plM7F6.js} +29 -11
- package/dist/{notification-url-Hg42tAbW.js → notification-url-rdnENCxt.js} +4 -4
- package/dist/{open-BIuOZ9ka.js → open-DVdE3HnK.js} +2 -2
- package/dist/{org-BrR4HGvl.js → org-DZ41muzA.js} +3 -2
- package/dist/organization-DIODPOwO.js +39 -0
- package/dist/orgs-BxlwcvTu.js +81 -0
- package/dist/{paths-CdwjySxK.js → paths-BaeoxDze.js} +1 -1
- package/dist/{playbook-BJ3opYIS.js → playbook-B-Pdonhg.js} +10 -10
- package/dist/{products-DH_fK9tY.js → products-Cqq59DBQ.js} +1 -1
- package/dist/project-DHU5wc3R.js +47 -0
- package/dist/{promote-BQO-1ScY.js → promote-Ca4URuHY.js} +24 -18
- package/dist/{pull-BhRswq6x.js → pull-CQcTZxW8.js} +9 -28
- package/dist/pull-DRMIxqR8.js +36 -0
- package/dist/pull-_qs90vGA.js +106 -0
- package/dist/{push-CR110qRh.js → push-BlZoIwIj.js} +122 -20
- package/dist/push-Cb4g_l1K.js +30 -0
- package/dist/push-DQE48h_M.js +290 -0
- package/dist/push-DZKsd6Dp.js +22 -0
- package/dist/{registry-DZsWoWqH.js → registry-FNG-uiIt.js} +712 -68
- package/dist/resolve-DGePiHgL.js +196 -0
- package/dist/{resources-BMspgZO1.js → resources-COOEvqqW.js} +3 -80
- package/dist/run-Czbb-sHR.js +1368 -0
- package/dist/{run-D4V6mq8_.js → run-DpYDOAw-.js} +2 -2
- package/dist/scan-2WqHGkjU.js +4 -0
- package/dist/{scan-CRexsHOE.js → scan-BZS2FZeU.js} +1 -1
- package/dist/{scope-Ct0_HoNq.js → scope-BJQ-KcQg.js} +5 -4
- package/dist/scope-t_SqFN6W.js +103 -0
- package/dist/sdk-CyttTnGf.js +71 -0
- package/dist/selection-CWfI4a0O.js +179 -0
- package/dist/series--Wp7TngJ.js +685 -0
- package/dist/{server-Dv1VwbNh.js → server-BmmOj7bh.js} +10 -8
- package/dist/server-BqLPwcy9.js +29 -0
- package/dist/session-BHBIGscL.js +6 -0
- package/dist/{session-UiPlLFn6.js → session-BpYpOgaY.js} +1 -1
- package/dist/session-DYdxTNZf.js +219 -0
- package/dist/{setup-UWLhQG3M.js → setup-DW50luOZ.js} +9 -8
- package/dist/skills/index.json +5 -0
- package/dist/skills/superwall/SKILL.md +48 -30
- package/dist/skills/superwall/references/api.md +3 -2
- package/dist/skills/superwall-editor/SKILL.md +7 -5
- package/dist/skills/superwall-framework/SKILL.md +7 -5
- package/dist/skills/superwall-workspaces/SKILL.md +314 -0
- package/dist/skills/superwall-workspaces/references/cli.md +174 -0
- package/dist/skills/superwall-workspaces/references/slots.md +103 -0
- package/dist/{skills-DzOvse9L.js → skills-Bbtq8V_D.js} +8 -8
- package/dist/{skills-CiWxt6vS.js → skills-Cm1j2d1W.js} +4 -4
- package/dist/{source-push-CX_k_yZD.js → source-push-B3c-VLfe.js} +43 -25
- package/dist/{spinner-1uuKKZMc.js → spinner-025_eqCX.js} +16 -4
- package/dist/starter-hcwocv_Z.js +190 -0
- package/dist/status-K1IGp6pe.js +142 -0
- package/dist/{storage-CrXGgIbS.js → storage-CUMgpcVH.js} +1 -1
- package/dist/{storekit-CptdG4RJ.js → storekit-Cb0TkToV.js} +4 -4
- package/dist/storekit-Dewj_5qg.js +17 -0
- package/dist/{telemetry-BqaPbM0k.js → telemetry-ekUQuhLJ.js} +1 -1
- package/dist/{token-zjjlkNDF.js → token-B2PduqrR.js} +1 -1
- package/dist/tools-skills/superwall/SKILL.md +49 -31
- package/dist/tools-skills/superwall/references/api.md +3 -2
- package/dist/tools-skills/superwall-editor/SKILL.md +7 -5
- package/dist/tools.d.ts +1 -1
- package/dist/tools.js +479 -34
- package/dist/try-BUnhITXS.js +120 -0
- package/dist/{selection-CgZJJ3FD.js → types-CB6O_wjy.js} +1 -178
- package/dist/{upgrade-BBnmcyY2.js → upgrade-CI7K1UZ-.js} +2 -2
- package/dist/{upgrade-AdyF7wXk.js → upgrade-DfZfDljd.js} +2 -2
- package/package.json +5 -3
- package/dist/create-CBCDWuyo.js +0 -19
- package/dist/held-BL4oizD6.js +0 -16
- package/dist/login-DdrOmi6m.js +0 -16
- package/dist/push-B3Onn_mL.js +0 -24
- package/dist/scan-DUQjxOZf.js +0 -4
- package/dist/server-Cv-Ug9JF.js +0 -24
- package/dist/session-BCQuMcQ0.js +0 -6
- package/dist/storekit-B675ZNiA.js +0 -16
- /package/dist/{client-BZ1UbpXz.js → client-BJQXl62Q.js} +0 -0
- /package/dist/{devtools-pBl_vt03.js → devtools-ByZ6XYnn.js} +0 -0
- /package/dist/{input-vi0bou04.js → input-MDd67UIp.js} +0 -0
- /package/dist/{reports-CwwKLUh0.js → reports-BZfxvenS.js} +0 -0
- /package/dist/{screenshot-file-tVBfUEIi.js → screenshot-file-XAS0Xy0e.js} +0 -0
- /package/dist/{storage-gRyQetN9.d.ts → storage-Bdz5AmqS.d.ts} +0 -0
- /package/dist/{timing-BVxPrYq3.js → timing-Ca0TXY-A.js} +0 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./token-B2PduqrR.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-FR3bcq0D.js";
|
|
4
|
+
import "./storage-CUMgpcVH.js";
|
|
5
|
+
import "./client-DHlsTaP1.js";
|
|
6
|
+
import { t as upsertHeldKey } from "./held-C2IjAyg6.js";
|
|
7
|
+
import "./config-CGcG7GOt.js";
|
|
8
|
+
import "./spinner-025_eqCX.js";
|
|
9
|
+
import "./ui-D_qf3Gvw.js";
|
|
10
|
+
import "./orgs-BxlwcvTu.js";
|
|
11
|
+
import "./resources-COOEvqqW.js";
|
|
12
|
+
import "./org-DZ41muzA.js";
|
|
13
|
+
import "./lookup-D23dAOz6.js";
|
|
14
|
+
import "./scope-BJQ-KcQg.js";
|
|
15
|
+
import "./client-BJQXl62Q.js";
|
|
16
|
+
|
|
17
|
+
export { upsertHeldKey };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import "./token-B2PduqrR.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-FR3bcq0D.js";
|
|
4
|
+
import "./storage-CUMgpcVH.js";
|
|
5
|
+
import "./client-DHlsTaP1.js";
|
|
6
|
+
import "./config-CGcG7GOt.js";
|
|
7
|
+
import "./spinner-025_eqCX.js";
|
|
8
|
+
import "./ui-D_qf3Gvw.js";
|
|
9
|
+
import "./orgs-BxlwcvTu.js";
|
|
10
|
+
import "./resources-COOEvqqW.js";
|
|
11
|
+
import "./lookup-D23dAOz6.js";
|
|
12
|
+
import { n as openBrowser } from "./browser-Bp3yRKlU.js";
|
|
13
|
+
import "./types-CB6O_wjy.js";
|
|
14
|
+
import "./scope-t_SqFN6W.js";
|
|
15
|
+
import { C as listWorkspaces, E as setInstallation, S as listVersions, _ as deleteInstallation, b as listInstallations, c as projectRoot, f as readBinding, i as latestManifest, l as resolveWorkspace, o as openLink, t as appEntrypointUrl } from "./resolve-DGePiHgL.js";
|
|
16
|
+
import { r as WorkspaceError } from "./project-DHU5wc3R.js";
|
|
17
|
+
import { n as resolveOrganization, t as resolveAppScope } from "./organization-DIODPOwO.js";
|
|
18
|
+
|
|
19
|
+
//#region src/core/workspaces/install.ts
|
|
20
|
+
const whereLabel = (application) => application === null || application === void 0 ? "the whole organization" : `app ${application}`;
|
|
21
|
+
const installationItem = (installation) => ({
|
|
22
|
+
label: installation.entrypoint_id,
|
|
23
|
+
meta: [
|
|
24
|
+
installation.slot,
|
|
25
|
+
whereLabel(installation.application_id),
|
|
26
|
+
installation.enabled ? "on" : "off",
|
|
27
|
+
`position ${installation.position}`
|
|
28
|
+
].join(", ")
|
|
29
|
+
});
|
|
30
|
+
async function runWorkspaceInstall(ctx, input) {
|
|
31
|
+
const workspace = await resolveWorkspace(ctx, input);
|
|
32
|
+
if (input.entrypoint === void 0) {
|
|
33
|
+
if (input.remove || input.disable || input.app !== void 0 || input.position !== void 0) throw new WorkspaceError("Say which entrypoint: `superwall workspaces install <entrypoint>`.");
|
|
34
|
+
const installations = await listInstallations(ctx.api, workspace.id);
|
|
35
|
+
if (ctx.json) ctx.output.data({ data: installations });
|
|
36
|
+
else ctx.ui.list({
|
|
37
|
+
empty: "Nothing is installed yet.",
|
|
38
|
+
items: installations.map(installationItem)
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const applicationId = input.app === void 0 ? void 0 : (await resolveAppScope(ctx.api, input.app, String(workspace.organization_id))).applicationId;
|
|
43
|
+
if (input.remove) {
|
|
44
|
+
if (!input.yes) {
|
|
45
|
+
if (!ctx.interactive) throw new WorkspaceError("Removing an installation ends sessions that are open. Pass --yes to go ahead.");
|
|
46
|
+
if (!await ctx.ui.confirm({
|
|
47
|
+
message: `Remove \`${input.entrypoint}\` from ${whereLabel(applicationId)}? Sessions that are open will end.`,
|
|
48
|
+
initial: false
|
|
49
|
+
})) {
|
|
50
|
+
ctx.ui.outro("Nothing was removed.");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const left = await deleteInstallation(ctx.api, workspace.id, input.entrypoint, applicationId);
|
|
55
|
+
if (ctx.json) ctx.output.data(left);
|
|
56
|
+
else ctx.ui.success(`Removed \`${input.entrypoint}\` from ${whereLabel(applicationId)}.`);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const installation = await setInstallation(ctx.api, workspace.id, {
|
|
60
|
+
entrypoint_id: input.entrypoint,
|
|
61
|
+
application_id: applicationId === void 0 ? null : Number(applicationId),
|
|
62
|
+
enabled: !input.disable,
|
|
63
|
+
...input.position === void 0 ? {} : { position: input.position }
|
|
64
|
+
});
|
|
65
|
+
if (ctx.json) {
|
|
66
|
+
ctx.output.data(installation);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
ctx.ui.success(input.disable ? `Turned \`${input.entrypoint}\` off for ${whereLabel(applicationId)}.` : `Installed \`${input.entrypoint}\` for ${whereLabel(applicationId)}.`);
|
|
70
|
+
}
|
|
71
|
+
async function runWorkspaceList(ctx, input) {
|
|
72
|
+
const organizationId = await resolveOrganization(ctx, input.org ?? readBinding(projectRoot(input.dir))?.organizationId);
|
|
73
|
+
const workspaces = await listWorkspaces(ctx.api, organizationId);
|
|
74
|
+
if (ctx.json) {
|
|
75
|
+
ctx.output.data({ data: workspaces });
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
ctx.ui.list({
|
|
79
|
+
empty: `No workspaces in organization ${organizationId} yet.`,
|
|
80
|
+
items: workspaces.map((workspace) => ({
|
|
81
|
+
label: workspace.name,
|
|
82
|
+
meta: `${workspace.slug}, id ${workspace.id}, ${workspace.state.replaceAll("_", " ")}`
|
|
83
|
+
}))
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async function runWorkspaceOpen(ctx, input, seams = {}) {
|
|
87
|
+
const workspace = await resolveWorkspace(ctx, input);
|
|
88
|
+
if (input.entrypoint !== void 0 && input.app === void 0) throw new WorkspaceError("An entrypoint opens inside an app. Say which with --app <id>.");
|
|
89
|
+
const manifest = latestManifest(await listVersions(ctx.api, workspace.id).catch(() => []));
|
|
90
|
+
let url;
|
|
91
|
+
if (input.entrypoint !== void 0 && input.app !== void 0) {
|
|
92
|
+
const { applicationId } = await resolveAppScope(ctx.api, input.app, String(workspace.organization_id));
|
|
93
|
+
const entrypoint = manifest?.entrypoints.find((candidate) => candidate.id === input.entrypoint);
|
|
94
|
+
url = appEntrypointUrl(ctx.api.host, workspace, String(applicationId), entrypoint ?? {
|
|
95
|
+
id: input.entrypoint,
|
|
96
|
+
slot: "app.page@1",
|
|
97
|
+
title: ""
|
|
98
|
+
});
|
|
99
|
+
} else url = (await openLink(ctx, workspace, manifest)).url;
|
|
100
|
+
if (ctx.json) {
|
|
101
|
+
ctx.output.data({ url });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
ctx.ui.info(`Open ${url}`);
|
|
105
|
+
if (input.open && ctx.outputMode === "rich") await (seams.open ?? openBrowser)(url);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
//#endregion
|
|
109
|
+
export { runWorkspaceInstall, runWorkspaceList, runWorkspaceOpen };
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import "./token-
|
|
1
|
+
import "./token-B2PduqrR.js";
|
|
2
2
|
import { r as formatJson, t as blocks } from "./output-Ggzq5_-t.js";
|
|
3
|
-
import {
|
|
4
|
-
import { i as removeSession, n as readSession, s as sessionOrgName } from "./storage-
|
|
5
|
-
import { i as superwallApi } from "./client-
|
|
3
|
+
import { d as DASHBOARD_URL, x as VERSION } from "./environment-FR3bcq0D.js";
|
|
4
|
+
import { i as removeSession, n as readSession, s as sessionOrgName } from "./storage-CUMgpcVH.js";
|
|
5
|
+
import { i as superwallApi } from "./client-DHlsTaP1.js";
|
|
6
6
|
import { i as readOnboardedApp } from "./config-CGcG7GOt.js";
|
|
7
|
-
import { i as updateTelemetryTags } from "./telemetry-
|
|
7
|
+
import { i as updateTelemetryTags } from "./telemetry-ekUQuhLJ.js";
|
|
8
8
|
import "./spawn-DmmmHIP-.js";
|
|
9
|
-
import { n as withSpinner } from "./spinner-
|
|
9
|
+
import { n as withSpinner } from "./spinner-025_eqCX.js";
|
|
10
10
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
11
11
|
import "./theme-DUsCh-Vd.js";
|
|
12
12
|
import { t as stripReport } from "./log-C0MDCfA2.js";
|
|
13
|
-
import { n as SUPPORTED_LABEL, t as scanProject } from "./scan-
|
|
14
|
-
import { t as detectExisting } from "./existing-
|
|
15
|
-
import { r as expandHome } from "./paths-
|
|
16
|
-
import
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import
|
|
21
|
-
import {
|
|
22
|
-
import "./
|
|
23
|
-
import
|
|
24
|
-
import "./
|
|
25
|
-
import
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
-
import {
|
|
29
|
-
import { n as
|
|
30
|
-
import { r as
|
|
31
|
-
import { n as
|
|
13
|
+
import { n as SUPPORTED_LABEL, t as scanProject } from "./scan-BZS2FZeU.js";
|
|
14
|
+
import { t as detectExisting } from "./existing-C6TTT6c4.js";
|
|
15
|
+
import { r as expandHome } from "./paths-BaeoxDze.js";
|
|
16
|
+
import "./orgs-BxlwcvTu.js";
|
|
17
|
+
import { A as listField, O as field, T as rowName, h as listResource, p as listApplications, s as createProduct, y as platformLabel } from "./resources-COOEvqqW.js";
|
|
18
|
+
import "./org-DZ41muzA.js";
|
|
19
|
+
import "./lookup-D23dAOz6.js";
|
|
20
|
+
import "./scope-BJQ-KcQg.js";
|
|
21
|
+
import { a as listAscConfigs, r as createAscConfig } from "./client-BJQXl62Q.js";
|
|
22
|
+
import { i as listUnimportedAscProducts, n as findAscAppId, r as listAscApps, t as ascTypeDisplay } from "./products-Cqq59DBQ.js";
|
|
23
|
+
import "./input-MDd67UIp.js";
|
|
24
|
+
import { n as resolveAppBinding, r as resolveScopeFromKey, t as platformForIntegration } from "./bind-DOF3o3FR.js";
|
|
25
|
+
import "./login-C6FcBQZg.js";
|
|
26
|
+
import { s as ensureSkillsCurrent } from "./skills-Cm1j2d1W.js";
|
|
27
|
+
import "./browser-Bp3yRKlU.js";
|
|
28
|
+
import { t as generateStoreKit } from "./storekit-Cb0TkToV.js";
|
|
29
|
+
import { n as performLoginWithUi, t as createLoginGate } from "./login-dRPPnGr7.js";
|
|
30
|
+
import { a as copyToClipboard, r as buildCopyPrompt, t as runAction } from "./run-DpYDOAw-.js";
|
|
31
|
+
import { n as selectHostedStatus, t as detectDrivers } from "./drivers-DkboeR1c.js";
|
|
32
|
+
import { r as actionById, t as detectBilling } from "./billing-BopwIhR3.js";
|
|
33
|
+
import { n as writeReport, t as readReport } from "./reports-BZfxvenS.js";
|
|
32
34
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
33
35
|
import { basename } from "node:path";
|
|
34
36
|
import fg from "fast-glob";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./token-B2PduqrR.js";
|
|
2
|
+
import "./output-Ggzq5_-t.js";
|
|
3
|
+
import "./environment-FR3bcq0D.js";
|
|
4
|
+
import "./storage-CUMgpcVH.js";
|
|
5
|
+
import "./client-DHlsTaP1.js";
|
|
6
|
+
import "./config-CGcG7GOt.js";
|
|
7
|
+
import "./telemetry-ekUQuhLJ.js";
|
|
8
|
+
import "./spawn-DmmmHIP-.js";
|
|
9
|
+
import "./spinner-025_eqCX.js";
|
|
10
|
+
import "./ui-D_qf3Gvw.js";
|
|
11
|
+
import "./scan-BZS2FZeU.js";
|
|
12
|
+
import "./paths-BaeoxDze.js";
|
|
13
|
+
import { i as startLogin, n as pollLogin, r as runLogin, t as performLogin } from "./login-C6FcBQZg.js";
|
|
14
|
+
import "./skills-Cm1j2d1W.js";
|
|
15
|
+
import "./browser-Bp3yRKlU.js";
|
|
16
|
+
|
|
17
|
+
export { performLogin, pollLogin, runLogin, startLogin };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as writePendingLogin, l as writeSession, o as serializeSession, r as removePendingLogin, t as readPendingLogin } from "./storage-
|
|
1
|
+
import { g as OAUTH_SCOPE, h as Integration, i as AUTH_HOST, l as CLI_CLIENT_ID, t as API_HOST } from "./environment-FR3bcq0D.js";
|
|
2
|
+
import { c as writePendingLogin, l as writeSession, o as serializeSession, r as removePendingLogin, t as readPendingLogin } from "./storage-CUMgpcVH.js";
|
|
3
3
|
import { a as readOnboardedOrg, m as writeOnboardedOrg, o as readOnboardingIdempotencyKey, p as writeOnboardedApp } from "./config-CGcG7GOt.js";
|
|
4
|
-
import { r as track } from "./telemetry-
|
|
5
|
-
import { r as UsageError } from "./spinner-
|
|
4
|
+
import { r as track } from "./telemetry-ekUQuhLJ.js";
|
|
5
|
+
import { r as UsageError } from "./spinner-025_eqCX.js";
|
|
6
6
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
7
|
-
import { t as scanProject } from "./scan-
|
|
8
|
-
import { s as ensureSkillsCurrent } from "./skills-
|
|
9
|
-
import {
|
|
7
|
+
import { t as scanProject } from "./scan-BZS2FZeU.js";
|
|
8
|
+
import { s as ensureSkillsCurrent } from "./skills-Cm1j2d1W.js";
|
|
9
|
+
import { n as openBrowser, t as BROWSER_UNAVAILABLE } from "./browser-Bp3yRKlU.js";
|
|
10
10
|
import { setTimeout } from "node:timers/promises";
|
|
11
11
|
|
|
12
12
|
//#region src/core/account/onboarding.ts
|
|
@@ -57,39 +57,6 @@ function onboardingHooks(app) {
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/core/account/browser.ts
|
|
62
|
-
const BROWSER_UNAVAILABLE = "Couldn't open a browser here. Open the URL above to approve the login.";
|
|
63
|
-
function hasDisplay(env, platform) {
|
|
64
|
-
if (platform !== "linux") return true;
|
|
65
|
-
return Boolean(env.DISPLAY || env.WAYLAND_DISPLAY || env.WSL_DISTRO_NAME);
|
|
66
|
-
}
|
|
67
|
-
function openBrowser(url, deps = {}) {
|
|
68
|
-
const platform = deps.platform ?? process.platform;
|
|
69
|
-
const env = deps.env ?? process.env;
|
|
70
|
-
if (env.BROWSER === "none" || !hasDisplay(env, platform)) return Promise.resolve(false);
|
|
71
|
-
const cmd = platform === "darwin" ? "open" : platform === "win32" ? "cmd" : "xdg-open";
|
|
72
|
-
const args = platform === "win32" ? [
|
|
73
|
-
"/c",
|
|
74
|
-
"start",
|
|
75
|
-
"",
|
|
76
|
-
url
|
|
77
|
-
] : [url];
|
|
78
|
-
return new Promise((resolve) => {
|
|
79
|
-
try {
|
|
80
|
-
const child = (deps.spawn ?? spawn)(cmd, args, {
|
|
81
|
-
stdio: "ignore",
|
|
82
|
-
detached: true
|
|
83
|
-
});
|
|
84
|
-
child.once("error", () => resolve(false));
|
|
85
|
-
child.once("spawn", () => resolve(true));
|
|
86
|
-
child.unref();
|
|
87
|
-
} catch {
|
|
88
|
-
resolve(false);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
60
|
//#endregion
|
|
94
61
|
//#region src/core/account/login.ts
|
|
95
62
|
const DEVICE_GRANT = "urn:ietf:params:oauth:grant-type:device_code";
|
|
@@ -589,4 +556,4 @@ async function runLogin(ctx, { flags, openBrowser: openBrowser$1 }) {
|
|
|
589
556
|
}
|
|
590
557
|
|
|
591
558
|
//#endregion
|
|
592
|
-
export {
|
|
559
|
+
export { onboardingHooks as a, startLogin as i, pollLogin as n, runLogin as r, performLogin as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
2
|
-
import { a as
|
|
2
|
+
import { a as onboardingHooks, t as performLogin } from "./login-C6FcBQZg.js";
|
|
3
|
+
import { t as BROWSER_UNAVAILABLE } from "./browser-Bp3yRKlU.js";
|
|
3
4
|
|
|
4
5
|
//#region src/core/workflows/login.ts
|
|
5
6
|
async function performLoginWithUi(app, onProvisioned) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as ApiError } from "./client-
|
|
2
|
-
import {
|
|
1
|
+
import { t as ApiError } from "./client-DHlsTaP1.js";
|
|
2
|
+
import { a as orgProjects, s as rememberOrg } from "./orgs-BxlwcvTu.js";
|
|
3
|
+
import { m as listProjects } from "./resources-COOEvqqW.js";
|
|
3
4
|
|
|
4
5
|
//#region src/core/api/lookup.ts
|
|
5
6
|
const DASHBOARD_PATH = /^\/(\d+)(?:\/(\d+))?(?:\/|$)/;
|
|
@@ -1,34 +1,39 @@
|
|
|
1
|
-
import "./token-
|
|
1
|
+
import "./token-B2PduqrR.js";
|
|
2
2
|
import { t as blocks } from "./output-Ggzq5_-t.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as readSession, s as sessionOrgName } from "./storage-
|
|
5
|
-
import "./client-
|
|
3
|
+
import { d as DASHBOARD_URL, x as VERSION } from "./environment-FR3bcq0D.js";
|
|
4
|
+
import { n as readSession, s as sessionOrgName } from "./storage-CUMgpcVH.js";
|
|
5
|
+
import "./client-DHlsTaP1.js";
|
|
6
6
|
import "./config-CGcG7GOt.js";
|
|
7
|
-
import "./telemetry-
|
|
7
|
+
import "./telemetry-ekUQuhLJ.js";
|
|
8
8
|
import "./spawn-DmmmHIP-.js";
|
|
9
|
-
import "./spinner-
|
|
9
|
+
import "./spinner-025_eqCX.js";
|
|
10
10
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
11
11
|
import "./theme-DUsCh-Vd.js";
|
|
12
12
|
import { t as stripReport } from "./log-C0MDCfA2.js";
|
|
13
|
-
import { t as scanProject } from "./scan-
|
|
14
|
-
import { t as detectExisting } from "./existing-
|
|
15
|
-
import "./paths-
|
|
16
|
-
import "./
|
|
17
|
-
import "./
|
|
18
|
-
import "./
|
|
19
|
-
import "./
|
|
20
|
-
import "./
|
|
21
|
-
import "./
|
|
22
|
-
import
|
|
23
|
-
import "./
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import "./
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
13
|
+
import { t as scanProject } from "./scan-BZS2FZeU.js";
|
|
14
|
+
import { t as detectExisting } from "./existing-C6TTT6c4.js";
|
|
15
|
+
import "./paths-BaeoxDze.js";
|
|
16
|
+
import "./orgs-BxlwcvTu.js";
|
|
17
|
+
import "./resources-COOEvqqW.js";
|
|
18
|
+
import "./lookup-D23dAOz6.js";
|
|
19
|
+
import "./login-C6FcBQZg.js";
|
|
20
|
+
import "./skills-Cm1j2d1W.js";
|
|
21
|
+
import "./browser-Bp3yRKlU.js";
|
|
22
|
+
import "./assets-CqpFg5mM.js";
|
|
23
|
+
import "./selection-CWfI4a0O.js";
|
|
24
|
+
import "./types-CB6O_wjy.js";
|
|
25
|
+
import { n as requireApi } from "./session-DYdxTNZf.js";
|
|
26
|
+
import "./source-push-B3c-VLfe.js";
|
|
27
|
+
import "./git-DqDPnldI.js";
|
|
28
|
+
import "./scope-t_SqFN6W.js";
|
|
29
|
+
import { n as performLoginWithUi } from "./login-dRPPnGr7.js";
|
|
30
|
+
import { t as runAction } from "./run-DpYDOAw-.js";
|
|
31
|
+
import { t as detectDrivers } from "./drivers-DkboeR1c.js";
|
|
32
|
+
import { a as migrationSource, c as scaffoldFromPaywall, d as findScreenCandidates, f as placementOfName, i as migrationFor, l as scaffoldFromScreen, n as hasOriginal, o as offerMigration, p as screenNameOf, s as projectDirOf, t as buildMigrationCopyPrompt, u as screenMigrationFor } from "./migration-r9plM7F6.js";
|
|
33
|
+
import "./server-BmmOj7bh.js";
|
|
34
|
+
import { i as startStudio, n as migrationNextSteps, r as screenNextSteps, t as askStudio } from "./open-DVdE3HnK.js";
|
|
35
|
+
import { r as actionById, t as detectBilling } from "./billing-BopwIhR3.js";
|
|
36
|
+
import { n as writeReport } from "./reports-BZfxvenS.js";
|
|
32
37
|
import { execFile } from "node:child_process";
|
|
33
38
|
import * as fs from "node:fs";
|
|
34
39
|
import * as os$1 from "node:os";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as ApiError } from "./client-
|
|
1
|
+
import { d as DASHBOARD_URL } from "./environment-FR3bcq0D.js";
|
|
2
|
+
import { t as ApiError } from "./client-DHlsTaP1.js";
|
|
3
3
|
import { t as stripReport } from "./log-C0MDCfA2.js";
|
|
4
|
-
import { i as readPackageJson, r as allDeps } from "./scan-
|
|
5
|
-
import { l as findPaywall, p as listApplications } from "./resources-
|
|
6
|
-
import { d as readBundledSkill } from "./skills-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { a as copyToClipboard, i as readPrompt, n as runWithDriverFallback } from "./run-
|
|
10
|
-
import { t as detectDrivers } from "./drivers-
|
|
4
|
+
import { i as readPackageJson, r as allDeps } from "./scan-BZS2FZeU.js";
|
|
5
|
+
import { l as findPaywall, p as listApplications } from "./resources-COOEvqqW.js";
|
|
6
|
+
import { d as readBundledSkill } from "./skills-Cm1j2d1W.js";
|
|
7
|
+
import { c as isScreenOrigin, f as readLock, m as writeApp, v as writeOrigin } from "./types-CB6O_wjy.js";
|
|
8
|
+
import { a as projectPackageName } from "./session-DYdxTNZf.js";
|
|
9
|
+
import { a as copyToClipboard, i as readPrompt, n as runWithDriverFallback } from "./run-DpYDOAw-.js";
|
|
10
|
+
import { t as detectDrivers } from "./drivers-DkboeR1c.js";
|
|
11
11
|
import * as fs from "node:fs";
|
|
12
12
|
import * as path from "node:path";
|
|
13
13
|
import fg from "fast-glob";
|
|
@@ -356,15 +356,32 @@ const SUPERWALL_DTS = "// Generated by the Superwall CLI. Commit it; don't edit
|
|
|
356
356
|
const GITIGNORE = "node_modules/\n.superwall\n.env\n";
|
|
357
357
|
const CONFIG = "import { definePaywall } from \"superwall/config\";\n\nexport default definePaywall({\n /** What this paywall is called on Superwall. Defaults to the directory name. */\n name: \"Pro\",\n\n /**\n * What the host paints behind the paywall, per scheme. `--sw-background` in\n * theme.css paints the routes; this is what shows when an iOS scroll\n * rubber-bands past the content, so the two carry the same colours.\n */\n background: { light: \"#fdfef6\", dark: \"#0c0d0f\" },\n\n /**\n * The products this paywall sells, as `reference: \"store identifier\"`.\n *\n * The identifiers below are placeholders — replace them with products that\n * exist in your Superwall dashboard. Nothing about a product is stored here:\n * price, period and trial all come from the store at runtime, which is why\n * `useProducts()` returns nothing until these match. Run `superwall dev`\n * against a connected app and the real prices appear, locally and on device.\n *\n * A reference the dashboard has no product for blocks publishing, so a\n * paywall can never ship with prices it cannot render.\n */\n products: {\n monthly: \"pro_999_month\",\n },\n});\n";
|
|
358
358
|
const MESSAGES = "export default {\n paywall: {\n title: \"Go Pro\",\n subtitle: \"Everything unlocked, cancel whenever you like.\",\n cta: \"Subscribe · {price}\",\n ctaBare: \"Subscribe\",\n restore: \"Restore purchases\",\n close: \"Close\",\n },\n purchase: {\n failed: \"That didn't go through. Try again.\",\n },\n restore: {\n restored: \"Purchases restored.\",\n failed: \"Nothing to restore, or the store didn't answer. Try again.\",\n },\n footer: {\n builtWith: \"Built with\",\n superwall: \"Superwall\",\n },\n} as const;\n";
|
|
359
|
-
const INDEX = "import * as React from \"react\";\nimport { useActions, useHaptics, useProducts, usePurchase, useTranslation } from \"superwall/hooks\";\n\nexport default function Index() {\n const { close, restore } = useActions();\n const { getProduct } = useProducts();\n const { purchase } = usePurchase();\n const { t } = useTranslation();\n const haptics = useHaptics();\n\n // One line of copy for an outcome worth saying; nothing for an abandoned sheet.\n const [notice, setNotice] = React.useState<string>();\n\n const monthly = getProduct(\"monthly\");\n const price = monthly?.variables.price;\n\n return (\n <main className=\"page\">\n <button\n type=\"button\"\n className=\"close\"\n aria-label={t(\"paywall.close\")}\n onClick={() => {\n haptics.light();\n close();\n }}\n >\n <svg viewBox=\"0 0 16 16\" width=\"24\" height=\"24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 4 12 12M12 4 4 12\" />\n </svg>\n </button>\n\n <div className=\"lede\">\n <h1>{t(\"paywall.title\")}</h1>\n <p>{t(\"paywall.subtitle\")}</p>\n </div>\n\n <div className=\"actions\">\n {notice ? (\n <p className=\"notice\" role=\"status\">\n {notice}\n </p>\n ) : null}\n <
|
|
359
|
+
const INDEX = "import * as React from \"react\";\nimport { useActions, useHaptics, useProducts, usePurchase, useTranslation } from \"superwall/hooks\";\nimport { Button } from \"@/components/Button\";\n\nexport default function Index() {\n const { close, restore } = useActions();\n const { getProduct } = useProducts();\n const { purchase } = usePurchase();\n const { t } = useTranslation();\n const haptics = useHaptics();\n\n // One line of copy for an outcome worth saying; nothing for an abandoned sheet.\n const [notice, setNotice] = React.useState<string>();\n\n const monthly = getProduct(\"monthly\");\n const price = monthly?.variables.price;\n\n return (\n <main className=\"page\">\n <button\n type=\"button\"\n className=\"close\"\n aria-label={t(\"paywall.close\")}\n onClick={() => {\n haptics.light();\n close();\n }}\n >\n <svg viewBox=\"0 0 16 16\" width=\"24\" height=\"24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" aria-hidden=\"true\">\n <path d=\"M4 4 12 12M12 4 4 12\" />\n </svg>\n </button>\n\n <div className=\"lede\">\n <h1>{t(\"paywall.title\")}</h1>\n <p>{t(\"paywall.subtitle\")}</p>\n </div>\n\n <div className=\"actions\">\n {notice ? (\n <p className=\"notice\" role=\"status\">\n {notice}\n </p>\n ) : null}\n <Button\n variant=\"primary\"\n onClick={async () => {\n haptics.light();\n setNotice(undefined);\n // Never a loading state: the store sheet is the feedback and the SDK owns it.\n const result = await purchase(\"monthly\");\n if (result.status === \"completed\") haptics.success(); // the SDK dismisses the paywall\n else if (result.status === \"failed\") setNotice(t(\"purchase.failed\")); // iOS only; the button stays enabled\n // abandoned: the user closed the sheet — nothing changes, nothing is said\n }}\n >\n {price ? t(\"paywall.cta\", { price }) : t(\"paywall.ctaBare\")}\n </Button>\n <button\n type=\"button\"\n className=\"link\"\n onClick={async () => {\n haptics.light();\n setNotice(undefined);\n // \"Nothing to restore\" and a store error both resolve `failed`; the copy covers both.\n const result = await restore();\n if (result.status === \"restored\") haptics.success();\n setNotice(result.status === \"restored\" ? t(\"restore.restored\") : t(\"restore.failed\"));\n }}\n >\n {t(\"paywall.restore\")}\n </button>\n </div>\n </main>\n );\n}\n";
|
|
360
360
|
const LAYOUT = "import type { PropsWithChildren } from \"react\";\nimport { useActions, useHaptics, useTranslation } from \"superwall/hooks\";\nimport { Wordmark } from \"../components/Wordmark\";\nimport \"./theme.css\";\n\nexport default function Layout({ children }: PropsWithChildren) {\n const { openUrl } = useActions();\n const { t } = useTranslation();\n const haptics = useHaptics();\n\n return (\n <div className=\"shell\">\n {children}\n <footer className=\"built\">\n {t(\"footer.builtWith\")}\n <button\n type=\"button\"\n className=\"wordmark\"\n aria-label={t(\"footer.superwall\")}\n onClick={() => {\n haptics.light();\n openUrl(\"https://superwall.com\");\n }}\n >\n <Wordmark />\n </button>\n </footer>\n </div>\n );\n}\n";
|
|
361
361
|
const WORDMARK = "/**\n * The Superwall wordmark, the same artwork as superwall.com and the\n * dashboard: \"$UPER\" in the accent, \"WALL\" in the foreground. Inlined so it\n * needs no network fetch and the two colours follow the theme\n * (`--logo-primary` / `--logo-secondary`, set on `.wordmark` in theme.css).\n */\nexport function Wordmark() {\n return (\n <svg className=\"wordmark-art\" viewBox=\"0 0 691 108\" fill=\"none\" aria-hidden=\"true\" focusable=\"false\">\n <path d=\"M634.735 95.5696C633.858 95.5696 633.142 95.2909 632.584 94.7334C632.027 94.1759 631.748 93.4592 631.748 92.5831V14.9343C631.748 14.0582 632.027 13.3415 632.584 12.784C633.142 12.2265 633.858 11.9478 634.735 11.9478H647.995C648.871 11.9478 649.587 12.2265 650.145 12.784C650.702 13.3415 650.981 14.0582 650.981 14.9343V76.562C650.981 78.2189 652.324 79.562 653.981 79.562H688.014C688.89 79.562 689.606 79.8407 690.164 80.3982C690.721 80.9557 691 81.6725 691 82.5485V92.5831C691 93.4592 690.721 94.1759 690.164 94.7334C689.606 95.2909 688.89 95.5696 688.014 95.5696H634.735Z\" fill=\"var(--logo-secondary)\" />\n <path d=\"M565.229 95.5696C564.353 95.5696 563.636 95.2909 563.078 94.7334C562.521 94.1759 562.242 93.4592 562.242 92.5831V14.9343C562.242 14.0582 562.521 13.3415 563.078 12.784C563.636 12.2265 564.353 11.9478 565.229 11.9478H578.489C579.365 11.9478 580.082 12.2265 580.639 12.784C581.196 13.3415 581.475 14.0582 581.475 14.9343V76.562C581.475 78.2189 582.818 79.562 584.475 79.562H618.508C619.384 79.562 620.101 79.8407 620.658 80.3982C621.215 80.9557 621.494 81.6725 621.494 82.5485V92.5831C621.494 93.4592 621.215 94.1759 620.658 94.7334C620.101 95.2909 619.384 95.5696 618.508 95.5696H565.229Z\" fill=\"var(--logo-secondary)\" />\n <path d=\"M472.962 95.5696C472.245 95.5696 471.648 95.3307 471.17 94.8529C470.692 94.2954 470.453 93.6981 470.453 93.061C470.453 92.6628 470.493 92.3044 470.573 91.9858L499.004 15.1732C499.243 14.2971 499.721 13.5406 500.438 12.9034C501.154 12.2663 502.15 11.9478 503.424 11.9478H518.715C519.989 11.9478 520.985 12.2663 521.701 12.9034C522.418 13.5406 522.896 14.2971 523.135 15.1732L551.566 91.9858C551.646 92.3044 551.686 92.6628 551.686 93.061C551.686 93.6981 551.447 94.2954 550.969 94.8529C550.491 95.3307 549.894 95.5696 549.177 95.5696H536.753C535.559 95.5696 534.683 95.2909 534.125 94.7334C533.568 94.1759 533.209 93.6583 533.05 93.1804L528.652 81.7257C528.207 80.5662 527.094 79.8009 525.852 79.8009H496.287C495.045 79.8009 493.932 80.5662 493.487 81.7257L489.089 93.1804C488.93 93.6583 488.571 94.1759 488.014 94.7334C487.456 95.2909 486.58 95.5696 485.386 95.5696H472.962ZM500.097 60.3717C499.391 62.3271 500.84 64.3906 502.919 64.3906H519.115C521.19 64.3906 522.638 62.3343 521.94 60.3804L513.881 37.8465C512.933 35.1978 509.19 35.1921 508.234 37.8378L500.097 60.3717Z\" fill=\"var(--logo-secondary)\" />\n <path d=\"M392.505 95.5696C391.231 95.5696 390.275 95.2112 389.638 94.4945C389.08 93.7777 388.842 92.9017 388.921 91.8664L390.952 14.6953C390.952 13.9786 391.231 13.3415 391.788 12.784C392.346 12.2265 393.023 11.9478 393.819 11.9478H406.004C407.119 11.9478 407.915 12.1867 408.393 12.6645C408.871 13.1424 409.07 13.8591 408.99 14.8148L407.847 51.2385C407.747 54.4211 412.02 55.5467 413.501 52.7278L423.564 33.57C423.963 32.9329 424.52 32.2559 425.237 31.5392C425.954 30.8224 426.909 30.464 428.104 30.464H435.63C436.904 30.464 437.74 30.8224 438.139 31.5392C438.537 32.2559 438.776 32.9329 438.855 33.57L440.889 52.6026C441.223 55.7286 445.53 56.3008 446.669 53.3705L461.792 14.4564C462.429 12.784 463.783 11.9478 465.853 11.9478H478.874C479.83 11.9478 480.427 12.2663 480.666 12.9034C480.985 13.5406 480.985 14.2175 480.666 14.9343L451.518 91.8664C451.12 92.9017 450.443 93.7777 449.487 94.4945C448.611 95.2112 447.536 95.5696 446.262 95.5696H436.347C434.993 95.5696 434.037 95.2511 433.48 94.6139C433.002 93.8972 432.683 93.1804 432.524 92.4637L428.181 64.5033C427.737 61.6484 423.911 61.0087 422.563 63.5641L407.318 92.4637C406.92 93.1804 406.322 93.8972 405.526 94.6139C404.73 95.2511 403.694 95.5696 402.42 95.5696H392.505Z\" fill=\"var(--logo-secondary)\" />\n <path d=\"M311.837 95.5696C310.961 95.5696 310.244 95.2909 309.687 94.7334C309.129 94.1759 308.851 93.4592 308.851 92.5831V14.9343C308.851 14.0582 309.129 13.3415 309.687 12.784C310.244 12.2265 310.961 11.9478 311.837 11.9478H343.494C353.449 11.9478 361.293 14.2573 367.028 18.8764C372.762 23.4159 375.629 29.9862 375.629 38.5873C375.629 44.401 374.235 49.259 371.448 53.1614C369.298 56.1713 366.579 58.5889 363.292 60.4144C361.712 61.2921 361.004 63.2757 361.893 64.8504L377.062 91.7469C377.301 92.2247 377.42 92.6628 377.42 93.061C377.42 93.6981 377.182 94.2954 376.704 94.8529C376.226 95.3307 375.629 95.5696 374.912 95.5696H361.652C360.218 95.5696 359.143 95.2112 358.426 94.4945C357.71 93.6981 357.192 92.9813 356.873 92.3442L343.146 66.5773C342.625 65.5991 341.607 64.9879 340.498 64.9879H330.845C329.188 64.9879 327.845 66.3311 327.845 67.9879V92.5831C327.845 93.4592 327.566 94.1759 327.008 94.7334C326.451 95.2909 325.734 95.5696 324.858 95.5696H311.837ZM327.845 46.8165C327.845 48.4734 329.188 49.8165 330.845 49.8165H343.136C347.516 49.8165 350.741 48.821 352.812 46.83C354.962 44.839 356.037 42.0516 356.037 38.4678C356.037 34.884 355.002 32.0568 352.931 29.9862C350.861 27.9155 347.595 26.8802 343.136 26.8802H330.845C329.188 26.8802 327.845 28.2234 327.845 29.8802V46.8165Z\" fill=\"var(--logo-primary)\" />\n <path d=\"M240.339 95.5696C239.463 95.5696 238.746 95.2909 238.189 94.7334C237.631 94.1759 237.353 93.4592 237.353 92.5831V14.9343C237.353 14.0582 237.631 13.3415 238.189 12.784C238.746 12.2265 239.463 11.9478 240.339 11.9478H294.454C295.33 11.9478 296.047 12.2265 296.605 12.784C297.162 13.3415 297.441 14.0582 297.441 14.9343V24.491C297.441 25.2874 297.162 25.9644 296.605 26.5219C296.047 27.0793 295.33 27.3581 294.454 27.3581H258.749C257.092 27.3581 255.749 28.7012 255.749 30.3581V43.1133C255.749 44.7701 257.092 46.1133 258.749 46.1133H291.826C292.702 46.1133 293.419 46.392 293.976 46.9495C294.534 47.507 294.813 48.2237 294.813 49.0998V57.9398C294.813 58.7362 294.534 59.4131 293.976 59.9706C293.419 60.5281 292.702 60.8068 291.826 60.8068H258.749C257.092 60.8068 255.749 62.15 255.749 63.8068V77.1593C255.749 78.8162 257.092 80.1593 258.749 80.1593H295.41C296.286 80.1593 297.003 80.438 297.56 80.9955C298.118 81.553 298.396 82.2698 298.396 83.1458V92.5831C298.396 93.4592 298.118 94.1759 297.56 94.7334C297.003 95.2909 296.286 95.5696 295.41 95.5696H240.339Z\" fill=\"var(--logo-primary)\" />\n <path d=\"M164.408 95.5696C163.532 95.5696 162.816 95.2909 162.258 94.7334C161.701 94.1759 161.422 93.4592 161.422 92.5831V14.9343C161.422 14.0582 161.701 13.3415 162.258 12.784C162.816 12.2265 163.532 11.9478 164.408 11.9478H197.021C203.472 11.9478 209.046 12.9433 213.745 14.9343C218.524 16.9252 222.227 19.9516 224.855 24.0132C227.563 27.9952 228.917 32.9727 228.917 38.9457C228.917 44.9983 227.563 50.0156 224.855 53.9976C222.227 57.9 218.524 60.8068 213.745 62.7182C209.046 64.6295 203.472 65.5852 197.021 65.5852H184.013C182.356 65.5852 181.013 66.9284 181.013 68.5852V92.5831C181.013 93.4592 180.735 94.1759 180.177 94.7334C179.62 95.2909 178.903 95.5696 178.027 95.5696H164.408ZM180.655 47.7722C180.655 49.429 181.998 50.7722 183.655 50.7722H196.424C200.485 50.7722 203.631 49.7767 205.861 47.7857C208.17 45.7947 209.325 42.8082 209.325 38.8262C209.325 35.3221 208.29 32.455 206.219 30.2251C204.228 27.9952 200.963 26.8802 196.424 26.8802H183.655C181.998 26.8802 180.655 28.2234 180.655 29.8802V47.7722Z\" fill=\"var(--logo-primary)\" />\n <path d=\"M114.645 96.7637C107.637 96.7637 101.504 95.6089 96.2481 93.2994C90.9919 90.9102 86.9303 87.2866 84.0632 82.4286C81.1962 77.4909 79.7627 71.2392 79.7627 63.6734V14.9338C79.7627 14.0577 80.0414 13.341 80.5989 12.7835C81.1564 12.226 81.8732 11.9473 82.7492 11.9473H95.7703C96.6463 11.9473 97.3631 12.226 97.9206 12.7835C98.4781 13.341 98.7568 14.0577 98.7568 14.9338V63.5539C98.7568 69.4473 100.15 73.8274 102.938 76.6945C105.725 79.5615 109.628 80.995 114.645 80.995C119.583 80.995 123.445 79.5615 126.233 76.6945C129.02 73.8274 130.414 69.4473 130.414 63.5539V14.9338C130.414 14.0577 130.692 13.341 131.25 12.7835C131.887 12.226 132.604 11.9473 133.4 11.9473H146.541C147.337 11.9473 148.014 12.226 148.572 12.7835C149.129 13.341 149.408 14.0577 149.408 14.9338V63.6734C149.408 71.2392 147.974 77.4909 145.107 82.4286C142.24 87.2866 138.218 90.9102 133.042 93.2994C127.865 95.6089 121.733 96.7637 114.645 96.7637Z\" fill=\"var(--logo-primary)\" />\n <path d=\"M30.7012 107.514C29.8251 107.514 29.1084 107.235 28.5509 106.678C27.9934 106.12 27.7147 105.403 27.7147 104.527V98.9503C27.7147 97.4299 26.5751 96.1593 25.0747 95.9137C20.1767 95.1118 15.9995 93.7621 12.5433 91.8646C8.48164 89.555 5.41551 86.7676 3.34487 83.5024C1.27424 80.2372 0.15928 76.8127 0 73.2289C0 72.5917 0.23892 72.0343 0.716759 71.5564C1.27424 70.9989 1.91136 70.7202 2.62811 70.7202H15.4103C16.4456 70.7202 17.242 70.9591 17.7995 71.437C18.2667 71.7707 18.7059 72.1883 19.1172 72.6898C19.2778 72.8856 19.3992 73.1093 19.504 73.3398C20.0637 74.5705 20.8892 75.7679 21.9806 76.9321C23.2548 78.2064 24.9671 79.2815 27.1174 80.1575C29.2676 80.9539 31.9356 81.3521 35.1212 81.3521C40.2978 81.3521 44.1603 80.5159 46.7088 78.8435C49.3369 77.171 50.6509 74.9013 50.6509 72.0343C50.6509 69.9636 49.9342 68.2912 48.5007 67.0169C47.1468 65.7427 44.9567 64.5879 41.9304 63.5526C38.9837 62.5173 35.0017 61.4023 29.9844 60.2077C24.0114 58.9335 18.9543 57.3009 14.813 55.3099C10.6717 53.2393 7.52596 50.6111 5.37569 47.4255C3.30505 44.1603 2.26974 40.1385 2.26974 35.3601C2.26974 29.0686 4.49965 23.7327 8.95948 19.3525C12.992 15.4614 18.3758 12.8901 25.1107 11.6386C26.5927 11.3632 27.7147 10.1013 27.7147 8.59398V2.98649C27.7147 2.11046 27.9934 1.3937 28.5509 0.836215C29.1084 0.278738 29.8251 0 30.7012 0H39.1828C39.9792 0 40.6561 0.278738 41.2136 0.836215C41.7711 1.3937 42.0498 2.11046 42.0498 2.98649V8.90851C42.0498 10.383 43.1243 11.6271 44.5656 11.9386C48.9576 12.8879 52.6983 14.4035 55.7877 16.4854C59.5308 18.8746 62.358 21.6222 64.2693 24.7282C66.2603 27.7545 67.2957 30.7012 67.3753 33.5682C67.3753 34.2053 67.1364 34.8026 66.6585 35.3601C66.1807 35.8379 65.5834 36.0769 64.8667 36.0769H51.3677C50.6509 36.0769 49.974 35.9176 49.3369 35.599C48.8255 35.3433 48.3653 34.9336 47.9566 34.37C47.7503 34.0856 47.6374 33.7481 47.5428 33.4097C47.0246 31.5563 45.6715 29.9367 43.4834 28.5509C41.0942 26.9581 38.0678 26.1617 34.4044 26.1617C30.5021 26.1617 27.3961 26.8785 25.0865 28.312C22.777 29.7455 21.6222 31.9356 21.6222 34.8823C21.6222 36.7936 22.2195 38.4262 23.4141 39.7801C24.6087 41.0544 26.5599 42.2091 29.2676 43.2444C31.9754 44.2001 35.6388 45.2753 40.2579 46.4699C47.2662 47.9034 52.9605 49.6156 57.3407 51.6066C61.7209 53.5976 64.9065 56.1859 66.8975 59.3715C68.9681 62.4775 70.0034 66.4197 70.0034 71.198C70.0034 75.8172 68.8486 79.9186 66.5391 83.5024C64.2295 87.0066 60.9643 89.8338 56.7434 91.984C53.2541 93.7958 49.2277 95.0987 44.6642 95.8928C43.1756 96.1518 42.0498 97.4173 42.0498 98.9283V104.527C42.0498 105.403 41.7711 106.12 41.2136 106.678C40.6561 107.235 39.9792 107.514 39.1828 107.514H30.7012Z\" fill=\"var(--logo-primary)\" />\n </svg>\n );\n}\n";
|
|
362
|
-
const THEME = "@import
|
|
362
|
+
const THEME = "@import \"@/design/tokens.css\";\n@import \"@/design/base.css\";\n\n/*\n * This paywall's own layout. Colours, type, spacing and the shared controls\n * (.button, .link, .close, .notice) come from design/; use their tokens here\n * rather than a literal colour or size.\n */\n:root {\n --sw-background: var(--color-bg);\n --sw-page-inset-bottom: 0px;\n}\n\n.shell {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n}\n\n.page {\n display: flex;\n min-height: 100%;\n flex-direction: column;\n gap: var(--space-6);\n width: 100%;\n max-width: 44rem;\n margin: 0 auto;\n padding: var(--space-4) var(--space-5) 0;\n}\n\n.lede {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n/* The primary action is pinned: the page scrolls under it, the content fades out behind it. */\n.actions {\n position: sticky;\n bottom: 0;\n display: flex;\n flex-direction: column;\n gap: var(--space-2);\n margin-top: auto;\n padding: var(--space-5) 0 var(--space-4);\n background: linear-gradient(to bottom, transparent, var(--color-bg) var(--space-5));\n}\n\n.built {\n display: flex;\n flex: none;\n align-items: center;\n justify-content: center;\n gap: 6px;\n border-top: 1px solid var(--color-border);\n padding: var(--space-1) var(--space-5);\n font-size: var(--text-xs);\n color: var(--color-fg-tertiary);\n}\n\n/* The Superwall wordmark (components/Wordmark.tsx): \"$UPER\" in the accent, \"WALL\" in the foreground; 44px to the finger. */\n.wordmark {\n --logo-primary: var(--color-accent);\n --logo-secondary: var(--color-fg);\n display: flex;\n min-height: 44px;\n align-items: center;\n border: 0;\n background: transparent;\n padding: 0 var(--space-1);\n color: var(--color-fg);\n cursor: pointer;\n transition: transform 200ms var(--ease-out);\n}\n\n.wordmark:active {\n transform: scale(0.97);\n transition-duration: var(--duration-press);\n}\n\n.wordmark-art {\n display: block;\n height: 13px;\n width: auto;\n}\n";
|
|
363
|
+
const DESIGN_MD = "# Design system\n\nAgents read this before building any paywall and keep it and `design/tokens.css` in sync: a\nchange to the brand changes both. Every paywall's `theme.css` imports `design/tokens.css` and\n`design/base.css`, and shared components live in `components/`, imported as `@/components/<Name>`.\n\n## Brand\n\nSuperwall's application register: flat and quiet. Cream paper in light, a cool-grey ink in dark,\none teal accent, no gradients for decoration, no shadows. The paywall reads like a well-set page,\nnot an ad.\n\n## Colour\n\n- `--color-bg` / `--color-fg`: cream (`#fdfef6`) and ink (`#0c0b0a`) in light; a cool grey and\n cream in dark.\n- `--color-surface`, `--color-raised`, `--color-muted`, `--color-secondary`: quiet steps of the\n foreground over the background, for panels and selected rows.\n- Text ladder: `--color-fg`, `--color-fg-secondary` (body copy), `--color-fg-tertiary` (captions,\n secondary actions), `--color-fg-muted` (disabled, placeholders).\n- `--color-border`: the one hairline, 10% of the foreground. `--color-border-strong` on hover.\n- `--color-accent` (`#46d7d4`), fixed in both modes, with `--color-accent-ink` on top: the primary\n action, the selected edge, the focused edge. Nothing else is teal.\n- `--color-destructive` and `--color-success` (each with an `-ink`) only for outcomes.\n\n## Type\n\n- Manrope (`--font-sans`) for everything; Roboto Mono (`--font-mono`) for codes and numbers set\n as code.\n- Sizes: `--text-xs` (captions, links), `--text-sm` (body), `--text-base` (buttons), `--text-lg`\n (h3), `--text-xl` (h2), `--text-2xl` (h1, fluid).\n- Weights 400 and 500; 600 only for inline `strong`. Headings are 500 with tight tracking.\n\n## Spacing and corners\n\n- Spacing steps `--space-1` to `--space-8` (4px base). One step per relationship; the parent's\n gap owns it.\n- One corner: `--radius-md` (3px) on every control and panel. `--radius-full` only for circles.\n- Touch targets are at least 44px; the primary button is 52px tall and full width.\n\n## Components\n\n- `Button` (`components/Button.tsx`, `.button` in `design/base.css`): `variant=\"primary\"` is the\n accent fill, used once per page; the default is the bordered secondary.\n- `.link`: a quiet text action under the primary button (restore, terms).\n- `.close`: the iOS close at the top right.\n- `.notice`: one line of outcome copy above the actions.\n\n## Voice\n\n- Short, plain and specific. Say what the user gets, not how great it is.\n- Sentence case everywhere, no exclamation marks, no emoji.\n- Prices come from the product (`{price}`), never typed into copy.\n- Failure copy says what happened and what to do next, in one line.\n\n## Rules\n\n- Never hard-code a colour, font, size, space or corner a token covers. Add a token instead.\n- Change values in `design/tokens.css`; change how an element looks in `design/base.css`; add a\n shared component to `components/`. A paywall's `theme.css` holds only its own layout.\n- A token change reaches every paywall on its next build, so check each one after changing it.\n- Dark mode overrides colours only, under `:root.dark`.\n- Do: one accent per page, flat surfaces, generous spacing. Don't: shadows, gradients for\n decoration, a second accent colour, more than one primary button on a page.\n";
|
|
364
|
+
const TOKENS = "@import url(\"https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&family=Roboto+Mono:wght@400..500&display=swap\");\n\n/*\n * The design system's values (DESIGN.md says what they are for). Every\n * paywall's theme.css imports this file, so a change here reaches every\n * paywall on its next build. Values only: no selectors but :root and\n * :root.dark (the SDK stamps `dark` on <html>), and dark overrides colours only.\n */\n:root {\n --color-cream: #fdfef6;\n --color-ink: #0c0b0a;\n\n --color-bg: var(--color-cream);\n --color-fg: var(--color-ink);\n --color-surface: color-mix(in oklab, var(--color-fg) 3%, var(--color-bg));\n --color-raised: color-mix(in oklab, var(--color-fg) 7%, var(--color-bg));\n --color-muted: color-mix(in oklab, var(--color-fg) 6%, var(--color-bg));\n --color-secondary: color-mix(in oklab, var(--color-fg) 10%, var(--color-bg));\n --color-wash: color-mix(in oklab, var(--color-fg) 5%, transparent);\n\n --color-fg-secondary: color-mix(in oklab, var(--color-fg) 70%, transparent);\n --color-fg-tertiary: color-mix(in oklab, var(--color-fg) 55%, transparent);\n --color-fg-muted: color-mix(in oklab, var(--color-fg) 45%, transparent);\n --color-border: color-mix(in oklab, var(--color-fg) 10%, transparent);\n --color-border-strong: color-mix(in oklab, var(--color-fg) 20%, transparent);\n\n /* The one accent, fixed in both modes: the primary fill, the selected edge, the focused edge. */\n --color-accent: #46d7d4;\n --color-accent-hover: color-mix(in oklab, var(--color-accent) 90%, transparent);\n --color-accent-ink: var(--color-ink);\n --color-destructive: #ee6d2e;\n --color-destructive-ink: #712f1a;\n --color-success: #9fd947;\n --color-success-ink: #5f822b;\n\n --font-sans: Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n --font-mono: \"Roboto Mono\", ui-monospace, SFMono-Regular, Menlo, monospace;\n\n --text-xs: 0.8125rem;\n --text-sm: 0.9375rem;\n --text-base: 1rem;\n --text-lg: 1.25rem;\n --text-xl: 1.5rem;\n --text-2xl: clamp(2rem, 7vw, 2.5rem);\n\n --leading-tight: 1.1;\n --leading-snug: 1.25;\n --leading-normal: 1.5;\n\n --weight-regular: 400;\n --weight-medium: 500;\n --weight-strong: 600;\n\n --tracking-tight: -0.03em;\n --tracking-snug: -0.02em;\n --tracking-normal: -0.01em;\n\n --space-1: 4px;\n --space-2: 8px;\n --space-3: 12px;\n --space-4: 16px;\n --space-5: 20px;\n --space-6: 24px;\n --space-8: 32px;\n\n --radius-md: 3px;\n --radius-full: 999px;\n\n --ease-out: cubic-bezier(0.23, 1, 0.32, 1);\n --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);\n --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);\n --duration-hover: 150ms;\n --duration-press: 80ms;\n\n color-scheme: light;\n}\n\n:root.dark {\n --color-bg: oklch(0.16 0.0039 262);\n --color-fg: var(--color-cream);\n --color-surface: oklch(0.195 0.0055 262);\n --color-raised: oklch(0.215 0.0069 262);\n --color-muted: oklch(0.25 0.0033 262);\n --color-secondary: oklch(0.29 0.0033 262);\n --color-wash: oklch(0.86 0.0033 262 / 0.08);\n --color-destructive-ink: #f3996d;\n --color-success-ink: #b7e375;\n color-scheme: dark;\n}\n";
|
|
365
|
+
const BASE = "/*\n * Element defaults and the shared component classes, built only from\n * tokens.css. Every paywall imports this after the tokens; a class used by\n * more than one paywall belongs here, not in a paywall's theme.css.\n */\n* {\n box-sizing: border-box;\n}\n\nhtml {\n -webkit-text-size-adjust: 100%;\n}\n\nbody {\n margin: 0;\n background: var(--color-bg);\n color: var(--color-fg);\n font-family: var(--font-sans);\n font-size: var(--text-sm);\n font-weight: var(--weight-regular);\n line-height: var(--leading-normal);\n letter-spacing: var(--tracking-normal);\n -webkit-font-smoothing: antialiased;\n text-rendering: optimizeLegibility;\n -webkit-user-select: none;\n user-select: none;\n}\n\nh1,\nh2,\nh3 {\n margin: 0;\n font-weight: var(--weight-medium);\n text-wrap: balance;\n}\n\nh1 {\n font-size: var(--text-2xl);\n line-height: var(--leading-tight);\n letter-spacing: var(--tracking-tight);\n}\n\nh2 {\n font-size: var(--text-xl);\n line-height: var(--leading-snug);\n letter-spacing: var(--tracking-snug);\n}\n\nh3 {\n font-size: var(--text-lg);\n line-height: var(--leading-snug);\n letter-spacing: var(--tracking-snug);\n}\n\np {\n margin: 0;\n color: var(--color-fg-secondary);\n}\n\nstrong {\n font-weight: var(--weight-strong);\n}\n\ncode {\n font-family: var(--font-mono);\n font-size: var(--text-xs);\n}\n\n/* Every control: one corner, no tap flash, press feedback on the finger, hover only for a real pointer. */\nbutton,\n[role=\"button\"],\n[role=\"radio\"],\n[role=\"switch\"] {\n border-radius: var(--radius-md);\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n touch-action: manipulation;\n user-select: none;\n}\n\n:focus-visible {\n outline: none;\n}\n\n/* components/Button.tsx */\n.button {\n display: flex;\n width: 100%;\n align-items: center;\n justify-content: center;\n min-height: 52px;\n border: 1px solid var(--color-border);\n background: transparent;\n padding: 0 var(--space-4);\n color: var(--color-fg);\n font: inherit;\n font-size: var(--text-base);\n font-weight: var(--weight-medium);\n cursor: pointer;\n transition:\n transform 200ms var(--ease-out),\n background-color var(--duration-hover) var(--ease-out),\n border-color var(--duration-hover) var(--ease-out);\n}\n\n.button:active {\n transform: scale(0.97);\n transition-duration: var(--duration-press);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .button:hover:not(:disabled) {\n background: var(--color-wash);\n border-color: var(--color-border-strong);\n }\n}\n\n.button:disabled {\n cursor: default;\n opacity: 0.5;\n}\n\n.button--primary {\n border-color: var(--color-accent);\n background: var(--color-accent);\n color: var(--color-accent-ink);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .button--primary:hover:not(:disabled) {\n border-color: var(--color-accent-hover);\n background: var(--color-accent-hover);\n }\n}\n\n.link {\n align-self: center;\n border: 0;\n background: none;\n min-height: 44px;\n padding: var(--space-2) var(--space-3);\n color: var(--color-fg-tertiary);\n font: inherit;\n font-size: var(--text-xs);\n cursor: pointer;\n transition:\n transform 200ms var(--ease-out),\n color var(--duration-hover) var(--ease-out);\n}\n\n.link:active {\n transform: scale(0.97);\n transition-duration: var(--duration-press);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .link:hover {\n color: var(--color-fg);\n }\n}\n\n/* iOS close: a small circle at the top-right, 44px to the finger. */\n.close {\n position: absolute;\n top: var(--space-1);\n right: 10px;\n z-index: 10;\n display: flex;\n width: 44px;\n height: 44px;\n align-items: center;\n justify-content: center;\n border: 0;\n border-radius: var(--radius-full);\n background: none;\n padding: 0;\n color: var(--color-fg-tertiary);\n cursor: pointer;\n transition:\n transform 200ms var(--ease-out),\n color var(--duration-hover) var(--ease-out);\n}\n\n.close:active {\n transform: scale(0.92);\n transition-duration: var(--duration-press);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .close:hover {\n color: var(--color-fg);\n }\n}\n\n/* A failed purchase or restore: one quiet line above the button, colour only — the button stays enabled. */\n.notice {\n margin: 0;\n color: var(--color-fg-tertiary);\n font-size: var(--text-xs);\n text-align: center;\n overflow-wrap: anywhere;\n user-select: text;\n -webkit-user-select: text;\n}\n\n/* Reduced motion is gentler, not none: colour and opacity still explain what happened; nothing moves. */\n@media (prefers-reduced-motion: reduce) {\n *,\n ::before,\n ::after {\n transition-property: color, background-color, border-color, opacity !important;\n animation-duration: 1ms !important;\n }\n}\n";
|
|
366
|
+
const BUTTON = "import type { ButtonHTMLAttributes } from \"react\";\n\ntype ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n variant?: \"primary\" | \"secondary\";\n};\n\n/** The design system's button: `.button` in design/base.css, filled with the accent when primary. */\nexport function Button({ variant = \"secondary\", className, type = \"button\", ...props }: ButtonProps) {\n const classes = [\"button\", variant === \"primary\" ? \"button--primary\" : \"\", className ?? \"\"].filter(Boolean).join(\" \");\n return <button type={type} className={classes} {...props} />;\n}\n";
|
|
363
367
|
const writer = (target) => (relative$1, content) => {
|
|
364
368
|
const destination = path.join(target, relative$1);
|
|
365
369
|
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
366
370
|
fs.writeFileSync(destination, content);
|
|
367
371
|
};
|
|
372
|
+
const absentWriter = (target) => (relative$1, content) => {
|
|
373
|
+
const destination = path.join(target, relative$1);
|
|
374
|
+
if (fs.existsSync(destination)) return;
|
|
375
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
376
|
+
fs.writeFileSync(destination, content);
|
|
377
|
+
};
|
|
378
|
+
function writeDesignSystem(target) {
|
|
379
|
+
const file = absentWriter(target);
|
|
380
|
+
file("DESIGN.md", DESIGN_MD);
|
|
381
|
+
file("design/tokens.css", TOKENS);
|
|
382
|
+
file("design/base.css", BASE);
|
|
383
|
+
file("components/Button.tsx", BUTTON);
|
|
384
|
+
}
|
|
368
385
|
function writeProjectFiles(target, name) {
|
|
369
386
|
const file = writer(target);
|
|
370
387
|
file("package.json", packageJson(name ?? projectPackageName(target)));
|
|
@@ -374,6 +391,7 @@ function writeProjectFiles(target, name) {
|
|
|
374
391
|
file("README.md", README);
|
|
375
392
|
}
|
|
376
393
|
function writeSurfaceFiles(target, surfaceId, config) {
|
|
394
|
+
writeDesignSystem(target);
|
|
377
395
|
const file = writer(target);
|
|
378
396
|
file(`paywalls/${surfaceId}/config.ts`, config);
|
|
379
397
|
file(`paywalls/${surfaceId}/messages/en.ts`, MESSAGES);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as updateServerNotifications, r as chooseKeyApp } from "./held-
|
|
2
|
-
import { t as apiCall } from "./spinner-
|
|
3
|
-
import { i as findAppNotificationUrl } from "./client-
|
|
4
|
-
import { t as timing } from "./timing-
|
|
1
|
+
import { D as updateServerNotifications, r as chooseKeyApp } from "./held-C2IjAyg6.js";
|
|
2
|
+
import { t as apiCall } from "./spinner-025_eqCX.js";
|
|
3
|
+
import { i as findAppNotificationUrl } from "./client-BJQXl62Q.js";
|
|
4
|
+
import { t as timing } from "./timing-Ca0TXY-A.js";
|
|
5
5
|
|
|
6
6
|
//#region src/core/app-store-connect/notification-url.ts
|
|
7
7
|
const RETRY_DELAYS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as runStudio } from "./server-
|
|
1
|
+
import { T as isNonInteractive } from "./environment-FR3bcq0D.js";
|
|
2
|
+
import { t as runStudio } from "./server-BmmOj7bh.js";
|
|
3
3
|
|
|
4
4
|
//#region src/core/paywalls/studio/open.ts
|
|
5
5
|
async function askStudio(ui, interactive, surfaceId, original = true) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { n as withSpinner } from "./spinner-
|
|
1
|
+
import { n as withSpinner } from "./spinner-025_eqCX.js";
|
|
2
2
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
3
|
-
import {
|
|
3
|
+
import { n as listOrganizations, t as listOrgGroups } from "./orgs-BxlwcvTu.js";
|
|
4
|
+
import { E as titleCase, T as rowName } from "./resources-COOEvqqW.js";
|
|
4
5
|
|
|
5
6
|
//#region src/core/account/org.ts
|
|
6
7
|
async function orgForNewProject(api, interactive) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { t as apiCall } from "./spinner-025_eqCX.js";
|
|
2
|
+
import { a as orgProjects, i as orgIdOf, n as listOrganizations } from "./orgs-BxlwcvTu.js";
|
|
3
|
+
import { n as findApplication, t as appNotFound } from "./lookup-D23dAOz6.js";
|
|
4
|
+
import { r as WorkspaceError } from "./project-DHU5wc3R.js";
|
|
5
|
+
|
|
6
|
+
//#region src/core/workspaces/organization.ts
|
|
7
|
+
async function resolveAppScope(api, app, org) {
|
|
8
|
+
if (/^\d+$/.test(app) && org !== void 0) return {
|
|
9
|
+
organizationId: org,
|
|
10
|
+
applicationId: app
|
|
11
|
+
};
|
|
12
|
+
const found = await findApplication(api, app, org === void 0 ? void 0 : await orgProjects(api, org));
|
|
13
|
+
if (!found) throw appNotFound(app);
|
|
14
|
+
const home = orgIdOf(found.project);
|
|
15
|
+
if (org !== void 0 && home !== org) throw new WorkspaceError(`App ${app} is in organization ${home ?? "unknown"}, not ${org}.`);
|
|
16
|
+
return {
|
|
17
|
+
organizationId: org ?? home,
|
|
18
|
+
applicationId: String(found.app.id)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
async function resolveOrganization(ctx, org) {
|
|
22
|
+
if (org !== void 0) return org;
|
|
23
|
+
const organizations = await apiCall(ctx, "Loading your organizations", () => listOrganizations(ctx.api));
|
|
24
|
+
const [only] = organizations;
|
|
25
|
+
if (only !== void 0 && organizations.length === 1) return String(only.id);
|
|
26
|
+
if (!ctx.interactive || organizations.length === 0) throw new WorkspaceError("Say which organization with --org <id>.");
|
|
27
|
+
const picked = await ctx.ui.select({
|
|
28
|
+
message: "Which organization?",
|
|
29
|
+
options: organizations.map((organization) => ({
|
|
30
|
+
value: String(organization.id),
|
|
31
|
+
label: String(organization.name ?? organization.id)
|
|
32
|
+
}))
|
|
33
|
+
});
|
|
34
|
+
if (picked === null) throw new WorkspaceError("No organization picked.");
|
|
35
|
+
return picked;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { resolveOrganization as n, resolveAppScope as t };
|