@docusaurus/utils 2.0.0-beta.16 → 2.0.0-beta.19

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.
Files changed (86) hide show
  1. package/lib/constants.d.ts +51 -1
  2. package/lib/constants.d.ts.map +1 -1
  3. package/lib/constants.js +57 -10
  4. package/lib/constants.js.map +1 -1
  5. package/lib/dataFileUtils.d.ts +38 -2
  6. package/lib/dataFileUtils.d.ts.map +1 -1
  7. package/lib/dataFileUtils.js +39 -13
  8. package/lib/dataFileUtils.js.map +1 -1
  9. package/lib/emitUtils.d.ts +32 -0
  10. package/lib/emitUtils.d.ts.map +1 -0
  11. package/lib/emitUtils.js +80 -0
  12. package/lib/emitUtils.js.map +1 -0
  13. package/lib/gitUtils.d.ts +54 -5
  14. package/lib/gitUtils.d.ts.map +1 -1
  15. package/lib/gitUtils.js +17 -14
  16. package/lib/gitUtils.js.map +1 -1
  17. package/lib/globUtils.d.ts +28 -0
  18. package/lib/globUtils.d.ts.map +1 -1
  19. package/lib/globUtils.js +36 -13
  20. package/lib/globUtils.js.map +1 -1
  21. package/lib/hashUtils.d.ts +5 -4
  22. package/lib/hashUtils.d.ts.map +1 -1
  23. package/lib/hashUtils.js +7 -6
  24. package/lib/hashUtils.js.map +1 -1
  25. package/lib/i18nUtils.d.ts +51 -0
  26. package/lib/i18nUtils.d.ts.map +1 -0
  27. package/lib/i18nUtils.js +69 -0
  28. package/lib/i18nUtils.js.map +1 -0
  29. package/lib/index.d.ts +10 -54
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/index.js +56 -256
  32. package/lib/index.js.map +1 -1
  33. package/lib/jsUtils.d.ts +45 -0
  34. package/lib/jsUtils.d.ts.map +1 -0
  35. package/lib/jsUtils.js +94 -0
  36. package/lib/jsUtils.js.map +1 -0
  37. package/lib/markdownLinks.d.ts +48 -5
  38. package/lib/markdownLinks.d.ts.map +1 -1
  39. package/lib/markdownLinks.js +29 -13
  40. package/lib/markdownLinks.js.map +1 -1
  41. package/lib/markdownUtils.d.ts +112 -0
  42. package/lib/markdownUtils.d.ts.map +1 -0
  43. package/lib/markdownUtils.js +271 -0
  44. package/lib/markdownUtils.js.map +1 -0
  45. package/lib/pathUtils.d.ts +2 -1
  46. package/lib/pathUtils.d.ts.map +1 -1
  47. package/lib/pathUtils.js +16 -7
  48. package/lib/pathUtils.js.map +1 -1
  49. package/lib/slugger.d.ts +10 -0
  50. package/lib/slugger.d.ts.map +1 -1
  51. package/lib/slugger.js +6 -2
  52. package/lib/slugger.js.map +1 -1
  53. package/lib/tags.d.ts +42 -10
  54. package/lib/tags.d.ts.map +1 -1
  55. package/lib/tags.js +40 -26
  56. package/lib/tags.js.map +1 -1
  57. package/lib/urlUtils.d.ts +57 -0
  58. package/lib/urlUtils.d.ts.map +1 -1
  59. package/lib/urlUtils.js +132 -6
  60. package/lib/urlUtils.js.map +1 -1
  61. package/lib/webpackUtils.d.ts +5 -0
  62. package/lib/webpackUtils.d.ts.map +1 -1
  63. package/lib/webpackUtils.js +8 -5
  64. package/lib/webpackUtils.js.map +1 -1
  65. package/package.json +11 -11
  66. package/src/constants.ts +65 -9
  67. package/src/dataFileUtils.ts +44 -12
  68. package/src/emitUtils.ts +99 -0
  69. package/src/gitUtils.ts +77 -17
  70. package/src/globUtils.ts +34 -13
  71. package/src/hashUtils.ts +6 -5
  72. package/src/i18nUtils.ts +115 -0
  73. package/src/index.ts +43 -307
  74. package/src/jsUtils.ts +102 -0
  75. package/src/markdownLinks.ts +71 -28
  76. package/src/markdownUtils.ts +354 -0
  77. package/src/pathUtils.ts +15 -7
  78. package/src/slugger.ts +13 -1
  79. package/src/tags.ts +53 -28
  80. package/src/urlUtils.ts +145 -7
  81. package/src/webpackUtils.ts +11 -4
  82. package/lib/markdownParser.d.ts +0 -32
  83. package/lib/markdownParser.d.ts.map +0 -1
  84. package/lib/markdownParser.js +0 -161
  85. package/lib/markdownParser.js.map +0 -1
  86. package/src/markdownParser.ts +0 -201
package/lib/index.js CHANGED
@@ -6,48 +6,66 @@
6
6
  * LICENSE file in the root directory of this source tree.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.genChunkName = exports.encodePath = exports.fileToPath = exports.generate = exports.getFolderContainingFile = exports.findFolderContainingFile = exports.getContentPathList = exports.getDataFileData = exports.getDataFilePath = exports.getFileLoaderUtils = exports.createAbsoluteFilePathMatcher = exports.createMatcher = exports.GlobExcludeDefault = exports.Globby = exports.docuHash = exports.simpleHash = exports.md5Hash = exports.escapePath = exports.aliasedSitePath = exports.toMessageRelativeFilePath = exports.posixPath = exports.shortName = exports.isNameTooLong = exports.createSlugger = exports.replaceMarkdownLinks = exports.parseMarkdownString = exports.parseMarkdownContentTitle = exports.parseFrontMatter = exports.createExcerpt = exports.parseMarkdownHeadingId = exports.groupTaggedItems = exports.normalizeFrontMatterTags = exports.normalizeFrontMatterTag = exports.getEditUrl = exports.normalizeUrl = exports.GitNotFoundError = exports.getFileCommitDate = exports.WEBPACK_URL_LOADER_LIMIT = exports.DEFAULT_PLUGIN_ID = exports.DEFAULT_PORT = exports.THEME_PATH = exports.OUTPUT_STATIC_ASSETS_DIR_NAME = exports.STATIC_DIR_NAME = exports.SRC_DIR_NAME = exports.GENERATED_FILES_DIR_NAME = exports.BABEL_CONFIG_FILE_NAME = exports.DEFAULT_CONFIG_FILE_NAME = exports.DEFAULT_BUILD_DIR_NAME = exports.NODE_MINOR_VERSION = exports.NODE_MAJOR_VERSION = void 0;
10
- exports.updateTranslationFileMessages = exports.mergeTranslations = exports.reportMessage = exports.findAsyncSequential = exports.mapAsyncSequential = exports.readOutputHTMLFile = exports.getPluginI18nPath = exports.getElementsAround = exports.removePrefix = exports.removeSuffix = exports.removeTrailingSlash = exports.addTrailingSlash = exports.addTrailingPathSeparator = exports.addLeadingSlash = exports.resolvePathname = exports.isValidPathname = void 0;
11
- const tslib_1 = require("tslib");
12
- const logger_1 = (0, tslib_1.__importDefault)(require("@docusaurus/logger"));
13
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
14
- const crypto_1 = require("crypto");
15
- const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
16
- const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
17
- const url_1 = require("url");
18
- const resolve_pathname_1 = (0, tslib_1.__importDefault)(require("resolve-pathname"));
19
- const hashUtils_1 = require("./hashUtils");
20
- const constants_1 = require("./constants");
21
- var constants_2 = require("./constants");
22
- Object.defineProperty(exports, "NODE_MAJOR_VERSION", { enumerable: true, get: function () { return constants_2.NODE_MAJOR_VERSION; } });
23
- Object.defineProperty(exports, "NODE_MINOR_VERSION", { enumerable: true, get: function () { return constants_2.NODE_MINOR_VERSION; } });
24
- Object.defineProperty(exports, "DEFAULT_BUILD_DIR_NAME", { enumerable: true, get: function () { return constants_2.DEFAULT_BUILD_DIR_NAME; } });
25
- Object.defineProperty(exports, "DEFAULT_CONFIG_FILE_NAME", { enumerable: true, get: function () { return constants_2.DEFAULT_CONFIG_FILE_NAME; } });
26
- Object.defineProperty(exports, "BABEL_CONFIG_FILE_NAME", { enumerable: true, get: function () { return constants_2.BABEL_CONFIG_FILE_NAME; } });
27
- Object.defineProperty(exports, "GENERATED_FILES_DIR_NAME", { enumerable: true, get: function () { return constants_2.GENERATED_FILES_DIR_NAME; } });
28
- Object.defineProperty(exports, "SRC_DIR_NAME", { enumerable: true, get: function () { return constants_2.SRC_DIR_NAME; } });
29
- Object.defineProperty(exports, "STATIC_DIR_NAME", { enumerable: true, get: function () { return constants_2.STATIC_DIR_NAME; } });
30
- Object.defineProperty(exports, "OUTPUT_STATIC_ASSETS_DIR_NAME", { enumerable: true, get: function () { return constants_2.OUTPUT_STATIC_ASSETS_DIR_NAME; } });
31
- Object.defineProperty(exports, "THEME_PATH", { enumerable: true, get: function () { return constants_2.THEME_PATH; } });
32
- Object.defineProperty(exports, "DEFAULT_PORT", { enumerable: true, get: function () { return constants_2.DEFAULT_PORT; } });
33
- Object.defineProperty(exports, "DEFAULT_PLUGIN_ID", { enumerable: true, get: function () { return constants_2.DEFAULT_PLUGIN_ID; } });
34
- Object.defineProperty(exports, "WEBPACK_URL_LOADER_LIMIT", { enumerable: true, get: function () { return constants_2.WEBPACK_URL_LOADER_LIMIT; } });
9
+ exports.writeMarkdownHeadingId = exports.parseMarkdownString = exports.parseMarkdownContentTitle = exports.parseFrontMatter = exports.createExcerpt = exports.parseMarkdownHeadingId = exports.groupTaggedItems = exports.normalizeFrontMatterTags = exports.buildSshUrl = exports.buildHttpsUrl = exports.hasSSHProtocol = exports.removeTrailingSlash = exports.addTrailingSlash = exports.addLeadingSlash = exports.resolvePathname = exports.isValidPathname = exports.encodePath = exports.fileToPath = exports.getEditUrl = exports.normalizeUrl = exports.reportMessage = exports.findAsyncSequential = exports.mapAsyncSequential = exports.removePrefix = exports.removeSuffix = exports.localizePath = exports.getPluginI18nPath = exports.updateTranslationFileMessages = exports.mergeTranslations = exports.GitNotFoundError = exports.FileNotTrackedError = exports.getFileCommitDate = exports.readOutputHTMLFile = exports.generate = exports.WEBPACK_URL_LOADER_LIMIT = exports.DEFAULT_PLUGIN_ID = exports.DEFAULT_PORT = exports.CODE_TRANSLATIONS_FILE_NAME = exports.I18N_DIR_NAME = exports.THEME_PATH = exports.OUTPUT_STATIC_ASSETS_DIR_NAME = exports.DEFAULT_STATIC_DIR_NAME = exports.SRC_DIR_NAME = exports.GENERATED_FILES_DIR_NAME = exports.BABEL_CONFIG_FILE_NAME = exports.DEFAULT_CONFIG_FILE_NAME = exports.DEFAULT_BUILD_DIR_NAME = exports.DOCUSAURUS_VERSION = exports.NODE_MINOR_VERSION = exports.NODE_MAJOR_VERSION = void 0;
10
+ exports.getFolderContainingFile = exports.findFolderContainingFile = exports.getContentPathList = exports.getDataFileData = exports.getDataFilePath = exports.getFileLoaderUtils = exports.createAbsoluteFilePathMatcher = exports.createMatcher = exports.GlobExcludeDefault = exports.Globby = exports.docuHash = exports.simpleHash = exports.md5Hash = exports.addTrailingPathSeparator = exports.escapePath = exports.aliasedSitePath = exports.toMessageRelativeFilePath = exports.posixPath = exports.shortName = exports.isNameTooLong = exports.createSlugger = exports.replaceMarkdownLinks = void 0;
11
+ var constants_1 = require("./constants");
12
+ Object.defineProperty(exports, "NODE_MAJOR_VERSION", { enumerable: true, get: function () { return constants_1.NODE_MAJOR_VERSION; } });
13
+ Object.defineProperty(exports, "NODE_MINOR_VERSION", { enumerable: true, get: function () { return constants_1.NODE_MINOR_VERSION; } });
14
+ Object.defineProperty(exports, "DOCUSAURUS_VERSION", { enumerable: true, get: function () { return constants_1.DOCUSAURUS_VERSION; } });
15
+ Object.defineProperty(exports, "DEFAULT_BUILD_DIR_NAME", { enumerable: true, get: function () { return constants_1.DEFAULT_BUILD_DIR_NAME; } });
16
+ Object.defineProperty(exports, "DEFAULT_CONFIG_FILE_NAME", { enumerable: true, get: function () { return constants_1.DEFAULT_CONFIG_FILE_NAME; } });
17
+ Object.defineProperty(exports, "BABEL_CONFIG_FILE_NAME", { enumerable: true, get: function () { return constants_1.BABEL_CONFIG_FILE_NAME; } });
18
+ Object.defineProperty(exports, "GENERATED_FILES_DIR_NAME", { enumerable: true, get: function () { return constants_1.GENERATED_FILES_DIR_NAME; } });
19
+ Object.defineProperty(exports, "SRC_DIR_NAME", { enumerable: true, get: function () { return constants_1.SRC_DIR_NAME; } });
20
+ Object.defineProperty(exports, "DEFAULT_STATIC_DIR_NAME", { enumerable: true, get: function () { return constants_1.DEFAULT_STATIC_DIR_NAME; } });
21
+ Object.defineProperty(exports, "OUTPUT_STATIC_ASSETS_DIR_NAME", { enumerable: true, get: function () { return constants_1.OUTPUT_STATIC_ASSETS_DIR_NAME; } });
22
+ Object.defineProperty(exports, "THEME_PATH", { enumerable: true, get: function () { return constants_1.THEME_PATH; } });
23
+ Object.defineProperty(exports, "I18N_DIR_NAME", { enumerable: true, get: function () { return constants_1.I18N_DIR_NAME; } });
24
+ Object.defineProperty(exports, "CODE_TRANSLATIONS_FILE_NAME", { enumerable: true, get: function () { return constants_1.CODE_TRANSLATIONS_FILE_NAME; } });
25
+ Object.defineProperty(exports, "DEFAULT_PORT", { enumerable: true, get: function () { return constants_1.DEFAULT_PORT; } });
26
+ Object.defineProperty(exports, "DEFAULT_PLUGIN_ID", { enumerable: true, get: function () { return constants_1.DEFAULT_PLUGIN_ID; } });
27
+ Object.defineProperty(exports, "WEBPACK_URL_LOADER_LIMIT", { enumerable: true, get: function () { return constants_1.WEBPACK_URL_LOADER_LIMIT; } });
28
+ var emitUtils_1 = require("./emitUtils");
29
+ Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return emitUtils_1.generate; } });
30
+ Object.defineProperty(exports, "readOutputHTMLFile", { enumerable: true, get: function () { return emitUtils_1.readOutputHTMLFile; } });
35
31
  var gitUtils_1 = require("./gitUtils");
36
32
  Object.defineProperty(exports, "getFileCommitDate", { enumerable: true, get: function () { return gitUtils_1.getFileCommitDate; } });
33
+ Object.defineProperty(exports, "FileNotTrackedError", { enumerable: true, get: function () { return gitUtils_1.FileNotTrackedError; } });
37
34
  Object.defineProperty(exports, "GitNotFoundError", { enumerable: true, get: function () { return gitUtils_1.GitNotFoundError; } });
35
+ var i18nUtils_1 = require("./i18nUtils");
36
+ Object.defineProperty(exports, "mergeTranslations", { enumerable: true, get: function () { return i18nUtils_1.mergeTranslations; } });
37
+ Object.defineProperty(exports, "updateTranslationFileMessages", { enumerable: true, get: function () { return i18nUtils_1.updateTranslationFileMessages; } });
38
+ Object.defineProperty(exports, "getPluginI18nPath", { enumerable: true, get: function () { return i18nUtils_1.getPluginI18nPath; } });
39
+ Object.defineProperty(exports, "localizePath", { enumerable: true, get: function () { return i18nUtils_1.localizePath; } });
40
+ var jsUtils_1 = require("./jsUtils");
41
+ Object.defineProperty(exports, "removeSuffix", { enumerable: true, get: function () { return jsUtils_1.removeSuffix; } });
42
+ Object.defineProperty(exports, "removePrefix", { enumerable: true, get: function () { return jsUtils_1.removePrefix; } });
43
+ Object.defineProperty(exports, "mapAsyncSequential", { enumerable: true, get: function () { return jsUtils_1.mapAsyncSequential; } });
44
+ Object.defineProperty(exports, "findAsyncSequential", { enumerable: true, get: function () { return jsUtils_1.findAsyncSequential; } });
45
+ Object.defineProperty(exports, "reportMessage", { enumerable: true, get: function () { return jsUtils_1.reportMessage; } });
38
46
  var urlUtils_1 = require("./urlUtils");
39
47
  Object.defineProperty(exports, "normalizeUrl", { enumerable: true, get: function () { return urlUtils_1.normalizeUrl; } });
40
48
  Object.defineProperty(exports, "getEditUrl", { enumerable: true, get: function () { return urlUtils_1.getEditUrl; } });
49
+ Object.defineProperty(exports, "fileToPath", { enumerable: true, get: function () { return urlUtils_1.fileToPath; } });
50
+ Object.defineProperty(exports, "encodePath", { enumerable: true, get: function () { return urlUtils_1.encodePath; } });
51
+ Object.defineProperty(exports, "isValidPathname", { enumerable: true, get: function () { return urlUtils_1.isValidPathname; } });
52
+ Object.defineProperty(exports, "resolvePathname", { enumerable: true, get: function () { return urlUtils_1.resolvePathname; } });
53
+ Object.defineProperty(exports, "addLeadingSlash", { enumerable: true, get: function () { return urlUtils_1.addLeadingSlash; } });
54
+ Object.defineProperty(exports, "addTrailingSlash", { enumerable: true, get: function () { return urlUtils_1.addTrailingSlash; } });
55
+ Object.defineProperty(exports, "removeTrailingSlash", { enumerable: true, get: function () { return urlUtils_1.removeTrailingSlash; } });
56
+ Object.defineProperty(exports, "hasSSHProtocol", { enumerable: true, get: function () { return urlUtils_1.hasSSHProtocol; } });
57
+ Object.defineProperty(exports, "buildHttpsUrl", { enumerable: true, get: function () { return urlUtils_1.buildHttpsUrl; } });
58
+ Object.defineProperty(exports, "buildSshUrl", { enumerable: true, get: function () { return urlUtils_1.buildSshUrl; } });
41
59
  var tags_1 = require("./tags");
42
- Object.defineProperty(exports, "normalizeFrontMatterTag", { enumerable: true, get: function () { return tags_1.normalizeFrontMatterTag; } });
43
60
  Object.defineProperty(exports, "normalizeFrontMatterTags", { enumerable: true, get: function () { return tags_1.normalizeFrontMatterTags; } });
44
61
  Object.defineProperty(exports, "groupTaggedItems", { enumerable: true, get: function () { return tags_1.groupTaggedItems; } });
45
- var markdownParser_1 = require("./markdownParser");
46
- Object.defineProperty(exports, "parseMarkdownHeadingId", { enumerable: true, get: function () { return markdownParser_1.parseMarkdownHeadingId; } });
47
- Object.defineProperty(exports, "createExcerpt", { enumerable: true, get: function () { return markdownParser_1.createExcerpt; } });
48
- Object.defineProperty(exports, "parseFrontMatter", { enumerable: true, get: function () { return markdownParser_1.parseFrontMatter; } });
49
- Object.defineProperty(exports, "parseMarkdownContentTitle", { enumerable: true, get: function () { return markdownParser_1.parseMarkdownContentTitle; } });
50
- Object.defineProperty(exports, "parseMarkdownString", { enumerable: true, get: function () { return markdownParser_1.parseMarkdownString; } });
62
+ var markdownUtils_1 = require("./markdownUtils");
63
+ Object.defineProperty(exports, "parseMarkdownHeadingId", { enumerable: true, get: function () { return markdownUtils_1.parseMarkdownHeadingId; } });
64
+ Object.defineProperty(exports, "createExcerpt", { enumerable: true, get: function () { return markdownUtils_1.createExcerpt; } });
65
+ Object.defineProperty(exports, "parseFrontMatter", { enumerable: true, get: function () { return markdownUtils_1.parseFrontMatter; } });
66
+ Object.defineProperty(exports, "parseMarkdownContentTitle", { enumerable: true, get: function () { return markdownUtils_1.parseMarkdownContentTitle; } });
67
+ Object.defineProperty(exports, "parseMarkdownString", { enumerable: true, get: function () { return markdownUtils_1.parseMarkdownString; } });
68
+ Object.defineProperty(exports, "writeMarkdownHeadingId", { enumerable: true, get: function () { return markdownUtils_1.writeMarkdownHeadingId; } });
51
69
  var markdownLinks_1 = require("./markdownLinks");
52
70
  Object.defineProperty(exports, "replaceMarkdownLinks", { enumerable: true, get: function () { return markdownLinks_1.replaceMarkdownLinks; } });
53
71
  var slugger_1 = require("./slugger");
@@ -59,10 +77,11 @@ Object.defineProperty(exports, "posixPath", { enumerable: true, get: function ()
59
77
  Object.defineProperty(exports, "toMessageRelativeFilePath", { enumerable: true, get: function () { return pathUtils_1.toMessageRelativeFilePath; } });
60
78
  Object.defineProperty(exports, "aliasedSitePath", { enumerable: true, get: function () { return pathUtils_1.aliasedSitePath; } });
61
79
  Object.defineProperty(exports, "escapePath", { enumerable: true, get: function () { return pathUtils_1.escapePath; } });
62
- var hashUtils_2 = require("./hashUtils");
63
- Object.defineProperty(exports, "md5Hash", { enumerable: true, get: function () { return hashUtils_2.md5Hash; } });
64
- Object.defineProperty(exports, "simpleHash", { enumerable: true, get: function () { return hashUtils_2.simpleHash; } });
65
- Object.defineProperty(exports, "docuHash", { enumerable: true, get: function () { return hashUtils_2.docuHash; } });
80
+ Object.defineProperty(exports, "addTrailingPathSeparator", { enumerable: true, get: function () { return pathUtils_1.addTrailingPathSeparator; } });
81
+ var hashUtils_1 = require("./hashUtils");
82
+ Object.defineProperty(exports, "md5Hash", { enumerable: true, get: function () { return hashUtils_1.md5Hash; } });
83
+ Object.defineProperty(exports, "simpleHash", { enumerable: true, get: function () { return hashUtils_1.simpleHash; } });
84
+ Object.defineProperty(exports, "docuHash", { enumerable: true, get: function () { return hashUtils_1.docuHash; } });
66
85
  var globUtils_1 = require("./globUtils");
67
86
  Object.defineProperty(exports, "Globby", { enumerable: true, get: function () { return globUtils_1.Globby; } });
68
87
  Object.defineProperty(exports, "GlobExcludeDefault", { enumerable: true, get: function () { return globUtils_1.GlobExcludeDefault; } });
@@ -76,223 +95,4 @@ Object.defineProperty(exports, "getDataFileData", { enumerable: true, get: funct
76
95
  Object.defineProperty(exports, "getContentPathList", { enumerable: true, get: function () { return dataFileUtils_1.getContentPathList; } });
77
96
  Object.defineProperty(exports, "findFolderContainingFile", { enumerable: true, get: function () { return dataFileUtils_1.findFolderContainingFile; } });
78
97
  Object.defineProperty(exports, "getFolderContainingFile", { enumerable: true, get: function () { return dataFileUtils_1.getFolderContainingFile; } });
79
- const fileHash = new Map();
80
- async function generate(generatedFilesDir, file, content, skipCache = process.env.NODE_ENV === 'production') {
81
- const filepath = path_1.default.join(generatedFilesDir, file);
82
- if (skipCache) {
83
- await fs_extra_1.default.ensureDir(path_1.default.dirname(filepath));
84
- await fs_extra_1.default.writeFile(filepath, content);
85
- return;
86
- }
87
- let lastHash = fileHash.get(filepath);
88
- // If file already exists but its not in runtime cache yet,
89
- // we try to calculate the content hash and then compare
90
- // This is to avoid unnecessary overwriting and we can reuse old file.
91
- if (!lastHash && (await fs_extra_1.default.pathExists(filepath))) {
92
- const lastContent = await fs_extra_1.default.readFile(filepath, 'utf8');
93
- lastHash = (0, crypto_1.createHash)('md5').update(lastContent).digest('hex');
94
- fileHash.set(filepath, lastHash);
95
- }
96
- const currentHash = (0, crypto_1.createHash)('md5').update(content).digest('hex');
97
- if (lastHash !== currentHash) {
98
- await fs_extra_1.default.ensureDir(path_1.default.dirname(filepath));
99
- await fs_extra_1.default.writeFile(filepath, content);
100
- fileHash.set(filepath, currentHash);
101
- }
102
- }
103
- exports.generate = generate;
104
- const indexRE = /(?<dirname>^|.*\/)index\.(?:mdx?|jsx?|tsx?)$/i;
105
- const extRE = /\.(?:mdx?|jsx?|tsx?)$/;
106
- /**
107
- * Convert filepath to url path.
108
- * Example: 'index.md' -> '/', 'foo/bar.js' -> '/foo/bar',
109
- */
110
- function fileToPath(file) {
111
- if (indexRE.test(file)) {
112
- return file.replace(indexRE, '/$1');
113
- }
114
- return `/${file.replace(extRE, '').replace(/\\/g, '/')}`;
115
- }
116
- exports.fileToPath = fileToPath;
117
- function encodePath(userPath) {
118
- return userPath
119
- .split('/')
120
- .map((item) => encodeURIComponent(item))
121
- .join('/');
122
- }
123
- exports.encodePath = encodePath;
124
- const chunkNameCache = new Map();
125
- /**
126
- * Generate unique chunk name given a module path.
127
- */
128
- function genChunkName(modulePath, prefix, preferredName, shortId = process.env.NODE_ENV === 'production') {
129
- let chunkName = chunkNameCache.get(modulePath);
130
- if (!chunkName) {
131
- if (shortId) {
132
- chunkName = (0, hashUtils_1.simpleHash)(modulePath, 8);
133
- }
134
- else {
135
- let str = modulePath;
136
- if (preferredName) {
137
- const shortHash = (0, hashUtils_1.simpleHash)(modulePath, 3);
138
- str = `${preferredName}${shortHash}`;
139
- }
140
- const name = str === '/' ? 'index' : (0, hashUtils_1.docuHash)(str);
141
- chunkName = prefix ? `${prefix}---${name}` : name;
142
- }
143
- chunkNameCache.set(modulePath, chunkName);
144
- }
145
- return chunkName;
146
- }
147
- exports.genChunkName = genChunkName;
148
- function isValidPathname(str) {
149
- if (!str.startsWith('/')) {
150
- return false;
151
- }
152
- try {
153
- // weird, but is there a better way?
154
- const parsedPathname = new url_1.URL(str, 'https://domain.com').pathname;
155
- return parsedPathname === str || parsedPathname === encodeURI(str);
156
- }
157
- catch {
158
- return false;
159
- }
160
- }
161
- exports.isValidPathname = isValidPathname;
162
- // resolve pathname and fail fast if resolution fails
163
- function resolvePathname(to, from) {
164
- return (0, resolve_pathname_1.default)(to, from);
165
- }
166
- exports.resolvePathname = resolvePathname;
167
- function addLeadingSlash(str) {
168
- return str.startsWith('/') ? str : `/${str}`;
169
- }
170
- exports.addLeadingSlash = addLeadingSlash;
171
- function addTrailingPathSeparator(str) {
172
- return str.endsWith(path_1.default.sep)
173
- ? str
174
- : // If this is Windows, we need to change the forward slash to backward
175
- `${str.replace(/\/$/, '')}${path_1.default.sep}`;
176
- }
177
- exports.addTrailingPathSeparator = addTrailingPathSeparator;
178
- // TODO deduplicate: also present in @docusaurus/utils-common
179
- function addTrailingSlash(str) {
180
- return str.endsWith('/') ? str : `${str}/`;
181
- }
182
- exports.addTrailingSlash = addTrailingSlash;
183
- function removeTrailingSlash(str) {
184
- return removeSuffix(str, '/');
185
- }
186
- exports.removeTrailingSlash = removeTrailingSlash;
187
- function removeSuffix(str, suffix) {
188
- if (suffix === '') {
189
- return str; // always returns "" otherwise!
190
- }
191
- return str.endsWith(suffix) ? str.slice(0, -suffix.length) : str;
192
- }
193
- exports.removeSuffix = removeSuffix;
194
- function removePrefix(str, prefix) {
195
- return str.startsWith(prefix) ? str.slice(prefix.length) : str;
196
- }
197
- exports.removePrefix = removePrefix;
198
- function getElementsAround(array, aroundIndex) {
199
- const min = 0;
200
- const max = array.length - 1;
201
- if (aroundIndex < min || aroundIndex > max) {
202
- throw new Error(`Valid "aroundIndex" for array (of size ${array.length}) are between ${min} and ${max}, but you provided ${aroundIndex}.`);
203
- }
204
- const previous = aroundIndex === min ? undefined : array[aroundIndex - 1];
205
- const next = aroundIndex === max ? undefined : array[aroundIndex + 1];
206
- return { previous, next };
207
- }
208
- exports.getElementsAround = getElementsAround;
209
- function getPluginI18nPath({ siteDir, locale, pluginName, pluginId = constants_1.DEFAULT_PLUGIN_ID, subPaths = [], }) {
210
- return path_1.default.join(siteDir, 'i18n',
211
- // namespace first by locale: convenient to work in a single folder for a
212
- // translator
213
- locale,
214
- // Make it convenient to use for single-instance
215
- // ie: return "docs", not "docs-default" nor "docs/default"
216
- `${pluginName}${pluginId === constants_1.DEFAULT_PLUGIN_ID ? '' : `-${pluginId}`}`, ...subPaths);
217
- }
218
- exports.getPluginI18nPath = getPluginI18nPath;
219
- /**
220
- * @param permalink The URL that the HTML file corresponds to, without base URL
221
- * @param outDir Full path to the output directory
222
- * @param trailingSlash The site config option. If provided, only one path will
223
- * be read.
224
- * @returns This returns a buffer, which you have to decode string yourself if
225
- * needed. (Not always necessary since the output isn't for human consumption
226
- * anyways, and most HTML manipulation libs accept buffers)
227
- */
228
- async function readOutputHTMLFile(permalink, outDir, trailingSlash) {
229
- const withTrailingSlashPath = path_1.default.join(outDir, permalink, 'index.html');
230
- const withoutTrailingSlashPath = path_1.default.join(outDir, `${permalink.replace(/\/$/, '')}.html`);
231
- if (trailingSlash) {
232
- return fs_extra_1.default.readFile(withTrailingSlashPath);
233
- }
234
- else if (trailingSlash === false) {
235
- return fs_extra_1.default.readFile(withoutTrailingSlashPath);
236
- }
237
- const HTMLPath = await findAsyncSequential([withTrailingSlashPath, withoutTrailingSlashPath], fs_extra_1.default.pathExists);
238
- if (!HTMLPath) {
239
- throw new Error(`Expected output HTML file to be found at ${withTrailingSlashPath}`);
240
- }
241
- return fs_extra_1.default.readFile(HTMLPath);
242
- }
243
- exports.readOutputHTMLFile = readOutputHTMLFile;
244
- async function mapAsyncSequential(array, action) {
245
- const results = [];
246
- for (const t of array) {
247
- const result = await action(t);
248
- results.push(result);
249
- }
250
- return results;
251
- }
252
- exports.mapAsyncSequential = mapAsyncSequential;
253
- async function findAsyncSequential(array, predicate) {
254
- for (const t of array) {
255
- if (await predicate(t)) {
256
- return t;
257
- }
258
- }
259
- return undefined;
260
- }
261
- exports.findAsyncSequential = findAsyncSequential;
262
- function reportMessage(message, reportingSeverity) {
263
- switch (reportingSeverity) {
264
- case 'ignore':
265
- break;
266
- case 'log':
267
- logger_1.default.info(message);
268
- break;
269
- case 'warn':
270
- logger_1.default.warn(message);
271
- break;
272
- case 'error':
273
- logger_1.default.error(message);
274
- break;
275
- case 'throw':
276
- throw new Error(message);
277
- default:
278
- throw new Error(`Unexpected "reportingSeverity" value: ${reportingSeverity}.`);
279
- }
280
- }
281
- exports.reportMessage = reportMessage;
282
- function mergeTranslations(contents) {
283
- return contents.reduce((acc, content) => ({ ...acc, ...content }), {});
284
- }
285
- exports.mergeTranslations = mergeTranslations;
286
- // Useful to update all the messages of a translation file
287
- // Used in tests to simulate translations
288
- function updateTranslationFileMessages(translationFile, updateMessage) {
289
- return {
290
- ...translationFile,
291
- content: lodash_1.default.mapValues(translationFile.content, (translation) => ({
292
- ...translation,
293
- message: updateMessage(translation.message),
294
- })),
295
- };
296
- }
297
- exports.updateTranslationFileMessages = updateTranslationFileMessages;
298
98
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;AAEH,6EAAwC;AACxC,6DAAwB;AACxB,mCAAkC;AAClC,iEAAuB;AACvB,qEAA0B;AAC1B,6BAAwB;AAOxB,qFAAqD;AAErD,2CAAiD;AACjD,2CAA8C;AAE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CAA2E;AAAhC,wGAAA,aAAa,OAAA;AACxD,yCAQqB;AAPnB,0GAAA,aAAa,OAAA;AACb,sGAAA,SAAS,OAAA;AACT,sGAAA,SAAS,OAAA;AACT,sHAAA,yBAAyB,OAAA;AACzB,4GAAA,eAAe,OAAA;AACf,uGAAA,UAAU,OAAA;AACV,qHAAA,wBAAwB,OAAA;AAE1B,yCAA0D;AAAlD,oGAAA,OAAO,OAAA;AAAE,uGAAA,UAAU,OAAA;AAAE,qGAAA,QAAQ,OAAA;AACrC,yCAKqB;AAJnB,mGAAA,MAAM,OAAA;AACN,+GAAA,kBAAkB,OAAA;AAClB,0GAAA,aAAa,OAAA;AACb,0HAAA,6BAA6B,OAAA;AAE/B,+CAAkD;AAA1C,kHAAA,kBAAkB,OAAA;AAC1B,iDAMyB;AALvB,gHAAA,eAAe,OAAA;AACf,gHAAA,eAAe,OAAA;AACf,mHAAA,kBAAkB,OAAA;AAClB,yHAAA,wBAAwB,OAAA;AACxB,wHAAA,uBAAuB,OAAA"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import type { ReportingSeverity } from '@docusaurus/types';
8
+ /** Removes a given string suffix from `str`. */
9
+ export declare function removeSuffix(str: string, suffix: string): string;
10
+ /** Removes a given string prefix from `str`. */
11
+ export declare function removePrefix(str: string, prefix: string): string;
12
+ /**
13
+ * `Array#map` for async operations where order matters.
14
+ * @param array The array to traverse.
15
+ * @param action An async action to be performed on every array item. Will be
16
+ * awaited before working on the next.
17
+ * @returns The list of results returned from every `action(item)`
18
+ */
19
+ export declare function mapAsyncSequential<T, R>(array: T[], action: (t: T) => Promise<R>): Promise<R[]>;
20
+ /**
21
+ * `Array#find` for async operations where order matters.
22
+ * @param array The array to traverse.
23
+ * @param predicate An async predicate to be called on every array item. Should
24
+ * return a boolean indicating whether the currently element should be returned.
25
+ * @returns The function immediately returns the first item on which `predicate`
26
+ * returns `true`, or `undefined` if none matches the predicate.
27
+ */
28
+ export declare function findAsyncSequential<T>(array: T[], predicate: (t: T) => Promise<boolean>): Promise<T | undefined>;
29
+ /**
30
+ * Takes a message and reports it according to the severity that the user wants.
31
+ *
32
+ * - `ignore`: completely no-op
33
+ * - `log`: uses the `INFO` log level
34
+ * - `warn`: uses the `WARN` log level
35
+ * - `error`: uses the `ERROR` log level
36
+ * - `throw`: aborts the process, throws the error.
37
+ *
38
+ * Since the logger doesn't have logging level filters yet, these severities
39
+ * mostly just differ by their colors.
40
+ *
41
+ * @throws In addition to throwing when `reportingSeverity === "throw"`, this
42
+ * function also throws if `reportingSeverity` is not one of the above.
43
+ */
44
+ export declare function reportMessage(message: string, reportingSeverity: ReportingSeverity): void;
45
+ //# sourceMappingURL=jsUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsUtils.d.ts","sourceRoot":"","sources":["../src/jsUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAGzD,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED,gDAAgD;AAChD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAEhE;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAC3C,KAAK,EAAE,CAAC,EAAE,EACV,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,GAC3B,OAAO,CAAC,CAAC,EAAE,CAAC,CAOd;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,CAAC,EACzC,KAAK,EAAE,CAAC,EAAE,EACV,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,GACpC,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAOxB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAoBN"}
package/lib/jsUtils.js ADDED
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Facebook, Inc. and its affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.reportMessage = exports.findAsyncSequential = exports.mapAsyncSequential = exports.removePrefix = exports.removeSuffix = void 0;
10
+ const tslib_1 = require("tslib");
11
+ const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
12
+ /** Removes a given string suffix from `str`. */
13
+ function removeSuffix(str, suffix) {
14
+ if (suffix === '') {
15
+ // str.slice(0, 0) is ""
16
+ return str;
17
+ }
18
+ return str.endsWith(suffix) ? str.slice(0, -suffix.length) : str;
19
+ }
20
+ exports.removeSuffix = removeSuffix;
21
+ /** Removes a given string prefix from `str`. */
22
+ function removePrefix(str, prefix) {
23
+ return str.startsWith(prefix) ? str.slice(prefix.length) : str;
24
+ }
25
+ exports.removePrefix = removePrefix;
26
+ /**
27
+ * `Array#map` for async operations where order matters.
28
+ * @param array The array to traverse.
29
+ * @param action An async action to be performed on every array item. Will be
30
+ * awaited before working on the next.
31
+ * @returns The list of results returned from every `action(item)`
32
+ */
33
+ async function mapAsyncSequential(array, action) {
34
+ const results = [];
35
+ for (const t of array) {
36
+ const result = await action(t);
37
+ results.push(result);
38
+ }
39
+ return results;
40
+ }
41
+ exports.mapAsyncSequential = mapAsyncSequential;
42
+ /**
43
+ * `Array#find` for async operations where order matters.
44
+ * @param array The array to traverse.
45
+ * @param predicate An async predicate to be called on every array item. Should
46
+ * return a boolean indicating whether the currently element should be returned.
47
+ * @returns The function immediately returns the first item on which `predicate`
48
+ * returns `true`, or `undefined` if none matches the predicate.
49
+ */
50
+ async function findAsyncSequential(array, predicate) {
51
+ for (const t of array) {
52
+ if (await predicate(t)) {
53
+ return t;
54
+ }
55
+ }
56
+ return undefined;
57
+ }
58
+ exports.findAsyncSequential = findAsyncSequential;
59
+ /**
60
+ * Takes a message and reports it according to the severity that the user wants.
61
+ *
62
+ * - `ignore`: completely no-op
63
+ * - `log`: uses the `INFO` log level
64
+ * - `warn`: uses the `WARN` log level
65
+ * - `error`: uses the `ERROR` log level
66
+ * - `throw`: aborts the process, throws the error.
67
+ *
68
+ * Since the logger doesn't have logging level filters yet, these severities
69
+ * mostly just differ by their colors.
70
+ *
71
+ * @throws In addition to throwing when `reportingSeverity === "throw"`, this
72
+ * function also throws if `reportingSeverity` is not one of the above.
73
+ */
74
+ function reportMessage(message, reportingSeverity) {
75
+ switch (reportingSeverity) {
76
+ case 'ignore':
77
+ break;
78
+ case 'log':
79
+ logger_1.default.info(message);
80
+ break;
81
+ case 'warn':
82
+ logger_1.default.warn(message);
83
+ break;
84
+ case 'error':
85
+ logger_1.default.error(message);
86
+ break;
87
+ case 'throw':
88
+ throw new Error(message);
89
+ default:
90
+ throw new Error(`Unexpected "reportingSeverity" value: ${reportingSeverity}.`);
91
+ }
92
+ }
93
+ exports.reportMessage = reportMessage;
94
+ //# sourceMappingURL=jsUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsUtils.js","sourceRoot":"","sources":["../src/jsUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAGH,wEAAwC;AAExC,gDAAgD;AAChD,SAAgB,YAAY,CAAC,GAAW,EAAE,MAAc;IACtD,IAAI,MAAM,KAAK,EAAE,EAAE;QACjB,wBAAwB;QACxB,OAAO,GAAG,CAAC;KACZ;IACD,OAAO,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CA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AAM;QACR,KAAK,OAAO;YACV,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3B;YACE,MAAM,IAAI,KAAK,CACb,yCAAyC,iBAAiB,GAAG,CAC9D,CAAC;KACL;AACH,CAAC;AAvBD,sCAuBC"}
@@ -4,25 +4,68 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
+ /**
8
+ * Content plugins have a base path and a localized path to source content from.
9
+ * We will look into the localized path in priority.
10
+ */
7
11
  export declare type ContentPaths = {
12
+ /**
13
+ * The absolute path to the base content directory, like `"<siteDir>/docs"`.
14
+ */
8
15
  contentPath: string;
16
+ /**
17
+ * The absolute path to the localized content directory, like
18
+ * `"<siteDir>/i18n/zh-Hans/plugin-content-docs"`.
19
+ */
9
20
  contentPathLocalized: string;
10
21
  };
22
+ /** Data structure representing each broken Markdown link to be reported. */
11
23
  export declare type BrokenMarkdownLink<T extends ContentPaths> = {
24
+ /** Absolute path to the file containing this link. */
12
25
  filePath: string;
26
+ /**
27
+ * This is generic because it may contain extra metadata like version name,
28
+ * which the reporter can provide for context.
29
+ */
13
30
  contentPaths: T;
31
+ /**
32
+ * The content of the link, like `"./brokenFile.md"`
33
+ */
14
34
  link: string;
15
35
  };
16
- export declare type ReplaceMarkdownLinksParams<T extends ContentPaths> = {
36
+ /**
37
+ * Takes a Markdown file and replaces relative file references with their URL
38
+ * counterparts, e.g. `[link](./intro.md)` => `[link](/docs/intro)`, preserving
39
+ * everything else.
40
+ *
41
+ * This method uses best effort to find a matching file. The file reference can
42
+ * be relative to the directory of the current file (most likely) or any of the
43
+ * content paths (so `/tutorials/intro.md` can be resolved as
44
+ * `<siteDir>/docs/tutorials/intro.md`). Links that contain the `http(s):` or
45
+ * `@site/` prefix will always be ignored.
46
+ */
47
+ export declare function replaceMarkdownLinks<T extends ContentPaths>({ siteDir, fileString, filePath, contentPaths, sourceToPermalink, }: {
48
+ /** Absolute path to the site directory, used to resolve aliased paths. */
17
49
  siteDir: string;
50
+ /** The Markdown file content to be processed. */
18
51
  fileString: string;
52
+ /** Absolute path to the current file containing `fileString`. */
19
53
  filePath: string;
54
+ /** The content paths which the file reference may live in. */
20
55
  contentPaths: T;
21
- sourceToPermalink: Record<string, string>;
22
- };
23
- export declare type ReplaceMarkdownLinksReturn<T extends ContentPaths> = {
56
+ /**
57
+ * A map from source paths to their URLs. Source paths are `@site` aliased.
58
+ */
59
+ sourceToPermalink: {
60
+ [aliasedPath: string]: string;
61
+ };
62
+ }): {
63
+ /**
64
+ * The content with all Markdown file references replaced with their URLs.
65
+ * Unresolved links are left as-is.
66
+ */
24
67
  newContent: string;
68
+ /** The list of broken links, */
25
69
  brokenMarkdownLinks: BrokenMarkdownLink<T>[];
26
70
  };
27
- export declare function replaceMarkdownLinks<T extends ContentPaths>({ siteDir, fileString, filePath, contentPaths, sourceToPermalink, }: ReplaceMarkdownLinksParams<T>): ReplaceMarkdownLinksReturn<T>;
28
71
  //# sourceMappingURL=markdownLinks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"markdownLinks.d.ts","sourceRoot":"","sources":["../src/markdownLinks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,oBAAY,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,oBAAY,kBAAkB,CAAC,CAAC,SAAS,YAAY,IAAI;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,0BAA0B,CAAC,CAAC,SAAS,YAAY,IAAI;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,CAAC,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,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