view-ignored 0.6.0 → 0.7.1
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/out/browser_scan.d.ts +1 -1
- package/out/browser_scan.js +14 -9
- package/out/browser_stream.d.ts +1 -1
- package/out/browser_stream.js +14 -9
- package/out/patterns/extractor.d.ts +16 -10
- package/out/patterns/gitignore.d.ts +1 -1
- package/out/patterns/gitignore.js +1 -1
- package/out/patterns/ignores.d.ts +30 -1
- package/out/patterns/jsrjson.d.ts +2 -2
- package/out/patterns/jsrjson.js +2 -2
- package/out/patterns/matcherContext.d.ts +8 -8
- package/out/patterns/matcherContextPatch.d.ts +2 -2
- package/out/patterns/matcherContextPatch.js +16 -11
- package/out/patterns/matcherStream.d.ts +9 -9
- package/out/patterns/matcherStream.js +1 -1
- package/out/patterns/packagejson.d.ts +1 -1
- package/out/patterns/packagejson.js +1 -1
- package/out/patterns/pattern.d.ts +6 -6
- package/out/patterns/pattern.js +2 -2
- package/out/patterns/patternMatcher.d.ts +3 -3
- package/out/patterns/resolveSources.d.ts +4 -4
- package/out/patterns/resolveSources.js +16 -18
- package/out/patterns/signedPattern.d.ts +21 -12
- package/out/patterns/signedPattern.js +60 -25
- package/out/patterns/source.d.ts +7 -7
- package/out/patterns/source.js +1 -1
- package/out/patterns/stringCompile.d.ts +1 -1
- package/out/patterns/stringCompile.js +1 -1
- package/out/scan.d.ts +1 -1
- package/out/scan.js +1 -1
- package/out/stream.d.ts +1 -1
- package/out/stream.js +1 -1
- package/out/targets/git.d.ts +1 -1
- package/out/targets/git.js +1 -1
- package/out/targets/jsr.d.ts +1 -1
- package/out/targets/jsr.js +1 -1
- package/out/targets/npm.d.ts +1 -1
- package/out/targets/npm.js +1 -1
- package/out/targets/target.d.ts +3 -3
- package/out/targets/vsce.d.ts +1 -1
- package/out/targets/vsce.js +1 -1
- package/out/targets/yarn.d.ts +1 -1
- package/out/targets/yarn.js +1 -1
- package/out/types.d.ts +11 -11
- package/out/walk.d.ts +1 -0
- package/out/walk.js +4 -7
- package/package.json +1 -1
package/out/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Target } from "./targets/target.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Minimal FS implementation needed for `scan`, `scanStream`, and their browser versions.
|
|
5
5
|
*
|
|
6
|
-
* @since 0.0
|
|
6
|
+
* @since 0.6.0
|
|
7
7
|
*/
|
|
8
8
|
export interface FsAdapter {
|
|
9
9
|
promises: {
|
|
@@ -14,13 +14,13 @@ export interface FsAdapter {
|
|
|
14
14
|
/**
|
|
15
15
|
* Used in multiple methods, primarily `scan`, `scanStream`, and their browser versions.
|
|
16
16
|
*
|
|
17
|
-
* @since 0.0
|
|
17
|
+
* @since 0.6.0
|
|
18
18
|
*/
|
|
19
19
|
export type ScanOptions = {
|
|
20
20
|
/**
|
|
21
21
|
* Provides the matcher to use for scanning.
|
|
22
22
|
*
|
|
23
|
-
* @since 0.0
|
|
23
|
+
* @since 0.6.0
|
|
24
24
|
*/
|
|
25
25
|
target: Target;
|
|
26
26
|
/**
|
|
@@ -28,7 +28,7 @@ export type ScanOptions = {
|
|
|
28
28
|
*
|
|
29
29
|
* @default `normalizeCwd(process.cwd())`
|
|
30
30
|
*
|
|
31
|
-
* @since 0.0
|
|
31
|
+
* @since 0.6.0
|
|
32
32
|
*/
|
|
33
33
|
cwd?: string;
|
|
34
34
|
/**
|
|
@@ -39,7 +39,7 @@ export type ScanOptions = {
|
|
|
39
39
|
*
|
|
40
40
|
* @default `"."`
|
|
41
41
|
*
|
|
42
|
-
* @since 0.0
|
|
42
|
+
* @since 0.6.0
|
|
43
43
|
*/
|
|
44
44
|
within?: string;
|
|
45
45
|
/**
|
|
@@ -47,7 +47,7 @@ export type ScanOptions = {
|
|
|
47
47
|
*
|
|
48
48
|
* @default `false`
|
|
49
49
|
*
|
|
50
|
-
* @since 0.0
|
|
50
|
+
* @since 0.6.0
|
|
51
51
|
*/
|
|
52
52
|
invert?: boolean;
|
|
53
53
|
/**
|
|
@@ -56,7 +56,7 @@ export type ScanOptions = {
|
|
|
56
56
|
*
|
|
57
57
|
* @default `Infinity`
|
|
58
58
|
*
|
|
59
|
-
* @since 0.0
|
|
59
|
+
* @since 0.6.0
|
|
60
60
|
*/
|
|
61
61
|
depth?: number;
|
|
62
62
|
/**
|
|
@@ -64,7 +64,7 @@ export type ScanOptions = {
|
|
|
64
64
|
*
|
|
65
65
|
* @default `undefined`
|
|
66
66
|
*
|
|
67
|
-
* @since 0.0
|
|
67
|
+
* @since 0.6.0
|
|
68
68
|
*/
|
|
69
69
|
signal?: AbortSignal | null;
|
|
70
70
|
/**
|
|
@@ -83,7 +83,7 @@ export type ScanOptions = {
|
|
|
83
83
|
*
|
|
84
84
|
* @default `false`
|
|
85
85
|
*
|
|
86
|
-
* @since 0.0
|
|
86
|
+
* @since 0.6.0
|
|
87
87
|
*/
|
|
88
88
|
fastDepth?: boolean;
|
|
89
89
|
/**
|
|
@@ -102,7 +102,7 @@ export type ScanOptions = {
|
|
|
102
102
|
*
|
|
103
103
|
* @default `false`
|
|
104
104
|
*
|
|
105
|
-
* @since 0.0
|
|
105
|
+
* @since 0.6.0
|
|
106
106
|
*/
|
|
107
107
|
fastInternal?: boolean;
|
|
108
108
|
/**
|
|
@@ -110,7 +110,7 @@ export type ScanOptions = {
|
|
|
110
110
|
*
|
|
111
111
|
* @default `await import("node:fs")`
|
|
112
112
|
*
|
|
113
|
-
* @since 0.0
|
|
113
|
+
* @since 0.6.0
|
|
114
114
|
*/
|
|
115
115
|
fs?: FsAdapter;
|
|
116
116
|
};
|
package/out/walk.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { MatcherContext } from "./patterns/matcherContext.js";
|
|
|
3
3
|
import type { MatcherStream } from "./patterns/matcherStream.js";
|
|
4
4
|
import type { ScanOptions } from "./types.js";
|
|
5
5
|
export type WalkOptions = {
|
|
6
|
+
path: string;
|
|
6
7
|
entry: Dirent;
|
|
7
8
|
ctx: MatcherContext;
|
|
8
9
|
stream: MatcherStream | undefined;
|
package/out/walk.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { relative } from "node:path/posix";
|
|
2
1
|
import { getDepth } from "./getDepth.js";
|
|
3
|
-
import { normalizeCwd } from "./normalizeCwd.js";
|
|
4
2
|
export async function walkIncludes(options) {
|
|
5
|
-
const { entry, ctx, stream, scanOptions } = options;
|
|
3
|
+
const { entry, ctx, stream, scanOptions, path } = options;
|
|
6
4
|
const { fs, target, cwd, depth: maxDepth, invert, signal, fastDepth, fastInternal } = scanOptions;
|
|
7
5
|
signal?.throwIfAborted();
|
|
8
|
-
const path = relative(cwd, normalizeCwd(entry.parentPath) + "/" + entry.name);
|
|
9
6
|
const isDir = entry.isDirectory();
|
|
10
7
|
let direntPath;
|
|
11
8
|
if (isDir) {
|
|
@@ -20,7 +17,7 @@ export async function walkIncludes(options) {
|
|
|
20
17
|
const { depth, depthSlash } = getDepth(path, maxDepth);
|
|
21
18
|
if (depth > maxDepth) {
|
|
22
19
|
const failedPrev = ctx.failed.length;
|
|
23
|
-
let match = await target.ignores({ fs, cwd, entry: path, ctx });
|
|
20
|
+
let match = await target.ignores({ fs, cwd, entry: path, ctx, signal });
|
|
24
21
|
if (invert) {
|
|
25
22
|
match.ignored = !match.ignored;
|
|
26
23
|
}
|
|
@@ -48,7 +45,7 @@ export async function walkIncludes(options) {
|
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
47
|
const failedPrev = ctx.failed.length;
|
|
51
|
-
let match = await target.ignores({ fs, cwd, entry: path, ctx });
|
|
48
|
+
let match = await target.ignores({ fs, cwd, entry: path, ctx, signal });
|
|
52
49
|
if (invert) {
|
|
53
50
|
match.ignored = !match.ignored;
|
|
54
51
|
}
|
|
@@ -91,7 +88,7 @@ export async function walkIncludes(options) {
|
|
|
91
88
|
if (lastSlash >= 0) {
|
|
92
89
|
const dir = path.substring(0, lastSlash) + "/";
|
|
93
90
|
const dirMatch = ctx.paths.get(dir);
|
|
94
|
-
if (
|
|
91
|
+
if (dirMatch?.ignored) {
|
|
95
92
|
ctx.paths.set(dir, match);
|
|
96
93
|
if (stream) {
|
|
97
94
|
stream.emit("dirent", { dirent: entry, match, path: direntPath, ctx });
|