4个版本 (破坏性)
0.22.0 | 2024年4月15日 |
---|---|
0.21.0 | 2023年12月23日 |
0.20.0 | 2023年10月16日 |
0.19.0 | 2023年10月9日 |
#465 in Web编程
每月36次下载
165KB
6K SLoC
RustyWind

安装
通过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
或
您可以使用dockerized版本
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<尾wind生成的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类。
它还会删除它找到的任何重复类。
依赖项
~19–31MB
~575K SLoC