@milesroxas/create-design-hub 0.9.0 → 0.11.0
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/index.mjs +1 -1
- package/package.json +2 -2
- package/template/.env.example +0 -15
- package/template/AGENTS.md +16 -13
- package/template/README.md +2 -1
- package/template/_gitignore +2 -2
- package/template/package.json +3 -0
- package/template/prototypes/sample-list/index.tsx +3 -2
- package/template/tsconfig.json +1 -1
- package/template/.claude/launch.json +0 -18
- package/template/api/review.ts +0 -5
- package/template/proxy.ts +0 -4
- package/template/vercel.json +0 -49
package/index.mjs
CHANGED
|
@@ -79,7 +79,7 @@ const errors = validate(values);
|
|
|
79
79
|
if (Object.keys(errors).length) fail(Object.values(errors).join(' '), { errors });
|
|
80
80
|
const { path, visibility = 'none', link, track = [] } = values;
|
|
81
81
|
const name = basename(path);
|
|
82
|
-
// dev claims the folder's port on its first start; bootstrap is only for its flags (TypeSafe,
|
|
82
|
+
// dev claims the folder's port on its first start; bootstrap is only for its flags (TypeSafe, Conductor).
|
|
83
83
|
const next =
|
|
84
84
|
values['no-install'] && track.length
|
|
85
85
|
? `pnpm --dir "${path}" install, then pnpm --dir "${path}" exec design-hub ${tracksArgs(values).join(' ')}`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milesroxas/create-design-hub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Create a Design Hub project: the thin folder of prototypes, kit materials and docs that installs the @milesroxas/design-hub package. Runs as `npm create @milesroxas/design-hub`.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
],
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@biomejs/biome": "2.6.3",
|
|
35
|
-
"@milesroxas/design-hub": "0.
|
|
35
|
+
"@milesroxas/design-hub": "0.11.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"check": "biome check --config-path ../design-hub/configs/biome .",
|
package/template/.env.example
CHANGED
|
@@ -2,26 +2,11 @@
|
|
|
2
2
|
# machine at the time. Never commit .env.
|
|
3
3
|
PORT=
|
|
4
4
|
|
|
5
|
-
# The gate for the deployed prototypes (proxy.ts). Each person signs in with
|
|
6
|
-
# their own one-time link; this secret signs their session cookie. Set it in the
|
|
7
|
-
# Vercel project's Environment Variables for Production and Preview; `pnpm
|
|
8
|
-
# bootstrap --vercel <project>` does it. Never commit it, never send it.
|
|
9
|
-
# GATE_SECRET: 32+ random bytes, base64 or hex (openssl rand -base64 32).
|
|
10
|
-
# Replacing it signs everyone out.
|
|
11
|
-
GATE_SECRET=
|
|
12
|
-
|
|
13
5
|
# Optional: TypeSafe's Jev checks (the fidelity guard, the pre-flight, comment
|
|
14
6
|
# triage, the skill hint). Set by `pnpm bootstrap --typesafe-key <key>`. Only this
|
|
15
7
|
# file turns it on, never a key in the shell. Absent, every Jev question is skipped.
|
|
16
8
|
TYPESAFE_API_KEY=
|
|
17
9
|
|
|
18
|
-
# Optional: the review store (comments and people) on the deployed site.
|
|
19
|
-
# `pnpm bootstrap --vercel <project> --review` adds Upstash Redis through the
|
|
20
|
-
# Vercel Marketplace and copies these two here, so `pnpm comments` and
|
|
21
|
-
# `pnpm people` reach the same store. Absent, they use the local dev store.
|
|
22
|
-
KV_REST_API_URL=
|
|
23
|
-
KV_REST_API_TOKEN=
|
|
24
|
-
|
|
25
10
|
# Optional: `pnpm fixtures-pull` reads real content from the website's CMS.
|
|
26
11
|
# Fill only the platform's lines. Read-only access is enough.
|
|
27
12
|
# Webflow: a site token with the cms:read scope.
|
package/template/AGENTS.md
CHANGED
|
@@ -47,9 +47,11 @@ pnpm guide <feature> # the feature's walkthrough, docs/spri
|
|
|
47
47
|
pnpm export <slug> # brand artboards to exports/<slug>/: PNG for posts, PDF for slides and print (miles-brand)
|
|
48
48
|
pnpm check # TypeScript and Biome; must pass before you report done
|
|
49
49
|
pnpm fix # Biome format and safe fixes
|
|
50
|
+
pnpm project link --studio <s> --client <c> --project <p> # put the project in a client of a studio, once (miles-deploy)
|
|
50
51
|
pnpm preflight # every check a share link needs (miles-deploy)
|
|
51
|
-
pnpm
|
|
52
|
-
pnpm
|
|
52
|
+
pnpm share # preflight, build, upload into the studio, print the address (miles-deploy)
|
|
53
|
+
pnpm people add --name <n> --team <t> # a person's own sign-in link, on the client's address (miles-deploy)
|
|
54
|
+
pnpm signin # Vercel sign-in as a link for the user to click, for the studio commands (miles-deploy)
|
|
53
55
|
pnpm comments pull # review comments into docs/sprints/<feature>/comments.md (miles-review)
|
|
54
56
|
pnpm fixtures-pull <slug> --collection <id> --map key=path # real fixtures from the CMS: Webflow, Payload, WordPress, or --from a JSON file (miles-get-hostile)
|
|
55
57
|
pnpm commands # every command, with its flags, as JSON
|
|
@@ -67,7 +69,7 @@ DESIGN.md PRODUCT.md the design system's named rules (Brand for collateral)
|
|
|
67
69
|
exports/ exported collateral, gitignored; rebuilt from the prototype any time
|
|
68
70
|
.design-hub/project.json the tracks and website platform (pnpm tracks set rewrites it)
|
|
69
71
|
.design-hub/checks.json the Jev thresholds (design-hub calibrate --write rewrites it)
|
|
70
|
-
|
|
72
|
+
.design-hub/studio.json the studio, client and project this project is shared into (pnpm project link writes it); committed, no secret
|
|
71
73
|
```
|
|
72
74
|
|
|
73
75
|
Each track's sample is the reference for its conventions: `prototypes/sample-list/` for product, `prototypes/sample-page/` for website, `prototypes/sample-social/` for brand. Setup keeps only the samples of the project's tracks; delete one, with its `docs/sprints/` folder, once its track has a feature of its own.
|
|
@@ -84,13 +86,14 @@ The README's `## States` table lists every state the prototype holds and how to
|
|
|
84
86
|
|
|
85
87
|
## Who sees a prototype
|
|
86
88
|
|
|
87
|
-
- A new prototype is **Internal**: only Studio can open it. A Studio person marks it **Client-facing** with the switch beside it on the hub's index (no command reads or sets it); a Client's index lists only client-facing prototypes. Say so when you hand a new one over. A switch flipped under `pnpm dev` writes this machine's store only; the
|
|
88
|
-
- Everything in `prototypes/<slug>/` (code, README, styles, fixtures, images) ships only to people who may see that prototype. The
|
|
89
|
+
- A new prototype is **Internal**: only Studio can open it. A Studio person marks it **Client-facing** with the switch beside it on the hub's index (no command reads or sets it); a Client's index lists only client-facing prototypes. Say so when you hand a new one over. A switch flipped under `pnpm dev` writes this machine's store only; the studio keeps its own.
|
|
90
|
+
- Everything in `prototypes/<slug>/` (code, README, styles, fixtures, images) ships only to people who may see that prototype. The studio refuses its page and files to a Client while it is internal.
|
|
89
91
|
- Never reach into another prototype's files (an import, a CSS `@import` or `url()`, a `new URL`): the build refuses it, naming both. No web worker in a prototype either: the build refuses it (a worker in `kit/` that uses no prototype's files is fine). Run `pnpm build` before you share: it checks more than `pnpm dev` does. Never put shared code directly in `prototypes/` or in a folder there without a README: the build refuses it; shared code belongs in `kit/`. Write styles in plain CSS (or `.pcss`): Sass, Less and Stylus are refused in prototypes and in `kit/`, in `pnpm dev` and `pnpm build`, because their own imports resolve where no check sees them. The build also fails when a file outside a prototype's folder is one of that prototype's files whole (the same bytes, a `data:` URI of it, or its whole text as a string), however it got there; it does not look for part of a file, so shared lines and rules build. A `new URL` whose path is built at run time is not seen until its content lands outside the folder.
|
|
90
92
|
- A prototype's small images and SVGs are files of their own, never `data:` URIs, so the site can refuse them to a Client while the prototype is internal.
|
|
91
93
|
- `kit/` is shared with every signed-in person, clients included: nothing client-secret goes there, and nothing in it may point into a prototype's folder (the build refuses it). A link from one prototype's page to another's is fine.
|
|
94
|
+
- A dial is **Internal** too: a client's Controls panel has only the View tools until a dial is marked client-facing. Mark one in code with `client(...)` from `@kit/dials` only when the user asks for clients to have it; otherwise leave it, and Studio marks it with the eye beside its row in the Controls panel, which overrules the code on that site. Never mark fixtures, roles or scenarios: they are how the studio tests. An internal dial's name, range and default are still in the page's code a client's browser loads, so a dial's name never says what a client must not read. A client reads an internal dial's default, so the default is the value to present.
|
|
92
95
|
- Walkthrough text (`docs/sprints/<feature>/guide.md`) and feature names go to every signed-in person, clients included, whether or not the feature's prototypes are client-facing: a walkthrough must not name or describe internal work until the client may see it.
|
|
93
|
-
- `
|
|
96
|
+
- `invite`, `api`, `_gate`, `_p`, `assets`, `guide`, `index.html` and `favicon.svg` are the hub's paths: a prototype may not be named any of them (`pnpm new` refuses them).
|
|
94
97
|
|
|
95
98
|
## A feature
|
|
96
99
|
|
|
@@ -103,13 +106,13 @@ One slug in two places: `docs/sprints/<feature>/` and the `feature:` line of eve
|
|
|
103
106
|
| Import | What |
|
|
104
107
|
| --- | --- |
|
|
105
108
|
| `@kit/shell` | `BRAND`, `PRODUCT` (nav, workspace, user), `SITE` (nav, footer): the one place the chrome is written. |
|
|
106
|
-
| `@kit/AppShell`, `@kit/SiteShell` | The disposable shells. Mount the dialog, sheet and toast hosts and the View dials. `PageHead({ title, desc, back, actions })`. |
|
|
107
|
-
| `@kit/Space` | `<Space title lede width
|
|
108
|
-
| `@kit/Artboard` | `<Board title lede>` holding `<Artboard format name>`s: collateral at real pixel size, scaled to fit on screen, written to files by `pnpm export`. `FORMATS` lists the sizes. |
|
|
109
|
+
| `@kit/AppShell`, `@kit/SiteShell` | The disposable shells. Mount the dialog, sheet and toast hosts and the View dials (theme, reduce motion, speed). A prototype never mounts `ViewTools` itself. `PageHead({ title, desc, back, actions })`. |
|
|
110
|
+
| `@kit/Space` | `<Space title lede width tools?>`: the low-gravity canvas. `tools` narrows the View panel to what changes something here: `['theme']` when nothing moves, `['motion']` when there is one theme, `false` for neither. |
|
|
111
|
+
| `@kit/Artboard` | `<Board title lede>` holding `<Artboard format name>`s: collateral at real pixel size, scaled to fit on screen, written to files by `pnpm export`. `FORMATS` lists the sizes. A board has no View panel and is held to the light look it exports in: no motion, no theme styles, no `ViewTools`; a dark version is a `tone` dial. |
|
|
109
112
|
| `@kit/ui` | `Button`, `Chevron`, `Segmented`, `Badge`, `Checkbox`, `useMenu`, `Select`, `openDialog`, `confirmDialog`, `openSheet`, `toast()`, `notInPrototype(what)`. Card, table and empty-state classes in `ui.css`. |
|
|
110
113
|
| `@kit/fixtures` | `fixtureSets({ real, missing }, { max, text })` returns `{ real, longest, empty, max, missing }`; `SET_NAMES` for the dial. |
|
|
111
|
-
| `@kit/Variants` | `<Variants options={{ Quiet, Editorial }}>`: the picker. Keys 1-N, arrows, R; `?v=N`. |
|
|
112
|
-
| `@kit/dials` | `useDials(name, config, { hints })` for values JS reads; `<DialVars name config target?>` writes CSS variables without re-rendering. Every dial carries a hint. |
|
|
114
|
+
| `@kit/Variants` | `<Variants options={{ Quiet, Editorial }}>`: the picker. Keys 1-N, arrows, R; `?v=N`. A client gets only the variants Studio marks with the picker's eye, the first when none is marked, and no picker when there is one. |
|
|
115
|
+
| `@kit/dials` | `useDials(name, config, { hints })` for values JS reads; `<DialVars name config target?>` writes CSS variables without re-rendering. Every dial carries a hint. `client(dial)` around a dial, or a folder of them, marks it client-facing. |
|
|
113
116
|
| `@kit/Icon`, `@kit/icons` | `<Icon name size label?>`. Add a glyph in `kit/icons.ts`. |
|
|
114
117
|
| `@kit/prefs`, `@kit/hooks`, `@kit/format`, `@kit/motion` | Theme and motion preferences; `useHashRoute`, `useStoredState`; `fmtDate`, `plural`; `ease.*` and `spring.*`. |
|
|
115
118
|
| `@kit/tokens.css` | The design's tokens, light and `.dark-mode`. Loaded globally. |
|
|
@@ -144,8 +147,8 @@ The `miles-*` skills in `.claude/skills/` come from the `@milesroxas/design-hub`
|
|
|
144
147
|
| `miles-new-feature` | Starting a feature or a prototype: the folder, the README, `docs/sprints/<feature>/`. |
|
|
145
148
|
| `miles-get-hostile` | Writing `fixtures.json` or deciding what an edge case looks like. |
|
|
146
149
|
| `miles-paper-to-prototype` | Every Paper MCP read. Maps Paper output onto the kit's tokens and components. |
|
|
147
|
-
| `miles-deploy` |
|
|
148
|
-
| `miles-review` | Comments
|
|
150
|
+
| `miles-deploy` | Sharing or updating the link, the studio and its clients, linking this project to a client, signing in to Vercel, adding people and sending each their sign-in link, a new link for another device, how long access lasts, checking the work before any of those. The user never types these commands: run them and send any link they must click. |
|
|
151
|
+
| `miles-review` | Comments on the shared prototypes, and who may comment. |
|
|
149
152
|
| `miles-port` | Turning an approved prototype into production. |
|
|
150
153
|
| `miles-brand` | Brand collateral: social posts, slides, print; artboards, formats and export. |
|
|
151
154
|
| `miles-worktrees` | Worktrees, parallel agents, Conductor or any harness, and port collisions. |
|
package/template/README.md
CHANGED
|
@@ -17,8 +17,9 @@ Not a developer? The [guide](https://github.com/milesroxas/design-hub/tree/main/
|
|
|
17
17
|
| `kit/` | The project's materials: `tokens.css`, `shell.ts` (brand and navigation), `icons.ts`, the disposable `AppShell` and `SiteShell`. |
|
|
18
18
|
| `docs/sprints/<feature>/` | A feature's design doc, walkthrough, pulled comments and port report. |
|
|
19
19
|
| `DESIGN.md`, `PRODUCT.md` | The recorded design system and who the product is for. |
|
|
20
|
+
| `.design-hub/studio.json` | The studio, client and project this project is shared into. Written by `pnpm project link`, committed. |
|
|
20
21
|
| `.claude/` | Claude Code hooks and the `miles-*` skills (`pnpm skills` refreshes them from the package and adds any script they need). |
|
|
21
22
|
|
|
22
|
-
The rules for people and agents are in [AGENTS.md](AGENTS.md). Sharing a link, who can sign in and review comments: ask Claude to share
|
|
23
|
+
The rules for people and agents are in [AGENTS.md](AGENTS.md). The project is shared through a studio: one site that gives each client its own address, with every project of that client below it. Sharing a link, who can sign in and review comments: ask Claude to share or add someone (the `miles-deploy` and `miles-review` skills run every command), or `pnpm commands` for every command.
|
|
23
24
|
|
|
24
25
|
Design Hub upgrades itself when a Claude Code session starts here. To upgrade by hand: `pnpm exec design-hub upgrade`. To turn the automatic upgrade off: `DESIGN_HUB_AUTO_UPDATE=0` in `.env`.
|
package/template/_gitignore
CHANGED
|
@@ -12,7 +12,6 @@ dist/
|
|
|
12
12
|
|
|
13
13
|
# Exported collateral: files to hand over, rebuilt from the prototype any time
|
|
14
14
|
exports/
|
|
15
|
-
.vercel/
|
|
16
15
|
|
|
17
16
|
# Environment and secrets
|
|
18
17
|
.env
|
|
@@ -22,10 +21,11 @@ exports/
|
|
|
22
21
|
# Logs
|
|
23
22
|
*.log
|
|
24
23
|
|
|
25
|
-
# Local state: the Jev log and its labels, the dev review store. checks.json (the thresholds)
|
|
24
|
+
# Local state: the Jev log and its labels, the dev review store. checks.json (the thresholds), project.json (the tracks) and studio.json (the studio link) stay.
|
|
26
25
|
.design-hub/*
|
|
27
26
|
!.design-hub/checks.json
|
|
28
27
|
!.design-hub/project.json
|
|
28
|
+
!.design-hub/studio.json
|
|
29
29
|
|
|
30
30
|
# Obsidian per-machine state (docs/ is an Obsidian vault)
|
|
31
31
|
docs/.obsidian/workspace*.json
|
package/template/package.json
CHANGED
|
@@ -20,6 +20,9 @@
|
|
|
20
20
|
"preflight": "design-hub preflight",
|
|
21
21
|
"signin": "design-hub signin",
|
|
22
22
|
"share": "design-hub share",
|
|
23
|
+
"project": "design-hub project",
|
|
24
|
+
"studio": "design-hub studio",
|
|
25
|
+
"client": "design-hub client",
|
|
23
26
|
"comments": "design-hub comments",
|
|
24
27
|
"people": "design-hub people",
|
|
25
28
|
"calibrate": "design-hub calibrate",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppShell, PageHead } from '@kit/AppShell';
|
|
2
|
-
import { DialVars, useDials } from '@kit/dials';
|
|
2
|
+
import { client, DialVars, useDials } from '@kit/dials';
|
|
3
3
|
import { type FixtureSets, fixtureSets, SET_NAMES, type SetName } from '@kit/fixtures';
|
|
4
4
|
import { fmtDate, plural } from '@kit/format';
|
|
5
5
|
import { useHashRoute } from '@kit/hooks';
|
|
@@ -36,7 +36,8 @@ function ItemsPage() {
|
|
|
36
36
|
'Review',
|
|
37
37
|
{
|
|
38
38
|
fixtures: { type: 'select', options: [...SET_NAMES], default: 'real' },
|
|
39
|
-
|
|
39
|
+
// client(): a client gets this dial too. Every other dial is internal until Studio's eye marks it.
|
|
40
|
+
density: client({ type: 'select', options: ['comfortable', 'compact'], default: 'comfortable' }),
|
|
40
41
|
},
|
|
41
42
|
{
|
|
42
43
|
hints: {
|
package/template/tsconfig.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.0.1",
|
|
3
|
-
"configurations": [
|
|
4
|
-
{
|
|
5
|
-
"name": "prototypes",
|
|
6
|
-
"runtimeExecutable": "pnpm",
|
|
7
|
-
"runtimeArgs": [
|
|
8
|
-
"dev"
|
|
9
|
-
],
|
|
10
|
-
"port": 3105
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"name": "prototypes-attach",
|
|
14
|
-
"url": "http://localhost:3105",
|
|
15
|
-
"port": 3105
|
|
16
|
-
}
|
|
17
|
-
]
|
|
18
|
-
}
|
package/template/api/review.ts
DELETED
package/template/proxy.ts
DELETED
package/template/vercel.json
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
3
|
-
"framework": "vite",
|
|
4
|
-
"installCommand": "pnpm install --frozen-lockfile",
|
|
5
|
-
"buildCommand": "pnpm build",
|
|
6
|
-
"outputDirectory": "dist",
|
|
7
|
-
"proxy": {
|
|
8
|
-
"entrypoint": "proxy.ts",
|
|
9
|
-
"matcher": ["/(.*)"]
|
|
10
|
-
},
|
|
11
|
-
"rewrites": [
|
|
12
|
-
{
|
|
13
|
-
"source": "/((?!api/).*)",
|
|
14
|
-
"destination": "/index.html"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"headers": [
|
|
18
|
-
{
|
|
19
|
-
"source": "/(.*)",
|
|
20
|
-
"headers": [
|
|
21
|
-
{
|
|
22
|
-
"key": "X-Robots-Tag",
|
|
23
|
-
"value": "noindex, nofollow, noarchive"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"key": "X-Content-Type-Options",
|
|
27
|
-
"value": "nosniff"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"key": "X-Frame-Options",
|
|
31
|
-
"value": "DENY"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"key": "Referrer-Policy",
|
|
35
|
-
"value": "same-origin"
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"key": "Strict-Transport-Security",
|
|
39
|
-
"value": "max-age=31536000; includeSubDomains"
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
],
|
|
44
|
-
"functions": {
|
|
45
|
-
"api/review.ts": {
|
|
46
|
-
"maxDuration": 10
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|