Commit ed61bc7
authored
refactor: Formatting and linting (#71)
* chore: Remove .prettierc configuration file
* chore: Add Prettier configuration files
- Introduced .prettierignore to exclude unnecessary files from formatting.
- Added .prettierrc with custom formatting rules to ensure consistent code style across the project.
* style: Standardize quotes in codebase
- Replaced double quotes with single quotes in various files for consistency across the codebase.
- Updated configuration files, service definitions, and test cases to adhere to the new style guide.
- Ensured that all instances of string literals are uniformly formatted to enhance readability and maintainability.
* chore: Add ESLint configuration and ignore files
- Introduced .eslintignore to exclude unnecessary files and directories from linting.
- Added eslint.config.js to establish linting rules and configurations for JavaScript and TypeScript files.
- Updated package.json to include ESLint as a development dependency and added linting scripts for code quality enforcement.
* refactor: Reorganize import statements across multiple files
- Cleaned up import statements in various files by rearranging and consolidating imports for better readability and maintainability.
- Ensured consistent import order and structure, enhancing the overall organization of the codebase.
- Updated test files to reflect the new import structure, ensuring all tests remain functional and organized.
* chore: Remove .eslintignore and update ESLint configuration
- Deleted the .eslintignore file to streamline linting processes.
- Updated eslint.config.js to refine file patterns for TypeScript and JavaScript linting, ensuring only relevant files are included and unnecessary directories are ignored.
* chore: Remove unused extractContentFromTags function and its tests
- Deleted the extractContentFromTags function from parsers.ts as it is no longer needed.
- Removed associated test cases from parsers.test.ts to maintain a clean codebase and eliminate redundancy.
* refactor: Simplify stream response handling in handleStreamResponse function
- Replaced nested for loop with forEach for better readability and maintainability.
- Added early return for lines not starting with 'data: ' to reduce nesting and improve clarity.
- Ensured that error handling remains intact while enhancing the overall structure of the code.
* refactor: Enhance type safety in TimestampConverterTool methods
- Updated the execute and getRawData methods to explicitly return a Promise of string or number, improving type safety and clarity.
- Ensured that the method signatures align with TypeScript best practices, enhancing maintainability and reducing potential runtime errors.
* refactor: Improve error handling and response fetching in ThirdWebTool
- Introduced a new private method `handleNebulaError` to centralize error handling for Axios requests, enhancing code clarity and maintainability.
- Refactored the `askNebula` method to utilize `fetchNebulaResponse`, separating concerns and improving readability.
- Ensured that error messages are more descriptive and consistent, adhering to best practices for user feedback.
* refactor: Enhance type safety and clarity in revenue-related methods
- Introduced explicit return types for methods in RevenueExecutor and RevenueDataExecutor, improving type safety and maintainability.
- Added inferred types for RevenueResponse and RevenueProjectResponse to ensure consistency and clarity in data handling.
- Updated getRawData methods in DePINNinjaTool and DePINScanMetricsTool to reflect new type definitions, enhancing overall code quality.
* refactor: Enhance type safety and clarity in DefiLlamaExecutor methods
- Removed default values for optional parameters to improve clarity and enforce explicit handling.
- Introduced inferred types for parameters and return values in execute methods, enhancing type safety across the DefiLlamaExecutor and its subclasses.
- Simplified method signatures and improved overall code readability by ensuring consistent type definitions.
* refactor: Improve type safety and clarity in LLM interface and implementations
* chore: Remove stream_utils and associated tests
- Deleted the stream_utils.ts file and its corresponding test file to eliminate unused code and maintain a clean codebase.
- This removal aligns with ongoing efforts to streamline the code and improve maintainability.
* refactor: Improve error handling and return type in processStream method
- Updated the return type of processStream to Response for better type safety and clarity.
- Changed the error handling to return a Response object instead of a string, enhancing consistency in response types.
- This refactor aligns with ongoing efforts to improve maintainability and adhere to best practices in error handling.
* refactor: Enhance PebbleTool implementation with improved structure and type safety
- Refactored PebbleTool to extend APITool, improving adherence to SOLID principles and enhancing maintainability.
- Introduced Zod schemas for input validation, ensuring type safety and clarity in parameter handling.
- Simplified the execute method and added private methods for geolocation extraction and Pebble data fetching, improving code readability and separation of concerns.
- Enhanced error handling and logging for better user feedback and debugging capabilities.
* refactor: Simplify getRawData method by extracting coordinate logic
- Refactored the getRawData method in MapboxTool to improve readability and maintainability by introducing a new private method, extractCoordinates, for handling origin and destination coordinate extraction.
- This change adheres to the single-responsibility principle, enhancing code clarity and separation of concerns.
* refactor: Simplify iCalendar parsing logic in LumaEventsTool
- Refactored the parseICalendar method by extracting property handling into dedicated private methods: handleProperty, startNewProperty, continuePrevProperty, and handleCommonProperties.
- This change enhances code readability and maintainability by adhering to the single-responsibility principle and improving the overall structure of the parsing logic.
* refactor: Remove unused storeEventsInKnowledgeBase method from LumaEventsTool
- Deleted the optional storeEventsInKnowledgeBase method to streamline the LumaEventsTool class and eliminate unnecessary code.
- This change enhances maintainability by adhering to the single-responsibility principle and reducing potential confusion in the codebase.
* refactor: Rename Zod schemas and streamline data fetching in L1DataTool
- Renamed Zod schemas to include an underscore prefix for clarity and potential future use.
- Refactored the data fetching logic by introducing a new private method, runFetchers, to enhance readability and maintainability.
- Added helper methods for error logging and result handling, improving code structure and adherence to the single-responsibility principle.
* refactor: Introduce metrics abstraction and streamline result handling in L1DataTool
- Added a centralized metrics object to improve clarity and maintainability of metric keys.
- Refactored the buildResults method to utilize a Map for results, enhancing type safety and reducing redundancy.
- Updated logErrors and runFetchers methods to align with the new metrics structure, improving code organization and adherence to the single-responsibility principle.
- Introduced a MetricFetcher interface to encapsulate fetching logic, further enhancing code clarity and maintainability.
* refactor: Enhance IoIDTool implementation with Zod validation and improved structure
- Refactored IoIDTool to extend APITool, improving adherence to SOLID principles and enhancing maintainability.
- Introduced Zod schemas for input validation, ensuring type safety and clarity in parameter handling.
- Simplified the execute method and added a dedicated getRawData method for better separation of concerns.
- Improved error handling by utilizing Zod for input parsing, enhancing code readability and maintainability.
* refactor: Enhance type safety and clarity in tool implementations
- Updated method signatures across multiple tools to include explicit return types, improving type safety and code clarity.
- Introduced a new type alias for AirQualityResponse to enhance readability and maintainability.
- Refactored the register method in ToolRegistry to specify a return type of void, aligning with best practices for method definitions.
- These changes contribute to a cleaner codebase and adherence to SOLID principles.
* refactor: Streamline project filtering logic and enhance number formatting
- Refactored the filterProjects function to utilize a more modular approach with dedicated filter predicates, improving readability and maintainability.
- Introduced a numberOrZeroIfNanToString utility function for consistent number formatting, enhancing clarity in data presentation.
- These changes adhere to the single-responsibility principle and improve the overall structure of the codebase.
* refactor: Extract query parameter logic into dedicated methods
- Refactored the getRawData and getMetadataV2 methods to improve readability and maintainability by extracting query parameter construction into private methods: buildSearchParams and populateQueryParams.
- This change adheres to the single-responsibility principle, enhancing code clarity and separation of concerns.
* chore: Add globals package for improved linting support
- Included the "globals" package in package.json to enhance linting capabilities and ensure better code quality.
- This addition supports the overall goal of maintaining a clean and maintainable codebase.
* refactor: Enhance ESLint configuration for improved linting and code quality
- Updated the ESLint configuration to include a new base ruleset for production code, improving maintainability and adherence to clean code principles.
- Introduced specific configurations for test files, allowing for more flexible linting rules while still enforcing key clean code practices.
- This refactor aims to streamline the linting process and ensure a consistent coding standard across the codebase.
* chore: Add pnpm-lock.yaml for dependency management
- Introduced a new pnpm-lock.yaml file to manage project dependencies effectively.
- This addition ensures consistent dependency resolution and enhances the overall maintainability of the codebase.
- The lockfile version is set to '9.0', aligning with the latest standards for package management.
* chore: Update .prettierignore to include ESLint and pnpm lock files
- Added .eslintrc.js and pnpm-lock.yaml to .prettierignore to prevent formatting issues with these configuration files.
- This change supports better project organization and maintains a clean codebase by ensuring that essential configuration files are excluded from formatting processes.
* refactor: Improve code formatting and structure in tests and llm module
- Updated test files to enhance readability by removing unnecessary blank lines and simplifying mock implementations.
- Refactored import statements in the llm module for better organization and clarity, adhering to clean code principles.
- These changes contribute to a more maintainable and elegant codebase.
* chore: Update GitHub Actions workflow for improved dependency management
- Upgraded the checkout action to v4 for better performance and reliability.
- Replaced Node.js setup with Bun setup to streamline the JavaScript runtime environment.
- Introduced pnpm for dependency installation and added linting step to ensure code quality.
- These changes enhance the CI/CD process and maintain a clean, efficient workflow.1 parent 6cee1b3 commit ed61bc7
File tree
77 files changed
+9618
-4195
lines changed- .github/workflows
- __tests__
- example
- src
- __tests__
- llm
- logger
- registry
- __tests__
- tools
- __tests__
- types
- types
- utils
- __test__
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
77 files changed
+9618
-4195
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
60 | | - | |
| 59 | + | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
23 | 28 | | |
24 | 29 | | |
25 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
26 | 34 | | |
27 | 35 | | |
28 | | - | |
| 36 | + | |
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
| 205 | + | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
| 327 | + | |
328 | 328 | | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
| 23 | + | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | | - | |
| 74 | + | |
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
16 | 16 | | |
0 commit comments