Three functions have been removed to simplify the `registry.ts` file in the CLI package. These functions are `getComponentName`, `getComponentLibVersion`, and `getLibURL`, which are no longer required. This commit contributes to making the codebase cleaner and more maintainable.
Modified the return type of the function getComponentLibVersion in registry.ts. Instead of returning a string or null, it now returns an object with a boolean type 'ok' status and 'libVersion'. The 'ok' attribute indicates whether the library version is included in the registry.
This commit introduces three new async functions in the registry.ts file to assist with CLI operations. These include methods to get component names, retrieve library versions, and fetch library URLs.
Update the functions `getComponentURL` and `getComponentRealname` in the CLI helper `registry.ts` to access the component name through the 'name' property of each component object in the registry, instead of directly accessing the component name.
This commit updates the registry helper in the CLI package. It now returns the full component name from the registry, instead of only returning the last part of the component's path.
Change the way the component URL is formed in the getComponentURL function in the registry helper. Now, it appends the path instead of replacing it directly in the registry base.
The update enhances the CLI functionality by introducing the realname resolution for components. This is done in the 'list.ts' file, through a new helper function 'getComponentRealName' that is called whenever list of installed components is required. This ensures the correct identifiers are always considered, regardless of them being aliases or actual names.
This commit adds error handling for fetching operations from the registry in the CLI 'list' command. Now, any failure in retrieving the registry results in a failed spinner with a clear descriptive message, thus making the failure more apparent to the user.
This commit introduces configuration and path management functionality in the CLI by adding the helper functions to load and validate configuration. It also provides the logic to retrieve available components from a given registry. Additionally, it exposes these functionalities in public API.