dithercharts 0.1.2 → 0.1.4
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 +3 -3
- package/assets/logo.png +0 -0
- package/dist/cli.js +11 -2
- package/dist/config.js +1 -1
- package/dist/logo.js +12 -0
- package/package.json +2 -2
- package/assets/cli-banner-on-white.png +0 -0
- package/assets/cli-banner.png +0 -0
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
<img src="./assets/logo.png" alt="DitherCharts" width="176">
|
|
2
2
|
|
|
3
3
|
# dithercharts
|
|
4
4
|
|
|
5
|
-
The CLI for [DitherCharts](https://dithercharts.
|
|
5
|
+
The CLI for [DitherCharts](https://dithercharts.com), dithered chart components for React. It copies chart source into your React app, so you own and can edit every line.
|
|
6
6
|
|
|
7
7
|
You need a DitherCharts Pro subscription, Node 20 or later, and a React 19 app with TypeScript. Tailwind and shadcn/ui are optional.
|
|
8
8
|
|
|
@@ -36,4 +36,4 @@ Files land in `src/components/dithercharts/` (or `components/dithercharts/` with
|
|
|
36
36
|
|
|
37
37
|
In CI, set `DITHERCHARTS_API_KEY` instead of running `login`.
|
|
38
38
|
|
|
39
|
-
Full docs: https://dithercharts.
|
|
39
|
+
Full docs: https://dithercharts.com/docs/installation
|
package/assets/logo.png
ADDED
|
Binary file
|
package/dist/cli.js
CHANGED
|
@@ -10,6 +10,7 @@ import { add } from "./commands/add.js";
|
|
|
10
10
|
import { list } from "./commands/list.js";
|
|
11
11
|
import { baseUrl, DEFAULT_BASE_URL } from "./config.js";
|
|
12
12
|
import { CliError } from "./errors.js";
|
|
13
|
+
import { LOGO } from "./logo.js";
|
|
13
14
|
import { askOverwrite, confirmDir, interactive } from "./prompt.js";
|
|
14
15
|
const HELP = `Usage: dithercharts <command>
|
|
15
16
|
|
|
@@ -29,6 +30,10 @@ Environment:
|
|
|
29
30
|
DITHERCHARTS_API_KEY Use this key instead of the saved login (CI)
|
|
30
31
|
DITHERCHARTS_URL Server to use (default ${DEFAULT_BASE_URL})`;
|
|
31
32
|
const version = () => JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
|
|
33
|
+
function welcome() {
|
|
34
|
+
const side = { 4: "Welcome to DitherCharts", 5: `v${version()} · dithered charts for React` };
|
|
35
|
+
return LOGO.split("\n").map((line, i) => (side[i] ? `${line.padEnd(20)}${side[i]}` : line)).join("\n");
|
|
36
|
+
}
|
|
32
37
|
function runCommand(cmd, cwd) {
|
|
33
38
|
const result = spawnSync(cmd[0], cmd.slice(1), { cwd, stdio: "inherit", shell: process.platform === "win32" });
|
|
34
39
|
if (result.status !== 0)
|
|
@@ -61,9 +66,13 @@ export async function main(argv, io) {
|
|
|
61
66
|
io.log(version());
|
|
62
67
|
return 0;
|
|
63
68
|
}
|
|
64
|
-
if (values.help
|
|
69
|
+
if (values.help) {
|
|
65
70
|
io.log(HELP);
|
|
66
|
-
return
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
if (!command) {
|
|
74
|
+
io.log(`${welcome()}\n\n${HELP}`);
|
|
75
|
+
return 0;
|
|
67
76
|
}
|
|
68
77
|
const base = baseUrl(io.env);
|
|
69
78
|
const path = authPath(io.env);
|
package/dist/config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const DEFAULT_BASE_URL = "https://dithercharts.
|
|
1
|
+
export const DEFAULT_BASE_URL = "https://dithercharts.com";
|
|
2
2
|
/** The server, without a trailing slash. DITHERCHARTS_URL overrides the default. */
|
|
3
3
|
export const baseUrl = (env) => (env.DITHERCHARTS_URL || DEFAULT_BASE_URL).replace(/\/+$/, "");
|
package/dist/logo.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// The DitherCharts mark on a classic Mac, drawn with half-block characters.
|
|
2
|
+
export const LOGO = `▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
|
|
3
|
+
█ ███████████▀█ █
|
|
4
|
+
█ ████████▀▄ ▄█ █
|
|
5
|
+
█ ████▀▀█▄▀▄▀▄█ █
|
|
6
|
+
█ ██▀▄▀▄ ▄▀▄▀▄█ █
|
|
7
|
+
█ █▄▀▄▀▄▀▄▀▄▀▄█ █
|
|
8
|
+
█ █▄▀▄▀▄▀▄▀▄▀▄█ █
|
|
9
|
+
█ ▀▀▀▀▀▀▀▀▀▀▀▀▀ █
|
|
10
|
+
█ ▄▄ ▀▀▀▀▀ █
|
|
11
|
+
▀█▀▀▀▀▀▀▀▀▀▀▀▀▀█▀
|
|
12
|
+
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dithercharts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Install DitherCharts Pro charts into your React app.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dithercharts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"shadcn-ui",
|
|
11
11
|
"cli"
|
|
12
12
|
],
|
|
13
|
-
"homepage": "https://dithercharts.
|
|
13
|
+
"homepage": "https://dithercharts.com/docs/installation",
|
|
14
14
|
"type": "module",
|
|
15
15
|
"bin": {
|
|
16
16
|
"dithercharts": "dist/bin.js"
|
|
Binary file
|
package/assets/cli-banner.png
DELETED
|
Binary file
|