import * as consola from 'consola'; import 'consola/utils'; import { RouteData } from '@crackle/router'; import React from 'react'; type PartialDeep = T extends object ? { [P in keyof T]?: PartialDeep; } : T; type RoutePath = string; type AppShell | void = void> = React.FC; }>>; interface CrackleServer { url: string; close: () => Promise; } interface Config { /** * The root of the application that all paths are resolved relative to * * @default process.cwd() */ root: string; /** * Compile output to CommonJS. * * @default {} */ cjs: any; /** * Compile output to ES Modules. */ esm: { /** * Peer dependencies that require ESM reconciliation. * * Specify the package and corresponding version range for which ESM compatibility is required. * * @see https://github.com/seek-oss/crackle/blob/master/docs/esm-reconciliation.md#reconciling-peer-dependencies * @default {} */ reconcileDependencies: Record; }; dts: { /** * Controls how Crackle generates `.d.ts` files. * * - 'bundle' rolls up all `.d.ts` files into a single file * - 'preserve' generates `.d.ts` files for each file in the source directory, for maximum compatibility with TypeScript * * @default 'bundle' */ mode: 'bundle' | 'preserve'; /** * Override TypeScript `compilerOptions` for when generating `.d.ts` files. * * @default { incremental: false, noEmitOnError: false } */ options: Record; }; dev: { /** * Controls whether Crackle should generate a shim. * * - 'require' creates a `require` shim using `createRequire` * - 'none' does not add a shim * * @default 'require' */ shim?: 'require' | 'none'; }; package: { /** * Automatically clean output directory. * * @default true */ clean: boolean; /** * Automatically run `fix` if necessary. * * @default false */ fix: boolean; /** * Controls how Crackle generates output files. * * - 'bundle' rolls up output files into as few chunks as possible * - 'preserve' creates separate files for all modules using the original module names as file names * * @default 'bundle' */ mode: 'bundle' | 'preserve'; }; web: { /** * Path to the App shell component * * @default 'src/App.tsx' */ appShell: `${string}.tsx`; /** * Directories that Crackle should search to find .page.tsx files * * @default ['src'] */ pageRoots: string[]; /** * Port for the server used in `start` and `serve` * * @default 5000 */ port: number; /** * The path that static assets will be served from in production * * @default '/' */ publicPath: string; }; } interface EnhancedConfig extends Config { resolveFromRoot: (filePath: string) => string; } type PartialConfig = PartialDeep; declare const mergeConfig: (config: C, override: O) => M; declare const defineConfig: (config: PartialConfig) => PartialConfig; declare const build: (inlineConfig?: PartialConfig) => Promise; declare const clean: (inlineConfig?: PartialConfig) => Promise; declare const dev: (inlineConfig?: PartialConfig) => Promise; declare const fix: (inlineConfig?: PartialConfig) => Promise; declare const logger: consola.ConsolaInstance; declare const buildPackage: (partialConfig?: PartialConfig) => Promise; interface ResolveConfigOptions { cwd?: string; onUpdate?: (config: PartialConfig) => void; } declare const resolveConfig: ({ cwd, onUpdate, }?: ResolveConfigOptions) => Promise; declare const pageGlobSuffix = "/**/*.page.tsx"; declare const getAllRoutes: (inlineConfig?: PartialConfig) => Promise>; declare const serve: (inlineConfig?: PartialConfig) => Promise<{ close: () => Promise; url: string; }>; declare const start: (inlineConfig?: PartialConfig) => Promise; export { build, buildPackage, clean, defineConfig, dev, fix, getAllRoutes, logger, mergeConfig, pageGlobSuffix, resolveConfig, serve, start }; export type { AppShell, CrackleServer, EnhancedConfig as ResolvedConfig, PartialConfig as UserConfig };