@superwall/cli 2.5.1 → 2.5.2

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.
Files changed (99) hide show
  1. package/dist/{apple-BSKxY7Gx.js → apple-D2z3tALE.js} +14 -14
  2. package/dist/{approve-DbwsYO4s.js → approve-I-lvTanp.js} +31 -28
  3. package/dist/{assets-CqpFg5mM.js → assets-oo93EFou.js} +3 -3
  4. package/dist/auth.js +3 -3
  5. package/dist/{session-DYdxTNZf.js → base-Cft9NZfU.js} +35 -35
  6. package/dist/{billing-BopwIhR3.js → billing-Bo1UEKqV.js} +3 -3
  7. package/dist/{bind-DOF3o3FR.js → bind-BvScWziR.js} +4 -4
  8. package/dist/{build-BF22vVdV.js → build-Co487gha.js} +10 -10
  9. package/dist/{client-DHlsTaP1.js → client-Tp6iD66_.js} +55 -5
  10. package/dist/create-CHIPz5vb.js +20 -0
  11. package/dist/{create-CboPfAlN.js → create-G3HuOHZ4.js} +31 -31
  12. package/dist/{create-CiZzZrru.js → create-uA3nrMIa.js} +6 -6
  13. package/dist/{doctor-BqZGaQE5.js → doctor-CHF9aNFc.js} +6 -6
  14. package/dist/{drivers-DkboeR1c.js → drivers-YZEcBiSV.js} +3 -3
  15. package/dist/entry.js +20 -20
  16. package/dist/{environment-FR3bcq0D.js → environment-EU7Mrk7j.js} +1 -1
  17. package/dist/{existing-C6TTT6c4.js → existing-DV_6NLfW.js} +2 -2
  18. package/dist/{selection-CWfI4a0O.js → framework-b-Yf8sP1.js} +50 -50
  19. package/dist/held-Dd19AduK.js +17 -0
  20. package/dist/{held-C2IjAyg6.js → held-L0vz0_hA.js} +6 -6
  21. package/dist/{install-DoSYCwLL.js → install-CXfLcLhU.js} +37 -37
  22. package/dist/{integrate-BSqd2wgI.js → integrate-DS2YGLsM.js} +23 -23
  23. package/dist/{types-CB6O_wjy.js → lock-DgSx-p8Y.js} +79 -79
  24. package/dist/login-C0BjJmFy.js +17 -0
  25. package/dist/{login-C6FcBQZg.js → login-Ca6FhI6R.js} +6 -6
  26. package/dist/{login-dRPPnGr7.js → login-DoMmU3Bq.js} +1 -1
  27. package/dist/{lookup-D23dAOz6.js → lookup-DhMLZmdW.js} +3 -3
  28. package/dist/{migrate-CDdUCTH3.js → migrate-CoQWqzhJ.js} +29 -29
  29. package/dist/{migration-r9plM7F6.js → migration-C22iQzAW.js} +9 -9
  30. package/dist/{notification-url-rdnENCxt.js → notification-url-CqnXE9yB.js} +2 -2
  31. package/dist/{open-DVdE3HnK.js → open-DriuY3di.js} +2 -2
  32. package/dist/{org-DZ41muzA.js → org-D7LQrg3k.js} +3 -3
  33. package/dist/{organization-DIODPOwO.js → organization-DDidaGRK.js} +8 -8
  34. package/dist/{orgs-BxlwcvTu.js → orgs-CYXjVdxM.js} +1 -1
  35. package/dist/{paths-BaeoxDze.js → paths-Bf3othB-.js} +1 -1
  36. package/dist/{playbook-B-Pdonhg.js → playbook-K7vmAUsu.js} +10 -10
  37. package/dist/{project-DHU5wc3R.js → project-NoMtbMyl.js} +9 -9
  38. package/dist/{promote-Ca4URuHY.js → promote-DXxxj4BU.js} +23 -23
  39. package/dist/pull-Bfa3_SBt.js +106 -0
  40. package/dist/pull-DGrlBSAG.js +36 -0
  41. package/dist/{pull-CQcTZxW8.js → pull-DuFUkP7t.js} +8 -8
  42. package/dist/{push-DQE48h_M.js → push-CrowxhpU.js} +53 -47
  43. package/dist/push-DPZdch2W.js +30 -0
  44. package/dist/push-DV-kJZdw.js +22 -0
  45. package/dist/{push-BlZoIwIj.js → push-Dk5x2xP3.js} +9 -9
  46. package/dist/{registry-FNG-uiIt.js → registry-HhZVRBqY.js} +154 -152
  47. package/dist/resolve-D3RBtfkI.js +242 -0
  48. package/dist/{resources-COOEvqqW.js → resources-CkG6SCia.js} +2 -2
  49. package/dist/{run-DpYDOAw-.js → run-CL5ZnujW.js} +2 -2
  50. package/dist/{run-Czbb-sHR.js → run-Co8u_BkN.js} +65 -65
  51. package/dist/scan-BQmjhs3g.js +4 -0
  52. package/dist/{scan-BZS2FZeU.js → scan-DhmGH1rF.js} +1 -1
  53. package/dist/{scope-BJQ-KcQg.js → scope-D0XpYMn4.js} +5 -5
  54. package/dist/{scope-t_SqFN6W.js → scope-ehZ7L1nj.js} +8 -8
  55. package/dist/{sdk-CyttTnGf.js → sdk-DEfQttek.js} +7 -7
  56. package/dist/{series--Wp7TngJ.js → series-D2ZpZ8cx.js} +95 -62
  57. package/dist/server-4ZK_1Off.js +29 -0
  58. package/dist/{server-BmmOj7bh.js → server-DamMN_ig.js} +9 -9
  59. package/dist/session-4F_YWSul.js +6 -0
  60. package/dist/{session-BpYpOgaY.js → session-G1uwJI8L.js} +1 -1
  61. package/dist/{setup-DW50luOZ.js → setup-BFTSxEWU.js} +9 -9
  62. package/dist/skills/index.json +2 -2
  63. package/dist/skills/superwall/workflows/integrate/flutter.md +9 -7
  64. package/dist/skills/{superwall-workspaces → superwall-artifacts}/SKILL.md +44 -30
  65. package/dist/skills/{superwall-workspaces → superwall-artifacts}/references/cli.md +35 -29
  66. package/dist/skills/{superwall-workspaces → superwall-artifacts}/references/slots.md +9 -9
  67. package/dist/{skills-Cm1j2d1W.js → skills-CE4c9eHX.js} +4 -4
  68. package/dist/{skills-Bbtq8V_D.js → skills-ClEVgXUB.js} +8 -8
  69. package/dist/{git-DqDPnldI.js → source-BccdO4aL.js} +95 -95
  70. package/dist/{source-push-B3c-VLfe.js → source-push-EyF02ekO.js} +6 -6
  71. package/dist/{spinner-025_eqCX.js → spinner-mWZnJCkN.js} +3 -3
  72. package/dist/{starter-hcwocv_Z.js → starter-BtUUQWhd.js} +38 -28
  73. package/dist/{status-K1IGp6pe.js → status-SAZxltzW.js} +39 -39
  74. package/dist/{storage-CUMgpcVH.js → storage-R5-qDvHq.js} +1 -1
  75. package/dist/{storekit-Cb0TkToV.js → storekit-CQHVFTOC.js} +3 -3
  76. package/dist/storekit-DK3xXKoY.js +17 -0
  77. package/dist/{telemetry-ekUQuhLJ.js → telemetry-B-uKuu49.js} +1 -1
  78. package/dist/{token-B2PduqrR.js → token-C2kzntVM.js} +1 -1
  79. package/dist/tools.d.ts +5 -0
  80. package/dist/tools.js +183 -125
  81. package/dist/{try-BUnhITXS.js → try-BrJJyXgq.js} +32 -32
  82. package/dist/{upgrade-DfZfDljd.js → upgrade-g_Bd9oJe.js} +2 -2
  83. package/dist/{upgrade-CI7K1UZ-.js → upgrade-zOXTIaAZ.js} +2 -2
  84. package/package.json +2 -2
  85. package/dist/create-DAkNdEzt.js +0 -20
  86. package/dist/held-KVcYIplR.js +0 -17
  87. package/dist/login-BiwaQkXS.js +0 -17
  88. package/dist/pull-DRMIxqR8.js +0 -36
  89. package/dist/pull-_qs90vGA.js +0 -106
  90. package/dist/push-Cb4g_l1K.js +0 -30
  91. package/dist/push-DZKsd6Dp.js +0 -22
  92. package/dist/resolve-DGePiHgL.js +0 -196
  93. package/dist/scan-2WqHGkjU.js +0 -4
  94. package/dist/server-BqLPwcy9.js +0 -29
  95. package/dist/session-BHBIGscL.js +0 -6
  96. package/dist/storekit-Dewj_5qg.js +0 -17
  97. /package/dist/{design-lint-CvgcSzVg.js → design-lint-CiFc78aM.js} +0 -0
  98. /package/dist/{download-F8OtTJze.js → download-DhGd4hOB.js} +0 -0
  99. /package/dist/{reports-BZfxvenS.js → reports-HYVp169R.js} +0 -0
@@ -1,39 +1,39 @@
1
- import "./token-B2PduqrR.js";
1
+ import "./token-C2kzntVM.js";
2
2
  import { t as blocks } from "./output-Ggzq5_-t.js";
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";
3
+ import { d as DASHBOARD_URL, x as VERSION } from "./environment-EU7Mrk7j.js";
4
+ import { n as readSession, s as sessionOrgName } from "./storage-R5-qDvHq.js";
5
+ import "./client-Tp6iD66_.js";
6
6
  import "./config-CGcG7GOt.js";
7
- import "./telemetry-ekUQuhLJ.js";
7
+ import "./telemetry-B-uKuu49.js";
8
8
  import "./spawn-DmmmHIP-.js";
9
- import "./spinner-025_eqCX.js";
9
+ import "./spinner-mWZnJCkN.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-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";
13
+ import { t as scanProject } from "./scan-DhmGH1rF.js";
14
+ import { t as detectExisting } from "./existing-DV_6NLfW.js";
15
+ import "./paths-Bf3othB-.js";
16
+ import "./orgs-CYXjVdxM.js";
17
+ import "./resources-CkG6SCia.js";
18
+ import "./lookup-DhMLZmdW.js";
19
+ import "./login-Ca6FhI6R.js";
20
+ import "./skills-CE4c9eHX.js";
21
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";
22
+ import "./lock-DgSx-p8Y.js";
23
+ import "./scope-ehZ7L1nj.js";
24
+ import { i as requireApi } from "./base-Cft9NZfU.js";
25
+ import "./framework-b-Yf8sP1.js";
26
+ import { t as runAction } from "./run-CL5ZnujW.js";
27
+ import { t as detectDrivers } from "./drivers-YZEcBiSV.js";
28
+ 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-C22iQzAW.js";
29
+ import { n as performLoginWithUi } from "./login-DoMmU3Bq.js";
30
+ import "./source-BccdO4aL.js";
31
+ import "./assets-oo93EFou.js";
32
+ import "./source-push-EyF02ekO.js";
33
+ import "./server-DamMN_ig.js";
34
+ import { i as startStudio, n as migrationNextSteps, r as screenNextSteps, t as askStudio } from "./open-DriuY3di.js";
35
+ import { r as actionById, t as detectBilling } from "./billing-Bo1UEKqV.js";
36
+ import { n as writeReport } from "./reports-HYVp169R.js";
37
37
  import { execFile } from "node:child_process";
38
38
  import * as fs from "node:fs";
39
39
  import * as os$1 from "node:os";
@@ -1,13 +1,13 @@
1
- import { d as DASHBOARD_URL } from "./environment-FR3bcq0D.js";
2
- import { t as ApiError } from "./client-DHlsTaP1.js";
1
+ import { d as DASHBOARD_URL } from "./environment-EU7Mrk7j.js";
2
+ import { t as ApiError } from "./client-Tp6iD66_.js";
3
3
  import { t as stripReport } from "./log-C0MDCfA2.js";
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";
4
+ import { i as readPackageJson, r as allDeps } from "./scan-DhmGH1rF.js";
5
+ import { l as findPaywall, p as listApplications } from "./resources-CkG6SCia.js";
6
+ import { d as readBundledSkill } from "./skills-CE4c9eHX.js";
7
+ import { a as isScreenOrigin, d as writeApp, h as writeOrigin, l as readLock } from "./lock-DgSx-p8Y.js";
8
+ import { a as projectPackageName } from "./base-Cft9NZfU.js";
9
+ import { a as copyToClipboard, i as readPrompt, n as runWithDriverFallback } from "./run-CL5ZnujW.js";
10
+ import { t as detectDrivers } from "./drivers-YZEcBiSV.js";
11
11
  import * as fs from "node:fs";
12
12
  import * as path from "node:path";
13
13
  import fg from "fast-glob";
@@ -1,5 +1,5 @@
1
- import { D as updateServerNotifications, r as chooseKeyApp } from "./held-C2IjAyg6.js";
2
- import { t as apiCall } from "./spinner-025_eqCX.js";
1
+ import { D as updateServerNotifications, r as chooseKeyApp } from "./held-L0vz0_hA.js";
2
+ import { t as apiCall } from "./spinner-mWZnJCkN.js";
3
3
  import { i as findAppNotificationUrl } from "./client-BJQXl62Q.js";
4
4
  import { t as timing } from "./timing-Ca0TXY-A.js";
5
5
 
@@ -1,5 +1,5 @@
1
- import { T as isNonInteractive } from "./environment-FR3bcq0D.js";
2
- import { t as runStudio } from "./server-BmmOj7bh.js";
1
+ import { T as isNonInteractive } from "./environment-EU7Mrk7j.js";
2
+ import { t as runStudio } from "./server-DamMN_ig.js";
3
3
 
4
4
  //#region src/core/paywalls/studio/open.ts
5
5
  async function askStudio(ui, interactive, surfaceId, original = true) {
@@ -1,7 +1,7 @@
1
- import { n as withSpinner } from "./spinner-025_eqCX.js";
1
+ import { n as withSpinner } from "./spinner-mWZnJCkN.js";
2
2
  import { n as ui } from "./ui-D_qf3Gvw.js";
3
- import { n as listOrganizations, t as listOrgGroups } from "./orgs-BxlwcvTu.js";
4
- import { E as titleCase, T as rowName } from "./resources-COOEvqqW.js";
3
+ import { n as listOrganizations, t as listOrgGroups } from "./orgs-CYXjVdxM.js";
4
+ import { E as titleCase, T as rowName } from "./resources-CkG6SCia.js";
5
5
 
6
6
  //#region src/core/account/org.ts
7
7
  async function orgForNewProject(api, interactive) {
@@ -1,9 +1,9 @@
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";
1
+ import { t as apiCall } from "./spinner-mWZnJCkN.js";
2
+ import { a as orgProjects, i as orgIdOf, n as listOrganizations } from "./orgs-CYXjVdxM.js";
3
+ import { n as findApplication, t as appNotFound } from "./lookup-DhMLZmdW.js";
4
+ import { t as ArtifactError } from "./project-NoMtbMyl.js";
5
5
 
6
- //#region src/core/workspaces/organization.ts
6
+ //#region src/core/artifacts/organization.ts
7
7
  async function resolveAppScope(api, app, org) {
8
8
  if (/^\d+$/.test(app) && org !== void 0) return {
9
9
  organizationId: org,
@@ -12,7 +12,7 @@ async function resolveAppScope(api, app, org) {
12
12
  const found = await findApplication(api, app, org === void 0 ? void 0 : await orgProjects(api, org));
13
13
  if (!found) throw appNotFound(app);
14
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}.`);
15
+ if (org !== void 0 && home !== org) throw new ArtifactError(`App ${app} is in organization ${home ?? "unknown"}, not ${org}.`);
16
16
  return {
17
17
  organizationId: org ?? home,
18
18
  applicationId: String(found.app.id)
@@ -23,7 +23,7 @@ async function resolveOrganization(ctx, org) {
23
23
  const organizations = await apiCall(ctx, "Loading your organizations", () => listOrganizations(ctx.api));
24
24
  const [only] = organizations;
25
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>.");
26
+ if (!ctx.interactive || organizations.length === 0) throw new ArtifactError("Say which organization with --org <id>.");
27
27
  const picked = await ctx.ui.select({
28
28
  message: "Which organization?",
29
29
  options: organizations.map((organization) => ({
@@ -31,7 +31,7 @@ async function resolveOrganization(ctx, org) {
31
31
  label: String(organization.name ?? organization.id)
32
32
  }))
33
33
  });
34
- if (picked === null) throw new WorkspaceError("No organization picked.");
34
+ if (picked === null) throw new ArtifactError("No organization picked.");
35
35
  return picked;
36
36
  }
37
37
 
@@ -1,4 +1,4 @@
1
- import { t as ApiError } from "./client-DHlsTaP1.js";
1
+ import { t as ApiError } from "./client-Tp6iD66_.js";
2
2
  import { h as writeOpenedOrgs, s as readOpenedOrgs } from "./config-CGcG7GOt.js";
3
3
 
4
4
  //#region src/core/api/orgs.ts
@@ -1,4 +1,4 @@
1
- import { E as resolveEnv } from "./environment-FR3bcq0D.js";
1
+ import { E as resolveEnv } from "./environment-EU7Mrk7j.js";
2
2
  import { existsSync } from "node:fs";
3
3
  import { homedir } from "node:os";
4
4
  import { dirname, join } from "node:path";
@@ -1,17 +1,17 @@
1
- import "./token-B2PduqrR.js";
1
+ import "./token-C2kzntVM.js";
2
2
  import "./output-Ggzq5_-t.js";
3
- import "./environment-FR3bcq0D.js";
4
- import "./storage-CUMgpcVH.js";
5
- import "./client-DHlsTaP1.js";
3
+ import "./environment-EU7Mrk7j.js";
4
+ import "./storage-R5-qDvHq.js";
5
+ import "./client-Tp6iD66_.js";
6
6
  import "./config-CGcG7GOt.js";
7
- import { i as updateTelemetryTags, r as track } from "./telemetry-ekUQuhLJ.js";
7
+ import { i as updateTelemetryTags, r as track } from "./telemetry-B-uKuu49.js";
8
8
  import "./spawn-DmmmHIP-.js";
9
- import "./spinner-025_eqCX.js";
9
+ import "./spinner-mWZnJCkN.js";
10
10
  import "./ui-D_qf3Gvw.js";
11
- import { t as scanProject } from "./scan-BZS2FZeU.js";
12
- import "./paths-BaeoxDze.js";
13
- import { d as readBundledSkill } from "./skills-Cm1j2d1W.js";
14
- import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-BopwIhR3.js";
11
+ import { t as scanProject } from "./scan-DhmGH1rF.js";
12
+ import "./paths-Bf3othB-.js";
13
+ import { d as readBundledSkill } from "./skills-CE4c9eHX.js";
14
+ import { n as FRAMEWORK_REF, t as detectBilling } from "./billing-Bo1UEKqV.js";
15
15
 
16
16
  //#region src/core/workflows/playbook.ts
17
17
  async function printPlaybook(installDir, playbook) {
@@ -1,10 +1,10 @@
1
1
  import * as fs from "node:fs";
2
2
  import * as path from "node:path";
3
3
 
4
- //#region src/core/workspaces/project.ts
5
- var WorkspaceError = class extends Error {};
4
+ //#region src/core/artifacts/project.ts
5
+ var ArtifactError = class extends Error {};
6
6
  const MANIFEST_FILE = "superwall.json";
7
- const VENDORED_SDK = path.join("vendor", "workspace-sdk");
7
+ const VENDORED_SDK = path.join("vendor", "artifact-sdk");
8
8
  function isManifest(value) {
9
9
  if (typeof value !== "object" || value === null) return false;
10
10
  const { name, scopes, entrypoints } = value;
@@ -16,15 +16,15 @@ function readManifest(root) {
16
16
  try {
17
17
  text = fs.readFileSync(file, "utf8");
18
18
  } catch {
19
- throw new WorkspaceError(`No ${MANIFEST_FILE} in ${root}. Run this inside a workspace, or start one with \`superwall workspaces create\`.`);
19
+ throw new ArtifactError(`No ${MANIFEST_FILE} in ${root}. Run this inside an artifact, or start one with \`superwall artifacts create\`.`);
20
20
  }
21
21
  let parsed;
22
22
  try {
23
23
  parsed = JSON.parse(text);
24
24
  } catch (error) {
25
- throw new WorkspaceError(`${MANIFEST_FILE} is not valid JSON: ${error.message}`);
25
+ throw new ArtifactError(`${MANIFEST_FILE} is not valid JSON: ${error.message}`);
26
26
  }
27
- if (!isManifest(parsed)) throw new WorkspaceError(`${MANIFEST_FILE} needs a name, scopes and entrypoints.`);
27
+ if (!isManifest(parsed)) throw new ArtifactError(`${MANIFEST_FILE} needs a name, scopes and entrypoints.`);
28
28
  return parsed;
29
29
  }
30
30
  function readProject(dir) {
@@ -37,11 +37,11 @@ function readProject(dir) {
37
37
  function findEntrypoint(manifest, id) {
38
38
  const entrypoint = manifest.entrypoints.find((candidate) => candidate.id === id);
39
39
  if (entrypoint) return entrypoint;
40
- throw new WorkspaceError(`No entrypoint named \`${id}\` in ${MANIFEST_FILE}. It has: ${manifest.entrypoints.map((candidate) => candidate.id).join(", ") || "none"}.`);
40
+ throw new ArtifactError(`No entrypoint named \`${id}\` in ${MANIFEST_FILE}. It has: ${manifest.entrypoints.map((candidate) => candidate.id).join(", ") || "none"}.`);
41
41
  }
42
42
  function bundleDir(root) {
43
- return path.join(root, ".superwall", "workspace");
43
+ return path.join(root, ".superwall", "artifact");
44
44
  }
45
45
 
46
46
  //#endregion
47
- export { findEntrypoint as a, bundleDir as i, VENDORED_SDK as n, readManifest as o, WorkspaceError as r, readProject as s, MANIFEST_FILE as t };
47
+ export { findEntrypoint as a, bundleDir as i, MANIFEST_FILE as n, readManifest as o, VENDORED_SDK as r, readProject as s, ArtifactError as t };
@@ -1,31 +1,31 @@
1
- import "./token-B2PduqrR.js";
1
+ import "./token-C2kzntVM.js";
2
2
  import "./output-Ggzq5_-t.js";
3
- import { x as VERSION } from "./environment-FR3bcq0D.js";
4
- import "./storage-CUMgpcVH.js";
5
- import { t as ApiError } from "./client-DHlsTaP1.js";
3
+ import { x as VERSION } from "./environment-EU7Mrk7j.js";
4
+ import "./storage-R5-qDvHq.js";
5
+ import { t as ApiError } from "./client-Tp6iD66_.js";
6
6
  import "./config-CGcG7GOt.js";
7
- import "./telemetry-ekUQuhLJ.js";
7
+ import "./telemetry-B-uKuu49.js";
8
8
  import "./spawn-DmmmHIP-.js";
9
- import "./spinner-025_eqCX.js";
9
+ import "./spinner-mWZnJCkN.js";
10
10
  import { n as ui } from "./ui-D_qf3Gvw.js";
11
- import "./scan-BZS2FZeU.js";
12
- import "./paths-BaeoxDze.js";
13
- import "./orgs-BxlwcvTu.js";
14
- import { _ as livePaywallVersion, x as promotePaywallVersion } from "./resources-COOEvqqW.js";
15
- import "./lookup-D23dAOz6.js";
16
- import "./login-C6FcBQZg.js";
17
- import "./skills-Cm1j2d1W.js";
11
+ import "./scan-DhmGH1rF.js";
12
+ import "./paths-Bf3othB-.js";
13
+ import "./orgs-CYXjVdxM.js";
14
+ import { _ as livePaywallVersion, x as promotePaywallVersion } from "./resources-CkG6SCia.js";
15
+ import "./lookup-DhMLZmdW.js";
16
+ import "./login-Ca6FhI6R.js";
17
+ import "./skills-CE4c9eHX.js";
18
18
  import "./browser-Bp3yRKlU.js";
19
- import "./assets-CqpFg5mM.js";
20
- import { a as resolveProjectDir, g as transition, s as selectSurfaces, y as resolveFramework } from "./selection-CWfI4a0O.js";
21
- import "./design-lint-CvgcSzVg.js";
22
- import { f as readLock, n as collectProjectDeclarations } from "./types-CB6O_wjy.js";
23
- import { c as planTargets, d as wantedPlatforms, h as resolveApps, n as requireApi, s as parsePlatformFlags, u as targetLabel } from "./session-DYdxTNZf.js";
24
- import { u as resolveBinding } from "./source-push-B3c-VLfe.js";
25
- import { a as pickApplicationOption, i as timed, o as pickAdoptOption, t as group } from "./push-BlZoIwIj.js";
26
- import "./git-DqDPnldI.js";
27
- import "./scope-t_SqFN6W.js";
28
- import "./login-dRPPnGr7.js";
19
+ import { l as readLock, y as collectProjectDeclarations } from "./lock-DgSx-p8Y.js";
20
+ import "./scope-ehZ7L1nj.js";
21
+ import { c as planTargets, d as wantedPlatforms, h as resolveApps, i as requireApi, s as parsePlatformFlags, u as targetLabel } from "./base-Cft9NZfU.js";
22
+ import { l as selectSurfaces, n as resolveFramework, s as resolveProjectDir, v as transition } from "./framework-b-Yf8sP1.js";
23
+ import "./login-DoMmU3Bq.js";
24
+ import "./source-BccdO4aL.js";
25
+ import "./assets-oo93EFou.js";
26
+ import "./design-lint-CiFc78aM.js";
27
+ import { u as resolveBinding } from "./source-push-EyF02ekO.js";
28
+ import { a as pickApplicationOption, i as timed, o as pickAdoptOption, t as group } from "./push-Dk5x2xP3.js";
29
29
  import pc from "picocolors";
30
30
 
31
31
  //#region src/core/paywalls/promote.ts
@@ -0,0 +1,106 @@
1
+ import "./token-C2kzntVM.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-EU7Mrk7j.js";
4
+ import "./storage-R5-qDvHq.js";
5
+ import "./client-Tp6iD66_.js";
6
+ import "./config-CGcG7GOt.js";
7
+ import "./telemetry-B-uKuu49.js";
8
+ import "./spawn-DmmmHIP-.js";
9
+ import "./spinner-mWZnJCkN.js";
10
+ import "./ui-D_qf3Gvw.js";
11
+ import "./theme-DUsCh-Vd.js";
12
+ import "./log-C0MDCfA2.js";
13
+ import "./scan-DhmGH1rF.js";
14
+ import "./existing-DV_6NLfW.js";
15
+ import "./paths-Bf3othB-.js";
16
+ import "./orgs-CYXjVdxM.js";
17
+ import "./resources-CkG6SCia.js";
18
+ import "./org-D7LQrg3k.js";
19
+ import "./lookup-DhMLZmdW.js";
20
+ import "./bind-BvScWziR.js";
21
+ import "./login-Ca6FhI6R.js";
22
+ import "./skills-CE4c9eHX.js";
23
+ import "./browser-Bp3yRKlU.js";
24
+ import { E as mintSourceAccess, d as resolveArtifact, g as writeBinding, h as readSourceFile, m as readBinding, u as projectRoot } from "./resolve-D3RBtfkI.js";
25
+ import { t as ArtifactError } from "./project-NoMtbMyl.js";
26
+ import "./lock-DgSx-p8Y.js";
27
+ import { t as ARTIFACT_DERIVED_FILES } from "./scope-ehZ7L1nj.js";
28
+ import "./organization-DDidaGRK.js";
29
+ import "./download-DhGd4hOB.js";
30
+ import "./sdk-DEfQttek.js";
31
+ import "./base-Cft9NZfU.js";
32
+ import "./framework-b-Yf8sP1.js";
33
+ import "./run-CL5ZnujW.js";
34
+ import "./drivers-YZEcBiSV.js";
35
+ import "./migration-C22iQzAW.js";
36
+ import "./login-DoMmU3Bq.js";
37
+ import { r as pullSourceTree, t as collectSourceFiles } from "./source-BccdO4aL.js";
38
+ import "./setup-BFTSxEWU.js";
39
+ import { n as applyPulledChanges } from "./pull-DuFUkP7t.js";
40
+ import { a as toSourceAccess } from "./push-CrowxhpU.js";
41
+ import * as fs from "node:fs";
42
+ import * as path from "node:path";
43
+
44
+ //#region src/core/artifacts/pull.ts
45
+ const NOT_PUSHED = "Its source repo is empty: nobody has pushed yet. Run `superwall artifacts push` first.";
46
+ function report(ctx, slug, head, written, skipped) {
47
+ if (ctx.json) {
48
+ ctx.output.data({
49
+ slug,
50
+ head,
51
+ written,
52
+ skipped
53
+ });
54
+ return;
55
+ }
56
+ ctx.ui.success(written.length === 0 ? "Already up to date." : `Pulled ${written.length} ${written.length === 1 ? "file" : "files"} of \`${slug}\`.`);
57
+ if (written.length > 0) ctx.ui.list({ items: written.map((label) => ({ label })) });
58
+ if (skipped.length > 0) ctx.ui.warn(`Not pulled, because a file of yours that git doesn't track is in the way: ${skipped.join(", ")}. Move it, then pull again.`);
59
+ }
60
+ function assertCloneTarget(root) {
61
+ if (!fs.existsSync(root)) return;
62
+ if (fs.readdirSync(root).length > 0) throw new ArtifactError(`${root} already has files and isn't linked to this artifact. Pick an empty directory.`);
63
+ }
64
+ async function runArtifactPull(ctx, input) {
65
+ const root = projectRoot(input.dir);
66
+ const linked = readBinding(root);
67
+ const artifact = await resolveArtifact(ctx, input);
68
+ if (linked && linked.artifactId !== String(artifact.id)) throw new ArtifactError(`This project is linked to artifact ${linked.artifactId}, not ${artifact.id}. Pull into an empty directory instead.`);
69
+ if (!linked) assertCloneTarget(root);
70
+ fs.mkdirSync(root, { recursive: true });
71
+ const collected = linked ? await collectSourceFiles(root, readSourceFile) : {
72
+ ok: true,
73
+ files: []
74
+ };
75
+ if (!collected.ok) throw new ArtifactError(collected.reason);
76
+ const pulled = await pullSourceTree({
77
+ access: toSourceAccess(await mintSourceAccess(ctx.api, artifact.id)),
78
+ files: collected.files,
79
+ base: linked?.syncedCommit,
80
+ theirs: input.theirs,
81
+ derived: ARTIFACT_DERIVED_FILES
82
+ });
83
+ if (pulled.status === "empty") throw new ArtifactError(NOT_PUSHED);
84
+ const { written, skipped } = applyPulledChanges(root, pulled.changes, new Set(collected.files.map((file) => file.path)));
85
+ writeBinding(root, {
86
+ artifactId: String(artifact.id),
87
+ organizationId: String(artifact.organization_id),
88
+ slug: artifact.slug,
89
+ ...skipped.length > 0 ? {
90
+ syncedCommit: linked?.syncedCommit,
91
+ reviewedCommit: linked?.reviewedCommit
92
+ } : {
93
+ syncedCommit: pulled.head,
94
+ reviewedCommit: pulled.head
95
+ }
96
+ });
97
+ report(ctx, artifact.slug, pulled.head, written, skipped);
98
+ if (linked && written.length > 0 && !ctx.json) ctx.ui.info("Read what came in before you push: your own copy runs all of it with your reads.");
99
+ if (!linked && !ctx.json) {
100
+ const where = path.relative(process.cwd(), root) || ".";
101
+ ctx.ui.info(`Next: cd ${where} && npm install && superwall artifacts dev`);
102
+ }
103
+ }
104
+
105
+ //#endregion
106
+ export { runArtifactPull };
@@ -0,0 +1,36 @@
1
+ import "./token-C2kzntVM.js";
2
+ import "./output-Ggzq5_-t.js";
3
+ import "./environment-EU7Mrk7j.js";
4
+ import "./storage-R5-qDvHq.js";
5
+ import "./client-Tp6iD66_.js";
6
+ import "./config-CGcG7GOt.js";
7
+ import "./telemetry-B-uKuu49.js";
8
+ import "./spawn-DmmmHIP-.js";
9
+ import "./spinner-mWZnJCkN.js";
10
+ import "./ui-D_qf3Gvw.js";
11
+ import "./theme-DUsCh-Vd.js";
12
+ import "./log-C0MDCfA2.js";
13
+ import "./scan-DhmGH1rF.js";
14
+ import "./existing-DV_6NLfW.js";
15
+ import "./paths-Bf3othB-.js";
16
+ import "./orgs-CYXjVdxM.js";
17
+ import "./resources-CkG6SCia.js";
18
+ import "./org-D7LQrg3k.js";
19
+ import "./lookup-DhMLZmdW.js";
20
+ import "./bind-BvScWziR.js";
21
+ import "./login-Ca6FhI6R.js";
22
+ import "./skills-CE4c9eHX.js";
23
+ import "./browser-Bp3yRKlU.js";
24
+ import "./lock-DgSx-p8Y.js";
25
+ import "./scope-ehZ7L1nj.js";
26
+ import "./base-Cft9NZfU.js";
27
+ import "./framework-b-Yf8sP1.js";
28
+ import "./run-CL5ZnujW.js";
29
+ import "./drivers-YZEcBiSV.js";
30
+ import "./migration-C22iQzAW.js";
31
+ import "./login-DoMmU3Bq.js";
32
+ import "./source-BccdO4aL.js";
33
+ import "./setup-BFTSxEWU.js";
34
+ import { a as cloneInto, c as pullInto, i as boundPaywall, l as runPull, n as applyPulledChanges, o as cloneTarget, r as appsToPull, s as mergePulledLock, t as PullPathError } from "./pull-DuFUkP7t.js";
35
+
36
+ export { PullPathError, applyPulledChanges, appsToPull, boundPaywall, cloneInto, cloneTarget, mergePulledLock, pullInto, runPull };
@@ -1,12 +1,12 @@
1
- import { x as VERSION } from "./environment-FR3bcq0D.js";
1
+ import { x as VERSION } from "./environment-EU7Mrk7j.js";
2
2
  import { n as ui } from "./ui-D_qf3Gvw.js";
3
- import { f as listAppPaywalls, v as mintSourceAccess } from "./resources-COOEvqqW.js";
4
- import { n as findApplication, t as appNotFound } from "./lookup-D23dAOz6.js";
5
- import { a as resolveProjectDir, i as requireProject, y as resolveFramework } from "./selection-CWfI4a0O.js";
6
- import { _ as writeLock, f as readLock, i as NewerLockError, n as collectProjectDeclarations, r as writeProjectTypes, t as TYPES_FILE, u as parseLock } from "./types-CB6O_wjy.js";
7
- import { f as PLATFORMS, i as writeSourceBase, m as requirePlatform, n as requireApi, r as readSourceBase, s as parsePlatformFlags } from "./session-DYdxTNZf.js";
8
- import { a as collectSourceFiles, i as statIfPresent, n as pullSourceTree } from "./git-DqDPnldI.js";
9
- import { a as devCommand, i as detectPackageManager } from "./setup-DW50luOZ.js";
3
+ import { f as listAppPaywalls, v as mintSourceAccess } from "./resources-CkG6SCia.js";
4
+ import { n as findApplication, t as appNotFound } from "./lookup-DhMLZmdW.js";
5
+ import { b as writeProjectTypes, l as readLock, m as writeLock, s as parseLock, t as NewerLockError, v as TYPES_FILE, y as collectProjectDeclarations } from "./lock-DgSx-p8Y.js";
6
+ import { f as PLATFORMS, i as requireApi, m as requirePlatform, n as writeSourceBase, s as parsePlatformFlags, t as readSourceBase } from "./base-Cft9NZfU.js";
7
+ import { n as resolveFramework, o as requireProject, s as resolveProjectDir } from "./framework-b-Yf8sP1.js";
8
+ import { a as statIfPresent, r as pullSourceTree, t as collectSourceFiles } from "./source-BccdO4aL.js";
9
+ import { a as devCommand, i as detectPackageManager } from "./setup-BFTSxEWU.js";
10
10
  import * as fs from "node:fs";
11
11
  import * as path from "node:path";
12
12
  import pc from "picocolors";