Skip to content

Commit

Permalink
chore: update Docusaurus to 3.5.2 and migrate to `@docusaurus/tsconfi…
Browse files Browse the repository at this point in the history
…g` (#484)
  • Loading branch information
Doc94 authored Sep 30, 2024
1 parent cbaffaa commit 59f4c97
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 217 deletions.
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
"format:check": "prettier . --check"
},
"dependencies": {
"@docusaurus/core": "3.5.1",
"@docusaurus/plugin-content-docs": "3.5.1",
"@docusaurus/plugin-content-pages": "3.5.1",
"@docusaurus/plugin-debug": "3.5.1",
"@docusaurus/plugin-pwa": "3.5.1",
"@docusaurus/plugin-sitemap": "3.5.1",
"@docusaurus/theme-classic": "3.5.1",
"@docusaurus/theme-common": "3.5.1",
"@docusaurus/theme-mermaid": "3.5.1",
"@docusaurus/theme-search-algolia": "3.5.1",
"@docusaurus/core": "3.5.2",
"@docusaurus/plugin-content-docs": "3.5.2",
"@docusaurus/plugin-content-pages": "3.5.2",
"@docusaurus/plugin-debug": "3.5.2",
"@docusaurus/plugin-pwa": "3.5.2",
"@docusaurus/plugin-sitemap": "3.5.2",
"@docusaurus/theme-classic": "3.5.2",
"@docusaurus/theme-common": "3.5.2",
"@docusaurus/theme-mermaid": "3.5.2",
"@docusaurus/theme-search-algolia": "3.5.2",
"@floating-ui/react": "^0.26.16",
"@fontsource/jetbrains-mono": "5.0.20",
"@iconify/react": "5.0.1",
Expand All @@ -40,10 +40,10 @@
"react-markdown": "8.0.7"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.5.1",
"@docusaurus/types": "3.5.1",
"@docusaurus/module-type-aliases": "3.5.2",
"@docusaurus/types": "3.5.2",
"@docusaurus/tsconfig": "3.5.2",
"@fec/remark-a11y-emoji": "4.0.2",
"@tsconfig/docusaurus": "2.0.3",
"@types/is-ci": "3.0.4",
"@types/js-yaml": "^4.0.9",
"@types/node": "20.14.2",
Expand Down Expand Up @@ -73,8 +73,8 @@
"packageManager": "[email protected]+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b",
"pnpm": {
"patchedDependencies": {
"@docusaurus/[email protected].1": "patches/@[email protected].1.patch",
"@docusaurus/[email protected].1": "patches/@[email protected].1.patch"
"@docusaurus/[email protected].2": "patches/@[email protected].2.patch",
"@docusaurus/[email protected].2": "patches/@[email protected].2.patch"
}
}
}
6 changes: 3 additions & 3 deletions [email protected][email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/lib/client/docsSearch.js b/lib/client/docsSearch.js
index fb1fb547238f704c3f27b4cc40af1e55766702df..2543ba879f86fa967b123b8ba55deb8186ac7fc9 100755
index fb1fb547238f704c3f27b4cc40af1e55766702df..2543ba879f86fa967b123b8ba55deb8186ac7fc9 100644
--- a/lib/client/docsSearch.js
+++ b/lib/client/docsSearch.js
@@ -35,5 +35,5 @@ export function useDocsContextualSearchTags() {
Expand All @@ -10,7 +10,7 @@ index fb1fb547238f704c3f27b4cc40af1e55766702df..2543ba879f86fa967b123b8ba55deb81
+ return [...(activePluginAndVersion ? [activePluginAndVersion.activePlugin.pluginId] : Object.keys(allDocsData)).map(getDocPluginTags)];
}
diff --git a/lib/constants.js b/lib/constants.js
index f91e43f00e1f9160afa6a34ed1df71c90fe45a28..db04a015ea2d4474339b1d02f6fbec75ba14c894 100755
index f91e43f00e1f9160afa6a34ed1df71c90fe45a28..db04a015ea2d4474339b1d02f6fbec75ba14c894 100644
--- a/lib/constants.js
+++ b/lib/constants.js
@@ -10,8 +10,8 @@ exports.VERSIONS_JSON_FILE = exports.VERSIONED_SIDEBARS_DIR = exports.VERSIONED_
Expand All @@ -26,7 +26,7 @@ index f91e43f00e1f9160afa6a34ed1df71c90fe45a28..db04a015ea2d4474339b1d02f6fbec75
-exports.VERSIONS_JSON_FILE = 'versions.json';
+exports.VERSIONED_BASE_DIR = 'docs/versioned';
diff --git a/lib/versions/files.js b/lib/versions/files.js
index f63cbb295242437ca8b417d3c32e228e370944e9..396b08c66bec0e4b8b455d32171196fcdd71aa1f 100755
index f63cbb295242437ca8b417d3c32e228e370944e9..396b08c66bec0e4b8b455d32171196fcdd71aa1f 100644
--- a/lib/versions/files.js
+++ b/lib/versions/files.js
@@ -19,19 +19,19 @@ const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
Expand Down
16 changes: 8 additions & 8 deletions patches/@[email protected] → patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/gitUtils.ts b/src/gitUtils.ts
index 39a3ad754a0c5ab27cfb78c7b44a9f0be3785a62..c3116d7a725d4a5420286baac8147f4e821e5631 100755
index 39a3ad754a0c5ab27cfb78c7b44a9f0be3785a62..c3116d7a725d4a5420286baac8147f4e821e5631 100644
--- a/src/gitUtils.ts
+++ b/src/gitUtils.ts
@@ -95,6 +95,13 @@ export async function getFileCommitDate(
Expand All @@ -21,12 +21,12 @@ index 39a3ad754a0c5ab27cfb78c7b44a9f0be3785a62..c3116d7a725d4a5420286baac8147f4e
);
}
+}

+function createArgs(format: string, includeAuthor?: boolean, age: 'oldest' | 'newest' = 'oldest') {
// We add a "RESULT:" prefix to make parsing easier
// See why: https://github.com/facebook/docusaurus/pull/10022
const resultFormat = includeAuthor ? 'RESULT:%ct,%an' : 'RESULT:%ct';

const args = [
- `--format=${resultFormat}`,
+ `--format=${includeAuthor === undefined ? format : resultFormat}`,
Expand All @@ -35,7 +35,7 @@ index 39a3ad754a0c5ab27cfb78c7b44a9f0be3785a62..c3116d7a725d4a5420286baac8147f4e
]
.filter(Boolean)
.join(' ');

+ return args;
+}
+async function runGitCommandOnFile(file: string, args: string): Promise<{
Expand All @@ -49,7 +49,7 @@ index 39a3ad754a0c5ab27cfb78c7b44a9f0be3785a62..c3116d7a725d4a5420286baac8147f4e
@@ -147,12 +163,18 @@ export async function getFileCommitDate(
);
}

+ return result;
+}
+function retrieveCorrectRegex(includeAuthor: boolean) {
Expand All @@ -58,17 +58,17 @@ index 39a3ad754a0c5ab27cfb78c7b44a9f0be3785a62..c3116d7a725d4a5420286baac8147f4e
const regex = includeAuthor
? /(?:^|\n)RESULT:(?<timestamp>\d+),(?<author>.+)(?:$|\n)/
: /(?:^|\n)RESULT:(?<timestamp>\d+)(?:$|\n)/;

+ return regex;
+}
+function matchFromRegex(file: string, regex: RegExp, result: { code: number; stdout: string; stderr: string; }): RegExpMatchArray {
const output = result.stdout.trim();

if (!output) {
@@ -169,6 +191,13 @@ export async function getFileCommitDate(
);
}

+ return match;
+}
+function matchDateAndTimestamp(match: RegExpMatchArray, includeAuthor: boolean): {
Expand Down
Loading

0 comments on commit 59f4c97

Please sign in to comment.