Skip to content

Releases: kaelzhang/node-ignore

7.0.0

23 Dec 11:59
Compare
Choose a tag to compare

Minor feature

The primary feature introduced by 7.0.0 is the .checkIgnore() method, which is most equivalent to git check-ignore -v. And also it allows to pass {pattern, mark?} as the parameter of .add() so that we could imitate the mechanism of git check-ignore as:

ig.add({
  pattern: 'foo/*',
  mark: '60'
})

const {
  ignored,
  rule
} = checkIgnore('foo/')

if (ignored) {
  console.log(`.gitignore:${result}:${rule.mark}:${rule.pattern} foo/`)
}

// .gitignore:60:foo/* foo/

Potential Incompatibilities

The only situation that 7.0.0 might bring incompatibility is to .add() a < 7.0.0 instance into a >= 7.0.0 instance, which might occur when the current workspace has multiple node-ignore versions installed, please be careful.

const {anotherIgnoreInstance} = require('./ignore-6.0-instance')

// A 7.0.0 instance
ignore().add(anotherIgnoreInstance)

// It will break your code

Otherwise, in most cases, if you never do something above or there is only one version of node-ignore installed in the current workspace, it is quite safe to upgrade to 7.0.0.

6.x (== 5.3.2)

28 Sep 13:03
Compare
Choose a tag to compare

6.x

  • The release of 6.x is due to a mistake.
  • Making an upgrade from 5.x to 6.x for now actually changes nothing and does no harm, everyone could just upgrade or ignore the version.
    • Actually 6.0.2 is 5.3.2
  • The next major release will be 7.0.0

5.3.0

16 Nov 11:47
Compare
Choose a tag to compare

5.3.0

  • MINOR export Options interface (#105)

An upgrade is safe for all dependents


It allows typing external methods which expect Options as a param, by importing the Options interface.

import {Options} from 'ignore'

5.2.4

19 Dec 16:12
Compare
Choose a tag to compare
  • PATCH fixes normal single asterisk and normal consecutive asterisks defined in gitignore spec (#57)
  • PATCH invalid trailing backslash will not throw unexpectedly

An upgrade is recommended for all dependents


The following rules could be not properly parsed with previous ignore versions

**foo
*bar
qu*ux
abc\   # `ignore` would throw if no whitespace after `\`

5.2.0

19 Dec 03:55
Compare
Choose a tag to compare
  • PATCH support readonly arrays of typescript. (#70)
  • MINOR bring backward compatibility with relative paths. (#75)

An upgrade is recommended for all dependents.


ignore().ignores('../foo/bar.js') // will throw

And the code below will not throw, however it is not recommended

ignore({
  allowRelativePaths: true
}).ignores('../foo/bar.js')

Recommend:

ignore().ignores('foo/bar.js')

5.1.9

03 Nov 08:06
Compare
Choose a tag to compare
  • PATCH fixes ignorecase when internal cache is hit. (#74)

An upgrade is recommended for all dependents.

5.1.5

22 May 14:12
Compare
Choose a tag to compare
  • PATCH fixes escaping for square brackets (#59)

An upgrade is recommended for all dependents.

5.1.3

14 Aug 09:19
Compare
Choose a tag to compare

An upgrade is recommended for all dependents.

5.1.1

17 Apr 07:58
Compare
Choose a tag to compare
  • PATCH fixes isPathValid on Windows (#54)

On Windows, if path is an absolute path, ig.ignores(path), ig.test(path) and related methods will now throw an error as expected.

2019-04-14, Version 5.1.0

14 Apr 08:51
Compare
Choose a tag to compare
  • FEATURE: Typescript: export interface Ignore (#53)