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

chore(core/loader): use tegg-metadata EggLoadUnitType enum #176

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 1 addition & 1 deletion core/lifecycle/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './src/LifecycleHook';
export * from './src/EggObjectLifecycle';
export * from './src/LifycycleUtil';
export * from './src/LifecycleUtil';
export * from './src/IdenticalObject';
export * from './src/decorator';
2 changes: 1 addition & 1 deletion core/lifecycle/src/decorator/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { EggProtoImplClass } from '@eggjs/core-decorator';
import { LifecycleUtil, LifecycleHookName } from '../LifycycleUtil';
import { LifecycleUtil, LifecycleHookName } from '../LifecycleUtil';

function createLifecycle(hookName: LifecycleHookName) {
return () => {
Expand Down
4 changes: 2 additions & 2 deletions core/loader/src/impl/ModuleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { LoaderUtil } from '../LoaderUtil';

import { EggProtoImplClass } from '@eggjs/core-decorator';
import { LoaderFactory } from '../LoaderFactory';
import type { Loader } from '@eggjs/tegg-metadata';
import { type Loader, EggLoadUnitType } from '@eggjs/tegg-metadata';

export class ModuleLoader implements Loader {
private readonly moduleDir: string;
Expand Down Expand Up @@ -40,4 +40,4 @@ export class ModuleLoader implements Loader {
}
}

LoaderFactory.registerLoader('MODULE', ModuleLoader.createModuleLoader);
LoaderFactory.registerLoader(EggLoadUnitType.MODULE, ModuleLoader.createModuleLoader);
Copy link
Contributor

Choose a reason for hiding this comment

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

@eggjs/tegg-metadata 这个需要从 devDep 挪到 dep 了。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

哦 没注意到这个 那看是否有必要了。

主要看到消费 createLoader 用了 enum

Copy link
Member

Choose a reason for hiding this comment

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

就不要改了,否则会循环依赖。

Loading