@docusaurus/plugin-content-blog 4.0.0-canary-6888 → 4.0.0-canary-6892

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/blogUtils.js CHANGED
@@ -17,7 +17,6 @@ exports.getBlogPostDate = getBlogPostDate;
17
17
  exports.generateBlogPosts = generateBlogPosts;
18
18
  exports.applyProcessBlogPosts = applyProcessBlogPosts;
19
19
  const tslib_1 = require("tslib");
20
- const promises_1 = tslib_1.__importDefault(require("node:fs/promises"));
21
20
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
22
21
  const lodash_1 = tslib_1.__importDefault(require("lodash"));
23
22
  const logger_1 = tslib_1.__importDefault(require("@docusaurus/logger"));
@@ -138,12 +137,12 @@ async function getBlogPostDate({ frontMatterDate, filenameDate, filePath, vcs, }
138
137
  }
139
138
  const result = await vcs.getFileCreationInfo(filePath);
140
139
  if (result == null) {
141
- return (await promises_1.default.stat(filePath)).birthtime;
140
+ return (await fs_1.fs.stat(filePath)).birthtime;
142
141
  }
143
142
  return new Date(result.timestamp);
144
143
  }
145
144
  async function parseBlogPostMarkdownFile({ filePath, parseFrontMatter, }) {
146
- const fileContent = await (0, fs_1.queueFileOperation)(() => promises_1.default.readFile(filePath, 'utf-8'));
145
+ const fileContent = await fs_1.fs.readFile(filePath, 'utf-8');
147
146
  try {
148
147
  const result = await (0, utils_1.parseMarkdownFile)({
149
148
  filePath,
package/lib/feed.js CHANGED
@@ -10,7 +10,6 @@ exports.createBlogFeedFiles = createBlogFeedFiles;
10
10
  exports.createFeedHtmlHeadTags = createFeedHtmlHeadTags;
11
11
  const tslib_1 = require("tslib");
12
12
  const node_path_1 = tslib_1.__importDefault(require("node:path"));
13
- const promises_1 = tslib_1.__importDefault(require("node:fs/promises"));
14
13
  const feed_1 = require("feed");
15
14
  const srcset_1 = require("srcset");
16
15
  const utils_1 = require("@docusaurus/utils");
@@ -137,8 +136,8 @@ async function generateXsltFiles({ xsltFilePath, generatePath, contentPaths, })
137
136
  });
138
137
  const xsltOutputPath = node_path_1.default.join(generatePath, node_path_1.default.basename(xsltAbsolutePath));
139
138
  const cssOutputPath = node_path_1.default.join(generatePath, node_path_1.default.basename(cssAbsolutePath));
140
- await promises_1.default.cp(xsltAbsolutePath, xsltOutputPath, { verbatimSymlinks: true });
141
- await promises_1.default.cp(cssAbsolutePath, cssOutputPath, { verbatimSymlinks: true });
139
+ await fs_1.fs.cp(xsltAbsolutePath, xsltOutputPath, { verbatimSymlinks: true });
140
+ await fs_1.fs.cp(cssAbsolutePath, cssOutputPath, { verbatimSymlinks: true });
142
141
  }
143
142
  // This modifies the XML feed content to add a relative href to the XSLT file
144
143
  // Good enough for now: we probably don't need a full XML parser just for that
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-content-blog",
3
- "version": "4.0.0-canary-6888",
3
+ "version": "4.0.0-canary-6892",
4
4
  "description": "Blog plugin for Docusaurus.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-content-blog.d.ts",
@@ -31,17 +31,17 @@
31
31
  },
32
32
  "license": "MIT",
33
33
  "dependencies": {
34
- "@docusaurus/core": "4.0.0-canary-6888",
35
- "@docusaurus/fs": "4.0.0-canary-6888",
36
- "@docusaurus/glob": "4.0.0-canary-6888",
37
- "@docusaurus/logger": "4.0.0-canary-6888",
38
- "@docusaurus/mdx-loader": "4.0.0-canary-6888",
39
- "@docusaurus/module-type-aliases": "4.0.0-canary-6888",
40
- "@docusaurus/theme-common": "4.0.0-canary-6888",
41
- "@docusaurus/types": "4.0.0-canary-6888",
42
- "@docusaurus/utils": "4.0.0-canary-6888",
43
- "@docusaurus/utils-common": "4.0.0-canary-6888",
44
- "@docusaurus/utils-validation": "4.0.0-canary-6888",
34
+ "@docusaurus/core": "4.0.0-canary-6892",
35
+ "@docusaurus/fs": "4.0.0-canary-6892",
36
+ "@docusaurus/glob": "4.0.0-canary-6892",
37
+ "@docusaurus/logger": "4.0.0-canary-6892",
38
+ "@docusaurus/mdx-loader": "4.0.0-canary-6892",
39
+ "@docusaurus/module-type-aliases": "4.0.0-canary-6892",
40
+ "@docusaurus/theme-common": "4.0.0-canary-6892",
41
+ "@docusaurus/types": "4.0.0-canary-6892",
42
+ "@docusaurus/utils": "4.0.0-canary-6892",
43
+ "@docusaurus/utils-common": "4.0.0-canary-6892",
44
+ "@docusaurus/utils-validation": "4.0.0-canary-6892",
45
45
  "cheerio": "^1.2.0",
46
46
  "combine-promises": "^1.2.0",
47
47
  "feed": "^6.0.0",
@@ -69,5 +69,5 @@
69
69
  "tree-node-cli": "^3.0.0",
70
70
  "unified": "^11.0.5"
71
71
  },
72
- "gitHead": "5019a662590dcb2722926890c1ade27194bc3b70"
72
+ "gitHead": "a28eee9700a9a7eab87344e7144546bfd0b57961"
73
73
  }
package/src/blogUtils.ts CHANGED
@@ -5,7 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import fs from 'node:fs/promises';
9
8
  import path from 'node:path';
10
9
  import _ from 'lodash';
11
10
  import logger from '@docusaurus/logger';
@@ -27,7 +26,7 @@ import {
27
26
  } from '@docusaurus/utils';
28
27
  import {glob} from '@docusaurus/glob';
29
28
 
30
- import {queueFileOperation, pathExists} from '@docusaurus/fs';
29
+ import {fs, pathExists} from '@docusaurus/fs';
31
30
  import {validateBlogPostFrontMatter} from './frontMatter';
32
31
  import {getBlogPostAuthors} from './authors';
33
32
  import {reportAuthorsProblems} from './authorsProblems';
@@ -234,9 +233,7 @@ async function parseBlogPostMarkdownFile({
234
233
  filePath: string;
235
234
  parseFrontMatter: ParseFrontMatter;
236
235
  }) {
237
- const fileContent = await queueFileOperation(() =>
238
- fs.readFile(filePath, 'utf-8'),
239
- );
236
+ const fileContent = await fs.readFile(filePath, 'utf-8');
240
237
  try {
241
238
  const result = await parseMarkdownFile({
242
239
  filePath,
package/src/feed.ts CHANGED
@@ -6,7 +6,6 @@
6
6
  */
7
7
 
8
8
  import path from 'node:path';
9
- import fs from 'node:fs/promises';
10
9
  import {Feed, type Author as FeedAuthor} from 'feed';
11
10
  import {parseSrcset, stringifySrcset} from 'srcset';
12
11
  import {
@@ -20,7 +19,7 @@ import {
20
19
  } from '@docusaurus/utils-common';
21
20
  import {load as cheerioLoad} from 'cheerio';
22
21
  import logger from '@docusaurus/logger';
23
- import {pathExists, outputFile} from '@docusaurus/fs';
22
+ import {fs, pathExists, outputFile} from '@docusaurus/fs';
24
23
  import type {BlogContentPaths} from './types';
25
24
  import type {DocusaurusConfig, HtmlTags, LoadContext} from '@docusaurus/types';
26
25
  import type {