Skip to main content

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​

TaskEntry point
Write a pluginBuildPlugin and BuildContext from @bedrock-core/builder-plugin
Run a build from NoderunBuild from @bedrock-core/builder/runner
Watch from NodewatchBuild from @bedrock-core/builder/watch

The remaining reference covers specialized build integrations and standalone compiler packages.

Specialized API reference

Build and configuration​

ExportKindDescription
planBuildFunctionResolve a profile without loading plugins
validateConfigFunctionValidate project metadata and builder configuration
validatePluginDefinitionFunctionCheck a named module or script definition
runBuildFunctionStage, execute, validate and publish packs
watchBuildFunctionRun serial rebuilds with cancellation and callbacks
BuildContextInterfacePlugin paths, current pack, artifacts and dependencies
BuildPluginInterfaceShared execution, detection and source-directory contract
BundleExtensionInterfaceFeature-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​

ExportKindDescription
resolveManifestFunctionResolve a selected file and its relative inheritance chain
transformManifestFunctionApply explicit patches to a cloned manifest
readManifestFunctionRead v3 metadata before bundles exist
readScriptEntriesFunctionRead manifest-declared runtime entry paths
validatePackManifestsFunctionCheck final identities and script files
resolveExportPathsFunctionResolve and validate environment-expanded destinations
withExportPathsFunctionHold destination locks around a publication callback
exportPacksFunctionPublish explicit pack directories without the runner

Standalone stages​

ExportKindDescription
bundleScriptsFunctionBundle explicit TS/JS entries with esbuild
CompilationDependenciesClassTrack files and missing module-resolution candidates
generateTemplatesFunctionEvaluate explicit templates and write JSON
defineTemplateFunctionPreserve and optionally categorize document data
defineManyFunctionBuild a typed multi-document tuple
generateSchemaTypesFunctionGenerate editor declarations from Mojang schemas
compileI18nFunctionCompile a translation library
parseLangFunctionParse a language table
compileGuidesFunctionCompile localized Markdown/MDX guides
validatePackContentFunctionValidate final JSON syntax and matching schemas
ContentValidationErrorClassInspect 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​

ExportKindDescription
compileGuidePageFunctionCompile a single localized page
assembleLocaleFunctionAssemble navigation and validate current-set links
buildManifestFunctionCreate the runtime guide manifest
guideScreenNamesFunctionResolve player/operator screen names
guideScreenTablesFunctionMap current page IDs to screen names
guideScreenModulesFunctionGenerate 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​

ExportKindDescription
migrateRegolithConfigFunctionConvert supported configuration into a reviewable preview
migrateRegolithProjectFunctionInspect project metadata without loading filters
writeMigrationFunctionWrite 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.