@herb-tools/formatter 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -5
- package/bin/herb-format +3 -0
- package/dist/herb-format.js +17254 -0
- package/dist/herb-format.js.map +1 -0
- package/dist/index.cjs +138 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +138 -35
- package/dist/index.esm.js.map +1 -1
- package/dist/types/printer.d.ts +1 -0
- package/package.json +4 -4
- package/src/cli.ts +170 -23
- package/src/printer.ts +158 -32
- package/bin/herb-formatter +0 -3
- package/dist/herb-formatter.js +0 -9070
- package/dist/herb-formatter.js.map +0 -1
- /package/dist/types/{herb-formatter.d.ts → herb-format.d.ts} +0 -0
- /package/src/{herb-formatter.ts → herb-format.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
# Herb Formatter <Badge type="
|
|
1
|
+
# Herb Formatter <Badge type="warning" text="experimental preview" />
|
|
2
2
|
|
|
3
3
|
**Package:** [`@herb-tools/formatter`](https://www.npmjs.com/package/@herb-tools/formatter)
|
|
4
4
|
|
|
5
|
+
> [!WARNING] Experimental Preview
|
|
6
|
+
> This formatter is currently in experimental preview. While it works for many common cases, it may potentially corrupt files in edge cases. Only use on files that can be restored via git or other version control systems.
|
|
7
|
+
|
|
5
8
|
---
|
|
6
9
|
|
|
7
10
|
Auto-formatter for HTML+ERB templates with intelligent indentation, line wrapping, and ERB-aware pretty-printing.
|
|
@@ -36,18 +39,18 @@ bun add @herb-tools/formatter
|
|
|
36
39
|
|
|
37
40
|
```bash
|
|
38
41
|
# relative path
|
|
39
|
-
herb-
|
|
42
|
+
herb-format templates/index.html.erb
|
|
40
43
|
|
|
41
44
|
# absolute path
|
|
42
|
-
herb-
|
|
45
|
+
herb-format /full/path/to/template.html.erb
|
|
43
46
|
```
|
|
44
47
|
|
|
45
48
|
#### Format from stdin
|
|
46
49
|
|
|
47
50
|
```bash
|
|
48
|
-
cat template.html.erb | herb-
|
|
51
|
+
cat template.html.erb | herb-format
|
|
49
52
|
# or explicitly use "-" for stdin
|
|
50
|
-
herb-
|
|
53
|
+
herb-format - < template.html.erb
|
|
51
54
|
```
|
|
52
55
|
|
|
53
56
|
<!-- #### Configuration Options -->
|
package/bin/herb-format
ADDED