Skip to content

feat(profiles): find targets by the files around them - #280

Merged
zaldih merged 3 commits into
mainfrom
profiles-heuristic
Nov 5, 2026
Merged

zaldih merged 3 commits into
mainfrom
profiles-heuristic

Conversation

@zaldih

@zaldih zaldih commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

A target can now be a rule as well as a name. The rule only matches when every entry it lists exists next to the target (nextTo) or inside it (contains). Rules with the same target are alternatives, and a plain name still matches on its own.

Example

new Npkill().startScan$('.', {
  targets: [
    'node_modules',
    {
      target: 'storybook-static',
      nextTo: ['package.json', '.storybook'],
      contains: ['index.html', 'iframe.html'],
    },
  ],
});
my-app/
├─ .storybook/             [nextTo]
├─ node_modules/           [target (name only)]
├─ package.json            [nextTo]
├─ src/
└─ storybook-static/       [target]
   ├─ index.html           [contains]
   └─ iframe.html          [contains]

A storybook-static folder without .storybook next to it is left alone.

@zaldih zaldih self-assigned this Nov 5, 2026
@zaldih zaldih changed the title Profiles heuristic feat(profiles): find targets by the files around them Nov 5, 2026
# Conflicts:
#	src/core/services/files/files.worker.ts
@zaldih
zaldih merged commit fd0762f into main Nov 5, 2026
19 checks passed
@zaldih
zaldih deleted the profiles-heuristic branch November 5, 2026 16:47
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