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.
The commit removes the default path for config in the CLI 'list' command. This change improves flexibility by allowing the user to define their own path without overriding the default one.
Modified the 'loadConfig' method to support '.cjs' and '.mjs' config files. Also, a 'changeExtension' function is added to helpers/path.ts to manipulate file extensions. An error will be thrown if a specified user config file is not found. The application defaults to the default config file if no user config file is provided.
Replaced direct log reference in validateConfig function calls with an anonymous function that logs a message. This change has been made in the add and list commands of the CLI package to ensure proper logging.
This commit introduces a new command 'add' to the CLI. The 'add' command allows users to add a component to the project with options for custom configurations, and it performs validation checks to ensure the component exists in the registry before installing.
The validateConfig function in the cli module has been updated to include logging. The logs show the locations where the component and shared module will be installed, as well as the import path for the shared module.
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.
A new field "shared" has been added to the Registry interface within the const.ts file located in the cli package. This extends the existing interface to hold more diverse data.
The commit removes the unnecessary "@oclif/plugin-plugins" from the plugin list within the cli's package.json file. This refactor enhances the code cleanliness, and potentially improves the cli performance by reducing the number of plugins loaded at runtime.
This adds a new 'list' command in the CLI package to print all available components in the registry as well as components installed in the project. This command includes additional options to include component file URL and specify a custom path to the config file.
This commit removes deprecated dependencies from the CLI and updates the yarn.lock file to reflect these changes. It also adds new dependencies that are needed for the project. The dependencies removed are "@types/mocha", "ansi-colors", "browser-stdout", "camelcase", "chokidar", "cliui", "debug", "decamelize", "diff", "find-up", "flat", "glob", "he", and "is-plain-obj". The dependencies added include "@types/treeify", "cli-cursor", "emoji-regex", "is-interactive", "is-unicode-supported",
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.
This commit deletes all template commands and related tests from the CLI package. The template command implementation and its associated tests have been fully removed to make way for new feature implementation.