[Refactor] Optimize copyDirectoryContents and clean up knip config#7453
Conversation
This PR introduces a small performance and robustness improvement to the `copyDirectoryContents` utility in `@shopify/cli-kit`. By using the `cwd` option in `glob`, we avoid manual string manipulation to calculate relative paths, which is safer and more efficient. Additionally, I've cleaned up the `knip` configuration by removing unused `ignoreDependencies` for `@graphql-typed-document-node/core`, as flagged by `knip`'s configuration hints. ### WHAT is this pull request doing? - Refactors `copyDirectoryContents` in `packages/cli-kit/src/public/node/fs.ts` to use `glob` with the `cwd` option. - Replaces a `for...of` loop with `.map()` for cleaner asynchronous parallel execution. - Removes unused `ignoreDependencies` from `package.json` for `packages/app` and `packages/cli-kit`. ### How to test your changes? 1. Use a service that relies on asset copying, like `shopify app build`. 2. Verify that assets are correctly copied to the build directory.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Refactored
copyDirectoryContentsinpackages/cli-kit/src/public/node/fs.tsto use thecwdoption inglobfor better robustness and readability. Also removed unusedignoreDependenciesfrom theknipconfiguration in the rootpackage.jsonas flagged byknip. verified with tests and linting.PR created automatically by Jules for task 9802385123648497733 started by @gonzaloriestra