8000 fix: export Orm class by fengmk2 · Pull Request #293 · eggjs/tegg · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: export Orm class #293

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

Merged
merged 2 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugin/orm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { Orm } from './lib/SingletonORM.js';
import type { OrmConfig } from './lib/DataSourceManager.js';
import type { DataType } from './lib/types.js';

export { Orm, LeoricRegister };

declare module '@eggjs/tegg-orm-decorator' {
// @ts-expect-error: DataType is not defined in tegg-orm-decorator
export function Attribute(dataType: DataType, options?: AttributeOptions): (target: any, propertyKey: PropertyKey) => void;
Expand Down
2 changes: 2 additions & 0 deletions plugin/orm/lib/DataSourceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export interface OrmConfig {
user: string;
define: object;
options: object;
charset: string;
[key: string]: any;
}

export class DataSourceManager {
Expand Down
2 changes: 2 additions & 0 deletions plugin/orm/lib/LeoricRegister.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { Base } from 'sdk-base';
import Realm from 'leoric';
import { ModelMetadata, ModelMetadataUtil } from '@eggjs/tegg-orm-decorator';

import { ModelProtoManager } from './ModelProtoManager.js';
import { DataSourceManager, OrmConfig } from './DataSourceManager.js';
import type { RealmType } from './types.js';

export class LeoricRegister extends Base {
private readonly modelProtoManager: ModelProtoManager;
private readonly dataSourceManager: DataSourceManager;
Expand Down
10 changes: 10 additions & 0 deletions plugin/orm/test/exports.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import assert from 'node:assert/strict';

import { Orm, LeoricRegister } from '../index.js';

describe('plugin/orm/exports.test.ts', () => {
it('should export Orm', () => {
assert.ok(Orm);
assert.ok(LeoricRegister);
});
});
2 changes: 1 addition & 1 deletion standalone/standalone/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';
import fs from 'node:fs/promises';
import { setTimeout as sleep } from 'node:timers/promises';
import { fileURLToPath } from 'node:url';
import mm from 'mm';
import { mm } from 'mm';
import { ModuleConfig, ModuleConfigs, ModuleDescriptorDumper } from '@eggjs/tegg/helper';
import { importResolve } from '@eggjs/utils';
import { main, StandaloneContext, Runner, preLoad } from '../index.js';
Expand Down
Loading
0