@nx/rsbuild
Version:
28 lines (27 loc) • 1.32 kB
TypeScript
import { type Tree } from '@nx/devkit';
import { type SupportedRsbuildMajorVersion } from './versions';
/**
* Returns the declared @rsbuild/core major version from the workspace's
* package.json when it matches a supported major, or `undefined` otherwise
* (fresh install, dist tag, unknown major). Below-floor enforcement is
* handled at generator entry points via `assertSupportedRsbuildVersion`.
*/
export declare function getInstalledRsbuildMajorVersion(tree: Tree): SupportedRsbuildMajorVersion | undefined;
/**
* Returns the installed @rsbuild/core major version resolved at runtime from
* node_modules. For use in executors and runtime code where no Tree is
* available. Returns `null` when @rsbuild/core can't be resolved or the
* installed major isn't supported.
*/
export declare function getInstalledRsbuildVersionRuntime(): SupportedRsbuildMajorVersion | null;
/**
* Returns the version-map entry for the installed major, falling back to the
* latest supported map when no installed version is detected (fresh install)
* or the detected major is outside the supported window.
*/
export declare function getRsbuildVersionsForInstalledMajor(tree: Tree): {
rsbuildVersion: string;
rsbuildPluginReactVersion: string;
rsbuildPluginVueVersion: string;
rsbuildPluginSassVersion: string;
};