Skip to content

Commit

Permalink
fix: remove inner class hook (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
gxkl authored Nov 5, 2024
1 parent 8bf7878 commit faffd34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 36 deletions.
26 changes: 0 additions & 26 deletions standalone/standalone/src/LoadUnitInnerClassHook.ts

This file was deleted.

9 changes: 0 additions & 9 deletions standalone/standalone/src/Runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import { InnerObject, StandaloneLoadUnit, StandaloneLoadUnitType } from './Stand
import { StandaloneContext } from './StandaloneContext';
import { StandaloneContextHandler } from './StandaloneContextHandler';
import { ConfigSourceLoadUnitHook } from './ConfigSourceLoadUnitHook';
import { LoadUnitInnerClassHook } from './LoadUnitInnerClassHook';
import { DalTableEggPrototypeHook } from '@eggjs/tegg-dal-plugin/lib/DalTableEggPrototypeHook';
import { DalModuleLoadUnitHook } from '@eggjs/tegg-dal-plugin/lib/DalModuleLoadUnitHook';
import { MysqlDataSourceManager } from '@eggjs/tegg-dal-plugin/lib/MysqlDataSourceManager';
Expand Down Expand Up @@ -77,7 +76,6 @@ export class Runner {
private dalModuleLoadUnitHook: DalModuleLoadUnitHook;
private transactionPrototypeHook: TransactionPrototypeHook;

private readonly loadUnitInnerClassHook: LoadUnitInnerClassHook;
private readonly crosscutAdviceFactory: CrosscutAdviceFactory;
private readonly loadUnitAopHook: LoadUnitAopHook;
private readonly eggPrototypeCrossCutHook: EggPrototypeCrossCutHook;
Expand Down Expand Up @@ -155,9 +153,6 @@ export class Runner {
const configSourceEggPrototypeHook = new ConfigSourceLoadUnitHook();
LoadUnitLifecycleUtil.registerLifecycle(configSourceEggPrototypeHook);

this.loadUnitInnerClassHook = new LoadUnitInnerClassHook();
LoadUnitLifecycleUtil.registerLifecycle(this.loadUnitInnerClassHook);

// TODO refactor with egg module
// aop runtime
this.crosscutAdviceFactory = new CrosscutAdviceFactory();
Expand Down Expand Up @@ -270,10 +265,6 @@ export class Runner {
LoadUnitLifecycleUtil.deleteLifecycle(this.configSourceEggPrototypeHook);
}

if (this.loadUnitInnerClassHook) {
LoadUnitLifecycleUtil.deleteLifecycle(this.loadUnitInnerClassHook);
}

if (this.eggPrototypeCrossCutHook) {
EggPrototypeLifecycleUtil.deleteLifecycle(this.eggPrototypeCrossCutHook);
}
Expand Down
6 changes: 5 additions & 1 deletion standalone/standalone/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,11 @@ describe('standalone/standalone/test/index.test.ts', () => {
const fixturePath = path.join(__dirname, './fixtures/dynamic-inject-module');

it('should work', async () => {
const msgs = await main(fixturePath);
const msgs = await main(fixturePath, {
dependencies: [
{ baseDir: path.join(__dirname, '..'), extraFilePattern: [ '!**/test' ] },
],
});
assert.deepEqual(msgs, [
'hello, foo(context:0)',
'hello, bar(context:0)',
Expand Down

0 comments on commit faffd34

Please sign in to comment.