Skip to content

Changed files inside project root but outside sourceRoot are not detected as affected #60

@nirsky

Description

@nirsky

Bug

When a file is changed inside a project's root directory but outside its sourceRoot, domino does not mark that project as affected.

Example

Given a project with:

{
  "root": "apps/my-app",
  "sourceRoot": "apps/my-app/src"
}

If you modify apps/my-app/project.json or apps/my-app/jest.config.js, domino does not detect my-app as affected.

Root cause

ProjectIndex::get_package_names_by_path matches files against source_root only. Files that live in the project root but outside source_root (config files like project.json, jest.config.js, tsconfig.json, etc.) don't match any project.

Additionally, non-source files go through the asset path in find_affected_internal, which also relies on get_package_names_by_path for ownership — so the same blind spot applies there.

Expected behavior

Any changed file inside a project's root should mark that project as affected, regardless of whether it falls under sourceRoot.

Suggested fix

ProjectIndex should also index project root paths (not just source_root), and fall back to root matching when source_root doesn't match. This would ensure config file changes are attributed to their owning project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions