@docusaurus/utils 2.0.0-beta.15 → 2.0.0-beta.16
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/dataFileUtils.js +2 -2
- package/lib/dataFileUtils.js.map +1 -1
- package/lib/gitUtils.d.ts +17 -0
- package/lib/gitUtils.d.ts.map +1 -0
- package/lib/gitUtils.js +63 -0
- package/lib/gitUtils.js.map +1 -0
- package/lib/hashUtils.js +4 -3
- package/lib/hashUtils.js.map +1 -1
- package/lib/index.d.ts +14 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +75 -29
- package/lib/index.js.map +1 -1
- package/lib/markdownLinks.d.ts.map +1 -1
- package/lib/markdownLinks.js +8 -5
- package/lib/markdownLinks.js.map +1 -1
- package/lib/markdownParser.d.ts.map +1 -1
- package/lib/markdownParser.js +35 -35
- package/lib/markdownParser.js.map +1 -1
- package/lib/pathUtils.d.ts +14 -1
- package/lib/pathUtils.d.ts.map +1 -1
- package/lib/pathUtils.js +19 -11
- package/lib/pathUtils.js.map +1 -1
- package/lib/tags.d.ts +8 -0
- package/lib/tags.d.ts.map +1 -1
- package/lib/tags.js +18 -13
- package/lib/tags.js.map +1 -1
- package/lib/urlUtils.d.ts.map +1 -1
- package/lib/urlUtils.js +11 -10
- package/lib/urlUtils.js.map +1 -1
- package/lib/webpackUtils.d.ts.map +1 -1
- package/lib/webpackUtils.js +11 -9
- package/lib/webpackUtils.js.map +1 -1
- package/package.json +12 -20
- package/src/dataFileUtils.ts +2 -2
- package/src/deps.d.ts +0 -4
- package/src/gitUtils.ts +93 -0
- package/src/hashUtils.ts +3 -3
- package/src/index.ts +86 -32
- package/src/markdownLinks.ts +9 -5
- package/src/markdownParser.ts +35 -33
- package/src/pathUtils.ts +19 -11
- package/src/tags.ts +17 -13
- package/src/urlUtils.ts +11 -10
- package/src/webpackUtils.ts +11 -9
package/lib/markdownParser.js
CHANGED
|
@@ -13,17 +13,15 @@ const gray_matter_1 = (0, tslib_1.__importDefault)(require("gray-matter"));
|
|
|
13
13
|
// Input: ## Some heading {#some-heading}
|
|
14
14
|
// Output: {text: "## Some heading", id: "some-heading"}
|
|
15
15
|
function parseMarkdownHeadingId(heading) {
|
|
16
|
-
const customHeadingIdRegex = /^(
|
|
16
|
+
const customHeadingIdRegex = /^(?<text>.*?)\s*\{#(?<id>[\w-]+)\}$/;
|
|
17
17
|
const matches = customHeadingIdRegex.exec(heading);
|
|
18
18
|
if (matches) {
|
|
19
19
|
return {
|
|
20
|
-
text: matches
|
|
21
|
-
id: matches
|
|
20
|
+
text: matches.groups.text,
|
|
21
|
+
id: matches.groups.id,
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
return { text: heading, id: undefined };
|
|
26
|
-
}
|
|
24
|
+
return { text: heading, id: undefined };
|
|
27
25
|
}
|
|
28
26
|
exports.parseMarkdownHeadingId = parseMarkdownHeadingId;
|
|
29
27
|
// Hacky way of stripping out import statements from the excerpt
|
|
@@ -38,14 +36,13 @@ function createExcerpt(fileString) {
|
|
|
38
36
|
let inCode = false;
|
|
39
37
|
let lastCodeFence = '';
|
|
40
38
|
/* eslint-disable no-continue */
|
|
41
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
42
39
|
for (const fileLine of fileLines) {
|
|
43
40
|
// Skip empty line.
|
|
44
41
|
if (!fileLine.trim()) {
|
|
45
42
|
continue;
|
|
46
43
|
}
|
|
47
44
|
// Skip import/export declaration.
|
|
48
|
-
if (
|
|
45
|
+
if (/^(?:import|export)\s.*/.test(fileLine)) {
|
|
49
46
|
continue;
|
|
50
47
|
}
|
|
51
48
|
// Skip code block line.
|
|
@@ -53,7 +50,8 @@ function createExcerpt(fileString) {
|
|
|
53
50
|
if (!inCode) {
|
|
54
51
|
inCode = true;
|
|
55
52
|
[lastCodeFence] = fileLine.trim().match(/^`+/);
|
|
56
|
-
// If we are in a ````-fenced block, all ``` would be plain text instead
|
|
53
|
+
// If we are in a ````-fenced block, all ``` would be plain text instead
|
|
54
|
+
// of fences
|
|
57
55
|
}
|
|
58
56
|
else if (fileLine.trim().match(/^`+/)[0].length >= lastCodeFence.length) {
|
|
59
57
|
inCode = false;
|
|
@@ -67,25 +65,27 @@ function createExcerpt(fileString) {
|
|
|
67
65
|
// Remove HTML tags.
|
|
68
66
|
.replace(/<[^>]*>/g, '')
|
|
69
67
|
// Remove Title headers
|
|
70
|
-
.replace(/^#\s*
|
|
68
|
+
.replace(/^#\s*[^#]*\s*#?/gm, '')
|
|
71
69
|
// Remove Markdown + ATX-style headers
|
|
72
|
-
.replace(/^#{1,6}\s*([^#]*)\s*(
|
|
73
|
-
// Remove emphasis
|
|
74
|
-
.replace(/([*_
|
|
70
|
+
.replace(/^#{1,6}\s*(?<text>[^#]*)\s*(?:#{1,6})?/gm, '$1')
|
|
71
|
+
// Remove emphasis.
|
|
72
|
+
.replace(/(?<opening>[*_]{1,3})(?<text>.*?)\1/g, '$2')
|
|
73
|
+
// Remove strikethroughs.
|
|
74
|
+
.replace(/~~(?<text>\S.*\S)~~/g, '$1')
|
|
75
75
|
// Remove images.
|
|
76
|
-
.replace(/!\[(
|
|
76
|
+
.replace(/!\[(?<alt>.*?)\][[(].*?[\])]/g, '$1')
|
|
77
77
|
// Remove footnotes.
|
|
78
|
-
.replace(/\[\^.+?\](
|
|
78
|
+
.replace(/\[\^.+?\](?:: .*?$)?/g, '')
|
|
79
79
|
// Remove inline links.
|
|
80
|
-
.replace(/\[(
|
|
80
|
+
.replace(/\[(?<alt>.*?)\][[(].*?[\])]/g, '$1')
|
|
81
81
|
// Remove inline code.
|
|
82
|
-
.replace(/`(
|
|
82
|
+
.replace(/`(?<text>.+?)`/g, '$1')
|
|
83
83
|
// Remove blockquotes.
|
|
84
84
|
.replace(/^\s{0,3}>\s?/g, '')
|
|
85
85
|
// Remove admonition definition.
|
|
86
|
-
.replace(
|
|
86
|
+
.replace(/:::.*/, '')
|
|
87
87
|
// Remove Emoji names within colons include preceding whitespace.
|
|
88
|
-
.replace(/\s
|
|
88
|
+
.replace(/\s?:(?:::|[^:\n])+:/g, '')
|
|
89
89
|
// Remove custom Markdown heading id.
|
|
90
90
|
.replace(/{#*[\w-]+}/, '')
|
|
91
91
|
.trim();
|
|
@@ -104,9 +104,11 @@ function parseFrontMatter(markdownFileContent) {
|
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
106
|
exports.parseFrontMatter = parseFrontMatter;
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
/**
|
|
108
|
+
* Try to convert markdown heading to text. Does not need to be perfect, it is
|
|
109
|
+
* only used as a fallback when frontMatter.title is not provided. For now, we
|
|
110
|
+
* just unwrap possible inline code blocks (# `config.js`)
|
|
111
|
+
*/
|
|
110
112
|
function toTextContentTitle(contentTitle) {
|
|
111
113
|
if (contentTitle.startsWith('`') && contentTitle.endsWith('`')) {
|
|
112
114
|
return contentTitle.substring(1, contentTitle.length - 1);
|
|
@@ -117,8 +119,8 @@ function parseMarkdownContentTitle(contentUntrimmed, options) {
|
|
|
117
119
|
var _a, _b;
|
|
118
120
|
const removeContentTitleOption = (_a = options === null || options === void 0 ? void 0 : options.removeContentTitle) !== null && _a !== void 0 ? _a : false;
|
|
119
121
|
const content = contentUntrimmed.trim();
|
|
120
|
-
const IMPORT_STATEMENT = /import\s+(
|
|
121
|
-
const REGULAR_TITLE = /(?<pattern>#\s*(?<title>[^#\n{]*)+[ \t]*(?<suffix>({#*[\w-]+})|#)?\n*?)/
|
|
122
|
+
const IMPORT_STATEMENT = /import\s+(?:[\w*{}\s\n,]+from\s+)?["'\s][@\w/_.-]+["'\s];?|\n/.source;
|
|
123
|
+
const REGULAR_TITLE = /(?<pattern>#\s*(?<title>[^#\n{]*)+[ \t]*(?<suffix>(?:{#*[\w-]+})|#)?\n*?)/
|
|
122
124
|
.source;
|
|
123
125
|
const ALTERNATE_TITLE = /(?<pattern>\s*(?<title>[^\n]*)\s*\n[=]+)/.source;
|
|
124
126
|
const regularTitleMatch = new RegExp(`^(?:${IMPORT_STATEMENT})*?${REGULAR_TITLE}`, 'g').exec(content);
|
|
@@ -128,15 +130,13 @@ function parseMarkdownContentTitle(contentUntrimmed, options) {
|
|
|
128
130
|
if (!pattern || !title) {
|
|
129
131
|
return { content, contentTitle: undefined };
|
|
130
132
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
};
|
|
139
|
-
}
|
|
133
|
+
const newContent = removeContentTitleOption
|
|
134
|
+
? content.replace(pattern, '')
|
|
135
|
+
: content;
|
|
136
|
+
return {
|
|
137
|
+
content: newContent.trim(),
|
|
138
|
+
contentTitle: toTextContentTitle(title.trim()).trim(),
|
|
139
|
+
};
|
|
140
140
|
}
|
|
141
141
|
exports.parseMarkdownContentTitle = parseMarkdownContentTitle;
|
|
142
142
|
function parseMarkdownString(markdownFileContent, options) {
|
|
@@ -151,10 +151,10 @@ function parseMarkdownString(markdownFileContent, options) {
|
|
|
151
151
|
excerpt,
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
catch (
|
|
154
|
+
catch (err) {
|
|
155
155
|
logger_1.default.error(`Error while parsing Markdown front matter.
|
|
156
156
|
This can happen if you use special characters in front matter values (try using double quotes around that value).`);
|
|
157
|
-
throw
|
|
157
|
+
throw err;
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
exports.parseMarkdownString = parseMarkdownString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdownParser.js","sourceRoot":"","sources":["../src/markdownParser.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,6EAAwC;AACxC,2EAAiC;AAEjC,yCAAyC;AACzC,wDAAwD;AACxD,SAAgB,sBAAsB,CAAC,OAAe;IAIpD,MAAM,oBAAoB,GAAG,
|
|
1
|
+
{"version":3,"file":"markdownParser.js","sourceRoot":"","sources":["../src/markdownParser.ts"],"names":[],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AU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,mCAAI,EAAE,CAAC;IAElD,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,EAAE;QACtB,OAAO,EAAC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAC,CAAC;KAC3C;IACD,MAAM,UAAU,GAAG,wBAAwB;QACzC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9B,CAAC,CAAC,OAAO,CAAC;IACZ,OAAO;QACL,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE;QAC1B,YAAY,EAAE,kBAAkB,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;KACtD,CAAC;AACJ,CAAC;AArCD,8DAqCC;AASD,SAAgB,mBAAmB,CACjC,mBAA2B,EAC3B,OAAwC;IAExC,IAAI;QACF,MAAM,EAAC,WAAW,EAAE,OAAO,EAAE,yBAAyB,EAAC,GACrD,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;QAExC,MAAM,EAAC,OAAO,EAAE,YAAY,EAAC,GAAG,yBAAyB,CACvD,yBAAyB,EACzB,OAAO,CACR,CAAC;QAEF,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QAEvC,OAAO;YACL,WAAW;YACX,OAAO;YACP,YAAY;YACZ,OAAO;SACR,CAAC;KACH;IAAC,OAAO,GAAG,EAAE;QACZ,gBAAM,CAAC,KAAK,CAAC;kHACiG,CAAC,CAAC;QAChH,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AA1BD,kDA0BC"}
|
package/lib/pathUtils.d.ts
CHANGED
|
@@ -17,6 +17,18 @@ export declare const shortName: (str: string) => string;
|
|
|
17
17
|
* Adopted from https://github.com/sindresorhus/slash/blob/main/index.js
|
|
18
18
|
*/
|
|
19
19
|
export declare function posixPath(str: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* When you want to display a path in a message/warning/error, it's more
|
|
22
|
+
* convenient to:
|
|
23
|
+
*
|
|
24
|
+
* - make it relative to `cwd()`
|
|
25
|
+
* - convert to posix (ie not using windows \ path separator)
|
|
26
|
+
*
|
|
27
|
+
* This way, Jest tests can run more reliably on any computer/CI on both
|
|
28
|
+
* Unix/Windows
|
|
29
|
+
* For Windows users this is not perfect (as they see / instead of \) but it's
|
|
30
|
+
* probably good enough
|
|
31
|
+
*/
|
|
20
32
|
export declare function toMessageRelativeFilePath(filePath: string): string;
|
|
21
33
|
/**
|
|
22
34
|
* Alias filepath relative to site directory, very useful so that we
|
|
@@ -27,7 +39,8 @@ export declare function aliasedSitePath(filePath: string, siteDir: string): stri
|
|
|
27
39
|
/**
|
|
28
40
|
* When you have a path like C:\X\Y
|
|
29
41
|
* It is not safe to use directly when generating code
|
|
30
|
-
* For example, this would fail due to unescaped \:
|
|
42
|
+
* For example, this would fail due to unescaped \:
|
|
43
|
+
* `<img src={require('${filePath}')} />`
|
|
31
44
|
* But this would work: `<img src={require('${escapePath(filePath)}')} />`
|
|
32
45
|
*
|
|
33
46
|
* posixPath can't be used in all cases, because forward slashes are only valid
|
package/lib/pathUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathUtils.d.ts","sourceRoot":"","sources":["../src/pathUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"pathUtils.d.ts","sourceRoot":"","sources":["../src/pathUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgBH,eAAO,MAAM,aAAa,QAAS,MAAM,KAAG,OAIgC,CAAC;AAE7E,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,MAiBvC,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAY7C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAKzE;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAK9C"}
|
package/lib/pathUtils.js
CHANGED
|
@@ -10,7 +10,8 @@ exports.escapePath = exports.aliasedSitePath = exports.toMessageRelativeFilePath
|
|
|
10
10
|
const tslib_1 = require("tslib");
|
|
11
11
|
// Based on https://github.com/gatsbyjs/gatsby/pull/21518/files
|
|
12
12
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
13
|
-
// MacOS (APFS) and Windows (NTFS) filename length limit = 255 chars,
|
|
13
|
+
// MacOS (APFS) and Windows (NTFS) filename length limit = 255 chars,
|
|
14
|
+
// Others = 255 bytes
|
|
14
15
|
const MAX_PATH_SEGMENT_CHARS = 255;
|
|
15
16
|
const MAX_PATH_SEGMENT_BYTES = 255;
|
|
16
17
|
// Space for appending things to the string like file extensions and so on
|
|
@@ -18,7 +19,7 @@ const SPACE_FOR_APPENDING = 10;
|
|
|
18
19
|
const isMacOs = () => process.platform === 'darwin';
|
|
19
20
|
const isWindows = () => process.platform === 'win32';
|
|
20
21
|
const isNameTooLong = (str) =>
|
|
21
|
-
//
|
|
22
|
+
// Not entirely correct: we can't assume FS from OS. But good enough?
|
|
22
23
|
isMacOs() || isWindows()
|
|
23
24
|
? str.length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_CHARS // MacOS (APFS) and Windows (NTFS) filename length limit (255 chars)
|
|
24
25
|
: Buffer.from(str).length + SPACE_FOR_APPENDING > MAX_PATH_SEGMENT_BYTES; // Other (255 bytes)
|
|
@@ -47,7 +48,8 @@ exports.shortName = shortName;
|
|
|
47
48
|
*/
|
|
48
49
|
function posixPath(str) {
|
|
49
50
|
const isExtendedLengthPath = /^\\\\\?\\/.test(str);
|
|
50
|
-
// Forward slashes are only valid Windows paths when they don't contain non-
|
|
51
|
+
// Forward slashes are only valid Windows paths when they don't contain non-
|
|
52
|
+
// ascii characters.
|
|
51
53
|
// eslint-disable-next-line no-control-regex
|
|
52
54
|
const hasNonAscii = /[^\u0000-\u0080]+/.test(str);
|
|
53
55
|
if (isExtendedLengthPath || hasNonAscii) {
|
|
@@ -56,13 +58,18 @@ function posixPath(str) {
|
|
|
56
58
|
return str.replace(/\\/g, '/');
|
|
57
59
|
}
|
|
58
60
|
exports.posixPath = posixPath;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
/**
|
|
62
|
+
* When you want to display a path in a message/warning/error, it's more
|
|
63
|
+
* convenient to:
|
|
64
|
+
*
|
|
65
|
+
* - make it relative to `cwd()`
|
|
66
|
+
* - convert to posix (ie not using windows \ path separator)
|
|
67
|
+
*
|
|
68
|
+
* This way, Jest tests can run more reliably on any computer/CI on both
|
|
69
|
+
* Unix/Windows
|
|
70
|
+
* For Windows users this is not perfect (as they see / instead of \) but it's
|
|
71
|
+
* probably good enough
|
|
72
|
+
*/
|
|
66
73
|
function toMessageRelativeFilePath(filePath) {
|
|
67
74
|
return posixPath(path_1.default.relative(process.cwd(), filePath));
|
|
68
75
|
}
|
|
@@ -82,7 +89,8 @@ exports.aliasedSitePath = aliasedSitePath;
|
|
|
82
89
|
/**
|
|
83
90
|
* When you have a path like C:\X\Y
|
|
84
91
|
* It is not safe to use directly when generating code
|
|
85
|
-
* For example, this would fail due to unescaped \:
|
|
92
|
+
* For example, this would fail due to unescaped \:
|
|
93
|
+
* `<img src={require('${filePath}')} />`
|
|
86
94
|
* But this would work: `<img src={require('${escapePath(filePath)}')} />`
|
|
87
95
|
*
|
|
88
96
|
* posixPath can't be used in all cases, because forward slashes are only valid
|
package/lib/pathUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathUtils.js","sourceRoot":"","sources":["../src/pathUtils.ts"],"names":[],"mappings":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,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AALD,gCAKC"}
|
package/lib/tags.d.ts
CHANGED
|
@@ -15,5 +15,13 @@ export declare type TaggedItemGroup<Item> = {
|
|
|
15
15
|
tag: Tag;
|
|
16
16
|
items: Item[];
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Permits to group docs/blogPosts by tag (provided by front matter)
|
|
20
|
+
* Note: groups are indexed by permalink, because routes must be unique in the
|
|
21
|
+
* end. Labels may vary on 2 md files but they are normalized. Docs with
|
|
22
|
+
* label='some label' and label='some-label' should end-up in the same
|
|
23
|
+
* group/page in the end. We can't create 2 routes /some-label because one would
|
|
24
|
+
* override the other
|
|
25
|
+
*/
|
|
18
26
|
export declare function groupTaggedItems<Item>(items: Item[], getItemTags: (item: Item) => Tag[]): Record<string, TaggedItemGroup<Item>>;
|
|
19
27
|
//# sourceMappingURL=tags.d.ts.map
|
package/lib/tags.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,oBAAY,GAAG,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,cAAc,GAAG,MAAM,GAAG,GAAG,CAAC;AAE1C,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,cAAc,GAC7B,GAAG,CAyBL;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,eAAe,GAAE,cAAc,EAAE,GAAG,SAAc,GACjD,GAAG,EAAE,CAMP;AAED,oBAAY,eAAe,CAAC,IAAI,IAAI;IAClC,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,oBAAY,GAAG,GAAG;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,cAAc,GAAG,MAAM,GAAG,GAAG,CAAC;AAE1C,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,cAAc,GAC7B,GAAG,CAyBL;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,EAChB,eAAe,GAAE,cAAc,EAAE,GAAG,SAAc,GACjD,GAAG,EAAE,CAMP;AAED,oBAAY,eAAe,CAAC,IAAI,IAAI;IAClC,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EACnC,KAAK,EAAE,IAAI,EAAE,EACb,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,EAAE,GACjC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CA8BvC"}
|
package/lib/tags.js
CHANGED
|
@@ -7,20 +7,21 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.groupTaggedItems = exports.normalizeFrontMatterTags = exports.normalizeFrontMatterTag = void 0;
|
|
10
|
-
const
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
|
|
11
12
|
const urlUtils_1 = require("./urlUtils");
|
|
12
13
|
function normalizeFrontMatterTag(tagsPath, frontMatterTag) {
|
|
13
14
|
function toTagObject(tagString) {
|
|
14
15
|
return {
|
|
15
16
|
label: tagString,
|
|
16
|
-
permalink:
|
|
17
|
+
permalink: lodash_1.default.kebabCase(tagString),
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
20
|
// TODO maybe make ensure the permalink is valid url path?
|
|
20
21
|
function normalizeTagPermalink(permalink) {
|
|
21
|
-
// note: we always apply tagsPath on purpose
|
|
22
|
-
//
|
|
23
|
-
// tagsPath is different for each doc version
|
|
22
|
+
// note: we always apply tagsPath on purpose. For versioned docs, v1/doc.md
|
|
23
|
+
// and v2/doc.md tags with custom permalinks don't lead to the same created
|
|
24
|
+
// page. tagsPath is different for each doc version
|
|
24
25
|
return (0, urlUtils_1.normalizeUrl)([tagsPath, permalink]);
|
|
25
26
|
}
|
|
26
27
|
const tag = typeof frontMatterTag === 'string'
|
|
@@ -34,20 +35,24 @@ function normalizeFrontMatterTag(tagsPath, frontMatterTag) {
|
|
|
34
35
|
exports.normalizeFrontMatterTag = normalizeFrontMatterTag;
|
|
35
36
|
function normalizeFrontMatterTags(tagsPath, frontMatterTags = []) {
|
|
36
37
|
const tags = frontMatterTags.map((tag) => normalizeFrontMatterTag(tagsPath, tag));
|
|
37
|
-
return
|
|
38
|
+
return lodash_1.default.uniqBy(tags, (tag) => tag.permalink);
|
|
38
39
|
}
|
|
39
40
|
exports.normalizeFrontMatterTags = normalizeFrontMatterTags;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Permits to group docs/blogPosts by tag (provided by front matter)
|
|
43
|
+
* Note: groups are indexed by permalink, because routes must be unique in the
|
|
44
|
+
* end. Labels may vary on 2 md files but they are normalized. Docs with
|
|
45
|
+
* label='some label' and label='some-label' should end-up in the same
|
|
46
|
+
* group/page in the end. We can't create 2 routes /some-label because one would
|
|
47
|
+
* override the other
|
|
48
|
+
*/
|
|
45
49
|
function groupTaggedItems(items, getItemTags) {
|
|
46
50
|
const result = {};
|
|
47
51
|
function handleItemTag(item, tag) {
|
|
48
52
|
var _a;
|
|
49
53
|
// Init missing tag groups
|
|
50
|
-
// TODO: it's not really clear what should be the behavior if 2 items have
|
|
54
|
+
// TODO: it's not really clear what should be the behavior if 2 items have
|
|
55
|
+
// the same tag but the permalink is different for each
|
|
51
56
|
// For now, the first tag found wins
|
|
52
57
|
result[tag.permalink] = (_a = result[tag.permalink]) !== null && _a !== void 0 ? _a : {
|
|
53
58
|
tag,
|
|
@@ -64,7 +69,7 @@ function groupTaggedItems(items, getItemTags) {
|
|
|
64
69
|
// If user add twice the same tag to a md doc (weird but possible),
|
|
65
70
|
// we don't want the item to appear twice in the list...
|
|
66
71
|
Object.values(result).forEach((group) => {
|
|
67
|
-
group.items =
|
|
72
|
+
group.items = lodash_1.default.uniq(group.items);
|
|
68
73
|
});
|
|
69
74
|
return result;
|
|
70
75
|
}
|
package/lib/tags.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":";AAAA;;;;;GAKG
|
|
1
|
+
{"version":3,"file":"tags.js","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,iEAAuB;AACvB,yCAAwC;AASxC,SAAgB,uBAAuB,CACrC,QAAgB,EAChB,cAA8B;IAE9B,SAAS,WAAW,CAAC,SAAiB;QACpC,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,gBAAC,CAAC,SAAS,CAAC,SAAS,CAAC;SAClC,CAAC;IACJ,CAAC;IAED,0DAA0D;IAC1D,SAAS,qBAAqB,CAAC,SAAiB;QAC9C,2EAA2E;QAC3E,2EAA2E;QAC3E,mDAAmD;QACnD,OAAO,IAAA,uBAAY,EAAC,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;IAC7C,CAAC;IAED,MAAM,GAAG,GACP,OAAO,cAAc,KAAK,QAAQ;QAChC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC;QAC7B,CAAC,CAAC,cAAc,CAAC;IAErB,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,SAAS,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G,gBAAC,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAjCD,4CAiCC"}
|
package/lib/urlUtils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlUtils.d.ts","sourceRoot":"","sources":["../src/urlUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"urlUtils.d.ts","sourceRoot":"","sources":["../src/urlUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CA8EtD;AAED,wBAAgB,UAAU,CACxB,gBAAgB,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAKpB"}
|
package/lib/urlUtils.js
CHANGED
|
@@ -16,7 +16,8 @@ function normalizeUrl(rawUrls) {
|
|
|
16
16
|
if (urls[0].match(/^[^/:]+:\/*$/) && urls.length > 1) {
|
|
17
17
|
const first = urls.shift();
|
|
18
18
|
if (first.startsWith('file:') && urls[0].startsWith('/')) {
|
|
19
|
-
// Force a double slash here, else we lose the information that the next
|
|
19
|
+
// Force a double slash here, else we lose the information that the next
|
|
20
|
+
// segment is an absolute path
|
|
20
21
|
urls[0] = `${first}//${urls[0]}`;
|
|
21
22
|
}
|
|
22
23
|
else {
|
|
@@ -26,9 +27,8 @@ function normalizeUrl(rawUrls) {
|
|
|
26
27
|
// There must be two or three slashes in the file protocol,
|
|
27
28
|
// two slashes in anything else.
|
|
28
29
|
const replacement = urls[0].match(/^file:\/\/\//) ? '$1:///' : '$1://';
|
|
29
|
-
urls[0] = urls[0].replace(/^([^/:]+):\/*/, replacement);
|
|
30
|
-
|
|
31
|
-
for (let i = 0; i < urls.length; i++) {
|
|
30
|
+
urls[0] = urls[0].replace(/^(?<protocol>[^/:]+):\/*/, replacement);
|
|
31
|
+
for (let i = 0; i < urls.length; i += 1) {
|
|
32
32
|
let component = urls[i];
|
|
33
33
|
if (typeof component !== 'string') {
|
|
34
34
|
throw new TypeError(`Url must be a string. Received ${typeof component}`);
|
|
@@ -37,19 +37,20 @@ function normalizeUrl(rawUrls) {
|
|
|
37
37
|
if (i === urls.length - 1 && hasEndingSlash) {
|
|
38
38
|
resultArray.push('/');
|
|
39
39
|
}
|
|
40
|
-
// eslint-disable-next-line
|
|
40
|
+
// eslint-disable-next-line no-continue
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
if (component !== '/') {
|
|
44
44
|
if (i > 0) {
|
|
45
45
|
// Removing the starting slashes for each component but the first.
|
|
46
46
|
component = component.replace(/^[/]+/,
|
|
47
|
-
// Special case where the first element of rawUrls is empty
|
|
47
|
+
// Special case where the first element of rawUrls is empty
|
|
48
|
+
// ["", "/hello"] => /hello
|
|
48
49
|
component[0] === '/' && !hasStartingSlash ? '/' : '');
|
|
49
50
|
}
|
|
50
51
|
hasEndingSlash = component[component.length - 1] === '/';
|
|
51
|
-
// Removing the ending slashes for each component but the last.
|
|
52
|
-
//
|
|
52
|
+
// Removing the ending slashes for each component but the last. For the
|
|
53
|
+
// last component we will combine multiple slashes to a single one.
|
|
53
54
|
component = component.replace(/[/]+$/, i < urls.length - 1 ? '' : '/');
|
|
54
55
|
}
|
|
55
56
|
hasStartingSlash = true;
|
|
@@ -59,12 +60,12 @@ function normalizeUrl(rawUrls) {
|
|
|
59
60
|
// Each input component is now separated by a single slash
|
|
60
61
|
// except the possible first plain protocol part.
|
|
61
62
|
// Remove trailing slash before parameters or hash.
|
|
62
|
-
str = str.replace(/\/(
|
|
63
|
+
str = str.replace(/\/(?<search>\?|&|#[^!])/g, '$1');
|
|
63
64
|
// Replace ? in parameters with &.
|
|
64
65
|
const parts = str.split('?');
|
|
65
66
|
str = parts.shift() + (parts.length > 0 ? '?' : '') + parts.join('&');
|
|
66
67
|
// Dedupe forward slashes in the entire path, avoiding protocol slashes.
|
|
67
|
-
str = str.replace(/([^:/]\/)\/+/g, '$1');
|
|
68
|
+
str = str.replace(/(?<textBefore>[^:/]\/)\/+/g, '$1');
|
|
68
69
|
// Dedupe forward slashes at the beginning of the path.
|
|
69
70
|
str = str.replace(/^\/+/g, '/');
|
|
70
71
|
return str;
|
package/lib/urlUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"urlUtils.js","sourceRoot":"","sources":["../src/urlUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,YAAY,CAAC,OAAiB;IAC5C,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC1B,MAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,2EAA2E;IAC3E,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,KAAM,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;YACzD,
|
|
1
|
+
{"version":3,"file":"urlUtils.js","sourceRoot":"","sources":["../src/urlUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,SAAgB,YAAY,CAAC,OAAiB;IAC5C,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;IAC1B,MAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAC7B,IAAI,cAAc,GAAG,KAAK,CAAC;IAE3B,2E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"","sources":["../src/webpackUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAQzC,aAAK,WAAW,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D,aAAK,eAAe,GAAG;IACrB,OAAO,EAAE;QACP,IAAI,EAAE,CAAC,OAAO,EAAE;YAAC,MAAM,EAAE,WAAW,CAAA;SAAC,KAAK,WAAW,CAAC;QACtD,GAAG,EAAE,CAAC,OAAO,EAAE;YAAC,MAAM,EAAE,WAAW,CAAA;SAAC,KAAK,WAAW,CAAC;QACrD,6BAA6B,EAAE,MAAM,CAAC;QACtC,4BAA4B,EAAE,MAAM,CAAC;KACtC,CAAC;IACF,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,WAAW,CAAC;QAC1B,KAAK,EAAE,MAAM,WAAW,CAAC;QACzB,KAAK,EAAE,MAAM,WAAW,CAAC;QACzB,GAAG,EAAE,MAAM,WAAW,CAAC;QACvB,WAAW,EAAE,MAAM,WAAW,CAAC;KAChC,CAAC;CACH,CAAC;AAGF,wBAAgB,kBAAkB,IAAI,eAAe,CA+GpD"}
|
package/lib/webpackUtils.js
CHANGED
|
@@ -13,10 +13,11 @@ const pathUtils_1 = require("./pathUtils");
|
|
|
13
13
|
const constants_1 = require("./constants");
|
|
14
14
|
// Inspired by https://github.com/gatsbyjs/gatsby/blob/8e6e021014da310b9cc7d02e58c9b3efe938c665/packages/gatsby/src/utils/webpack-utils.ts#L447
|
|
15
15
|
function getFileLoaderUtils() {
|
|
16
|
-
// files/images < urlLoaderLimit will be inlined as base64 strings directly in
|
|
16
|
+
// files/images < urlLoaderLimit will be inlined as base64 strings directly in
|
|
17
|
+
// the html
|
|
17
18
|
const urlLoaderLimit = constants_1.WEBPACK_URL_LOADER_LIMIT;
|
|
18
19
|
// defines the path/pattern of the assets handled by webpack
|
|
19
|
-
const fileLoaderFileName = (folder) => `${constants_1.OUTPUT_STATIC_ASSETS_DIR_NAME}/${folder}/[name]-[
|
|
20
|
+
const fileLoaderFileName = (folder) => `${constants_1.OUTPUT_STATIC_ASSETS_DIR_NAME}/${folder}/[name]-[contenthash].[ext]`;
|
|
20
21
|
const loaders = {
|
|
21
22
|
file: (options) => ({
|
|
22
23
|
loader: require.resolve(`file-loader`),
|
|
@@ -32,7 +33,7 @@ function getFileLoaderUtils() {
|
|
|
32
33
|
fallback: require.resolve('file-loader'),
|
|
33
34
|
},
|
|
34
35
|
}),
|
|
35
|
-
// TODO
|
|
36
|
+
// TODO avoid conflicts with the ideal-image plugin
|
|
36
37
|
// TODO this may require a little breaking change for ideal-image users?
|
|
37
38
|
// Maybe with the ideal image plugin, all md images should be "ideal"?
|
|
38
39
|
// This is used to force url-loader+file-loader on markdown images
|
|
@@ -47,11 +48,11 @@ function getFileLoaderUtils() {
|
|
|
47
48
|
*/
|
|
48
49
|
images: () => ({
|
|
49
50
|
use: [loaders.url({ folder: 'images' })],
|
|
50
|
-
test: /\.(ico|
|
|
51
|
+
test: /\.(?:ico|jpe?g|png|gif|webp)(?:\?.*)?$/i,
|
|
51
52
|
}),
|
|
52
53
|
fonts: () => ({
|
|
53
54
|
use: [loaders.url({ folder: 'fonts' })],
|
|
54
|
-
test: /\.(
|
|
55
|
+
test: /\.(?:woff2?|eot|ttf|otf)$/i,
|
|
55
56
|
}),
|
|
56
57
|
/**
|
|
57
58
|
* Loads audio and video and inlines them via a data URI if they are below
|
|
@@ -59,10 +60,10 @@ function getFileLoaderUtils() {
|
|
|
59
60
|
*/
|
|
60
61
|
media: () => ({
|
|
61
62
|
use: [loaders.url({ folder: 'medias' })],
|
|
62
|
-
test: /\.(mp4|webm|ogv|wav|mp3|m4a|aac|oga|flac)
|
|
63
|
+
test: /\.(?:mp4|webm|ogv|wav|mp3|m4a|aac|oga|flac)$/i,
|
|
63
64
|
}),
|
|
64
65
|
svg: () => ({
|
|
65
|
-
test: /\.svg
|
|
66
|
+
test: /\.svg$/i,
|
|
66
67
|
oneOf: [
|
|
67
68
|
{
|
|
68
69
|
use: [
|
|
@@ -77,6 +78,7 @@ function getFileLoaderUtils() {
|
|
|
77
78
|
name: 'preset-default',
|
|
78
79
|
params: {
|
|
79
80
|
overrides: {
|
|
81
|
+
removeTitle: false,
|
|
80
82
|
removeViewBox: false,
|
|
81
83
|
},
|
|
82
84
|
},
|
|
@@ -91,7 +93,7 @@ function getFileLoaderUtils() {
|
|
|
91
93
|
// We don't want to use SVGR loader for non-React source code
|
|
92
94
|
// ie we don't want to use SVGR for CSS files...
|
|
93
95
|
issuer: {
|
|
94
|
-
and: [/\.(
|
|
96
|
+
and: [/\.(?:tsx?|jsx?|mdx?)$/i],
|
|
95
97
|
},
|
|
96
98
|
},
|
|
97
99
|
{
|
|
@@ -101,7 +103,7 @@ function getFileLoaderUtils() {
|
|
|
101
103
|
}),
|
|
102
104
|
otherAssets: () => ({
|
|
103
105
|
use: [loaders.file({ folder: 'files' })],
|
|
104
|
-
test: /\.(pdf|
|
|
106
|
+
test: /\.(?:pdf|docx?|xlsx?|zip|rar)$/i,
|
|
105
107
|
}),
|
|
106
108
|
};
|
|
107
109
|
return { loaders, rules };
|
package/lib/webpackUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpackUtils.js","sourceRoot":"","sources":["../src/webpackUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAGH,6DAAwB;AACxB,2CAAuC;AACvC,2CAGqB;AAoBrB,+IAA+I;AAC/I,SAAgB,kBAAkB;IAChC,
|
|
1
|
+
{"version":3,"file":"webpackUtils.js","sourceRoot":"","sources":["../src/webpackUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAGH,6DAAwB;AACxB,2CAAuC;AACvC,2CAGqB;AAoBrB,+IAA+I;AAC/I,SAAgB,kBAAkB;IAChC,8EAA8E;IAC9E,WAAW;IACX,MAAM,cAAc,GAAG,oCAAwB,CAAC;IA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