Move VCS code in dedicated subfolder

This commit is contained in:
sebastien 2025-10-31 13:05:08 +01:00
parent 9443d5f6c0
commit 7e6a4e062b
6 changed files with 11 additions and 8 deletions

View File

@ -562,8 +562,9 @@ describe('blog plugin', () => {
const noDateSource = path.posix.join('@site', PluginPath, 'no date.md');
const noDateSourceFile = path.posix.join(siteDir, PluginPath, 'no date.md');
// We know the file exists and we know we have git
const result = await getFileCommitDate(noDateSourceFile, {age: 'oldest'});
const noDateSourceTime = result.date;
const noDateSourceTime = (
await getFileCommitDate(noDateSourceFile, {age: 'oldest'})
).date;
expect({
...getByTitle(blogPosts, 'no date').metadata,

View File

@ -25,10 +25,12 @@ export {
} from './constants';
export {generate, readOutputHTMLFile} from './emitUtils';
export {
// TODO Docusaurus v4: remove these legacy exports,
// they are only kept for retro-compatibility
getFileCommitDate,
FileNotTrackedError,
GitNotFoundError,
} from './gitUtils';
} from './vcs/gitUtils';
export {
mergeTranslations,
updateTranslationFileMessages,
@ -129,6 +131,6 @@ export {
type FrontMatterLastUpdate,
} from './lastUpdateUtils';
export {DEFAULT_VCS_CONFIG} from './vcsUtils';
export {DEFAULT_VCS_CONFIG} from './vcs/vcsUtils';
export {normalizeTags, reportInlineTags} from './tags';

View File

@ -11,8 +11,8 @@ import {
FileNotTrackedError,
GitNotFoundError,
getFileCommitDate,
} from './gitUtils';
import {DEFAULT_VCS_CONFIG} from './vcsUtils';
} from './vcs/gitUtils';
import {DEFAULT_VCS_CONFIG} from './vcs/vcsUtils';
import type {PluginOptions, VcsConfig} from '@docusaurus/types';
export type LastUpdateData = {

View File

@ -9,7 +9,7 @@ import fs from 'fs-extra';
import path from 'path';
import {createTempRepo} from '@testing-utils/git';
import {FileNotTrackedError, getFileCommitDate} from '../gitUtils';
import {getGitLastUpdate} from '../lastUpdateUtils';
import {getGitLastUpdate} from '../../lastUpdateUtils';
/* eslint-disable no-restricted-properties */
function initializeTempRepo() {

View File

@ -10,7 +10,7 @@ import {
getFileCommitDate,
GitNotFoundError,
} from './gitUtils';
import {getLastUpdate} from './lastUpdateUtils';
import {getLastUpdate} from '../lastUpdateUtils';
import type {VcsConfig} from '@docusaurus/types';
export const DEFAULT_VCS_CONFIG: VcsConfig = {