@eggjs/core 7.0.0-beta.19 → 7.0.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- import { _default } from "./utils/index.js";
2
- import { CustomLoaderConfigItem, EggAppConfig, EggAppInfo, EggPluginInfo } from "./types.js";
3
- import { BaseContextClass } from "./base_context_class.js";
4
- import { Timing, TimingItem } from "./utils/timing.js";
5
- import { BootImplClass, FunWithFullPath, ILifecycleBoot, Lifecycle, LifecycleOptions } from "./lifecycle.js";
6
- import { CaseStyle, CaseStyleFunction, EXPORTS, FULLPATH, FileLoader, FileLoaderFilter, FileLoaderInitializer, FileLoaderOptions, FileLoaderParseItem } from "./loader/file_loader.js";
7
- import { ClassLoader, ClassLoaderOptions, ContextLoader, ContextLoaderOptions } from "./loader/context_loader.js";
8
- import { EggDirInfo, EggDirInfoType, EggLoader, EggLoaderOptions } from "./loader/egg_loader.js";
9
- import { Singleton, SingletonCreateMethod, SingletonOptions } from "./singleton.js";
10
- import { Context, EGG_LOADER, EggCore, EggCoreInitOptions, EggCoreOptions, KoaApplication, KoaContext, KoaMiddlewareFunc, KoaRequest, KoaResponse, MiddlewareFunc, Next, Request, Response, Router } from "./egg.js";
11
- import { SequencifyResult, SequencifyTask, sequencify } from "./utils/sequencify.js";
12
- export { BaseContextClass, BootImplClass, CaseStyle, CaseStyleFunction, ClassLoader, ClassLoaderOptions, Context, ContextLoader, ContextLoaderOptions, CustomLoaderConfigItem, EGG_LOADER, EXPORTS, EggAppConfig, EggAppInfo, EggCore, EggCoreInitOptions, EggCoreOptions, EggDirInfo, EggDirInfoType, EggLoader, EggLoaderOptions, EggPluginInfo, FULLPATH, FileLoader, FileLoaderFilter, FileLoaderInitializer, FileLoaderOptions, FileLoaderParseItem, FunWithFullPath, ILifecycleBoot, KoaApplication, KoaContext, KoaMiddlewareFunc, KoaRequest, KoaResponse, Lifecycle, LifecycleOptions, MiddlewareFunc, Next, Request, Response, Router, SequencifyResult, SequencifyTask, Singleton, SingletonCreateMethod, SingletonOptions, Timing, TimingItem, sequencify, _default as utils };
1
+ import utils from './utils/index.ts';
2
+ export { utils };
3
+ export * from './egg.ts';
4
+ export * from './base_context_class.ts';
5
+ export * from './lifecycle.ts';
6
+ export * from './singleton.ts';
7
+ export * from './loader/egg_loader.ts';
8
+ export * from './loader/file_loader.ts';
9
+ export * from './loader/context_loader.ts';
10
+ export * from './utils/sequencify.ts';
11
+ export * from './utils/timing.ts';
12
+ export type * from './types.ts';
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import utils_default from "./utils/index.js";
2
- import { BaseContextClass } from "./base_context_class.js";
3
- import { Timing } from "./utils/timing.js";
4
- import { Lifecycle } from "./lifecycle.js";
5
- import { CaseStyle, EXPORTS, FULLPATH, FileLoader } from "./loader/file_loader.js";
6
- import { ClassLoader, ContextLoader } from "./loader/context_loader.js";
7
- import { sequencify } from "./utils/sequencify.js";
8
- import { EggLoader } from "./loader/egg_loader.js";
9
- import { Singleton } from "./singleton.js";
10
- import { Context, EGG_LOADER, EggCore, KoaApplication, KoaContext, KoaRequest, KoaResponse, Request, Response, Router } from "./egg.js";
11
-
12
- export { BaseContextClass, CaseStyle, ClassLoader, Context, ContextLoader, EGG_LOADER, EXPORTS, EggCore, EggLoader, FULLPATH, FileLoader, KoaApplication, KoaContext, KoaRequest, KoaResponse, Lifecycle, Request, Response, Router, Singleton, Timing, sequencify, utils_default as utils };
1
+ import utils from "./utils/index.js";
2
+ export { utils };
3
+ export * from "./egg.js";
4
+ export * from "./base_context_class.js";
5
+ export * from "./lifecycle.js";
6
+ export * from "./singleton.js";
7
+ export * from "./loader/egg_loader.js";
8
+ export * from "./loader/file_loader.js";
9
+ export * from "./loader/context_loader.js";
10
+ export * from "./utils/sequencify.js";
11
+ export * from "./utils/timing.js";
12
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE1BQU0sa0JBQWtCLENBQUM7QUFFckMsT0FBTyxFQUFFLEtBQUssRUFBRSxDQUFDO0FBRWpCLGNBQWMsVUFBVSxDQUFDO0FBQ3pCLGNBQWMseUJBQXlCLENBQUM7QUFDeEMsY0FBYyxnQkFBZ0IsQ0FBQztBQUMvQixjQUFjLGdCQUFnQixDQUFDO0FBQy9CLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLDRCQUE0QixDQUFDO0FBQzNDLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYyxtQkFBbUIsQ0FBQyJ9
@@ -1,84 +1,78 @@
1
- import { Fun } from "./utils/index.js";
2
- import { Timing } from "./utils/timing.js";
3
- import { EggCore } from "./egg.js";
4
- import * as egg_logger0 from "egg-logger";
5
- import { EggConsoleLogger } from "egg-logger";
6
- import { EventEmitter } from "node:events";
7
- import { ReadyFunctionArg } from "get-ready";
8
- import { Ready as Ready$1 } from "ready-callback";
9
-
10
- //#region src/lifecycle.d.ts
11
- interface ILifecycleBoot {
12
- fullPath?: string;
13
- /**
14
- * Ready to call configDidLoad,
15
- * Config, plugin files are referred,
16
- * this is the last chance to modify the config.
17
- */
18
- configWillLoad?(): void;
19
- /**
20
- * Config, plugin files have loaded
21
- */
22
- configDidLoad?(): void;
23
- /**
24
- * All files have loaded, start plugin here
25
- */
26
- didLoad?(): Promise<void>;
27
- /**
28
- * All plugins have started, can do some thing before app ready
29
- */
30
- willReady?(): Promise<void>;
31
- /**
32
- * Worker is ready, can do some things,
33
- * don't need to block the app boot
34
- */
35
- didReady?(err?: Error): Promise<void>;
36
- /**
37
- * Server is listening
38
- */
39
- serverDidReady?(): Promise<void>;
40
- /**
41
- * Do some thing before app close
42
- */
43
- beforeClose?(): Promise<void>;
1
+ import { EventEmitter } from 'node:events';
2
+ import { type ReadyFunctionArg } from 'get-ready';
3
+ import { Ready } from 'ready-callback';
4
+ import { EggConsoleLogger } from 'egg-logger';
5
+ import type { Fun } from './utils/index.ts';
6
+ import type { EggCore } from './egg.ts';
7
+ export interface ILifecycleBoot {
8
+ fullPath?: string;
9
+ /**
10
+ * Ready to call configDidLoad,
11
+ * Config, plugin files are referred,
12
+ * this is the last chance to modify the config.
13
+ */
14
+ configWillLoad?(): void;
15
+ /**
16
+ * Config, plugin files have loaded
17
+ */
18
+ configDidLoad?(): void;
19
+ /**
20
+ * All files have loaded, start plugin here
21
+ */
22
+ didLoad?(): Promise<void>;
23
+ /**
24
+ * All plugins have started, can do some thing before app ready
25
+ */
26
+ willReady?(): Promise<void>;
27
+ /**
28
+ * Worker is ready, can do some things,
29
+ * don't need to block the app boot
30
+ */
31
+ didReady?(err?: Error): Promise<void>;
32
+ /**
33
+ * Server is listening
34
+ */
35
+ serverDidReady?(): Promise<void>;
36
+ /**
37
+ * Do some thing before app close
38
+ */
39
+ beforeClose?(): Promise<void>;
44
40
  }
45
- type BootImplClass<T = ILifecycleBoot> = new (...args: any[]) => T;
46
- interface LifecycleOptions {
47
- baseDir: string;
48
- app: EggCore;
49
- logger: EggConsoleLogger;
41
+ export type BootImplClass<T = ILifecycleBoot> = new (...args: any[]) => T;
42
+ export interface LifecycleOptions {
43
+ baseDir: string;
44
+ app: EggCore;
45
+ logger: EggConsoleLogger;
50
46
  }
51
- type FunWithFullPath = Fun & {
52
- fullPath?: string;
47
+ export type FunWithFullPath = Fun & {
48
+ fullPath?: string;
53
49
  };
54
- declare class Lifecycle extends EventEmitter {
55
- #private;
56
- loadReady: Ready$1;
57
- bootReady: Ready$1;
58
- options: LifecycleOptions;
59
- readyTimeout: number;
60
- constructor(options: Partial<LifecycleOptions>);
61
- ready(): Promise<void>;
62
- ready(flagOrFunction: ReadyFunctionArg): void;
63
- get app(): EggCore;
64
- get logger(): EggConsoleLogger<egg_logger0.LoggerOptions>;
65
- get timing(): Timing;
66
- legacyReadyCallback(name: string, opt?: object): (...args: unknown[]) => void;
67
- addBootHook(bootHootOrBootClass: BootImplClass | ILifecycleBoot): void;
68
- addFunctionAsBootHook<T = EggCore>(hook: (app: T) => void, fullPath?: string): void;
69
- /**
70
- * init boots and trigger config did config
71
- */
72
- init(): void;
73
- registerBeforeStart(scope: Fun, name: string): void;
74
- registerBeforeClose(fn: FunWithFullPath, fullPath?: string): void;
75
- close(): Promise<void>;
76
- triggerConfigWillLoad(): void;
77
- triggerConfigDidLoad(): void;
78
- triggerDidLoad(): void;
79
- triggerWillReady(): void;
80
- triggerDidReady(err?: Error): Promise<void>;
81
- triggerServerDidReady(): Promise<void>;
50
+ export declare class Lifecycle extends EventEmitter {
51
+ #private;
52
+ loadReady: Ready;
53
+ bootReady: Ready;
54
+ options: LifecycleOptions;
55
+ readyTimeout: number;
56
+ constructor(options: Partial<LifecycleOptions>);
57
+ ready(): Promise<void>;
58
+ ready(flagOrFunction: ReadyFunctionArg): void;
59
+ get app(): EggCore;
60
+ get logger(): EggConsoleLogger<import("egg-logger").LoggerOptions>;
61
+ get timing(): import("./index.ts").Timing;
62
+ legacyReadyCallback(name: string, opt?: object): (...args: unknown[]) => void;
63
+ addBootHook(bootHootOrBootClass: BootImplClass | ILifecycleBoot): void;
64
+ addFunctionAsBootHook<T = EggCore>(hook: (app: T) => void, fullPath?: string): void;
65
+ /**
66
+ * init boots and trigger config did config
67
+ */
68
+ init(): void;
69
+ registerBeforeStart(scope: Fun, name: string): void;
70
+ registerBeforeClose(fn: FunWithFullPath, fullPath?: string): void;
71
+ close(): Promise<void>;
72
+ triggerConfigWillLoad(): void;
73
+ triggerConfigDidLoad(): void;
74
+ triggerDidLoad(): void;
75
+ triggerWillReady(): void;
76
+ triggerDidReady(err?: Error): Promise<void>;
77
+ triggerServerDidReady(): Promise<void>;
82
78
  }
83
- //#endregion
84
- export { BootImplClass, FunWithFullPath, ILifecycleBoot, Lifecycle, LifecycleOptions };