Skip to content

feat(cli): add --ignore-pattern flag to exclude files from deploy bundle.#221

Open
codxbrexx wants to merge 1 commit into
metacall:masterfrom
codxbrexx:fix/ignore_pattern_flag
Open

feat(cli): add --ignore-pattern flag to exclude files from deploy bundle.#221
codxbrexx wants to merge 1 commit into
metacall:masterfrom
codxbrexx:fix/ignore_pattern_flag

Conversation

@codxbrexx
Copy link
Copy Markdown
Contributor

@codxbrexx codxbrexx commented Mar 16, 2026

Resolves Issue

fix: #220

What changed?

  1. src/cli/args.ts: Replaced the legacy --ignore flag mapping with --ignore-pattern. Re-assigned the -i alias to this new flag and concurrently removed -i from the --inspect command to prevent any parsing collisions.
  2. src/deploy.ts: Implemented language detection during ZIP bundling using descriptor.runners. It now seamlessly combines user-supplied patterns with sensible, language-specific defaults (e.g., node_modules for Node.js, __pycache__ for Python, vendor for Ruby/PHP, bin/obj for C#/F#/COBOL, target for Rust).
  3. src/utils.ts: Ensured filterFiles properly matches user and system exclusions reliably during the filesystem traversal via REGEX.
  4. src/help.ts: Updated the hard-coded metacall-deploy --help documentation so that users can correctly see the new configuration aliases.
  5. Testing Configured: Added targeted integration test coverage in src/test/package.integration.spec.ts guaranteeing payload ZIP distributions don't contain ignored subsets.

Why this matters

Before this change, the CLI zipped the entire directory payload. This forces developers to arbitrarily upload incredibly large project assets (node_modules, compiled .pyc caches) decreasing upload speed or cluttering remote bundle sizes.
Providing a configurable and automatically scalable --ignore-pattern flag keeps the resulting payloads clean, lean, and specifically scoped.

Resolves

Resolves the TODO tracking the implementation of an exclude/ignore file functionality.

Testing

  • npm run lint executing locally produces no unexpected exceptions relating to these modifications.
  • npm run unit testing specifically asserting the filterFiles utility verifies correct array exclusion behaviors.
  • npm run test executes integration end-to-end zip archiving and assertions against local node repository file trees explicitly tracking --ignore-pattern payload reductions.

- Replace '--ignore' flag with '--ignore-pattern' (-i) to exclude files from the deployment bundle.
- Remove '-i' alias from '--inspect' to prevent command collisions.
- Automatically ignore default language folders (e.g., node_modules, __pycache__) during the zipping phase.
- Update '--help' output to reflect new flags and usages.
- Add unit and integration tests for pattern matching and ZIP file generation.
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.

Feature: add --ignore-pattern flag to exclude files from the deploy bundle

1 participant