@sparkletree/cli 0.1.0 → 0.1.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.
- package/README.md +34 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
# @sparkletree/cli
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
shadcn/ui
|
|
3
|
+
Copy SparkleTree component source into your project, in the same distribution
|
|
4
|
+
style as [shadcn/ui](https://ui.shadcn.com/). No install needed:
|
|
5
5
|
|
|
6
6
|
```bash
|
|
7
7
|
npx @sparkletree/cli add hero cta
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
+
Each component is written into your repo as plain React + Tailwind source that
|
|
11
|
+
you own and can edit freely. The copies talk to SparkleTree through
|
|
12
|
+
[`@sparkletree/react`](https://www.npmjs.com/package/@sparkletree/react) and
|
|
13
|
+
[`@sparkletree/core`](https://www.npmjs.com/package/@sparkletree/core), which
|
|
14
|
+
they import like any other dependency.
|
|
15
|
+
|
|
10
16
|
## Commands
|
|
11
17
|
|
|
12
18
|
```
|
|
@@ -15,54 +21,50 @@ sparkletree list
|
|
|
15
21
|
sparkletree help
|
|
16
22
|
```
|
|
17
23
|
|
|
18
|
-
| Option | |
|
|
24
|
+
| Option | What it does |
|
|
19
25
|
|---|---|
|
|
20
26
|
| `--dir <path>` | Where components are written. Default `components`. |
|
|
21
27
|
| `--cwd <path>` | Project root. Default: current directory. |
|
|
22
28
|
| `--force` | Overwrite files that already exist. |
|
|
23
29
|
| `--dry-run` | Show what would happen; write nothing. |
|
|
24
30
|
|
|
25
|
-
Dependencies are resolved for you — asking for `hero` also
|
|
26
|
-
you
|
|
31
|
+
Dependencies between components are resolved for you — asking for `hero` also
|
|
32
|
+
writes `provider` if you don't have it yet.
|
|
27
33
|
|
|
28
34
|
## Components
|
|
29
35
|
|
|
30
|
-
| | |
|
|
36
|
+
| Name | What you get |
|
|
31
37
|
|---|---|
|
|
32
|
-
| `provider` |
|
|
33
|
-
| `hero` |
|
|
34
|
-
| `cta` |
|
|
35
|
-
| `copy-card` |
|
|
36
|
-
| `product-card` |
|
|
38
|
+
| `provider` | `SparkletreeProvider` wired to your environment variables. |
|
|
39
|
+
| `hero` | A hero section with streaming headline, body, and artwork. |
|
|
40
|
+
| `cta` | A call-to-action with a streaming label. |
|
|
41
|
+
| `copy-card` | A text card. |
|
|
42
|
+
| `product-card` | A product card with price and call-to-action. |
|
|
37
43
|
|
|
38
|
-
The
|
|
39
|
-
|
|
44
|
+
The default classes use Tailwind CSS. Restyle or restructure however you like —
|
|
45
|
+
the files are yours.
|
|
40
46
|
|
|
41
|
-
##
|
|
47
|
+
## Your copies survive protocol changes
|
|
42
48
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
The copied files contain only markup and presentation — no endpoints, event
|
|
50
|
+
formats, or timing constants. Everything that talks to SparkleTree's servers
|
|
51
|
+
lives in `@sparkletree/react` and `@sparkletree/core`. When the protocol
|
|
52
|
+
evolves, you update those packages through npm like any other dependency, and
|
|
53
|
+
your copied components keep working unchanged.
|
|
47
54
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
distribution safe: **a protocol change is a version bump, never a migration
|
|
53
|
-
guide.**
|
|
54
|
-
|
|
55
|
-
It also means the adaptation mark is not in the copied source. It renders
|
|
56
|
-
inside `StreamText`, in npm, and deleting it from your copy is not possible
|
|
57
|
-
because it was never there. That is deliberate — see rule 4 in the
|
|
58
|
-
[SDK README](https://gitlab.com/sparkletree/sparkletree-sdk/-/blob/main/README.md).
|
|
55
|
+
One consequence worth knowing: the small mark that labels AI-adapted text is
|
|
56
|
+
rendered by the npm package (`StreamText`), not by your copied source. Readers
|
|
57
|
+
can always tell adapted text from authored text, regardless of how the copies
|
|
58
|
+
are edited.
|
|
59
59
|
|
|
60
|
-
##
|
|
60
|
+
## Pick one distribution style
|
|
61
61
|
|
|
62
62
|
Either import components from `@sparkletree/react`, or copy them with this CLI
|
|
63
|
-
and import from `./components/sparkletree/…`.
|
|
64
|
-
|
|
63
|
+
and import from `./components/sparkletree/…`. Mixing both leaves you with two
|
|
64
|
+
components of the same name.
|
|
65
65
|
|
|
66
66
|
## Requirements
|
|
67
67
|
|
|
68
68
|
Node >= 18. ESM only.
|
|
69
|
+
|
|
70
|
+
Full documentation: [docs.sparkletree.io](https://docs.sparkletree.io/developers/sdk/cli/)
|