Skip to content

Fix ui_extension manifest.json#7339

Open
vividviolet wants to merge 1 commit intomainfrom
04-16-fix_ui_extension_manifest.json
Open

Fix ui_extension manifest.json#7339
vividviolet wants to merge 1 commit intomainfrom
04-16-fix_ui_extension_manifest.json

Conversation

@vividviolet
Copy link
Copy Markdown
Member

@vividviolet vividviolet commented Apr 17, 2026

WHY are these changes introduced?

The manifest.json was being generated inside /dist even though /dist should only affect the bundle_ui step. Manifest files should be generated in the root of the bundle for consistency.

Before

admin_link

image
{
  "admin.app.intent.link": {
    "tools": "tools.json",
    "instructions": "instructions.md",
    "intents": [
      {
        "schema": "intent-schema.json"
      }
    ]
  }
}

ui_extension
image

{
  "admin.app.tools.data": {
    "main": "app-tools.js",
    "tools": "tools.json",
    "instructions": "instructions.md"
  }
}

After

admin_link (unchanged)

image
{
  "admin.app.intent.link": {
    "tools": "tools.json",
    "instructions": "instructions.md",
    "intents": [
      {
        "schema": "intent-schema.json"
      }
    ]
  }
}

ui_extension

image
{
  "admin.app.tools.data": {
    "main": "dist/app-tools.js",
    "tools": "tools.json",
    "instructions": "instructions.md"
  }
}

WHAT is this pull request doing?

  • Add bundleRoot property to ExtensionInstance to track the root directory for bundled extensions
  • Add localOutputPath getter that consistently resolves the extension's local output path
  • Refactor buildForBundle and copyIntoBundle methods to use bundleRoot for determining bundle locations
  • Update asset inclusion steps to write static assets to bundleRoot instead of output directory
  • Modify manifest generation to write manifest.json to bundleRoot
  • Update bundle UI step to rewrite asset paths relative to bundle root for consistent resolution
  • Remove bundlePath parameter from payload generation functions since extensions now track their own bundle locations
  • Fix asset payload generation to use correct file paths for timestamp resolution

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes
  • I've considered analytics changes to measure impact
  • The change is user-facing, so I've added a changelog entry with pnpm changeset add

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vividviolet
Copy link
Copy Markdown
Member Author

/snapit

@github-actions
Copy link
Copy Markdown
Contributor

🫰✨ Thanks @vividviolet! Your snapshot has been published to npm.

Test the snapshot by installing your package globally:

pnpm i -g --@shopify:registry=https://registry.npmjs.org @shopify/cli@0.0.0-snapshot-20260417020303

Caution

After installing, validate the version by running shopify version in your terminal.
If the versions don't match, you might have multiple global instances installed.
Use which shopify to find out which one you are running and uninstall it.

@vividviolet vividviolet force-pushed the 04-16-fix_ui_extension_manifest.json branch from ba0ec3f to 521ad24 Compare April 17, 2026 02:07
@vividviolet vividviolet marked this pull request as ready for review April 17, 2026 02:39
@vividviolet vividviolet requested a review from a team as a code owner April 17, 2026 02:39
return this.specification.getOutputRelativePath?.(this) ?? ''
}

get localOutputPath() {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was being repeated everywhere so I made a getter for it

url: `${url}/assets/${extension.outputFileName}`,
lastUpdated: (await fileLastUpdatedTimestamp(extensionOutputPath)) ?? 0,
},
// Always use the local output path for the main asset
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes a bug where the main asset appears to always update even though the JS files have not changed

@vividviolet vividviolet force-pushed the 04-16-fix_ui_extension_manifest.json branch from 521ad24 to ba7782c Compare April 17, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant