pub fn resolve_theme_path(
theme: &str,
search_root: &Path,
) -> Result<PathBuf, TokenError>Expand description
Resolve a --theme value to a file path on disk.
Resolution order:
- If
themeis a path to an existing file, use it directly. - Otherwise, treat it as an npm package name and walk up from
search_rootlooking fornode_modules/<pkg>/tokens.json:@scope/pkgโnode_modules/@scope/pkg/tokens.json@scope/pkg/custom.jsonโnode_modules/@scope/pkg/custom.jsonpkgโnode_modules/pkg/tokens.json
ยงErrors
Returns TokenError::Schema if the theme cannot be resolved.