Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/docusaurus/src/commands/__tests__/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {Command} from 'commander';
import {createCLIProgram} from '../cli';
import * as buildCommand from '../build/build';
import * as startCommand from '../start/start';
import * as serveCommand from '../serve';
import * as writeHeadingIdsCommand from '../writeHeadingIds';
import * as serveCommand from '../serve/serve';
import * as writeHeadingIdsCommand from '../writeHeadingIds/writeHeadingIds';

const ExitOverrideError = new Error('exitOverride');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
GENERATED_FILES_DIR_NAME,
} from '@docusaurus/utils';
import {pathExists, realpath} from '@docusaurus/fs';
import clearPath from './utils/clearPath';
import clearPath from '../utils/clearPath';

async function removePath(entry: {path: string; description: string}) {
if (!(await pathExists(entry.path))) {
Expand Down
17 changes: 10 additions & 7 deletions packages/docusaurus/src/commands/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ import {Command, Option} from 'commander';
import {DOCUSAURUS_VERSION} from '@docusaurus/utils';

import {build} from './build/build';
import {clear} from './clear';
import {deploy} from './deploy';
import {externalCommand} from './external';
import {serve} from './serve';
import {clear} from './clear/clear';
import {deploy} from './deploy/deploy';
import {externalCommand} from './external/external';
import {serve} from './serve/serve';
import {start} from './start/start';
import {swizzle} from './swizzle';
import {writeHeadingIds, HeadingIdSyntaxes} from './writeHeadingIds';
import {writeTranslations} from './writeTranslations';
import {swizzle} from './swizzle/swizzle';
import {
writeHeadingIds,
HeadingIdSyntaxes,
} from './writeHeadingIds/writeHeadingIds';
import {writeTranslations} from './writeTranslations/writeTranslations';

function concatLocaleOptions(locale: string, locales: string[] = []): string[] {
return locales.concat(locale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import logger from '@docusaurus/logger';
import {execa} from 'execa';
import {hasSSHProtocol, buildSshUrl, buildHttpsUrl} from '@docusaurus/utils';
import {fs, realpath} from '@docusaurus/fs';
import {loadContext, type LoadContextParams} from '../server/site';
import {build} from './build/build';
import {loadContext, type LoadContextParams} from '../../server/site';
import {build} from '../build/build';

export type DeployCLIOptions = Pick<LoadContextParams, 'config' | 'outDir'> & {
locale?: [string, ...string[]];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*/

import {realpath} from '@docusaurus/fs';
import {loadContext} from '../server/site';
import {initPlugins} from '../server/plugins/init';
import {loadContext} from '../../server/site';
import {initPlugins} from '../../server/plugins/init';
import type {Command} from 'commander';

export async function externalCommand({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import {DEFAULT_BUILD_DIR_NAME} from '@docusaurus/utils';
import serveHandler from 'serve-handler';
import {applyTrailingSlash} from '@docusaurus/utils-common';
import {realpath} from '@docusaurus/fs';
import openBrowser from './utils/openBrowser/openBrowser';
import {loadSiteConfig} from '../server/config';
import {build} from './build/build';
import {getHostPort, type HostPortOptions} from '../server/getHostPort';
import {listenToServer} from './utils/listenToServer';
import type {LoadContextParams} from '../server/site';
import openBrowser from '../utils/openBrowser/openBrowser';
import {loadSiteConfig} from '../../server/config';
import {build} from '../build/build';
import {getHostPort, type HostPortOptions} from '../../server/getHostPort';
import {listenToServer} from './listenToServer';
import type {LoadContextParams} from '../../server/site';

function redirect(res: http.ServerResponse, location: string) {
res.writeHead(302, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {tree} from 'tree-node-cli';
import {escapePath, posixPath} from '@docusaurus/utils';
import {glob} from '@docusaurus/glob';
import {ThemePath, createTempSiteDir, Components} from './testUtils';
import {swizzle} from '../index';
import {swizzle} from '../swizzle';

const FixtureThemeName = 'fixture-theme-name';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
} from '@docusaurus/utils';
import {safeGlob} from '@docusaurus/glob';
import {fs, realpath} from '@docusaurus/fs';
import {loadContext} from '../server/site';
import {initPlugins} from '../server/plugins/init';
import {loadContext} from '../../server/site';
import {initPlugins} from '../../server/plugins/init';
import type {LoadContext, MarkdownConfig} from '@docusaurus/types';

export const HeadingIdSyntaxes = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@
import path from 'node:path';
import {globTranslatableSourceFiles} from '@docusaurus/glob';
import {realpath} from '@docusaurus/fs';
import {loadContext, type LoadContextParams} from '../server/site';
import {initPlugins} from '../server/plugins/init';
import {loadContext, type LoadContextParams} from '../../server/site';
import {initPlugins} from '../../server/plugins/init';
import {
writePluginTranslations,
writeCodeTranslations,
type WriteTranslationsOptions,
loadPluginsDefaultCodeTranslationMessages,
applyDefaultCodeTranslations,
} from '../server/translations/translations';
import {extractSiteSourceCodeTranslations} from '../server/translations/translationsExtractor';
} from '../../server/translations/translations';
import {extractSiteSourceCodeTranslations} from '../../server/translations/translationsExtractor';
import type {InitializedPlugin} from '@docusaurus/types';

export type WriteTranslationsCLIOptions = Pick<
Expand Down
14 changes: 7 additions & 7 deletions packages/docusaurus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

export {runCLI} from './commands/cli';
export {build} from './commands/build/build';
export {clear} from './commands/clear';
export {deploy} from './commands/deploy';
export {externalCommand} from './commands/external';
export {serve} from './commands/serve';
export {clear} from './commands/clear/clear';
export {deploy} from './commands/deploy/deploy';
export {externalCommand} from './commands/external/external';
export {serve} from './commands/serve/serve';
export {start} from './commands/start/start';
export {swizzle} from './commands/swizzle';
export {writeHeadingIds} from './commands/writeHeadingIds';
export {writeTranslations} from './commands/writeTranslations';
export {swizzle} from './commands/swizzle/swizzle';
export {writeHeadingIds} from './commands/writeHeadingIds/writeHeadingIds';
export {writeTranslations} from './commands/writeTranslations/writeTranslations';
Loading