-
Notifications
You must be signed in to change notification settings - Fork 102
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
Import AML in CLI #337
Import AML in CLI #337
Conversation
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe changes involve updates to the Changes
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 (3)
cli/src/convert.ts (3)
45-49
: Consider improving error handling and implementation strategyThe current implementation returns a generic "not available" error. Consider:
- Adding more specific error information from the detailed comment in the error message
- Implementing feature detection to provide better feedback about why AML parsing isn't available
if (dialect === 'aml') { - return ParserResult.failure([{message: 'AML parser not available', kind: 'NotImplemented', level: 'error', offset: {start: 0, end: 0}, position: {start: {line: 0, column: 0}, end: {line: 0, column: 0}}}]) + return ParserResult.failure([{ + message: 'AML parser module not found. Please ensure @azimutt/aml is properly installed.', + kind: 'ModuleNotFound', + level: 'error', + offset: {start: 0, end: 0}, + position: {start: {line: 0, column: 0}, end: {line: 0, column: 0}} + }]) }
55-58
: Maintain consistent error handling between parse and generate functionsThe error handling approach differs between
parseDialect
andgenerateDialect
. Consider:
- Using the same error structure for consistency
- Providing more detailed error information
if (dialect === 'aml') { - return Result.failure('AML generator not available') + return Result.failure('AML generator module not found. Please ensure @azimutt/aml is properly installed.') }
AML module is implemented but not properly imported
The AML module is fully implemented in
libs/aml/src/
with all necessary components:
- The module exports
parseAml
andgenerateAml
functions inindex.ts
- Implementation files exist:
amlAst.ts
,amlParser.ts
,amlGenerator.ts
- Tests are present:
amlGenerator.test.ts
,amlParser.test.ts
The issue in
cli/src/convert.ts
is just an import problem. The commented import should be uncommented and the TODOs in the implementation should be removed since the functionality is available.🔗 Analysis chain
Line range hint
11-58
: Verify complete AML implementation pathLet's verify the implementation status of the AML module and related dependencies.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Check for AML module implementation files echo "Checking for AML implementation files..." fd -t f "aml" libs/aml/src # Check for any existing AML-related tests echo -e "\nChecking for AML-related tests..." fd -t f "aml" -e test.ts -e spec.ts # Check for any existing AML documentation echo -e "\nChecking for AML documentation..." fd -t f "aml" -e md docsLength of output: 698
Script:
#!/bin/bash # Let's check the content of the AML implementation files to verify their status echo "Checking AML implementation status..." for file in libs/aml/src/amlAst.ts libs/aml/src/amlParser.ts libs/aml/src/amlGenerator.ts; do echo -e "\n=== Content of $file ===" head -n 20 "$file" done # Check if the AML module is properly exported echo -e "\n=== Checking AML exports ===" cat libs/aml/src/index.ts # Check package.json for AML module configuration echo -e "\n=== Checking package.json for AML configuration ===" cat libs/aml/package.jsonLength of output: 7329
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
cli/package.json
(1 hunks)cli/src/convert.ts
(2 hunks)
🔇 Additional comments (3)
cli/package.json (2)
44-44
: LGTM! Dependency addition follows workspace patterns
The new @azimutt/aml
dependency follows the same workspace pattern as other internal packages.
44-44
: Verify workspace dependency resolution
Let's ensure the workspace is properly configured and the new dependency can be resolved.
✅ Verification successful
Workspace dependency resolution is properly configured
The workspace setup is valid and all required dependencies are present:
- Found
pnpm-workspace.yaml
confirming workspace configuration @azimutt/aml
package exists with version 0.1.10- Required workspace dependencies are available:
@azimutt/models
(v0.1.16)@azimutt/utils
(v0.1.7)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify workspace setup and dependency resolution
# Check if package exists in workspace
fd -t f "package.json" | xargs cat | jq 'select(.name=="@azimutt/aml")'
# Check for potential workspace configuration
fd -t f "pnpm-workspace.yaml" -t f "rush.json" -t f "lerna.json"
Length of output: 1768
Script:
#!/bin/bash
# Let's check for workspace configuration and verify the dependency structure
# Check for pnpm workspace configuration
fd -t f "pnpm-workspace.yaml"
# Look for package.json files in the root and potential workspace packages
fd -t f "package.json" -d 1
# Check if @azimutt/models and @azimutt/utils (dependencies of aml) exist
fd -t f "package.json" | xargs cat | jq 'select(.name | contains("@azimutt/models") or contains("@azimutt/utils"))'
Length of output: 2119
cli/src/convert.ts (1)
11-11
: Verify AML module implementation status
The TODO comment suggests that the AML module implementation is pending. Since this PR's objective is to import AML in CLI, we should clarify if this is intentionally left as a TODO or if it needs to be implemented as part of this PR.
Would you like help implementing the AML parser and generator functions? I can assist in creating the implementation or open a GitHub issue to track this task.
Closed, started again on #339
Parser SQL
Rollup don't like CommonJS but still generate the bundle.
`npm run build` logs:
Parser DBML
Rollup don't like CommonJS but still generate the bundle.
`npm run build` logs:
Parser Prisma
Rollup don't like CommonJS but still generate the bundle.
`npm run build` logs
CLI project
commonjs
because ofcli/src/utils/file.ts:21
(fileURLToPath(import.meta.url)
)chalk
is an ESM lib :/Summary by CodeRabbit
New Features
Documentation
Chores
@azimutt/aml
.