UNPKG

@knapsack/app

Version:

Build Design Systems with Knapsack

90 lines 4.53 kB
import type { KsCloudConfig, PathAbsolute, PathRelative } from '@knapsack/types'; import type { ConvertTokenDataToFilesArgs } from '@knapsack/design-token-utils'; import { z } from 'zod'; import { type Renderer } from '../domains/patterns/renderers/renderer-base'; import type { KsServerPlugin } from './plugins'; export type { TemplateRendererMeta } from '@knapsack/types'; export type KnapsackConfig<PathType extends string = string> = { /** Output of knapsack build directory */ dist: PathType; /** Knapsack data directory */ data: PathType; /** Hosted by knapsack server. Place compiled Design System css and js as well as images and other assets needed by knapsack */ public: PathType; templateRenderers: Renderer<any, any>[]; designTokens?: { /** path to `knapsack.design-tokens.json` */ srcFilePath?: PathType; /** * Use this directory instead of "`config.dist`/tokens" * @see {KnapsackConfig['dist']} */ distDir?: PathType; targets?: ConvertTokenDataToFilesArgs['targets']; }; plugins?: KsServerPlugin<any>[]; version?: string; cloud?: KsCloudConfig<PathType>; devServer?: { https?: boolean; /** * If present (and if `devServer.https` is `true`), this will be used instead of auto-generating an SSL cert. If absent, an SSL cert will be auto-generated. */ ssl?: { /** * This is a file path and NOT the contents of the file */ cert: PathType; /** * This is a file path and NOT the contents of the file */ key: PathType; }; port?: number; }; }; export declare const KnapsackConfigSchema: z.ZodObject<{ public: z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>; dist: z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>; data: z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>; version: z.ZodOptional<z.ZodString>; designTokens: z.ZodOptional<z.ZodObject<{ srcFilePath: z.ZodOptional<z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>>; distDir: z.ZodOptional<z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>>; targets: z.ZodOptional<z.ZodObject<{ css: z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; filterTokens: z.ZodOptional<z.ZodCustom<(token: import("@knapsack/types").TokenData) => boolean, (token: import("@knapsack/types").TokenData) => boolean>>; }, z.core.$strict>>; js: z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; filterTokens: z.ZodOptional<z.ZodCustom<(token: import("@knapsack/types").TokenData) => boolean, (token: import("@knapsack/types").TokenData) => boolean>>; }, z.core.$strict>>; android: z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; filterTokens: z.ZodOptional<z.ZodCustom<(token: import("@knapsack/types").TokenData) => boolean, (token: import("@knapsack/types").TokenData) => boolean>>; }, z.core.$strict>>; ios: z.ZodOptional<z.ZodObject<{ enabled: z.ZodBoolean; filterTokens: z.ZodOptional<z.ZodCustom<(token: import("@knapsack/types").TokenData) => boolean, (token: import("@knapsack/types").TokenData) => boolean>>; }, z.core.$strict>>; }, z.core.$strict>>; }, z.core.$strict>>; cloud: z.ZodOptional<z.ZodObject<{ siteId: z.ZodString; repoRoot: z.ZodOptional<z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>>; repoName: z.ZodOptional<z.ZodString>; repoOwner: z.ZodOptional<z.ZodString>; }, z.core.$strict>>; devServer: z.ZodOptional<z.ZodObject<{ https: z.ZodOptional<z.ZodBoolean>; ssl: z.ZodOptional<z.ZodObject<{ cert: z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>; key: z.ZodCustom<PathRelative | PathAbsolute, PathRelative | PathAbsolute>; }, z.core.$strict>>; port: z.ZodOptional<z.ZodNumber>; }, z.core.$strict>>; plugins: z.ZodOptional<z.ZodArray<z.ZodCustom<KsServerPlugin<any>, KsServerPlugin<any>>>>; templateRenderers: z.ZodArray<z.ZodCustom<Renderer<any, any>, Renderer<any, any>>>; }, z.core.$strict>; //# sourceMappingURL=knapsack-config.d.ts.map