@docusaurus/plugin-content-docs 3.8.1-canary-6360 → 3.8.1-canary-6361

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/index.js CHANGED
@@ -29,6 +29,11 @@ const loadVersion_1 = require("./versions/loadVersion");
29
29
  // Problem documented here: https://github.com/facebook/docusaurus/pull/10934
30
30
  // TODO this is not a perfect solution, find better?
31
31
  async function createMdxLoaderDependencyFile({ dataDir, options, versionsMetadata, }) {
32
+ // Disabled for unit tests, the side effect produces infinite watch loops
33
+ // TODO find a better way :/
34
+ if (process.env.NODE_ENV === 'test') {
35
+ return undefined;
36
+ }
32
37
  const filePath = path_1.default.join(dataDir, '__mdx-loader-dependency.json');
33
38
  // the cache is invalidated whenever this file content changes
34
39
  const fileContent = {
@@ -18,6 +18,12 @@ const sidebars_1 = require("../sidebars");
18
18
  const utils_2 = require("../sidebars/utils");
19
19
  function ensureNoDuplicateDocId(docs) {
20
20
  const duplicatesById = lodash_1.default.chain(docs)
21
+ .sort((d1, d2) => {
22
+ // Need to sort because Globby order is non-deterministic
23
+ // TODO maybe we should create a deterministic glob utils?
24
+ // see https://github.com/sindresorhus/globby/issues/131
25
+ return d1.source.localeCompare(d2.source);
26
+ })
21
27
  .groupBy((d) => d.id)
22
28
  .pickBy((group) => group.length > 1)
23
29
  .value();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-docs",
3
- "version": "3.8.1-canary-6360",
3
+ "version": "3.8.1-canary-6361",
4
4
  "description": "Docs plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "sideEffects": false,
@@ -35,15 +35,15 @@
35
35
  },
36
36
  "license": "MIT",
37
37
  "dependencies": {
38
- "@docusaurus/core": "3.8.1-canary-6360",
39
- "@docusaurus/logger": "3.8.1-canary-6360",
40
- "@docusaurus/mdx-loader": "3.8.1-canary-6360",
41
- "@docusaurus/module-type-aliases": "3.8.1-canary-6360",
42
- "@docusaurus/theme-common": "3.8.1-canary-6360",
43
- "@docusaurus/types": "3.8.1-canary-6360",
44
- "@docusaurus/utils": "3.8.1-canary-6360",
45
- "@docusaurus/utils-common": "3.8.1-canary-6360",
46
- "@docusaurus/utils-validation": "3.8.1-canary-6360",
38
+ "@docusaurus/core": "3.8.1-canary-6361",
39
+ "@docusaurus/logger": "3.8.1-canary-6361",
40
+ "@docusaurus/mdx-loader": "3.8.1-canary-6361",
41
+ "@docusaurus/module-type-aliases": "3.8.1-canary-6361",
42
+ "@docusaurus/theme-common": "3.8.1-canary-6361",
43
+ "@docusaurus/types": "3.8.1-canary-6361",
44
+ "@docusaurus/utils": "3.8.1-canary-6361",
45
+ "@docusaurus/utils-common": "3.8.1-canary-6361",
46
+ "@docusaurus/utils-validation": "3.8.1-canary-6361",
47
47
  "@types/react-router-config": "^5.0.7",
48
48
  "combine-promises": "^1.1.0",
49
49
  "fs-extra": "^11.1.1",
@@ -67,5 +67,5 @@
67
67
  "engines": {
68
68
  "node": ">=18.0"
69
69
  },
70
- "gitHead": "39d2663556664be19f2a18c24ceae1e532ab58df"
70
+ "gitHead": "184f214bf6cf8502921c316289df34500fb9ebb7"
71
71
  }
package/src/index.ts CHANGED
@@ -62,6 +62,12 @@ async function createMdxLoaderDependencyFile({
62
62
  options: PluginOptions;
63
63
  versionsMetadata: VersionMetadata[];
64
64
  }): Promise<string | undefined> {
65
+ // Disabled for unit tests, the side effect produces infinite watch loops
66
+ // TODO find a better way :/
67
+ if (process.env.NODE_ENV === 'test') {
68
+ return undefined;
69
+ }
70
+
65
71
  const filePath = path.join(dataDir, '__mdx-loader-dependency.json');
66
72
  // the cache is invalidated whenever this file content changes
67
73
  const fileContent = {
@@ -38,6 +38,12 @@ type LoadVersionParams = {
38
38
 
39
39
  function ensureNoDuplicateDocId(docs: DocMetadataBase[]): void {
40
40
  const duplicatesById = _.chain(docs)
41
+ .sort((d1, d2) => {
42
+ // Need to sort because Globby order is non-deterministic
43
+ // TODO maybe we should create a deterministic glob utils?
44
+ // see https://github.com/sindresorhus/globby/issues/131
45
+ return d1.source.localeCompare(d2.source);
46
+ })
41
47
  .groupBy((d) => d.id)
42
48
  .pickBy((group) => group.length > 1)
43
49
  .value();