ztd-charts-cli 0.4.1 → 0.5.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # ztd-charts-cli
2
2
 
3
- `ztd-charts`: the list of all 33 charts, JSON Schema, spec validation, SVG/PNG/HTML rendering, starter files, and chart suggestions from your data.
3
+ `ztd-charts`: the list of all 36 charts, JSON Schema, spec validation, SVG/PNG/HTML rendering, starter files, and chart suggestions from your data.
4
4
 
5
5
  [Website](https://charts.ztd.app) · [Gallery](https://charts.ztd.app/docs/) · [GitHub](https://github.com/Junhan2/ztd-charts)
6
6
 
@@ -21,7 +21,7 @@ Installed in a project (`npm i -D ztd-charts-cli`), the command is `ztd-charts`.
21
21
 
22
22
  Messages, chart text and number formats are English by default. Add `--locale ko` for Korean. `validate` exits with 1 when the spec has errors, so it works in CI.
23
23
 
24
- PNGs are drawn with resvg. Chart text asks for Pretendard first, then Apple SD Gothic Neo, Noto Sans KR or Malgun Gothic. Besides system fonts, the CLI loads the `pretendard` package when it is installed next to the CLI, every font in `ZTD_CHARTS_FONT_DIR`, and `--font path.otf`. For Korean text in PNGs, make one of those fonts available.
24
+ PNGs are drawn with resvg. Chart text asks for Pretendard first, then Apple SD Gothic Neo, Noto Sans KR or Malgun Gothic. The package ships Pretendard in the five weights charts use (SIL Open Font License 1.1, see `fonts/LICENSE.txt`), so PNG text, Korean included, renders even in a Linux container with no fonts installed. `--font path.otf` or `ZTD_CHARTS_FONT_DIR` loads your own fonts in place of the bundled ones.
25
25
 
26
26
  To use it from a program: `import { render, validate, suggest, listCharts } from "ztd-charts-cli"`.
27
27
 
package/dist/api.d.ts CHANGED
@@ -44,7 +44,7 @@ declare function getChartInfo(type: string, locale?: string): {
44
44
  schema: JSONSchema | null;
45
45
  example: ChartSpec;
46
46
  react: string;
47
- /** 이름 붙은 꼴: 예시 options 위에 덮어쓰는 옵션 (ztd-charts example <type> --variant <id>) */
47
+ /** 이름 붙은 꼴: 예시 options 위에 덮어쓰는 옵션, 범위 띠처럼 필드를 더하는 꼴은 encoding도 (ztd-charts example <type> --variant <id>) */
48
48
  variants: ztd_charts_spec.ChartVariant[];
49
49
  type: string;
50
50
  component: string;
package/dist/api.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  suggest,
17
17
  summarize,
18
18
  validate
19
- } from "./chunk-3NU4OUQK.js";
19
+ } from "./chunk-LVCEIXBR.js";
20
20
  export {
21
21
  CHARTS,
22
22
  FETCH_TIMEOUT_MS,
@@ -9,10 +9,10 @@ import { langOf, renderSpecToHTML, renderSpecToSVG, resolveSpecData } from "ztd-
9
9
 
10
10
  // src/messages.ts
11
11
  import { plural } from "ztd-charts/server";
12
- var VERSION = "0.4.1";
12
+ var VERSION = "0.5.0";
13
13
  var SCHEMA_URL = "https://unpkg.com/ztd-charts/schema/chart-spec.schema.json";
14
14
  var en = {
15
- help: `ztd-charts ${VERSION} CLI for 33 React chart types
15
+ help: `ztd-charts ${VERSION} CLI for 36 React chart types
16
16
 
17
17
  Usage
18
18
  ztd-charts list [--group proportion] [--level basic] [--json]
@@ -102,7 +102,7 @@ ${n} charts. Details: ztd-charts info <type>`,
102
102
  })
103
103
  };
104
104
  var ko = {
105
- help: `ztd-charts ${VERSION} React \uCC28\uD2B8 33\uC885\uC744 \uC704\uD55C CLI
105
+ help: `ztd-charts ${VERSION} React \uCC28\uD2B8 36\uC885\uC744 \uC704\uD55C CLI
106
106
 
107
107
  \uC0AC\uC6A9\uBC95
108
108
  ztd-charts list [--group \uBE44\uC728] [--level \uAE30\uBCF8] [--json]
@@ -260,7 +260,7 @@ function getChartInfo(type, locale) {
260
260
  schema: schemaForIn(def.type, lang),
261
261
  example: def.example,
262
262
  react: reactSnippet(def.example, { locale }),
263
- /** 이름 붙은 꼴: 예시 options 위에 덮어쓰는 옵션 (ztd-charts example <type> --variant <id>) */
263
+ /** 이름 붙은 꼴: 예시 options 위에 덮어쓰는 옵션, 범위 띠처럼 필드를 더하는 꼴은 encoding도 (ztd-charts example <type> --variant <id>) */
264
264
  variants: variantsIn(def.type, lang)
265
265
  };
266
266
  }
@@ -331,8 +331,7 @@ function findFonts(extra = []) {
331
331
  dirs.push(join(dirname(pkg), "dist/public/static"));
332
332
  } catch {
333
333
  }
334
- const here = dirname(fileURLToPath(import.meta.url));
335
- dirs.push(join(here, "../fonts"));
334
+ if (!extra.length && !process.env.ZTD_CHARTS_FONT_DIR) dirs.push(join(dirname(fileURLToPath(import.meta.url)), "../fonts"));
336
335
  for (const d of dirs) {
337
336
  if (!existsSync(d)) continue;
338
337
  for (const f of readdirSync(d)) if (/^Pretendard-(Regular|Medium|SemiBold|Bold|ExtraBold)\.(otf|ttf)$/i.test(f) || d === process.env.ZTD_CHARTS_FONT_DIR && /\.(otf|ttf|ttc)$/i.test(f)) out.push(join(d, f));
package/dist/cli.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  resolveType,
14
14
  suggest,
15
15
  validate
16
- } from "./chunk-3NU4OUQK.js";
16
+ } from "./chunk-LVCEIXBR.js";
17
17
 
18
18
  // src/cli.ts
19
19
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -0,0 +1,94 @@
1
+ Copyright (c) 2021, Kil Hyung-jin (https://github.com/orioncactus/pretendard),
2
+ with Reserved Font Name Pretendard.
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is copied below, and is also available with a FAQ at:
6
+ https://scripts.sil.org/OFL
7
+
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font creation
16
+ efforts of academic and linguistic communities, and to provide a free and
17
+ open framework in which fonts may be shared and improved in partnership
18
+ with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply
27
+ to any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software components as
38
+ distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to, deleting,
41
+ or substituting -- in part or in whole -- any of the components of the
42
+ Original Version, by changing formats or by porting the Font Software to a
43
+ new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
51
+ redistribute, and sell modified and unmodified copies of the Font
52
+ Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components,
55
+ in Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the corresponding
66
+ Copyright Holder. This restriction only applies to the primary font name as
67
+ presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created
79
+ using the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ztd-charts-cli",
3
- "version": "0.4.1",
3
+ "version": "0.5.0",
4
4
  "description": "ztd-charts CLI: list charts, get JSON Schemas, validate specs, render SVG/PNG/HTML, start a project, and get chart suggestions from data",
5
5
  "license": "MIT",
6
6
  "author": "Junhan2",
@@ -25,6 +25,7 @@
25
25
  },
26
26
  "files": [
27
27
  "dist",
28
+ "fonts",
28
29
  "README.md"
29
30
  ],
30
31
  "engines": {
@@ -34,7 +35,7 @@
34
35
  "@resvg/resvg-js": "^2.6.2",
35
36
  "react": "^19.3.1",
36
37
  "react-dom": "^19.3.1",
37
- "ztd-charts": "0.4.1"
38
+ "ztd-charts": "0.5.0"
38
39
  },
39
40
  "devDependencies": {
40
41
  "@types/react": "^19.2.0",
@@ -44,7 +45,7 @@
44
45
  "typescript": "5.9.3"
45
46
  },
46
47
  "scripts": {
47
- "build": "rm -rf dist && tsup",
48
+ "build": "rm -rf dist && tsup && node scripts/copy-fonts.mjs",
48
49
  "typecheck": "tsc --noEmit -p tsconfig.json"
49
50
  }
50
51
  }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Junhan2
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.