@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
@@ -4,9 +4,37 @@
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
+ /** A re-export of the globby instance. */
7
8
  export { default as Globby } from 'globby';
9
+ /**
10
+ * The default glob patterns we ignore when sourcing content.
11
+ * - Ignore files and folders starting with `_` recursively
12
+ * - Ignore tests
13
+ */
8
14
  export declare const GlobExcludeDefault: string[];
9
15
  declare type Matcher = (str: string) => boolean;
16
+ /**
17
+ * A very thin wrapper around `Micromatch.makeRe`.
18
+ *
19
+ * @see {@link createAbsoluteFilePathMatcher}
20
+ * @param patterns A list of glob patterns. If the list is empty, it defaults to
21
+ * matching none.
22
+ * @returns A matcher handle that tells if a file path is matched by any of the
23
+ * patterns.
24
+ */
10
25
  export declare function createMatcher(patterns: string[]): Matcher;
26
+ /**
27
+ * We use match patterns like `"** /_* /**"` (ignore the spaces), where `"_*"`
28
+ * should only be matched within a subfolder. This function would:
29
+ * - Match `/user/sebastien/website/docs/_partials/xyz.md`
30
+ * - Ignore `/user/_sebastien/website/docs/partials/xyz.md`
31
+ *
32
+ * @param patterns A list of glob patterns.
33
+ * @param rootFolders A list of root folders to resolve the glob from.
34
+ * @returns A matcher handle that tells if a file path is matched by any of the
35
+ * patterns, resolved from the first root folder that contains the path.
36
+ * @throws Throws when the returned matcher receives a path that doesn't belong
37
+ * to any of the `rootFolders`.
38
+ */
11
39
  export declare function createAbsoluteFilePathMatcher(patterns: string[], rootFolders: string[]): Matcher;
12
40
  //# sourceMappingURL=globUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"globUtils.d.ts","sourceRoot":"","sources":["../src/globUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,QAAQ,CAAC;AAIzC,eAAO,MAAM,kBAAkB,UAU9B,CAAC;AAEF,aAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAExC,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAKzD;AAMD,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAmBT"}
1
+ {"version":3,"file":"globUtils.d.ts","sourceRoot":"","sources":["../src/globUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,0CAA0C;AAC1C,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,QAAQ,CAAC;AAEzC;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,UAK9B,CAAC;AAEF,aAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;AAExC;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CASzD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,EAAE,MAAM,EAAE,GACpB,OAAO,CAmBT"}
package/lib/globUtils.js CHANGED
@@ -9,36 +9,59 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.createAbsoluteFilePathMatcher = exports.createMatcher = exports.GlobExcludeDefault = exports.Globby = void 0;
10
10
  const tslib_1 = require("tslib");
11
11
  // Globby/Micromatch are the 2 libs we use in Docusaurus consistently
12
- const micromatch_1 = (0, tslib_1.__importDefault)(require("micromatch")); // Note: Micromatch is used by Globby
13
- const path_1 = (0, tslib_1.__importDefault)(require("path"));
12
+ const micromatch_1 = tslib_1.__importDefault(require("micromatch")); // Note: Micromatch is used by Globby
13
+ const path_1 = tslib_1.__importDefault(require("path"));
14
+ /** A re-export of the globby instance. */
14
15
  var globby_1 = require("globby");
15
- Object.defineProperty(exports, "Globby", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(globby_1).default; } });
16
- // The default patterns we ignore when globbing
17
- // using _ prefix for exclusion by convention
16
+ Object.defineProperty(exports, "Globby", { enumerable: true, get: function () { return tslib_1.__importDefault(globby_1).default; } });
17
+ /**
18
+ * The default glob patterns we ignore when sourcing content.
19
+ * - Ignore files and folders starting with `_` recursively
20
+ * - Ignore tests
21
+ */
18
22
  exports.GlobExcludeDefault = [
19
- // Ignore files starting with _
20
23
  '**/_*.{js,jsx,ts,tsx,md,mdx}',
21
- // Ignore folders starting with _ (including folder content)
22
24
  '**/_*/**',
23
- // Ignore tests
24
25
  '**/*.test.{js,jsx,ts,tsx}',
25
26
  '**/__tests__/**',
26
27
  ];
28
+ /**
29
+ * A very thin wrapper around `Micromatch.makeRe`.
30
+ *
31
+ * @see {@link createAbsoluteFilePathMatcher}
32
+ * @param patterns A list of glob patterns. If the list is empty, it defaults to
33
+ * matching none.
34
+ * @returns A matcher handle that tells if a file path is matched by any of the
35
+ * patterns.
36
+ */
27
37
  function createMatcher(patterns) {
38
+ if (patterns.length === 0) {
39
+ // `/(?:)/.test("foo")` is `true`
40
+ return () => false;
41
+ }
28
42
  const regexp = new RegExp(patterns.map((pattern) => micromatch_1.default.makeRe(pattern).source).join('|'));
29
43
  return (str) => regexp.test(str);
30
44
  }
31
45
  exports.createMatcher = createMatcher;
32
- // We use match patterns like '**/_*/**',
33
- // This function permits to help to:
34
- // Match /user/sebastien/website/docs/_partials/xyz.md
35
- // Ignore /user/_sebastien/website/docs/partials/xyz.md
46
+ /**
47
+ * We use match patterns like `"** /_* /**"` (ignore the spaces), where `"_*"`
48
+ * should only be matched within a subfolder. This function would:
49
+ * - Match `/user/sebastien/website/docs/_partials/xyz.md`
50
+ * - Ignore `/user/_sebastien/website/docs/partials/xyz.md`
51
+ *
52
+ * @param patterns A list of glob patterns.
53
+ * @param rootFolders A list of root folders to resolve the glob from.
54
+ * @returns A matcher handle that tells if a file path is matched by any of the
55
+ * patterns, resolved from the first root folder that contains the path.
56
+ * @throws Throws when the returned matcher receives a path that doesn't belong
57
+ * to any of the `rootFolders`.
58
+ */
36
59
  function createAbsoluteFilePathMatcher(patterns, rootFolders) {
37
60
  const matcher = createMatcher(patterns);
38
61
  function getRelativeFilePath(absoluteFilePath) {
39
62
  const rootFolder = rootFolders.find((folderPath) => absoluteFilePath.startsWith(folderPath));
40
63
  if (!rootFolder) {
41
- throw new Error(`createAbsoluteFilePathMatcher unexpected error, absoluteFilePath=${absoluteFilePath} was not contained in any of the root folders ${JSON.stringify(rootFolders)}`);
64
+ throw new Error(`createAbsoluteFilePathMatcher unexpected error, absoluteFilePath=${absoluteFilePath} was not contained in any of the root folders: ${rootFolders.join(', ')}`);
42
65
  }
43
66
  return path_1.default.relative(rootFolder, absoluteFilePath);
44
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"globUtils.js","sourceRoot":"","sources":["../src/globUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,qEAAqE;AAErE,yEAAoC,CAAC,qCAAqC;AAC1E,6DAAwB;AAExB,iCAAyC;AAAjC,8HAAA,OAAO,OAAU;AAEzB,+CAA+C;AAC/C,6CAA6C;AAChC,QAAA,kBAAkB,GAAG;IAChC,+BAA+B;IAC/B,8BAA8B;IAE9B,4DAA4D;IAC5D,UAAU;IAEV,eAAe;IACf,2BAA2B;IAC3B,iBAAiB;CAClB,CAAC;AAIF,SAAgB,aAAa,CAAC,QAAkB;IAC9C,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;AALD,sCAKC;AAED,yCAAyC;AACzC,oCAAoC;AACpC,sDAAsD;AACtD,uDAAuD;AACvD,SAAgB,6BAA6B,CAC3C,QAAkB,EAClB,WAAqB;IAEr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CAAC;IACF,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AATD,sCASC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,6BAA6B,CAC3C,QAAkB,EAClB,WAAqB;IAErB,MAAM,OAAO,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IAExC,SAAS,mBAAmB,CAAC,gBAAwB;QACnD,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CACjD,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,CACxC,CAAC;QACF,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CACb,oEAAoE,gBAAgB,kDAAkD,WAAW,CAAC,IAAI,CACpJ,IAAI,CACL,EAAE,CACJ,CAAC;SACH;QACD,OAAO,cAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACrD,CAAC;IAED,OAAO,CAAC,gBAAwB,EAAE,EAAE,CAClC,OAAO,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACnD,CAAC;AAtBD,sEAsBC"}
@@ -4,13 +4,14 @@
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
+ /** Thin wrapper around `crypto.createHash("md5")`. */
7
8
  export declare function md5Hash(str: string): string;
9
+ /** Creates an MD5 hash and truncates it to the given length. */
8
10
  export declare function simpleHash(str: string, length: number): string;
9
11
  /**
10
- * Given an input string, convert to kebab-case and append a hash.
11
- * Avoid str collision.
12
- * Also removes part of the string if its larger than the allowed
13
- * filename per OS. Avoids ERRNAMETOOLONG error.
12
+ * Given an input string, convert to kebab-case and append a hash, avoiding name
13
+ * collision. Also removes part of the string if its larger than the allowed
14
+ * filename per OS, avoiding `ERRNAMETOOLONG` error.
14
15
  */
15
16
  export declare function docuHash(str: string): string;
16
17
  //# sourceMappingURL=hashUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashUtils.d.ts","sourceRoot":"","sources":["../src/hashUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE9D;AAGD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAU5C"}
1
+ {"version":3,"file":"hashUtils.d.ts","sourceRoot":"","sources":["../src/hashUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,sDAAsD;AACtD,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3C;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE9D;AAGD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAU5C"}
package/lib/hashUtils.js CHANGED
@@ -9,22 +9,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.docuHash = exports.simpleHash = exports.md5Hash = void 0;
10
10
  const tslib_1 = require("tslib");
11
11
  const crypto_1 = require("crypto");
12
- const lodash_1 = (0, tslib_1.__importDefault)(require("lodash"));
12
+ const lodash_1 = tslib_1.__importDefault(require("lodash"));
13
13
  const pathUtils_1 = require("./pathUtils");
14
+ /** Thin wrapper around `crypto.createHash("md5")`. */
14
15
  function md5Hash(str) {
15
16
  return (0, crypto_1.createHash)('md5').update(str).digest('hex');
16
17
  }
17
18
  exports.md5Hash = md5Hash;
19
+ /** Creates an MD5 hash and truncates it to the given length. */
18
20
  function simpleHash(str, length) {
19
- return md5Hash(str).substr(0, length);
21
+ return md5Hash(str).substring(0, length);
20
22
  }
21
23
  exports.simpleHash = simpleHash;
22
24
  // Based on https://github.com/gatsbyjs/gatsby/pull/21518/files
23
25
  /**
24
- * Given an input string, convert to kebab-case and append a hash.
25
- * Avoid str collision.
26
- * Also removes part of the string if its larger than the allowed
27
- * filename per OS. Avoids ERRNAMETOOLONG error.
26
+ * Given an input string, convert to kebab-case and append a hash, avoiding name
27
+ * collision. Also removes part of the string if its larger than the allowed
28
+ * filename per OS, avoiding `ERRNAMETOOLONG` error.
28
29
  */
29
30
  function docuHash(str) {
30
31
  if (str === '/') {
@@ -1 +1 @@
1
- {"version":3,"file":"hashUtils.js","sourceRoot":"","sources":["../src/hashUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,mCAAkC;AAClC,iEAAuB;AACvB,2CAAqD;AAErD,SAAgB,OAAO,CAAC,GAAW;IACjC,OAAO,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC;AAFD,0BAEC;AAED,SAAgB,UAAU,CAAC,GAAW,EAAE,MAAc;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AAFD,gCAEC;AAED,+DAA+D;AAC/D;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,GAAW;IAClC,IAAI,GAAG,KAAK,GAAG,EAAE;QACf,OAAO,OAAO,CAAC;KAChB;IACD,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,GAAG,gBAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,CAAC;IACtD,IAAI,IAAA,yBAAa,EAAC,UAAU,CAAC,EAAE;QAC7B,OAAO,GAAG,IAAA,qBAAS,EAAC,gBAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC;KACtD;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAVD,4BAUC"}
1
+ {"version":3,"file":"hashUtils.js","sourceRoot":"","sources":["../src/hashUtils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,mCAAkC;AAClC,4DAAuB;AACvB,2CAAqD;AAErD,sDAAsD;AACtD,SAAgB,OAAO,CAAC,GAAW;IACjC,OAAO,IAAA,mBAAU,EAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC;AAFD,0BAEC;AAED,gEAAgE;AAChE,SAAgB,UAAU,CAAC,GAAW,EAAE,MAAc;IACpD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC;AAFD,gCAEC;AAED,+DAA+D;AAC/D;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,GAAW;IAClC,IAAI,GAAG,KAAK,GAAG,EAAE;QACf,OAAO,OAAO,CAAC;KAChB;IACD,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,GAAG,gBAAC,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,SAAS,EAAE,CAAC;IACtD,IAAI,IAAA,yBAAa,EAAC,UAAU,CAAC,EAAE;QAC7B,OAAO,GAAG,IAAA,qBAAS,EAAC,gBAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,SAAS,EAAE,CAAC;KACtD;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAVD,4BAUC"}
@@ -0,0 +1,51 @@
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 { TranslationFileContent, TranslationFile, I18n } from '@docusaurus/types';
8
+ /**
9
+ * Takes a list of translation file contents, and shallow-merges them into one.
10
+ */
11
+ export declare function mergeTranslations(contents: TranslationFileContent[]): TranslationFileContent;
12
+ /**
13
+ * Useful to update all the messages of a translation file. Used in tests to
14
+ * simulate translations.
15
+ */
16
+ export declare function updateTranslationFileMessages(translationFile: TranslationFile, updateMessage: (message: string) => string): TranslationFile;
17
+ /**
18
+ * Takes everything needed and constructs a plugin i18n path. Plugins should
19
+ * expect everything it needs for translations to be found under this path.
20
+ */
21
+ export declare function getPluginI18nPath({ siteDir, locale, pluginName, pluginId, subPaths, }: {
22
+ siteDir: string;
23
+ locale: string;
24
+ pluginName: string;
25
+ pluginId?: string | undefined;
26
+ subPaths?: string[];
27
+ }): string;
28
+ /**
29
+ * Takes a path and returns a localized a version (which is basically `path +
30
+ * i18n.currentLocale`).
31
+ */
32
+ export declare function localizePath({ pathType, path: originalPath, i18n, options, }: {
33
+ /**
34
+ * FS paths will treat Windows specially; URL paths will always have a
35
+ * trailing slash to make it a valid base URL.
36
+ */
37
+ pathType: 'fs' | 'url';
38
+ /** The path, URL or file path, to be localized. */
39
+ path: string;
40
+ /** The current i18n context. */
41
+ i18n: I18n;
42
+ options?: {
43
+ /**
44
+ * By default, we don't localize the path of defaultLocale. This option
45
+ * would override that behavior. Setting `false` is useful for `yarn build
46
+ * -l zh-Hans` to always emit into the root build directory.
47
+ */
48
+ localizePath?: boolean;
49
+ };
50
+ }): string;
51
+ //# sourceMappingURL=i18nUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18nUtils.d.ts","sourceRoot":"","sources":["../src/i18nUtils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,IAAI,EACL,MAAM,mBAAmB,CAAC;AAI3B;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,sBAAsB,EAAE,GACjC,sBAAsB,CAExB;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GACzC,eAAe,CAQjB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,MAAM,EACN,UAAU,EACV,QAA4B,EAC5B,QAAa,GACd,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB,GAAG,MAAM,CAYT;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,IAAI,EAAE,YAAY,EAClB,IAAI,EACJ,OAAY,GACb,EAAE;IACD;;;OAGG;IACH,QAAQ,EAAE,IAAI,GAAG,KAAK,CAAC;IACvB,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,CAAC,EAAE;QACR;;;;WAIG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;KACxB,CAAC;CACH,GAAG,MAAM,CAcT"}
@@ -0,0 +1,69 @@
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.localizePath = exports.getPluginI18nPath = exports.updateTranslationFileMessages = exports.mergeTranslations = void 0;
10
+ const tslib_1 = require("tslib");
11
+ const path_1 = tslib_1.__importDefault(require("path"));
12
+ const lodash_1 = tslib_1.__importDefault(require("lodash"));
13
+ const constants_1 = require("./constants");
14
+ const urlUtils_1 = require("./urlUtils");
15
+ /**
16
+ * Takes a list of translation file contents, and shallow-merges them into one.
17
+ */
18
+ function mergeTranslations(contents) {
19
+ return contents.reduce((acc, content) => ({ ...acc, ...content }), {});
20
+ }
21
+ exports.mergeTranslations = mergeTranslations;
22
+ /**
23
+ * Useful to update all the messages of a translation file. Used in tests to
24
+ * simulate translations.
25
+ */
26
+ function updateTranslationFileMessages(translationFile, updateMessage) {
27
+ return {
28
+ ...translationFile,
29
+ content: lodash_1.default.mapValues(translationFile.content, (translation) => ({
30
+ ...translation,
31
+ message: updateMessage(translation.message),
32
+ })),
33
+ };
34
+ }
35
+ exports.updateTranslationFileMessages = updateTranslationFileMessages;
36
+ /**
37
+ * Takes everything needed and constructs a plugin i18n path. Plugins should
38
+ * expect everything it needs for translations to be found under this path.
39
+ */
40
+ function getPluginI18nPath({ siteDir, locale, pluginName, pluginId = constants_1.DEFAULT_PLUGIN_ID, subPaths = [], }) {
41
+ return path_1.default.join(siteDir, constants_1.I18N_DIR_NAME,
42
+ // Namespace first by locale: convenient to work in a single folder for a
43
+ // translator
44
+ locale,
45
+ // Make it convenient to use for single-instance
46
+ // ie: return "docs", not "docs-default" nor "docs/default"
47
+ `${pluginName}${pluginId === constants_1.DEFAULT_PLUGIN_ID ? '' : `-${pluginId}`}`, ...subPaths);
48
+ }
49
+ exports.getPluginI18nPath = getPluginI18nPath;
50
+ /**
51
+ * Takes a path and returns a localized a version (which is basically `path +
52
+ * i18n.currentLocale`).
53
+ */
54
+ function localizePath({ pathType, path: originalPath, i18n, options = {}, }) {
55
+ const shouldLocalizePath =
56
+ //
57
+ options.localizePath ?? i18n.currentLocale !== i18n.defaultLocale;
58
+ if (!shouldLocalizePath) {
59
+ return originalPath;
60
+ }
61
+ // FS paths need special care, for Windows support
62
+ if (pathType === 'fs') {
63
+ return path_1.default.join(originalPath, i18n.currentLocale);
64
+ }
65
+ // Url paths; add a trailing slash so it's a valid base URL
66
+ return (0, urlUtils_1.normalizeUrl)([originalPath, i18n.currentLocale, '/']);
67
+ }
68
+ exports.localizePath = localizePath;
69
+ //# sourceMappingURL=i18nUtils.js.map
@@ -0,0 +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O,GAAG,EAAE,GAmBb;IACC,MAAM,kBAAkB;IACtB,EAAE;IACF,OAAO,CAAC,YAAY,IAAI,IAAI,CAAC,aAAa,KAAK,IAAI,CAAC,aAAa,CAAC;IAEpE,IAAI,CAAC,kBAAkB,EAAE;QACvB,OAAO,YAAY,CAAC;KACrB;IACD,kDAAkD;IAClD,IAAI,QAAQ,KAAK,IAAI,EAAE;QACrB,OAAO,cAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;KACpD;IACD,2DAA2D;IAC3D,OAAO,IAAA,uBAAY,EAAC,CAAC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,CAAC;AAC/D,CAAC;AArCD,oCAqCC"}
package/lib/index.d.ts CHANGED
@@ -4,63 +4,19 @@
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
- /// <reference types="node" />
8
- import type { ReportingSeverity, TranslationFileContent, TranslationFile } from '@docusaurus/types';
9
- export { NODE_MAJOR_VERSION, NODE_MINOR_VERSION, DEFAULT_BUILD_DIR_NAME, DEFAULT_CONFIG_FILE_NAME, BABEL_CONFIG_FILE_NAME, GENERATED_FILES_DIR_NAME, SRC_DIR_NAME, STATIC_DIR_NAME, OUTPUT_STATIC_ASSETS_DIR_NAME, THEME_PATH, DEFAULT_PORT, DEFAULT_PLUGIN_ID, WEBPACK_URL_LOADER_LIMIT, } from './constants';
10
- export { getFileCommitDate, GitNotFoundError } from './gitUtils';
11
- export { normalizeUrl, getEditUrl } from './urlUtils';
12
- export { type Tag, type FrontMatterTag, type TaggedItemGroup, normalizeFrontMatterTag, normalizeFrontMatterTags, groupTaggedItems, } from './tags';
13
- export { parseMarkdownHeadingId, createExcerpt, parseFrontMatter, parseMarkdownContentTitle, parseMarkdownString, } from './markdownParser';
14
- export { type ContentPaths, type BrokenMarkdownLink, type ReplaceMarkdownLinksParams, type ReplaceMarkdownLinksReturn, replaceMarkdownLinks, } from './markdownLinks';
7
+ export { NODE_MAJOR_VERSION, NODE_MINOR_VERSION, DOCUSAURUS_VERSION, DEFAULT_BUILD_DIR_NAME, DEFAULT_CONFIG_FILE_NAME, BABEL_CONFIG_FILE_NAME, GENERATED_FILES_DIR_NAME, SRC_DIR_NAME, DEFAULT_STATIC_DIR_NAME, OUTPUT_STATIC_ASSETS_DIR_NAME, THEME_PATH, I18N_DIR_NAME, CODE_TRANSLATIONS_FILE_NAME, DEFAULT_PORT, DEFAULT_PLUGIN_ID, WEBPACK_URL_LOADER_LIMIT, } from './constants';
8
+ export { generate, readOutputHTMLFile } from './emitUtils';
9
+ export { getFileCommitDate, FileNotTrackedError, GitNotFoundError, } from './gitUtils';
10
+ export { mergeTranslations, updateTranslationFileMessages, getPluginI18nPath, localizePath, } from './i18nUtils';
11
+ export { removeSuffix, removePrefix, mapAsyncSequential, findAsyncSequential, reportMessage, } from './jsUtils';
12
+ export { normalizeUrl, getEditUrl, fileToPath, encodePath, isValidPathname, resolvePathname, addLeadingSlash, addTrailingSlash, removeTrailingSlash, hasSSHProtocol, buildHttpsUrl, buildSshUrl, } from './urlUtils';
13
+ export { type Tag, type TagsListItem, type TagModule, type FrontMatterTag, normalizeFrontMatterTags, groupTaggedItems, } from './tags';
14
+ export { parseMarkdownHeadingId, createExcerpt, parseFrontMatter, parseMarkdownContentTitle, parseMarkdownString, writeMarkdownHeadingId, type WriteHeadingIDOptions, } from './markdownUtils';
15
+ export { type ContentPaths, type BrokenMarkdownLink, replaceMarkdownLinks, } from './markdownLinks';
15
16
  export { type SluggerOptions, type Slugger, createSlugger } from './slugger';
16
- export { isNameTooLong, shortName, posixPath, toMessageRelativeFilePath, aliasedSitePath, escapePath, } from './pathUtils';
17
+ export { isNameTooLong, shortName, posixPath, toMessageRelativeFilePath, aliasedSitePath, escapePath, addTrailingPathSeparator, } from './pathUtils';
17
18
  export { md5Hash, simpleHash, docuHash } from './hashUtils';
18
19
  export { Globby, GlobExcludeDefault, createMatcher, createAbsoluteFilePathMatcher, } from './globUtils';
19
20
  export { getFileLoaderUtils } from './webpackUtils';
20
21
  export { getDataFilePath, getDataFileData, getContentPathList, findFolderContainingFile, getFolderContainingFile, } from './dataFileUtils';
21
- export declare function generate(generatedFilesDir: string, file: string, content: string, skipCache?: boolean): Promise<void>;
22
- /**
23
- * Convert filepath to url path.
24
- * Example: 'index.md' -> '/', 'foo/bar.js' -> '/foo/bar',
25
- */
26
- export declare function fileToPath(file: string): string;
27
- export declare function encodePath(userPath: string): string;
28
- /**
29
- * Generate unique chunk name given a module path.
30
- */
31
- export declare function genChunkName(modulePath: string, prefix?: string, preferredName?: string, shortId?: boolean): string;
32
- export declare function isValidPathname(str: string): boolean;
33
- export declare function resolvePathname(to: string, from?: string): string;
34
- export declare function addLeadingSlash(str: string): string;
35
- export declare function addTrailingPathSeparator(str: string): string;
36
- export declare function addTrailingSlash(str: string): string;
37
- export declare function removeTrailingSlash(str: string): string;
38
- export declare function removeSuffix(str: string, suffix: string): string;
39
- export declare function removePrefix(str: string, prefix: string): string;
40
- export declare function getElementsAround<T>(array: T[], aroundIndex: number): {
41
- next: T | undefined;
42
- previous: T | undefined;
43
- };
44
- export declare function getPluginI18nPath({ siteDir, locale, pluginName, pluginId, subPaths, }: {
45
- siteDir: string;
46
- locale: string;
47
- pluginName: string;
48
- pluginId?: string | undefined;
49
- subPaths?: string[];
50
- }): string;
51
- /**
52
- * @param permalink The URL that the HTML file corresponds to, without base URL
53
- * @param outDir Full path to the output directory
54
- * @param trailingSlash The site config option. If provided, only one path will
55
- * be read.
56
- * @returns This returns a buffer, which you have to decode string yourself if
57
- * needed. (Not always necessary since the output isn't for human consumption
58
- * anyways, and most HTML manipulation libs accept buffers)
59
- */
60
- export declare function readOutputHTMLFile(permalink: string, outDir: string, trailingSlash: boolean | undefined): Promise<Buffer>;
61
- export declare function mapAsyncSequential<T, R>(array: T[], action: (t: T) => Promise<R>): Promise<R[]>;
62
- export declare function findAsyncSequential<T>(array: T[], predicate: (t: T) => Promise<boolean>): Promise<T | undefined>;
63
- export declare function reportMessage(message: string, reportingSeverity: ReportingSeverity): void;
64
- export declare function mergeTranslations(contents: TranslationFileContent[]): TranslationFileContent;
65
- export declare function updateTranslationFileMessages(translationFile: TranslationFile, updateMessage: (message: string) => string): TranslationFile;
66
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAQH,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,YAAY,EACZ,eAAe,EACf,6BAA6B,EAC7B,UAAU,EACV,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAE,UAAU,EAAC,MAAM,YAAY,CAAC;AACpD,OAAO,EACL,KAAK,GAAG,EACR,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,KAAK,cAAc,EAAE,KAAK,OAAO,EAAE,aAAa,EAAC,MAAM,WAAW,CAAC;AAC3E,OAAO,EACL,aAAa,E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CAAC,CAOxB;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,iBAAiB,EAAE,iBAAiB,GACnC,IAAI,CAoBN;AAED,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,sBAAsB,EAAE,GACjC,sBAAsB,CAExB;AAID,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GACzC,eAAe,CAQjB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,wBAAwB,EACxB,YAAY,EACZ,uBAAuB,EACvB,6BAA6B,EAC7B,UAAU,EACV,aAAa,EACb,2BAA2B,EAC3B,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAC,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC7B,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,GACd,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,UAAU,EACV,eAAe,EACf,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,WAAW,GACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,GAAG,EACR,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACn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