Framework
BuildCompleteContext
Interface: BuildCompleteContext
Context provided to build/complete.ts hooks. Runs AFTER manifest is written.
Hook signature: (context: BuildCompleteContext) => void | Promise<void>
Use this hook to perform post-build tasks like:
- Registering commands with Discord
- Generating additional files
- Logging build summaries
Example
export default function (context: BuildCompleteContext) {
const commands = context.entries.get('discordjs', 'commands')
context.logger.info(`Built ${commands.length} commands`)
}Extends
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
config | Config | Loaded configuration | - | BuildContext.config |
entries | EntriesAccessor | Entries accessor is always available in complete hooks | BuildContext.entries | - |
env | typeof Env | Environment variable access | - | BuildContext.env |
logger | Logger | Logger instance (forked for plugins) | - | BuildContext.logger |
mode | string | Current build mode (supports custom modes like 'beta', 'staging', etc.) | - | BuildContext.mode |
paths | { output: string; root: string; src: string; } | Project paths | - | BuildContext.paths |
paths.output | string | - | - | - |
paths.root | string | - | - | - |
paths.src | string | - | - | - |
store | BuildStore | Key-value store for passing data between build hooks. Use to share computed values between build/start and build/complete. | - | BuildContext.store |
Methods
registerMetadataAggregator()
registerMetadataAggregator<T>(namespace, aggregator): voidRegister a metadata aggregator for a namespace. Aggregators combine metadata from all handlers into a summary.
Type Parameters
| Type Parameter |
|---|
T extends AggregatedMetadata |
Parameters
| Parameter | Type | Description |
|---|---|---|
namespace | string | Plugin namespace to aggregate (e.g., 'discordjs') |
aggregator | MetadataAggregator<T> | Function that processes entries into aggregated metadata |
Returns
void
updateMetadata()
updateMetadata(namespace, updates): voidUpdate aggregated metadata for a namespace. Can be called multiple times; updates are merged.
Parameters
| Parameter | Type | Description |
|---|---|---|
namespace | string | Plugin namespace |
updates | Record<string, unknown> | Partial metadata to merge |
Returns
void
