@herb-tools/formatter 0.4.0
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 +59 -0
- package/bin/herb-formatter +3 -0
- package/dist/herb-formatter.js +9070 -0
- package/dist/herb-formatter.js.map +1 -0
- package/dist/index.cjs +3215 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.js +3211 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/types/cli.d.ts +5 -0
- package/dist/types/formatter.d.ts +16 -0
- package/dist/types/herb-formatter.d.ts +2 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/options.d.ts +22 -0
- package/dist/types/printer.d.ts +55 -0
- package/package.json +47 -0
- package/src/cli.ts +70 -0
- package/src/formatter.ts +36 -0
- package/src/herb-formatter.ts +6 -0
- package/src/index.ts +5 -0
- package/src/options.ts +34 -0
- package/src/printer.ts +635 -0
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Herb Formatter <Badge type="info" text="coming soon" />
|
|
2
|
+
|
|
3
|
+
**Package:** [`@herb-tools/formatter`](https://www.npmjs.com/package/@herb-tools/formatter)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Auto-formatter for HTML+ERB templates with intelligent indentation, line wrapping, and ERB-aware pretty-printing.
|
|
8
|
+
|
|
9
|
+
Perfect for format-on-save in editors and formatting verification in CI/CD pipelines. Transforms templates into consistently formatted, readable code while preserving all functionality.
|
|
10
|
+
|
|
11
|
+
### Installation
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
:::code-group
|
|
15
|
+
```shell [npm]
|
|
16
|
+
npm add @herb-tools/formatter
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```shell [pnpm]
|
|
20
|
+
pnpm add @herb-tools/formatter
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```shell [yarn]
|
|
24
|
+
yarn add @herb-tools/formatter
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
```shell [bun]
|
|
28
|
+
bun add @herb-tools/formatter
|
|
29
|
+
```
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
### Usage
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
#### Format a file
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
# relative path
|
|
39
|
+
herb-formatter templates/index.html.erb
|
|
40
|
+
|
|
41
|
+
# absolute path
|
|
42
|
+
herb-formatter /full/path/to/template.html.erb
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Format from stdin
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
cat template.html.erb | herb-formatter
|
|
49
|
+
# or explicitly use "-" for stdin
|
|
50
|
+
herb-formatter - < template.html.erb
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
<!-- #### Configuration Options -->
|
|
54
|
+
|
|
55
|
+
<!-- TODO -->
|
|
56
|
+
|
|
57
|
+
<!-- #### CLI Usage -->
|
|
58
|
+
|
|
59
|
+
<!-- TODO -->
|