API
Most projects use the CLI and need no Builder API imports. This reference is for plugin authors and tools that run builds programmatically.
For content authoring, start with Generate JSON. For extension configuration, start with Plugins.
Start here
| Task | Entry point |
|---|---|
| Write a plugin | BuildPlugin and BuildContext from @bedrock-core/builder-plugin |
| Run a build from Node | runBuild from @bedrock-core/builder/runner |
| Watch from Node | watchBuild from @bedrock-core/builder/watch |
The remaining reference covers specialized build integrations and standalone compiler packages.
Specialized API reference
Build and configuration
| Export | Kind | Description |
|---|---|---|
planBuild | Function | Resolve a profile without loading plugins |
validateConfig | Function | Validate project metadata and builder configuration |
validatePluginDefinition | Function | Check a named module or script definition |
runBuild | Function | Stage, execute, validate and publish packs |
watchBuild | Function | Run serial rebuilds with cancellation and callbacks |
BuildContext | Interface | Plugin paths, current pack, artifacts and dependencies |
BuildPlugin | Interface | Shared execution, detection and source-directory contract |
BundleExtension | Interface | Feature-owned compiler plugins, JSX runtime and import preferences |
@bedrock-core/builder also exports the frozen stages order and planned-step types. @bedrock-core/builder/config exports configSchema and project/profile/plugin types. @bedrock-core/builder/runner exports the build options, result, step and artifact contracts.
@bedrock-core/builder-plugin owns the shared plugin, pack, artifact and cache types. It also exports generatedAliases, hasFiles, fingerprint, pack inspection/selection helpers and resolveFeaturePacks. Plugin authoring describes their use.
Manifests and exports
| Export | Kind | Description |
|---|---|---|
resolveManifest | Function | Resolve a selected file and its relative inheritance chain |
transformManifest | Function | Apply explicit patches to a cloned manifest |
readManifest | Function | Read v3 metadata before bundles exist |
readScriptEntries | Function | Read manifest-declared runtime entry paths |
validatePackManifests | Function | Check final identities and script files |
resolveExportPaths | Function | Resolve and validate environment-expanded destinations |
withExportPaths | Function | Hold destination locks around a publication callback |
exportPacks | Function | Publish explicit pack directories without the runner |
Standalone stages
| Export | Kind | Description |
|---|---|---|
bundleScripts | Function | Bundle explicit TS/JS entries with esbuild |
CompilationDependencies | Class | Track files and missing module-resolution candidates |
generateTemplates | Function | Evaluate explicit templates and write JSON |
defineTemplate | Function | Preserve and optionally categorize document data |
defineMany | Function | Build a typed multi-document tuple |
generateSchemaTypes | Function | Generate editor declarations from Mojang schemas |
compileI18n | Function | Compile a translation library |
parseLang | Function | Parse a language table |
compileGuides | Function | Compile localized Markdown/MDX guides |
validatePackContent | Function | Validate final JSON syntax and matching schemas |
ContentValidationError | Class | Inspect structured content failures |
Each standalone package exports its options and result types. APIs accept explicit paths and do not imply runner staging or pack publication. @bedrock-core/builder/validation also exposes the standalone validation API.
UI compilation
Use the UI stage to build @bedrock-core screens. @bedrock-core/builder-ui exports the UiSettings configuration type. Screen authoring and compiler behavior are documented under Compiler.
Guide assembly
| Export | Kind | Description |
|---|---|---|
compileGuidePage | Function | Compile a single localized page |
assembleLocale | Function | Assemble navigation and validate current-set links |
buildManifest | Function | Create the runtime guide manifest |
guideScreenNames | Function | Resolve player/operator screen names |
guideScreenTables | Function | Map current page IDs to screen names |
guideScreenModules | Function | Generate guide screen module source |
@bedrock-core/builder-guides/types exports runtime and intermediate guide data types. @bedrock-core/builder-guides/screens exports screen-generation types and SCREEN_HEADER, the generated-file marker.
Configuration conversion
| Export | Kind | Description |
|---|---|---|
migrateRegolithConfig | Function | Convert supported configuration into a reviewable preview |
migrateRegolithProject | Function | Inspect project metadata without loading filters |
writeMigration | Function | Write a ready preview with source-change guards |
Conversion types are exported from @bedrock-core/builder/migrate. These APIs convert configuration and leave authored project code and pack manifests intact.