Skip to content
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

fix: fix dal runtime dep #210

Merged
merged 1 commit into from
Apr 16, 2024
Merged

fix: fix dal runtime dep #210

merged 1 commit into from
Apr 16, 2024

Conversation

killagu
Copy link
Contributor

@killagu killagu commented Apr 16, 2024

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

Summary by CodeRabbit

  • Refactor
    • Updated the project to use the new @eggjs/tegg package, enhancing the underlying technology stack.
  • Chores
    • Simplified dependencies in package.json files, focusing on essential libraries to streamline project maintenance.

Copy link

coderabbitai bot commented Apr 16, 2024

Walkthrough

The recent updates primarily involve transitioning from @eggjs/dal-decorator to @eggjs/tegg across various files in the core/dal-runtime and plugin/dal directories. This change includes updating import paths and cleaning up dependencies, streamlining the integration of the new @eggjs/tegg module into the existing codebase.

Changes

File Path Change Summary
core/dal-runtime/.../package.json Replaced @eggjs/dal-decorator with @eggjs/tegg; removed @eggjs/tegg from devDependencies.
core/dal-runtime/.../*.ts (multiple files) Updated import paths from @eggjs/dal-decorator to @eggjs/tegg/dal and @eggjs/tegg for various classes and utilities.
plugin/dal/.../DalModuleLoadUnitHook.ts Modified imports to include ModuleConfigHolder from @eggjs/tegg.
plugin/dal/.../DalTableEggPrototypeHook.ts Reorganized imports related to Logger and LifecycleHook within @eggjs/tegg packages.
plugin/dal/.../DataSource.ts Added imports for LoaderUtil, EggObject, and EggObjectLifeCycleContext from @eggjs/tegg/helper.
plugin/dal/.../package.json Simplified dependencies, retaining only @eggjs/dal-runtime.

🐰✨
A hop, a skip, in the code we dip,
From dal-decorator to tegg we flip.
Update paths, clean the stash,
With every line, we make a splash!
Cheers to changes, big and small,
In the world of code, we grow tall! 🌱
🐰✨


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c65bbbb and f4a3401.
Files selected for processing (13)
  • core/dal-runtime/package.json (2 hunks)
  • core/dal-runtime/src/BaseSqlMap.ts (1 hunks)
  • core/dal-runtime/src/CodeGenerator.ts (1 hunks)
  • core/dal-runtime/src/DataSource.ts (1 hunks)
  • core/dal-runtime/src/SqlGenerator.ts (1 hunks)
  • core/dal-runtime/src/SqlMapLoader.ts (1 hunks)
  • core/dal-runtime/src/TableModelInstanceBuilder.ts (1 hunks)
  • core/dal-runtime/src/TableSqlMap.ts (1 hunks)
  • core/dal-runtime/src/TemplateUtil.ts (1 hunks)
  • plugin/dal/lib/DalModuleLoadUnitHook.ts (1 hunks)
  • plugin/dal/lib/DalTableEggPrototypeHook.ts (1 hunks)
  • plugin/dal/lib/DataSource.ts (1 hunks)
  • plugin/dal/package.json (1 hunks)
Files skipped from review due to trivial changes (1)
  • plugin/dal/lib/DalTableEggPrototypeHook.ts
Additional Context Used
Learnings (3)
core/dal-runtime/src/SqlMapLoader.ts (1)
User: fengmk2"
PR: eggjs/tegg#192
File: core/dal-runtime/src/BaseSqlMap.ts:56-84
Timestamp: 2024-03-21T01:23:50.031Z
Learning: A GitHub issue was opened to track the implementation of index left matching in the `BaseSqlMapGenerator` class, as per user request.
core/dal-runtime/src/TableSqlMap.ts (1)
User: fengmk2"
PR: eggjs/tegg#192
File: core/dal-runtime/src/BaseSqlMap.ts:56-84
Timestamp: 2024-03-21T01:23:50.031Z
Learning: A GitHub issue was opened to track the implementation of index left matching in the `BaseSqlMapGenerator` class, as per user request.
core/dal-runtime/src/BaseSqlMap.ts (1)
User: fengmk2"
PR: eggjs/tegg#192
File: core/dal-runtime/src/BaseSqlMap.ts:56-84
Timestamp: 2024-03-21T01:23:50.031Z
Learning: A GitHub issue was opened to track the implementation of index left matching in the `BaseSqlMapGenerator` class, as per user request.
Additional comments not posted (10)
core/dal-runtime/src/TableModelInstanceBuilder.ts (1)

1-1: Updated import path for TableModel aligns with the PR's objectives.

core/dal-runtime/src/SqlMapLoader.ts (1)

2-2: Updated import paths for TableModel and SqlMap are correct and align with the PR's objectives.

plugin/dal/lib/DalModuleLoadUnitHook.ts (1)

3-3: Updated import path for ModuleConfigHolder aligns with the PR's objectives and is correctly integrated into the class.

core/dal-runtime/src/TemplateUtil.ts (1)

12-12: Updated import paths for spatial data type modules are correct and align with the PR's objectives.

core/dal-runtime/src/TableSqlMap.ts (1)

5-5: Updated import paths for SqlMap and SqlType are correct and align with the PR's objectives.

core/dal-runtime/src/DataSource.ts (1)

1-1: Updated import paths for DataSource, PaginateData, SqlType, and TableModel are correct and align with the PR's objectives.

plugin/dal/lib/DataSource.ts (1)

12-12: Ensure that the newly imported modules (LoaderUtil, EggObject, EggObjectLifeCycleContext) are utilized effectively within the file.

Verification successful

The verification process has confirmed that the newly imported modules LoaderUtil, EggObject, and EggObjectLifeCycleContext from @eggjs/tegg/helper are indeed utilized within the DataSource.ts file. Specifically:

  • LoaderUtil is used in a filter operation to determine DAO files.
  • EggObjectLifeCycleContext and EggObject are used as parameters in the init method, indicating their roles in object lifecycle management.

This confirms that the imports are not only present but are actively used in the code, aligning with the intended modifications in the pull request.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for usage of LoaderUtil, EggObject, and EggObjectLifeCycleContext in DataSource.ts
rg --type ts "LoaderUtil|EggObject|EggObjectLifeCycleContext" plugin/dal/lib/DataSource.ts

Length of output: 338

core/dal-runtime/src/CodeGenerator.ts (1)

5-6: Updated import paths for ColumnModel, TableModel, and PrototypeUtil look correct. Ensure that these classes are used appropriately throughout the file.

Verification successful

The verification process has confirmed that the updated import paths for ColumnModel, TableModel, and PrototypeUtil are correctly used within the CodeGenerator.ts file. The classes are referenced in the methods genCode and generate, and their methods and properties are accessed as expected based on the import paths provided.

This confirms that the changes made to the import paths are correctly implemented and function as intended within the context of the CodeGenerator.ts file.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for usage of ColumnModel, TableModel, and PrototypeUtil in CodeGenerator.ts
rg --type ts "ColumnModel|TableModel|PrototypeUtil" core/dal-runtime/src/CodeGenerator.ts

Length of output: 562

core/dal-runtime/src/BaseSqlMap.ts (1)

2-2: Updated import paths for SqlMap and related entities look correct. Ensure that these classes are used appropriately throughout the file.

Verification successful

The verification process focused on ensuring that the updated import paths for SqlMap and related entities in BaseSqlMap.ts are correctly used throughout the file. The script output confirms that these entities are indeed utilized within the file, specifically within the BaseSqlMapGenerator class and its methods.

Here's a breakdown of the findings:

  • The import statement includes SqlMap and TableModel from @eggjs/tegg/dal.
  • TableModel is used as a type for a private member tableModel and as a parameter in the constructor of BaseSqlMapGenerator.
  • SqlMap is used as a return type in the load method, indicating that it maps strings to SqlMap instances.
  • The GenerateSqlMap interface is used in several places, suggesting that it is a related entity, possibly used to structure SQL map generation logic.

Given this information, the usage of SqlMap and TableModel aligns with their import, confirming that the updated paths are correctly implemented and utilized in the file. Therefore, the review comment is consistent with the codebase.

Conclusion: The updated import paths for SqlMap and related entities are correctly implemented and used in BaseSqlMap.ts.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for usage of SqlMap and related entities in BaseSqlMap.ts
rg --type ts "SqlMap|TableModel" core/dal-runtime/src/BaseSqlMap.ts

Length of output: 672

core/dal-runtime/src/SqlGenerator.ts (1)

8-8: Updated import paths in SqlGenerator.ts look correct. Ensure that these classes are used appropriately throughout the file.

Verification successful

The output from the executed script confirms that the imported entities from @eggjs/tegg/dal in SqlGenerator.ts are indeed being used throughout the file. The entities such as BaseSpatialParams, ColumnModel, ColumnType, ColumnTypeParams, IndexModel, IndexType, and TableModel are referenced in various methods like generateColumn, generateColumnType, generateIndex, and generateTableOptions. This usage aligns with the expectations set by the import statement.

Given this information, the updated import paths and their usage within SqlGenerator.ts are verified to be correct and appropriately implemented. There is no indication of misuse or incorrect references of these classes in the provided context.

Updated import paths in SqlGenerator.ts are verified to be correct and used appropriately throughout the file.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Search for usage of imported entities in SqlGenerator.ts
rg --type ts "BaseSpatialParams|ColumnModel|ColumnType|ColumnTypeParams|IndexModel|IndexType|TableModel" core/dal-runtime/src/SqlGenerator.ts

Length of output: 2430


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

plugin/dal/package.json Show resolved Hide resolved
core/dal-runtime/package.json Show resolved Hide resolved
@killagu killagu merged commit 5ad7f45 into master Apr 16, 2024
11 checks passed
@killagu killagu deleted the fix/dal-dep branch April 16, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant