Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TypeScript types for the tailwind.config.js file #7891

Merged
merged 9 commits into from
Mar 22, 2022
Merged

Commits on Mar 21, 2022

  1. add generate-types script

    This script will generate the full list of core plugins, which will
    allow you to get code completion for the `corePlugins` section.
    
    It will also generate all the colors (and deprecated colors) which is
    used in multiple places in the config.
    RobinMalfait committed Mar 21, 2022
    Configuration menu
    Copy the full SHA
    db5fe42 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    72f354b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e2278f1 View commit details
    Browse the repository at this point in the history
  4. add types to package.json

    - Updated the files to make sure that the types are being published
    - Add a `types` section in the `package.json`, otherwise your editor by
      default will look for the `DefinitelyTyped` types which got me really
      confused for a second.
    - Added some scripts to make sure that the generation of types happens
      when needed (before tests and before building). This way you never
      ever have to think about generating them when working on Tailwind CSS
      internals.
    RobinMalfait committed Mar 21, 2022
    Configuration menu
    Copy the full SHA
    6ea3347 View commit details
    Browse the repository at this point in the history
  5. re-export types top-level

    Having a `colors.d.ts` next to the `colors.js` file allows us to type
    the `colors.js` file and your editor will pickup the types from
    `colors.d.ts`.
    RobinMalfait committed Mar 21, 2022
    Configuration menu
    Copy the full SHA
    98c5aa8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    c1b0b6a View commit details
    Browse the repository at this point in the history
  7. update changelog

    RobinMalfait committed Mar 21, 2022
    Configuration menu
    Copy the full SHA
    e1e674f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    cfd3b9c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    9796edb View commit details
    Browse the repository at this point in the history