Add a build manifest build step#6869
Draft
alfonso-noriega wants to merge 1 commit into03-hosted-static-app-build-pipelinefrom
Draft
Add a build manifest build step#6869alfonso-noriega wants to merge 1 commit into03-hosted-static-app-build-pipelinefrom
alfonso-noriega wants to merge 1 commit into03-hosted-static-app-build-pipelinefrom
Conversation
This was referenced Feb 19, 2026
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5 tasks
146db7f to
e56e3c3
Compare
a3c7106 to
038b372
Compare
e56e3c3 to
ed19082
Compare
227bbf6 to
fe18a99
Compare
ed19082 to
d5a9a3f
Compare
fe18a99 to
2ecdc39
Compare
c356f95 to
d0d8bed
Compare
2ecdc39 to
6ca3b6b
Compare
d0d8bed to
61f38e1
Compare
510cdf7 to
b990700
Compare
61f38e1 to
7ea9b07
Compare
7ea9b07 to
ea8da6c
Compare
b990700 to
4188667
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

WHY are these changes introduced?
To support the generation of build manifests for UI extensions, which will be used to map extension points to their compiled assets.
Add
build_manifestbuild stepIntroduces a new
build_manifeststep type for the declarative build pipeline. The step generates a JSON manifest that maps logical asset identifiers to their resolved filepaths and sourcemodules, and writes it to the extension's output directory.
How the step is configured
{ "id": "write-build-manifest", "displayName": "Write Build Manifest", "type": "build_manifest", "config": { "outputFile": "build-manifest.json", "forEach": { "tomlKey": "extension_points", "keyBy": "target" }, "assets": { ... } } }Top-level fields
outputFile"build-manifest.json"forEachassetsRecord<string, AssetEntry>forEachWhen
forEachis set the step iterates the named config array and writes an array of{ [keyBy]: value, build_manifest: { assets } }objects — one per item. This mirrors the shape thatUIExtensionSchema.transformattaches to eachextension_point.tomlKeykeyBy"target")Without
forEachthe step writes a single{ assets }object.Asset entries
Shorthand — resolves the entire filepath from a single TOML key:
{ "tomlKey": "static_root" } { "tomlKey": "static_root", "static": true }Explicit:
filepathFilepathValuemodule{ "tomlKey": string }staticoptionalfilepathormodulecannot be resolvedFilepathValueA filepath can be specified in three forms:
Literal string — used as-is:
"dist/index.js"TOML key shorthand — whole filepath resolved from the extension config:
{ "tomlKey": "entry_file" }Composed — assembled as
{path/}{prefix}{filename}:{ "path": "dist", "prefix": { "tomlKey": "handle" }, "filename": ".js" }The
prefixfield accepts:"static"{ "tomlKey": "..." }forEachitem first, falls back to the top-level extension config. If the resolved value is an array, the current outer iteration index is used as the prefix.moduleresolutionmoduleis always{ "tomlKey": string }. InforEachcontext the key is looked up on the current item first, falling back to the top-level config.Nested arrays
When a
tomlKeypath crosses an array at the config level (e.g.extension_points.module), the current outer iteration index is used to pick the right element automatically.When a
tomlKeypath crosses a nested array on the current item (e.g.should_render.modulewhereshould_renderis itself an array), the asset expands into an array in the manifest — oneentry per inner item. The inner index is inserted between the config-defined prefix and the filename to keep filepaths unique.
Examples
Single manifest — static hosted app
{ "type": "build_manifest", "config": { "assets": { "main": { "tomlKey": "static_root" } } } }Output (
build-manifest.json):{ "assets": { "main": { "filepath": "public" } } }Per-target manifest — UI extension
{ "type": "build_manifest", "config": { "forEach": { "tomlKey": "extension_points", "keyBy": "target" }, "assets": { "main": { "filepath": { "prefix": { "tomlKey": "handle" }, "filename": ".js" }, "module": { "tomlKey": "module" } }, "should_render": { "filepath": { "prefix": { "tomlKey": "handle" }, "filename": "-conditions.js" }, "module": { "tomlKey": "should_render.module" }, "optional": true }, "tools": { "filepath": { "prefix": { "tomlKey": "handle" }, "filename": "-tools.json" }, "module": { "tomlKey": "tools" }, "static": true, "optional": true } } } }Given this TOML:
Output (
build-manifest.json):[ { "target": "purchase.checkout.block.render", "build_manifest": { "assets": { "main": { "filepath": "my-ext.js", "module": "./src/checkout.tsx" }, "should_render": { "filepath": "my-ext-conditions.js", "module": "./src/conditions.tsx" } } } }, { "target": "admin.product-details.action.render", "build_manifest": { "assets": { "main": { "filepath": "my-ext.js", "module": "./src/admin.tsx" } } } } ]should_renderis absent from the second entry becauseshould_render.moduleis not present on that item and the asset isoptional: true.Nested array expansion
When
should_renderis itself an array of objects, the manifest reflects that structure:Output for that entry:
{ "target": "purchase.checkout.block.render", "build_manifest": { "assets": { "main": { "filepath": "my-ext.js", "module": "./src/checkout.tsx" }, "should_render": [ { "filepath": "my-ext-0-conditions.js", "module": "./src/conditions-a.tsx" }, { "filepath": "my-ext-1-conditions.js", "module": "./src/conditions-b.tsx" } ] } } }The inner index is inserted between the config-defined prefix (
my-ext) and the filename (-conditions.js), keeping each filepath unique while preserving the array structure of the sourceTOML.
The implementation includes:
How to test your changes?
Measuring impact
How do we know this change was effective? Please choose one:
Checklist