@cspell/cspell-pipe 6.14.0 → 6.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -61
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -7,64 +7,3 @@ A library to assist with working with Iterables and AsyncIterables
|
|
|
7
7
|
```sh
|
|
8
8
|
npm install -S @cspell/cspell-pipe
|
|
9
9
|
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { GitIgnore, findRepoRoot } from 'cspell-gitignore';
|
|
15
|
-
|
|
16
|
-
// ...
|
|
17
|
-
|
|
18
|
-
const cwd = process.cwd();
|
|
19
|
-
const root = (await findRepoRoot(cwd)) || cwd;
|
|
20
|
-
const gitIgnore = new GitIgnore([root]);
|
|
21
|
-
|
|
22
|
-
const allFiles = glob('**');
|
|
23
|
-
|
|
24
|
-
const files = await gitIgnore.filterOutIgnored(allFiles);
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Logic
|
|
28
|
-
|
|
29
|
-
- For each file, search for the `.gitignore` files in the directory hierarchy.
|
|
30
|
-
- Ignore any files that match the globs found in the `.gitignore` files.
|
|
31
|
-
|
|
32
|
-
The `.gitignore` globs are evaluated from highest to lowest, matching the `git` behavior.
|
|
33
|
-
|
|
34
|
-
To prevent searching higher in the directory hierarchy, specify roots:
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
const gitIgnore = new GitIgnore([process.cwd()]);
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
# `cspell-gitignore` CLI
|
|
41
|
-
|
|
42
|
-
`cspell-gitignore` provides a simple cli for debugging .gitignore issues.
|
|
43
|
-
|
|
44
|
-
In most cases it should provide the same output as `git check-ignore`.
|
|
45
|
-
|
|
46
|
-
## Usage
|
|
47
|
-
|
|
48
|
-
```text
|
|
49
|
-
Usage cspell-gitignore [options] <files>
|
|
50
|
-
|
|
51
|
-
Check files against .gitignore
|
|
52
|
-
Compare against git check-ignore -v -n <files>
|
|
53
|
-
|
|
54
|
-
Options:
|
|
55
|
-
-r, --root Add a root to prevent searching for .gitignore files above the root if the file is under the root.
|
|
56
|
-
This option can be used multiple times to add multiple roots. The default root is the current
|
|
57
|
-
repository root determined by the `.git` directory.
|
|
58
|
-
|
|
59
|
-
Example:
|
|
60
|
-
cspell-gitignore README.md
|
|
61
|
-
cspell-gitignore -r . node_modules
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Example:
|
|
66
|
-
|
|
67
|
-
```sh
|
|
68
|
-
$ cspell-gitignore -r . node_modules
|
|
69
|
-
.gitignore:58:node_modules/ node_modules
|
|
70
|
-
```
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "6.14.
|
|
6
|
+
"version": "6.14.2",
|
|
7
7
|
"description": "Library to make working with Iterators/AsyncIterators easier.",
|
|
8
8
|
"keywords": [
|
|
9
9
|
"cspell",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
},
|
|
112
112
|
"devDependencies": {
|
|
113
113
|
"@types/node": "^18.11.9",
|
|
114
|
-
"jest": "^29.
|
|
114
|
+
"jest": "^29.3.1",
|
|
115
115
|
"rimraf": "^3.0.2"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "ea9692380357e9e890c20f15b1200cc1c6c3a2df"
|
|
118
118
|
}
|