@docusaurus/utils 0.0.0-4818 → 0.0.0-4821
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/pathUtils.js +2 -2
- package/package.json +5 -5
- package/src/pathUtils.ts +2 -2
package/lib/pathUtils.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.addTrailingPathSeparator = exports.escapePath = exports.aliasedSitePath
|
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
11
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
12
|
// Based on https://github.com/gatsbyjs/gatsby/pull/21518/files
|
|
13
|
-
//
|
|
13
|
+
// macOS (APFS) and Windows (NTFS) filename length limit = 255 chars,
|
|
14
14
|
// Others = 255 bytes
|
|
15
15
|
const MAX_PATH_SEGMENT_CHARS = 255;
|
|
16
16
|
const MAX_PATH_SEGMENT_BYTES = 255;
|
|
@@ -21,7 +21,7 @@ const isWindows = () => process.platform === 'win32';
|
|
|
21
21
|
const isNameTooLong = (str) =>
|
|
22
22
|
// Not entirely correct: we can't assume FS from OS. But good enough?
|
|
23
23
|
isMacOs() || isWindows()
|
|
24
|
-
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS //
|
|
24
|
+
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS // macOS (APFS) and Windows (NTFS) filename length limit (255 chars)
|
|
25
25
|
: Buffer.from(str).length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_BYTES; // Other (255 bytes)
|
|
26
26
|
exports.isNameTooLong = isNameTooLong;
|
|
27
27
|
function shortName(str) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/utils",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-4821",
|
|
4
4
|
"description": "Node utility functions for Docusaurus packages.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/logger": "0.0.0-
|
|
21
|
+
"@docusaurus/logger": "0.0.0-4821",
|
|
22
22
|
"@svgr/webpack": "^6.2.1",
|
|
23
23
|
"file-loader": "^6.2.0",
|
|
24
24
|
"fs-extra": "^10.0.1",
|
|
@@ -32,18 +32,18 @@
|
|
|
32
32
|
"shelljs": "^0.8.5",
|
|
33
33
|
"tslib": "^2.3.1",
|
|
34
34
|
"url-loader": "^4.1.1",
|
|
35
|
-
"webpack": "^5.70.
|
|
35
|
+
"webpack": "^5.70.1"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=14"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@docusaurus/types": "0.0.0-
|
|
41
|
+
"@docusaurus/types": "0.0.0-4821",
|
|
42
42
|
"@types/dedent": "^0.7.0",
|
|
43
43
|
"@types/github-slugger": "^1.3.0",
|
|
44
44
|
"@types/micromatch": "^4.0.2",
|
|
45
45
|
"@types/react-dom": "^17.0.14",
|
|
46
46
|
"dedent": "^0.7.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "8a074bee9e416464a8d8856cebbf346838d8ef6b"
|
|
49
49
|
}
|
package/src/pathUtils.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import path from 'path';
|
|
9
9
|
|
|
10
10
|
// Based on https://github.com/gatsbyjs/gatsby/pull/21518/files
|
|
11
|
-
//
|
|
11
|
+
// macOS (APFS) and Windows (NTFS) filename length limit = 255 chars,
|
|
12
12
|
// Others = 255 bytes
|
|
13
13
|
const MAX_PATH_SEGMENT_CHARS = 255;
|
|
14
14
|
const MAX_PATH_SEGMENT_BYTES = 255;
|
|
@@ -21,7 +21,7 @@ const isWindows = () => process.platform === 'win32';
|
|
|
21
21
|
export const isNameTooLong = (str: string): boolean =>
|
|
22
22
|
// Not entirely correct: we can't assume FS from OS. But good enough?
|
|
23
23
|
isMacOs() || isWindows()
|
|
24
|
-
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS //
|
|
24
|
+
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS // macOS (APFS) and Windows (NTFS) filename length limit (255 chars)
|
|
25
25
|
: Buffer.from(str).length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_BYTES; // Other (255 bytes)
|
|
26
26
|
|
|
27
27
|
export function shortName(str: string): string {
|