import { PackageManager } from './package-manager.js'; /** Local shape for a package to install; the registry ships plain strings. */ export interface ComponentDependency { name: string; version: string; dev?: boolean; } /** * Splits `name[@version]` into its parts. * * The leading `@` of a scoped package is not a version delimiter, so the search * for `@` has to start past index 0 — otherwise `@expo/vector-icons` parses as * an empty name. */ export declare function parseDependency(spec: string): ComponentDependency; /** * True when `targetPath` is an Expo app. * * Worth knowing because `expo install` resolves each package to the version * that matches the project's SDK, where a bare `npm install` resolves to * `latest` and quietly pulls a package built for the *next* SDK. */ export declare function isExpoProject(targetPath: string): boolean; export declare function installPackageDependencies(dependencies: string[], targetPath: string, packageManager: PackageManager): Promise; /** * The exact command that installs `packages`. * * Registry entries declare bare package names, which a plain install resolves * to `latest`. In an Expo app that is wrong the moment a new SDK ships: * `expo-camera@latest` targets the newest SDK, not the one the project is on. * `expo install` pins each package to the project's SDK and passes anything it * doesn't recognise through to the package manager, so it is preferred whenever * the target is an Expo project. * * Which runner launches it used to be a hardcoded `npx`, which assumes Node is * on the machine. That holds for npm, yarn and pnpm — all three are Node * programs, so `npx` came with them. Bun is not: it is its own runtime, * `bunx --bun bna-ui add camera` never goes near Node, and a bun-only * environment has no `npx` to call. `add` resolved every file it was about to * write and then died on the install. So bun, and only bun, gets `bunx`: * `pnpm dlx` and `yarn dlx` exist too, but `yarn dlx` is Berry-only and * swapping a working `npx` for them buys nothing. * * Pure and exported because the failure it guards against needs a machine with * bun and no Node, which no test environment reproduces. */ export declare function buildInstallCommand(packages: string[], packageManager: PackageManager, { isDev, isExpo }: { isDev: boolean; isExpo: boolean; }): string; export declare function checkExistingDependencies(dependencies: string[], targetPath: string): string[]; export declare function getDependencyInfo(dependencies: string[], targetPath: string): { missing: string[]; existing: string[]; };