Skip to content

Commit

Permalink
fix: fix dal runtime dep (#210)
Browse files Browse the repository at this point in the history
<!--
Thank you for your pull request. Please review below requirements.
Bug fixes and new features should include tests and possibly benchmarks.
Contributors guide:
https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md

感谢您贡献代码。请确认下列 checklist 的完成情况。
Bug 修复和新功能必须包含测试,必要时请附上性能测试。
Contributors guide:
https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md
-->

##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to
[x]. -->

- [ ] `npm test` passes
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [ ] commit message follows commit guidelines

##### Affected core subsystem(s)
<!-- Provide affected core subsystem(s). -->


##### Description of change
<!-- Provide a description of the change below this comment. -->

<!--
- any feature?
- close https://github.com/eggjs/egg/ISSUE_URL
-->

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
killagu committed Apr 16, 2024
1 parent c65bbbb commit 5ad7f45
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 25 deletions.
3 changes: 1 addition & 2 deletions core/dal-runtime/package.json
Expand Up @@ -39,7 +39,7 @@
"node": ">=14.0.0"
},
"dependencies": {
"@eggjs/dal-decorator": "^3.37.0",
"@eggjs/tegg": "^3.37.0",
"@eggjs/rds": "^1.0.0",
"js-beautify": "^1.15.1",
"lodash": "^4.17.21",
Expand All @@ -51,7 +51,6 @@
"access": "public"
},
"devDependencies": {
"@eggjs/tegg": "^3.37.0",
"@types/lodash": "^4.17.0",
"@types/mocha": "^10.0.1",
"@types/node": "^20.2.4",
Expand Down
2 changes: 1 addition & 1 deletion core/dal-runtime/src/BaseSqlMap.ts
@@ -1,5 +1,5 @@
import _ from 'lodash';
import { ColumnType, IndexType, SqlType, SqlMap, TableModel } from '@eggjs/dal-decorator';
import { ColumnType, IndexType, SqlType, SqlMap, TableModel } from '@eggjs/tegg/dal';
import { Logger } from '@eggjs/tegg';
import { TemplateUtil } from './TemplateUtil';

Expand Down
4 changes: 2 additions & 2 deletions core/dal-runtime/src/CodeGenerator.ts
Expand Up @@ -2,8 +2,8 @@ import nunjucks, { type Environment } from 'nunjucks';
import path from 'node:path';
import _ from 'lodash';
import { TemplateUtil } from './TemplateUtil';
import { ColumnModel, TableModel } from '@eggjs/dal-decorator';
import { PrototypeUtil } from '@eggjs/core-decorator';
import { ColumnModel, TableModel } from '@eggjs/tegg/dal';
import { PrototypeUtil } from '@eggjs/tegg';
import fs from 'node:fs/promises';
import { js_beautify } from 'js-beautify';
import { SqlGenerator } from './SqlGenerator';
Expand Down
2 changes: 1 addition & 1 deletion core/dal-runtime/src/DataSource.ts
@@ -1,4 +1,4 @@
import { DataSource as IDataSource, PaginateData, SqlType, TableModel } from '@eggjs/dal-decorator';
import { DataSource as IDataSource, PaginateData, SqlType, TableModel } from '@eggjs/tegg/dal';
import { MysqlDataSource } from './MySqlDataSource';
import { TableSqlMap } from './TableSqlMap';
import { TableModelInstanceBuilder } from './TableModelInstanceBuilder';
Expand Down
2 changes: 1 addition & 1 deletion core/dal-runtime/src/SqlGenerator.ts
Expand Up @@ -5,7 +5,7 @@ import {
ColumnTypeParams,
IndexModel, IndexType,
TableModel,
} from '@eggjs/dal-decorator';
} from '@eggjs/tegg/dal';

// TODO diff 实现
export class SqlGenerator {
Expand Down
2 changes: 1 addition & 1 deletion core/dal-runtime/src/SqlMapLoader.ts
@@ -1,5 +1,5 @@
import path from 'node:path';
import { TableModel, SqlMap } from '@eggjs/dal-decorator';
import { TableModel, SqlMap } from '@eggjs/tegg/dal';
import { Logger } from '@eggjs/tegg';
import { BaseSqlMapGenerator } from './BaseSqlMap';
import { TableSqlMap } from './TableSqlMap';
Expand Down
2 changes: 1 addition & 1 deletion core/dal-runtime/src/TableModelInstanceBuilder.ts
@@ -1,4 +1,4 @@
import { TableModel } from '@eggjs/dal-decorator';
import { TableModel } from '@eggjs/tegg/dal';

export class TableModelInstanceBuilder {
constructor(tableModel: TableModel, row: Record<string, any>) {
Expand Down
2 changes: 1 addition & 1 deletion core/dal-runtime/src/TableSqlMap.ts
Expand Up @@ -2,7 +2,7 @@
import { Template } from 'nunjucks';
import { NunjucksUtils } from './NunjucksUtil';
import { TemplateUtil } from './TemplateUtil';
import { SqlMap, SqlType } from '@eggjs/dal-decorator';
import { SqlMap, SqlType } from '@eggjs/tegg/dal';

export interface SqlGenerator {
type: SqlType;
Expand Down
2 changes: 1 addition & 1 deletion core/dal-runtime/src/TemplateUtil.ts
Expand Up @@ -9,7 +9,7 @@ import {
MultiPolygon,
Point,
Polygon, SpatialHelper,
} from '@eggjs/dal-decorator';
} from '@eggjs/tegg/dal';

export class TemplateUtil {
static isSpatialType(columnModel: ColumnModel): boolean {
Expand Down
3 changes: 1 addition & 2 deletions plugin/dal/lib/DalModuleLoadUnitHook.ts
@@ -1,7 +1,6 @@
import { MysqlDataSourceManager } from './MysqlDataSourceManager';
import path from 'node:path';
import { LifecycleHook } from '@eggjs/tegg-lifecycle';
import { ModuleConfigHolder } from '@eggjs/tegg-common-util';
import { LifecycleHook, ModuleConfigHolder } from '@eggjs/tegg';
import { DatabaseForker, DataSourceOptions } from '@eggjs/dal-runtime';
import { LoadUnit, LoadUnitLifecycleContext } from '@eggjs/tegg/helper';

Expand Down
5 changes: 2 additions & 3 deletions plugin/dal/lib/DalTableEggPrototypeHook.ts
@@ -1,7 +1,6 @@
import { LifecycleHook } from '@eggjs/tegg-lifecycle';
import { EggPrototype, EggPrototypeLifecycleContext } from '@eggjs/tegg-metadata';
import { Logger, LifecycleHook } from '@eggjs/tegg';
import { EggPrototype, EggPrototypeLifecycleContext } from '@eggjs/tegg/helper';
import { TableInfoUtil, TableModel } from '@eggjs/dal-decorator';
import { Logger } from '@eggjs/tegg';
import { SqlMapLoader } from '@eggjs/dal-runtime';
import { TableModelManager } from './TableModelManager';
import { SqlMapManager } from './SqlMapManager';
Expand Down
4 changes: 1 addition & 3 deletions plugin/dal/lib/DataSource.ts
Expand Up @@ -9,19 +9,17 @@ import {
ObjectInitType,
LifecycleInit,
} from '@eggjs/tegg';
import { ModuleConfigUtil } from '@eggjs/tegg-common-util';
import { ModuleConfigUtil, LoaderUtil, EggObject, EggObjectLifeCycleContext } from '@eggjs/tegg/helper';
import {
DataSourceInjectName,
DataSourceQualifierAttribute,
TableInfoUtil,
DataSource as IDataSource, TableModel, PaginateData,
} from '@eggjs/tegg/dal';
import { DataSource } from '@eggjs/dal-runtime';
import { EggObject, EggObjectLifeCycleContext } from '@eggjs/tegg-runtime';
import { TableModelManager } from './TableModelManager';
import { MysqlDataSourceManager } from './MysqlDataSourceManager';
import { SqlMapManager } from './SqlMapManager';
import { LoaderUtil } from '@eggjs/tegg/helper';

@MultiInstanceProto({
accessLevel: AccessLevel.PUBLIC,
Expand Down
7 changes: 1 addition & 6 deletions plugin/dal/package.json
Expand Up @@ -50,12 +50,7 @@
"node": ">=14.0.0"
},
"dependencies": {
"@eggjs/core-decorator": "^3.37.0",
"@eggjs/dal-decorator": "^3.37.0",
"@eggjs/dal-runtime": "^3.37.0",
"@eggjs/tegg": "^3.37.0",
"@eggjs/tegg-common-util": "^3.37.0",
"@eggjs/tegg-lifecycle": "^3.37.0"
"@eggjs/dal-runtime": "^3.37.0"
},
"devDependencies": {
"@eggjs/tegg-config": "^3.37.0",
Expand Down

0 comments on commit 5ad7f45

Please sign in to comment.