Skip to content

Commit 94ceb7c

Browse files
stevekwon211claude
andcommitted
docs: present npm + cargo consistently across README and site
Follow-up to v0.34.0 — the Install section led with both runtimes but the Quick-start, CLI section, hero, and nav/footers still implied npm-only. - README: Quick start now leads with `cargo install slintcn`; CLI section notes cargo (core) vs npm (full adoption toolkit); maintainers note covers `cd cli && cargo publish`. - Landing hero command → `cargo slintcn add button` (+ no-Node subtext); crates.io link in nav + footer. - /create page + docs topnav: crates.io link alongside npm. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9c4bf8a commit 94ceb7c

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,15 @@ you copy into your repo and customize.
6363
# Run the visual showcase
6464
cd examples/showcase && cargo run
6565

66-
# Install components into your Slint project
66+
# Install components into your Slint project — cargo (no Node):
67+
cargo install slintcn
6768
cd your-slint-app
69+
slintcn init --base-color zinc
70+
slintcn add button card input dialog
71+
72+
# …or with npm, if you prefer:
6873
npx slintcn@latest init
6974
npx slintcn@latest add button card input dialog
70-
71-
# …or from a local checkout:
72-
node /path/to/slintcn/bin/slintcn.mjs init
73-
node /path/to/slintcn/bin/slintcn.mjs add button card input dialog
7475
```
7576

7677
## Philosophy
@@ -152,7 +153,8 @@ silently falling through to the default styling.
152153
## CLI & distribution
153154

154155
slintcn isn't a library you depend on — it's a **distribution system for
155-
copy-paste Slint code** (the shadcn model). The CLI:
156+
copy-paste Slint code** (the shadcn model). The CLI ships two ways — `slintcn`
157+
(after `cargo install slintcn`) or `npx slintcn` — over the same registry:
156158

157159
```bash
158160
slintcn init # create slintcn.json + install theme tokens
@@ -162,6 +164,11 @@ slintcn view dialog [--files] # an item's metadata, install order, and sour
162164
slintcn build -o dist/registry # emit a static registry (registry.json + r/*.json)
163165
```
164166

167+
> The **cargo** CLI (`cargo install slintcn`) covers the core path —
168+
> `init` / `add` / `list` / `view`, no Node required. The **npm** CLI
169+
> (`npx slintcn`) adds the full adoption toolkit (`diff`, `export`,
170+
> `build`, `--external-tokens`, `--import-map`, …) shown below.
171+
165172
**Config — `slintcn.json`** (created by `init`): `style` (which registry),
166173
`baseColor` (`neutral` · `zinc` · `slate` · `stone` — pick at init with
167174
`slintcn init --base-color zinc`), `outDir`/`themeDir`/`componentsDir`/`blocksDir`
@@ -181,8 +188,10 @@ slintcn add @acme/button # via registr
181188
against the same registry. The official registry is served at
182189
`https://stevekwon211.github.io/slintcn/r/`.
183190

184-
> **Maintainers:** publish to npm with `npm login && npm publish` (the package
185-
> ships `bin`, `registry`, `templates`, `schema`; `prepublishOnly` runs tests).
191+
> **Maintainers:** publish the npm package with `npm login && npm publish`
192+
> (ships `bin`, `registry`, `templates`, `schema`; `prepublishOnly` runs tests)
193+
> and the cargo CLI with `cd cli && cargo publish`. Keep both versions in lockstep
194+
> with `registry/default/registry.json`.
186195
187196
## Community registries
188197

scripts/build-docs.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ function topnav() {
8484
<a class="tn-link" href="../create.html">Create</a>
8585
<a class="tn-link" href="../demo.html">Playground</a>
8686
<a class="tn-link star-link" href="https://github.com/stevekwon211/slintcn" target="_blank" rel="noreferrer">GitHub <span data-stars></span></a>
87+
<a class="tn-link" href="https://crates.io/crates/slintcn">crates.io</a>
8788
<a class="tn-link" href="https://www.npmjs.com/package/slintcn">npm</a>
8889
</div></header>
8990
<div id="scrim"></div>`;

web/create.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
<a class="link" href="./docs/">Docs</a>
115115
<a class="link" href="./demo.html">Live demo</a>
116116
<a class="link" href="https://github.com/stevekwon211/slintcn" target="_blank" rel="noreferrer">GitHub</a>
117+
<a class="link" href="https://crates.io/crates/slintcn">crates.io</a>
117118
<a class="link" href="https://www.npmjs.com/package/slintcn">npm</a>
118119
</div>
119120
</nav>
@@ -164,6 +165,7 @@ <h3>Your install</h3>
164165
<span>slintcn — copy-paste Slint components.</span>
165166
<a href="./docs/">Docs</a>
166167
<a href="./docs/directory.html">Directory</a>
168+
<a href="https://crates.io/crates/slintcn">crates.io</a>
167169
<a href="https://www.npmjs.com/package/slintcn">npm</a>
168170
</div>
169171
</footer>

web/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
<a class="link" href="./create.html">Create</a>
109109
<a class="link" href="./demo.html">Live demo</a>
110110
<a class="link" href="https://github.com/stevekwon211/slintcn" target="_blank" rel="noreferrer">GitHub <span class="star-count" data-stars></span></a>
111+
<a class="link" href="https://crates.io/crates/slintcn">crates.io</a>
111112
<a class="link" href="https://www.npmjs.com/package/slintcn">npm</a>
112113
</div>
113114
</nav>
@@ -124,9 +125,10 @@ <h1><span class="grad">Copy-paste components<br>for Slint.</span></h1>
124125
<a class="btn btn-ghost" href="https://github.com/stevekwon211/slintcn" target="_blank" rel="noreferrer">Star on GitHub <span class="star-count" data-stars></span></a>
125126
</div>
126127
<div class="install">
127-
<span class="dollar">$</span><code id="cmd">npx slintcn@latest add button</code>
128+
<span class="dollar">$</span><code id="cmd">cargo slintcn add button</code>
128129
<button onclick="navigator.clipboard&amp;&amp;navigator.clipboard.writeText(document.getElementById('cmd').textContent)">copy</button>
129130
</div>
131+
<p style="margin-top:10px;font-size:13px;color:var(--subtle)">no Node — <code>cargo install slintcn</code> · or <code>npx slintcn add button</code></p>
130132
</div>
131133
</header>
132134

@@ -185,6 +187,7 @@ <h2>Three commands.</h2>
185187
<span class="spacer" style="flex:1"></span>
186188
<a href="./demo.html">Live demo</a>
187189
<a href="https://github.com/stevekwon211/slintcn">GitHub</a>
190+
<a href="https://crates.io/crates/slintcn">crates.io</a>
188191
<a href="https://www.npmjs.com/package/slintcn">npm</a>
189192
<span>MIT</span>
190193
</div>

0 commit comments

Comments
 (0)