-
Notifications
You must be signed in to change notification settings - Fork 234
Add client steps implementation to support existing functionalities #6966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
alfonso-noriega
merged 13 commits into
main
from
03-10-add_client_steps_implementation_to_support_existing_functionalities
Mar 25, 2026
+1,569
−5
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
10cf452
Add client steps implementation to support existing functionalities
alfonso-noriega 08b23f3
Guard include_assets step against path traversal in destinations and …
alfonso-noriega 2923a07
Fix prettier lint errors in include_assets_step.ts
alfonso-noriega 4a5ddb5
Refactor include_assets step helpers and fix directory copy count
alfonso-noriega ded4712
Fix static preserveStructure default and unwrap copyByPattern return …
alfonso-noriega 17065af
Move sanitizeRelativePath to cli-kit/path and simplify copySourceEntry
alfonso-noriega 416a408
Split include-assets-step into orchestrator + strategy files
alfonso-noriega af26a23
Fix reduce type annotation after include-assets split
alfonso-noriega 0a08209
Add unit tests for each include-assets strategy
alfonso-noriega ad3fc54
Remove preserveStructure option from include_assets step
alfonso-noriega a59eae8
Remove preserveStructure option from include_assets step
alfonso-noriega 428897d
Improve log messages and migrate copy-config-key-entry tests to real …
alfonso-noriega 9ece376
Remove no-files-matched warning from copy-by-pattern
alfonso-noriega File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
packages/app/src/cli/services/build/steps/build-function-step.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import {buildFunctionExtension} from '../extension.js' | ||
| import type {LifecycleStep, BuildContext} from '../client-steps.js' | ||
|
|
||
| /** | ||
| * Executes a build_function build step. | ||
| * | ||
| * Compiles the function extension (JavaScript or other language) to WASM, | ||
| * applying wasm-opt and trampoline as configured. | ||
| */ | ||
| export async function executeBuildFunctionStep(_step: LifecycleStep, context: BuildContext): Promise<void> { | ||
| return buildFunctionExtension(context.extension, context.options) | ||
| } |
14 changes: 14 additions & 0 deletions
14
packages/app/src/cli/services/build/steps/build-theme-step.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import {runThemeCheck} from '../theme-check.js' | ||
| import type {LifecycleStep, BuildContext} from '../client-steps.js' | ||
|
|
||
| /** | ||
| * Executes a build_theme build step. | ||
| * | ||
| * Runs theme check on the extension directory and writes any offenses to stdout. | ||
| */ | ||
| export async function executeBuildThemeStep(_step: LifecycleStep, context: BuildContext): Promise<void> { | ||
| const {extension, options} = context | ||
| options.stdout.write(`Running theme check on your Theme app extension...`) | ||
| const offenses = await runThemeCheck(extension.directory) | ||
| if (offenses) options.stdout.write(offenses) | ||
| } |
30 changes: 30 additions & 0 deletions
30
packages/app/src/cli/services/build/steps/bundle-theme-step.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import {themeExtensionFiles} from '../../../utilities/extensions/theme.js' | ||
| import {copyFile} from '@shopify/cli-kit/node/fs' | ||
| import {relativePath, joinPath} from '@shopify/cli-kit/node/path' | ||
| import type {LifecycleStep, BuildContext} from '../client-steps.js' | ||
|
|
||
| /** | ||
| * Executes a bundle_theme build step. | ||
| * | ||
| * Copies theme extension files to the output directory, preserving relative paths. | ||
| * Respects the extension's .shopifyignore file and the standard ignore patterns. | ||
| */ | ||
| export async function executeBundleThemeStep( | ||
| _step: LifecycleStep, | ||
| context: BuildContext, | ||
| ): Promise<{filesCopied: number}> { | ||
| const {extension, options} = context | ||
| options.stdout.write(`Bundling theme extension ${extension.localIdentifier}...`) | ||
| const files = await themeExtensionFiles(extension) | ||
|
|
||
| await Promise.all( | ||
| files.map(async (filepath) => { | ||
| const relativePathName = relativePath(extension.directory, filepath) | ||
| const outputFile = joinPath(extension.outputPath, relativePathName) | ||
| if (filepath === outputFile) return | ||
| await copyFile(filepath, outputFile) | ||
| }), | ||
| ) | ||
|
|
||
| return {filesCopied: files.length} | ||
| } |
11 changes: 11 additions & 0 deletions
11
packages/app/src/cli/services/build/steps/bundle-ui-step.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import {buildUIExtension} from '../extension.js' | ||
| import type {LifecycleStep, BuildContext} from '../client-steps.js' | ||
|
|
||
| /** | ||
| * Executes a bundle_ui build step. | ||
| * | ||
| * Bundles the UI extension using esbuild, writing output to extension.outputPath. | ||
| */ | ||
| export async function executeBundleUIStep(_step: LifecycleStep, context: BuildContext): Promise<void> { | ||
| return buildUIExtension(context.extension, context.options) | ||
| } |
11 changes: 11 additions & 0 deletions
11
packages/app/src/cli/services/build/steps/copy-static-assets-step.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import type {LifecycleStep, BuildContext} from '../client-steps.js' | ||
|
|
||
| /** | ||
| * Executes a copy_static_assets build step. | ||
| * | ||
| * Copies static assets defined in the extension's build_manifest to the output directory. | ||
| * This is a no-op for extensions that do not define static assets. | ||
| */ | ||
| export async function executeCopyStaticAssetsStep(_step: LifecycleStep, context: BuildContext): Promise<void> { | ||
alfonso-noriega marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| return context.extension.copyStaticAssets() | ||
| } | ||
14 changes: 14 additions & 0 deletions
14
packages/app/src/cli/services/build/steps/create-tax-stub-step.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| import {touchFile, writeFile} from '@shopify/cli-kit/node/fs' | ||
| import type {LifecycleStep, BuildContext} from '../client-steps.js' | ||
|
|
||
| /** | ||
| * Executes a create_tax_stub build step. | ||
| * | ||
| * Creates a minimal JavaScript stub file at the extension's output path, | ||
| * satisfying the tax calculation extension bundle format. | ||
| */ | ||
| export async function executeCreateTaxStubStep(_step: LifecycleStep, context: BuildContext): Promise<void> { | ||
| const {extension} = context | ||
| await touchFile(extension.outputPath) | ||
| await writeFile(extension.outputPath, '(()=>{})();') | ||
alfonso-noriega marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.