@spiracss/html-cli 0.2.2 → 0.3.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 +20 -22
- package/dist/cli.js +66 -66
- package/dist/config-warnings.d.ts +1 -1
- package/dist/config-warnings.d.ts.map +1 -1
- package/dist/generator-core.d.ts +6 -7
- package/dist/generator-core.d.ts.map +1 -1
- package/dist/html-format.d.ts.map +1 -1
- package/dist/html-format.js +58 -58
- package/dist/html-lint.js +57 -57
- package/dist/index.js +66 -66
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
# @spiracss/html-cli
|
|
2
2
|
|
|
3
|
-
CLI
|
|
3
|
+
A CLI tool designed primarily for AI agents and automation scripts—generates SCSS from HTML, validates structure, and formats placeholders. The [VS Code extension](https://marketplace.visualstudio.com/items?itemName=spiracss.spiracss-html-to-scss) uses this package internally; for manual use, prefer the extension.
|
|
4
4
|
|
|
5
5
|
## About SpiraCSS
|
|
6
6
|
|
|
7
|
-
[SpiraCSS](https://spiracss.jp) is a CSS architecture
|
|
7
|
+
[SpiraCSS](https://spiracss.jp) is a CSS architecture based on one principle. The HTML structure determines how to write styles, eliminating the need for individual judgment. Designed for AI agents and tool-based validation.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
This CLI is designed to be used with the [SpiraCSS Design Principles](https://spiracss.jp/architecture/principles/).
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- Structural decisions can be derived from class names and HTML structure.
|
|
13
|
-
- `shared`/`interaction`/`rel` comment conventions can be treated as tool-verifiable contracts.
|
|
14
|
-
- SpiraCSS projects should place [`spiracss.config.js`](https://github.com/zetsubo-dev/spiracss/blob/master/docs_spira/en/tooling/spiracss-config.md) at the project root so that generation and validation follow the same policy.
|
|
15
|
-
- Download [spiracss-ai-doc.md](https://github.com/zetsubo-dev/spiracss/blob/master/docs_spira/ai/spiracss-ai-doc.md) and use it as a reference document for AI-assisted workflows.
|
|
16
|
-
|
|
17
|
-
This CLI provides the same SCSS starting point for both humans and AI.
|
|
11
|
+
→ [See how it works](https://spiracss.jp)
|
|
18
12
|
|
|
19
13
|
## Status
|
|
20
14
|
|
|
@@ -26,6 +20,10 @@ Beta release. Breaking changes may still occur.
|
|
|
26
20
|
|
|
27
21
|
## Install
|
|
28
22
|
|
|
23
|
+
```bash
|
|
24
|
+
yarn add -D @spiracss/html-cli
|
|
25
|
+
```
|
|
26
|
+
|
|
29
27
|
```bash
|
|
30
28
|
npm install -D @spiracss/html-cli
|
|
31
29
|
```
|
|
@@ -42,21 +40,23 @@ Use `--root` for a single component root. Use `--selection` for fragments.
|
|
|
42
40
|
|
|
43
41
|
```bash
|
|
44
42
|
# Generate SCSS from a component root (root mode)
|
|
45
|
-
cat file.html |
|
|
43
|
+
cat file.html | yarn spiracss-html-to-scss --root --stdin --base-dir src/pages
|
|
46
44
|
|
|
47
45
|
# Generate SCSS from fragments (selection mode)
|
|
48
|
-
cat fragment.html |
|
|
46
|
+
cat fragment.html | yarn spiracss-html-to-scss --selection --stdin --base-dir src/pages
|
|
49
47
|
|
|
50
48
|
# Lint a component root
|
|
51
|
-
cat file.html |
|
|
49
|
+
cat file.html | yarn spiracss-html-lint --root --stdin
|
|
52
50
|
|
|
53
51
|
# Lint fragments
|
|
54
|
-
cat fragment.html |
|
|
52
|
+
cat fragment.html | yarn spiracss-html-lint --selection --stdin
|
|
55
53
|
|
|
56
54
|
# Insert placeholders
|
|
57
|
-
cat file.html |
|
|
55
|
+
cat file.html | yarn spiracss-html-format --stdin
|
|
58
56
|
```
|
|
59
57
|
|
|
58
|
+
Note: If you use npm, replace `yarn` with `npx` or `npm exec`.
|
|
59
|
+
|
|
60
60
|
## Configuration
|
|
61
61
|
|
|
62
62
|
SpiraCSS tools share a common configuration file at the project root: `spiracss.config.js` (htmlFormat, selectorPolicy, generator options, naming).
|
|
@@ -85,14 +85,12 @@ Note: If your project is CommonJS (no `"type": "module"` in `package.json`), use
|
|
|
85
85
|
|
|
86
86
|
## Docs
|
|
87
87
|
|
|
88
|
-
- [
|
|
89
|
-
- [HTML
|
|
90
|
-
- [
|
|
91
|
-
- [Quickstart](https://github.com/zetsubo-dev/spiracss/blob/master/docs_spira/en/quickstart.md) | \[[JA](https://github.com/zetsubo-dev/spiracss/blob/master/docs_spira/ja/quickstart.md)\]
|
|
92
|
-
- [`spiracss.config.js` guide](https://github.com/zetsubo-dev/spiracss/blob/master/docs_spira/en/tooling/spiracss-config.md) | \[[JA](https://github.com/zetsubo-dev/spiracss/blob/master/docs_spira/ja/tooling/spiracss-config.md)\]
|
|
88
|
+
- [HTML CLI](https://spiracss.jp/tooling/html-cli/)
|
|
89
|
+
- [HTML to SCSS (VS Code)](https://spiracss.jp/tooling/html-to-scss/)
|
|
90
|
+
- [Configuration](https://spiracss.jp/configuration/)
|
|
93
91
|
|
|
94
92
|
## Related Tools
|
|
95
93
|
|
|
96
94
|
- [SpiraCSS Stylelint Plugin (npm)](https://www.npmjs.com/package/@spiracss/stylelint-plugin)
|
|
97
|
-
-
|
|
98
|
-
-
|
|
95
|
+
- SpiraCSS Comment Links ([VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=spiracss.spiracss-comment-links) / [Open VSX](https://open-vsx.org/extension/spiracss/spiracss-comment-links))
|
|
96
|
+
- SpiraCSS HTML to SCSS ([VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=spiracss.spiracss-html-to-scss) / [Open VSX](https://open-vsx.org/extension/spiracss/spiracss-html-to-scss))
|