@docusaurus/glob 4.0.0-canary-6870 → 4.0.0-canary-6872
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/globUtils.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.createAbsoluteFilePathMatcher = createAbsoluteFilePathMatcher;
|
|
|
13
13
|
exports.safeGlob = safeGlob;
|
|
14
14
|
const tslib_1 = require("tslib");
|
|
15
15
|
// Tinyglobby/Micromatch are the 2 libs we use in Docusaurus consistently
|
|
16
|
-
const
|
|
16
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
17
17
|
const micromatch_1 = tslib_1.__importDefault(require("micromatch"));
|
|
18
18
|
const Tinyglobby = tslib_1.__importStar(require("tinyglobby"));
|
|
19
19
|
/** Finds the files matching the given glob patterns. */
|
|
@@ -69,7 +69,7 @@ function createAbsoluteFilePathMatcher(patterns, rootFolders) {
|
|
|
69
69
|
if (!rootFolder) {
|
|
70
70
|
throw new Error(`createAbsoluteFilePathMatcher unexpected error, absoluteFilePath=${absoluteFilePath} was not contained in any of the root folders: ${rootFolders.join(', ')}`);
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return node_path_1.default.relative(rootFolder, absoluteFilePath);
|
|
73
73
|
}
|
|
74
74
|
return (absoluteFilePath) => matcher(getRelativeFilePath(absoluteFilePath));
|
|
75
75
|
}
|
|
@@ -87,7 +87,7 @@ function posixPath(str) {
|
|
|
87
87
|
async function safeGlob(patterns, options) {
|
|
88
88
|
// Required for Windows support, as paths using \ should not be used by glob
|
|
89
89
|
// (also using the windows hard drive prefix like c: is not a good idea)
|
|
90
|
-
const globPaths = patterns.map((dirPath) => posixPath(
|
|
90
|
+
const globPaths = patterns.map((dirPath) => posixPath(node_path_1.default.relative(process.cwd(), dirPath)));
|
|
91
91
|
return glob(globPaths, options);
|
|
92
92
|
}
|
|
93
93
|
//# sourceMappingURL=globUtils.js.map
|
package/lib/globUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globUtils.js","sourceRoot":"","sources":["../src/globUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;AAEH,yEAAyE;AAEzE,
|
|
1
|
+
{"version":3,"file":"globUtils.js","sourceRoot":"","sources":["../src/globUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;AAEH,yEAAyE;AAEzE,kEAA6B;AAC7B,oEAAoC;AACpC,MAAY,UAAU,+CAAmB;AAWzC,wDAAwD;AACjD,KAAK,eACV,QAA2B,EAC3B,OAAqB;IAErB,2EAA2E;IAC3E,OAAO,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAC,GAAG,OAAO,EAAC,CAAC,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACU,QAAA,kBAAkB,GAAG;IAChC,8BAA8B;IAC9B,UAAU;IACV,2BAA2B;IAC3B,iBAAiB;CAClB,CAAC;AAIF;;;;;;;;GAQG;AACH,uBAA8B,QAAkB;IAC9C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,iCAAiC;QACjC,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC;IACrB,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,oBAAU,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CACvE,CAAC;IACF,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,uCACE,QAAkB,EAClB,WAAqB;IAErB,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAExC,SAAS,mBAAmB,CAAC,gBAAwB;QACnD,MAAM,UAAU,GAAG,WAAW,CAA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
package/lib/translationUtils.js
CHANGED
|
@@ -11,7 +11,7 @@ exports.globTranslatableSourceFiles = globTranslatableSourceFiles;
|
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
// Awkward to have translation code in this package, but it is consumed by both
|
|
13
13
|
// @docusaurus/core and @docusaurus/theme-translations: this avoids duplication
|
|
14
|
-
const
|
|
14
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
15
15
|
const globUtils_1 = require("./globUtils");
|
|
16
16
|
exports.isTranslatableSourceFile = (() => {
|
|
17
17
|
// We only support extracting source code translations from these extensions
|
|
@@ -30,7 +30,7 @@ exports.isTranslatableSourceFile = (() => {
|
|
|
30
30
|
return filePath.endsWith('.d.ts');
|
|
31
31
|
};
|
|
32
32
|
return (filePath) => {
|
|
33
|
-
const ext =
|
|
33
|
+
const ext = node_path_1.default.extname(filePath);
|
|
34
34
|
return extensionsAllowed.has(ext) && !isBlacklistedFilePath(filePath);
|
|
35
35
|
};
|
|
36
36
|
})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translationUtils.js","sourceRoot":"","sources":["../src/translationUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAEH,+EAA+E;AAC/E,+EAA+E;AAE/E,
|
|
1
|
+
{"version":3,"file":"translationUtils.js","sourceRoot":"","sources":["../src/translationUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAEH,+EAA+E;AAC/E,+EAA+E;AAE/E,kEAA6B;AAC7B,2CAAqC;AAExB,QAAA,wBAAwB,GAAkC,CAAC,GAAG,EAAE;IAC3E,4EAA4E;IAC5E,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;QAChC,KAAK;QACL,MAAM;QACN,KAAK;QACL,MAAM;QACN,6CAA6C;QAC7C,+DAA+D;QAC/D,SAAS;QACT,UAAU;KACX,CAAC,CAAC;IAEH,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAE,EAAE;QACjD,gEAAgE;QAChE,OAAO,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC,CAAC;IAEF,OAAO,CAAC,QAAQ,EAAW,EAAE;QAC3B,MAAM,GAAG,GAAG,mBAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QACnC,OAAO,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,CAAC;IACxE,CAAC,CAAC;AACJ,CAAC,CAAC,EAAE,CAAC;AAEE,KAAK,sCACV,QAAkB;IAElB,MAAM,SAAS,GAAG,MAAM,IAAA,oBAAQ,EAAC,QAAQ,EAAE;QACzC,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,MAAM,CAAC,QAAA,wBAAwB,CAAC,CAAC;AACpD,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-6872",
|
|
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": "97ddb0451f086d8a1c20967f0d324d667dc58ebf"
|
|
33
33
|
}
|
package/src/globUtils.ts
CHANGED
package/src/translationUtils.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// Awkward to have translation code in this package, but it is consumed by both
|
|
9
9
|
// @docusaurus/core and @docusaurus/theme-translations: this avoids duplication
|
|
10
10
|
|
|
11
|
-
import path from 'path';
|
|
11
|
+
import path from 'node:path';
|
|
12
12
|
import {safeGlob} from './globUtils';
|
|
13
13
|
|
|
14
14
|
export const isTranslatableSourceFile: (filePath: string) => boolean = (() => {
|