@lamsa/cli 0.0.0-stage → 0.1.1-rc.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.
@@ -0,0 +1,114 @@
1
+ import { z } from "zod";
2
+ import { Browser } from "playwright-core";
3
+ declare const tokenModeSchema: z.ZodEnum<{
4
+ light: "light";
5
+ dark: "dark";
6
+ }>;
7
+ declare const configSchema: z.ZodObject<{
8
+ $schema: z.ZodOptional<z.ZodString>;
9
+ designs: z.ZodDefault<z.ZodArray<z.ZodString>>;
10
+ tokens: z.ZodDefault<z.ZodObject<{
11
+ adapter: z.ZodEnum<{
12
+ "shadcn-tailwind4": "shadcn-tailwind4";
13
+ none: "none";
14
+ }>;
15
+ path: z.ZodOptional<z.ZodString>;
16
+ }, z.core.$strict>>;
17
+ fonts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
18
+ google: z.ZodString;
19
+ }, z.core.$strict>, z.ZodObject<{
20
+ files: z.ZodArray<z.ZodString>;
21
+ }, z.core.$strict>]>>>;
22
+ assetsDir: z.ZodDefault<z.ZodString>;
23
+ commentsDir: z.ZodDefault<z.ZodString>;
24
+ agent: z.ZodDefault<z.ZodObject<{
25
+ command: z.ZodDefault<z.ZodString>;
26
+ args: z.ZodDefault<z.ZodArray<z.ZodString>>;
27
+ }, z.core.$strict>>;
28
+ }, z.core.$strict>;
29
+ type TokenMode = z.infer<typeof tokenModeSchema>;
30
+ type LamsaConfig = z.infer<typeof configSchema>;
31
+ type TokenKind = "color" | "radius" | "font" | "spacing" | "shadow" | "text" | "other";
32
+ interface Token {
33
+ /** Reference path used in designs, e.g. `color.primary` for `{color.primary}`. */
34
+ path: string;
35
+ /** CSS expression substituted where the token is used, e.g. `var(--primary)`. */
36
+ css: string;
37
+ kind: TokenKind;
38
+ /** Resolved values for display and lint matching. */
39
+ values: {
40
+ light: string;
41
+ dark?: string;
42
+ };
43
+ /** From the framework's built-in theme (e.g. Tailwind's palette) rather than the project's own CSS. */
44
+ builtin?: boolean;
45
+ }
46
+ interface TokenSet {
47
+ adapter: string;
48
+ source?: string;
49
+ tokens: Record<string, Token>;
50
+ /** Variable definitions (a `:root` block and a `.dark` block), then the app's `@keyframes`. */
51
+ css: string;
52
+ /** Names of the `@keyframes` in `css`, usable in `animation` without defining them in a design file. */
53
+ keyframes?: string[];
54
+ }
55
+ interface LoadedFile {
56
+ /** Repo-relative path with forward slashes. */
57
+ path: string;
58
+ /** Parsed JSON as found on disk; may not satisfy the schema yet. */
59
+ raw: unknown;
60
+ /** Set when the file is not valid JSON. */
61
+ parseError?: string;
62
+ }
63
+ interface Project {
64
+ root: string;
65
+ config: LamsaConfig;
66
+ files: Map<string, LoadedFile>;
67
+ }
68
+ interface FontSetup {
69
+ css: string;
70
+ links: string[];
71
+ }
72
+ interface Workspace {
73
+ project: Project;
74
+ tokens: TokenSet;
75
+ fonts: FontSetup;
76
+ }
77
+ export declare function openWorkspace(root?: string): Promise<Workspace>;
78
+ /** Layers to outline in one colour on a second, marked copy of a render. */
79
+ interface Mark {
80
+ ids: string[];
81
+ color: string;
82
+ }
83
+ interface RenderedFrame {
84
+ id: string;
85
+ /** With `marks`: the copy with the marked layers outlined. */
86
+ markedPath?: string;
87
+ name?: string;
88
+ path: string;
89
+ width: number;
90
+ height: number;
91
+ mode: TokenMode;
92
+ missingTokens: string[];
93
+ missingIcons: string[];
94
+ /** With `animate`: the moments captured, in ms. */
95
+ times?: number[];
96
+ }
97
+ export declare function launchBrowser(log?: (message: string) => void): Promise<Browser>;
98
+ export declare function renderFrames({ workspace, ids, outDir, scale, mode, naming, log, animate, state, marks, markedNaming }: {
99
+ workspace: Workspace;
100
+ ids: string[];
101
+ outDir: string;
102
+ scale?: number;
103
+ mode?: TokenMode;
104
+ naming: (id: string) => string;
105
+ log?: (message: string) => void;
106
+ /** Capture this many moments of the frame's motion into one strip image. */
107
+ animate?: number;
108
+ /** Put every node into this state first: hover, press, focus, or a `data-state` value. */
109
+ state?: string;
110
+ /** Per frame, layers to outline in a second copy of the render, named by `markedNaming`. */
111
+ marks?: Record<string, Mark[]>;
112
+ markedNaming?: (id: string) => string;
113
+ }): Promise<RenderedFrame[]>;
114
+ export type { RenderedFrame, Workspace };
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export { t as launchBrowser, r as openWorkspace, n as renderFrames } from "./render-CiFXTSpf.js";