Commit 3b5565d
authored
fix(createTokens): follow a {alias} reached through a segment path (#589)
* fix(createTokens): follow a {alias} reached through a segment path
The segment-path branch of resolve() assigned a terminal value to the
result without following a trailing {alias}, so a dotted-segment lookup
landing on an alias string returned the raw '{alias}' instead of its
resolved value. The leaf-value branch already re-resolved terminal
aliases; the segment branch now mirrors it, reusing the visited set so
circular detection still holds.
Surfaces through useTheme, which resolves theme colors through a
flat: true token table: a palette entry that is itself an alias,
referenced by a theme via a dotted alias, previously produced an
unresolved {alias} (dropped by the CSS brace guard, or leaked literally
to consumers reading theme.colors directly).
Ref #566 (Group A, item #1)
* test(createTokens): guard segment-path terminal alias resolution
Regression tests for the #566 fix: a {alias} reached through a dotted
segment lookup must be followed (single hop and multi-hop chain), and a
circular reference reached that way must be detected rather than leaking
a raw {alias}. All three fail against the pre-fix segment branch.1 parent 95d2d34 commit 3b5565d
3 files changed
Lines changed: 40 additions & 0 deletions
File tree
- .changeset
- packages/0/src/composables/createTokens
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1262 | 1293 | | |
1263 | 1294 | | |
1264 | 1295 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| |||
0 commit comments