/** The templates that ship with the package, as `templates//`. */ export declare const TEMPLATES: readonly ["minimal"]; export type TemplateName = (typeof TEMPLATES)[number]; /** * Every `@dunx/*` version in a template manifest is this placeholder. Versioning * is lockstep, so the right version to install is whatever version of * `@dunx/create-app` is doing the scaffolding - resolved at run time rather than * written into the template, which would go stale on the next release. */ export declare const VERSION_PLACEHOLDER = "__DUNX_VERSION__"; /** * What is in `directory` that stops it being a scaffolding target. Empty means it * is one, whether or not it exists. * * Exported because the wizard asks about a non-empty directory before writing * anything, and asking a different question from the one `scaffold` then enforces * is how a prompt and its guard drift apart. */ export declare const blockingEntries: (directory: string) => readonly string[]; export interface ScaffoldOptions { /** Directory to create. Relative paths resolve against `cwd`. */ readonly target: string; /** Package name for the generated app. Defaults to the target's basename. */ readonly name?: string; readonly template?: TemplateName; /** * Features to compose the app from, by name. Anything they require is pulled in. * * Passing any switches from copying a fixed template to generating the wiring * around the chosen feature directories - see `generate.ts`. An empty list, or * none at all, scaffolds `template` unchanged, so the default behaviour is exactly * what it was. */ readonly features?: readonly string[]; /** * Add a `scripts/build.ts` and a `build` script that compile the app to one * standalone executable. Forces the generation path, so it works with no * features chosen too. */ readonly binary?: boolean; /** Write into a directory that already has files in it. */ readonly force?: boolean; readonly cwd?: string; /** Overrides the version written into the generated manifest. */ readonly version?: string; } export interface ScaffoldResult { readonly directory: string; readonly name: string; readonly template: TemplateName | 'composed'; /** Resolved feature names, in import order. Empty for a fixed template. */ readonly features: readonly string[]; /** Whether a standalone-binary build was generated. */ readonly binary: boolean; readonly files: readonly string[]; } export declare class ScaffoldError extends Error { readonly name = "ScaffoldError"; } /** * npm forbids uppercase and a leading dot or underscore, and a scope is legal. * Checked here because the failure would otherwise surface as a confusing * `bun install` error inside a directory the user just created. */ export declare const isValidPackageName: (name: string) => boolean; /** This package's own version, which is also the one it writes into the app. */ export declare const packageVersion: () => Promise; export declare const scaffold: (options: ScaffoldOptions) => Promise;