-
Notifications
You must be signed in to change notification settings - Fork 247
refactor: remove buildConfig from specifications in favor of clientSteps #7334
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,13 +12,18 @@ import {Writable} from 'stream' | |
| interface BundleOptions { | ||
| app: AppInterface | ||
| appManifest: AppManifest | ||
| bundlePath?: string | ||
| bundlePath: string | ||
| identifiers?: Identifiers | ||
| skipBuild: boolean | ||
| isDevDashboardApp: boolean | ||
| } | ||
|
|
||
| export async function bundleAndBuildExtensions(options: BundleOptions) { | ||
| /** | ||
| * Builds all extensions into a bundle directory and compresses it if any | ||
| * extension produced output. Returns the bundlePath if a bundle was created, | ||
| * or undefined if only the manifest was present (nothing to upload). | ||
| */ | ||
| export async function bundleAndBuildExtensions(options: BundleOptions): Promise<string | undefined> { | ||
|
Comment on lines
+21
to
+26
|
||
| const bundleDirectory = joinPath(options.app.directory, '.shopify', 'deploy-bundle') | ||
| await rmdir(bundleDirectory, {force: true}) | ||
| await mkdir(bundleDirectory) | ||
|
|
@@ -73,7 +78,12 @@ export async function bundleAndBuildExtensions(options: BundleOptions) { | |
| showTimestamps: false, | ||
| }) | ||
|
|
||
| if (options.bundlePath) { | ||
| const hasExtensionOutput = options.app.allExtensions.some((ext) => ext.hasDeploySteps) | ||
|
|
||
| if (hasExtensionOutput) { | ||
| await compressBundle(bundleDirectory, options.bundlePath) | ||
| return options.bundlePath | ||
| } | ||
|
|
||
| return undefined | ||
|
Comment on lines
+81
to
+88
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyIntoBundleassumes a single file output and usescopyFile(defaultOutputPath, this.outputPath). For extensions whoseoutputPathis a directory (e.g., specs that only runinclude_assetsand don't definegetOutputRelativePath),fileExists(defaultOutputPath)will be true andcopyFilewill throw (EISDIR). It also won't include any additional files placed alongside the main output (e.g., static assets copied into the output directory). Consider handling directory outputs (recursive copy) and/or executing the relevant non-build client steps (likeinclude_assets/copy_static_assets) even whenskipBuildis enabled.