export declare const TEMPLATE_REPO = "https://github.com/vincentt-xr/v2-template.git"; /** * The template ref a scaffold resolves by default. * * `latest` is a MOVING tag on v2-template, force-updated by its Release workflow * only after the tagged tree passes a frozen install + build + typecheck. Cloning * it rather than the default branch is what stops an unreleased commit on the * template's `main` from reaching every new creator the moment it merges. * * A creator pins a known version with `--template 1.0.0`; version tags are * immutable, which is what makes that an escape hatch rather than a coin flip. */ export declare const DEFAULT_TEMPLATE_REF = "latest"; /** Injectable git runner (real git by default; a fake in tests avoids the network). */ export type GitRunner = (args: string[]) => Promise; /** * True when `dir` has no app yet (no package.json) → safe to scaffold into. * A directory that already holds an app is left untouched (project_create just binds). */ export declare function needsScaffold(dir: string): Promise; /** * True when `dir` exists and holds anything at all. * * `needsScaffold` only answers "is there an app here", which waves through a home * directory, a notes folder, or any repo that is not a Node project — and the * scaffold then scatters ~30 files into it. Nothing is overwritten (the copy is * `force: false`), but the files are unlisted and separating them again is manual, * so the creator is asked first. * * Dotfiles count. A folder holding only `.git` is a repo someone cares about. */ export declare function isNonEmptyDir(dir: string): Promise; export interface ScaffoldOptions { repo?: string; /** Template ref (tag) to scaffold from. Defaults to `DEFAULT_TEMPLATE_REF`. */ ref?: string; /** Test seam — defaults to spawning real git. */ runGit?: GitRunner; } /** * Scaffold the template into `targetDir`. Clones to a temp dir, strips `.git`, * copies the files in (never overwriting anything already there), then inits a * fresh repo. Throws a clear error if the clone fails (e.g. no git access). */ export declare function scaffoldFromTemplate(targetDir: string, opts?: ScaffoldOptions): Promise; export type PackageManager = "pnpm" | "yarn" | "npm"; /** * Pick the package manager the scaffolded template is set up for, by its lockfile. * The template ships a pnpm-lock.yaml + `node-linker=hoisted` (the hoisted layout * the esbuild singleton aliasing needs), so installing with the wrong manager * leaves a second lockfile and an unproven node_modules layout. Defaults to npm. */ export declare function detectPackageManager(dir: string): Promise; /** * Install a freshly scaffolded project's dependencies (with the template's own * package manager) so the first preview/build doesn't fail on a missing * node_modules. Throws on failure (no network, manager not installed); the caller * surfaces it as a "run install yourself" hint rather than aborting create. * Returns the manager used so the caller can name it in messages. */ export declare function installDependencies(dir: string): Promise;