@embeddables/cli 0.7.13 → 0.7.15

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 (236) hide show
  1. package/.prompts/custom/build-funnel.md +1 -1
  2. package/.prompts/embeddables-cli.md +9 -2
  3. package/package.json +1 -1
  4. package/dist/auth/index.d.ts +0 -43
  5. package/dist/auth/index.d.ts.map +0 -1
  6. package/dist/auth/index.js +0 -102
  7. package/dist/cli.d.ts +0 -2
  8. package/dist/cli.d.ts.map +0 -1
  9. package/dist/cli.js +0 -174
  10. package/dist/commands/branch.d.ts +0 -4
  11. package/dist/commands/branch.d.ts.map +0 -1
  12. package/dist/commands/branch.js +0 -68
  13. package/dist/commands/build-workbench.d.ts +0 -5
  14. package/dist/commands/build-workbench.d.ts.map +0 -1
  15. package/dist/commands/build-workbench.js +0 -128
  16. package/dist/commands/build.d.ts +0 -8
  17. package/dist/commands/build.d.ts.map +0 -1
  18. package/dist/commands/build.js +0 -55
  19. package/dist/commands/dev.d.ts +0 -12
  20. package/dist/commands/dev.d.ts.map +0 -1
  21. package/dist/commands/dev.js +0 -221
  22. package/dist/commands/experiments-connect.d.ts +0 -6
  23. package/dist/commands/experiments-connect.d.ts.map +0 -1
  24. package/dist/commands/experiments-connect.js +0 -140
  25. package/dist/commands/init.d.ts +0 -5
  26. package/dist/commands/init.d.ts.map +0 -1
  27. package/dist/commands/init.js +0 -327
  28. package/dist/commands/login.d.ts +0 -2
  29. package/dist/commands/login.d.ts.map +0 -1
  30. package/dist/commands/login.js +0 -122
  31. package/dist/commands/logout.d.ts +0 -2
  32. package/dist/commands/logout.d.ts.map +0 -1
  33. package/dist/commands/logout.js +0 -22
  34. package/dist/commands/pull.d.ts +0 -14
  35. package/dist/commands/pull.d.ts.map +0 -1
  36. package/dist/commands/pull.js +0 -383
  37. package/dist/commands/save.d.ts +0 -30
  38. package/dist/commands/save.d.ts.map +0 -1
  39. package/dist/commands/save.js +0 -591
  40. package/dist/commands/upgrade.d.ts +0 -2
  41. package/dist/commands/upgrade.d.ts.map +0 -1
  42. package/dist/commands/upgrade.js +0 -51
  43. package/dist/compiler/errors.d.ts +0 -20
  44. package/dist/compiler/errors.d.ts.map +0 -1
  45. package/dist/compiler/errors.js +0 -35
  46. package/dist/compiler/evalStatic.d.ts +0 -3
  47. package/dist/compiler/evalStatic.d.ts.map +0 -1
  48. package/dist/compiler/evalStatic.js +0 -57
  49. package/dist/compiler/flatten.js +0 -1
  50. package/dist/compiler/helpers/duplicateIds.d.ts +0 -9
  51. package/dist/compiler/helpers/duplicateIds.d.ts.map +0 -1
  52. package/dist/compiler/helpers/duplicateIds.js +0 -71
  53. package/dist/compiler/helpers/numericLeadingKeys.d.ts +0 -8
  54. package/dist/compiler/helpers/numericLeadingKeys.d.ts.map +0 -1
  55. package/dist/compiler/helpers/numericLeadingKeys.js +0 -17
  56. package/dist/compiler/index.d.ts +0 -18
  57. package/dist/compiler/index.d.ts.map +0 -1
  58. package/dist/compiler/index.js +0 -1245
  59. package/dist/compiler/parsePage.d.ts +0 -15
  60. package/dist/compiler/parsePage.d.ts.map +0 -1
  61. package/dist/compiler/parsePage.js +0 -631
  62. package/dist/compiler/registry.d.ts +0 -4
  63. package/dist/compiler/registry.d.ts.map +0 -1
  64. package/dist/compiler/registry.js +0 -44
  65. package/dist/compiler/reverse.d.ts +0 -23
  66. package/dist/compiler/reverse.d.ts.map +0 -1
  67. package/dist/compiler/reverse.js +0 -1875
  68. package/dist/compiler/types.d.ts +0 -21
  69. package/dist/compiler/types.d.ts.map +0 -1
  70. package/dist/compiler/types.js +0 -1
  71. package/dist/components/index.d.ts +0 -21
  72. package/dist/components/index.d.ts.map +0 -1
  73. package/dist/components/index.js +0 -21
  74. package/dist/components/primitives/BaseComponent.d.ts +0 -32
  75. package/dist/components/primitives/BaseComponent.d.ts.map +0 -1
  76. package/dist/components/primitives/BaseComponent.js +0 -26
  77. package/dist/components/primitives/BookMeeting.d.ts +0 -18
  78. package/dist/components/primitives/BookMeeting.d.ts.map +0 -1
  79. package/dist/components/primitives/BookMeeting.js +0 -5
  80. package/dist/components/primitives/Chart.d.ts +0 -41
  81. package/dist/components/primitives/Chart.d.ts.map +0 -1
  82. package/dist/components/primitives/Chart.js +0 -5
  83. package/dist/components/primitives/Container.d.ts +0 -8
  84. package/dist/components/primitives/Container.d.ts.map +0 -1
  85. package/dist/components/primitives/Container.js +0 -5
  86. package/dist/components/primitives/CustomButton.d.ts +0 -37
  87. package/dist/components/primitives/CustomButton.d.ts.map +0 -1
  88. package/dist/components/primitives/CustomButton.js +0 -10
  89. package/dist/components/primitives/CustomHTML.d.ts +0 -8
  90. package/dist/components/primitives/CustomHTML.d.ts.map +0 -1
  91. package/dist/components/primitives/CustomHTML.js +0 -5
  92. package/dist/components/primitives/FileUpload.d.ts +0 -18
  93. package/dist/components/primitives/FileUpload.d.ts.map +0 -1
  94. package/dist/components/primitives/FileUpload.js +0 -16
  95. package/dist/components/primitives/InputBox.d.ts +0 -34
  96. package/dist/components/primitives/InputBox.d.ts.map +0 -1
  97. package/dist/components/primitives/InputBox.js +0 -25
  98. package/dist/components/primitives/Lottie.d.ts +0 -11
  99. package/dist/components/primitives/Lottie.d.ts.map +0 -1
  100. package/dist/components/primitives/Lottie.js +0 -5
  101. package/dist/components/primitives/MediaEmbed.d.ts +0 -13
  102. package/dist/components/primitives/MediaEmbed.d.ts.map +0 -1
  103. package/dist/components/primitives/MediaEmbed.js +0 -6
  104. package/dist/components/primitives/MediaImage.d.ts +0 -8
  105. package/dist/components/primitives/MediaImage.d.ts.map +0 -1
  106. package/dist/components/primitives/MediaImage.js +0 -5
  107. package/dist/components/primitives/OptionSelector.d.ts +0 -35
  108. package/dist/components/primitives/OptionSelector.d.ts.map +0 -1
  109. package/dist/components/primitives/OptionSelector.js +0 -8
  110. package/dist/components/primitives/PaypalCheckout.d.ts +0 -25
  111. package/dist/components/primitives/PaypalCheckout.d.ts.map +0 -1
  112. package/dist/components/primitives/PaypalCheckout.js +0 -5
  113. package/dist/components/primitives/PlainText.d.ts +0 -6
  114. package/dist/components/primitives/PlainText.d.ts.map +0 -1
  115. package/dist/components/primitives/PlainText.js +0 -5
  116. package/dist/components/primitives/ProgressBar.d.ts +0 -15
  117. package/dist/components/primitives/ProgressBar.d.ts.map +0 -1
  118. package/dist/components/primitives/ProgressBar.js +0 -5
  119. package/dist/components/primitives/RichText.d.ts +0 -6
  120. package/dist/components/primitives/RichText.d.ts.map +0 -1
  121. package/dist/components/primitives/RichText.js +0 -5
  122. package/dist/components/primitives/RichTextMarkdown.d.ts +0 -6
  123. package/dist/components/primitives/RichTextMarkdown.d.ts.map +0 -1
  124. package/dist/components/primitives/RichTextMarkdown.js +0 -5
  125. package/dist/components/primitives/Rive.d.ts +0 -16
  126. package/dist/components/primitives/Rive.d.ts.map +0 -1
  127. package/dist/components/primitives/Rive.js +0 -8
  128. package/dist/components/primitives/StripeCheckout.d.ts +0 -52
  129. package/dist/components/primitives/StripeCheckout.d.ts.map +0 -1
  130. package/dist/components/primitives/StripeCheckout.js +0 -5
  131. package/dist/components/primitives/StripeCheckout2.d.ts +0 -30
  132. package/dist/components/primitives/StripeCheckout2.d.ts.map +0 -1
  133. package/dist/components/primitives/StripeCheckout2.js +0 -7
  134. package/dist/config/index.d.ts +0 -23
  135. package/dist/config/index.d.ts.map +0 -1
  136. package/dist/config/index.js +0 -42
  137. package/dist/constants.d.ts +0 -9
  138. package/dist/constants.d.ts.map +0 -1
  139. package/dist/constants.js +0 -9
  140. package/dist/helpers/TEMP helpers file.d.ts +0 -1
  141. package/dist/helpers/TEMP helpers file.d.ts.map +0 -1
  142. package/dist/helpers/TEMP helpers file.js +0 -1
  143. package/dist/helpers/dates.d.ts +0 -5
  144. package/dist/helpers/dates.d.ts.map +0 -1
  145. package/dist/helpers/dates.js +0 -7
  146. package/dist/helpers/json.d.ts +0 -47
  147. package/dist/helpers/json.d.ts.map +0 -1
  148. package/dist/helpers/json.js +0 -622
  149. package/dist/helpers/utils.d.ts +0 -13
  150. package/dist/helpers/utils.d.ts.map +0 -1
  151. package/dist/helpers/utils.js +0 -28
  152. package/dist/logger.d.ts +0 -11
  153. package/dist/logger.d.ts.map +0 -1
  154. package/dist/logger.js +0 -21
  155. package/dist/prompts/branches.d.ts +0 -20
  156. package/dist/prompts/branches.d.ts.map +0 -1
  157. package/dist/prompts/branches.js +0 -90
  158. package/dist/prompts/embeddables.d.ts +0 -43
  159. package/dist/prompts/embeddables.d.ts.map +0 -1
  160. package/dist/prompts/embeddables.js +0 -198
  161. package/dist/prompts/experiments.d.ts +0 -28
  162. package/dist/prompts/experiments.d.ts.map +0 -1
  163. package/dist/prompts/experiments.js +0 -87
  164. package/dist/prompts/index.d.ts +0 -11
  165. package/dist/prompts/index.d.ts.map +0 -1
  166. package/dist/prompts/index.js +0 -6
  167. package/dist/prompts/projects.d.ts +0 -22
  168. package/dist/prompts/projects.d.ts.map +0 -1
  169. package/dist/prompts/projects.js +0 -86
  170. package/dist/prompts/versions.d.ts +0 -18
  171. package/dist/prompts/versions.d.ts.map +0 -1
  172. package/dist/prompts/versions.js +0 -99
  173. package/dist/proxy/injectApiInterceptor.d.ts +0 -6
  174. package/dist/proxy/injectApiInterceptor.d.ts.map +0 -1
  175. package/dist/proxy/injectApiInterceptor.js +0 -66
  176. package/dist/proxy/injectReload.d.ts +0 -2
  177. package/dist/proxy/injectReload.d.ts.map +0 -1
  178. package/dist/proxy/injectReload.js +0 -14
  179. package/dist/proxy/injectWorkbench.d.ts +0 -5
  180. package/dist/proxy/injectWorkbench.d.ts.map +0 -1
  181. package/dist/proxy/injectWorkbench.js +0 -22
  182. package/dist/proxy/server.d.ts +0 -11
  183. package/dist/proxy/server.d.ts.map +0 -1
  184. package/dist/proxy/server.js +0 -316
  185. package/dist/proxy/sse.d.ts +0 -5
  186. package/dist/proxy/sse.d.ts.map +0 -1
  187. package/dist/proxy/sse.js +0 -17
  188. package/dist/sentry-context.d.ts +0 -48
  189. package/dist/sentry-context.d.ts.map +0 -1
  190. package/dist/sentry-context.js +0 -156
  191. package/dist/stdout.d.ts +0 -17
  192. package/dist/stdout.d.ts.map +0 -1
  193. package/dist/stdout.js +0 -23
  194. package/dist/types-builder.d.ts +0 -800
  195. package/dist/types-builder.d.ts.map +0 -1
  196. package/dist/types-builder.js +0 -20
  197. package/dist/workbench/ActionsPanel.d.ts +0 -6
  198. package/dist/workbench/ActionsPanel.d.ts.map +0 -1
  199. package/dist/workbench/ActionsPanel.js +0 -47
  200. package/dist/workbench/AutofillPanel.d.ts +0 -6
  201. package/dist/workbench/AutofillPanel.d.ts.map +0 -1
  202. package/dist/workbench/AutofillPanel.js +0 -543
  203. package/dist/workbench/ComputedFieldsPanel.d.ts +0 -6
  204. package/dist/workbench/ComputedFieldsPanel.d.ts.map +0 -1
  205. package/dist/workbench/ComputedFieldsPanel.js +0 -31
  206. package/dist/workbench/ExperimentsPanel.d.ts +0 -6
  207. package/dist/workbench/ExperimentsPanel.d.ts.map +0 -1
  208. package/dist/workbench/ExperimentsPanel.js +0 -182
  209. package/dist/workbench/FieldEditorPanel.d.ts +0 -9
  210. package/dist/workbench/FieldEditorPanel.d.ts.map +0 -1
  211. package/dist/workbench/FieldEditorPanel.js +0 -650
  212. package/dist/workbench/InspectorPanel.d.ts +0 -6
  213. package/dist/workbench/InspectorPanel.d.ts.map +0 -1
  214. package/dist/workbench/InspectorPanel.js +0 -341
  215. package/dist/workbench/PageNavigator.d.ts +0 -6
  216. package/dist/workbench/PageNavigator.d.ts.map +0 -1
  217. package/dist/workbench/PageNavigator.js +0 -123
  218. package/dist/workbench/SchemaPanel.d.ts +0 -6
  219. package/dist/workbench/SchemaPanel.d.ts.map +0 -1
  220. package/dist/workbench/SchemaPanel.js +0 -222
  221. package/dist/workbench/UserDataPanel.d.ts +0 -6
  222. package/dist/workbench/UserDataPanel.d.ts.map +0 -1
  223. package/dist/workbench/UserDataPanel.js +0 -350
  224. package/dist/workbench/WorkbenchApp.d.ts +0 -7
  225. package/dist/workbench/WorkbenchApp.d.ts.map +0 -1
  226. package/dist/workbench/WorkbenchApp.js +0 -193
  227. package/dist/workbench/cloudflare-worker/README.md +0 -31
  228. package/dist/workbench/cloudflare-worker/public/workbench.css +0 -1614
  229. package/dist/workbench/cloudflare-worker/public/workbench.js +0 -77
  230. package/dist/workbench/cloudflare-worker/worker.js +0 -40
  231. package/dist/workbench/cloudflare-worker/wrangler.toml +0 -10
  232. package/dist/workbench/index.d.ts +0 -10
  233. package/dist/workbench/index.d.ts.map +0 -1
  234. package/dist/workbench/index.js +0 -44
  235. package/dist/workbench/workbench.css +0 -1614
  236. package/dist/workbench/workbench.js +0 -77
@@ -1,156 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import * as Sentry from '@sentry/node';
4
- import { readProjectConfig } from './config/index.js';
5
- /**
6
- * Set Sentry scope with the given context. Only sets keys that are present and have valid values.
7
- * Uses setUser/setContext for error events and setAttributes on the current scope so values
8
- * (project, org, embeddable, branch, versionNumber) are included in log events.
9
- */
10
- export function setSentryContext(ctx) {
11
- if (ctx.user?.id) {
12
- Sentry.setUser({
13
- id: ctx.user.id,
14
- email: ctx.user.email ?? undefined,
15
- });
16
- }
17
- if (ctx.project?.id) {
18
- Sentry.setContext('project', {
19
- id: ctx.project.id,
20
- title: ctx.project.title ?? undefined,
21
- });
22
- }
23
- if (ctx.org?.id) {
24
- Sentry.setContext('org', {
25
- id: ctx.org.id,
26
- title: ctx.org.title ?? undefined,
27
- });
28
- }
29
- if (ctx.embeddable?.id) {
30
- Sentry.setContext('embeddable', {
31
- id: ctx.embeddable.id,
32
- title: ctx.embeddable.title ?? undefined,
33
- });
34
- }
35
- if (ctx.branch?.id) {
36
- Sentry.setContext('branch', {
37
- id: ctx.branch.id,
38
- name: ctx.branch.name ?? undefined,
39
- });
40
- }
41
- if (ctx.versionNumber != null && !isNaN(ctx.versionNumber)) {
42
- Sentry.setContext('version', { versionNumber: ctx.versionNumber });
43
- }
44
- // Scope attributes are included in log events; only string/number/boolean are supported
45
- const scope = Sentry.getCurrentScope();
46
- const attrs = {};
47
- if (ctx.project?.id) {
48
- attrs.projectId = ctx.project.id;
49
- if (ctx.project.title != null)
50
- attrs.projectTitle = String(ctx.project.title);
51
- }
52
- if (ctx.org?.id) {
53
- attrs.orgId = ctx.org.id;
54
- if (ctx.org.title != null)
55
- attrs.orgTitle = String(ctx.org.title);
56
- }
57
- if (ctx.embeddable?.id) {
58
- attrs.embeddableId = ctx.embeddable.id;
59
- if (ctx.embeddable.title != null)
60
- attrs.embeddableTitle = String(ctx.embeddable.title);
61
- }
62
- if (ctx.branch?.id) {
63
- attrs.branchId = ctx.branch.id;
64
- if (ctx.branch.name != null)
65
- attrs.branchName = String(ctx.branch.name);
66
- }
67
- if (ctx.versionNumber != null && !isNaN(ctx.versionNumber)) {
68
- attrs.versionNumber = ctx.versionNumber;
69
- }
70
- if (Object.keys(attrs).length > 0) {
71
- scope.setAttributes(attrs);
72
- }
73
- }
74
- /**
75
- * Return project and org context from embeddables.json when present.
76
- */
77
- export function getSentryContextFromProjectConfig() {
78
- const config = readProjectConfig();
79
- if (!config)
80
- return {};
81
- const out = {};
82
- if (config.project_id) {
83
- out.project = { id: config.project_id, title: config.project_name ?? null };
84
- }
85
- if (config.org_id) {
86
- out.org = { id: config.org_id, title: config.org_title ?? null };
87
- }
88
- return out;
89
- }
90
- /**
91
- * Return embeddable title (from metadata.json), branch and versionNumber (from config.json)
92
- * for embeddables/{embeddableId}/ when present.
93
- */
94
- export function getSentryContextFromEmbeddableConfig(embeddableId) {
95
- const out = {};
96
- const embeddableDir = path.join('embeddables', embeddableId);
97
- // Embeddable title from metadata.json (written by pull)
98
- const metadataPath = path.join(embeddableDir, 'metadata.json');
99
- if (fs.existsSync(metadataPath)) {
100
- try {
101
- const metadata = JSON.parse(fs.readFileSync(metadataPath, 'utf8'));
102
- const title = metadata.title;
103
- if (typeof title === 'string' && title) {
104
- out.embeddable = { id: embeddableId, title };
105
- }
106
- }
107
- catch {
108
- // ignore
109
- }
110
- }
111
- if (!out.embeddable) {
112
- out.embeddable = { id: embeddableId };
113
- }
114
- const configPath = path.join(embeddableDir, 'config.json');
115
- if (!fs.existsSync(configPath))
116
- return out;
117
- try {
118
- const raw = fs.readFileSync(configPath, 'utf8');
119
- const config = JSON.parse(raw);
120
- const branchId = config._branch_id;
121
- if (typeof branchId === 'string' && branchId) {
122
- const branchName = config._branch_name;
123
- out.branch = {
124
- id: branchId,
125
- name: typeof branchName === 'string' ? branchName : null,
126
- };
127
- }
128
- else if (config._version != null) {
129
- // Config was written by pull; no _branch_id means we're on main
130
- out.branch = { id: 'main', name: 'main' };
131
- }
132
- const ver = config._version;
133
- if (typeof ver === 'number' && !isNaN(ver)) {
134
- out.versionNumber = ver;
135
- }
136
- return out;
137
- }
138
- catch {
139
- return out;
140
- }
141
- }
142
- /**
143
- * Set Sentry user from auth when logged in. Call after requireLogin for commands that need user context.
144
- */
145
- export async function setSentryUserFromAuth() {
146
- const { getAuthenticatedSupabaseClient } = await import('./auth/index.js');
147
- const supabase = await getAuthenticatedSupabaseClient();
148
- if (!supabase)
149
- return;
150
- const { data: { user }, } = await supabase.auth.getUser();
151
- if (user?.id) {
152
- setSentryContext({
153
- user: { id: user.id, email: user.email ?? null },
154
- });
155
- }
156
- }
package/dist/stdout.d.ts DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * Write a line to stdout. Use this for all user-facing CLI terminal output.
3
- * Replaces console.log so that user-facing output and observability logging
4
- * (logger.info → Sentry) are clearly distinct in the code.
5
- */
6
- export declare function print(message?: string): void;
7
- /**
8
- * Write a warning line to stdout with a yellow WARN badge.
9
- * Replaces console.warn.
10
- */
11
- export declare function warn(message: string): void;
12
- /**
13
- * Write an error line to stderr with a red ERROR badge.
14
- * Replaces console.error.
15
- */
16
- export declare function error(message: string): void;
17
- //# sourceMappingURL=stdout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdout.d.ts","sourceRoot":"","sources":["../src/stdout.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,OAAO,SAAK,GAAG,IAAI,CAExC;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE3C"}
package/dist/stdout.js DELETED
@@ -1,23 +0,0 @@
1
- import pc from 'picocolors';
2
- /**
3
- * Write a line to stdout. Use this for all user-facing CLI terminal output.
4
- * Replaces console.log so that user-facing output and observability logging
5
- * (logger.info → Sentry) are clearly distinct in the code.
6
- */
7
- export function print(message = '') {
8
- process.stdout.write(message + '\n');
9
- }
10
- /**
11
- * Write a warning line to stdout with a yellow WARN badge.
12
- * Replaces console.warn.
13
- */
14
- export function warn(message) {
15
- process.stdout.write(`${pc.bold(pc.bgYellow(' WARN '))} ${message}\n`);
16
- }
17
- /**
18
- * Write an error line to stderr with a red ERROR badge.
19
- * Replaces console.error.
20
- */
21
- export function error(message) {
22
- process.stderr.write(`${pc.bold(pc.bgRed(' ERROR '))} ${message}\n`);
23
- }