@svgsketch/cli 0.1.3 → 0.2.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.
Files changed (2) hide show
  1. package/README.md +20 -0
  2. package/package.json +3 -2
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
 
@@ -33,3 +37,19 @@ svgsketch codegen icon.svgs -f react -o Icon.tsx --name Icon --typescript
33
37
  # Generate CSS+SVG markup
34
38
  svgsketch codegen design.svgs -f css -o design-snippet.svg
35
39
  ```
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.1.3",
3
+ "version": "0.2.1",
4
4
  "private": false,
5
- "description": "CLI tool for rendering and validating SVGSketch documents",
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",