Skip to content

Conversation

isaacroldan
Copy link
Contributor

@isaacroldan isaacroldan commented Aug 22, 2025

WHY are these changes introduced?

To support a new build mode for extensions that allows copying specific files to the output directory based on configurable patterns.

WHAT is this pull request doing?

Adds a new copy_files build mode for extensions that:

  • Allows specifying file patterns to include in the build output
  • Supports ignoring specific file patterns
  • Maintains the directory structure when copying files
  • Provides appropriate build output messages

The implementation includes:

  • Updated type definitions for BuildConfig to support the new mode
  • New copyFilesForExtension function to handle the file copying logic
  • Comprehensive tests for the new functionality
  • Integration with the existing extension build system

How to test your changes?

  1. Create an extension with the following build configuration in its specification:
"buildConfig": {
  "mode": "copy_files",
  "filePatterns": ["*.json", "assets/**/*.png"],
  "ignoredFilePatterns": ["test/**"]
}
  1. Run shopify app build
  2. Verify that only files matching the patterns are copied to the output directory
  3. Verify that files in ignored directories are not copied

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

@isaacroldan isaacroldan mentioned this pull request Aug 22, 2025
5 tasks
Copy link
Contributor Author

isaacroldan commented Aug 22, 2025

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

@isaacroldan isaacroldan changed the title Add new copy_files build mode and apply it to flow Add new copy_files build mode Aug 22, 2025
@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch 2 times, most recently from 1d8faaf to 2452642 Compare August 22, 2025 14:06
Copy link
Contributor

github-actions bot commented Aug 22, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.62% (+0.01% 🔼)
13502/17174
🟡 Branches
72.62% (-0.02% 🔻)
6555/9027
🟡 Functions
78.92% (+0.02% 🔼)
3512/4450
🟡 Lines
78.97% (+0.01% 🔼)
12760/16158
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / extension-instance.ts
82.22% (-0.46% 🔻)
76.98% (-0.62% 🔻)
92.73%
81.93% (-0.5% 🔻)
🟢
... / bundle.ts
84.38% (+2.02% 🔼)
63.33% (-3.33% 🔻)
78.95% (+5.61% 🔼)
86.44% (+2.77% 🔼)

Test suite run success

3241 tests passing in 1360 suites.

Report generated by 🧪jest coverage report action from 2e42e1c

@isaacroldan isaacroldan marked this pull request as ready for review August 22, 2025 14:46
@isaacroldan isaacroldan requested a review from a team as a code owner August 22, 2025 14:46
Copy link
Contributor

We detected some changes at packages/*/src and there are no updates in the .changeset.
If the changes are user-facing, run pnpm changeset add to track your changes and include them in the next release CHANGELOG.

Caution

DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release.

@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch from 2452642 to 838606e Compare August 29, 2025 11:39
@isaacroldan isaacroldan force-pushed the 08-22-move_buildmode_to_specification branch from e9d37ac to f69d123 Compare August 29, 2025 11:39
@isaacroldan isaacroldan mentioned this pull request Aug 29, 2025
5 tasks
@seandmccarthy seandmccarthy force-pushed the 08-22-move_buildmode_to_specification branch from f69d123 to 1544b06 Compare September 1, 2025 05:55
@seandmccarthy seandmccarthy force-pushed the 08-22-add_new_copy_files_build_mode branch from 838606e to 8f0f766 Compare September 1, 2025 05:55
@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch from 8f0f766 to 2ed7248 Compare September 9, 2025 13:30
@isaacroldan isaacroldan force-pushed the 08-22-move_buildmode_to_specification branch from 1544b06 to 1fb62eb Compare September 9, 2025 13:30
@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch from 2ed7248 to ca41206 Compare September 9, 2025 13:35
@isaacroldan isaacroldan force-pushed the 08-22-move_buildmode_to_specification branch from 1fb62eb to 652becc Compare September 9, 2025 13:35
@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch from ca41206 to f26b4d2 Compare September 9, 2025 15:11
@isaacroldan isaacroldan force-pushed the 08-22-move_buildmode_to_specification branch from 652becc to bfebf0a Compare September 9, 2025 15:11
@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch from f26b4d2 to b6c65ba Compare September 11, 2025 15:51
@isaacroldan isaacroldan force-pushed the 08-22-move_buildmode_to_specification branch from bfebf0a to 87a7aa1 Compare September 11, 2025 15:51
@seandmccarthy seandmccarthy force-pushed the 08-22-add_new_copy_files_build_mode branch from b6c65ba to 8f0f766 Compare September 11, 2025 22:56
@seandmccarthy seandmccarthy force-pushed the 08-22-move_buildmode_to_specification branch from 87a7aa1 to 1544b06 Compare September 11, 2025 22:56
Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/common/version.d.ts
@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "3.84.1";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "3.84.0";
\ No newline at end of file
packages/cli-kit/dist/private/node/analytics/error-categorizer.d.ts
@@ -1,5 +1,4 @@
 export declare enum ErrorCategory {
-    Liquid = "LIQUID",
     ThemeCheck = "THEME_CHECK",
     Network = "NETWORK",
     FileSystem = "FILE_SYSTEM",
@@ -7,12 +6,7 @@ export declare enum ErrorCategory {
     Validation = "VALIDATION",
     Permission = "PERMISSION",
     RateLimit = "RATE_LIMIT",
-    Json = "JSON",
+    Parsing = "PARSING",
     Unknown = "UNKNOWN"
 }
-export declare function categorizeError(error: unknown): ErrorCategory;
-/**
- * Formats an error message for analytics tracking, preserving important information
- * based on the error category while keeping it concise and normalized.
- */
-export declare function formatErrorMessage(error: unknown, category: ErrorCategory): string;
\ No newline at end of file
+export declare function categorizeError(error: unknown): ErrorCategory;
\ No newline at end of file

Copy link
Contributor

Differences in type declarations

We detected differences in the type declarations generated by Typescript for this branch compared to the baseline ('main' branch). Please, review them to ensure they are backward-compatible. Here are some important things to keep in mind:

  • Some seemingly private modules might be re-exported through public modules.
  • If the branch is behind main you might see odd diffs, rebase main into this branch.

New type declarations

We found no new type declarations in this PR

Existing type declarations

packages/cli-kit/dist/public/common/version.d.ts
@@ -1 +1 @@
-export declare const CLI_KIT_VERSION = "3.84.1";
\ No newline at end of file
+export declare const CLI_KIT_VERSION = "3.84.0";
\ No newline at end of file
packages/cli-kit/dist/private/node/analytics/error-categorizer.d.ts
@@ -1,5 +1,4 @@
 export declare enum ErrorCategory {
-    Liquid = "LIQUID",
     ThemeCheck = "THEME_CHECK",
     Network = "NETWORK",
     FileSystem = "FILE_SYSTEM",
@@ -7,12 +6,7 @@ export declare enum ErrorCategory {
     Validation = "VALIDATION",
     Permission = "PERMISSION",
     RateLimit = "RATE_LIMIT",
-    Json = "JSON",
+    Parsing = "PARSING",
     Unknown = "UNKNOWN"
 }
-export declare function categorizeError(error: unknown): ErrorCategory;
-/**
- * Formats an error message for analytics tracking, preserving important information
- * based on the error category while keeping it concise and normalized.
- */
-export declare function formatErrorMessage(error: unknown, category: ErrorCategory): string;
\ No newline at end of file
+export declare function categorizeError(error: unknown): ErrorCategory;
\ No newline at end of file

@isaacroldan isaacroldan force-pushed the 08-22-move_buildmode_to_specification branch from 1544b06 to 87a7aa1 Compare September 12, 2025 10:48
@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch from 8f0f766 to b6c65ba Compare September 12, 2025 10:48
@isaacroldan isaacroldan force-pushed the 08-22-move_buildmode_to_specification branch from 87a7aa1 to 9cc81cf Compare September 12, 2025 11:03
@isaacroldan isaacroldan force-pushed the 08-22-add_new_copy_files_build_mode branch from b6c65ba to 2e42e1c Compare September 12, 2025 11:03
Base automatically changed from 08-22-move_buildmode_to_specification to main September 15, 2025 10:02
@isaacroldan isaacroldan added this pull request to the merge queue Sep 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 16, 2025
@isaacroldan isaacroldan added this pull request to the merge queue Sep 16, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 16, 2025
@isaacroldan isaacroldan added this pull request to the merge queue Sep 16, 2025
Merged via the queue into main with commit 28ee441 Sep 16, 2025
68 of 96 checks passed
@isaacroldan isaacroldan deleted the 08-22-add_new_copy_files_build_mode branch September 16, 2025 10:35
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