Skip to content

Conversation

@kairosci
Copy link

Fix: Respect .gitignore when discovering web and extension configurations

Resolves #6518

Problem

The shopify app deploy and shopify app dev commands fail when there are multiple shopify.web.toml files in gitignored directories (e.g., git worktrees, build artifacts, tmp directories). The CLI currently searches through ALL subdirectories and only excludes node_modules.

Solution

  • Implement gitignore filtering for web directories
  • Implement gitignore filtering for extension directories
  • Add comprehensive tests
  • Fix linting issues
  • All tests pass ✓

Changes Made

Modified packages/app/src/cli/models/app/loader.ts:

  1. Added filterIgnoredPaths helper function - Reads .gitignore if it exists and filters paths using the ignore package
  2. Updated loadWebs function - Applies gitignore filtering before loading web configs
  3. Updated createExtensionInstances function - Applies gitignore filtering before loading extensions

Added tests in packages/app/src/cli/models/app/loader.test.ts:

  • Web blocks in gitignored directories are excluded
  • All web blocks load when no .gitignore exists (backward compatibility)
  • Extensions in gitignored directories are excluded

Test Results

✅ Lint passes (0 errors, 38 pre-existing warnings)
✅ All 138 loader tests pass
✅ Manual verification confirms gitignored directories are properly excluded

Note on CI

Some CI jobs may fail due to infrastructure issues:

  • graphql-codegen: Requires /opt/dev/bin/dev not available in CI
  • Acceptance tests: Require Shopify credentials not available in CI

These are pre-existing environment issues unrelated to these changes.

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@kairosci
Copy link
Author

i signed CLA, but system doesn't recognize

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.

[Bug]: shopify app deploy doesn't recognize web_directories argument

1 participant