Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
3c1ce3d
add some module res code and tests
brandonthomas Mar 6, 2025
e98b619
updated module resolver
brandonthomas Mar 7, 2025
0d6f371
updates to module resolver
brandonthomas Mar 7, 2025
4265280
fixing tests
brandonthomas Mar 8, 2025
e005fac
fix tests
brandonthomas Mar 11, 2025
e1a324d
remove console log.
brandonthomas Mar 12, 2025
404bba0
adding comment
brandonthomas Mar 15, 2025
aced755
writing css var analysis tests and ensure failure
brandonthomas Mar 20, 2025
42c5a72
uncomment clean up
brandonthomas Mar 20, 2025
6c89604
update readme
brandonthomas Mar 21, 2025
e8cd1d6
adding ability to analyze css vars
brandonthomas Mar 21, 2025
3f98951
fixing import processing for string literals and property accessors
brandonthomas Mar 22, 2025
f3f981a
Fix duplication issues in token data
brandonthomas Mar 25, 2025
c745219
updating button analysis
brandonthomas Mar 25, 2025
999a716
update README
brandonthomas Mar 25, 2025
35e3a37
updating analysis with default format from tool and order
brandonthomas Mar 25, 2025
a46e617
add format to do
brandonthomas Mar 25, 2025
dd782ac
some debug comments
brandonthomas Mar 25, 2025
2328dba
Format json with prettier automatically.
brandonthomas Mar 27, 2025
cc96621
update to dos
brandonthomas Mar 27, 2025
af466dd
Update so we recurse through imports and template string spans
brandonthomas Mar 27, 2025
d3659b6
Adding spread handling
brandonthomas Mar 28, 2025
9bd14cc
fix spread analysis
brandonthomas Mar 28, 2025
e2c51ee
sorting json output for consistent results
brandonthomas Mar 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions packages/react-components/token-analyzer-preview/library/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@ A static analysis tool that scans your project's style files to track and analyz

## TODO

- we also need to ensure var analysis is done correctly after the refactor
- ~~**This is high pri now since we have components in source using this technique (see buttonstyles.styles.ts)** Handle very complex cases like `var(--optional-token, var(--semantic-token, ${some-other-var-with-a-string-or-fallback}))`. This other var might be in another package or file as well. Currently we won't handle this level of depth but we could do symbol extraction in the future if needed to resolve the chain fully. This will likely require changes in importAnalyzer.ts and structural changes in the data we return. On top of needing to find referenced symbols within an aliased template string literal, we might also then need to parse out var fallbacks within short hands. IE: `padding: 'var(--first, var(--second)) 10px` and ensure the ordering is correct.~~
- ~~Format output with prettier when we save to ensure stage lint doesn't fail.~~
- ~~make sure this works with shorthand spread~~
- Look at the path info again. Do we ever need it?
- Convert token member within the analysis output to an array so we can hold multiple tokens. The order should be the order or priority. [0] being the highest pri with the last item in the array the least prioritized.
- Duplicate entries in useButtonStyles.styles.ts for useRootDisabledStyles.base.nested:hover.color - we might need to test case this
- ~~We've added the ability to analyze spreads but there's an issue where we find the tokens and call them out but they get nuked somewhere before we return them. Need to trace that and fix.~~
- Add makeResetStyles specific tests in analyzer to ensure we process those correctly.
- ~~Button has some weird patterns in it where it uses makeResetStyles and then uses enums to pull in the styles, we might need to account for those as well.~~
- ~~Some property assignments can also be function calls, we need to process this scenario~~
- ~~`createCustomFocusIndicatorStyle` is a special function that is used throughout the library so we might be able to special case it~~
- if we have file imports we need to analyze those such as importing base styles
- we also need to ensure var analysis is done correctly after the refactor
- ~~if we have file imports we need to analyze those such as importing base styles~~
~~- Manage makeResetStyles (likely same as makeStyles)~~
- Button has some weird patterns in it where it uses makeResetStyles and then uses enums to pull in the styles, we might need to account for those as well.
- ~~what if we have multiple `makeStyles` calls merged, are we handling that correctly or just nuking the conflicts in our output?~~
- make sure this works with shorthand spread
- as we update the functionality, we should update our test cases to reflect the new functionality we support and ensure it works.
- ~~if we have functions we can't process (or other code for that matter), can we add that data into our report so we know to manually go deal with it?~~
- ~~assignedSlots in output to track which slots classes are applied to~~
- ~~Add variables full name to metadata (i.e. classNames.icon instead of just 'icon)~~
- Module importing
- ~~Module importing~~

## Features

Expand Down
Loading
Loading