@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.
Files changed (2) hide show
  1. package/README.md +34 -32
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,12 +1,18 @@
1
1
  # @sparkletree/cli
2
2
 
3
- `sparkletree add` — copy SparkleTree component source into your repo, in the
4
- shadcn/ui style. No install needed:
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 writes `provider` if
26
- you do not have it.
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` | The `SparkletreeProvider` wrapper, reading your env vars. |
33
- | `hero` | Streaming hero: headline, body, art. |
34
- | `cta` | Streaming call-to-action. |
35
- | `copy-card` | The copy-card creative. |
36
- | `product-card` | Product creative with price and CTA. |
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 copies require Tailwind CSS for their default classes. Swap them freely
39
- they are yours.
44
+ The default classes use Tailwind CSS. Restyle or restructure however you like
45
+ the files are yours.
40
46
 
41
- ## What "yours" means, and the one thing it does not include
47
+ ## Your copies survive protocol changes
42
48
 
43
- Copied components are your code: we cannot patch them, deprecate them, or know
44
- what they look like a year from now. So they are **wire-ignorant by
45
- construction** no event names, no protocol versions, no transports, no
46
- endpoints, no timing constants. A CI test enforces this per component.
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
- Everything that speaks the wire stays in
49
- [`@sparkletree/react`](https://www.npmjs.com/package/@sparkletree/react) and
50
- [`@sparkletree/core`](https://www.npmjs.com/package/@sparkletree/core), which
51
- the copies import from. That is what buys the property that makes copy-paste
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
- ## Choose one distribution, not both
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/…`. Doing both gives you two Heroes
64
- with the same name and a confusing diff.
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/)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkletree/cli",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "sparkletree — add SparkleTree components to your project.",
5
5
  "license": "MIT",
6
6
  "type": "module",