tailwindest icon indicating copy to clipboard operation
tailwindest copied to clipboard

Tailwind classname coverage test

Open jbs-marcus opened this issue 5 months ago • 4 comments

Description

This adds a test (currently failing) that takes the class names presented in the tailwind docs and ensures that they all have a place in the Tailwindest style definition.

examples of issues found with this being implemented (unless I just couldn't find where to put them):

  • "zinc" color does not exist
  • start/end class names do not exist
  • gridAutoCols takes gridTemplateColumns class names

The change set adds a new script generate:coverage, which generates packages/tailwindest/__tests__/TailwindTypes.out.ts. The generated file is a huge (*1) list of (almost *2) every documented class name in tailwind. The test classname.coverage.test.ts is a compile time test, which creates a map with every class name mapped to a Tailwindest property. The test does not check if there are extra class names allowed that don't exist (*3) (*4)

*1: I think this should probably be split up, but also I also think it makes it easier to find errors in a huge list like this. *2: transform-gpu not present, as it is only mentioned in text. There might be more *3: translate-1 does not exist in tailwind *4: but as tailwind updates, it will show changes if things get removed

I hope this is helpful. I really appreciate your work.

Type of Change

  • [ ] Bug Fix
  • [ ] Enhancement
  • [ ] Breaking API Changes
  • [ ] Refactor
  • [ ] Documentation
  • [x] Other (please describe)

Checklist

  • [x] I have verified this change is not present in other open pull requests
  • [x] Existing issues have been referenced (where applicable)
  • [x] Functionality is documented
  • [x] All code style checks pass
  • [ ] All new and existing tests pass

jbs-marcus avatar Sep 25 '24 03:09 jbs-marcus