fix: reorder plugin reference handling in AfilmoryBuilder class (#146)

This commit is contained in:
Whitewater
2025-11-03 12:45:45 +08:00
committed by GitHub
parent f13adda795
commit a9119b2811

View File

@@ -208,7 +208,7 @@ export class AfilmoryBuilder {
const concurrency = options.concurrencyLimit ?? this.config.options.defaultConcurrency
const { useClusterMode } = this.config.performance.worker
const shouldUseCluster = useClusterMode && tasksToProcess.length >= concurrency * 2
const {progressListener} = options
const { progressListener } = options
await this.emitPluginEvent(runState, 'beforeProcessTasks', {
options,
@@ -634,14 +634,6 @@ export class AfilmoryBuilder {
})
}
for (const ref of this.config.plugins ?? []) {
addReference(ref)
}
if (this.config.repo.enable && !hasPluginWithName('afilmory:github-repo-sync')) {
addReference(() => import('@afilmory/builder/plugins/github-repo-sync.js'))
}
const storagePluginByProvider: Record<string, BuilderPluginESMImporter> = {
s3: () => import('@afilmory/builder/plugins/storage/s3.js'),
github: () => import('@afilmory/builder/plugins/storage/github.js'),
@@ -659,6 +651,14 @@ export class AfilmoryBuilder {
addReference(storagePlugin)
}
for (const ref of this.config.plugins ?? []) {
addReference(ref)
}
if (this.config.repo.enable && !hasPluginWithName('afilmory:github-repo-sync')) {
addReference(() => import('@afilmory/builder/plugins/github-repo-sync.js'))
}
return references
}