Skip to content

Commit

Permalink
4.0.0-rc.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Sep 7, 2022
1 parent 78c03da commit 676dd6a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
## next
## 4.0.0-rc.1

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

- Added `basedir` field
Expand All @@ -20,7 +23,6 @@
console.log(files, symlinks);
```

- Added `resolveSymlinks` option to enable symlink resolving, a symlink resolving is disabled by default
- Renamed `NormRule` type into `MatchRule`
- Added `ScanResult` type to define returning type of `scanFs()`
- Removed output errors to console by default
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@ A value of `options` parameter is a string (which equivalent to `{ basedir: <str
Type: `string`
Default: `process.cwd()`

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

- **include**

Type: `string`, `string[]` or `null`
Default: `null`

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).
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.

- **exclude**

Type: `string`, `string[]` or `null`
Default: `null`

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.
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.

- **rules**

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

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

- **include**

Type: `string`, `string[]` or `null`
Default: `null`

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

- **exclude**

Type: `string`, `string[]` or `null`
Default: `undefnullined`

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

- **extract**

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@discoveryjs/scan-fs",
"version": "3.0.0",
"version": "4.0.0-rc.1",
"description": "An utility for seeking files by file system scanning and optionally populating file info with processing their content",
"author": "Roman Dvornov <[email protected]>",
"license": "MIT",
Expand Down

0 comments on commit 676dd6a

Please sign in to comment.