76 Commits

Author SHA1 Message Date
217410a507 fix(cli): use checkComponentInstalled and getDirComponentRequiredFiles 2024-06-15 03:29:18 +09:00
6f637e51ba fix(cli): use filter to return string only in getDirComponentRequiredFiles 2024-06-15 03:21:07 +09:00
9f28779745 fix(cli): remove typo 2024-06-15 03:13:22 +09:00
5a41b84c9a refactor(cli): remove getComponentsInstalled & make getDirComponentRequiredFiles 2024-06-15 03:13:04 +09:00
bba1a80550 feat(cli): add checkComponentInstalled taking RegistryComponent 2024-06-15 03:12:37 +09:00
1902b9606a refactor(cli): rename files to requiredFiles of component 2024-06-15 03:01:48 +09:00
d721aa290f fix(cli): check installed check with required files 2024-06-15 02:59:23 +09:00
272fc89a92 feat(cli): list command handles directory library 2024-06-15 02:54:27 +09:00
66232b2b9a feat(cli): add command handles directory library & component installation 2024-06-15 02:33:30 +09:00
2d68a5051f feat(cli): add ability to make dir component URL in getComponentURL 2024-06-15 02:30:29 +09:00
36da69240c refactor(cli): rename getDirComponentRequiredFiles to getDirComponentInstalledFiles 2024-06-15 02:21:36 +09:00
4148b903e3 refactor(cli): simplify getComponentsInstalled 2024-06-15 02:20:15 +09:00
46bdb3df98 feat(cli): add getDirComponentRequiredFiles 2024-06-15 02:19:40 +09:00
0be21e2a8d refactor(cli): export RegistryComponent type 2024-06-15 02:15:33 +09:00
f6d2e2335d refactor(cli): safeFetcher return response instead of json 2024-06-15 01:59:10 +09:00
de8a1129da feat(cli): make registry fetch use safeFetcher 2024-06-15 01:57:21 +09:00
b3ebcb45ee feat(cli): make getRegistry take custom branch 2024-06-15 01:45:29 +09:00
28d5f409f8 fix(cli): add url in registry fetch error message 2024-06-15 01:45:18 +09:00
7d2453b4cf feat(cli): make getRegistry take custom branch 2024-06-15 01:45:00 +09:00
c1d5c5d06b refactor(cli): make config lib path to directory pattern 2024-06-15 01:44:06 +09:00
0072836bfc feat(registry): apply new structure of registry 2024-06-15 01:43:34 +09:00
aa074d16c1 fix: add everything for eslint fix 2024-06-14 22:47:39 +09:00
Shinwoo PARK
d8d61aceaa feat: add registry override flag 2024-06-13 19:43:24 +00:00
Shinwoo PARK
a966a85f62 fix: change registry url to githubusercontent 2024-06-13 19:37:44 +00:00
99773f11cc refactor(cli): simplify library installation process
Consolidated the process of installing the library in the "add" command. Simplified the path handling by using the dirname function. Also, the shared-file version dependent part has been removed. Library installation is now based on a singular registry url path instead of component specific versions.
2024-06-11 18:01:51 +09:00
89776267ad refactor(cli): remove redundant functions in registry.ts
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.
2024-06-11 18:01:35 +09:00
dd63fcb753 refactor(cli): remove unused lib array
Deleted the unused 'lib' array from within the 'const.ts' file in the 'cli' package to clean up the codebase.
2024-06-11 17:58:50 +09:00
07d9306dde refactor(cli): update registry path and remove libVersion
Removed the 'libVersion' field from the RegistryComponent interface and updated the 'lib' path in the DEFAULT_CONFIG and 'paths' field in Registry. The 'lib' path now includes the file extension '.tsx', aiming to improve clarity and accuracy.
2024-06-11 17:53:34 +09:00
8062f02a78 refactor(cli): update import statement in add command
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.
2024-06-11 16:31:23 +09:00
fcc35223d3 refactor(cli): update shared module and import paths in config
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'.
2024-06-11 15:30:23 +09:00
556556251f feat(cli): refactor add command and improve module handling
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.
2024-06-11 13:40:45 +09:00
6f5ec5042d refactor(cli): modify return type of getComponentLibVersion
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.
2024-06-11 13:35:27 +09:00
7c3459076a feat(cli): add helper functions for registry management
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.
2024-06-11 13:30:52 +09:00
397210462f feat(cli): update components in Registry interface
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.
2024-06-11 13:25:36 +09:00
090fada7cd refactor(cli): update references to component name
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.
2024-06-11 13:25:23 +09:00
8a8508c8fb refactor(cli): update return value in registry helper
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.
2024-06-11 13:06:06 +09:00
7a82c284fc refactor(cli): update getComponentURL function in registry helper
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.
2024-06-11 13:05:57 +09:00
fb0c33a6cb refactor(cli): update Registry interface in const.ts
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.
2024-06-11 13:03:15 +09:00
274016035f refactor(cli): replace shared with lib in Registry
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.
2024-06-11 13:00:33 +09:00
b962b02690 refactor(cli): rename shared path and import properties to lib
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.
2024-06-11 12:52:25 +09:00
f16a2c9564 refactor(cli): optimize SearchBox setState calls
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.
2024-06-08 05:05:20 +09:00
0c79f86d80 refactor(cli): streamline component selection and overwrite process
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.
2024-06-08 04:10:13 +09:00
ec9dfb9f40 feat(cli): migrate add command to react and implement search functionality
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.
2024-06-08 03:53:15 +09:00
ae018f5176 feat(cli): add Choice component
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.
2024-06-08 03:52:56 +09:00
12b1d530c4 refactor(cli): change onSubmit typing in SearchBox
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.
2024-06-08 02:51:27 +09:00
62e606f273 fix(cli): update dependencies in SearchBox useEffect
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.
2024-06-08 02:46:23 +09:00
483930474b feat(cli): add query mode to SearchBox component
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.
2024-06-08 02:15:08 +09:00
f4b79f1f02 refactor(cli): adjust SearchBox styling
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.
2024-06-08 02:08:44 +09:00
0fea1a50e3 fix(cli): update condition in SearchBox component
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.
2024-06-08 02:08:26 +09:00
803659a06b refactor(cli): remove unused Spinner import
The unnecessary Spinner import from 'ink-spinner' was removed in the SearchBox component. This reduces clutter and enhances code readability.
2024-06-08 02:05:21 +09:00