Skip to content

[Feature] Add support for a global .shopifyignore file in user's home directory #6018

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sshaw
Copy link

@sshaw sshaw commented Jun 26, 2025

WHY are these changes introduced?

Stems from #5951.

I wouldn't add Emacs-specific ignore patterns to a repo's .gitignore as Emacs ignores are specific to my environment and others may use VS Code etc... I'd put patterns specific to my environment in ~/.gitignore. Same applies to .shopifyignore.

WHAT is this pull request doing?

Expanding the search for ignore patterns from the project root's .shopifyignore to include ~/.shopifyignore.

How to test your changes?

pnpm vitest run packages/theme/src/cli/utilities/asset-ignore.test.ts

Post-release steps

N/A

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
  • Existing analytics will cater for this addition
  • PR includes analytics changes to measure impact

Checklist

  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've considered possible documentation changes

Can open a PR for doc changes if approved.

@sshaw sshaw requested review from a team as code owners June 26, 2025 01:45

const content = await readFile(shopifyIgnorePath, {encoding: 'utf8'})
async function readIgnoreFile(path: string) {
Copy link
Author

@sshaw sshaw Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a fan of this approach, much simpler to due do via flatMap in getPatternsFromShopifyIgnore but given await's semantics (await is an anti-pattern IMHO and this is just another example) it was a cleaner approach 😉

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.

1 participant