1个不稳定版本

0.1.0 2024年4月12日

#14#vite

25 每月下载量
rustywind 中使用

Apache-2.0

150KB
5.5K SLoC

RustyWind Mean Bean CI npm版本 crates.io

安装

通过npm提供

yarn global add rustywind

npm install-g rustywind

从homebrew(mac和linux)安装

brewinstall avencera/tap/rustywind

从crates.io安装

cargoinstall rustywind

cargobinstall rustywind

从GitHub发布版安装

curl -LSfshttps://avencera.github.io/rustywind/install.sh | sh -s ----git avencera/rustywind

直接从GitHub下载发布版: github.com/avencera/rustywind/releases

您可以使用容器化版本

docker run--rm-v$PWD:/app avencera/rustywind:latest<rustywind参数>

用法

运行rustywind并将输出更新文件内容路径传递到终端

  • rustywind.

如果您想就地重新组织所有类并更改文件,请使用带有--write标志的运行

  • rustywind--write.

运行rustywind并使用路径和--dry-run来获取将更改的文件列表

  • rustywind--dry-run.

在您的STDIN上运行rustywind

  • echo"<FILE CONTENTS>" |rustywind--stdin

在CI中运行,如果找到未排序的类则退出错误

  • rustywind--check-formatted.

使用自定义排序器运行RustyWind。配置文件config_file.json应具有顶级条目sortOrder,它是一个数组,包含按您希望排序的顺序列出的类。

  • rustywind--config-file config_file.json

与tailwind prettier插件一起使用

  • rustywind--output-css-file<tailwind生成的CSS文件路径>

  • rustywind--vite-css<由vite生成的CSS的URL>

Usage: rustywind [OPTIONS] [PATH]...

Run rustywind with a path to get a list of files that will be changed
  rustywind . --dry-run

If you want to reorganize all classes in place, and change the files run with the `--write` flag
  rustywind --write .

To print only the file names that would be changed run with the `--check-formatted` flag
  rustywind --check-formatted .

If you want to run it on your STDIN, you can do:
  echo "<FILE CONTENTS>" | rustywind --stdin

Arguments:
  [PATH]...
          A file or directory to run on

Options:
      --stdin
          Uses stdin instead of a file or folder

      --write
          Changes the files in place with the reorganized classes

      --dry-run
          Prints out the new file content with the sorted classes to the terminal

      --check-formatted
          Checks if the files are already formatted, exits with 1 if not formatted

      --allow-duplicates
          When set, RustyWind will not delete duplicated classes

      --config-file <CONFIG_FILE>
          When set, RustyWind will use the config file to derive configurations. The config file current only supports json with one property sortOrder, e.g. { "sortOrder": ["class1", ...] }

      --output-css-file <OUTPUT_CSS_FILE>
          When set RustyWind will determine the sort order by the order the class appear in the the given css file

      --vite-css <VITE_CSS>
          When set RustyWind will determine the sort order by the order the class appear in the CSS file that vite generates.

          Please provide the full URL to the CSS file ex: `rustywind --vite-css "http://127.0.0.1:5173/src/assets/main.css" . --dry-run`

          Note: This option is experimental and may be removed in the future.

      --skip-ssl-verification
          When set, RustyWind will skip SSL verification for the vite_css option

      --ignored-files <IGNORED_FILES>
          When set, RustyWind will ignore this list of files

      --custom-regex <CUSTOM_REGEX>
          Uses a custom regex instead of default one

      --quiet
          Do not print log messages

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

What

Ryan Heybourn的 headwind vscode插件启发。这是一个CLI工具,可以遍历您的项目并排序所有Tailwind CSS类。

它还会删除任何找到的重复类。

依赖项

~16–26MB
~486K SLoC