@docusaurus/glob 4.0.0-canary-6865 → 4.0.0-canary-6869
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/lib/watchUtils.d.ts +5 -2
- package/lib/watchUtils.d.ts.map +1 -1
- package/lib/watchUtils.js +9 -3
- package/lib/watchUtils.js.map +1 -1
- package/package.json +2 -2
- package/src/watchUtils.ts +10 -4
package/lib/watchUtils.d.ts
CHANGED
|
@@ -9,9 +9,12 @@ import * as Chokidar from 'chokidar';
|
|
|
9
9
|
* Our own watch options: we only expose the options we actually use, so that
|
|
10
10
|
* we can upgrade or swap the underlying lib.
|
|
11
11
|
*/
|
|
12
|
-
export type WatchOptions = Pick<Chokidar.WatchOptions, 'cwd' | '
|
|
12
|
+
export type WatchOptions = Pick<Chokidar.WatchOptions, 'cwd' | 'usePolling' | 'interval'>;
|
|
13
13
|
/** Our own file watcher handle, exposing only the APIs we actually use. */
|
|
14
14
|
export type Watcher = Pick<Chokidar.FSWatcher, 'on' | 'close'>;
|
|
15
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Watches file system paths for changes.
|
|
17
|
+
* Only emits events for changes happening after the watcher is created.
|
|
18
|
+
*/
|
|
16
19
|
export declare function watch(paths: string | string[], options?: WatchOptions): Watcher;
|
|
17
20
|
//# sourceMappingURL=watchUtils.d.ts.map
|
package/lib/watchUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchUtils.d.ts","sourceRoot":"","sources":["../src/watchUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,QAAQ,CAAC,YAAY,EACrB,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"watchUtils.d.ts","sourceRoot":"","sources":["../src/watchUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,CAC7B,QAAQ,CAAC,YAAY,EACrB,KAAK,GAAG,YAAY,GAAG,UAAU,CAClC,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,KAAK,CACnB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EACxB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAMT"}
|
package/lib/watchUtils.js
CHANGED
|
@@ -10,9 +10,15 @@ exports.watch = watch;
|
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
11
|
// Chokidar is the lib we use in Docusaurus to watch files
|
|
12
12
|
const Chokidar = tslib_1.__importStar(require("chokidar"));
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Watches file system paths for changes.
|
|
15
|
+
* Only emits events for changes happening after the watcher is created.
|
|
16
|
+
*/
|
|
14
17
|
function watch(paths, options) {
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
return Chokidar.watch(paths, {
|
|
19
|
+
// Other lib options are still forwarded at runtime for retro-compatibility
|
|
20
|
+
...options,
|
|
21
|
+
ignoreInitial: true,
|
|
22
|
+
});
|
|
17
23
|
}
|
|
18
24
|
//# sourceMappingURL=watchUtils.js.map
|
package/lib/watchUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchUtils.js","sourceRoot":"","sources":["../src/watchUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,0DAA0D;AAE1D,MAAY,QAAQ,6CAAiB;AAcrC
|
|
1
|
+
{"version":3,"file":"watchUtils.js","sourceRoot":"","sources":["../src/watchUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,0DAA0D;AAE1D,MAAY,QAAQ,6CAAiB;AAcrC;;;GAGG;AACH,eACE,KAAwB,EACxB,OAAsB;IAEtB,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE;QAC3B,2EAA2E;QAC3E,GAAG,OAAO;QACV,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;AACL,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/glob",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6869",
|
|
4
4
|
"description": "File globbing, glob matching and file watching utilities for Docusaurus packages.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/micromatch": "^4.0.10"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "c5a66b0528810d8c3a2163d682722eb28ab10fe2"
|
|
33
33
|
}
|
package/src/watchUtils.ts
CHANGED
|
@@ -15,17 +15,23 @@ import * as Chokidar from 'chokidar';
|
|
|
15
15
|
*/
|
|
16
16
|
export type WatchOptions = Pick<
|
|
17
17
|
Chokidar.WatchOptions,
|
|
18
|
-
'cwd' | '
|
|
18
|
+
'cwd' | 'usePolling' | 'interval'
|
|
19
19
|
>;
|
|
20
20
|
|
|
21
21
|
/** Our own file watcher handle, exposing only the APIs we actually use. */
|
|
22
22
|
export type Watcher = Pick<Chokidar.FSWatcher, 'on' | 'close'>;
|
|
23
23
|
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* Watches file system paths for changes.
|
|
26
|
+
* Only emits events for changes happening after the watcher is created.
|
|
27
|
+
*/
|
|
25
28
|
export function watch(
|
|
26
29
|
paths: string | string[],
|
|
27
30
|
options?: WatchOptions,
|
|
28
31
|
): Watcher {
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
return Chokidar.watch(paths, {
|
|
33
|
+
// Other lib options are still forwarded at runtime for retro-compatibility
|
|
34
|
+
...options,
|
|
35
|
+
ignoreInitial: true,
|
|
36
|
+
});
|
|
31
37
|
}
|