@emailshepherd/cli 0.2.2 → 0.2.4

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/dist/cli.js CHANGED
@@ -8,7 +8,7 @@ import updateNotifier from "update-notifier";
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "@emailshepherd/cli",
11
- version: "0.2.2",
11
+ version: "0.2.4",
12
12
  type: "module",
13
13
  publishConfig: {
14
14
  registry: "https://registry.npmjs.org",
@@ -29,8 +29,9 @@ var package_default = {
29
29
  scripts: {
30
30
  typecheck: "tsc",
31
31
  "build:cli": "tsup",
32
+ "build:types": "dts-bundle-generator -o dist/types.d.ts src/types.ts",
32
33
  "build:dev-ui": "vite build",
33
- build: "pnpm run typecheck && pnpm run build:cli && pnpm run build:dev-ui && cp -r src/templates dist/",
34
+ build: "pnpm run typecheck && pnpm run build:cli && pnpm run build:types && pnpm run build:dev-ui && cp -r src/templates dist/",
34
35
  test: "vitest run",
35
36
  "test:watch": "vitest",
36
37
  prepublishOnly: "pnpm run build"
@@ -50,6 +51,7 @@ var package_default = {
50
51
  "@preact/preset-vite": "^2.10.2",
51
52
  "@types/node": "^24.10.1",
52
53
  "@types/update-notifier": "^6.0.8",
54
+ "dts-bundle-generator": "^9.5.1",
53
55
  msw: "^2.12.7",
54
56
  tsup: "^8.5.1",
55
57
  tsx: "^4.21.0",
package/dist/types.d.ts CHANGED
@@ -1,38 +1,382 @@
1
- import { Component, DesignTokens, RichTextCustomStyle } from '@emailshepherd/api-client';
2
- export { DesignTokens, FieldDefinition, RichTextCustomStyle } from '@emailshepherd/api-client';
1
+ // Generated by dts-bundle-generator v9.5.1
3
2
 
4
- type ComponentDefinition = Omit<Component, "id" | "email_design_system_id" | "created_at" | "updated_at" | "screenshot_url" | "last_updated_by" | "container" | "position">;
5
- type EDSMetadata = {
6
- name: string;
7
- description: string;
8
- design_tokens: DesignTokens;
9
- custom_styles?: RichTextCustomStyle[];
10
- };
11
- type EDSConfig = {
12
- eds_metadata: EDSMetadata;
13
- container_component: ComponentDefinition;
14
- components: ComponentDefinition[];
3
+ /**
4
+ * @nullable
5
+ */
6
+ export type DesignTokens = {
7
+ [key: string]: unknown;
8
+ } | null;
9
+ export interface RichTextCustomStyle {
10
+ style: string;
11
+ name: string;
12
+ label: string;
13
+ }
14
+ export type FieldDefinition = TextFieldDefinition | NumberFieldDefinition | EnumFieldDefinition | BooleanFieldDefinition | UrlFieldDefinition | ImageFieldDefinition | ColorFieldDefinition | RichTextFieldDefinition | CodeFieldDefinition | HorizontalAlignFieldDefinition | VerticalAlignFieldDefinition;
15
+ export type TextFieldDefinitionType = typeof TextFieldDefinitionType[keyof typeof TextFieldDefinitionType];
16
+ declare const TextFieldDefinitionType: {
17
+ readonly text: "text";
18
+ };
19
+ export type TextFieldDefinitionValidations = {
20
+ min_length?: number;
21
+ max_length?: number;
22
+ must_not_be_blank?: boolean;
23
+ must_not_be_default?: boolean;
24
+ };
25
+ export interface TextFieldDefinition {
26
+ type: TextFieldDefinitionType;
27
+ label: string;
28
+ /** @nullable */
29
+ group?: string | null;
30
+ liquid_variable: string;
31
+ visible_if?: string;
32
+ default_value: string;
33
+ validations?: TextFieldDefinitionValidations;
34
+ hint?: string;
35
+ hidden_in_editor?: boolean;
36
+ hidden_from_ai?: boolean;
37
+ /** @nullable */
38
+ feed_field_name?: string | null;
39
+ }
40
+ export type NumberFieldDefinitionType = typeof NumberFieldDefinitionType[keyof typeof NumberFieldDefinitionType];
41
+ declare const NumberFieldDefinitionType: {
42
+ readonly number: "number";
43
+ };
44
+ export type NumberFieldDefinitionValidations = {
45
+ min?: number;
46
+ max?: number;
47
+ };
48
+ export interface NumberFieldDefinition {
49
+ type: NumberFieldDefinitionType;
50
+ label: string;
51
+ /** @nullable */
52
+ group?: string | null;
53
+ liquid_variable: string;
54
+ visible_if?: string;
55
+ default_value: number;
56
+ validations?: NumberFieldDefinitionValidations;
57
+ hint?: string;
58
+ hidden_in_editor?: boolean;
59
+ hidden_from_ai?: boolean;
60
+ /** @nullable */
61
+ feed_field_name?: string | null;
62
+ }
63
+ export type EnumFieldDefinitionType = typeof EnumFieldDefinitionType[keyof typeof EnumFieldDefinitionType];
64
+ declare const EnumFieldDefinitionType: {
65
+ readonly enum: "enum";
66
+ };
67
+ export type EnumFieldDefinitionValidations = {
68
+ [key: string]: unknown;
69
+ };
70
+ export type EnumFieldDefinitionOptionsItem = {
71
+ label: string;
72
+ value: string;
73
+ };
74
+ export interface EnumFieldDefinition {
75
+ type: EnumFieldDefinitionType;
76
+ label: string;
77
+ /** @nullable */
78
+ group?: string | null;
79
+ liquid_variable: string;
80
+ visible_if?: string;
81
+ default_value: string;
82
+ validations?: EnumFieldDefinitionValidations;
83
+ options: EnumFieldDefinitionOptionsItem[];
84
+ hint?: string;
85
+ hidden_in_editor?: boolean;
86
+ hidden_from_ai?: boolean;
87
+ /** @nullable */
88
+ feed_field_name?: string | null;
89
+ }
90
+ export type BooleanFieldDefinitionType = typeof BooleanFieldDefinitionType[keyof typeof BooleanFieldDefinitionType];
91
+ declare const BooleanFieldDefinitionType: {
92
+ readonly boolean: "boolean";
93
+ };
94
+ export type BooleanFieldDefinitionValidations = {
95
+ [key: string]: unknown;
96
+ };
97
+ export interface BooleanFieldDefinition {
98
+ type: BooleanFieldDefinitionType;
99
+ label: string;
100
+ /** @nullable */
101
+ group?: string | null;
102
+ liquid_variable: string;
103
+ visible_if?: string;
104
+ default_value: boolean;
105
+ validations?: BooleanFieldDefinitionValidations;
106
+ hint?: string;
107
+ hidden_in_editor?: boolean;
108
+ hidden_from_ai?: boolean;
109
+ /** @nullable */
110
+ feed_field_name?: string | null;
111
+ }
112
+ export type UrlFieldDefinitionType = typeof UrlFieldDefinitionType[keyof typeof UrlFieldDefinitionType];
113
+ declare const UrlFieldDefinitionType: {
114
+ readonly url: "url";
115
+ };
116
+ export type UrlFieldDefinitionValidations = {
117
+ must_not_be_blank?: boolean;
118
+ must_not_be_default?: boolean;
119
+ };
120
+ export interface UrlFieldDefinition {
121
+ type: UrlFieldDefinitionType;
122
+ label: string;
123
+ /** @nullable */
124
+ group?: string | null;
125
+ liquid_variable: string;
126
+ visible_if?: string;
127
+ default_value: string;
128
+ validations?: UrlFieldDefinitionValidations;
129
+ hint?: string;
130
+ hidden_in_editor?: boolean;
131
+ hidden_from_ai?: boolean;
132
+ /** @nullable */
133
+ feed_field_name?: string | null;
134
+ /** @nullable */
135
+ skip_link_tracking?: boolean | null;
136
+ }
137
+ export type ImageFieldDefinitionType = typeof ImageFieldDefinitionType[keyof typeof ImageFieldDefinitionType];
138
+ declare const ImageFieldDefinitionType: {
139
+ readonly image: "image";
140
+ };
141
+ export type ImageFieldDefinitionValidations = {
142
+ must_not_be_blank?: boolean;
143
+ must_not_be_default?: boolean;
144
+ };
145
+ export interface ImageFieldDefinition {
146
+ type: ImageFieldDefinitionType;
147
+ label: string;
148
+ /** @nullable */
149
+ group?: string | null;
150
+ liquid_variable: string;
151
+ visible_if?: string;
152
+ default_value: string;
153
+ validations?: ImageFieldDefinitionValidations;
154
+ hint?: string;
155
+ hidden_in_editor?: boolean;
156
+ hidden_from_ai?: boolean;
157
+ /** @nullable */
158
+ feed_field_name?: string | null;
159
+ }
160
+ export type ColorFieldDefinitionType = typeof ColorFieldDefinitionType[keyof typeof ColorFieldDefinitionType];
161
+ declare const ColorFieldDefinitionType: {
162
+ readonly color: "color";
163
+ };
164
+ export type ColorFieldDefinitionValidations = {
165
+ [key: string]: unknown;
166
+ };
167
+ export interface ColorFieldDefinition {
168
+ type: ColorFieldDefinitionType;
169
+ label: string;
170
+ /** @nullable */
171
+ group?: string | null;
172
+ liquid_variable: string;
173
+ visible_if?: string;
174
+ default_value: string;
175
+ validations?: ColorFieldDefinitionValidations;
176
+ hint?: string;
177
+ hidden_in_editor?: boolean;
178
+ hidden_from_ai?: boolean;
179
+ /** @nullable */
180
+ feed_field_name?: string | null;
181
+ }
182
+ export type RichTextFieldDefinitionType = typeof RichTextFieldDefinitionType[keyof typeof RichTextFieldDefinitionType];
183
+ declare const RichTextFieldDefinitionType: {
184
+ readonly rich_text: "rich_text";
185
+ };
186
+ export type RichTextFieldDefinitionValidations = {
187
+ max_content_length?: number;
188
+ min_content_length?: number;
189
+ must_not_be_blank?: boolean;
190
+ must_not_be_default?: boolean;
191
+ };
192
+ export type RichTextFieldDefinitionMarksBold = {
193
+ enabled: boolean;
194
+ };
195
+ export type RichTextFieldDefinitionMarksItalic = {
196
+ enabled: boolean;
197
+ };
198
+ export type RichTextFieldDefinitionMarksLink = {
199
+ enabled: boolean;
200
+ };
201
+ export type RichTextFieldDefinitionMarksBulletList = {
202
+ enabled: boolean;
203
+ };
204
+ export type RichTextFieldDefinitionMarksNumberedList = {
205
+ enabled: boolean;
206
+ };
207
+ /**
208
+ * @nullable
209
+ */
210
+ export type RichTextFieldDefinitionMarks = {
211
+ bold: RichTextFieldDefinitionMarksBold;
212
+ italic: RichTextFieldDefinitionMarksItalic;
213
+ link: RichTextFieldDefinitionMarksLink;
214
+ bullet_list: RichTextFieldDefinitionMarksBulletList;
215
+ numbered_list: RichTextFieldDefinitionMarksNumberedList;
216
+ } | null;
217
+ export interface RichTextFieldDefinition {
218
+ type: RichTextFieldDefinitionType;
219
+ label: string;
220
+ /** @nullable */
221
+ group?: string | null;
222
+ liquid_variable: string;
223
+ visible_if?: string;
224
+ default_value: string;
225
+ validations?: RichTextFieldDefinitionValidations;
226
+ hint?: string;
227
+ hidden_in_editor?: boolean;
228
+ hidden_from_ai?: boolean;
229
+ /** @nullable */
230
+ feed_field_name?: string | null;
231
+ /** @nullable */
232
+ marks: RichTextFieldDefinitionMarks;
233
+ /** @nullable */
234
+ custom_styles_names?: string[] | null;
235
+ }
236
+ export type CodeFieldDefinitionType = typeof CodeFieldDefinitionType[keyof typeof CodeFieldDefinitionType];
237
+ declare const CodeFieldDefinitionType: {
238
+ readonly code: "code";
239
+ };
240
+ export type CodeFieldDefinitionValidations = {
241
+ must_not_be_blank?: boolean;
242
+ must_not_be_default?: boolean;
243
+ };
244
+ export interface CodeFieldDefinition {
245
+ type: CodeFieldDefinitionType;
246
+ label: string;
247
+ /** @nullable */
248
+ group?: string | null;
249
+ liquid_variable: string;
250
+ visible_if?: string;
251
+ default_value: string;
252
+ validations?: CodeFieldDefinitionValidations;
253
+ hint?: string;
254
+ hidden_in_editor?: boolean;
255
+ hidden_from_ai?: boolean;
256
+ /** @nullable */
257
+ feed_field_name?: string | null;
258
+ }
259
+ export type HorizontalAlignFieldDefinitionType = typeof HorizontalAlignFieldDefinitionType[keyof typeof HorizontalAlignFieldDefinitionType];
260
+ declare const HorizontalAlignFieldDefinitionType: {
261
+ readonly horizontal_align: "horizontal_align";
262
+ };
263
+ export type HorizontalAlignFieldDefinitionValidations = {
264
+ [key: string]: unknown;
265
+ };
266
+ export type HorizontalAlignFieldDefinitionOptionsItem = typeof HorizontalAlignFieldDefinitionOptionsItem[keyof typeof HorizontalAlignFieldDefinitionOptionsItem];
267
+ declare const HorizontalAlignFieldDefinitionOptionsItem: {
268
+ readonly left: "left";
269
+ readonly center: "center";
270
+ readonly right: "right";
271
+ };
272
+ export interface HorizontalAlignFieldDefinition {
273
+ type: HorizontalAlignFieldDefinitionType;
274
+ label: string;
275
+ /** @nullable */
276
+ group?: string | null;
277
+ liquid_variable: string;
278
+ visible_if?: string;
279
+ default_value: string;
280
+ validations?: HorizontalAlignFieldDefinitionValidations;
281
+ options: HorizontalAlignFieldDefinitionOptionsItem[];
282
+ hint?: string;
283
+ hidden_in_editor?: boolean;
284
+ hidden_from_ai?: boolean;
285
+ /** @nullable */
286
+ feed_field_name?: string | null;
287
+ }
288
+ export type VerticalAlignFieldDefinitionType = typeof VerticalAlignFieldDefinitionType[keyof typeof VerticalAlignFieldDefinitionType];
289
+ declare const VerticalAlignFieldDefinitionType: {
290
+ readonly vertical_align: "vertical_align";
291
+ };
292
+ export type VerticalAlignFieldDefinitionValidations = {
293
+ [key: string]: unknown;
294
+ };
295
+ export type VerticalAlignFieldDefinitionOptionsItem = typeof VerticalAlignFieldDefinitionOptionsItem[keyof typeof VerticalAlignFieldDefinitionOptionsItem];
296
+ declare const VerticalAlignFieldDefinitionOptionsItem: {
297
+ readonly top: "top";
298
+ readonly middle: "middle";
299
+ readonly bottom: "bottom";
300
+ };
301
+ export interface VerticalAlignFieldDefinition {
302
+ type: VerticalAlignFieldDefinitionType;
303
+ label: string;
304
+ /** @nullable */
305
+ group?: string | null;
306
+ liquid_variable: string;
307
+ visible_if?: string;
308
+ default_value: string;
309
+ validations?: VerticalAlignFieldDefinitionValidations;
310
+ options: VerticalAlignFieldDefinitionOptionsItem[];
311
+ hint?: string;
312
+ hidden_in_editor?: boolean;
313
+ hidden_from_ai?: boolean;
314
+ /** @nullable */
315
+ feed_field_name?: string | null;
316
+ }
317
+ /**
318
+ * @nullable
319
+ */
320
+ export type ComponentLastUpdatedBy = UserReference | null;
321
+ export interface Component {
322
+ name: string;
323
+ label: string;
324
+ /** @nullable */
325
+ description: string | null;
326
+ email_design_system_id: number;
327
+ updated_at: string;
328
+ created_at: string;
329
+ /** @nullable */
330
+ container?: boolean | null;
331
+ template: string;
332
+ field_definitions: FieldDefinition[];
333
+ screenshot_url: string;
334
+ /** @nullable */
335
+ position: number | null;
336
+ /** @nullable */
337
+ last_updated_by: ComponentLastUpdatedBy;
338
+ /** @nullable */
339
+ feed_id: number | null;
340
+ deprecated: boolean;
341
+ }
342
+ export interface UserReference {
343
+ id: number;
344
+ first_name: string;
345
+ last_name: string;
346
+ /** @nullable */
347
+ profile_image_url: string | null;
348
+ }
349
+ export type ComponentDefinition = Omit<Component, "id" | "email_design_system_id" | "created_at" | "updated_at" | "screenshot_url" | "last_updated_by" | "container" | "position">;
350
+ export type EDSMetadata = {
351
+ name: string;
352
+ description: string;
353
+ design_tokens: DesignTokens;
354
+ custom_styles?: RichTextCustomStyle[];
355
+ };
356
+ export type EDSConfig = {
357
+ eds_metadata: EDSMetadata;
358
+ container_component: ComponentDefinition;
359
+ components: ComponentDefinition[];
15
360
  };
16
-
17
361
  /**
18
362
  * Define an Email Design System configuration.
19
363
  * Use this in your src/eds.ts file.
20
364
  */
21
- declare function defineEDS(config: EDSConfig): EDSConfig;
365
+ export declare function defineEDS(config: EDSConfig): EDSConfig;
22
366
  /**
23
367
  * Define a component with its template.
24
368
  * Use this in your src/components/{name}/index.ts file.
25
369
  */
26
- declare function defineComponent(config: ComponentDefinition): ComponentDefinition;
370
+ export declare function defineComponent(config: ComponentDefinition): ComponentDefinition;
27
371
  /**
28
372
  * Define design tokens for your Email Design System.
29
373
  * Use this in your src/design_tokens.ts file.
30
374
  */
31
- declare function defineDesignTokens(tokens: DesignTokens): DesignTokens;
375
+ export declare function defineDesignTokens(tokens: DesignTokens): DesignTokens;
32
376
  /**
33
377
  * Define custom styles for rich text fields.
34
378
  * Use this in your src/custom_styles.ts file.
35
379
  */
36
- declare function defineCustomStyles(styles: RichTextCustomStyle[]): RichTextCustomStyle[];
380
+ export declare function defineCustomStyles(styles: RichTextCustomStyle[]): RichTextCustomStyle[];
37
381
 
38
- export { type ComponentDefinition, type EDSConfig, type EDSMetadata, defineComponent, defineCustomStyles, defineDesignTokens, defineEDS };
382
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emailshepherd/cli",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org",
@@ -32,6 +32,7 @@
32
32
  "@preact/preset-vite": "^2.10.2",
33
33
  "@types/node": "^24.10.1",
34
34
  "@types/update-notifier": "^6.0.8",
35
+ "dts-bundle-generator": "^9.5.1",
35
36
  "msw": "^2.12.7",
36
37
  "tsup": "^8.5.1",
37
38
  "tsx": "^4.21.0",
@@ -42,8 +43,9 @@
42
43
  "scripts": {
43
44
  "typecheck": "tsc",
44
45
  "build:cli": "tsup",
46
+ "build:types": "dts-bundle-generator -o dist/types.d.ts src/types.ts",
45
47
  "build:dev-ui": "vite build",
46
- "build": "pnpm run typecheck && pnpm run build:cli && pnpm run build:dev-ui && cp -r src/templates dist/",
48
+ "build": "pnpm run typecheck && pnpm run build:cli && pnpm run build:types && pnpm run build:dev-ui && cp -r src/templates dist/",
47
49
  "test": "vitest run",
48
50
  "test:watch": "vitest"
49
51
  }