@embeddables/cli 0.7.13 → 0.7.14
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/.prompts/custom/build-funnel.md +1 -1
- package/.prompts/embeddables-cli.md +9 -2
- package/package.json +1 -1
- package/dist/auth/index.d.ts +0 -43
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -102
- package/dist/cli.d.ts +0 -2
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -174
- package/dist/commands/branch.d.ts +0 -4
- package/dist/commands/branch.d.ts.map +0 -1
- package/dist/commands/branch.js +0 -68
- package/dist/commands/build-workbench.d.ts +0 -5
- package/dist/commands/build-workbench.d.ts.map +0 -1
- package/dist/commands/build-workbench.js +0 -128
- package/dist/commands/build.d.ts +0 -8
- package/dist/commands/build.d.ts.map +0 -1
- package/dist/commands/build.js +0 -55
- package/dist/commands/dev.d.ts +0 -12
- package/dist/commands/dev.d.ts.map +0 -1
- package/dist/commands/dev.js +0 -221
- package/dist/commands/experiments-connect.d.ts +0 -6
- package/dist/commands/experiments-connect.d.ts.map +0 -1
- package/dist/commands/experiments-connect.js +0 -140
- package/dist/commands/init.d.ts +0 -5
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -327
- package/dist/commands/login.d.ts +0 -2
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -122
- package/dist/commands/logout.d.ts +0 -2
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -22
- package/dist/commands/pull.d.ts +0 -14
- package/dist/commands/pull.d.ts.map +0 -1
- package/dist/commands/pull.js +0 -383
- package/dist/commands/save.d.ts +0 -30
- package/dist/commands/save.d.ts.map +0 -1
- package/dist/commands/save.js +0 -591
- package/dist/commands/upgrade.d.ts +0 -2
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -51
- package/dist/compiler/errors.d.ts +0 -20
- package/dist/compiler/errors.d.ts.map +0 -1
- package/dist/compiler/errors.js +0 -35
- package/dist/compiler/evalStatic.d.ts +0 -3
- package/dist/compiler/evalStatic.d.ts.map +0 -1
- package/dist/compiler/evalStatic.js +0 -57
- package/dist/compiler/flatten.js +0 -1
- package/dist/compiler/helpers/duplicateIds.d.ts +0 -9
- package/dist/compiler/helpers/duplicateIds.d.ts.map +0 -1
- package/dist/compiler/helpers/duplicateIds.js +0 -71
- package/dist/compiler/helpers/numericLeadingKeys.d.ts +0 -8
- package/dist/compiler/helpers/numericLeadingKeys.d.ts.map +0 -1
- package/dist/compiler/helpers/numericLeadingKeys.js +0 -17
- package/dist/compiler/index.d.ts +0 -18
- package/dist/compiler/index.d.ts.map +0 -1
- package/dist/compiler/index.js +0 -1245
- package/dist/compiler/parsePage.d.ts +0 -15
- package/dist/compiler/parsePage.d.ts.map +0 -1
- package/dist/compiler/parsePage.js +0 -631
- package/dist/compiler/registry.d.ts +0 -4
- package/dist/compiler/registry.d.ts.map +0 -1
- package/dist/compiler/registry.js +0 -44
- package/dist/compiler/reverse.d.ts +0 -23
- package/dist/compiler/reverse.d.ts.map +0 -1
- package/dist/compiler/reverse.js +0 -1875
- package/dist/compiler/types.d.ts +0 -21
- package/dist/compiler/types.d.ts.map +0 -1
- package/dist/compiler/types.js +0 -1
- package/dist/components/index.d.ts +0 -21
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -21
- package/dist/components/primitives/BaseComponent.d.ts +0 -32
- package/dist/components/primitives/BaseComponent.d.ts.map +0 -1
- package/dist/components/primitives/BaseComponent.js +0 -26
- package/dist/components/primitives/BookMeeting.d.ts +0 -18
- package/dist/components/primitives/BookMeeting.d.ts.map +0 -1
- package/dist/components/primitives/BookMeeting.js +0 -5
- package/dist/components/primitives/Chart.d.ts +0 -41
- package/dist/components/primitives/Chart.d.ts.map +0 -1
- package/dist/components/primitives/Chart.js +0 -5
- package/dist/components/primitives/Container.d.ts +0 -8
- package/dist/components/primitives/Container.d.ts.map +0 -1
- package/dist/components/primitives/Container.js +0 -5
- package/dist/components/primitives/CustomButton.d.ts +0 -37
- package/dist/components/primitives/CustomButton.d.ts.map +0 -1
- package/dist/components/primitives/CustomButton.js +0 -10
- package/dist/components/primitives/CustomHTML.d.ts +0 -8
- package/dist/components/primitives/CustomHTML.d.ts.map +0 -1
- package/dist/components/primitives/CustomHTML.js +0 -5
- package/dist/components/primitives/FileUpload.d.ts +0 -18
- package/dist/components/primitives/FileUpload.d.ts.map +0 -1
- package/dist/components/primitives/FileUpload.js +0 -16
- package/dist/components/primitives/InputBox.d.ts +0 -34
- package/dist/components/primitives/InputBox.d.ts.map +0 -1
- package/dist/components/primitives/InputBox.js +0 -25
- package/dist/components/primitives/Lottie.d.ts +0 -11
- package/dist/components/primitives/Lottie.d.ts.map +0 -1
- package/dist/components/primitives/Lottie.js +0 -5
- package/dist/components/primitives/MediaEmbed.d.ts +0 -13
- package/dist/components/primitives/MediaEmbed.d.ts.map +0 -1
- package/dist/components/primitives/MediaEmbed.js +0 -6
- package/dist/components/primitives/MediaImage.d.ts +0 -8
- package/dist/components/primitives/MediaImage.d.ts.map +0 -1
- package/dist/components/primitives/MediaImage.js +0 -5
- package/dist/components/primitives/OptionSelector.d.ts +0 -35
- package/dist/components/primitives/OptionSelector.d.ts.map +0 -1
- package/dist/components/primitives/OptionSelector.js +0 -8
- package/dist/components/primitives/PaypalCheckout.d.ts +0 -25
- package/dist/components/primitives/PaypalCheckout.d.ts.map +0 -1
- package/dist/components/primitives/PaypalCheckout.js +0 -5
- package/dist/components/primitives/PlainText.d.ts +0 -6
- package/dist/components/primitives/PlainText.d.ts.map +0 -1
- package/dist/components/primitives/PlainText.js +0 -5
- package/dist/components/primitives/ProgressBar.d.ts +0 -15
- package/dist/components/primitives/ProgressBar.d.ts.map +0 -1
- package/dist/components/primitives/ProgressBar.js +0 -5
- package/dist/components/primitives/RichText.d.ts +0 -6
- package/dist/components/primitives/RichText.d.ts.map +0 -1
- package/dist/components/primitives/RichText.js +0 -5
- package/dist/components/primitives/RichTextMarkdown.d.ts +0 -6
- package/dist/components/primitives/RichTextMarkdown.d.ts.map +0 -1
- package/dist/components/primitives/RichTextMarkdown.js +0 -5
- package/dist/components/primitives/Rive.d.ts +0 -16
- package/dist/components/primitives/Rive.d.ts.map +0 -1
- package/dist/components/primitives/Rive.js +0 -8
- package/dist/components/primitives/StripeCheckout.d.ts +0 -52
- package/dist/components/primitives/StripeCheckout.d.ts.map +0 -1
- package/dist/components/primitives/StripeCheckout.js +0 -5
- package/dist/components/primitives/StripeCheckout2.d.ts +0 -30
- package/dist/components/primitives/StripeCheckout2.d.ts.map +0 -1
- package/dist/components/primitives/StripeCheckout2.js +0 -7
- package/dist/config/index.d.ts +0 -23
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -42
- package/dist/constants.d.ts +0 -9
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -9
- package/dist/helpers/TEMP helpers file.d.ts +0 -1
- package/dist/helpers/TEMP helpers file.d.ts.map +0 -1
- package/dist/helpers/TEMP helpers file.js +0 -1
- package/dist/helpers/dates.d.ts +0 -5
- package/dist/helpers/dates.d.ts.map +0 -1
- package/dist/helpers/dates.js +0 -7
- package/dist/helpers/json.d.ts +0 -47
- package/dist/helpers/json.d.ts.map +0 -1
- package/dist/helpers/json.js +0 -622
- package/dist/helpers/utils.d.ts +0 -13
- package/dist/helpers/utils.d.ts.map +0 -1
- package/dist/helpers/utils.js +0 -28
- package/dist/logger.d.ts +0 -11
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -21
- package/dist/prompts/branches.d.ts +0 -20
- package/dist/prompts/branches.d.ts.map +0 -1
- package/dist/prompts/branches.js +0 -90
- package/dist/prompts/embeddables.d.ts +0 -43
- package/dist/prompts/embeddables.d.ts.map +0 -1
- package/dist/prompts/embeddables.js +0 -198
- package/dist/prompts/experiments.d.ts +0 -28
- package/dist/prompts/experiments.d.ts.map +0 -1
- package/dist/prompts/experiments.js +0 -87
- package/dist/prompts/index.d.ts +0 -11
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/index.js +0 -6
- package/dist/prompts/projects.d.ts +0 -22
- package/dist/prompts/projects.d.ts.map +0 -1
- package/dist/prompts/projects.js +0 -86
- package/dist/prompts/versions.d.ts +0 -18
- package/dist/prompts/versions.d.ts.map +0 -1
- package/dist/prompts/versions.js +0 -99
- package/dist/proxy/injectApiInterceptor.d.ts +0 -6
- package/dist/proxy/injectApiInterceptor.d.ts.map +0 -1
- package/dist/proxy/injectApiInterceptor.js +0 -66
- package/dist/proxy/injectReload.d.ts +0 -2
- package/dist/proxy/injectReload.d.ts.map +0 -1
- package/dist/proxy/injectReload.js +0 -14
- package/dist/proxy/injectWorkbench.d.ts +0 -5
- package/dist/proxy/injectWorkbench.d.ts.map +0 -1
- package/dist/proxy/injectWorkbench.js +0 -22
- package/dist/proxy/server.d.ts +0 -11
- package/dist/proxy/server.d.ts.map +0 -1
- package/dist/proxy/server.js +0 -316
- package/dist/proxy/sse.d.ts +0 -5
- package/dist/proxy/sse.d.ts.map +0 -1
- package/dist/proxy/sse.js +0 -17
- package/dist/sentry-context.d.ts +0 -48
- package/dist/sentry-context.d.ts.map +0 -1
- package/dist/sentry-context.js +0 -156
- package/dist/stdout.d.ts +0 -17
- package/dist/stdout.d.ts.map +0 -1
- package/dist/stdout.js +0 -23
- package/dist/types-builder.d.ts +0 -800
- package/dist/types-builder.d.ts.map +0 -1
- package/dist/types-builder.js +0 -20
- package/dist/workbench/ActionsPanel.d.ts +0 -6
- package/dist/workbench/ActionsPanel.d.ts.map +0 -1
- package/dist/workbench/ActionsPanel.js +0 -47
- package/dist/workbench/AutofillPanel.d.ts +0 -6
- package/dist/workbench/AutofillPanel.d.ts.map +0 -1
- package/dist/workbench/AutofillPanel.js +0 -543
- package/dist/workbench/ComputedFieldsPanel.d.ts +0 -6
- package/dist/workbench/ComputedFieldsPanel.d.ts.map +0 -1
- package/dist/workbench/ComputedFieldsPanel.js +0 -31
- package/dist/workbench/ExperimentsPanel.d.ts +0 -6
- package/dist/workbench/ExperimentsPanel.d.ts.map +0 -1
- package/dist/workbench/ExperimentsPanel.js +0 -182
- package/dist/workbench/FieldEditorPanel.d.ts +0 -9
- package/dist/workbench/FieldEditorPanel.d.ts.map +0 -1
- package/dist/workbench/FieldEditorPanel.js +0 -650
- package/dist/workbench/InspectorPanel.d.ts +0 -6
- package/dist/workbench/InspectorPanel.d.ts.map +0 -1
- package/dist/workbench/InspectorPanel.js +0 -341
- package/dist/workbench/PageNavigator.d.ts +0 -6
- package/dist/workbench/PageNavigator.d.ts.map +0 -1
- package/dist/workbench/PageNavigator.js +0 -123
- package/dist/workbench/SchemaPanel.d.ts +0 -6
- package/dist/workbench/SchemaPanel.d.ts.map +0 -1
- package/dist/workbench/SchemaPanel.js +0 -222
- package/dist/workbench/UserDataPanel.d.ts +0 -6
- package/dist/workbench/UserDataPanel.d.ts.map +0 -1
- package/dist/workbench/UserDataPanel.js +0 -350
- package/dist/workbench/WorkbenchApp.d.ts +0 -7
- package/dist/workbench/WorkbenchApp.d.ts.map +0 -1
- package/dist/workbench/WorkbenchApp.js +0 -193
- package/dist/workbench/cloudflare-worker/README.md +0 -31
- package/dist/workbench/cloudflare-worker/public/workbench.css +0 -1614
- package/dist/workbench/cloudflare-worker/public/workbench.js +0 -77
- package/dist/workbench/cloudflare-worker/worker.js +0 -40
- package/dist/workbench/cloudflare-worker/wrangler.toml +0 -10
- package/dist/workbench/index.d.ts +0 -10
- package/dist/workbench/index.d.ts.map +0 -1
- package/dist/workbench/index.js +0 -44
- package/dist/workbench/workbench.css +0 -1614
- package/dist/workbench/workbench.js +0 -77
package/dist/sentry-context.js
DELETED
|
@@ -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
|
package/dist/stdout.d.ts.map
DELETED
|
@@ -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
|
-
}
|