Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 2.66 KB

CONTRIBUTING.md

File metadata and controls

60 lines (39 loc) · 2.66 KB

Contributing guidelines

To submit patches or features:

  1. Fork the repo
  2. Run yarn install or npm install
  3. Make changes
  4. Build and run the CLI by yarn run-cli or npm run run-cli
  5. Submit your changes via GitHub Pull Requests.

Git commits style

Commit messages follows the Conventional Commits style.

Code style

The code style is enforced by prettier and eslint rules and there is a pre-commit hooks setup that automatically fixes any fixable violations.

Check style violations by running:

yarn run lint && yarn run check-formatting

Fix formatting issues by running:

yarn run fix-formatting

Adding new features from TailwindCSS

First thing is to look at their release notes, then update tailwindcss and the default config file by running:

yarn add -D tailwindcss@^RELEASE_VERSION
yarn run updateConfig

This will update src/cli/lib/defaultTailwindConfig.ts with the latest tailwind config and the CLI will use this file to automatically generate the following classes:

  • new pseudoclass variants e.g. hover:flex, focus:flex, md:flex etc.
  • new classnames that are based on new values in config. e.g. in tailwind v2 they added font sizing like text-7xl. the new config will have this value and thus will be generated by the CLI.

The above will update existing classes that got new values. For new classnames:

  • classes that their name cannot be customized should be added to src/cli/lib/non-configurable/CORRESPONDING_CATEGORY.ts. An example for these would be flex, block (non-configurable/layout) or capitalize (non-configurable/typography).

  • classes that their name can be customized (like bg-red-100, sizing classes w-6, etc.) each should be added to corresponding category method in ClassnamesGenerator class.

After doing this for new classes, the CLI would be compatible with new tailwind release.

Now src/index.ts can be updated with the new types by running:

yarn run generate