UNPKG

everything-dev

Version:

A consolidated product package for building Module Federation apps with oRPC APIs.

175 lines • 8.12 kB
import { BosConfig, BosConfigInput, ParentStarterConfig, StarterLevel } from "../types.cjs"; import { OverrideSection } from "../contract.cjs"; import { runDockerComposeUp } from "../infra/docker.cjs"; //#region src/cli/init.d.ts declare const PNPM_PACKAGE_MANAGER = "pnpm@12.10.1"; /** * The child's workspace manifest: pnpm-workspace.yaml is canonical (v2, ADR * 0026) — packages globs synthesized from the child's override sections, the * catalog merged over any local entry, plus the fleet-wide linker posture and * singleton overrides. Re-running (sync/upgrade) merges instead of clobbering. */ declare function writeChildWorkspaceYaml(projectDir: string, next: { packages: string[]; catalog: Record<string, string>; }): boolean; /** * Init must never reuse a lockfile left in the target (copied from a parent * checkout or left by a previous run) — stale framework resolutions would * survive the fresh install. Bun's bun.lock is deleted on sight (ADR 0026's * silent-revert footgun); the child's own pnpm-lock.yaml is re-resolved. */ declare function removeStrayLockfiles(projectDir: string): void; declare const INIT_ROOT_PATTERNS: readonly ["bos.config.json", "package.json", ".env.example", ".gitignore", "biome.json", "railway.json", "railway.toml", "AGENTS.md", ".agents/skills/**", "skills-lock.json", "docs/agents/**", ".changeset/config.json", ".changeset/README.md", "README.md", "CONTRIBUTING.md", ".github/templates/**"]; interface SourceResult { sourceDir: string; parentConfig: BosConfig; cleanup: () => Promise<void>; } interface CatalogChainSource { catalog: Record<string, string>; repository?: string; extendsChain: string[]; } declare function readWorkspaceCatalog(sourceDir: string): Record<string, string>; declare function resolveCatalogChainSource(opts: { extendsAccount: string; extendsGateway: string; sourceDir?: string; }): Promise<CatalogChainSource>; declare function resolveSourceDir(opts: { extendsAccount: string; extendsGateway: string; source?: string; }): Promise<SourceResult>; declare function buildInitPatterns(overrides: OverrideSection[], plugins?: string[], pluginDirMap?: Record<string, string>): string[]; declare function isApiTemplatePath(filePath: string): boolean; declare function isComposeTemplatePath(filePath: string): boolean; declare function buildPluginRouteExclusions(parentConfig: { plugins?: Record<string, unknown>; } | null | undefined, selectedPlugins: string[]): string[]; /** * Route-file globs (relative to the child's `ui/src/routes/`) that a starter * of the given level must not receive. Parent `starter` config can add * exclusions (`exclude`, `levels[level].exclude`) or reclaim routes for a * level (`levels[level].include`). Entries are prefixed with * `ui/src/routes/` so they compose with `copyFilteredFiles`'s ignore list. */ declare function buildStarterRouteExclusions(level: StarterLevel, parentConfig: { starter?: ParentStarterConfig; } | null | undefined): string[]; declare function sourcePathToDestinationPath(filePath: string): string; declare function fetchParentConfig(extendsAccount: string, extendsGateway: string): Promise<BosConfig>; declare function resolveRepositoryViaExtendsChain(extendsAccount: string, extendsGateway: string, visited?: Set<string>): Promise<{ repository: string; config: BosConfig; } | null>; declare function detectGitRemoteUrl(directory: string): Promise<string | undefined>; declare function downloadTarball(repoUrl: string): Promise<{ dir: string; cleanup: () => Promise<void>; }>; declare function copyFilteredFiles(sourceDir: string, destination: string, patterns: string[], options: { overrides: OverrideSection[]; plugins?: string[]; ignore?: string[]; }): Promise<number>; /** * Scaffold the authored config as the TS form: the personalized * bos.config.json materializes into an authored `bos.app.ts` descriptor and * the JSON copy is removed — publish/sync still canonicalize to JSON for * FastKV from the resolved config. Returns the config that was converted, so * callers that need it (before the child has node_modules to import the * descriptor) can pass it onward. */ declare function convertChildConfigToAppForm(destination: string): Promise<BosConfigInput | null>; /** * Scaffold the root dev-overlay starter (`bos.dev.ts`). Idempotent — never * overwrites an existing overlay. Dev overlays are merged child-wins over * the resolved config in development and are never published. */ declare function writeDevOverlayTemplate(destination: string, opts?: { extendsRef?: string; }): void; declare function getParentOnlyScriptKeys(projectDir: string): string[]; declare function buildChildRootScripts(sections: { ui: boolean; api: boolean; host: boolean; plugins: boolean; }): Record<string, string>; declare function personalizeConfig(destination: string, opts: { extendsAccount: string; extendsGateway: string; account?: string; domain?: string; plugins?: string[]; overrides: OverrideSection[]; pluginRoutes?: Record<string, string[]>; workspaceOpts?: { localOverrides?: boolean; sourceDir?: string; }; mode?: "init" | "sync"; existingConfig?: Record<string, unknown>; repository?: string; title?: string; description?: string; testnet?: string; staging?: unknown; starter?: StarterLevel; }): Promise<void>; declare function runPnpmInstall(destination: string, opts?: { spinner?: { message: (msg: string) => void; }; }): Promise<void>; declare function runPnpmInstallForUpgrade(destination: string, opts?: { spinner?: { message: (msg: string) => void; }; }): Promise<void>; declare function runTypesGen(destination: string, opts?: { spinner?: { message: (msg: string) => void; }; remotePlugins?: string[]; }): Promise<void>; declare function scaffoldMinimalProject(destination: string, parentConfig: BosConfigInput, opts: { extendsAccount: string; extendsGateway: string; account?: string; domain?: string; plugins?: string[]; overrides: OverrideSection[]; repository?: string; title?: string; description?: string; starter?: StarterLevel; /** local parent source dir — resolves the catalog offline (tests, --source) */ catalogSourceDir?: string; }): Promise<number>; declare function writeInitSnapshot(destination: string, extendsAccount: string, extendsGateway: string, sourceDir: string, patterns: string[], options: { overrides: OverrideSection[]; plugins?: string[]; ignore?: string[]; starter?: StarterLevel; }): Promise<void>; declare function generateDatabaseMigrations(destination: string): Promise<void>; declare function execCommand(command: string, args: string[], cwd?: string, options?: { stdio?: "pipe" | "inherit"; }): Promise<void>; declare function extractSkillsBlock(content: string): string; declare function buildChildAgentsMd(skillsBlock: string, opts: { overrides: OverrideSection[]; plugins?: string[]; }): string; declare function personalizeAgentsMd(destination: string, opts: { overrides: OverrideSection[]; plugins?: string[]; }): Promise<void>; declare function buildChildLlmsTxt(title: string): string; declare function buildChildSkillMd(title: string, repository: string): string; //#endregion export { CatalogChainSource, INIT_ROOT_PATTERNS, PNPM_PACKAGE_MANAGER, buildChildAgentsMd, buildChildLlmsTxt, buildChildRootScripts, buildChildSkillMd, buildInitPatterns, buildPluginRouteExclusions, buildStarterRouteExclusions, convertChildConfigToAppForm, copyFilteredFiles, detectGitRemoteUrl, downloadTarball, execCommand, extractSkillsBlock, fetchParentConfig, generateDatabaseMigrations, getParentOnlyScriptKeys, isApiTemplatePath, isComposeTemplatePath, personalizeAgentsMd, personalizeConfig, readWorkspaceCatalog, removeStrayLockfiles, resolveCatalogChainSource, resolveRepositoryViaExtendsChain, resolveSourceDir, runDockerComposeUp, runPnpmInstall, runPnpmInstallForUpgrade, runTypesGen, scaffoldMinimalProject, sourcePathToDestinationPath, writeChildWorkspaceYaml, writeDevOverlayTemplate, writeInitSnapshot }; //# sourceMappingURL=init.d.cts.map