Skip to content

Releases: tokens-studio/tokenscript-interpreter

v0.30.0

05 Mar 15:40

Choose a tag to compare

What's Changed

  • Fix: validate function call argument counts by @floscr in #118

Full Changelog: v0.29.1...v0.30.0

v0.29.1

05 Mar 13:28

Choose a tag to compare

Added

  • Public schema accessors on managers: FunctionsManager.getFunctionSchemas() and ColorManager.getColorSchemas() expose the registered specification maps, giving consumers access to metadata like descriptions.

What's Changed

  • feat: expose getFunctionSchemas() and getColorSchemas() on managers by @floscr in #116

Full Changelog: v0.29.0...v0.29.1

v0.29.0

26 Feb 19:04

Choose a tag to compare

Added

  • Opt-in type validation for resolveValue(): Pass type and validate: true to validate the resolved value against a registered token type spec, returning validation issues alongside the result. Useful for live preview validation without full CRUD overhead.

What's Changed

  • feat: add opt-in validation to resolveValue by @floscr in #115

Full Changelog: v0.28.0...v0.29.0

v0.28.0

26 Feb 14:57

Choose a tag to compare

Added

  • resolveValue() method on TokenResolver: Lightweight expression resolution against the warm cache without cloning or rebuilding the dependency graph. Intended for live preview scenarios (e.g. form inputs) where full CRUD overhead is unnecessary.

Changed

  • Graph-based cache seeding for CRUD operations: rebuildResolver() now uses the dependency graph to seed the reference cache for unaffected tokens, so only the changed token and its dependents are re-resolved from scratch. Improves performance for large token sets during incremental updates.

What's Changed

  • feat: resolveValue() and graph-based cache seeding by @floscr in #114

Full Changelog: v0.27.0...v0.28.0

v0.27.0

19 Feb 11:17

Choose a tag to compare

Added

  • Fault-tolerant parser for editor support: Inline-mode parser that gracefully handles incomplete expressions, enabling real-time syntax highlighting, autocomplete, and live preview
    • parseTolerantly() / tokenizeTolerantly() for partial input
    • Partial AST node types for incomplete references, strings, function calls, binary ops, unary ops, and parenthesized expressions
    • collectAllReferences() / hasPartialNodes() / walkAST() utilities
    • Trailing dot detection for property/method autocomplete triggers
  • Vue tolerant parser demo: Interactive example at examples/tolerant-parser-vue/ with syntax highlighting, reference extraction, and live color preview

Fixed

  • Lexer crash on empty string input
  • Lexer peek() returning undefined instead of null for out-of-bounds access
  • Upgraded vitest to v4 to resolve minimatch vulnerability

What's Changed

  • feat: Add fault tolerant parser by @floscr in #95

Full Changelog: v0.26.0...v0.27.0

v0.26.0

10 Feb 16:21

Choose a tag to compare

What's Changed

  • Fix: error on multiple decimal points by @floscr in #113

Full Changelog: v0.25.0...v0.26.0

v0.25.0

10 Feb 15:10

Choose a tag to compare

Added

  • Constants schema type: New "constants" schema type for registering named constants (e.g., CSS color names like red#FF0000). Constants with inline: true are injected into the symbol table and resolve as bare identifiers during token $value evaluation, without leaking into function/color/unit scripts. Multiple constants schemas merge, and Config.clone() isolates them. String values are parsed through the interpreter so "#FF0000" becomes a ColorSymbol, numbers stay as NumberSymbol, etc.

What's Changed

  • feat: add constants schema type for inline symbol injection by @floscr in #112

Full Changelog: v0.24.0...v0.25.0

v0.24.0

02 Feb 09:51

Choose a tag to compare

Added

  • Time units (s, ms): Support for seconds and milliseconds in expressions. Use 3s for 3 seconds, 500ms for 500 milliseconds. Arithmetic works as expected: 3s + 2s5s.

Fixed

  • sign() function returns Number: The sign() function now always returns a plain Number instead of preserving the input unit. This matches the mathematical behavior where sign indicates direction (-1, 0, 1), not a measurement.

What's Changed

  • refactor: Refactor math tests to use common helpers by @floscr in #109
  • fix: sign() function always returns Number symbol by @floscr in #110
  • fix: Fix s/ms unit parsing edge-case by @floscr in #111

Full Changelog: v0.23.1...v0.24.0

v0.23.1

27 Jan 16:34

Choose a tag to compare

Fixed

  • Hex color alpha preservation in string output: Colors with alpha now output hex8 format (#RRGGBBAA) when converted to string, preserving the alpha channel instead of losing it

What's Changed

Full Changelog: v0.23.0...v0.23.1

v0.23.0

27 Jan 15:30

Choose a tag to compare

What's Changed

Full Changelog: v0.21.0...v0.23.0