Skip to content

Commit 676dd6a

Browse files
committed
4.0.0-rc.1
1 parent 78c03da commit 676dd6a

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

CHANGELOG.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
## next
1+
## 4.0.0-rc.1
22

33
- Allowed to pass a string value as an options, it's equivalent to `{ basedir: <string> }`
44
- Fixed `scanFs()` definition to allow omitting of `options` argument
5-
- Added `encoding` option for `Rule` to specify an encoding for a file content
5+
- Added `resolveSymlinks` option to enable symlink resolving, a symlink resolving is disabled by default
66
- Added `posixPath` field to `File` and `Symlink` interfaces
7+
- Added `encoding` option for `Rule` to specify an encoding for a file content
8+
- Changed rule's `test` option to apply to POSIX paths disregarding of operating system used
9+
- Changed `include` and `exclude` options to take POSIX paths disregarding of operating system used which are supposed to be relative to `basedir`
710
- Changed a returning value of `scanFs()`:
811

912
- Added `basedir` field
@@ -20,7 +23,6 @@
2023
console.log(files, symlinks);
2124
```
2225

23-
- Added `resolveSymlinks` option to enable symlink resolving, a symlink resolving is disabled by default
2426
- Renamed `NormRule` type into `MatchRule`
2527
- Added `ScanResult` type to define returning type of `scanFs()`
2628
- Removed output errors to console by default

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,21 @@ A value of `options` parameter is a string (which equivalent to `{ basedir: <str
6262
Type: `string`
6363
Default: `process.cwd()`
6464

65-
Base directory to scan. All the paths in a result are relative to `basedir`.
65+
Base directory to scan and resolve paths to. All the paths in a result are relative to `basedir`.
6666

6767
- **include**
6868

6969
Type: `string`, `string[]` or `null`
7070
Default: `null`
7171

72-
A list of directories to scan, relative to `basedir`. When used, a scanned file path must start with one of the directories from the list. In case when the same path is used in `include` and `exclude`, `include` has priority over `exclude` (i.e. `include` wins).
72+
A list of directories to scan relative to `basedir`. When used, a scanned file path must start with one of the directories from the list. `include` has priority over `exclude` option, i.e. `include` wins when the same path is used in `include` and `exclude` options. Paths should be specified in POSIX disregarding of used operating system.
7373

7474
- **exclude**
7575

7676
Type: `string`, `string[]` or `null`
7777
Default: `null`
7878

79-
A list of directories to avoid scan, relative to `basedir`. When used, a scanned file path must not start with any of the directories from the list.
79+
A list of directories to avoid scan relative to `basedir`. When used, a file relative path must not start with any of the directories from the list. Paths should be specified in POSIX disregarding of used operating system.
8080

8181
- **rules**
8282

@@ -106,21 +106,21 @@ A **rule** is an object with following fields (all are optional):
106106
Type: `RegExp`, `RegExp[]` or `null`
107107
Default: `null`
108108

109-
A list of RegExps that applies to relative to `options.basedir` path of file.
109+
A list of RegExps that applies to a POSIX path relative to `options.basedir`.
110110

111111
- **include**
112112

113113
Type: `string`, `string[]` or `null`
114114
Default: `null`
115115

116-
The same as for `options.include` but applies on a rule level. When used it also populates `options.include`.
116+
The same as for `options.include` but applies on a rule's level. When used it also populates `options.include`.
117117

118118
- **exclude**
119119

120120
Type: `string`, `string[]` or `null`
121121
Default: `undefnullined`
122122

123-
The same as for `options.exclude` but applies on a rule level.
123+
The same as for `options.exclude` but applies on a rule's level.
124124

125125
- **extract**
126126

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@discoveryjs/scan-fs",
3-
"version": "3.0.0",
3+
"version": "4.0.0-rc.1",
44
"description": "An utility for seeking files by file system scanning and optionally populating file info with processing their content",
55
"author": "Roman Dvornov <[email protected]>",
66
"license": "MIT",

0 commit comments

Comments
 (0)