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
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ Add to the MCP servers config (`claude_desktop_config.json`, `.cursor/mcp.json`,

## Configuration

| Flag | Env | Default | Description |
| -------------------- | ------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `--framework <list>` | `COREUI_DOCS_FRAMEWORKS` | `bootstrap,react,vue` | Enabled editions (comma-separated). `angular` is available but off by default. The first is the default for tools. |
| `--base-url <url>` | `COREUI_DOCS_BASE_URL` | `https://coreui.io` | Origin of the CoreUI site. Override for a staging or self-hosted mirror. |
| `--base-path <tmpl>` | `COREUI_DOCS_BASE_PATH` | `/{framework}/docs` | Path (after the origin) where a framework's docs live; `{framework}` is substituted. Set to e.g. `/data-grid/{framework}/docs`. |
| `--docs-path <map>` | `COREUI_DOCS_PATHS` | — | Per-framework path overrides, `fw=path` comma-separated. Wins over `--base-path`; use it where a slug breaks the template. |
| `--ttl <minutes>` | `COREUI_DOCS_TTL_MINUTES` | `360` | Cache freshness window. |
| — | `COREUI_DOCS_CACHE_DIR` | OS cache dir | On-disk cache location. |
| Flag | Env | Default | Description |
| -------------------- | ------------------------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| `--framework <list>` | `COREUI_DOCS_FRAMEWORKS` | `angular,bootstrap,react,vue` | Enabled editions (comma-separated). The first is the default for tools. |
| `--base-url <url>` | `COREUI_DOCS_BASE_URL` | `https://coreui.io` | Origin of the CoreUI site. Override for a staging or self-hosted mirror. |
| `--base-path <tmpl>` | `COREUI_DOCS_BASE_PATH` | `/{framework}/docs` | Path (after the origin) where a framework's docs live; `{framework}` is substituted. Set to e.g. `/data-grid/{framework}/docs`. |
| `--docs-path <map>` | `COREUI_DOCS_PATHS` | — | Per-framework path overrides, `fw=path` comma-separated. Wins over `--base-path`; use it where a slug breaks the template. |
| `--ttl <minutes>` | `COREUI_DOCS_TTL_MINUTES` | `360` | Cache freshness window. |
| — | `COREUI_DOCS_CACHE_DIR` | OS cache dir | On-disk cache location. |

### CoreUI Data Grid

Expand Down
7 changes: 3 additions & 4 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import { join } from 'node:path'
export const FRAMEWORKS = ['bootstrap', 'react', 'vue', 'angular'] as const
export type Framework = (typeof FRAMEWORKS)[number]

// Enabled by default when `--framework` is omitted. Angular is allowed (so a
// standalone product like Data Grid can opt into it) but stays out of the default
// set, which mirrors the main component-library docs currently on the engine.
export const DEFAULT_FRAMEWORKS: readonly Framework[] = ['bootstrap', 'react', 'vue']
// Enabled by default when `--framework` is omitted — every edition whose docs serve
// the Markdown and llms endpoints this reads.
export const DEFAULT_FRAMEWORKS: readonly Framework[] = ['angular', 'bootstrap', 'react', 'vue']

// Path (after the origin) where a framework's docs live, with `{framework}`
// substituted. The main library uses `/<framework>/docs`; a standalone product
Expand Down
6 changes: 3 additions & 3 deletions test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { describe, expect, it } from 'vitest'
import { docsBase, docsPath, loadConfig } from '../src/config.js'

describe('loadConfig frameworks', () => {
it('defaults to bootstrap, react, vue (angular excluded)', () => {
it('defaults to every edition', () => {
const config = loadConfig([], {} as NodeJS.ProcessEnv)
expect(config.frameworks).toEqual(['bootstrap', 'react', 'vue'])
expect(config.frameworks).toEqual(['angular', 'bootstrap', 'react', 'vue'])
})

it('allows angular when requested explicitly', () => {
it('narrows to the requested editions', () => {
const config = loadConfig(['--framework', 'angular,react'], {} as NodeJS.ProcessEnv)
expect(config.frameworks).toEqual(['angular', 'react'])
})
Expand Down
Loading