/** * Where a scaffold goes, and what it is called (GRK1 + GRK2). * * The positional argument is a PATH — `my-shop`, `.`, `../clients/x`, * `/tmp/x-y` — and the project name is the slug of its last segment. Before * this, the whole positional was the name, so `/tmp/cartwright-new` reached * brand.config.ts as `storeName: "/tmp/cartwright New"` and a storeSlug with * slashes in it; and the pre-flight refused every directory that existed, * which made `create-cartwright .` impossible even in an empty folder — the * way Cursor and Claude Code users start. */ export declare const DEFAULT_PROJECT_NAME = "my-cartwright-shop"; /** * `dir` is set only when a positional was given: the path fixes the directory * and the name is derived from it. Without one, the directory follows the * name (prompted, or the AI brief's slug), exactly as before. */ export type ProjectArg = { dir?: string; name: string; }; export declare function resolveProjectArg(arg: string | undefined, cwd: string, homeName?: string): ProjectArg; export type TargetCheck = { ok: true; replaces: string[]; } | { ok: false; reason: string; }; /** * May the template be extracted into `dir`? A missing or empty folder, or one * holding only TOLERATED_ENTRIES, is fine; anything else is refused with the * entries that are in the way, so nothing a user wrote is overwritten. The * home directory and the filesystem root are refused even when empty. */ export declare function inspectScaffoldTarget(dir: string, home: string): TargetCheck; /** * The remote of a repository that already lives AT `dir` — a GitHub clone, or * `git init` + `git remote add` — read before the scaffold writes anything. * Only a `.git` in `dir` itself counts: in a folder nested inside another * repository `git remote` answers for the parent, while the scaffold's own * `git init` then creates a fresh repository with no remote at all. */ export declare function existingRemote(dir: string): string | undefined; export type PreparedTarget = { ok: false; reason: string; } | { ok: true; dir: string; /** What to type to get there: the relative path, or "." when scaffolding where we stand. */ cdDir: string; replaces: string[]; /** giget refuses a non-empty folder unless forced, so force exactly what the check let through. */ force: boolean; /** The folder's remote before the scaffold, if it had one — its commit is then NOT on GitHub yet. */ remoteBefore: string | undefined; }; /** * The whole pre-flight in one call, so the CLI cannot pick a directory, a * force flag or a remote fact that the check did not see: the positional's * path wins over the name, a refused folder has no `dir` to write into, and * the remote is recorded before anything is written. */ export declare function prepareScaffoldTarget(target: ProjectArg, slug: string, cwd: string, home: string): PreparedTarget;