Interfaces
CreateArgs
Properties
| Property | Type |
|---|---|
flags | Map<string, FlagValue> |
positional | string[] |
PackageJsonMerge
create-pyric — scaffold engine for npm create pyric and pyric init.
Properties
| Property | Type |
|---|---|
added | string[] |
conflicts | { existing: unknown; key: string; wanted: unknown; }[] |
contents | string |
unchanged | boolean |
ScaffoldIo
create-pyric — scaffold engine for npm create pyric and pyric init.
Properties
ScaffoldRequest
create-pyric — scaffold engine for npm create pyric and pyric init.
Properties
| Property | Type | Description |
|---|---|---|
commandLabel? | string | Label used in human report lines (create-pyric or pyric init). |
depsMode? | DepsMode | - |
dir? | string | Absolute or relative project directory (relative resolved against cwd). |
effectiveTemplate? | ScaffoldTemplate | Already-rewritten template; defaults to TEMPLATES[template] (+ npm pin). |
force? | boolean | - |
json? | boolean | - |
name? | string | - |
pinVersion? | string | Version pin for npm-mode @pyric/cli / pyric ranges. |
preCreated? | string[] | Extra paths already created (e.g. vendor tarballs) to list in the report. |
template? | "web" | "node" | "static" | "chat" | "nextjs" | - |
ScaffoldResult
Stable --json contract; agents parse this.
Properties
| Property | Type |
|---|---|
conflicts | { existing: unknown; key: string; wanted: unknown; }[] |
created | string[] |
depsMode | DepsMode |
dir | string |
merged | string[] |
nextSteps | string[] |
skipped | string[] |
template | "web" | "node" | "static" | "chat" | "nextjs" |
ScaffoldTemplate
create-pyric — scaffold engine for npm create pyric and pyric init.
Properties
Methods
files()
files(name: string): {
content: string;
name: string;
}[];
Scaffold-owned files, relative path → content.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
{
content: string;
name: string;
}[]
Type Aliases
DepsMode
type DepsMode = "vendor" | "npm";
Where the scaffold’s pyric / @pyric/cli deps come from.
FlagValue
type FlagValue = string | boolean | (string | boolean)[];
Minimal argv parser for create-pyric (no subcommand — first bare
arg is the target directory).
TemplateName
type TemplateName = typeof TEMPLATE_NAMES[number];
create-pyric — scaffold engine for npm create pyric and pyric init.
Variables
TEMPLATE_NAMES
const TEMPLATE_NAMES: readonly ["web", "node", "static", "chat", "nextjs"];
Scaffold templates for pyric init (engine in ./init.js).
web (the default) scaffolds a Vite app wired to the @pyric/cli/vite
plugin: vite dev runs the app’s CANONICAL firebase/* imports against the
in-process sandbox; vite build ships the real firebase package. One
toolchain, no graduation cliff — the sandbox↔Firebase swap is environmental
(dev vs build), never a code edit (the design rationale section 9).
static is the serve-era scaffold (no bundler): a static app pyric dev
runs against the in-page sandbox via a runtime import map. For pre-built /
retrofit apps, or anyone who wants zero build step.
node is the script-style scaffold (backend fixtures, agent loops). Its
canonical imports are swapped by the dev command and remain Firebase under
the production command.
TEMPLATES
const TEMPLATES: Record<TemplateName, ScaffoldTemplate>;
create-pyric — scaffold engine for npm create pyric and pyric init.
Functions
applyDepsMode()
function applyDepsMode(
t: ScaffoldTemplate,
mode: DepsMode,
opts: {
vendorSpecs?: Record<string, string>;
version?: string;
}): ScaffoldTemplate;
Return a copy of t with pyric / @pyric/cli deps rewritten for mode.
Parameters
| Parameter | Type |
|---|---|
t | ScaffoldTemplate |
mode | DepsMode |
opts | { vendorSpecs?: Record<string, string>; version?: string; } |
opts.vendorSpecs? | Record<string, string> |
opts.version? | string |
Returns
isTemplateName()
function isTemplateName(value: string): value is "web" | "node" | "static" | "chat" | "nextjs";
create-pyric — scaffold engine for npm create pyric and pyric init.
Parameters
| Parameter | Type |
|---|---|
value | string |
Returns
value is “web” | “node” | “static” | “chat” | “nextjs”
mergeIntoExistingPackageJson()
function mergeIntoExistingPackageJson(
raw: string,
projectName: string,
template: ScaffoldTemplate): PackageJsonMerge;
Merge template fields into an existing package.json. Never overwrites.
Parameters
| Parameter | Type |
|---|---|
raw | string |
projectName | string |
template | ScaffoldTemplate |
Returns
normalizeBoolFlags()
function normalizeBoolFlags(flags: Map<string, FlagValue>, positional: string[]): void;
Reclaim --force dir / --json dir when a parser bound the value as the flag.
Parameters
| Parameter | Type |
|---|---|
flags | Map<string, FlagValue> |
positional | string[] |
Returns
void
packageJsonFor()
function packageJsonFor(name: string, t: ScaffoldTemplate): string;
create-pyric — scaffold engine for npm create pyric and pyric init.
Parameters
| Parameter | Type |
|---|---|
name | string |
t | ScaffoldTemplate |
Returns
string
parseCreateArgs()
function parseCreateArgs(argv: string[]): CreateArgs;
Parameters
| Parameter | Type |
|---|---|
argv | string[] |
Returns
runScaffold()
function runScaffold(request: ScaffoldRequest, deps?: ScaffoldIo): Promise<number>;
Write the scaffold into dir. Caller prepares vendor tarballs / pin when
needed and may pass effectiveTemplate.
Parameters
| Parameter | Type |
|---|---|
request | ScaffoldRequest |
deps? | ScaffoldIo |
Returns
Promise<number>