@@ -3,16 +3,16 @@ import type {} from '@cordisjs/plugin-logger'
3
3
import { defineProperty , Dict , isNullable } from 'cosmokit'
4
4
import { ModuleLoader } from './internal.ts'
5
5
import { Entry , EntryOptions } from './config/entry.ts'
6
- import { LoaderFile } from './config/file.ts'
7
- import { ImportTree } from './config/import.ts'
6
+ import { EntryTree } from './config/tree.ts'
8
7
import isolate from './config/isolate.ts'
8
+ import { LoaderFile } from './loader.ts'
9
9
10
10
export * from './config/entry.ts'
11
- export * from './config/file.ts'
12
11
export * from './config/group.ts'
13
- export * from './config/import.ts'
14
12
export * from './config/isolate.ts'
15
13
export * from './config/tree.ts'
14
+ export * from './file.ts'
15
+ export * from './import.ts'
16
16
17
17
declare module '@cordisjs/core' {
18
18
interface Events {
@@ -49,7 +49,7 @@ export namespace Loader {
49
49
}
50
50
}
51
51
52
- export abstract class Loader < C extends Context = Context > extends ImportTree < C > {
52
+ export abstract class Loader < C extends Context = Context > extends EntryTree < C > {
53
53
declare [ Service . config ] : Loader . Intercept
54
54
55
55
public envData = process . env . CORDIS_SHARED
@@ -126,10 +126,10 @@ export abstract class Loader<C extends Context = Context> extends ImportTree<C>
126
126
ctx . plugin ( isolate )
127
127
}
128
128
129
- async * [ Service . init ] ( ) {
130
- await this . init ( process . cwd ( ) , this . config )
131
- yield * super [ Service . init ] ( )
132
- }
129
+ // async* [Service.init]() {
130
+ // await this.init(process.cwd(), this.config)
131
+ // yield* super[Service.init]()
132
+ // }
133
133
134
134
[ Service . check ] ( ) {
135
135
const config : Loader . Intercept = Service . prototype [ Service . resolveConfig ] . call ( this )
@@ -151,7 +151,14 @@ export abstract class Loader<C extends Context = Context> extends ImportTree<C>
151
151
}
152
152
}
153
153
154
- exit ( ) { }
154
+ exit ( ) {
155
+ // const body = JSON.stringify(this.envData)
156
+ // process.send?.({ type: 'shared', body }, (err: any) => {
157
+ // if (err) this.ctx.emit(this.ctx, 'internal/error', 'failed to send shared data')
158
+ // this.ctx.root.logger?.('loader').info('trigger full reload')
159
+ // process.exit(code)
160
+ // })
161
+ }
155
162
156
163
unwrapExports ( exports : any ) {
157
164
if ( isNullable ( exports ) ) return exports
0 commit comments