-
Notifications
You must be signed in to change notification settings - Fork 2
common to core #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common to core #110
Conversation
WalkthroughThe changes encompass textual modifications primarily in comments across various files, specifically updating terminology from "common information" to "core information" for clarity. Additionally, there is a restructuring of module paths in the Changes
Possibly related PRs
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
package.json (1)
Line range hint
2-2: Consider updating the version numberThe current version "0.0.0-test29" appropriately indicates that the package is in a testing phase. However, given the significant change from "common" to "core", it's important to plan for a version update when these changes are finalized.
Suggestions:
- If this change is backwards-compatible, consider bumping the minor version (e.g., 0.1.0).
- If this is a breaking change, which seems likely, plan to bump the major version to 1.0.0 when ready for a stable release.
- In the meantime, continue incrementing the pre-release number for each significant change or test iteration.
src/zod/index.ts (1)
Line range hint
27-29: Address FIXME comment and review eslint-disable usage.There's a FIXME comment with an eslint-disable next line. Consider addressing this issue:
// FIXME // eslint-disable-next-line @typescript-eslint/no-unused-vars ParamKeys extends string,Additionally, there are multiple eslint-disable comments throughout the file. It's recommended to review these and address the underlying issues if possible, rather than disabling the linter.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (17)
- examples/express/valibot/express.ts (1 hunks)
- examples/express/valibot/fetch.ts (2 hunks)
- examples/express/zod/express.ts (1 hunks)
- examples/express/zod/fetch.ts (2 hunks)
- examples/fastify/zod/fetch.ts (1 hunks)
- package.json (1 hunks)
- src/express/index.ts (1 hunks)
- src/express/valibot.test.ts (1 hunks)
- src/express/valibot.ts (1 hunks)
- src/express/zod.test.ts (1 hunks)
- src/express/zod.ts (1 hunks)
- src/fastify/zod.ts (1 hunks)
- src/fetch/index.t-test.ts (1 hunks)
- src/fetch/index.ts (1 hunks)
- src/index.ts (1 hunks)
- src/valibot/index.ts (1 hunks)
- src/zod/index.ts (1 hunks)
Files skipped from review due to trivial changes (8)
- examples/express/valibot/express.ts
- examples/express/valibot/fetch.ts
- examples/express/zod/express.ts
- examples/express/zod/fetch.ts
- examples/fastify/zod/fetch.ts
- src/express/zod.test.ts
- src/express/zod.ts
- src/fastify/zod.ts
Additional comments not posted (16)
src/index.ts (1)
1-1: LGTM! Verify project-wide impact of this change.The change from
"./common"to"./core"aligns with the PR objective. This modification likely represents a significant refactoring or reorganization of the project structure.To ensure this change doesn't introduce unintended side-effects, please run the following verification:
Also, please ensure that any relevant documentation is updated to reflect this structural change.
Verification successful
Action Required: Re-verify the changes with corrected search parameters.
Please run the following verification scripts to ensure all references to
"./common"have been updated and that the./coremodule exists with the expected exports:
Verified project-wide impact of the change.
All references to
"./common"have been successfully updated to"./core", and the./coremodule exists with the expected exports.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to the old "./common" import # and verify that "./core" exists and exports the expected members. echo "Checking for remaining './common' references:" rg --type typescript '"./common"' echo "\nVerifying './core' exists and its exports:" if [ -f "./src/core.ts" ]; then echo "File ./src/core.ts exists." echo "Exports from ./src/core.ts:" rg --type typescript '^export' ./src/core.ts else echo "Warning: ./src/core.ts does not exist!" fi echo "\nChecking for potential breaking changes:" rg --type typescript 'from\s+["'']\.\.?/common["'']'Length of output: 577
Script:
#!/bin/bash # Description: Corrected script to check for remaining references to "./common" # and verify the existence and exports of "./core". echo "Checking for remaining './common' references:" rg --type ts '"./common"' echo "\nVerifying './core' exists and its exports:" if [ -f "./src/core.ts" ]; then echo "File ./src/core.ts exists." echo "Exports from ./src/core.ts:" rg --type ts '^export' ./src/core.ts elif [ -d "./src/core" ]; then echo "Directory ./src/core/ exists." echo "Exports from ./src/core/index.ts:" rg --type ts '^export' ./src/core/index.ts else echo "Warning: ./src/core.ts or ./src/core/index.ts does not exist!" fi echo "\nChecking for potential breaking changes:" rg --type ts 'from\s+["'']\.\.?/common["'']'Length of output: 752
src/express/valibot.ts (1)
8-8: LGTM! Verify consistency across the codebase.The change from
import { Method } from "../common";toimport { Method } from "../core";aligns with the PR objective of moving from "common" to "core". This refactoring likely improves the project structure.To ensure consistency across the codebase and prevent potential issues, please run the following verification steps:
These checks will help ensure that:
- No other files are still importing
Methodfrom "../common".- The "../core" module exists and exports the
Methodtype.- There are no potential compilation errors related to the
Methodtype usage.Verification successful
Further verification needed: Adjust shell scripts to correctly recognize TypeScript files.
Further verification needed: Adjust shell scripts to correctly target TypeScript files using file extensions.
Import statement correctly updated to '../core'.
No remaining imports from "../common" were found, and the "../core" module properly exports the
Methodtype.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistency of Method import across the codebase # Test 1: Check for any remaining imports of Method from "../common" echo "Checking for remaining imports from '../common':" rg --type typescript 'import.*Method.*from.*"../common"' # Test 2: Verify that "../core" exists and exports Method echo "Verifying '../core' module:" fd -e ts -e tsx core.ts -x cat {} | rg 'export.*Method' # Test 3: Check for any compilation errors related to Method import echo "Checking for potential compilation errors:" rg --type typescript 'Method.*' | rg -v 'import'Length of output: 516
Script:
#!/bin/bash # Description: Verify the consistency of Method import across the codebase # Test 1: Check for any remaining imports of Method from "../common" echo "Checking for remaining imports from '../common':" rg --type ts 'import.*Method.*from.*"../common"' rg --type tsx 'import.*Method.*from.*"../common"' # Test 2: Verify that "../core" exists and exports Method echo "Verifying '../core' module exports Method:" rg --type ts 'export.*Method' src/core/ rg --type tsx 'export.*Method' src/core/ # Test 3: Check for any potential usage issues related to Method import echo "Checking for potential usage issues of Method import:" rg --type ts 'Method\s*\.' src/ rg --type tsx 'Method\s*\.' src/Length of output: 1135
Script:
#!/bin/bash # Description: Verify the consistency of Method import across the codebase # Test 1: Check for any remaining imports of Method from "../common" echo "Checking for remaining imports from '../common':" rg 'import.*Method.*from.*"../common"' --glob "*.ts" --glob "*.tsx" # Test 2: Verify that "../core" exists and exports Method echo "Verifying '../core' module exports Method:" rg 'export.*Method' src/core/ --glob "*.ts" --glob "*.tsx" # Test 3: Check for any potential usage issues related to Method import echo "Checking for potential usage issues of Method import:" rg 'Method\s*\.' src/ --glob "*.ts" --glob "*.tsx"Length of output: 978
src/fetch/index.ts (2)
Line range hint
1-93: Overall changes look good and well-integrated.The modifications to the import statements have been correctly integrated with the rest of the file. The imported types are used consistently throughout the code, and no other changes were necessary as a result of the refactoring.
16-17: LGTM! Verify impact on other files.The changes to import statements look good. They reflect a refactoring from the "common" module to the "core" module, which can improve the overall structure of the project.
To ensure consistency across the codebase, let's verify that no other files are still importing these types from "../common":
package.json (2)
76-79: Approve: Good structural improvementThe renaming of "common" to "core" appears to be a positive architectural decision, potentially clarifying the role of this module in the overall project structure. The modular approach evident in the
exportsfield, with separate paths for different functionalities (core, express, fetch, etc.), is a good practice that enhances maintainability and allows for more flexible use of the library.Keep up the good work on improving the project's architecture!
76-79: Potential breaking change: "./common" renamed to "./core"The replacement of "./common" with "./core" in the
exportsfield represents a significant change in the project structure. This modification aligns with the PR title "common to core" and appears to be an intentional refactoring.However, this change may break existing code that imports from "./common". To mitigate potential issues:
- Ensure that all internal references to "./common" have been updated to "./core".
- Update the project's documentation to reflect this change, including any README files, API documentation, and usage examples.
- Consider adding a note in the changelog about this breaking change.
- If backwards compatibility is a concern, consider providing a temporary alias or migration guide for users of the library.
To verify the impact of this change, please run the following script:
This script will help identify any remaining references to the old "./common" path that need to be updated.
Verification successful
Verification Successful: No remaining references to './common'
All references to './common' have been successfully removed from the project. The transition from "./common" to "./core" in the
exportsfield does not leave any lingering references that could cause issues for consumers of the library.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining references to './common' in the project # Search for './common' in all files echo "Searching for './common' references:" rg --type-not json './common' # Search for 'from "common"' or "from 'common'" in TypeScript/JavaScript files echo "Searching for imports from 'common':" rg --type ts --type js 'from ["\']common["\']'Length of output: 302
Script:
#!/bin/bash # Description: Check for any remaining references to './common' in the project # Search for './common' in all files excluding JSON files echo "Searching for './common' references in non-JSON files:" rg --type-not json '\./common' # Search for imports from 'common' in TypeScript and JavaScript files echo "Searching for imports from 'common' in TypeScript and JavaScript files:" rg --type ts --type js "from ['\"]common['\"]"Length of output: 369
src/zod/index.ts (2)
15-15: LGTM. Verify consistent import updates for the 'validate' submodule.The change from '../common/validate' to '../core/validate' is consistent with the PR objective. Ensure that all other files importing these modules have been updated accordingly.
Run the following script to verify the import consistency for the 'validate' submodule:
Verification successful
Verified: No remaining imports from '../common/validate' found.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining imports from '../common/validate' for the moved modules. # Test: Search for imports from '../common/validate'. Expect: No results. rg --type typescript "from ['\"]../common/validate['\"]" -g '!src/zod/index.ts'Length of output: 120
Script:
#!/bin/bash # Description: Check for any remaining imports from '../common/validate' for the moved modules. # Test: Search for imports from '../common/validate'. Expect: No results. rg "from ['\"]../common/validate['\"]" -g "*.ts" -g "*.tsx" -g '!src/zod/index.ts'Length of output: 88
9-9: LGTM. Verify consistent import updates across the codebase.The change from '../common' to '../core' aligns with the PR objective. However, ensure that all other files importing these modules have been updated consistently.
Run the following script to verify the import consistency:
src/valibot/index.ts (2)
10-10: Verify consistency of moved entities.While the import path changes don't affect how the imported entities are used in this file, it's crucial to ensure that the entities moved from "../common" to "../core" maintain the same interface and functionality. This will prevent any potential breaking changes in the codebase.
Let's verify the consistency of the moved entities:
Also applies to: 16-16
10-10: LGTM: Import paths updated correctly.The import paths have been successfully updated from "../common" to "../core", which aligns with the PR objective of moving from "common to core". This change appears to be part of a larger refactoring effort to reorganize the project structure.
Let's verify that these are the only occurrences of "../common" in the file:
Also applies to: 16-16
Verification successful
Verified: No remaining "../common" imports found.
All import paths have been successfully updated from"../common"to"../core", and no instances of"../common"remain insrc/valibot/index.ts.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining "../common" imports in the file. # Test: Search for "../common" in the file. Expect: No matches. rg --type typescript '../common' src/valibot/index.tsLength of output: 88
Script:
#!/bin/bash # Description: Check for any remaining "../common" imports in the file. # Test: Search for "../common" in the file. Expect: No matches. rg --type ts '../common' src/valibot/index.tsLength of output: 45
Script:
#!/bin/bash # Description: Check for any remaining "../common" imports in the file. # Test: Search for "../common" in the file. Expect: No matches. grep "../common" src/valibot/index.tsLength of output: 37
src/express/index.ts (3)
16-22: Ensure comprehensive testing after directory restructuring.The changes to import statements from "../common" to "../core" appear to be part of a larger refactoring effort. While the changes in this file are straightforward, they may have a broader impact on the project structure and organization.
To ensure that these changes don't introduce any regressions:
- Run the full test suite to verify that all functionality remains intact.
- Perform a manual smoke test of the affected modules to ensure they work as expected.
- Consider updating any documentation that may reference the old directory structure.
Please run the following script to check for any test files that might need updating:
#!/bin/bash # Description: Find test files that might need updating # Test: Search for test files containing "common". Expect: List of test files that might need updating. fd -e test.ts -e spec.ts | xargs rg 'common'
16-16: LGTM. Verify consistency across the codebase.The import path update from "../common" to "../core" for
StatusCodeis correct and aligns with the PR objectives.To ensure consistency, please run the following script to check for any remaining imports from "../common":
Verification successful
Verified. No remaining imports from "../common" found in TypeScript files.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining imports from "../common" # Test: Search for imports from "../common". Expect: No results. rg --type typescript 'from "../common"'Length of output: 76
Script:
#!/bin/bash # Description: Check for any remaining imports from "../common" in TypeScript files # Test: Search for imports from "../common" in .ts and .tsx files. Expect: No results. rg --glob '*.ts' --glob '*.tsx' 'from "\.\./common"'Length of output: 54
Script:
#!/bin/bash # Description: Check for any remaining imports from "../common" in TypeScript files # Test: Search for imports from "../common" in .ts and .tsx files. Expect: No results. rg 'from "../common"' --glob '*.ts' --glob '*.tsx'Length of output: 52
22-22: LGTM. Verify consistency across the codebase.The import path update from "../common/validate" to "../core/validate" for
AnyValidators,ValidatorsInput, andValidatorsMapis correct and aligns with the PR objectives.To ensure consistency, please run the following script to check for any remaining imports from "../common/validate":
src/fetch/index.t-test.ts (2)
Line range hint
1-278: LGTM! No further changes required in this file.After reviewing the entire file, I can confirm that:
- The change in the import statement is the only modification.
- All test cases are using the imported types correctly.
- No references to "../common" are found in the rest of the file.
The tests appear to be comprehensive and cover various scenarios for the fetch API wrapper.
Tools
Biome
[error] 4-4: Shouldn't redeclare 'JSONT'. Consider to delete it or rename it.
'JSONT' is defined here:
(lint/suspicious/noRedeclare)
1-1: LGTM! Verify import consistency across the project.The change from importing
AsJsonApiandDefineApiEndpointsfrom "../common" to "../core" looks good. This suggests a refactoring of the project structure.To ensure consistency, please run the following script to check for any remaining imports from "../common" that might need updating:
Verification successful
Please update the script to use the correct TypeScript type identifiers or remove the type specification if necessary. Here's an updated script using
tsandtsx:
Please update the script to target TypeScript files using glob patterns. Here's the revised script:
Import consistency verified successfully. No remaining imports from "../common" found.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for remaining imports from "../common" # Test: Search for imports from "../common". Expect: No results. rg --type typescript 'from "../common"'Length of output: 76
Script:
#!/bin/bash # Description: Check for remaining imports from "../common" # Test: Search for imports from "../common" in TypeScript files. Expect: No results. rg --type ts --type tsx 'from "../common"'Length of output: 72
Script:
#!/bin/bash # Description: Check for remaining imports from "../common" # Test: Search for imports from "../common" in TypeScript files. Expect: No results. rg 'from "../common"' --glob '*.ts' --glob '*.tsx'Length of output: 52
src/express/valibot.test.ts (1)
7-7: Approve the import path change and verify project-wide consistency.The change from
../commonto../corefor importingParseUrlParamslooks good. This suggests a refactoring of the project structure, movingParseUrlParamsfrom thecommondirectory to thecoredirectory.To ensure this change is consistent across the project and doesn't introduce any issues, please run the following verification script:
This script will help ensure that:
- There are no remaining imports from
../common.- All imports of
ParseUrlParamsare now from../core.- There are no remaining files in the
commondirectory that might need to be moved.ParseUrlParamsexists and is exported in thecoredirectory.Please review the results of this script and make any necessary adjustments to ensure project-wide consistency.
Summary by CodeRabbit
New Features
Chores
../commonto../corein multiple files, indicating a reorganization of the codebase.Documentation