| 1234567891011121314151617181920212223242526 |
- /** Shell base styles stay independent from the dynamically loaded theme bundle. */
- import { readFileSync } from 'node:fs'
- import { fileURLToPath } from 'node:url'
- import { describe, expect, it } from 'vitest'
- const THEME_PACKAGE = '@deepseek-ai/dsh-client-ui-theme'
- const baseCss = readFileSync(fileURLToPath(new URL('../src/base.css', import.meta.url)), 'utf8')
- /**
- * Import specifiers of the sheet, in source order. Quote style and surrounding
- * whitespace are intentionally irrelevant; duplicate imports remain visible.
- * @param css - stylesheet text.
- * @returns import specifiers in declaration order.
- */
- function importOrder(css: string): string[] {
- return [...css.matchAll(/@import\s+['"]([^'"]+)['"]/g)].map(([, specifier = '']) => specifier)
- }
- const imports = importOrder(baseCss)
- describe('web shell base.css', () => {
- it('leaves theme styles to the dynamic ui-theme client entry', () => {
- expect(imports).toEqual([])
- expect(baseCss).not.toContain(THEME_PACKAGE)
- })
- })
|