Refactor extension build process to use modular build steps#6867
Conversation
|
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. |
64d581f to
c4c3353
Compare
1c5c718 to
3ac919f
Compare
c4c3353 to
d2a2b21
Compare
2b6f7ba to
68c2a9f
Compare
d2a2b21 to
3837d71
Compare
8096aa6 to
f6ae0a0
Compare
794d3e0 to
75deab1
Compare
f6ae0a0 to
1b503e0
Compare
75deab1 to
feab6d2
Compare
1b503e0 to
01cfc8b
Compare
feab6d2 to
27b8cfc
Compare
01cfc8b to
048e70a
Compare
27b8cfc to
34005f5
Compare
048e70a to
c25acc0
Compare
4dd6917 to
56f0d4a
Compare
Coverage report
Test suite run success3860 tests passing in 1486 suites. Report generated by 🧪jest coverage report action from 4061625 |
c468483 to
067c371
Compare
067c371 to
be84850
Compare
d835caf to
57a0790
Compare
be84850 to
dd1d204
Compare
57a0790 to
316c2ab
Compare
e90a1b3 to
93493c9
Compare
|
These findings are in files not modified by this PR and cannot be posted as inline comments.
For Impact:
|
316c2ab to
a9d3692
Compare
93493c9 to
af69f6c
Compare
| break | ||
| const steps = clientSteps | ||
| .filter((lifecycle) => lifecycle.lifecycle === 'deploy') | ||
| .flatMap((lifecycle) => lifecycle.steps) |
There was a problem hiding this comment.
Crash when specification.clientSteps is missing/undefined
ExtensionInstance.build() now does:
const steps = clientSteps
.filter((lifecycle) => lifecycle.lifecycle === 'deploy')
.flatMap((lifecycle) => lifecycle.steps)If this.specification.clientSteps is undefined for any extension type (including internal/legacy specs not updated in this PR), this will throw: TypeError: Cannot read properties of undefined (reading 'filter').
Impact:
- Extension builds/deploys will hard-fail for any extension type missing
clientSteps, blocking development and deployments. - CI/release pipelines that build extensions will fail; could break deploys for affected extension types.
- Potentially broad depending on how many specs are migrated; PR only updates some specs so risk is high.
- Could cause widespread deployment failures.
a9d3692 to
ce4a75e
Compare
af69f6c to
4061625
Compare
4061625 to
5bbfb2b
Compare
5bbfb2b to
bfecc1d
Compare
b6f6989 to
92899bf
Compare
bfecc1d to
f528520
Compare
55fc27f to
b5573b3
Compare
f528520 to
60604ec
Compare

Wire extension specifications to use client steps
Summary
This PR wires all extension specifications to use the
clientStepscontract introduced in #01-build-steps-infrastructure. Thebuild()method inExtensionInstanceis refactored from a hard-coded mode switch to a generic step execution loop, and every spec now declares its ownclientStepsarray.Depends on:
01-build-steps-infrastructureWhat changed
ExtensionInstance.build()— mode switch replaced by step loopBefore:
After:
The mode switch and all its direct function call imports (
buildThemeExtension,buildUIExtension,buildFunctionExtension,copyFilesForExtension) are removed. The step loop is uniform across all extension types.extension.ts—buildThemeExtensionremovedbuildThemeExtension()and itsrunThemeCheckimport are removed fromextension.ts— the logic now lives exclusively inbuild-theme-step.ts.Specs wired
All specs now declare
clientSteps. ThebuildConfig.modeis kept as a transitional field.UI extensions
Theme
Function
Tax calculation
Flow template
Channel
Tests added
Each spec now has a dedicated build test file asserting:
buildConfig.modeis correctclientStepshas the expected step structureextension.build()produces the correct output on disk (integration)ui_extension_build.test.tsbundle_ui+copy_static_assetsstepstheme.test.tsbuild_theme+bundle_themestepsfunction_build.test.tsbuild_functionstep delegates tobuildFunctionExtensiontax_calculation_build.test.tscreate_tax_stubwrites(()=>{})();flow_template.test.ts.flow/.json/.toml, not.js/.ts; preserves subdirschannel.test.tsspecifications/subdirectory intooutput/specifications/; filters by extensionFiles changed
models/extensions/extension-instance.tsbuild()rewritten to useexecuteSteploopservices/build/extension.tsbuildThemeExtension+runThemeCheckimportspecifications/ui_extension.tsclientStepsspecifications/checkout_post_purchase.tsclientStepsspecifications/checkout_ui_extension.tsclientStepsspecifications/pos_ui_extension.tsclientStepsspecifications/product_subscription.tsclientStepsspecifications/web_pixel_extension.tsclientStepsspecifications/theme.tsclientStepsspecifications/function.tsclientStepsspecifications/tax_calculation.tsclientStepsspecifications/flow_template.tsclientStepswithinclude_assetsconfigspecifications/channel.tsinclude_assetsscoped tospecifications/subdirectoryMeasuring impact
How do we know this change was effective? Please choose one:
Checklist