@svgsketch/cli 0.1.2 → 0.2.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 +19 -0
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ npm install -g @svgsketch/cli
|
|
|
11
11
|
## Commands
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
+
svgsketch import <input.svg> -o <output.svgs>
|
|
14
15
|
svgsketch validate <input>
|
|
15
16
|
svgsketch render <input> -o <output.svg>
|
|
16
17
|
svgsketch info <input>
|
|
@@ -21,6 +22,9 @@ svgsketch codegen <input> -f <svg|react|vue|d3|css>
|
|
|
21
22
|
## Examples
|
|
22
23
|
|
|
23
24
|
```bash
|
|
25
|
+
# Import foreign SVG into the native document format
|
|
26
|
+
svgsketch import artwork.svg -o artwork.svgs
|
|
27
|
+
|
|
24
28
|
# Validate a document
|
|
25
29
|
svgsketch validate design.svgs
|
|
26
30
|
|
|
@@ -34,3 +38,18 @@ svgsketch codegen icon.svgs -f react -o Icon.tsx --name Icon --typescript
|
|
|
34
38
|
svgsketch codegen design.svgs -f css -o design-snippet.svg
|
|
35
39
|
```
|
|
36
40
|
|
|
41
|
+
## Render diagnostics
|
|
42
|
+
|
|
43
|
+
`import`, `render`, and `codegen` report machine-readable diagnostics as `warning:` / `error:` lines on stderr.
|
|
44
|
+
Import diagnostics also include their stable diagnostic code.
|
|
45
|
+
Malformed SVG never produces a partial `.svgs` file.
|
|
46
|
+
|
|
47
|
+
Render diagnostics include cases such as an unsupported shape type that was dropped from the output.
|
|
48
|
+
The output is still written and the exit status stays `0`.
|
|
49
|
+
Pass `--fail-on-warnings` to these commands to exit with a nonzero status when a warning is reported - useful in CI.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
svgsketch import artwork.svg -o artwork.svgs --fail-on-warnings
|
|
53
|
+
svgsketch render design.svgs -o out.svg --fail-on-warnings
|
|
54
|
+
svgsketch codegen design.svgs -f react -o Icon.tsx --fail-on-warnings
|
|
55
|
+
```
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svgsketch/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "CLI tool for
|
|
5
|
+
"description": "CLI tool for importing SVG and working with SVGSketch documents",
|
|
6
|
+
"type": "module",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"types": "dist/index.d.ts",
|
|
8
9
|
"license": "MIT",
|
|
@@ -39,8 +40,9 @@
|
|
|
39
40
|
"commander": "^13.1.0"
|
|
40
41
|
},
|
|
41
42
|
"devDependencies": {
|
|
43
|
+
"@types/node": "^26.1.1",
|
|
42
44
|
"tsup": "^8.5.0",
|
|
43
|
-
"typescript": "^
|
|
45
|
+
"typescript": "^6.0.3",
|
|
44
46
|
"vitest": "^4.0.18"
|
|
45
47
|
}
|
|
46
48
|
}
|