Skip to content

Commit df7991c

Browse files
authored
fix: inline @types/glob, remove from deps (#268)
1 parent 45d4c19 commit df7991c

File tree

3 files changed

+163
-14
lines changed

3 files changed

+163
-14
lines changed

lib/index.d.ts

+163-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,169 @@
1-
import { IOptions as GlobOptions } from 'glob';
2-
import { Stats } from 'fs';
1+
import { Stats } from "fs";
2+
3+
interface IMinimatchOptions {
4+
/**
5+
* Dump a ton of stuff to stderr.
6+
*
7+
* @default false
8+
*/
9+
debug?: boolean | undefined;
10+
11+
/**
12+
* Do not expand `{a,b}` and `{1..3}` brace sets.
13+
*
14+
* @default false
15+
*/
16+
nobrace?: boolean | undefined;
17+
18+
/**
19+
* Disable `**` matching against multiple folder names.
20+
*
21+
* @default false
22+
*/
23+
noglobstar?: boolean | undefined;
24+
25+
/**
26+
* Allow patterns to match filenames starting with a period,
27+
* even if the pattern does not explicitly have a period in that spot.
28+
*
29+
* Note that by default, `'a/**' + '/b'` will **not** match `a/.d/b`, unless `dot` is set.
30+
*
31+
* @default false
32+
*/
33+
dot?: boolean | undefined;
34+
35+
/**
36+
* Disable "extglob" style patterns like `+(a|b)`.
37+
*
38+
* @default false
39+
*/
40+
noext?: boolean | undefined;
41+
42+
/**
43+
* Perform a case-insensitive match.
44+
*
45+
* @default false
46+
*/
47+
nocase?: boolean | undefined;
48+
49+
/**
50+
* When a match is not found by `minimatch.match`,
51+
* return a list containing the pattern itself if this option is set.
52+
* Otherwise, an empty list is returned if there are no matches.
53+
*
54+
* @default false
55+
*/
56+
nonull?: boolean | undefined;
57+
58+
/**
59+
* If set, then patterns without slashes will be matched
60+
* against the basename of the path if it contains slashes. For example,
61+
* `a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
62+
*
63+
* @default false
64+
*/
65+
matchBase?: boolean | undefined;
66+
67+
/**
68+
* Suppress the behavior of treating `#` at the start of a pattern as a comment.
69+
*
70+
* @default false
71+
*/
72+
nocomment?: boolean | undefined;
73+
74+
/**
75+
* Suppress the behavior of treating a leading `!` character as negation.
76+
*
77+
* @default false
78+
*/
79+
nonegate?: boolean | undefined;
80+
81+
/**
82+
* Returns from negate expressions the same as if they were not negated.
83+
* (Ie, true on a hit, false on a miss.)
84+
*
85+
* @default false
86+
*/
87+
flipNegate?: boolean | undefined;
88+
89+
/**
90+
* Compare a partial path to a pattern. As long as the parts of the path that
91+
* are present are not contradicted by the pattern, it will be treated as a
92+
* match. This is useful in applications where you're walking through a
93+
* folder structure, and don't yet have the full path, but want to ensure that
94+
* you do not walk down paths that can never be a match.
95+
*
96+
* @default false
97+
*
98+
* @example
99+
* import minimatch = require("minimatch");
100+
*
101+
* minimatch('/a/b', '/a/*' + '/c/d', { partial: true }) // true, might be /a/b/c/d
102+
* minimatch('/a/b', '/**' + '/d', { partial: true }) // true, might be /a/b/.../d
103+
* minimatch('/x/y/z', '/a/**' + '/z', { partial: true }) // false, because x !== a
104+
*/
105+
partial?: boolean;
106+
107+
/**
108+
* Use `\\` as a path separator _only_, and _never_ as an escape
109+
* character. If set, all `\\` characters are replaced with `/` in
110+
* the pattern. Note that this makes it **impossible** to match
111+
* against paths containing literal glob pattern characters, but
112+
* allows matching with patterns constructed using `path.join()` and
113+
* `path.resolve()` on Windows platforms, mimicking the (buggy!)
114+
* behavior of earlier versions on Windows. Please use with
115+
* caution, and be mindful of the caveat about Windows paths
116+
*
117+
* For legacy reasons, this is also set if
118+
* `options.allowWindowsEscape` is set to the exact value `false`.
119+
*
120+
* @default false
121+
*/
122+
windowsPathsNoEscape?: boolean;
123+
}
124+
125+
import fs = require("fs");
126+
interface IGlobOptions extends IMinimatchOptions {
127+
cwd?: string | undefined;
128+
root?: string | undefined;
129+
dot?: boolean | undefined;
130+
nomount?: boolean | undefined;
131+
mark?: boolean | undefined;
132+
nosort?: boolean | undefined;
133+
stat?: boolean | undefined;
134+
silent?: boolean | undefined;
135+
strict?: boolean | undefined;
136+
cache?:
137+
| { [path: string]: boolean | "DIR" | "FILE" | ReadonlyArray<string> }
138+
| undefined;
139+
statCache?:
140+
| { [path: string]: false | { isDirectory(): boolean } | undefined }
141+
| undefined;
142+
symlinks?: { [path: string]: boolean | undefined } | undefined;
143+
realpathCache?: { [path: string]: string } | undefined;
144+
sync?: boolean | undefined;
145+
nounique?: boolean | undefined;
146+
nonull?: boolean | undefined;
147+
debug?: boolean | undefined;
148+
nobrace?: boolean | undefined;
149+
noglobstar?: boolean | undefined;
150+
noext?: boolean | undefined;
151+
nocase?: boolean | undefined;
152+
matchBase?: any;
153+
nodir?: boolean | undefined;
154+
ignore?: string | ReadonlyArray<string> | undefined;
155+
follow?: boolean | undefined;
156+
realpath?: boolean | undefined;
157+
nonegate?: boolean | undefined;
158+
nocomment?: boolean | undefined;
159+
absolute?: boolean | undefined;
160+
allowWindowsEscape?: boolean | undefined;
161+
fs?: typeof fs;
162+
}
3163

4164
export type CreateOptions = {
5165
dot?: boolean;
6-
globOptions?: GlobOptions;
166+
globOptions?: IGlobOptions;
7167
ordering?: string;
8168
pattern?: string;
9169
transform?: (filePath: string) => NodeJS.ReadWriteStream | void;

package.json

-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
"glob": "^7.1.6",
4949
"minimatch": "^3.0.4"
5050
},
51-
"optionalDependencies": {
52-
"@types/glob": "^7.1.1"
53-
},
5451
"devDependencies": {
5552
"@continuous-auth/semantic-release-npm": "^3.0.0",
5653
"electron": "^22.0.0",

yarn.lock

-8
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,6 @@
323323
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2"
324324
integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==
325325

326-
"@types/glob@^7.1.1":
327-
version "7.2.0"
328-
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb"
329-
integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==
330-
dependencies:
331-
"@types/minimatch" "*"
332-
"@types/node" "*"
333-
334326
"@types/http-cache-semantics@*":
335327
version "4.0.1"
336328
resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812"

0 commit comments

Comments
 (0)