Skip to content

feat(build): exclude files#793

Merged
basmasking merged 5 commits into
mainfrom
768-include-exclude-source-files
Jun 23, 2026
Merged

feat(build): exclude files#793
basmasking merged 5 commits into
mainfrom
768-include-exclude-source-files

Conversation

@petermasking

Copy link
Copy Markdown
Member

Fixes #768

Changes proposed in this pull request:

  • option to exclude files from build

@MaskingTechnology/jitar

@petermasking petermasking requested a review from basmasking as a code owner June 22, 2026 13:50
@petermasking petermasking linked an issue Jun 22, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e13938fb-4f39-4372-a2ba-bf47b97ccd4a

📥 Commits

Reviewing files that changed from the base of the PR and between c9e2c83 and 688ac33.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (21)
  • package.json
  • packages/analysis/package.json
  • packages/build/package.json
  • packages/cli/package.json
  • packages/configuration/package.json
  • packages/errors/package.json
  • packages/execution/package.json
  • packages/health/package.json
  • packages/http/package.json
  • packages/init/package.json
  • packages/jitar/package.json
  • packages/logging/package.json
  • packages/middleware/package.json
  • packages/plugin-vite/package.json
  • packages/runtime/package.json
  • packages/scheduling/package.json
  • packages/serialization/package.json
  • packages/services/package.json
  • packages/sourcing/package.json
  • packages/validation/package.json
  • tools/eslint-plugin/package.json
✅ Files skipped from review due to trivial changes (21)
  • packages/jitar/package.json
  • packages/build/package.json
  • package.json
  • packages/validation/package.json
  • packages/configuration/package.json
  • packages/analysis/package.json
  • packages/middleware/package.json
  • packages/plugin-vite/package.json
  • packages/scheduling/package.json
  • packages/logging/package.json
  • packages/sourcing/package.json
  • packages/http/package.json
  • packages/cli/package.json
  • packages/init/package.json
  • tools/eslint-plugin/package.json
  • packages/runtime/package.json
  • packages/execution/package.json
  • packages/health/package.json
  • packages/errors/package.json
  • packages/serialization/package.json
  • packages/services/package.json

Summary by CodeRabbit

  • New Features
    • Added support for build exclusion patterns via build.ignore to skip matching files during builds.
    • Ignore rules are now applied when discovering modules to build.
  • Documentation
    • Updated build configuration docs with build.ignore, including glob examples and jitar.json configuration guidance.
  • Tests
    • Extended runtime configuration tests and fixtures to cover build.ignore.
  • Chores
    • Bumped package versions to 0.11.2.

Walkthrough

Adds a build.ignore option to Jitar's runtime configuration accepting glob patterns for files to exclude from build processing. The change extends the configuration type, defaults, and validation schema; introduces a filterWithIgnores method on FileManager; wires ignore rules through ProjectFileManager, BuildHelper, and BuildManager; and documents the new option. All packages are version-bumped to 0.11.2.

Changes

build.ignore glob-pattern exclusion

Layer / File(s) Summary
RuntimeConfiguration type, defaults, and validation
packages/configuration/src/runtime/definitions/RuntimeConfiguration.ts, packages/configuration/src/runtime/ConfigurationBuilder.ts
RuntimeConfiguration gains a build: { ignore: string[] } field; DefaultValues adds RESOURCES, BUILD, and BUILD_IGNORE; validationScheme adds optional resources and build.ignore validation; ConfigurationBuilder.build() defaults build.ignore from DefaultValues.BUILD_IGNORE.
FileManager.filterWithIgnores
packages/sourcing/src/files/FileManager.ts
New async filterWithIgnores(pattern, ignorePatterns) method filters a primary glob result against a flattened set of all filenames matching any ignore pattern, returning only non-ignored names.
ProjectFileManager, BuildHelper, and BuildManager wiring
packages/build/src/ProjectFileManager.ts, packages/build/src/BuildHelper.ts, packages/build/src/BuildManager.ts
ProjectFileManager adds a #sourceIgnores field, an extended constructor parameter, and a public getter. BuildHelper and BuildManager pass configuration.build.ignore into ProjectFileManager and replace filter(MODULE_PATTERN) with filterWithIgnores(MODULE_PATTERN, sourceIgnores).
Configuration tests and fixtures
packages/configuration/test/runtime/ConfigurationBuilder.spec.ts, packages/configuration/test/runtime/fixtures/*
Fixture types widened to Record<string, unknown>; existing result fixtures updated to include build.ignore; new BUILD fixture constants added to FILENAMES, FILES, and CONFIGURATIONS; new test case asserts build config resolves to expected result.
Build configuration docs
documentation/docs/build/configuration.md
Page updated to describe the JSON file as optional with jitar.json default, adds a "Specific build options" subsection with a JSON example documenting build.ignore as a list of glob patterns relative to the source folder.

Release version update

Layer / File(s) Summary
Monorepo package version updates
package.json, packages/*/package.json, tools/*/package.json
All package manifests updated from version 0.11.1 to 0.11.2.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • basmasking

Poem

🐇 Hopping through the source files, one by one,
Some paths I'll skip — my ignore list has begun!
build.ignore globs, a pattern here and there,
Frontend bundles vanish into thin air.
With filterWithIgnores the build stays neat,
A tidy jitar.json makes it all complete! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Out of Scope Changes check ❓ Inconclusive The PR implements exclude functionality but does not include include/exclusion patterns as originally described in issue #768; only exclude capability is delivered. Clarify whether the partial implementation (exclude-only) aligns with the original scope which requested both include and exclude options, or document the decision to defer include patterns to a future phase.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(build): exclude files' directly and clearly summarizes the main feature addition in this PR—implementing file exclusion for the build process.
Description check ✅ Passed The PR description follows the repository template, includes the linked issue reference (#768), summarizes the changes proposed (option to exclude files), and includes the team mention.
Linked Issues check ✅ Passed The PR implements the core requirement from issue #768 by adding exclude file functionality through the build.ignore configuration option, allowing users to selectively control which files are processed during the build.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/configuration/src/runtime/ConfigurationBuilder.ts`:
- Around line 34-35: The code at lines 34-35 in ConfigurationBuilder.ts assigns
shared references from DefaultValues.BUILD and DefaultValues.BUILD_IGNORE
directly to the configuration object. To prevent mutations in one build from
affecting subsequent builds, create independent copies of these default objects
instead of reusing the shared references. When assigning to configuration.build
and configuration.build.ignore, use a cloning or spreading mechanism to ensure
each configuration instance gets its own copy of the default values rather than
a shared reference.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f505940c-36d7-4094-b9c1-fed2b16fc01b

📥 Commits

Reviewing files that changed from the base of the PR and between a3c1d36 and c9e2c83.

📒 Files selected for processing (11)
  • documentation/docs/build/configuration.md
  • packages/build/src/BuildHelper.ts
  • packages/build/src/BuildManager.ts
  • packages/build/src/ProjectFileManager.ts
  • packages/configuration/src/runtime/ConfigurationBuilder.ts
  • packages/configuration/src/runtime/definitions/RuntimeConfiguration.ts
  • packages/configuration/test/runtime/ConfigurationBuilder.spec.ts
  • packages/configuration/test/runtime/fixtures/configuration.fixture.ts
  • packages/configuration/test/runtime/fixtures/filenames.fixture.ts
  • packages/configuration/test/runtime/fixtures/files.fixture.ts
  • packages/sourcing/src/files/FileManager.ts

Comment on lines +34 to +35
configuration.build ??= DefaultValues.BUILD;
configuration.build.ignore ??= DefaultValues.BUILD_IGNORE;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Avoid sharing mutable defaults across builds.

Line 34 and Line 35 assign shared object/array references from DefaultValues. If configuration.build.ignore is mutated later, subsequent build() calls can inherit stale ignore patterns.

Suggested fix
-        configuration.build ??= DefaultValues.BUILD;
-        configuration.build.ignore ??= DefaultValues.BUILD_IGNORE;
+        configuration.build ??= { ignore: [...DefaultValues.BUILD_IGNORE] };
+        configuration.build.ignore ??= [...DefaultValues.BUILD_IGNORE];
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
configuration.build ??= DefaultValues.BUILD;
configuration.build.ignore ??= DefaultValues.BUILD_IGNORE;
configuration.build ??= { ...DefaultValues.BUILD, ignore: [...DefaultValues.BUILD_IGNORE] };
configuration.build.ignore ??= [...DefaultValues.BUILD_IGNORE];
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/configuration/src/runtime/ConfigurationBuilder.ts` around lines 34 -
35, The code at lines 34-35 in ConfigurationBuilder.ts assigns shared references
from DefaultValues.BUILD and DefaultValues.BUILD_IGNORE directly to the
configuration object. To prevent mutations in one build from affecting
subsequent builds, create independent copies of these default objects instead of
reusing the shared references. When assigning to configuration.build and
configuration.build.ignore, use a cloning or spreading mechanism to ensure each
configuration instance gets its own copy of the default values rather than a
shared reference.

@basmasking basmasking merged commit b270eeb into main Jun 23, 2026
23 of 24 checks passed
@basmasking basmasking deleted the 768-include-exclude-source-files branch June 23, 2026 20:35
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
11.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

Include / exclude source files

2 participants