designsource 0.5.0 → 0.6.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 +14 -9
- package/dist/index.js +799 -149
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
The command line for a [DS source](https://designsource.app) design system. Five things it does:
|
|
8
8
|
|
|
9
|
-
- **`add`** — add the UI kit to the React app you already have: your theme in its global stylesheet, the 61 components and the libraries they import, with Tailwind v4, the `@/` alias and the shadcn config set up first when the app lacks them. Run it again to pull updates.
|
|
9
|
+
- **`add`** — add the UI kit to the React app you already have: your theme in its global stylesheet, the 61 components and the libraries they import, with Tailwind v4, the `@/` alias and the shadcn config set up first when the app lacks them, plus a `/design-system` section showing them. Run it again to pull updates.
|
|
10
10
|
- **`connect`** — connect your coding apps to the design system: saves the project token once, privately, on this computer, and writes each app's MCP settings in the project with no token in them. Claude Code, Cursor, VS Code, Codex and Gemini CLI.
|
|
11
11
|
- **`integrate`** — add the design system to the app you already have: a `design-system/` folder with your tokens as CSS variables, a prompt that tells your coding agent how to wire them in, and the component kit as reference. Vue, Svelte, Angular or plain CSS.
|
|
12
|
-
- **`create`** — start a new Next.js project from it: tokens, all 61 components, the
|
|
12
|
+
- **`create`** — start a new Next.js project from it: tokens, all 61 components, a front page on `/` and the design system under `/design-system` (components, blocks, sample pages and your mockup page), running after `pnpm install && pnpm dev`.
|
|
13
13
|
- **`mcp`** — serve the design system to your coding agent over MCP: tokens, every component's source, your mockup page and a step-by-step integration guide, read on demand instead of pasted, and a tool that adds the UI kit to your app for you. Claude Code, Cursor, Codex — any client that speaks MCP over stdio.
|
|
14
14
|
|
|
15
15
|
```sh
|
|
@@ -39,7 +39,7 @@ Works the same with `pnpm dlx designsource …`, `yarn dlx designsource …` and
|
|
|
39
39
|
## `add` — the UI kit in the app you have
|
|
40
40
|
|
|
41
41
|
```sh
|
|
42
|
-
npx designsource add [names…] [--all] [--yes] [--force] [--skip-install] [--token <project token>] [--api <origin>]
|
|
42
|
+
npx designsource add [names…] [--all] [--yes] [--force] [--skip-install] [--no-blocks] [--token <project token>] [--api <origin>]
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
Run it in your React app's folder. It writes your theme into the app's global stylesheet, the kit's components under the app's `components/ui` and the `cn` helper in `lib/utils.ts`, then installs the libraries those components import with the package manager the app already uses (pnpm, npm, yarn or bun). Every setup step it takes is named in one line as it runs.
|
|
@@ -49,7 +49,9 @@ Run it in your React app's folder. It writes your theme into the app's global st
|
|
|
49
49
|
Pick some…
|
|
50
50
|
Adding theme… ✓
|
|
51
51
|
Adding 61 components… ✓
|
|
52
|
+
Adding the /design-system section… ✓
|
|
52
53
|
Installing libraries… ✓
|
|
54
|
+
Your design system: /design-system
|
|
53
55
|
Done. Your components now use "my-system" from designsource.app.
|
|
54
56
|
Run it again any time to pull updates.
|
|
55
57
|
```
|
|
@@ -62,6 +64,8 @@ Run it again any time to pull updates.
|
|
|
62
64
|
- **Reruns** refresh the theme and every component `add` wrote before; `add <names…>` adds more, and `--all` adds everything. A component file carries a `// designsource: <name> <hash>` first line, which is how a rerun tells a file you edited from one it can update. Edited files are kept by default (Enter on "Keep your edits to …?") and named at the end; `--force` replaces them.
|
|
63
65
|
- **Files designsource did not write**, such as stock shadcn components, are replaced only on a yes ("Replace N existing components with your design system's?") or with `--force`; a no changes nothing. Without a terminal, or with `--yes`, no question is asked: all components on a first run, your edits kept, and the run stops naming any such file unless `--force` is given.
|
|
64
66
|
- **`--skip-install`** writes the files and prints the install command instead of running it. A failed install leaves the files in place and says which command finishes it.
|
|
67
|
+
- **The `/design-system` section** comes with the full kit: a first run answered All, `--all`, `--yes` or a run outside a terminal, or a bare rerun in an app that already has every component. It is your design system inside your app: the component gallery, the 34 blocks, the sample pages and your mockup page, each on its own route, with its own copy of your theme and its own light/dark switch, so your app's theme rules do not reach it. In a Next.js app (App Router) it is a route folder, `app/design-system/` (or `src/app/design-system/`), drawn over your app's own header and footer; its pieces go under `components/design-system/` and `components/blocks/`. In a Vite app it is its own page, `/design-system.html` beside `index.html`, with its own stylesheet, and `add` lists it among `vite.config`'s build inputs so `vite build` builds it (a config it cannot edit safely is left alone and the lines to add are printed; a custom `base` or `root` is not handled). `add <names…>` and Pick some write no section and say so in one line; in an app that already has it they leave it as it is. A Pages Router app gets one line and no section. When a library the section needs is in your app at another major, the section is skipped with a line saying why. Section files are stamped like components, so reruns refresh them and keep your edits; its JSON data is written fresh every run.
|
|
68
|
+
- **`--no-blocks`** writes the section without its blocks and installs none of the libraries only they need; the section then has no Blocks menu. After that, blocks follow what is on disk: a rerun does not add back blocks a `--no-blocks` run skipped, and `--no-blocks` on an app that has them leaves them as they are and says how many (`Left 34 blocks in place; --no-blocks does not remove them.`).
|
|
65
69
|
|
|
66
70
|
## `connect` — your coding apps, connected
|
|
67
71
|
|
|
@@ -129,7 +133,7 @@ Writes `design-system/` into the folder (default: the current one). For Vue, Sve
|
|
|
129
133
|
npx designsource create [folder] [--token <project token>] [--api <origin>] [--force]
|
|
130
134
|
```
|
|
131
135
|
|
|
132
|
-
Writes a runnable Next.js app into a new or empty folder (default `my-design-system`): Tailwind v4 with the shadcn theme CSS built from your tokens, 61 UI components under `components/ui`,
|
|
136
|
+
Writes a runnable Next.js app into a new or empty folder (default `my-design-system`): Tailwind v4 with the shadcn theme CSS built from your tokens, 61 UI components under `components/ui`, a front page on `/`, and the design system under `/design-system`: the component gallery (`/design-system/components`), the blocks (`/design-system/blocks`, one page each at `/design-system/blocks/<id>`), the sample pages and your mockup page (`/design-system/custom`); light and dark via `next-themes`. Next steps print in the dialect of the runner you used (`pnpm`, `npm`, `yarn` or `bun`); a pnpm run pins `packageManager`.
|
|
133
137
|
|
|
134
138
|
<p align="center">
|
|
135
139
|
<img src="https://designsource.app/designsource/starter-dark-home.png" alt="Generated Next.js starter, home page, dark" width="49%">
|
|
@@ -209,9 +213,9 @@ The workbench's Connect an agent dialog hands out the `connect` command and the
|
|
|
209
213
|
| `get_integration_guide` | The steps: wire the tokens, bring in the components, migrate existing styles, document. |
|
|
210
214
|
| `list_blocks` | The 34 ready-made page layouts (login, signup, sidebars, a dashboard, chart sets) with the components and files of each. |
|
|
211
215
|
| `get_block_source` | Every file of one block, headed by the path it takes under `components/blocks/`. |
|
|
212
|
-
| `add_ui_kit` | Adds the UI kit to the React app in the project folder: the theme, the components and their libraries, with the same setup as `add
|
|
216
|
+
| `add_ui_kit` | Adds the UI kit to the React app in the project folder: the theme, the components and their libraries, with the same setup as `add`, and the `/design-system` section when it adds every component. Optional `components`, `replace_existing` (for files designsource did not write) and `no_blocks` (the section without its blocks, as `--no-blocks`). |
|
|
213
217
|
|
|
214
|
-
New in 0.4.0: `list_blocks` and `get_block_source`, the page layouts built from the components
|
|
218
|
+
New in 0.4.0: `list_blocks` and `get_block_source`, the page layouts built from the components; `integrate` drops them under `design-system/reference/blocks/`. Against an older server the two tools answer that the server sent no blocks. New in 0.6.0: `add_ui_kit` writes the `/design-system` section as `add` does, and takes `no_blocks`.
|
|
215
219
|
|
|
216
220
|
The tools read the design system, and `add_ui_kit` adds its UI kit to the React app in the project folder (with `--project`, the folder `connect` saved for it: the one the client started in or under, else the only saved one, and it refuses with a line telling the agent to run `connect` there when it cannot tell; with `--token` alone, the folder the client started in; it never overwrites a component you edited, only replaces other existing files when told to, and your client asks before running it; the install it runs keeps the project token out of its environment and its output off the protocol stream); nothing an agent does here changes the design system itself. The project is fetched on the first tool call and refreshed every 60 seconds, so a Save in the workbench shows on the next call. Like every export, it needs the project's account on Pro; on the free plan every tool answers with one line saying so.
|
|
217
221
|
|
|
@@ -227,6 +231,7 @@ The tools read the design system, and `add_ui_kit` adds its UI kit to the React
|
|
|
227
231
|
| `--forget` | `connect` only. Remove this folder's saved token from this computer. |
|
|
228
232
|
| `--project` | `mcp`: the saved project whose token to use. `connect --forget`: which project, when several are connected to the folder. |
|
|
229
233
|
| `--skip-install` | `add` only. Write the files, print the install command. |
|
|
234
|
+
| `--no-blocks` | `add` only. The `/design-system` section without its blocks and their libraries; blocks already written stay. |
|
|
230
235
|
| `--framework` | `integrate` only. Skip the picker: `vue`, `svelte`, `angular` or `css`. |
|
|
231
236
|
| `--token` | The project token, or set `DS_SYNC_TOKEN` for scripts. Else the one `connect` saved for this folder; asked hidden when there is none. |
|
|
232
237
|
| `--api` | API origin. Default `https://designsource.app`; point it at a self-hosted instance. |
|
|
@@ -262,11 +267,11 @@ For the MCP server, add it to Claude Code with `claude mcp add designsource -e D
|
|
|
262
267
|
By the maintainer, through GitHub Actions with npm trusted publishing: no npm token exists anywhere; npm accepts the release because GitHub vouches for the repository and workflow that built it. Nothing publishes on an ordinary push or merge. (npm attaches a provenance attestation only when the source repository is public, so while this one is private the releases carry none.)
|
|
263
268
|
|
|
264
269
|
1. Bump the version in `package.json` (`pnpm version patch|minor` here) and merge to `main`. Every publish needs a bump.
|
|
265
|
-
2. Rehearse, optionally: Actions → "Release designsource" → Run workflow
|
|
266
|
-
3. Tag the merge commit `designsource@<version>` and push the tag:
|
|
270
|
+
2. Rehearse, optionally: Actions → "Release designsource" → Run workflow. A manual run installs, builds, tests and packs, and never publishes, from any branch.
|
|
271
|
+
3. Tag the merge commit on `main` `designsource@<version>` and push the tag (a tag on any other commit stops the run):
|
|
267
272
|
|
|
268
273
|
```sh
|
|
269
|
-
git tag designsource@0.
|
|
274
|
+
git tag designsource@0.6.1 && git push origin designsource@0.6.1
|
|
270
275
|
```
|
|
271
276
|
|
|
272
277
|
The workflow (`.github/workflows/release-designsource.yml`) refuses a tag that does not match `package.json`, runs the tests (which build `dist/` first), publishes, then installs the published version from npm and runs `--help` against it.
|