vercel / vercel/nft

glob in ignore option does not work

Open
#445 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.7k
Forks
185
PR merge metrics
No merged PRs in 30d

Description

Easiest way to reproduce:

// type in node repl
const { nodeFileTrace } = require('@vercel/nft');
(await nodeFileTrace([require.resolve('glob')], { ignore: ['node_modules/**'] })).fileList;

This outputs exactly same list of files as if no ignore option was provided at all. It should output list containing only the input file itself (result of require.resolve).

I have a hunch it happens only on windows (but I have no way of confirming it now), as on windows the package outputs \ as path separators. However I also tried 'node_modules\\**' and it didn't work as well.

Env:
OS: Windows 10
Node: v18.19.0
@vercel/nft version: 0.27.4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the nodeFileTrace entry point and reproduce the issue in a Node REPL using require.resolve('glob') with ignore: ['node_modules/']; compare the result with and without the ignore option, including Windows path separators. Done means the fileList contains only the input file when node_modules/ is ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.