mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-10 14:10:37 -07:00
refactor(cli): categorize built-in themes into dark/ and light/ directories (#18634)
This commit is contained in:
@@ -20,8 +20,8 @@ import {
|
||||
type AdminControlsSettings,
|
||||
} from '@google/gemini-cli-core';
|
||||
import stripJsonComments from 'strip-json-comments';
|
||||
import { DefaultLight } from '../ui/themes/default-light.js';
|
||||
import { DefaultDark } from '../ui/themes/default.js';
|
||||
import { DefaultLight } from '../ui/themes/builtin/light/default-light.js';
|
||||
import { DefaultDark } from '../ui/themes/builtin/dark/default-dark.js';
|
||||
import { isWorkspaceTrusted } from './trustedFolders.js';
|
||||
import {
|
||||
type Settings,
|
||||
|
||||
@@ -50,7 +50,7 @@ import { AppContext, type AppState } from '../ui/contexts/AppContext.js';
|
||||
import { createMockSettings } from './settings.js';
|
||||
import { SessionStatsProvider } from '../ui/contexts/SessionContext.js';
|
||||
import { themeManager, DEFAULT_THEME } from '../ui/themes/theme-manager.js';
|
||||
import { DefaultLight } from '../ui/themes/default-light.js';
|
||||
import { DefaultLight } from '../ui/themes/builtin/light/default-light.js';
|
||||
import { pickDefaultThemeName } from '../ui/themes/theme.js';
|
||||
import { generateSvgForTerminal } from './svg.js';
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ vi.mock('../themes/theme-manager.js', () => ({
|
||||
DEFAULT_THEME: { name: 'Default' },
|
||||
}));
|
||||
|
||||
vi.mock('../themes/holiday.js', () => ({
|
||||
vi.mock('../themes/builtin/dark/holiday-dark.js', () => ({
|
||||
Holiday: { name: 'Holiday' },
|
||||
}));
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useState, useEffect, useMemo } from 'react';
|
||||
import { getAsciiArtWidth } from '../utils/textUtils.js';
|
||||
import { debugState } from '../debug.js';
|
||||
import { themeManager } from '../themes/theme-manager.js';
|
||||
import { Holiday } from '../themes/holiday.js';
|
||||
import { Holiday } from '../themes/builtin/dark/holiday-dark.js';
|
||||
import { useUIState } from '../contexts/UIStateContext.js';
|
||||
import { useTerminalSize } from './useTerminalSize.js';
|
||||
import { shortAsciiLogo } from '../components/AsciiArt.js';
|
||||
|
||||
@@ -65,7 +65,7 @@ vi.mock('../themes/theme-manager.js', async (importOriginal) => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('../themes/default-light.js', () => ({
|
||||
vi.mock('../themes/builtin/light/default-light.js', () => ({
|
||||
DefaultLight: { name: 'default-light' },
|
||||
}));
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
shouldSwitchTheme,
|
||||
} from '../themes/color-utils.js';
|
||||
import { themeManager, DEFAULT_THEME } from '../themes/theme-manager.js';
|
||||
import { DefaultLight } from '../themes/default-light.js';
|
||||
import { DefaultLight } from '../themes/builtin/light/default-light.js';
|
||||
import { useSettings } from '../contexts/SettingsContext.js';
|
||||
import type { Config } from '@google/gemini-cli-core';
|
||||
import { useTerminalContext } from '../contexts/TerminalContext.js';
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { darkSemanticColors } from './semantic-tokens.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { darkSemanticColors } from '../../semantic-tokens.js';
|
||||
|
||||
const ansiColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const atomOneDarkColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const ayuDarkColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { darkTheme, Theme } from './theme.js';
|
||||
import { darkTheme, Theme } from '../../theme.js';
|
||||
|
||||
export const DefaultDark: Theme = new Theme(
|
||||
'Default',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const draculaColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const githubDarkColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const holidayColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* Shades of Purple Theme — for Highlight.js.
|
||||
* @author Ahmad Awais <https://twitter.com/mrahmadawais/>
|
||||
*/
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const shadesOfPurpleColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme, interpolateColor } from './theme.js';
|
||||
import { type SemanticColors } from './semantic-tokens.js';
|
||||
import { DEFAULT_SELECTION_OPACITY } from '../constants.js';
|
||||
import { type ColorsTheme, Theme, interpolateColor } from '../../theme.js';
|
||||
import { type SemanticColors } from '../../semantic-tokens.js';
|
||||
import { DEFAULT_SELECTION_OPACITY } from '../../../constants.js';
|
||||
|
||||
const solarizedDarkColors: ColorsTheme = {
|
||||
type: 'dark',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { lightSemanticColors } from './semantic-tokens.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { lightSemanticColors } from '../../semantic-tokens.js';
|
||||
|
||||
const ansiLightColors: ColorsTheme = {
|
||||
type: 'light',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const ayuLightColors: ColorsTheme = {
|
||||
type: 'light',
|
||||
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { lightTheme, Theme } from './theme.js';
|
||||
import { lightTheme, Theme } from '../../theme.js';
|
||||
|
||||
export const DefaultLight: Theme = new Theme(
|
||||
'Default Light',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const githubLightColors: ColorsTheme = {
|
||||
type: 'light',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme, lightTheme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme, lightTheme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const googleCodeColors: ColorsTheme = {
|
||||
type: 'light',
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme, interpolateColor } from './theme.js';
|
||||
import { type SemanticColors } from './semantic-tokens.js';
|
||||
import { DEFAULT_SELECTION_OPACITY } from '../constants.js';
|
||||
import { type ColorsTheme, Theme, interpolateColor } from '../../theme.js';
|
||||
import { type SemanticColors } from '../../semantic-tokens.js';
|
||||
import { DEFAULT_SELECTION_OPACITY } from '../../../constants.js';
|
||||
|
||||
const solarizedLightColors: ColorsTheme = {
|
||||
type: 'light',
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { type ColorsTheme, Theme } from './theme.js';
|
||||
import { interpolateColor } from './color-utils.js';
|
||||
import { type ColorsTheme, Theme } from '../../theme.js';
|
||||
import { interpolateColor } from '../../color-utils.js';
|
||||
|
||||
const xcodeColors: ColorsTheme = {
|
||||
type: 'light',
|
||||
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import type { ColorsTheme } from './theme.js';
|
||||
import { Theme } from './theme.js';
|
||||
import type { SemanticColors } from './semantic-tokens.js';
|
||||
import type { ColorsTheme } from '../theme.js';
|
||||
import { Theme } from '../theme.js';
|
||||
import type { SemanticColors } from '../semantic-tokens.js';
|
||||
|
||||
const noColorColorsTheme: ColorsTheme = {
|
||||
type: 'ansi',
|
||||
@@ -1,23 +1,23 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* Copyright 2026 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { AyuDark } from './ayu.js';
|
||||
import { AyuLight } from './ayu-light.js';
|
||||
import { AtomOneDark } from './atom-one-dark.js';
|
||||
import { Dracula } from './dracula.js';
|
||||
import { GitHubDark } from './github-dark.js';
|
||||
import { GitHubLight } from './github-light.js';
|
||||
import { GoogleCode } from './googlecode.js';
|
||||
import { Holiday } from './holiday.js';
|
||||
import { DefaultLight } from './default-light.js';
|
||||
import { DefaultDark } from './default.js';
|
||||
import { ShadesOfPurple } from './shades-of-purple.js';
|
||||
import { SolarizedDark } from './solarized-dark.js';
|
||||
import { SolarizedLight } from './solarized-light.js';
|
||||
import { XCode } from './xcode.js';
|
||||
import { AyuDark } from './builtin/dark/ayu-dark.js';
|
||||
import { AyuLight } from './builtin/light/ayu-light.js';
|
||||
import { AtomOneDark } from './builtin/dark/atom-one-dark.js';
|
||||
import { Dracula } from './builtin/dark/dracula-dark.js';
|
||||
import { GitHubDark } from './builtin/dark/github-dark.js';
|
||||
import { GitHubLight } from './builtin/light/github-light.js';
|
||||
import { GoogleCode } from './builtin/light/googlecode-light.js';
|
||||
import { Holiday } from './builtin/dark/holiday-dark.js';
|
||||
import { DefaultLight } from './builtin/light/default-light.js';
|
||||
import { DefaultDark } from './builtin/dark/default-dark.js';
|
||||
import { ShadesOfPurple } from './builtin/dark/shades-of-purple-dark.js';
|
||||
import { SolarizedDark } from './builtin/dark/solarized-dark.js';
|
||||
import { SolarizedLight } from './builtin/light/solarized-light.js';
|
||||
import { XCode } from './builtin/light/xcode-light.js';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import type { Theme, ThemeType, ColorsTheme } from './theme.js';
|
||||
@@ -36,9 +36,9 @@ import {
|
||||
DEFAULT_SELECTION_OPACITY,
|
||||
DEFAULT_BORDER_OPACITY,
|
||||
} from '../constants.js';
|
||||
import { ANSI } from './ansi.js';
|
||||
import { ANSILight } from './ansi-light.js';
|
||||
import { NoColorTheme } from './no-color.js';
|
||||
import { ANSI } from './builtin/dark/ansi-dark.js';
|
||||
import { ANSILight } from './builtin/light/ansi-light.js';
|
||||
import { NoColorTheme } from './builtin/no-color.js';
|
||||
import process from 'node:process';
|
||||
import { debugLogger, homedir } from '@google/gemini-cli-core';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user