The commit updates the README file located in the CLI package. It mainly changes the links that refer to the code of the `add`, `list`, and `search` commands. The references in those links are now pointing to the 0.3.0 version instead of the 0.2.1 version.
The import statement in the add.tsx file of the CLI package has been updated to use the correct library name and version. This change ensures accurate reference to shared libraries, leading to better stability and interoperability.
The change includes an update to config.ts in CLI. The configuration paths for the shared module changed from 'shared' to 'lib'. Also, the import paths adjusted to reflect the path changes from 'shared' to 'lib'.
Import additional helper methods in add.tsx. Remove forceShared flag as it could potentially break components. Instead of planning for a shared module, this commit plans for version-specific libraries, which exist in a separate lib folder. This ensures that the right version of the library required by the component is installed. Also, handle potential errors related to absence of lib version in the registry. Fixed component installation path.
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.
The Registry interface in the 'const.ts' file within the cli package has been updated. The 'components' property is now a record of RegistryComponent objects, which includes 'name' and 'libVersion' properties, previously it was a record of strings.
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 Registry interface has been refactored to include "paths" field, which is an object containing "components" and "lib" paths. Also, "lib" field is now a string array instead of a record.
Changed the 'shared' property in the Registry interface to 'lib'. This update in 'packages/cli/src/const.ts' provides a more generic way to manage libraries with a key-value pair notation.
The commit includes an update in the cli package where we've changed the properties in paths and import objects from 'shared' to 'lib'. This refactoring also applies to the DEFAULT_CONFIG object and the configZod object, ensuring consistency across all configurations.
The links to the code for add, list, and search commands in README.md are updated to reflect the latest version of the CLI (v0.2.1). Additionally, the package version for the CLI is updated from 0.2.0-build to 0.2.1 in package.json.
State setting logic for SearchBox in the CLI package has been streamlined. Redundant setState calls have been eliminated while others are more appropriately placed for better state management. This refactor focuses on the selected and queryMode states. Improved handling of selection state enhances component efficiency.
This commit updates the homepage and repository URLs in the package.json file for the cli package. It also cleans up some unnecessary scripts in the "scripts" block.
This update upgrades the version of the cli package from 0.1.0 to 0.2.0. It also includes the addition of a new "search" command in the CLI readme documentation. Link to relevant source code has also been updated.
Refactored the 'cli add' command to streamline the process of component selection and the decision to overwrite an already installed one. The task has been split into two separate interactive choices to enhance the user experience and simplify the codebase. The force option is now also evaluated separately which results in cleaner code.
Renamed 'add.ts' to 'add.tsx' and converted it to a React component. This change includes implementing search functionality through installed components and handling the case if the component is already installed. Added search options and overwriting prompt in CLI interface.
This commit includes the addition of a new component, Choice, that presents two options yes or no to the user. The user can interact with this component using the up and down arrow keys. Based on this selection, different actions can be submitted. The feature also supports unicode if the environment supports it.
The onSubmit function typing in the SearchBox component was changed from handling a string to handling a generic T type object. Also, the onSubmit function now uses the found item in components based on the selected suggestion to submit instead of submitting directly.
The dependencies array in the useEffect hook within SearchBox.tsx has been updated. The 'suggestions' variable has been added to the dependencies to ensure the function updates accordingly when this state changes.
Added a new stateful variable, 'queryMode', to the 'SearchBox' component in the CLI to enhance its functionality. As a result, 'Input' and suggestion fetching are now conditioned by this mode, providing more controled user search management and interaction with the autocomplete feature.
Decreased the marginRight property from 2 to 1 in the SearchBox component of the CLI to improve layout. Also modified the placeholder text in the Input field for better readability.
This commit modifies a conditional statement in the SearchBox component to properly manage the selected index based on the length of search results. This ensures appropriate selection even when the result length is less than or equal to the selected index.
Removed the top 5 slicing constraint from the search helper function within the CLI package. This change allows to return all components whose score exceeds zero, instead of restricting it to the top 5.
This commit removes the dependency on the ink-spinner module from the package.json file in the CLI package. This is reflected in the yarn.lock file, where references to ink-spinner have been removed.
In the SearchBox component, a new onSubmit prop has been added for user's search input handling. The UI has also been updated: changed border styles, introduced color changes based on selection and added placeholder for search input.
The SearchBox component in the CLI package now supports generic types, enhancing its flexibility. The onChange method now returns selected item details, instead of just returning the key. The SearchBox props have been modified to support the generic type T.
Changed the 'components' prop passed to 'SearchBox' in 'search.tsx' to have 'key' and 'displayName' properties instead of simple component names. This refactoring aims to better align with the expected prop structure.
Added 'onChange' prop to the SearchBox component for active response to selection changes. Also updated the 'components' prop type and handled the related changes in the 'getSuggestion' use case. This includes mapping the components to their keys, updating the display name and handling selected results.
The search command in the CLI is enhanced to recognize search queries as command arguments. An improved interaction with the search box is also introduced, including key event handlers for up and down arrows and escape key, allowing users to navigate more intuitively. keyboard-based selection of suggestions is now implemented and the helper message is updated to match these interaction changes.
The SearchBox component in the Command Line Interface (CLI) now accepts an optional initialQuery prop. This prop is used to set the initial state of the search box query, which enables prepopulating the search box with a specific string if desired.
A new command has been added to the CLI package to search for components. This command fetches the registry and lists accessible components through the SearchBox component. The SearchBox component has also been updated to show a helper text and a new styled border for better user interaction.
A Divider and a SearchBox component have been added to the CLI. The Divider is a simple component for displaying a horizontal line. The SearchBox takes a list of components as props and provides a live search functionality, showing suggestions for user inputs.
This commit introduces a new file "search.ts" in the CLI helpers. It adds the implementation of the Jaro-Winkler string comparison algorithm and a "getSuggestion" function. The getSuggestion function uses the Jaro-Winkler algorithm for comparing component names against an input string and providing suitable suggestions.
Imported the colorize method from '@oclif/core/ux' to add color to the log messages in the 'validateConfig' function within 'config.ts' for improved readability. The messages that detail installation paths and import shared details are now displayed in gray.
The `@types/ink-divider` dependency has been added to the CLI package. This addition will provide types for the ink-divider, enhancing TypeScript support and code reliability. The yarn.lock file has been updated accordingly.
This change includes normalization of user input for component name by converting it to lowercase during the installation process. This is done to ensure that component names are not case sensitive and that any input will match the existing component names in the registry.
The repository and bugs URLs in both the main package.json and the cli package.json files have been corrected. They were mistakenly pointing to the deprecated "p-sw/ui" repository, but are now correctly aiming at the "pswui/ui" repository.
The pswui CLI documentation has been updated to reflect the current commands and to give clearer instructions. Changes include replacing "mycli123" with "pswui" throughout the document, reducing the number of commands to three - add, help, and list, and updating their descriptions and examples for better understanding.
The shared file extension has been updated from .ts to .tsx in the path constants and the default configuration within the CLI package. This change aligns with our efforts to standardize the file types across the project.
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.