@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,158 @@
|
|
|
1
|
+
import * as fs from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
|
|
4
|
+
//#region src/core/paywalls/project/design-lint.ts
|
|
5
|
+
const TOKENS_FILE = path.join("design", "tokens.css");
|
|
6
|
+
const SCANNED = /\.(css|tsx|ts|jsx|js)$/;
|
|
7
|
+
const SKIPPED_DIRS = new Set([
|
|
8
|
+
"node_modules",
|
|
9
|
+
".superwall",
|
|
10
|
+
"dist",
|
|
11
|
+
"public",
|
|
12
|
+
"assets"
|
|
13
|
+
]);
|
|
14
|
+
const COLOR = /#[0-9a-fA-F]{3,8}\b|rgba?\([^)]*\)|hsla?\([^)]*\)/g;
|
|
15
|
+
const LENGTH = /(?<![\w.#-])-?\d*\.?\d+(?:px|rem|em)\b/g;
|
|
16
|
+
const NUMBER = /(?<![\w.#%-])\d*\.?\d+(?![\w.%(])/g;
|
|
17
|
+
const PAINTS = /color|background|border|outline|fill|stroke|shadow|caret|accent|decoration|column-rule/;
|
|
18
|
+
const URL_VALUE = /url\([^)]*\)/gi;
|
|
19
|
+
const DECLARATION = /(?<![\w-])["']?([a-zA-Z][\w-]*)["']?\s*:\s*((?:[^;{},]|,(?!\s*["']?[a-zA-Z][\w-]*["']?\s*:))+)/g;
|
|
20
|
+
const PREFIXES = {
|
|
21
|
+
text: "--text-",
|
|
22
|
+
leading: "--leading-",
|
|
23
|
+
tracking: "--tracking-",
|
|
24
|
+
weight: "--weight-",
|
|
25
|
+
radius: "--radius",
|
|
26
|
+
space: "--space-"
|
|
27
|
+
};
|
|
28
|
+
const kebab = (name) => name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);
|
|
29
|
+
function categoryOf(property) {
|
|
30
|
+
if (property === "font-size") return "text";
|
|
31
|
+
if (property === "line-height") return "leading";
|
|
32
|
+
if (property === "letter-spacing") return "tracking";
|
|
33
|
+
if (property === "font-weight") return "weight";
|
|
34
|
+
if (property.includes("radius")) return "radius";
|
|
35
|
+
if (/^(padding|margin|gap|row-gap|column-gap)(-|$)/.test(property)) return "space";
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
function normalizeColor(literal) {
|
|
39
|
+
const value = literal.toLowerCase().trim().replace(/\s+/g, " ").replace(/\s*([(),/])\s*/g, "$1");
|
|
40
|
+
if (!value.startsWith("#")) return value;
|
|
41
|
+
const hex = value.slice(1);
|
|
42
|
+
const long = hex.length <= 4 ? [...hex].map((digit) => digit + digit).join("") : hex;
|
|
43
|
+
return `#${long.length === 8 && long.endsWith("ff") ? long.slice(0, 6) : long}`;
|
|
44
|
+
}
|
|
45
|
+
function normalizeLength(literal) {
|
|
46
|
+
const unit = literal.match(/(px|rem|em)$/)?.[1];
|
|
47
|
+
const amount = Number.parseFloat(literal);
|
|
48
|
+
if (unit === "rem") return `${amount * 16}px`;
|
|
49
|
+
return `${amount}${unit ?? ""}`;
|
|
50
|
+
}
|
|
51
|
+
function tokenLiteral(value) {
|
|
52
|
+
const trimmed = value.trim();
|
|
53
|
+
if (/^(#[0-9a-fA-F]{3,8}|rgba?\([^)]*\)|hsla?\([^)]*\))$/.test(trimmed)) return {
|
|
54
|
+
kind: "color",
|
|
55
|
+
value: normalizeColor(trimmed)
|
|
56
|
+
};
|
|
57
|
+
if (/^-?\d*\.?\d+(px|rem|em)$/.test(trimmed)) return {
|
|
58
|
+
kind: "length",
|
|
59
|
+
value: normalizeLength(trimmed)
|
|
60
|
+
};
|
|
61
|
+
if (/^\d*\.?\d+$/.test(trimmed)) return {
|
|
62
|
+
kind: "number",
|
|
63
|
+
value: String(Number(trimmed))
|
|
64
|
+
};
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
function readTokens(css) {
|
|
68
|
+
const index = {
|
|
69
|
+
colors: /* @__PURE__ */ new Map(),
|
|
70
|
+
values: /* @__PURE__ */ new Map()
|
|
71
|
+
};
|
|
72
|
+
for (const match of css.replace(/\/\*[\s\S]*?\*\//g, "").matchAll(/(--[\w-]+)\s*:\s*([^;}]+)/g)) {
|
|
73
|
+
const [, name, raw] = match;
|
|
74
|
+
if (!name || raw === void 0) continue;
|
|
75
|
+
const literal = tokenLiteral(raw);
|
|
76
|
+
if (!literal) continue;
|
|
77
|
+
const map = literal.kind === "color" ? index.colors : index.values;
|
|
78
|
+
const key = literal.kind === "color" ? literal.value : `${literal.kind}:${literal.value}`;
|
|
79
|
+
map.set(key, (map.get(key) ?? /* @__PURE__ */ new Set()).add(name));
|
|
80
|
+
}
|
|
81
|
+
return index;
|
|
82
|
+
}
|
|
83
|
+
function lintValue(index, property, value) {
|
|
84
|
+
const findings = [];
|
|
85
|
+
const painted = PAINTS.test(property) ? value.replace(URL_VALUE, " ") : "";
|
|
86
|
+
for (const [literal] of painted.matchAll(COLOR)) {
|
|
87
|
+
const tokens = index.colors.get(normalizeColor(literal));
|
|
88
|
+
if (tokens) findings.push({
|
|
89
|
+
literal,
|
|
90
|
+
tokens: [...tokens].sort()
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
const category = categoryOf(property);
|
|
94
|
+
if (!category) return findings;
|
|
95
|
+
const prefix = PREFIXES[category];
|
|
96
|
+
const unitless = category === "weight" || category === "leading";
|
|
97
|
+
const literals = [...value.replace(COLOR, " ").matchAll(LENGTH)].map(([literal]) => ({
|
|
98
|
+
literal,
|
|
99
|
+
key: `length:${normalizeLength(literal)}`
|
|
100
|
+
}));
|
|
101
|
+
if (unitless) for (const [literal] of value.replace(COLOR, " ").replace(LENGTH, " ").matchAll(NUMBER)) literals.push({
|
|
102
|
+
literal,
|
|
103
|
+
key: `number:${Number(literal)}`
|
|
104
|
+
});
|
|
105
|
+
for (const { literal, key } of literals) {
|
|
106
|
+
if (Number.parseFloat(literal) === 0) continue;
|
|
107
|
+
const tokens = [...index.values.get(key) ?? []].filter((name) => name.startsWith(prefix)).sort();
|
|
108
|
+
if (tokens.length > 0) findings.push({
|
|
109
|
+
literal,
|
|
110
|
+
tokens
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
return findings;
|
|
114
|
+
}
|
|
115
|
+
function lintSource(index, text) {
|
|
116
|
+
const findings = [];
|
|
117
|
+
const lines = text.replace(/\/\*[\s\S]*?\*\//g, (comment) => comment.replace(/[^\n]/g, " ")).split("\n");
|
|
118
|
+
for (const [index_, line] of lines.entries()) {
|
|
119
|
+
if (/^\s*\/\//.test(line)) continue;
|
|
120
|
+
for (const [, rawProperty, rawValue] of line.matchAll(DECLARATION)) {
|
|
121
|
+
if (!rawProperty || rawValue === void 0) continue;
|
|
122
|
+
for (const finding of lintValue(index, kebab(rawProperty), rawValue.replace(/["'`]/g, " "))) findings.push({
|
|
123
|
+
line: index_ + 1,
|
|
124
|
+
...finding
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return findings;
|
|
129
|
+
}
|
|
130
|
+
function walk(dir, into) {
|
|
131
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
132
|
+
for (const entry of entries) {
|
|
133
|
+
const full = path.join(dir, entry.name);
|
|
134
|
+
if (entry.isDirectory()) {
|
|
135
|
+
if (!SKIPPED_DIRS.has(entry.name)) walk(full, into);
|
|
136
|
+
} else if (SCANNED.test(entry.name)) into.push(full);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
function lintDesignTokens(project, surfaces) {
|
|
140
|
+
const tokensFile = path.join(project.superwallDir, TOKENS_FILE);
|
|
141
|
+
if (!fs.existsSync(tokensFile)) return [];
|
|
142
|
+
const index = readTokens(fs.readFileSync(tokensFile, "utf8"));
|
|
143
|
+
if (index.colors.size === 0 && index.values.size === 0) return [];
|
|
144
|
+
const files = [];
|
|
145
|
+
for (const dir of [...surfaces.map((surface) => surface.dir), path.join(project.superwallDir, "components")]) if (fs.existsSync(dir)) walk(dir, files);
|
|
146
|
+
const configFiles = new Set(surfaces.map((surface) => surface.configFile));
|
|
147
|
+
return [...new Set(files)].filter((file) => !configFiles.has(file)).flatMap((file) => lintSource(index, fs.readFileSync(file, "utf8")).map((finding) => ({
|
|
148
|
+
file: path.relative(project.superwallDir, file),
|
|
149
|
+
...finding
|
|
150
|
+
})));
|
|
151
|
+
}
|
|
152
|
+
function formatTokenFinding(finding) {
|
|
153
|
+
const tokens = finding.tokens.map((token) => `var(${token})`).join(" or ");
|
|
154
|
+
return `${finding.file}:${finding.line} hard-codes ${finding.literal}, which the design system holds as ${tokens}. Use the token so a design-system change reaches it.`;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
//#endregion
|
|
158
|
+
export { lintDesignTokens as n, formatTokenFinding as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./token-
|
|
1
|
+
import "./token-B2PduqrR.js";
|
|
2
2
|
import "./output-Ggzq5_-t.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as readSession } from "./storage-
|
|
3
|
+
import { S as apiKeyFromEnv } from "./environment-FR3bcq0D.js";
|
|
4
|
+
import { n as readSession } from "./storage-CUMgpcVH.js";
|
|
5
5
|
import "./spawn-DmmmHIP-.js";
|
|
6
6
|
import { n as ui } from "./ui-D_qf3Gvw.js";
|
|
7
7
|
import { n as fg, t as THEME } from "./theme-DUsCh-Vd.js";
|
|
8
|
-
import { t as scanProject } from "./scan-
|
|
9
|
-
import { t as detectExisting } from "./existing-
|
|
10
|
-
import { t as detectDrivers } from "./drivers-
|
|
8
|
+
import { t as scanProject } from "./scan-BZS2FZeU.js";
|
|
9
|
+
import { t as detectExisting } from "./existing-C6TTT6c4.js";
|
|
10
|
+
import { t as detectDrivers } from "./drivers-DkboeR1c.js";
|
|
11
11
|
|
|
12
12
|
//#region src/core/support/doctor.ts
|
|
13
13
|
async function runDoctor(ctx, deps = {}) {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import * as fs from "node:fs";
|
|
3
|
+
import * as os$1 from "node:os";
|
|
4
|
+
import * as path from "node:path";
|
|
5
|
+
import { promisify } from "node:util";
|
|
6
|
+
import { gunzipSync } from "node:zlib";
|
|
7
|
+
|
|
8
|
+
//#region src/core/repo/download.ts
|
|
9
|
+
const run = promisify(execFile);
|
|
10
|
+
const PUBLIC_REPO = process.env.SUPERWALL_EXAMPLES_REPO ?? "superwall/superwall";
|
|
11
|
+
const PUBLIC_REF = process.env.SUPERWALL_EXAMPLES_REF ?? "main";
|
|
12
|
+
var RepoDownloadError = class extends Error {};
|
|
13
|
+
const DOWNLOAD_TIMEOUT_MS = 12e4;
|
|
14
|
+
async function downloadRepoDir(dir, target, notFound, fetchImpl = fetch) {
|
|
15
|
+
const signal = AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS);
|
|
16
|
+
let response;
|
|
17
|
+
let bytes;
|
|
18
|
+
try {
|
|
19
|
+
response = await fetchImpl(`https://codeload.github.com/${PUBLIC_REPO}/tar.gz/refs/heads/${PUBLIC_REF}`, { signal });
|
|
20
|
+
if (!response.ok) throw new RepoDownloadError(`Could not download github.com/${PUBLIC_REPO} (HTTP ${response.status}). Check your network, then try again.`);
|
|
21
|
+
bytes = await response.arrayBuffer();
|
|
22
|
+
} catch (error) {
|
|
23
|
+
if (error instanceof RepoDownloadError) throw error;
|
|
24
|
+
throw new RepoDownloadError(`Could not reach github.com/${PUBLIC_REPO}. Check your network, then try again.`);
|
|
25
|
+
}
|
|
26
|
+
let archive;
|
|
27
|
+
try {
|
|
28
|
+
archive = gunzipSync(Buffer.from(bytes));
|
|
29
|
+
} catch {
|
|
30
|
+
throw new RepoDownloadError(`The download of github.com/${PUBLIC_REPO} was damaged. Try again.`);
|
|
31
|
+
}
|
|
32
|
+
const stage = fs.mkdtempSync(path.join(os$1.tmpdir(), "superwall-download-"));
|
|
33
|
+
const tarball = path.join(stage, "repo.tar");
|
|
34
|
+
fs.writeFileSync(tarball, archive);
|
|
35
|
+
const prefix = `${PUBLIC_REPO.split("/")[1]}-${PUBLIC_REF.replace(/\//g, "-")}`;
|
|
36
|
+
fs.mkdirSync(target, { recursive: true });
|
|
37
|
+
try {
|
|
38
|
+
await run("tar", [
|
|
39
|
+
"-xf",
|
|
40
|
+
tarball,
|
|
41
|
+
"-C",
|
|
42
|
+
target,
|
|
43
|
+
"--strip-components",
|
|
44
|
+
String(dir.split("/").length + 1),
|
|
45
|
+
`${prefix}/${dir}`
|
|
46
|
+
]);
|
|
47
|
+
} catch {
|
|
48
|
+
throw new RepoDownloadError(notFound);
|
|
49
|
+
} finally {
|
|
50
|
+
fs.rmSync(stage, {
|
|
51
|
+
recursive: true,
|
|
52
|
+
force: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
//#endregion
|
|
58
|
+
export { downloadRepoDir as i, PUBLIC_REPO as n, RepoDownloadError as r, PUBLIC_REF as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as getOAuthAccessToken } from "./token-
|
|
2
|
-
import {
|
|
3
|
-
import { n as readSession } from "./storage-
|
|
1
|
+
import { t as getOAuthAccessToken } from "./token-B2PduqrR.js";
|
|
2
|
+
import { t as API_HOST, x as VERSION } from "./environment-FR3bcq0D.js";
|
|
3
|
+
import { n as readSession } from "./storage-CUMgpcVH.js";
|
|
4
4
|
import { n as readVersion, r as spawnStream, t as onPath } from "./spawn-DmmmHIP-.js";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
6
|
import { basename, join } from "node:path";
|
package/dist/entry.js
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
import { n as __require, r as __toESM, t as __commonJS } from "./chunk-DQxbwPpZ.js";
|
|
2
|
-
import "./token-
|
|
2
|
+
import "./token-B2PduqrR.js";
|
|
3
3
|
import { a as stripAnsi, d as useStores, i as writeJson } from "./output-Ggzq5_-t.js";
|
|
4
|
-
import {
|
|
5
|
-
import "./storage-
|
|
6
|
-
import { i as superwallApi } from "./client-
|
|
7
|
-
import { O as useAscRefresh } from "./held-
|
|
4
|
+
import { T as isNonInteractive, s as CHANNEL, x as VERSION } from "./environment-FR3bcq0D.js";
|
|
5
|
+
import "./storage-CUMgpcVH.js";
|
|
6
|
+
import { i as superwallApi } from "./client-DHlsTaP1.js";
|
|
7
|
+
import { O as useAscRefresh } from "./held-C2IjAyg6.js";
|
|
8
8
|
import "./config-CGcG7GOt.js";
|
|
9
|
-
import { n as maybeShowTelemetryNotice, r as track, t as flushTelemetry } from "./telemetry-
|
|
9
|
+
import { n as maybeShowTelemetryNotice, r as track, t as flushTelemetry } from "./telemetry-ekUQuhLJ.js";
|
|
10
10
|
import "./spawn-DmmmHIP-.js";
|
|
11
|
-
import { a as printAutoUpdate, i as maybeNotifyUpdate, l as selectAutoUpdate, n as isGlobalInstall, o as recordAutoUpdate, s as refreshUpdateCheck, t as flushUpdateCheck } from "./upgrade-
|
|
12
|
-
import { c as onChannel, f as useHost, l as summaryOf, o as examplesOf, r as UsageError, s as flagName } from "./spinner-
|
|
11
|
+
import { a as printAutoUpdate, i as maybeNotifyUpdate, l as selectAutoUpdate, n as isGlobalInstall, o as recordAutoUpdate, s as refreshUpdateCheck, t as flushUpdateCheck } from "./upgrade-CI7K1UZ-.js";
|
|
12
|
+
import { c as onChannel, f as useHost, l as summaryOf, o as examplesOf, r as UsageError, s as flagName } from "./spinner-025_eqCX.js";
|
|
13
13
|
import { r as useRenderer, t as silentRenderer } from "./ui-D_qf3Gvw.js";
|
|
14
14
|
import { t as THEME } from "./theme-DUsCh-Vd.js";
|
|
15
15
|
import { n as styleMarkdown, r as wrapReportLine } from "./log-C0MDCfA2.js";
|
|
16
|
-
import { t as scanProject } from "./scan-
|
|
17
|
-
import { t as detectExisting } from "./existing-
|
|
18
|
-
import { n as SUPERWALL_HOME, r as expandHome } from "./paths-
|
|
19
|
-
import { a as renderPage, i as exampleLines, n as cmd, r as detailLines, t as listGroups } from "./registry-
|
|
20
|
-
import "./session-
|
|
21
|
-
import "./
|
|
22
|
-
import "./
|
|
23
|
-
import "./
|
|
24
|
-
import "./
|
|
25
|
-
import "./
|
|
26
|
-
import "./
|
|
27
|
-
import "./
|
|
28
|
-
import "./
|
|
29
|
-
import "./
|
|
30
|
-
import "./
|
|
16
|
+
import { t as scanProject } from "./scan-BZS2FZeU.js";
|
|
17
|
+
import { t as detectExisting } from "./existing-C6TTT6c4.js";
|
|
18
|
+
import { n as SUPERWALL_HOME, r as expandHome } from "./paths-BaeoxDze.js";
|
|
19
|
+
import { a as renderPage, i as exampleLines, n as cmd, r as detailLines, t as listGroups } from "./registry-FNG-uiIt.js";
|
|
20
|
+
import "./session-BpYpOgaY.js";
|
|
21
|
+
import "./orgs-BxlwcvTu.js";
|
|
22
|
+
import "./resources-COOEvqqW.js";
|
|
23
|
+
import "./org-DZ41muzA.js";
|
|
24
|
+
import "./lookup-D23dAOz6.js";
|
|
25
|
+
import "./scope-BJQ-KcQg.js";
|
|
26
|
+
import "./client-BJQXl62Q.js";
|
|
27
|
+
import "./products-Cqq59DBQ.js";
|
|
28
|
+
import "./input-MDd67UIp.js";
|
|
29
|
+
import "./timing-Ca0TXY-A.js";
|
|
30
|
+
import "./notification-url-rdnENCxt.js";
|
|
31
|
+
import "./bind-DOF3o3FR.js";
|
|
31
32
|
import { spawn } from "node:child_process";
|
|
32
33
|
import * as fs from "node:fs";
|
|
33
34
|
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
@@ -22096,7 +22097,7 @@ var styles_default = styles$2;
|
|
|
22096
22097
|
//#endregion
|
|
22097
22098
|
//#region ../../node_modules/.bun/ink@5.2.1+95f74e15225f916f/node_modules/ink/build/reconciler.js
|
|
22098
22099
|
if (process$1.env["DEV"] === "true") try {
|
|
22099
|
-
await import("./devtools-
|
|
22100
|
+
await import("./devtools-ByZ6XYnn.js");
|
|
22100
22101
|
} catch (error) {
|
|
22101
22102
|
if (error.code === "ERR_MODULE_NOT_FOUND") console.warn(`
|
|
22102
22103
|
The environment variable DEV is set to true, so Ink tried to import \`react-devtools-core\`,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region package.json
|
|
2
|
-
var version = "2.
|
|
2
|
+
var version = "2.5.1";
|
|
3
3
|
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/environment.ts
|
|
@@ -19,6 +19,7 @@ const AUTH_HOST = () => resolveEnv("SUPERWALL_AUTH_HOST") ?? "https://auth.super
|
|
|
19
19
|
const ASSET_HOST = () => resolveEnv("SUPERWALL_ASSET_HOST") ?? "https://user-content.superwalleditor.com/user-content/hl";
|
|
20
20
|
const API_HOST_OVERRIDE = () => resolveEnv("SUPERWALL_API_HOST");
|
|
21
21
|
const API_HOST = () => API_HOST_OVERRIDE() ?? "https://api.superwall.com";
|
|
22
|
+
const DASHBOARD_ORIGIN_OVERRIDE = () => resolveEnv("SUPERWALL_DASHBOARD_ORIGIN");
|
|
22
23
|
const CLI_CLIENT_ID = () => resolveEnv("SUPERWALL_CLI_CLIENT_ID") ?? "client_01KWEWM154D2T28NZAS02B8MWT";
|
|
23
24
|
const OAUTH_SCOPE = "openid profile email offline_access";
|
|
24
25
|
const TELEMETRY_HOST = () => resolveEnv("SUPERWALL_TELEMETRY_HOST") ?? "https://us.i.posthog.com";
|
|
@@ -39,7 +40,7 @@ const ENV_APPLE_ID = "SUPERWALL_APPLE_ID";
|
|
|
39
40
|
const ENV_APPLE_PASSWORD = "SUPERWALL_APPLE_PASSWORD";
|
|
40
41
|
function appleCredentialsFromEnv() {
|
|
41
42
|
const appleId = resolveEnv(ENV_APPLE_ID);
|
|
42
|
-
const password = process
|
|
43
|
+
const password = globalThis.process?.env[ENV_APPLE_PASSWORD];
|
|
43
44
|
return {
|
|
44
45
|
...appleId ? { appleId } : {},
|
|
45
46
|
...password ? { password } : {}
|
|
@@ -59,7 +60,7 @@ const USER_AGENT = () => {
|
|
|
59
60
|
return agent ? `superwall-cli/${VERSION} (${agent})` : `superwall-cli/${VERSION}`;
|
|
60
61
|
};
|
|
61
62
|
function resolveEnv(name) {
|
|
62
|
-
const value = process
|
|
63
|
+
const value = globalThis.process?.env[name]?.trim();
|
|
63
64
|
return value === "" ? void 0 : value;
|
|
64
65
|
}
|
|
65
66
|
function isNonInteractive() {
|
|
@@ -74,4 +75,4 @@ const AUTO_UPDATE = () => !isOn("SUPERWALL_NO_UPDATE") && !isOn("CI") && !RUNNIN
|
|
|
74
75
|
const AUTO_UPDATE_TARGET = () => resolveEnv("SW_AUTO_UPDATE");
|
|
75
76
|
|
|
76
77
|
//#endregion
|
|
77
|
-
export {
|
|
78
|
+
export { appleCredentialsFromEnv as C, resolveEnv as E, apiKeyFromEnv as S, isNonInteractive as T, RUNNING_VIA_NPX as _, AUTO_UPDATE as a, USER_AGENT as b, CHANNELS as c, DASHBOARD_URL as d, ENV_API_KEY as f, OAUTH_SCOPE as g, Integration as h, AUTH_HOST as i, CLI_CLIENT_ID as l, ENV_APPLE_PASSWORD as m, API_HOST_OVERRIDE as n, AUTO_UPDATE_TARGET as o, ENV_APPLE_ID as p, ASSET_HOST as r, CHANNEL as s, API_HOST as t, DASHBOARD_ORIGIN_OVERRIDE as u, TELEMETRY_HOST as v, detectAgent as w, VERSION as x, TELEMETRY_KEY as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as readPackageJson, r as allDeps } from "./scan-
|
|
1
|
+
import { h as Integration } from "./environment-FR3bcq0D.js";
|
|
2
|
+
import { i as readPackageJson, r as allDeps } from "./scan-BZS2FZeU.js";
|
|
3
3
|
import { readFileSync } from "node:fs";
|
|
4
4
|
import fg from "fast-glob";
|
|
5
5
|
|