diff --git a/packages/types/config/cli.d.ts b/packages/types/config/cli.d.ts new file mode 100644 index 00000000..4195ef61 --- /dev/null +++ b/packages/types/config/cli.d.ts @@ -0,0 +1,14 @@ +/** + * NuxtConfigurationCli + * Documentation: https://nuxtjs.org/api/configuration-cli + */ + +import { Chalk } from 'chalk' + +type ChalkColor = + 'black' | 'george' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'blackBright' | 'gray' | 'grey' | 'redBright' | 'greenBright' | 'yellowBright' | 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright' | 'bgBlack' | 'bgRed' | 'bgGreen' | 'bgYellow' | 'bgBlue' | 'bgMagenta' | 'bgCyan' | 'bgWhite' | 'bgBlackBright' | 'bgGray' | 'bgGrey' | 'bgRedBright' | 'bgGreenBright' | 'bgYellowBright' | 'bgBlueBright' | 'bgMagentaBright' | 'bgCyanBright' | 'bgWhiteBright' + +export interface NuxtConfigurationCli { + badgeMessages: string[] + bannerColor: keyof Chalk & ChalkColor +} diff --git a/packages/types/config/index.d.ts b/packages/types/config/index.d.ts index 3cce2094..d954388a 100644 --- a/packages/types/config/index.d.ts +++ b/packages/types/config/index.d.ts @@ -1,5 +1,6 @@ import { Transition } from '../app' import { NuxtConfigurationBuild } from './build' +import { NuxtConfigurationCli } from './cli' import { NuxtConfigurationEnv } from './env' import { NuxtConfigurationFetch } from './fetch' import { NuxtConfigurationGenerate } from './generate' @@ -20,6 +21,7 @@ export interface Configuration extends Record { build?: NuxtConfigurationBuild buildDir?: string buildModules?: NuxtConfigurationModule[] + cli?: NuxtConfigurationCli css?: string[] dev?: boolean dir?: { [key in 'app' | 'assets' | 'layouts' | 'middleware' | 'pages' | 'static' | 'store']?: string } diff --git a/packages/typescript-build/lib/module.js b/packages/typescript-build/lib/module.js index 3de6d48e..a8f80469 100644 --- a/packages/typescript-build/lib/module.js +++ b/packages/typescript-build/lib/module.js @@ -14,6 +14,9 @@ function tsModule (_moduleOptions) { _moduleOptions ) + // Change color of CLI banner + this.options.cli.bannerColor = 'blue' + // Extend Builder to handle .ts/.tsx files as routes and watch them this.options.build.additionalExtensions = ['ts', 'tsx']