chore: release packages (#411)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
71022abc99
commit
35d81880a7
@@ -1,48 +0,0 @@
|
|||||||
---
|
|
||||||
"@esengine/database-drivers": minor
|
|
||||||
"@esengine/database": minor
|
|
||||||
"@esengine/transaction": minor
|
|
||||||
---
|
|
||||||
|
|
||||||
feat: add database layer architecture
|
|
||||||
|
|
||||||
Added new database packages with layered architecture:
|
|
||||||
|
|
||||||
**@esengine/database-drivers (Layer 1)**
|
|
||||||
- MongoDB connection with pool management, auto-reconnect, events
|
|
||||||
- Redis connection with auto-reconnect, key prefix
|
|
||||||
- Type-safe `IMongoCollection<T>` interface decoupled from mongodb types
|
|
||||||
- Service tokens for dependency injection (`MongoConnectionToken`, `RedisConnectionToken`)
|
|
||||||
|
|
||||||
**@esengine/database (Layer 2)**
|
|
||||||
- Generic `Repository<T>` with CRUD, pagination, soft delete
|
|
||||||
- `UserRepository` with registration, authentication, role management
|
|
||||||
- Password hashing utilities using scrypt
|
|
||||||
- Query operators: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$like`, `$regex`
|
|
||||||
|
|
||||||
**@esengine/transaction**
|
|
||||||
- Refactored `MongoStorage` to use shared connection from `@esengine/database-drivers`
|
|
||||||
- Removed factory pattern in favor of shared connection (breaking change)
|
|
||||||
- Simplified API: `createMongoStorage(connection, options?)`
|
|
||||||
|
|
||||||
Example usage:
|
|
||||||
```typescript
|
|
||||||
import { createMongoConnection } from '@esengine/database-drivers'
|
|
||||||
import { UserRepository } from '@esengine/database'
|
|
||||||
import { createMongoStorage, TransactionManager } from '@esengine/transaction'
|
|
||||||
|
|
||||||
// Create shared connection
|
|
||||||
const mongo = createMongoConnection({
|
|
||||||
uri: 'mongodb://localhost:27017',
|
|
||||||
database: 'game'
|
|
||||||
})
|
|
||||||
await mongo.connect()
|
|
||||||
|
|
||||||
// Use for database operations
|
|
||||||
const userRepo = new UserRepository(mongo)
|
|
||||||
await userRepo.register({ username: 'john', password: '123456' })
|
|
||||||
|
|
||||||
// Use for transactions (same connection)
|
|
||||||
const storage = createMongoStorage(mongo)
|
|
||||||
const txManager = new TransactionManager({ storage })
|
|
||||||
```
|
|
||||||
49
packages/framework/database-drivers/CHANGELOG.md
Normal file
49
packages/framework/database-drivers/CHANGELOG.md
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
# @esengine/database-drivers
|
||||||
|
|
||||||
|
## 1.1.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#410](https://github.com/esengine/esengine/pull/410) [`71022ab`](https://github.com/esengine/esengine/commit/71022abc99ad4a1b349f19f4ccf1e0a2a0923dfa) Thanks [@esengine](https://github.com/esengine)! - feat: add database layer architecture
|
||||||
|
|
||||||
|
Added new database packages with layered architecture:
|
||||||
|
|
||||||
|
**@esengine/database-drivers (Layer 1)**
|
||||||
|
- MongoDB connection with pool management, auto-reconnect, events
|
||||||
|
- Redis connection with auto-reconnect, key prefix
|
||||||
|
- Type-safe `IMongoCollection<T>` interface decoupled from mongodb types
|
||||||
|
- Service tokens for dependency injection (`MongoConnectionToken`, `RedisConnectionToken`)
|
||||||
|
|
||||||
|
**@esengine/database (Layer 2)**
|
||||||
|
- Generic `Repository<T>` with CRUD, pagination, soft delete
|
||||||
|
- `UserRepository` with registration, authentication, role management
|
||||||
|
- Password hashing utilities using scrypt
|
||||||
|
- Query operators: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$like`, `$regex`
|
||||||
|
|
||||||
|
**@esengine/transaction**
|
||||||
|
- Refactored `MongoStorage` to use shared connection from `@esengine/database-drivers`
|
||||||
|
- Removed factory pattern in favor of shared connection (breaking change)
|
||||||
|
- Simplified API: `createMongoStorage(connection, options?)`
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createMongoConnection } from '@esengine/database-drivers';
|
||||||
|
import { UserRepository } from '@esengine/database';
|
||||||
|
import { createMongoStorage, TransactionManager } from '@esengine/transaction';
|
||||||
|
|
||||||
|
// Create shared connection
|
||||||
|
const mongo = createMongoConnection({
|
||||||
|
uri: 'mongodb://localhost:27017',
|
||||||
|
database: 'game'
|
||||||
|
});
|
||||||
|
await mongo.connect();
|
||||||
|
|
||||||
|
// Use for database operations
|
||||||
|
const userRepo = new UserRepository(mongo);
|
||||||
|
await userRepo.register({ username: 'john', password: '123456' });
|
||||||
|
|
||||||
|
// Use for transactions (same connection)
|
||||||
|
const storage = createMongoStorage(mongo);
|
||||||
|
const txManager = new TransactionManager({ storage });
|
||||||
|
```
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@esengine/database-drivers",
|
"name": "@esengine/database-drivers",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "Database connection drivers for ESEngine | ESEngine 数据库连接驱动",
|
"description": "Database connection drivers for ESEngine | ESEngine 数据库连接驱动",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
54
packages/framework/database/CHANGELOG.md
Normal file
54
packages/framework/database/CHANGELOG.md
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
# @esengine/database
|
||||||
|
|
||||||
|
## 1.1.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#410](https://github.com/esengine/esengine/pull/410) [`71022ab`](https://github.com/esengine/esengine/commit/71022abc99ad4a1b349f19f4ccf1e0a2a0923dfa) Thanks [@esengine](https://github.com/esengine)! - feat: add database layer architecture
|
||||||
|
|
||||||
|
Added new database packages with layered architecture:
|
||||||
|
|
||||||
|
**@esengine/database-drivers (Layer 1)**
|
||||||
|
- MongoDB connection with pool management, auto-reconnect, events
|
||||||
|
- Redis connection with auto-reconnect, key prefix
|
||||||
|
- Type-safe `IMongoCollection<T>` interface decoupled from mongodb types
|
||||||
|
- Service tokens for dependency injection (`MongoConnectionToken`, `RedisConnectionToken`)
|
||||||
|
|
||||||
|
**@esengine/database (Layer 2)**
|
||||||
|
- Generic `Repository<T>` with CRUD, pagination, soft delete
|
||||||
|
- `UserRepository` with registration, authentication, role management
|
||||||
|
- Password hashing utilities using scrypt
|
||||||
|
- Query operators: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$like`, `$regex`
|
||||||
|
|
||||||
|
**@esengine/transaction**
|
||||||
|
- Refactored `MongoStorage` to use shared connection from `@esengine/database-drivers`
|
||||||
|
- Removed factory pattern in favor of shared connection (breaking change)
|
||||||
|
- Simplified API: `createMongoStorage(connection, options?)`
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createMongoConnection } from '@esengine/database-drivers';
|
||||||
|
import { UserRepository } from '@esengine/database';
|
||||||
|
import { createMongoStorage, TransactionManager } from '@esengine/transaction';
|
||||||
|
|
||||||
|
// Create shared connection
|
||||||
|
const mongo = createMongoConnection({
|
||||||
|
uri: 'mongodb://localhost:27017',
|
||||||
|
database: 'game'
|
||||||
|
});
|
||||||
|
await mongo.connect();
|
||||||
|
|
||||||
|
// Use for database operations
|
||||||
|
const userRepo = new UserRepository(mongo);
|
||||||
|
await userRepo.register({ username: 'john', password: '123456' });
|
||||||
|
|
||||||
|
// Use for transactions (same connection)
|
||||||
|
const storage = createMongoStorage(mongo);
|
||||||
|
const txManager = new TransactionManager({ storage });
|
||||||
|
```
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`71022ab`](https://github.com/esengine/esengine/commit/71022abc99ad4a1b349f19f4ccf1e0a2a0923dfa)]:
|
||||||
|
- @esengine/database-drivers@1.1.0
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@esengine/database",
|
"name": "@esengine/database",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0",
|
||||||
"description": "Database CRUD operations and repositories for ESEngine | ESEngine 数据库 CRUD 操作和仓库",
|
"description": "Database CRUD operations and repositories for ESEngine | ESEngine 数据库 CRUD 操作和仓库",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
@@ -1,5 +1,58 @@
|
|||||||
# @esengine/transaction
|
# @esengine/transaction
|
||||||
|
|
||||||
|
## 2.1.0
|
||||||
|
|
||||||
|
### Minor Changes
|
||||||
|
|
||||||
|
- [#410](https://github.com/esengine/esengine/pull/410) [`71022ab`](https://github.com/esengine/esengine/commit/71022abc99ad4a1b349f19f4ccf1e0a2a0923dfa) Thanks [@esengine](https://github.com/esengine)! - feat: add database layer architecture
|
||||||
|
|
||||||
|
Added new database packages with layered architecture:
|
||||||
|
|
||||||
|
**@esengine/database-drivers (Layer 1)**
|
||||||
|
- MongoDB connection with pool management, auto-reconnect, events
|
||||||
|
- Redis connection with auto-reconnect, key prefix
|
||||||
|
- Type-safe `IMongoCollection<T>` interface decoupled from mongodb types
|
||||||
|
- Service tokens for dependency injection (`MongoConnectionToken`, `RedisConnectionToken`)
|
||||||
|
|
||||||
|
**@esengine/database (Layer 2)**
|
||||||
|
- Generic `Repository<T>` with CRUD, pagination, soft delete
|
||||||
|
- `UserRepository` with registration, authentication, role management
|
||||||
|
- Password hashing utilities using scrypt
|
||||||
|
- Query operators: `$eq`, `$ne`, `$gt`, `$gte`, `$lt`, `$lte`, `$in`, `$nin`, `$like`, `$regex`
|
||||||
|
|
||||||
|
**@esengine/transaction**
|
||||||
|
- Refactored `MongoStorage` to use shared connection from `@esengine/database-drivers`
|
||||||
|
- Removed factory pattern in favor of shared connection (breaking change)
|
||||||
|
- Simplified API: `createMongoStorage(connection, options?)`
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
import { createMongoConnection } from '@esengine/database-drivers';
|
||||||
|
import { UserRepository } from '@esengine/database';
|
||||||
|
import { createMongoStorage, TransactionManager } from '@esengine/transaction';
|
||||||
|
|
||||||
|
// Create shared connection
|
||||||
|
const mongo = createMongoConnection({
|
||||||
|
uri: 'mongodb://localhost:27017',
|
||||||
|
database: 'game'
|
||||||
|
});
|
||||||
|
await mongo.connect();
|
||||||
|
|
||||||
|
// Use for database operations
|
||||||
|
const userRepo = new UserRepository(mongo);
|
||||||
|
await userRepo.register({ username: 'john', password: '123456' });
|
||||||
|
|
||||||
|
// Use for transactions (same connection)
|
||||||
|
const storage = createMongoStorage(mongo);
|
||||||
|
const txManager = new TransactionManager({ storage });
|
||||||
|
```
|
||||||
|
|
||||||
|
### Patch Changes
|
||||||
|
|
||||||
|
- Updated dependencies [[`71022ab`](https://github.com/esengine/esengine/commit/71022abc99ad4a1b349f19f4ccf1e0a2a0923dfa)]:
|
||||||
|
- @esengine/database-drivers@1.1.0
|
||||||
|
|
||||||
## 2.0.7
|
## 2.0.7
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@esengine/transaction",
|
"name": "@esengine/transaction",
|
||||||
"version": "2.0.7",
|
"version": "2.1.0",
|
||||||
"description": "Game transaction system with distributed support | 游戏事务系统,支持分布式事务",
|
"description": "Game transaction system with distributed support | 游戏事务系统,支持分布式事务",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user