Classcore/pluginv0.14.0
FolderExports
Registers the values that the files in one folder export, and keeps them registered while you
edit those files under seedcord dev. is picks which exports count.
A value that two files export, like a class and the barrel that re-exports it, registers once and unregisters once neither file exports it.
Call load() from your plugin's init() and handle() from its onHmr().
class FolderExports<TUnit>this.jobs = new FolderExports({
dir,
is: isJob,
register: (job) => this.registry.set(job.name, job),
unregister: (job) => this.registry.delete(job.name),
logger: this.logger
});Member visibility
Filter class members by access level.
FolderExports(options: FolderExportsOptions<TUnit>)TUnit
TUnitpublic async handle(event: HmrUpdateEvent): Promise<void>public async scan(): Promise<TUnit[]>Throws:
A SeedcordError when a file throws while it imports.
public override async codegen() {
const jobs = await this.jobFiles.scan();
return { jobs: Object.fromEntries(jobs.map((job) => [job.name, job])) };
}