v1.0.0: extract theme from cl-tty.box to own cl-tty.theme package
The theme system (theme class, define-preset, load-preset, theme-color) was part of the bloated cl-tty.box package even though it had nothing to do with boxes, spans, or component rendering. It only used cl-tty.backend for the *theme-colors* hash table. Changes: - added defpackage :cl-tty.theme as the first block in theme.lisp (inline defpackage avoids ASDF dependency ordering issues with separate package files) - removed theme exports from cl-tty.box defpackage - theme tests now run in their own THEME-SUITE (16 tests) instead of part of BOX-SUITE - box suite drops from 64 to 48 tests (16 moved to theme suite) - updated ASDF, run-all-tests.lisp All 15 test suites pass at 100%.
This commit is contained in:
@@ -173,9 +173,6 @@ theme object is passed in from the application level. This separation
|
||||
means themes can be swapped without touching component instances.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/package.lisp
|
||||
;; Theme engine
|
||||
#:theme #:make-theme #:theme-mode
|
||||
#:theme-color #:load-preset #:define-preset
|
||||
;; Container components (merged from cl-tty.container)
|
||||
#:scroll-box #:make-scroll-box
|
||||
#:scroll-box-scroll-y #:scroll-box-scroll-x
|
||||
|
||||
@@ -43,6 +43,17 @@ and the backend's ~*theme-colors*~ for SGR resolution.
|
||||
- ~:default~ — gold/accent on dark blue-gray
|
||||
- ~:nord~ — cool blue nord palette
|
||||
|
||||
* Package definition
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/theme.lisp
|
||||
(defpackage :cl-tty.theme
|
||||
(:use :cl :cl-tty.backend)
|
||||
(:export
|
||||
#:theme #:make-theme #:theme-mode
|
||||
#:theme-color #:load-preset #:define-preset))
|
||||
(in-package :cl-tty.theme)
|
||||
#+END_SRC
|
||||
|
||||
* Tests
|
||||
|
||||
** Test header
|
||||
@@ -50,8 +61,18 @@ and the backend's ~*theme-colors*~ for SGR resolution.
|
||||
Package declaration and test suite registration.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/theme-tests.lisp
|
||||
(in-package :cl-tty-box-test)
|
||||
(in-suite box-suite)
|
||||
(defpackage :cl-tty-theme-test
|
||||
(:use :cl :cl-tty.theme :fiveam)
|
||||
(:export #:run-tests))
|
||||
(in-package :cl-tty-theme-test)
|
||||
|
||||
(def-suite theme-suite :description "Theme engine tests")
|
||||
(in-suite theme-suite)
|
||||
|
||||
(defun run-tests ()
|
||||
(let ((result (run 'theme-suite)))
|
||||
(fiveam:explain! result)
|
||||
(uiop:quit 0)))
|
||||
#+END_SRC
|
||||
|
||||
** Test: theme-create-default
|
||||
@@ -201,7 +222,7 @@ hash table). Using ~make-hash-table~ as the ~:initform~ ensures each
|
||||
instance gets its own table instead of sharing one.
|
||||
|
||||
#+BEGIN_SRC lisp :tangle ~/.local/share/cl-tty/src/components/theme.lisp
|
||||
(in-package :cl-tty.box)
|
||||
(in-package :cl-tty.theme)
|
||||
|
||||
(defclass theme ()
|
||||
((mode :initform :dark :initarg :mode :accessor theme-mode)
|
||||
|
||||
Reference in New Issue
Block a user