import { Diagnostic, Driver, ParseFileReport, BuildInfoArtifact, NodeDriver } from '@pandacss/compiler'; import { UsageReport } from '@pandacss/compiler-shared'; /** * Minimal, dependency-free stand-in for the slice of zod the CLI actually used: * optional boolean/string/enum/union fields on a flat object, with `.extend`/ * `.omit`/`.pick` and a `safeParse` that reports issues shaped like zod's. * * Every flag is optional (missing/undefined always passes) — the CLI never had * a required flag, so that case isn't modeled. */ interface Issue { path: [string]; code: 'invalid_type' | 'invalid_value'; message: string; values?: readonly unknown[]; } type ParseResult = { success: true; data: T; } | { success: false; error: { issues: Issue[]; }; }; type Field = { kind: 'boolean'; } | { kind: 'string'; } | { kind: 'stringOrNumber'; } | { kind: 'stringOrArray'; } | { kind: 'enum'; values: readonly string[]; }; type FieldValue = F extends { kind: 'boolean'; } ? boolean : F extends { kind: 'string'; } ? string : F extends { kind: 'stringOrNumber'; } ? string | number : F extends { kind: 'stringOrArray'; } ? string | string[] : F extends { kind: 'enum'; values: infer V; } ? V extends readonly (infer U)[] ? U : never : never; type Shape = Record; type Infer = { [K in keyof S]?: FieldValue; }; type EnumValues = F extends { kind: 'enum'; values: infer V; } ? V extends readonly (infer U)[] ? U : never : never; declare class FlagsSchema { readonly shape: S; constructor(shape: S); extend(shape: S2): FlagsSchema & S2>; omit(keys: Record): FlagsSchema>; pick(keys: Record): FlagsSchema>; safeParse(input: unknown): ParseResult>; } type FlagsInfer> = T extends FlagsSchema ? Infer : never; declare enum ExitCode { Success = 0, Failed = 1, UsageError = 2, InternalError = 3 } interface CliResult { ok: boolean; command: string; exitCode: ExitCode; durationMs: number; timings?: Record; diagnostics: Diagnostic[]; } declare const logLevelSchema: { kind: "enum"; values: readonly ["silent", "error", "warn", "info", "debug"]; }; declare const commonFlagsSchema: FlagsSchema<{ cwd: { kind: "string"; }; config: { kind: "string"; }; include: { kind: "stringOrArray"; }; watch: { kind: "boolean"; }; json: { kind: "boolean"; }; format: { kind: "enum"; values: readonly ["human", "pretty", "json", "github"]; }; logLevel: { kind: "enum"; values: readonly ["silent", "error", "warn", "info", "debug"]; }; maxWarnings: { kind: "stringOrNumber"; }; logfile: { kind: "string"; }; noColor: { kind: "boolean"; }; profile: { kind: "boolean"; }; trace: { kind: "boolean"; }; traceOutput: { kind: "enum"; values: ("fmt" | "chrome-json")[]; }; traceFile: { kind: "string"; }; watchDebounce: { kind: "stringOrNumber"; }; }>; declare const codegenFlagsSchema: FlagsSchema & { outdir: { kind: "string"; }; clean: { kind: "boolean"; }; check: { kind: "boolean"; }; }>; declare const cssgenFlagsSchema: FlagsSchema & { outfile: { kind: "string"; }; splitting: { kind: "boolean"; }; check: { kind: "boolean"; }; minimal: { kind: "boolean"; }; minify: { kind: "boolean"; }; polyfill: { kind: "boolean"; }; }>; declare const buildFlagsSchema: FlagsSchema & { outdir: { kind: "string"; }; outfile: { kind: "string"; }; splitting: { kind: "boolean"; }; clean: { kind: "boolean"; }; check: { kind: "boolean"; }; polyfill: { kind: "boolean"; }; }>; declare const initFlagsSchema: FlagsSchema, "syntax" | "strictTokens" | "outExtension" | "outdir" | "jsxFramework" | "jsxStyleProps" | "skipPresets" | "force" | "gitignore" | "postcss" | "codegen" | "interactive"> & { force: { kind: "boolean"; }; postcss: { kind: "boolean"; }; gitignore: { kind: "boolean"; }; codegen: { kind: "boolean"; }; outExtension: { kind: "enum"; values: readonly ["ts", "js", "mjs"]; }; outdir: { kind: "string"; }; jsxFramework: { kind: "string"; }; jsxStyleProps: { kind: "enum"; values: readonly ["all", "minimal", "none"]; }; syntax: { kind: "enum"; values: readonly ["template-literal", "object-literal"]; }; strictTokens: { kind: "boolean"; }; skipPresets: { kind: "boolean"; }; interactive: { kind: "boolean"; }; }>; declare const buildinfoFlagsSchema: FlagsSchema, "minify" | "outfile" | "panda"> & { outfile: { kind: "string"; }; panda: { kind: "string"; }; minify: { kind: "boolean"; }; }>; declare const libFlagsSchema: FlagsSchema & { outdir: { kind: "string"; }; panda: { kind: "string"; }; files: { kind: "stringOrArray"; }; minify: { kind: "boolean"; }; }>; declare const doctorFlagsSchema: FlagsSchema, "include">>; declare const debugFlagsSchema: FlagsSchema, "outdir" | "dry" | "onlyConfig"> & { outdir: { kind: "string"; }; dry: { kind: "boolean"; }; onlyConfig: { kind: "boolean"; }; }>; declare const analyzeFlagsSchema: FlagsSchema & { scope: { kind: "enum"; values: readonly ["all", "tokens", "recipes", "utilities", "patterns", "keyframes", "token", "recipe"]; }; outfile: { kind: "string"; }; report: { kind: "string"; }; limit: { kind: "stringOrNumber"; }; ui: { kind: "boolean"; }; uiHost: { kind: "string"; }; uiPort: { kind: "stringOrNumber"; }; }>; type LogLevel = EnumValues; type CommonFlags = FlagsInfer; type CodegenFlags = FlagsInfer; type CssgenFlags = FlagsInfer; type BuildFlags = FlagsInfer; type InitFlags = FlagsInfer; type BuildinfoFlags = FlagsInfer; type LibFlags = FlagsInfer; type DoctorFlags = FlagsInfer; type DebugFlags = FlagsInfer; type AnalyzeScopeRaw = FlagsInfer['scope']; type AnalyzeScope = NonNullable>; type AnalyzeFlags = FlagsInfer; interface BuildinfoResult extends CommandResult { outfile?: string; buildInfo?: BuildInfoArtifact; moduleCount: number; atomCount: number; recipeCount: number; bytes: number; } interface LibResult extends CommandResult { manifestPath?: string; buildInfoPath?: string; presetPath?: string; exportsChanged: boolean; } interface CommandResult extends CliResult { driver?: TDriver; stop?: () => Promise; } interface CodegenResult extends CommandResult { outdir?: string; files: string[]; missing: string[]; stale: string[]; } interface CssgenResult extends CommandResult { outfile?: string; parsed: ParseFileReport[]; cssBytes: number; diagnosticCount: number; missing: string[]; stale: string[]; } interface BuildResult extends CommandResult { outdir?: string; outfile?: string; files: string[]; parsed: ParseFileReport[]; cssBytes: number; diagnosticCount: number; missing: string[]; stale: string[]; } interface AnalyzeResult extends CommandResult, UsageReport { scope: AnalyzeScope; report?: string; ui?: string; } interface DebugResult extends CommandResult { outdir?: string; /** Debug files written (or, in `--dry`, the files that would be written). */ files: string[]; sourceCount: number; } interface InitResult extends CommandResult { configPath: string; outdir: string; configWritten: boolean; postcssWritten: boolean; gitignoreWritten: boolean; codegenFiles: string[]; presetsInstalled: string[]; } interface DoctorResult extends CommandResult { configPath?: string; diagnosticCount: number; errors: number; sourceCount: number; watchDirs: string[]; artifactIds: string[]; conditionCount: number; tokenCategoryCount: number; utilityCount: number; } interface RunContext { driver: Driver; cwd: string; outdir: string; output: OutputSink; timings?: PhaseTimings; } type PhaseTimings = Record; interface OutputSink { log(message: string): void; error?(message: string): void; } declare function runBuild(flags?: BuildFlags, output?: OutputSink): Promise; declare function runCodegen(flags?: CodegenFlags, output?: OutputSink): Promise; declare function runCssgen(flags?: CssgenFlags, output?: OutputSink): Promise; type CssgenOnceResult = Pick & { cssFiles: number; }; declare function writeCssgenOutput(ctx: RunContext, outfile: string, flags: CssgenFlags, parsed: ParseFileReport[]): Promise; declare function runDebug(flags?: DebugFlags, output?: OutputSink): Promise; declare function runDoctor(flags?: DoctorFlags, output?: OutputSink): Promise; declare function runBuildinfo(flags?: BuildinfoFlags, output?: OutputSink): Promise; declare function runLib(flags?: LibFlags, output?: OutputSink): Promise; declare function runAnalyze(flags?: AnalyzeFlags, output?: OutputSink): Promise; interface ProjectSummary { configPath?: string; sourceCount: number; watchDirs: string[]; artifactIds: string[]; conditionCount: number; tokenCategoryCount: number; utilityCount: number; } declare function projectSummary(driver: Driver): ProjectSummary; declare function runInit(flags?: InitFlags, output?: OutputSink): Promise; declare function setupGitIgnore(cwd: string, outdir?: string): boolean; export { type AnalyzeFlags, type AnalyzeResult, type BuildFlags, type BuildResult, type BuildinfoFlags, type BuildinfoResult, type CodegenFlags, type CodegenResult, type CommandResult, type CommonFlags, type CssgenFlags, type CssgenResult, type DebugFlags, type DebugResult, type DoctorFlags, type DoctorResult, type InitFlags, type InitResult, type LibFlags, type LibResult, type LogLevel, type ProjectSummary, projectSummary, runAnalyze, runBuild, runBuildinfo, runCodegen, runCssgen, runDebug, runDoctor, runInit, runLib, setupGitIgnore, writeCssgenOutput };