Skip to content

Comments

Abstract build steps to externalize the build configuration#6842

Draft
alfonso-noriega wants to merge 1 commit intographite-base/6842from
02-10-abstract_build_steps_to_externalize_the_build_configuration
Draft

Abstract build steps to externalize the build configuration#6842
alfonso-noriega wants to merge 1 commit intographite-base/6842from
02-10-abstract_build_steps_to_externalize_the_build_configuration

Conversation

@alfonso-noriega
Copy link
Contributor

@alfonso-noriega alfonso-noriega commented Feb 10, 2026

[Feature] Add build_steps extension build mode for flexible build pipelines

WHY are these changes introduced?

This PR introduces a new build_steps build mode for extensions, providing a more flexible and configurable build pipeline system. This allows extension developers to define custom build steps with different strategies, rather than being limited to the existing predefined build modes.

WHAT is this pull request doing?

  • Adds a new build_steps mode to the extension build configuration
  • Implements a build steps pipeline executor that can run steps sequentially or in parallel
  • Creates a copy_files step implementation with three strategies:
    • directory: Copy an entire directory
    • pattern: Copy files matching glob patterns
    • files: Copy a specific list of files
  • Adds comprehensive test coverage for the new build steps system
  • Integrates the new build mode with the existing extension build process

The architecture follows a Command Pattern approach, where each step type has a dedicated executor, making it easy to add more step types in the future.

How to test your changes?

  1. TODO
  2. Run shopify app dev and verify that the assets are correctly copied to the output directory
  3. Try different copy strategies and configurations to test the flexibility of the system

Measuring impact

How do we know this change was effective? Please choose one:

  • n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Copy link
Contributor Author

alfonso-noriega commented Feb 10, 2026

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.
Learn more

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

@github-actions
Copy link
Contributor

github-actions bot commented Feb 10, 2026

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements 79.05% 14701/18596
🟡 Branches 73.34% 7301/9955
🟡 Functions 79.24% 3732/4710
🟡 Lines 79.42% 13905/17508

Test suite run success

3864 tests passing in 1498 suites.

Report generated by 🧪jest coverage report action from 2830f1b

@alfonso-noriega alfonso-noriega force-pushed the 02-10-abstract_build_steps_to_externalize_the_build_configuration branch 4 times, most recently from cf3d1cc to fab204c Compare February 10, 2026 18:32
@elanalynn elanalynn force-pushed the proj-48450/asset-pipeline-for-hosted-apps branch from 4dd73b7 to 4a80cd2 Compare February 13, 2026 16:32
@elanalynn elanalynn changed the base branch from proj-48450/asset-pipeline-for-hosted-apps to graphite-base/6842 February 13, 2026 16:36
@alfonso-noriega alfonso-noriega force-pushed the 02-10-abstract_build_steps_to_externalize_the_build_configuration branch from fab204c to 602145f Compare February 16, 2026 10:59
@alfonso-noriega alfonso-noriega changed the base branch from graphite-base/6842 to proj-48450/asset-pipeline-for-hosted-apps February 16, 2026 10:59
@alfonso-noriega alfonso-noriega force-pushed the 02-10-abstract_build_steps_to_externalize_the_build_configuration branch from 602145f to bfb2090 Compare February 16, 2026 16:36
@elanalynn elanalynn changed the base branch from proj-48450/asset-pipeline-for-hosted-apps to graphite-base/6842 February 18, 2026 02:05
@alfonso-noriega alfonso-noriega force-pushed the 02-10-abstract_build_steps_to_externalize_the_build_configuration branch from bfb2090 to 2fafa03 Compare February 18, 2026 15:54
@alfonso-noriega alfonso-noriega changed the base branch from graphite-base/6842 to proj-48450/asset-pipeline-for-hosted-apps February 18, 2026 15:55
@alfonso-noriega alfonso-noriega force-pushed the 02-10-abstract_build_steps_to_externalize_the_build_configuration branch 4 times, most recently from ef67839 to e07113f Compare February 19, 2026 11:59
@alfonso-noriega alfonso-noriega force-pushed the 02-10-abstract_build_steps_to_externalize_the_build_configuration branch from e07113f to 2830f1b Compare February 19, 2026 12:36
Comment on lines +58 to +62
interface BuildConfig {
mode: 'none' | 'ui' | 'theme' | 'function' | 'tax_calculation' | 'copy_files'
steps?: ReadonlyArray<BuildStep>
stopOnError?: boolean
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Why keep mode and steps? the mode doesn't do anything anymore with this implementation right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mode is still used in two other places of this file, so i keep it here untill the other to usages get sorted out and replaced

Comment on lines +107 to +108
{id: 'bundle-ui', displayName: 'Bundle UI Extension', type: 'bundle_ui', config: {}},
{id: 'copy-static-assets', displayName: 'Copy Static Assets', type: 'copy_static_assets', config: {}},
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need a copy-static-assets step here?

Copy link
Contributor Author

@alfonso-noriega alfonso-noriega Feb 19, 2026

Choose a reason for hiding this comment

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

is part of the original ui mode, it had two lines one for bundeling another for copying. I kept it splited into two steps as it is pretty clear that copy assets should soon be a standard copy files step

Comment on lines +28 to +38
| 'copy_files'
| 'build_theme'
| 'bundle_theme'
| 'bundle_ui'
| 'copy_static_assets'
| 'build_function'
| 'create_tax_stub'
| 'esbuild'
| 'validate'
| 'transform'
| 'custom'
Copy link
Contributor

Choose a reason for hiding this comment

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

for me copy_files, bundle_theme, copy_static_assets is basically the same no? just move files from one place to another

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, I want to have follow up PRs migrating those but the changes are already enough as to add also this here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants