Skip to content

feat: support dot-path notation in Story.set and Story.get#151

Merged
rohal12 merged 1 commit into
mainfrom
feat/dot-path-story-api
Apr 3, 2026
Merged

feat: support dot-path notation in Story.set and Story.get#151
rohal12 merged 1 commit into
mainfrom
feat/dot-path-story-api

Conversation

@rohal12

@rohal12 rohal12 commented Apr 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Story.set('alma.view', 'home') now sets the view property on the $alma object instead of creating a flat variable named "alma.view"
  • Story.get('alma.view') traverses nested properties, consistent with twee {$alma.view}
  • Works in both string and batch object forms, including transient (%) variables

Closes #150

Test plan

  • 15 new unit tests covering: nested get/set, deep paths, missing intermediates, array index access, transient dot-paths, batch form with mixed keys, error on non-object intermediate
  • All 1136 existing tests pass — zero regressions
  • tsc --noEmit clean

🤖 Generated with Claude Code

Story.set('alma.view', 'home') now sets the view property on the $alma
object instead of creating a flat variable named "alma.view". Similarly,
Story.get('alma.view') traverses nested properties. Both the string and
batch object forms support dot-paths, including transient (%) variables.

Closes #150

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

Release preview: merging this PR will publish v0.44.0 (minor bump from v0.43.7)

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.9% 2856 / 3666
🔵 Statements 76.8% 3116 / 4057
🔵 Functions 69.47% 519 / 747
🔵 Branches 74.09% 1579 / 2131
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/story-api.ts 45.1% 38.46% 31.25% 46.19% 76, 102-104, 239, 268-276, 284-368, 381-459, 475-492, 519-524, 551-586
Generated in workflow #234 for commit ec0b2f3 by the Vitest Coverage Report Action

@rohal12 rohal12 merged commit 0dc6999 into main Apr 3, 2026
5 checks passed
@rohal12 rohal12 deleted the feat/dot-path-story-api branch April 3, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Story.set should support dot-path notation for nested object properties

1 participant