29 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
36f465f2cf refactor(cli): remove slicing from search helper
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.
2024-06-08 02:04:08 +09:00
48cb320303 feat(cli): add Jaro-Winkler algorithm and getSuggestion method to search helpers
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.
2024-06-07 21:31:27 +09:00
bad0c4f84e feat(cli): colorize log messages
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.
2024-06-07 20:38:24 +09:00
5f50d1d8f6 feat(cli): add realname resolution for components
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.
2024-06-07 00:48:14 +09:00
c5bf5c69b3 feat(cli): add support for different config file formats
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.
2024-06-07 00:33:52 +09:00
be28704cb1 feat(cli): add logging to config validation
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.
2024-06-07 00:11:12 +09:00
acca348e1e feat(cli): handle registry fetching errors
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.
2024-06-07 00:11:01 +09:00
c59c80007a feat(cli): add configuration and path management functionality
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.
2024-06-06 22:07:19 +09:00